Thanks for using Compiler Explorer
Sponsors
Jakt
C++
Ada
Algol68
Analysis
Android Java
Android Kotlin
Assembly
C
C3
Carbon
C with Coccinelle
C++ with Coccinelle
C++ (Circle)
CIRCT
Clean
CMake
CMakeScript
COBOL
C++ for OpenCL
MLIR
Cppx
Cppx-Blue
Cppx-Gold
Cpp2-cppfront
Crystal
C#
CUDA C++
D
Dart
Elixir
Erlang
Fortran
F#
GLSL
Go
Haskell
HLSL
Hook
Hylo
IL
ispc
Java
Julia
Kotlin
LLVM IR
LLVM MIR
Modula-2
Mojo
Nim
Numba
Nix
Objective-C
Objective-C++
OCaml
Odin
OpenCL C
Pascal
Pony
PTX
Python
Racket
Raku
Ruby
Rust
Sail
Snowball
Scala
Slang
Solidity
Spice
SPIR-V
Swift
LLVM TableGen
Toit
Triton
TypeScript Native
V
Vala
Visual Basic
Vyper
WASM
Zig
Javascript
GIMPLE
Ygen
sway
c source #1
Output
Compile to binary object
Link to binary
Execute the code
Intel asm syntax
Demangle identifiers
Verbose demangling
Filters
Unused labels
Library functions
Directives
Comments
Horizontal whitespace
Debug intrinsics
Compiler
6502 cc65 2.17
6502 cc65 2.18
6502 cc65 2.19
6502 cc65 trunk
ARM GCC 10.2.0 (linux)
ARM GCC 10.2.1 (none)
ARM GCC 10.3.0 (linux)
ARM GCC 10.3.1 (2021.07 none)
ARM GCC 10.3.1 (2021.10 none)
ARM GCC 10.5.0
ARM GCC 11.1.0 (linux)
ARM GCC 11.2.0 (linux)
ARM GCC 11.2.1 (none)
ARM GCC 11.3.0 (linux)
ARM GCC 11.4.0
ARM GCC 12.1.0 (linux)
ARM GCC 12.2.0 (linux)
ARM GCC 12.3.0
ARM GCC 12.4.0
ARM GCC 12.5.0
ARM GCC 13.1.0 (linux)
ARM GCC 13.2.0
ARM GCC 13.2.0 (unknown-eabi)
ARM GCC 13.3.0
ARM GCC 13.3.0 (unknown-eabi)
ARM GCC 13.4.0
ARM GCC 13.4.0 (unknown-eabi)
ARM GCC 14.1.0
ARM GCC 14.1.0 (unknown-eabi)
ARM GCC 14.2.0
ARM GCC 14.2.0 (unknown-eabi)
ARM GCC 14.3.0
ARM GCC 14.3.0 (unknown-eabi)
ARM GCC 15.1.0
ARM GCC 15.1.0 (unknown-eabi)
ARM GCC 15.2.0
ARM GCC 15.2.0 (unknown-eabi)
ARM GCC 4.5.4 (linux)
ARM GCC 4.6.4 (linux)
ARM GCC 5.4 (linux)
ARM GCC 5.4.1 (none)
ARM GCC 6.3.0 (linux)
ARM GCC 6.4.0 (linux)
ARM GCC 7.2.1 (none)
ARM GCC 7.3.0 (linux)
ARM GCC 7.5.0 (linux)
ARM GCC 8.2.0 (WinCE)
ARM GCC 8.2.0 (linux)
ARM GCC 8.3.1 (none)
ARM GCC 8.5.0 (linux)
ARM GCC 9.2.1 (none)
ARM GCC 9.3.0 (linux)
ARM GCC trunk (linux)
ARM msvc v19.0 (ex-WINE)
ARM msvc v19.10 (ex-WINE)
ARM msvc v19.14 (ex-WINE)
ARM64 GCC 10.2.0
ARM64 GCC 10.3.0
ARM64 GCC 10.4.0
ARM64 GCC 10.5.0
ARM64 GCC 11.1.0
ARM64 GCC 11.2.0
ARM64 GCC 11.3.0
ARM64 GCC 11.4.0
ARM64 GCC 12.1.0
ARM64 GCC 12.2.0
ARM64 GCC 12.3.0
ARM64 GCC 12.4.0
ARM64 GCC 12.5.0
ARM64 GCC 13.1.0
ARM64 GCC 13.2.0
ARM64 GCC 13.3.0
ARM64 GCC 13.4.0
ARM64 GCC 14.1.0
ARM64 GCC 14.2.0
ARM64 GCC 14.3.0
ARM64 GCC 15.1.0
ARM64 GCC 15.2.0
ARM64 GCC 4.9.4
ARM64 GCC 5.4
ARM64 GCC 5.5.0
ARM64 GCC 6.3
ARM64 GCC 6.4.0
ARM64 GCC 7.3.0
ARM64 GCC 7.5.0
ARM64 GCC 8.2.0
ARM64 GCC 8.5.0
ARM64 GCC 9.3.0
ARM64 GCC 9.4.0
ARM64 GCC 9.5.0
ARM64 GCC trunk
ARM64 Morello GCC 10.1.0 Alpha 1
ARM64 Morello GCC 10.1.2 Alpha 2
ARM64 msvc v19.14 (ex-WINE)
AVR gcc 10.3.0
AVR gcc 11.1.0
AVR gcc 12.1.0
AVR gcc 12.2.0
AVR gcc 12.3.0
AVR gcc 12.4.0
AVR gcc 12.5.0
AVR gcc 13.1.0
AVR gcc 13.2.0
AVR gcc 13.3.0
AVR gcc 13.4.0
AVR gcc 14.1.0
AVR gcc 14.2.0
AVR gcc 14.3.0
AVR gcc 15.1.0
AVR gcc 15.2.0
AVR gcc 4.5.4
AVR gcc 4.6.4
AVR gcc 5.4.0
AVR gcc 9.2.0
AVR gcc 9.3.0
Arduino Mega (1.8.9)
Arduino Uno (1.8.9)
BPF clang (trunk)
BPF clang 13.0.0
BPF clang 14.0.0
BPF clang 15.0.0
BPF clang 16.0.0
BPF clang 17.0.1
BPF clang 18.1.0
BPF clang 19.1.0
BPF clang 20.1.0
BPF clang 21.1.0
BPF gcc 13.1.0
BPF gcc 13.2.0
BPF gcc 13.3.0
BPF gcc 13.4.0
BPF gcc 14.1.0
BPF gcc 14.2.0
BPF gcc 14.3.0
BPF gcc 15.1.0
BPF gcc 15.2.0
BPF gcc trunk
C2Rust (master)
Chibicc 2020-12-07
FRC 2019
FRC 2020
FRC 2023
HPPA gcc 14.2.0
HPPA gcc 14.3.0
HPPA gcc 15.1.0
HPPA gcc 15.2.0
K1C gcc 7.4
K1C gcc 7.5
KVX ACB 4.1.0 (GCC 7.5.0)
KVX ACB 4.1.0-cd1 (GCC 7.5.0)
KVX ACB 4.10.0 (GCC 10.3.1)
KVX ACB 4.11.1 (GCC 10.3.1)
KVX ACB 4.12.0 (GCC 11.3.0)
KVX ACB 4.2.0 (GCC 7.5.0)
KVX ACB 4.3.0 (GCC 7.5.0)
KVX ACB 4.4.0 (GCC 7.5.0)
KVX ACB 4.6.0 (GCC 9.4.1)
KVX ACB 4.8.0 (GCC 9.4.1)
KVX ACB 4.9.0 (GCC 9.4.1)
KVX ACB 5.0.0 (GCC 12.2.1)
KVX ACB 5.2.0 (GCC 13.2.1)
LC3 (trunk)
M68K clang (trunk)
M68K gcc 13.1.0
M68K gcc 13.2.0
M68K gcc 13.3.0
M68K gcc 13.4.0
M68K gcc 14.1.0
M68K gcc 14.2.0
M68K gcc 14.3.0
M68K gcc 15.1.0
M68K gcc 15.2.0
MRISC32 gcc (trunk)
MSP430 gcc 12.1.0
MSP430 gcc 12.2.0
MSP430 gcc 12.3.0
MSP430 gcc 12.4.0
MSP430 gcc 12.5.0
MSP430 gcc 13.1.0
MSP430 gcc 13.2.0
MSP430 gcc 13.3.0
MSP430 gcc 13.4.0
MSP430 gcc 14.1.0
MSP430 gcc 14.2.0
MSP430 gcc 14.3.0
MSP430 gcc 15.1.0
MSP430 gcc 15.2.0
MSP430 gcc 4.5.3
MSP430 gcc 5.3.0
MSP430 gcc 6.2.1
MinGW clang 14.0.3
MinGW clang 14.0.6
MinGW clang 15.0.7
MinGW clang 16.0.0
MinGW clang 16.0.2
MinGW gcc 11.3.0
MinGW gcc 12.1.0
MinGW gcc 12.2.0
MinGW gcc 13.1.0
ORCA/C 2.1.0
ORCA/C 2.2.0
ORCA/C 2.2.1
POWER64 gcc 11.2.0
POWER64 gcc 12.1.0
POWER64 gcc 12.2.0
POWER64 gcc 12.3.0
POWER64 gcc 12.4.0
POWER64 gcc 12.5.0
POWER64 gcc 13.1.0
POWER64 gcc 13.2.0
POWER64 gcc 13.3.0
POWER64 gcc 13.4.0
POWER64 gcc 14.1.0
POWER64 gcc 14.2.0
POWER64 gcc 14.3.0
POWER64 gcc 15.1.0
POWER64 gcc 15.2.0
POWER64 gcc trunk
RISC-V (32-bits) gcc (trunk)
RISC-V (32-bits) gcc 10.2.0
RISC-V (32-bits) gcc 10.3.0
RISC-V (32-bits) gcc 11.2.0
RISC-V (32-bits) gcc 11.3.0
RISC-V (32-bits) gcc 11.4.0
RISC-V (32-bits) gcc 12.1.0
RISC-V (32-bits) gcc 12.2.0
RISC-V (32-bits) gcc 12.3.0
RISC-V (32-bits) gcc 12.4.0
RISC-V (32-bits) gcc 12.5.0
RISC-V (32-bits) gcc 13.1.0
RISC-V (32-bits) gcc 13.2.0
RISC-V (32-bits) gcc 13.3.0
RISC-V (32-bits) gcc 13.4.0
RISC-V (32-bits) gcc 14.1.0
RISC-V (32-bits) gcc 14.2.0
RISC-V (32-bits) gcc 14.3.0
RISC-V (32-bits) gcc 15.1.0
RISC-V (32-bits) gcc 15.2.0
RISC-V (32-bits) gcc 8.2.0
RISC-V (32-bits) gcc 8.5.0
RISC-V (32-bits) gcc 9.4.0
RISC-V (64-bits) gcc (trunk)
RISC-V (64-bits) gcc 10.2.0
RISC-V (64-bits) gcc 10.3.0
RISC-V (64-bits) gcc 11.2.0
RISC-V (64-bits) gcc 11.3.0
RISC-V (64-bits) gcc 11.4.0
RISC-V (64-bits) gcc 12.1.0
RISC-V (64-bits) gcc 12.2.0
RISC-V (64-bits) gcc 12.3.0
RISC-V (64-bits) gcc 12.4.0
RISC-V (64-bits) gcc 12.5.0
RISC-V (64-bits) gcc 13.1.0
RISC-V (64-bits) gcc 13.2.0
RISC-V (64-bits) gcc 13.3.0
RISC-V (64-bits) gcc 13.4.0
RISC-V (64-bits) gcc 14.1.0
RISC-V (64-bits) gcc 14.2.0
RISC-V (64-bits) gcc 14.3.0
RISC-V (64-bits) gcc 15.1.0
RISC-V (64-bits) gcc 15.2.0
RISC-V (64-bits) gcc 8.2.0
RISC-V (64-bits) gcc 8.5.0
RISC-V (64-bits) gcc 9.4.0
RISC-V rv32gc clang (trunk)
RISC-V rv32gc clang 10.0.0
RISC-V rv32gc clang 10.0.1
RISC-V rv32gc clang 11.0.0
RISC-V rv32gc clang 11.0.1
RISC-V rv32gc clang 12.0.0
RISC-V rv32gc clang 12.0.1
RISC-V rv32gc clang 13.0.0
RISC-V rv32gc clang 13.0.1
RISC-V rv32gc clang 14.0.0
RISC-V rv32gc clang 15.0.0
RISC-V rv32gc clang 16.0.0
RISC-V rv32gc clang 17.0.1
RISC-V rv32gc clang 18.1.0
RISC-V rv32gc clang 19.1.0
RISC-V rv32gc clang 20.1.0
RISC-V rv32gc clang 21.1.0
RISC-V rv32gc clang 9.0.0
RISC-V rv32gc clang 9.0.1
RISC-V rv64gc clang (trunk)
RISC-V rv64gc clang 10.0.0
RISC-V rv64gc clang 10.0.1
RISC-V rv64gc clang 11.0.0
RISC-V rv64gc clang 11.0.1
RISC-V rv64gc clang 12.0.0
RISC-V rv64gc clang 12.0.1
RISC-V rv64gc clang 13.0.0
RISC-V rv64gc clang 13.0.1
RISC-V rv64gc clang 14.0.0
RISC-V rv64gc clang 15.0.0
RISC-V rv64gc clang 16.0.0
RISC-V rv64gc clang 17.0.1
RISC-V rv64gc clang 18.1.0
RISC-V rv64gc clang 19.1.0
RISC-V rv64gc clang 20.1.0
RISC-V rv64gc clang 21.1.0
RISC-V rv64gc clang 9.0.0
RISC-V rv64gc clang 9.0.1
Raspbian Buster
Raspbian Stretch
SDCC 4.0.0
SDCC 4.1.0
SDCC 4.2.0
SDCC 4.3.0
SDCC 4.4.0
SDCC 4.5.0
SPARC LEON gcc 12.2.0
SPARC LEON gcc 12.3.0
SPARC LEON gcc 12.4.0
SPARC LEON gcc 12.5.0
SPARC LEON gcc 13.1.0
SPARC LEON gcc 13.2.0
SPARC LEON gcc 13.3.0
SPARC LEON gcc 13.4.0
SPARC LEON gcc 14.1.0
SPARC LEON gcc 14.2.0
SPARC LEON gcc 14.3.0
SPARC LEON gcc 15.1.0
SPARC LEON gcc 15.2.0
SPARC gcc 12.2.0
SPARC gcc 12.3.0
SPARC gcc 12.4.0
SPARC gcc 12.5.0
SPARC gcc 13.1.0
SPARC gcc 13.2.0
SPARC gcc 13.3.0
SPARC gcc 13.4.0
SPARC gcc 14.1.0
SPARC gcc 14.2.0
SPARC gcc 14.3.0
SPARC gcc 15.1.0
SPARC gcc 15.2.0
SPARC64 gcc 12.2.0
SPARC64 gcc 12.3.0
SPARC64 gcc 12.4.0
SPARC64 gcc 12.5.0
SPARC64 gcc 13.1.0
SPARC64 gcc 13.2.0
SPARC64 gcc 13.3.0
SPARC64 gcc 13.4.0
SPARC64 gcc 14.1.0
SPARC64 gcc 14.2.0
SPARC64 gcc 14.3.0
SPARC64 gcc 15.1.0
SPARC64 gcc 15.2.0
TCC (trunk)
TCC 0.9.27
TI C6x gcc 12.2.0
TI C6x gcc 12.3.0
TI C6x gcc 12.4.0
TI C6x gcc 12.5.0
TI C6x gcc 13.1.0
TI C6x gcc 13.2.0
TI C6x gcc 13.3.0
TI C6x gcc 13.4.0
TI C6x gcc 14.1.0
TI C6x gcc 14.2.0
TI C6x gcc 14.3.0
TI C6x gcc 15.1.0
TI C6x gcc 15.2.0
TI CL430 21.6.1
Tricore gcc 11.3.0 (EEESlab)
VAX gcc NetBSDELF 10.4.0
VAX gcc NetBSDELF 10.5.0 (Nov 15 03:50:22 2023)
VAX gcc NetBSDELF 12.4.0 (Apr 16 05:27 2025)
WebAssembly clang (trunk)
Xtensa ESP32 gcc 11.2.0 (2022r1)
Xtensa ESP32 gcc 12.2.0 (20230208)
Xtensa ESP32 gcc 14.2.0 (20241119)
Xtensa ESP32 gcc 8.2.0 (2019r2)
Xtensa ESP32 gcc 8.2.0 (2020r1)
Xtensa ESP32 gcc 8.2.0 (2020r2)
Xtensa ESP32 gcc 8.4.0 (2020r3)
Xtensa ESP32 gcc 8.4.0 (2021r1)
Xtensa ESP32 gcc 8.4.0 (2021r2)
Xtensa ESP32-S2 gcc 11.2.0 (2022r1)
Xtensa ESP32-S2 gcc 12.2.0 (20230208)
Xtensa ESP32-S2 gcc 14.2.0 (20241119)
Xtensa ESP32-S2 gcc 8.2.0 (2019r2)
Xtensa ESP32-S2 gcc 8.2.0 (2020r1)
Xtensa ESP32-S2 gcc 8.2.0 (2020r2)
Xtensa ESP32-S2 gcc 8.4.0 (2020r3)
Xtensa ESP32-S2 gcc 8.4.0 (2021r1)
Xtensa ESP32-S2 gcc 8.4.0 (2021r2)
Xtensa ESP32-S3 gcc 11.2.0 (2022r1)
Xtensa ESP32-S3 gcc 12.2.0 (20230208)
Xtensa ESP32-S3 gcc 14.2.0 (20241119)
Xtensa ESP32-S3 gcc 8.4.0 (2020r3)
Xtensa ESP32-S3 gcc 8.4.0 (2021r1)
Xtensa ESP32-S3 gcc 8.4.0 (2021r2)
arm64 msvc v19.20 VS16.0
arm64 msvc v19.21 VS16.1
arm64 msvc v19.22 VS16.2
arm64 msvc v19.23 VS16.3
arm64 msvc v19.24 VS16.4
arm64 msvc v19.25 VS16.5
arm64 msvc v19.27 VS16.7
arm64 msvc v19.28 VS16.8
arm64 msvc v19.28 VS16.9
arm64 msvc v19.29 VS16.10
arm64 msvc v19.29 VS16.11
arm64 msvc v19.30 VS17.0
arm64 msvc v19.31 VS17.1
arm64 msvc v19.32 VS17.2
arm64 msvc v19.33 VS17.3
arm64 msvc v19.34 VS17.4
arm64 msvc v19.35 VS17.5
arm64 msvc v19.36 VS17.6
arm64 msvc v19.37 VS17.7
arm64 msvc v19.38 VS17.8
arm64 msvc v19.39 VS17.9
arm64 msvc v19.40 VS17.10
arm64 msvc v19.41 VS17.11
arm64 msvc v19.42 VS17.12
arm64 msvc v19.43 VS17.13
arm64 msvc v19.latest
armv7-a clang (trunk)
armv7-a clang 10.0.0
armv7-a clang 10.0.1
armv7-a clang 11.0.0
armv7-a clang 11.0.1
armv7-a clang 12.0.0
armv7-a clang 12.0.1
armv7-a clang 13.0.0
armv7-a clang 13.0.1
armv7-a clang 14.0.0
armv7-a clang 15.0.0
armv7-a clang 16.0.0
armv7-a clang 17.0.1
armv7-a clang 18.1.0
armv7-a clang 19.1.0
armv7-a clang 20.1.0
armv7-a clang 21.1.0
armv7-a clang 9.0.0
armv7-a clang 9.0.1
armv8-a clang (all architectural features, trunk)
armv8-a clang (trunk)
armv8-a clang 10.0.0
armv8-a clang 10.0.1
armv8-a clang 11.0.0
armv8-a clang 11.0.1
armv8-a clang 12.0.0
armv8-a clang 12.0.1
armv8-a clang 13.0.0
armv8-a clang 13.0.1
armv8-a clang 14.0.0
armv8-a clang 15.0.0
armv8-a clang 16.0.0
armv8-a clang 17.0.1
armv8-a clang 18.1.0
armv8-a clang 19.1.0
armv8-a clang 20.1.0
armv8-a clang 21.1.0
armv8-a clang 9.0.0
armv8-a clang 9.0.1
clang 12 for DPU (rel 2023.2.0)
cproc-master
ez80-clang 15.0.0
ez80-clang 15.0.7
llvm-mos commander X16
llvm-mos commodore 64
llvm-mos mega65
llvm-mos nes-cnrom
llvm-mos nes-mmc1
llvm-mos nes-mmc3
llvm-mos nes-nrom
llvm-mos osi-c1p
loongarch64 gcc 12.2.0
loongarch64 gcc 12.3.0
loongarch64 gcc 12.4.0
loongarch64 gcc 12.5.0
loongarch64 gcc 13.1.0
loongarch64 gcc 13.2.0
loongarch64 gcc 13.3.0
loongarch64 gcc 13.4.0
loongarch64 gcc 14.1.0
loongarch64 gcc 14.2.0
loongarch64 gcc 14.3.0
loongarch64 gcc 15.1.0
loongarch64 gcc 15.2.0
mips (el) gcc 12.1.0
mips (el) gcc 12.2.0
mips (el) gcc 12.3.0
mips (el) gcc 12.4.0
mips (el) gcc 12.5.0
mips (el) gcc 13.1.0
mips (el) gcc 13.2.0
mips (el) gcc 13.3.0
mips (el) gcc 13.4.0
mips (el) gcc 14.1.0
mips (el) gcc 14.2.0
mips (el) gcc 14.3.0
mips (el) gcc 15.1.0
mips (el) gcc 15.2.0
mips (el) gcc 4.9.4
mips (el) gcc 5.4
mips (el) gcc 5.5.0
mips (el) gcc 9.5.0
mips clang 13.0.0
mips clang 14.0.0
mips clang 15.0.0
mips clang 16.0.0
mips clang 17.0.1
mips clang 18.1.0
mips clang 19.1.0
mips clang 20.1.0
mips clang 21.1.0
mips gcc 11.2.0
mips gcc 12.1.0
mips gcc 12.2.0
mips gcc 12.3.0
mips gcc 12.4.0
mips gcc 12.5.0
mips gcc 13.1.0
mips gcc 13.2.0
mips gcc 13.3.0
mips gcc 13.4.0
mips gcc 14.1.0
mips gcc 14.2.0
mips gcc 14.3.0
mips gcc 15.1.0
mips gcc 15.2.0
mips gcc 4.9.4
mips gcc 5.4
mips gcc 5.5.0
mips gcc 9.3.0 (codescape)
mips gcc 9.5.0
mips64 (el) gcc 12.1.0
mips64 (el) gcc 12.2.0
mips64 (el) gcc 12.3.0
mips64 (el) gcc 12.4.0
mips64 (el) gcc 12.5.0
mips64 (el) gcc 13.1.0
mips64 (el) gcc 13.2.0
mips64 (el) gcc 13.3.0
mips64 (el) gcc 13.4.0
mips64 (el) gcc 14.1.0
mips64 (el) gcc 14.2.0
mips64 (el) gcc 14.3.0
mips64 (el) gcc 15.1.0
mips64 (el) gcc 15.2.0
mips64 (el) gcc 4.9.4
mips64 (el) gcc 5.4.0
mips64 (el) gcc 5.5.0
mips64 (el) gcc 9.5.0
mips64 clang 13.0.0
mips64 clang 14.0.0
mips64 clang 15.0.0
mips64 clang 16.0.0
mips64 clang 17.0.1
mips64 clang 18.1.0
mips64 clang 19.1.0
mips64 clang 20.1.0
mips64 clang 21.1.0
mips64 gcc 11.2.0
mips64 gcc 12.1.0
mips64 gcc 12.2.0
mips64 gcc 12.3.0
mips64 gcc 12.4.0
mips64 gcc 12.5.0
mips64 gcc 13.1.0
mips64 gcc 13.2.0
mips64 gcc 13.3.0
mips64 gcc 13.4.0
mips64 gcc 14.1.0
mips64 gcc 14.2.0
mips64 gcc 14.3.0
mips64 gcc 15.1.0
mips64 gcc 15.2.0
mips64 gcc 4.9.4
mips64 gcc 5.4
mips64 gcc 5.5.0
mips64 gcc 9.5.0
mips64el clang 13.0.0
mips64el clang 14.0.0
mips64el clang 15.0.0
mips64el clang 16.0.0
mips64el clang 17.0.1
mips64el clang 18.1.0
mips64el clang 19.1.0
mips64el clang 20.1.0
mips64el clang 21.1.0
mipsel clang 13.0.0
mipsel clang 14.0.0
mipsel clang 15.0.0
mipsel clang 16.0.0
mipsel clang 17.0.1
mipsel clang 18.1.0
mipsel clang 19.1.0
mipsel clang 20.1.0
mipsel clang 21.1.0
movfuscator (trunk)
nanoMIPS gcc 6.3.0
power gcc 11.2.0
power gcc 12.1.0
power gcc 12.2.0
power gcc 12.3.0
power gcc 12.4.0
power gcc 12.5.0
power gcc 13.1.0
power gcc 13.2.0
power gcc 13.3.0
power gcc 13.4.0
power gcc 14.1.0
power gcc 14.2.0
power gcc 14.3.0
power gcc 15.1.0
power gcc 15.2.0
power gcc 4.8.5
power64 AT12.0 (gcc8)
power64 AT13.0 (gcc9)
power64le AT12.0 (gcc8)
power64le AT13.0 (gcc9)
power64le clang (trunk)
power64le gcc 11.2.0
power64le gcc 12.1.0
power64le gcc 12.2.0
power64le gcc 12.3.0
power64le gcc 12.4.0
power64le gcc 12.5.0
power64le gcc 13.1.0
power64le gcc 13.2.0
power64le gcc 13.3.0
power64le gcc 13.4.0
power64le gcc 14.1.0
power64le gcc 14.2.0
power64le gcc 14.3.0
power64le gcc 15.1.0
power64le gcc 15.2.0
power64le gcc 6.3.0
power64le gcc trunk
powerpc64 clang (trunk)
ppci 0.5.5
s390x gcc 11.2.0
s390x gcc 12.1.0
s390x gcc 12.2.0
s390x gcc 12.3.0
s390x gcc 12.4.0
s390x gcc 12.5.0
s390x gcc 13.1.0
s390x gcc 13.2.0
s390x gcc 13.3.0
s390x gcc 13.4.0
s390x gcc 14.1.0
s390x gcc 14.2.0
s390x gcc 14.3.0
s390x gcc 15.1.0
s390x gcc 15.2.0
sh gcc 12.2.0
sh gcc 12.3.0
sh gcc 12.4.0
sh gcc 12.5.0
sh gcc 13.1.0
sh gcc 13.2.0
sh gcc 13.3.0
sh gcc 13.4.0
sh gcc 14.1.0
sh gcc 14.2.0
sh gcc 14.3.0
sh gcc 15.1.0
sh gcc 15.2.0
sh gcc 4.9.4
sh gcc 9.5.0
vast (trunk)
x64 msvc v19.0 (ex-WINE)
x64 msvc v19.10 (ex-WINE)
x64 msvc v19.14 (ex-WINE)
x64 msvc v19.20 VS16.0
x64 msvc v19.21 VS16.1
x64 msvc v19.22 VS16.2
x64 msvc v19.23 VS16.3
x64 msvc v19.24 VS16.4
x64 msvc v19.25 VS16.5
x64 msvc v19.27 VS16.7
x64 msvc v19.28 VS16.8
x64 msvc v19.28 VS16.9
x64 msvc v19.29 VS16.10
x64 msvc v19.29 VS16.11
x64 msvc v19.30 VS17.0
x64 msvc v19.31 VS17.1
x64 msvc v19.32 VS17.2
x64 msvc v19.33 VS17.3
x64 msvc v19.34 VS17.4
x64 msvc v19.35 VS17.5
x64 msvc v19.36 VS17.6
x64 msvc v19.37 VS17.7
x64 msvc v19.38 VS17.8
x64 msvc v19.39 VS17.9
x64 msvc v19.40 VS17.10
x64 msvc v19.41 VS17.11
x64 msvc v19.42 VS17.12
x64 msvc v19.43 VS17.13
x64 msvc v19.latest
x86 CompCert 3.10
x86 CompCert 3.11
x86 CompCert 3.12
x86 CompCert 3.9
x86 gcc 1.27
x86 msvc v19.0 (ex-WINE)
x86 msvc v19.10 (ex-WINE)
x86 msvc v19.14 (ex-WINE)
x86 msvc v19.20 VS16.0
x86 msvc v19.21 VS16.1
x86 msvc v19.22 VS16.2
x86 msvc v19.23 VS16.3
x86 msvc v19.24 VS16.4
x86 msvc v19.25 VS16.5
x86 msvc v19.27 VS16.7
x86 msvc v19.28 VS16.8
x86 msvc v19.28 VS16.9
x86 msvc v19.29 VS16.10
x86 msvc v19.29 VS16.11
x86 msvc v19.30 VS17.0
x86 msvc v19.31 VS17.1
x86 msvc v19.32 VS17.2
x86 msvc v19.33 VS17.3
x86 msvc v19.34 VS17.4
x86 msvc v19.35 VS17.5
x86 msvc v19.36 VS17.6
x86 msvc v19.37 VS17.7
x86 msvc v19.38 VS17.8
x86 msvc v19.39 VS17.9
x86 msvc v19.40 VS17.10
x86 msvc v19.41 VS17.11
x86 msvc v19.42 VS17.12
x86 msvc v19.43 VS17.13
x86 msvc v19.latest
x86 nvc 24.11
x86 nvc 24.9
x86 nvc 25.1
x86 nvc 25.3
x86 nvc 25.5
x86 nvc 25.7
x86 tendra (trunk)
x86-64 clang (assertions trunk)
x86-64 clang (thephd.dev)
x86-64 clang (trunk)
x86-64 clang (widberg)
x86-64 clang 10.0.0
x86-64 clang 10.0.1
x86-64 clang 11.0.0
x86-64 clang 11.0.1
x86-64 clang 12.0.0
x86-64 clang 12.0.1
x86-64 clang 13.0.0
x86-64 clang 13.0.1
x86-64 clang 14.0.0
x86-64 clang 15.0.0
x86-64 clang 16.0.0
x86-64 clang 17.0.1
x86-64 clang 18.1.0
x86-64 clang 19.1.0
x86-64 clang 20.1.0
x86-64 clang 21.1.0
x86-64 clang 3.0.0
x86-64 clang 3.1
x86-64 clang 3.2
x86-64 clang 3.3
x86-64 clang 3.4.1
x86-64 clang 3.5
x86-64 clang 3.5.1
x86-64 clang 3.5.2
x86-64 clang 3.6
x86-64 clang 3.7
x86-64 clang 3.7.1
x86-64 clang 3.8
x86-64 clang 3.8.1
x86-64 clang 3.9.0
x86-64 clang 3.9.1
x86-64 clang 4.0.0
x86-64 clang 4.0.1
x86-64 clang 5.0.0
x86-64 clang 5.0.1
x86-64 clang 5.0.2
x86-64 clang 6.0.0
x86-64 clang 6.0.1
x86-64 clang 7.0.0
x86-64 clang 7.0.1
x86-64 clang 7.1.0
x86-64 clang 8.0.0
x86-64 clang 8.0.1
x86-64 clang 9.0.0
x86-64 clang 9.0.1
x86-64 gcc (trunk)
x86-64 gcc 10.1
x86-64 gcc 10.2
x86-64 gcc 10.3
x86-64 gcc 10.3 (assertions)
x86-64 gcc 10.4
x86-64 gcc 10.4 (assertions)
x86-64 gcc 10.5
x86-64 gcc 10.5 (assertions)
x86-64 gcc 11.1
x86-64 gcc 11.1 (assertions)
x86-64 gcc 11.2
x86-64 gcc 11.2 (assertions)
x86-64 gcc 11.3
x86-64 gcc 11.3 (assertions)
x86-64 gcc 11.4
x86-64 gcc 11.4 (assertions)
x86-64 gcc 12.1
x86-64 gcc 12.1 (assertions)
x86-64 gcc 12.2
x86-64 gcc 12.2 (assertions)
x86-64 gcc 12.3
x86-64 gcc 12.3 (assertions)
x86-64 gcc 12.4
x86-64 gcc 12.4 (assertions)
x86-64 gcc 12.5
x86-64 gcc 12.5 (assertions)
x86-64 gcc 13.1
x86-64 gcc 13.1 (assertions)
x86-64 gcc 13.2
x86-64 gcc 13.2 (assertions)
x86-64 gcc 13.3
x86-64 gcc 13.3 (assertions)
x86-64 gcc 13.4
x86-64 gcc 13.4 (assertions)
x86-64 gcc 14.1
x86-64 gcc 14.1 (assertions)
x86-64 gcc 14.2
x86-64 gcc 14.2 (assertions)
x86-64 gcc 14.3
x86-64 gcc 14.3 (assertions)
x86-64 gcc 15.1
x86-64 gcc 15.1 (assertions)
x86-64 gcc 15.2
x86-64 gcc 15.2 (assertions)
x86-64 gcc 3.4.6
x86-64 gcc 4.0.4
x86-64 gcc 4.1.2
x86-64 gcc 4.4.7
x86-64 gcc 4.5.3
x86-64 gcc 4.6.4
x86-64 gcc 4.7.1
x86-64 gcc 4.7.2
x86-64 gcc 4.7.3
x86-64 gcc 4.7.4
x86-64 gcc 4.8.1
x86-64 gcc 4.8.2
x86-64 gcc 4.8.3
x86-64 gcc 4.8.4
x86-64 gcc 4.8.5
x86-64 gcc 4.9.0
x86-64 gcc 4.9.1
x86-64 gcc 4.9.2
x86-64 gcc 4.9.3
x86-64 gcc 4.9.4
x86-64 gcc 5.1
x86-64 gcc 5.2
x86-64 gcc 5.3
x86-64 gcc 5.4
x86-64 gcc 6.1
x86-64 gcc 6.2
x86-64 gcc 6.3
x86-64 gcc 6.5
x86-64 gcc 7.1
x86-64 gcc 7.2
x86-64 gcc 7.3
x86-64 gcc 7.4
x86-64 gcc 7.5
x86-64 gcc 8.1
x86-64 gcc 8.2
x86-64 gcc 8.3
x86-64 gcc 8.4
x86-64 gcc 8.5
x86-64 gcc 9.1
x86-64 gcc 9.2
x86-64 gcc 9.3
x86-64 gcc 9.4
x86-64 gcc 9.5
x86-64 icc 13.0.1
x86-64 icc 16.0.3
x86-64 icc 17.0.0
x86-64 icc 18.0.0
x86-64 icc 19.0.0
x86-64 icc 19.0.1
x86-64 icc 2021.1.2
x86-64 icc 2021.10.0
x86-64 icc 2021.2.0
x86-64 icc 2021.3.0
x86-64 icc 2021.4.0
x86-64 icc 2021.5.0
x86-64 icc 2021.6.0
x86-64 icc 2021.7.0
x86-64 icc 2021.7.1
x86-64 icc 2021.8.0
x86-64 icc 2021.9.0
x86-64 icx (latest)
x86-64 icx 2021.1.2
x86-64 icx 2021.2.0
x86-64 icx 2021.3.0
x86-64 icx 2021.4.0
x86-64 icx 2022.0.0
x86-64 icx 2022.1.0
x86-64 icx 2022.2.0
x86-64 icx 2022.2.1
x86-64 icx 2023.0.0
x86-64 icx 2023.1.0
x86-64 icx 2024.0.0
x86_64 CompCert 3.10
x86_64 CompCert 3.11
x86_64 CompCert 3.12
x86_64 CompCert 3.9
z180-clang 15.0.0
z180-clang 15.0.7
z80-clang 15.0.0
z80-clang 15.0.7
z88dk 2.2
zig cc 0.10.0
zig cc 0.11.0
zig cc 0.12.0
zig cc 0.12.1
zig cc 0.13.0
zig cc 0.14.0
zig cc 0.14.1
zig cc 0.15.1
zig cc 0.6.0
zig cc 0.7.0
zig cc 0.7.1
zig cc 0.8.0
zig cc 0.9.0
zig cc trunk
Options
Source code
# 0 "sord.c" # 1 "/home/marcan/software/Carla/source/modules/lilv//" # 0 "<built-in>" # 0 "<command-line>" # 1 "/usr/include/stdc-predef.h" 1 3 4 # 0 "<command-line>" 2 # 1 "sord.c" # 17 "sord.c" # 1 "sord-0.16.0/src/sord.c" 1 # 18 "sord-0.16.0/src/sord.c" # 1 "/usr/include/assert.h" 1 3 4 # 35 "/usr/include/assert.h" 3 4 # 1 "/usr/include/features.h" 1 3 4 # 392 "/usr/include/features.h" 3 4 # 1 "/usr/include/features-time64.h" 1 3 4 # 20 "/usr/include/features-time64.h" 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 21 "/usr/include/features-time64.h" 2 3 4 # 1 "/usr/include/bits/timesize.h" 1 3 4 # 22 "/usr/include/features-time64.h" 2 3 4 # 393 "/usr/include/features.h" 2 3 4 # 490 "/usr/include/features.h" 3 4 # 1 "/usr/include/sys/cdefs.h" 1 3 4 # 559 "/usr/include/sys/cdefs.h" 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 560 "/usr/include/sys/cdefs.h" 2 3 4 # 1 "/usr/include/bits/long-double.h" 1 3 4 # 561 "/usr/include/sys/cdefs.h" 2 3 4 # 491 "/usr/include/features.h" 2 3 4 # 514 "/usr/include/features.h" 3 4 # 1 "/usr/include/gnu/stubs.h" 1 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 6 "/usr/include/gnu/stubs.h" 2 3 4 # 1 "/usr/include/gnu/stubs-lp64.h" 1 3 4 # 9 "/usr/include/gnu/stubs.h" 2 3 4 # 515 "/usr/include/features.h" 2 3 4 # 36 "/usr/include/assert.h" 2 3 4 # 19 "sord-0.16.0/src/sord.c" 2 # 1 "/usr/include/errno.h" 1 3 4 # 28 "/usr/include/errno.h" 3 4 # 1 "/usr/include/bits/errno.h" 1 3 4 # 26 "/usr/include/bits/errno.h" 3 4 # 1 "/usr/include/linux/errno.h" 1 3 4 # 1 "/usr/include/asm/errno.h" 1 3 4 # 1 "/usr/include/asm-generic/errno.h" 1 3 4 # 1 "/usr/include/asm-generic/errno-base.h" 1 3 4 # 6 "/usr/include/asm-generic/errno.h" 2 3 4 # 2 "/usr/include/asm/errno.h" 2 3 4 # 2 "/usr/include/linux/errno.h" 2 3 4 # 27 "/usr/include/bits/errno.h" 2 3 4 # 29 "/usr/include/errno.h" 2 3 4 # 37 "/usr/include/errno.h" 3 4 extern int *__errno_location (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); # 52 "/usr/include/errno.h" 3 4 # 20 "sord-0.16.0/src/sord.c" 2 # 1 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stdint.h" 1 3 4 # 9 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stdint.h" 3 4 # 1 "/usr/include/stdint.h" 1 3 4 # 26 "/usr/include/stdint.h" 3 4 # 1 "/usr/include/bits/libc-header-start.h" 1 3 4 # 27 "/usr/include/stdint.h" 2 3 4 # 1 "/usr/include/bits/types.h" 1 3 4 # 27 "/usr/include/bits/types.h" 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 28 "/usr/include/bits/types.h" 2 3 4 # 1 "/usr/include/bits/timesize.h" 1 3 4 # 29 "/usr/include/bits/types.h" 2 3 4 typedef unsigned char __u_char; typedef unsigned short int __u_short; typedef unsigned int __u_int; typedef unsigned long int __u_long; typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef signed short int __int16_t; typedef unsigned short int __uint16_t; typedef signed int __int32_t; typedef unsigned int __uint32_t; typedef signed long int __int64_t; typedef unsigned long int __uint64_t; typedef __int8_t __int_least8_t; typedef __uint8_t __uint_least8_t; typedef __int16_t __int_least16_t; typedef __uint16_t __uint_least16_t; typedef __int32_t __int_least32_t; typedef __uint32_t __uint_least32_t; typedef __int64_t __int_least64_t; typedef __uint64_t __uint_least64_t; typedef long int __quad_t; typedef unsigned long int __u_quad_t; typedef long int __intmax_t; typedef unsigned long int __uintmax_t; # 141 "/usr/include/bits/types.h" 3 4 # 1 "/usr/include/bits/typesizes.h" 1 3 4 # 142 "/usr/include/bits/types.h" 2 3 4 # 1 "/usr/include/bits/time64.h" 1 3 4 # 143 "/usr/include/bits/types.h" 2 3 4 typedef unsigned long int __dev_t; typedef unsigned int __uid_t; typedef unsigned int __gid_t; typedef unsigned long int __ino_t; typedef unsigned long int __ino64_t; typedef unsigned int __mode_t; typedef unsigned int __nlink_t; typedef long int __off_t; typedef long int __off64_t; typedef int __pid_t; typedef struct { int __val[2]; } __fsid_t; typedef long int __clock_t; typedef unsigned long int __rlim_t; typedef unsigned long int __rlim64_t; typedef unsigned int __id_t; typedef long int __time_t; typedef unsigned int __useconds_t; typedef long int __suseconds_t; typedef long int __suseconds64_t; typedef int __daddr_t; typedef int __key_t; typedef int __clockid_t; typedef void * __timer_t; typedef int __blksize_t; typedef long int __blkcnt_t; typedef long int __blkcnt64_t; typedef unsigned long int __fsblkcnt_t; typedef unsigned long int __fsblkcnt64_t; typedef unsigned long int __fsfilcnt_t; typedef unsigned long int __fsfilcnt64_t; typedef long int __fsword_t; typedef long int __ssize_t; typedef long int __syscall_slong_t; typedef unsigned long int __syscall_ulong_t; typedef __off64_t __loff_t; typedef char *__caddr_t; typedef long int __intptr_t; typedef unsigned int __socklen_t; typedef int __sig_atomic_t; # 28 "/usr/include/stdint.h" 2 3 4 # 1 "/usr/include/bits/wchar.h" 1 3 4 # 29 "/usr/include/stdint.h" 2 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 30 "/usr/include/stdint.h" 2 3 4 # 1 "/usr/include/bits/stdint-intn.h" 1 3 4 # 24 "/usr/include/bits/stdint-intn.h" 3 4 typedef __int8_t int8_t; typedef __int16_t int16_t; typedef __int32_t int32_t; typedef __int64_t int64_t; # 35 "/usr/include/stdint.h" 2 3 4 # 1 "/usr/include/bits/stdint-uintn.h" 1 3 4 # 24 "/usr/include/bits/stdint-uintn.h" 3 4 typedef __uint8_t uint8_t; typedef __uint16_t uint16_t; typedef __uint32_t uint32_t; typedef __uint64_t uint64_t; # 38 "/usr/include/stdint.h" 2 3 4 typedef __int_least8_t int_least8_t; typedef __int_least16_t int_least16_t; typedef __int_least32_t int_least32_t; typedef __int_least64_t int_least64_t; typedef __uint_least8_t uint_least8_t; typedef __uint_least16_t uint_least16_t; typedef __uint_least32_t uint_least32_t; typedef __uint_least64_t uint_least64_t; typedef signed char int_fast8_t; typedef long int int_fast16_t; typedef long int int_fast32_t; typedef long int int_fast64_t; # 71 "/usr/include/stdint.h" 3 4 typedef unsigned char uint_fast8_t; typedef unsigned long int uint_fast16_t; typedef unsigned long int uint_fast32_t; typedef unsigned long int uint_fast64_t; # 87 "/usr/include/stdint.h" 3 4 typedef long int intptr_t; typedef unsigned long int uintptr_t; # 101 "/usr/include/stdint.h" 3 4 typedef __intmax_t intmax_t; typedef __uintmax_t uintmax_t; # 10 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stdint.h" 2 3 4 # 21 "sord-0.16.0/src/sord.c" 2 # 1 "/usr/include/stdio.h" 1 3 4 # 27 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/bits/libc-header-start.h" 1 3 4 # 28 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stddef.h" 1 3 4 # 214 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stddef.h" 3 4 typedef long unsigned int size_t; # 34 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stdarg.h" 1 3 4 # 40 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stdarg.h" 3 4 typedef __builtin_va_list __gnuc_va_list; # 37 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/bits/types/__fpos_t.h" 1 3 4 # 1 "/usr/include/bits/types/__mbstate_t.h" 1 3 4 # 13 "/usr/include/bits/types/__mbstate_t.h" 3 4 typedef struct { int __count; union { unsigned int __wch; char __wchb[4]; } __value; } __mbstate_t; # 6 "/usr/include/bits/types/__fpos_t.h" 2 3 4 typedef struct _G_fpos_t { __off_t __pos; __mbstate_t __state; } __fpos_t; # 40 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/bits/types/__fpos64_t.h" 1 3 4 # 10 "/usr/include/bits/types/__fpos64_t.h" 3 4 typedef struct _G_fpos64_t { __off64_t __pos; __mbstate_t __state; } __fpos64_t; # 41 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/bits/types/__FILE.h" 1 3 4 struct _IO_FILE; typedef struct _IO_FILE __FILE; # 42 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/bits/types/FILE.h" 1 3 4 struct _IO_FILE; typedef struct _IO_FILE FILE; # 43 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/bits/types/struct_FILE.h" 1 3 4 # 35 "/usr/include/bits/types/struct_FILE.h" 3 4 struct _IO_FILE; struct _IO_marker; struct _IO_codecvt; struct _IO_wide_data; typedef void _IO_lock_t; struct _IO_FILE { int _flags; char *_IO_read_ptr; char *_IO_read_end; char *_IO_read_base; char *_IO_write_base; char *_IO_write_ptr; char *_IO_write_end; char *_IO_buf_base; char *_IO_buf_end; char *_IO_save_base; char *_IO_backup_base; char *_IO_save_end; struct _IO_marker *_markers; struct _IO_FILE *_chain; int _fileno; int _flags2; __off_t _old_offset; unsigned short _cur_column; signed char _vtable_offset; char _shortbuf[1]; _IO_lock_t *_lock; __off64_t _offset; struct _IO_codecvt *_codecvt; struct _IO_wide_data *_wide_data; struct _IO_FILE *_freeres_list; void *_freeres_buf; size_t __pad5; int _mode; char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)]; }; # 44 "/usr/include/stdio.h" 2 3 4 # 52 "/usr/include/stdio.h" 3 4 typedef __gnuc_va_list va_list; # 63 "/usr/include/stdio.h" 3 4 typedef __off_t off_t; # 77 "/usr/include/stdio.h" 3 4 typedef __ssize_t ssize_t; typedef __fpos_t fpos_t; # 133 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/bits/stdio_lim.h" 1 3 4 # 134 "/usr/include/stdio.h" 2 3 4 # 143 "/usr/include/stdio.h" 3 4 extern FILE *stdin; extern FILE *stdout; extern FILE *stderr; extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)); extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__)); extern int renameat (int __oldfd, const char *__old, int __newfd, const char *__new) __attribute__ ((__nothrow__ , __leaf__)); # 178 "/usr/include/stdio.h" 3 4 extern int fclose (FILE *__stream); # 188 "/usr/include/stdio.h" 3 4 extern FILE *tmpfile (void) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ; # 205 "/usr/include/stdio.h" 3 4 extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ; extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ; # 222 "/usr/include/stdio.h" 3 4 extern char *tempnam (const char *__dir, const char *__pfx) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1))); extern int fflush (FILE *__stream); # 239 "/usr/include/stdio.h" 3 4 extern int fflush_unlocked (FILE *__stream); # 258 "/usr/include/stdio.h" 3 4 extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ; extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) ; # 293 "/usr/include/stdio.h" 3 4 extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ; # 308 "/usr/include/stdio.h" 3 4 extern FILE *fmemopen (void *__s, size_t __len, const char *__modes) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ; extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ; # 328 "/usr/include/stdio.h" 3 4 extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)); extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__)); extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)); extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); extern int fprintf (FILE *__restrict __stream, const char *__restrict __format, ...); extern int printf (const char *__restrict __format, ...); extern int sprintf (char *__restrict __s, const char *__restrict __format, ...) __attribute__ ((__nothrow__)); extern int vfprintf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg); extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg); extern int vsprintf (char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__)); extern int snprintf (char *__restrict __s, size_t __maxlen, const char *__restrict __format, ...) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4))); extern int vsnprintf (char *__restrict __s, size_t __maxlen, const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0))); # 403 "/usr/include/stdio.h" 3 4 extern int vdprintf (int __fd, const char *__restrict __fmt, __gnuc_va_list __arg) __attribute__ ((__format__ (__printf__, 2, 0))); extern int dprintf (int __fd, const char *__restrict __fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); extern int fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) ; extern int scanf (const char *__restrict __format, ...) ; extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) __attribute__ ((__nothrow__ , __leaf__)); # 1 "/usr/include/bits/floatn.h" 1 3 4 # 23 "/usr/include/bits/floatn.h" 3 4 # 1 "/usr/include/bits/long-double.h" 1 3 4 # 24 "/usr/include/bits/floatn.h" 2 3 4 # 95 "/usr/include/bits/floatn.h" 3 4 # 1 "/usr/include/bits/floatn-common.h" 1 3 4 # 24 "/usr/include/bits/floatn-common.h" 3 4 # 1 "/usr/include/bits/long-double.h" 1 3 4 # 25 "/usr/include/bits/floatn-common.h" 2 3 4 # 96 "/usr/include/bits/floatn.h" 2 3 4 # 431 "/usr/include/stdio.h" 2 3 4 extern int fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) __asm__ ("" "__isoc99_fscanf") ; extern int scanf (const char *__restrict __format, ...) __asm__ ("" "__isoc99_scanf") ; extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) __asm__ ("" "__isoc99_sscanf") __attribute__ ((__nothrow__ , __leaf__)) ; # 459 "/usr/include/stdio.h" 3 4 extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__format__ (__scanf__, 2, 0))) ; extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__format__ (__scanf__, 1, 0))) ; extern int vsscanf (const char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0))); extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vfscanf") __attribute__ ((__format__ (__scanf__, 2, 0))) ; extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vscanf") __attribute__ ((__format__ (__scanf__, 1, 0))) ; extern int vsscanf (const char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vsscanf") __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0))); # 513 "/usr/include/stdio.h" 3 4 extern int fgetc (FILE *__stream); extern int getc (FILE *__stream); extern int getchar (void); extern int getc_unlocked (FILE *__stream); extern int getchar_unlocked (void); # 538 "/usr/include/stdio.h" 3 4 extern int fgetc_unlocked (FILE *__stream); # 549 "/usr/include/stdio.h" 3 4 extern int fputc (int __c, FILE *__stream); extern int putc (int __c, FILE *__stream); extern int putchar (int __c); # 565 "/usr/include/stdio.h" 3 4 extern int fputc_unlocked (int __c, FILE *__stream); extern int putc_unlocked (int __c, FILE *__stream); extern int putchar_unlocked (int __c); extern int getw (FILE *__stream); extern int putw (int __w, FILE *__stream); extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) __attribute__ ((__access__ (__write_only__, 1, 2))); # 605 "/usr/include/stdio.h" 3 4 extern char *gets (char *__s) __attribute__ ((__deprecated__)); # 632 "/usr/include/stdio.h" 3 4 extern __ssize_t __getdelim (char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) ; extern __ssize_t getdelim (char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) ; extern __ssize_t getline (char **__restrict __lineptr, size_t *__restrict __n, FILE *__restrict __stream) ; extern int fputs (const char *__restrict __s, FILE *__restrict __stream); extern int puts (const char *__s); extern int ungetc (int __c, FILE *__stream); extern size_t fread (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) ; extern size_t fwrite (const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __s); # 702 "/usr/include/stdio.h" 3 4 extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) ; extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream); extern int fseek (FILE *__stream, long int __off, int __whence); extern long int ftell (FILE *__stream) ; extern void rewind (FILE *__stream); # 736 "/usr/include/stdio.h" 3 4 extern int fseeko (FILE *__stream, __off_t __off, int __whence); extern __off_t ftello (FILE *__stream) ; # 760 "/usr/include/stdio.h" 3 4 extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos); extern int fsetpos (FILE *__stream, const fpos_t *__pos); # 786 "/usr/include/stdio.h" 3 4 extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; extern void perror (const char *__s); extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; # 823 "/usr/include/stdio.h" 3 4 extern int pclose (FILE *__stream); extern FILE *popen (const char *__command, const char *__modes) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ; extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__access__ (__write_only__, 1))); # 867 "/usr/include/stdio.h" 3 4 extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); # 885 "/usr/include/stdio.h" 3 4 extern int __uflow (FILE *); extern int __overflow (FILE *, int); # 1 "/usr/include/bits/stdio.h" 1 3 4 # 38 "/usr/include/bits/stdio.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) int vprintf (const char *__restrict __fmt, __gnuc_va_list __arg) { return vfprintf (stdout, __fmt, __arg); } extern __inline __attribute__ ((__gnu_inline__)) int getchar (void) { return getc (stdin); } extern __inline __attribute__ ((__gnu_inline__)) int fgetc_unlocked (FILE *__fp) { return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); } extern __inline __attribute__ ((__gnu_inline__)) int getc_unlocked (FILE *__fp) { return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); } extern __inline __attribute__ ((__gnu_inline__)) int getchar_unlocked (void) { return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++); } extern __inline __attribute__ ((__gnu_inline__)) int putchar (int __c) { return putc (__c, stdout); } extern __inline __attribute__ ((__gnu_inline__)) int fputc_unlocked (int __c, FILE *__stream) { return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); } extern __inline __attribute__ ((__gnu_inline__)) int putc_unlocked (int __c, FILE *__stream) { return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); } extern __inline __attribute__ ((__gnu_inline__)) int putchar_unlocked (int __c) { return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c))); } # 127 "/usr/include/bits/stdio.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__nothrow__ , __leaf__)) feof_unlocked (FILE *__stream) { return (((__stream)->_flags & 0x0010) != 0); } extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__nothrow__ , __leaf__)) ferror_unlocked (FILE *__stream) { return (((__stream)->_flags & 0x0020) != 0); } # 892 "/usr/include/stdio.h" 2 3 4 # 902 "/usr/include/stdio.h" 3 4 # 22 "sord-0.16.0/src/sord.c" 2 # 1 "/usr/include/stdlib.h" 1 3 4 # 26 "/usr/include/stdlib.h" 3 4 # 1 "/usr/include/bits/libc-header-start.h" 1 3 4 # 27 "/usr/include/stdlib.h" 2 3 4 # 1 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stddef.h" 1 3 4 # 329 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stddef.h" 3 4 typedef unsigned int wchar_t; # 33 "/usr/include/stdlib.h" 2 3 4 # 1 "/usr/include/bits/waitflags.h" 1 3 4 # 41 "/usr/include/stdlib.h" 2 3 4 # 1 "/usr/include/bits/waitstatus.h" 1 3 4 # 42 "/usr/include/stdlib.h" 2 3 4 # 59 "/usr/include/stdlib.h" 3 4 typedef struct { int quot; int rem; } div_t; typedef struct { long int quot; long int rem; } ldiv_t; __extension__ typedef struct { long long int quot; long long int rem; } lldiv_t; # 98 "/usr/include/stdlib.h" 3 4 extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ; extern double atof (const char *__nptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; extern int atoi (const char *__nptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; extern long int atol (const char *__nptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; __extension__ extern long long int atoll (const char *__nptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; extern double strtod (const char *__restrict __nptr, char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern float strtof (const char *__restrict __nptr, char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern long double strtold (const char *__restrict __nptr, char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); # 177 "/usr/include/stdlib.h" 3 4 extern long int strtol (const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern unsigned long int strtoul (const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); __extension__ extern long long int strtoq (const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); __extension__ extern unsigned long long int strtouq (const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); __extension__ extern long long int strtoll (const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); __extension__ extern unsigned long long int strtoull (const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); # 361 "/usr/include/stdlib.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__nothrow__ , __leaf__)) atoi (const char *__nptr) { return (int) strtol (__nptr, (char **) ((void *)0), 10); } extern __inline __attribute__ ((__gnu_inline__)) long int __attribute__ ((__nothrow__ , __leaf__)) atol (const char *__nptr) { return strtol (__nptr, (char **) ((void *)0), 10); } __extension__ extern __inline __attribute__ ((__gnu_inline__)) long long int __attribute__ ((__nothrow__ , __leaf__)) atoll (const char *__nptr) { return strtoll (__nptr, (char **) ((void *)0), 10); } # 386 "/usr/include/stdlib.h" 3 4 extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ; extern long int a64l (const char *__s) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; # 1 "/usr/include/sys/types.h" 1 3 4 # 27 "/usr/include/sys/types.h" 3 4 typedef __u_char u_char; typedef __u_short u_short; typedef __u_int u_int; typedef __u_long u_long; typedef __quad_t quad_t; typedef __u_quad_t u_quad_t; typedef __fsid_t fsid_t; typedef __loff_t loff_t; typedef __ino_t ino_t; # 59 "/usr/include/sys/types.h" 3 4 typedef __dev_t dev_t; typedef __gid_t gid_t; typedef __mode_t mode_t; typedef __nlink_t nlink_t; typedef __uid_t uid_t; # 97 "/usr/include/sys/types.h" 3 4 typedef __pid_t pid_t; typedef __id_t id_t; # 114 "/usr/include/sys/types.h" 3 4 typedef __daddr_t daddr_t; typedef __caddr_t caddr_t; typedef __key_t key_t; # 1 "/usr/include/bits/types/clock_t.h" 1 3 4 typedef __clock_t clock_t; # 127 "/usr/include/sys/types.h" 2 3 4 # 1 "/usr/include/bits/types/clockid_t.h" 1 3 4 typedef __clockid_t clockid_t; # 129 "/usr/include/sys/types.h" 2 3 4 # 1 "/usr/include/bits/types/time_t.h" 1 3 4 # 10 "/usr/include/bits/types/time_t.h" 3 4 typedef __time_t time_t; # 130 "/usr/include/sys/types.h" 2 3 4 # 1 "/usr/include/bits/types/timer_t.h" 1 3 4 typedef __timer_t timer_t; # 131 "/usr/include/sys/types.h" 2 3 4 # 144 "/usr/include/sys/types.h" 3 4 # 1 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stddef.h" 1 3 4 # 145 "/usr/include/sys/types.h" 2 3 4 typedef unsigned long int ulong; typedef unsigned short int ushort; typedef unsigned int uint; typedef __uint8_t u_int8_t; typedef __uint16_t u_int16_t; typedef __uint32_t u_int32_t; typedef __uint64_t u_int64_t; typedef int register_t __attribute__ ((__mode__ (__word__))); # 176 "/usr/include/sys/types.h" 3 4 # 1 "/usr/include/endian.h" 1 3 4 # 24 "/usr/include/endian.h" 3 4 # 1 "/usr/include/bits/endian.h" 1 3 4 # 35 "/usr/include/bits/endian.h" 3 4 # 1 "/usr/include/bits/endianness.h" 1 3 4 # 36 "/usr/include/bits/endian.h" 2 3 4 # 25 "/usr/include/endian.h" 2 3 4 # 35 "/usr/include/endian.h" 3 4 # 1 "/usr/include/bits/byteswap.h" 1 3 4 # 33 "/usr/include/bits/byteswap.h" 3 4 static __inline __uint16_t __bswap_16 (__uint16_t __bsx) { return __builtin_bswap16 (__bsx); } static __inline __uint32_t __bswap_32 (__uint32_t __bsx) { return __builtin_bswap32 (__bsx); } # 69 "/usr/include/bits/byteswap.h" 3 4 __extension__ static __inline __uint64_t __bswap_64 (__uint64_t __bsx) { return __builtin_bswap64 (__bsx); } # 36 "/usr/include/endian.h" 2 3 4 # 1 "/usr/include/bits/uintn-identity.h" 1 3 4 # 32 "/usr/include/bits/uintn-identity.h" 3 4 static __inline __uint16_t __uint16_identity (__uint16_t __x) { return __x; } static __inline __uint32_t __uint32_identity (__uint32_t __x) { return __x; } static __inline __uint64_t __uint64_identity (__uint64_t __x) { return __x; } # 37 "/usr/include/endian.h" 2 3 4 # 177 "/usr/include/sys/types.h" 2 3 4 # 1 "/usr/include/sys/select.h" 1 3 4 # 30 "/usr/include/sys/select.h" 3 4 # 1 "/usr/include/bits/select.h" 1 3 4 # 31 "/usr/include/sys/select.h" 2 3 4 # 1 "/usr/include/bits/types/sigset_t.h" 1 3 4 # 1 "/usr/include/bits/types/__sigset_t.h" 1 3 4 typedef struct { unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))]; } __sigset_t; # 5 "/usr/include/bits/types/sigset_t.h" 2 3 4 typedef __sigset_t sigset_t; # 34 "/usr/include/sys/select.h" 2 3 4 # 1 "/usr/include/bits/types/struct_timeval.h" 1 3 4 struct timeval { __time_t tv_sec; __suseconds_t tv_usec; }; # 38 "/usr/include/sys/select.h" 2 3 4 # 1 "/usr/include/bits/types/struct_timespec.h" 1 3 4 # 11 "/usr/include/bits/types/struct_timespec.h" 3 4 struct timespec { __time_t tv_sec; __syscall_slong_t tv_nsec; # 31 "/usr/include/bits/types/struct_timespec.h" 3 4 }; # 40 "/usr/include/sys/select.h" 2 3 4 typedef __suseconds_t suseconds_t; typedef long int __fd_mask; # 59 "/usr/include/sys/select.h" 3 4 typedef struct { __fd_mask __fds_bits[1024 / (8 * (int) sizeof (__fd_mask))]; } fd_set; typedef __fd_mask fd_mask; # 91 "/usr/include/sys/select.h" 3 4 # 102 "/usr/include/sys/select.h" 3 4 extern int select (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, struct timeval *__restrict __timeout); # 127 "/usr/include/sys/select.h" 3 4 extern int pselect (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, const struct timespec *__restrict __timeout, const __sigset_t *__restrict __sigmask); # 153 "/usr/include/sys/select.h" 3 4 # 180 "/usr/include/sys/types.h" 2 3 4 typedef __blksize_t blksize_t; typedef __blkcnt_t blkcnt_t; typedef __fsblkcnt_t fsblkcnt_t; typedef __fsfilcnt_t fsfilcnt_t; # 227 "/usr/include/sys/types.h" 3 4 # 1 "/usr/include/bits/pthreadtypes.h" 1 3 4 # 23 "/usr/include/bits/pthreadtypes.h" 3 4 # 1 "/usr/include/bits/thread-shared-types.h" 1 3 4 # 44 "/usr/include/bits/thread-shared-types.h" 3 4 # 1 "/usr/include/bits/pthreadtypes-arch.h" 1 3 4 # 45 "/usr/include/bits/thread-shared-types.h" 2 3 4 # 1 "/usr/include/bits/atomic_wide_counter.h" 1 3 4 # 25 "/usr/include/bits/atomic_wide_counter.h" 3 4 typedef union { __extension__ unsigned long long int __value64; struct { unsigned int __low; unsigned int __high; } __value32; } __atomic_wide_counter; # 47 "/usr/include/bits/thread-shared-types.h" 2 3 4 typedef struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __pthread_list_t; typedef struct __pthread_internal_slist { struct __pthread_internal_slist *__next; } __pthread_slist_t; # 76 "/usr/include/bits/thread-shared-types.h" 3 4 # 1 "/usr/include/bits/struct_mutex.h" 1 3 4 # 27 "/usr/include/bits/struct_mutex.h" 3 4 struct __pthread_mutex_s { int __lock ; unsigned int __count; int __owner; unsigned int __nusers; # 58 "/usr/include/bits/struct_mutex.h" 3 4 int __kind; int __spins; __pthread_list_t __list; # 74 "/usr/include/bits/struct_mutex.h" 3 4 }; # 77 "/usr/include/bits/thread-shared-types.h" 2 3 4 # 89 "/usr/include/bits/thread-shared-types.h" 3 4 # 1 "/usr/include/bits/struct_rwlock.h" 1 3 4 # 23 "/usr/include/bits/struct_rwlock.h" 3 4 struct __pthread_rwlock_arch_t { unsigned int __readers; unsigned int __writers; unsigned int __wrphase_futex; unsigned int __writers_futex; unsigned int __pad3; unsigned int __pad4; int __cur_writer; int __shared; unsigned long int __pad1; unsigned long int __pad2; unsigned int __flags; }; # 90 "/usr/include/bits/thread-shared-types.h" 2 3 4 struct __pthread_cond_s { __atomic_wide_counter __wseq; __atomic_wide_counter __g1_start; unsigned int __g_refs[2] ; unsigned int __g_size[2]; unsigned int __g1_orig_size; unsigned int __wrefs; unsigned int __g_signals[2]; }; typedef unsigned int __tss_t; typedef unsigned long int __thrd_t; typedef struct { int __data ; } __once_flag; # 24 "/usr/include/bits/pthreadtypes.h" 2 3 4 typedef unsigned long int pthread_t; typedef union { char __size[8]; int __align; } pthread_mutexattr_t; typedef union { char __size[8]; int __align; } pthread_condattr_t; typedef unsigned int pthread_key_t; typedef int pthread_once_t; union pthread_attr_t { char __size[64]; long int __align; }; typedef union pthread_attr_t pthread_attr_t; typedef union { struct __pthread_mutex_s __data; char __size[48]; long int __align; } pthread_mutex_t; typedef union { struct __pthread_cond_s __data; char __size[48]; __extension__ long long int __align; } pthread_cond_t; typedef union { struct __pthread_rwlock_arch_t __data; char __size[56]; long int __align; } pthread_rwlock_t; typedef union { char __size[8]; long int __align; } pthread_rwlockattr_t; typedef volatile int pthread_spinlock_t; typedef union { char __size[32]; long int __align; } pthread_barrier_t; typedef union { char __size[8]; int __align; } pthread_barrierattr_t; # 228 "/usr/include/sys/types.h" 2 3 4 # 396 "/usr/include/stdlib.h" 2 3 4 extern long int random (void) __attribute__ ((__nothrow__ , __leaf__)); extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__)); extern char *initstate (unsigned int __seed, char *__statebuf, size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); struct random_data { int32_t *fptr; int32_t *rptr; int32_t *state; int rand_type; int rand_deg; int rand_sep; int32_t *end_ptr; }; extern int random_r (struct random_data *__restrict __buf, int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int srandom_r (unsigned int __seed, struct random_data *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); extern int initstate_r (unsigned int __seed, char *__restrict __statebuf, size_t __statelen, struct random_data *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))); extern int setstate_r (char *__restrict __statebuf, struct random_data *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int rand (void) __attribute__ ((__nothrow__ , __leaf__)); extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__)); extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__)); extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__)); extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__)); extern long int nrand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__)); extern long int jrand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__)); extern unsigned short int *seed48 (unsigned short int __seed16v[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); struct drand48_data { unsigned short int __x[3]; unsigned short int __old_x[3]; unsigned short int __c; unsigned short int __init; __extension__ unsigned long long int __a; }; extern int drand48_r (struct drand48_data *__restrict __buffer, double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int erand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int lrand48_r (struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int nrand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int mrand48_r (struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int jrand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int srand48_r (long int __seedval, struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); extern int seed48_r (unsigned short int __seed16v[3], struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int lcong48_r (unsigned short int __param[7], struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1))) ; extern void *calloc (size_t __nmemb, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ; extern void *realloc (void *__ptr, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2))); extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__)); extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2, 3))) __attribute__ ((__malloc__ (__builtin_free, 1))); extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1))); # 1 "/usr/include/alloca.h" 1 3 4 # 24 "/usr/include/alloca.h" 3 4 # 1 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stddef.h" 1 3 4 # 25 "/usr/include/alloca.h" 2 3 4 extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__)); # 575 "/usr/include/stdlib.h" 2 3 4 extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1))) ; extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; # 598 "/usr/include/stdlib.h" 3 4 extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); # 617 "/usr/include/stdlib.h" 3 4 extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); # 636 "/usr/include/stdlib.h" 3 4 extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; # 654 "/usr/include/stdlib.h" 3 4 extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int setenv (const char *__name, const char *__value, int __replace) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__)); # 682 "/usr/include/stdlib.h" 3 4 extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); # 695 "/usr/include/stdlib.h" 3 4 extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ; # 717 "/usr/include/stdlib.h" 3 4 extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) ; # 738 "/usr/include/stdlib.h" 3 4 extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; # 791 "/usr/include/stdlib.h" 3 4 extern int system (const char *__command) ; # 808 "/usr/include/stdlib.h" 3 4 extern char *realpath (const char *__restrict __name, char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ; typedef int (*__compar_fn_t) (const void *, const void *); # 828 "/usr/include/stdlib.h" 3 4 extern void *bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 2, 5))) ; # 1 "/usr/include/bits/stdlib-bsearch.h" 1 3 4 # 19 "/usr/include/bits/stdlib-bsearch.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) void * bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) { size_t __l, __u, __idx; const void *__p; int __comparison; __l = 0; __u = __nmemb; while (__l < __u) { __idx = (__l + __u) / 2; __p = (const void *) (((const char *) __base) + (__idx * __size)); __comparison = (*__compar) (__key, __p); if (__comparison < 0) __u = __idx; else if (__comparison > 0) __l = __idx + 1; else { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-qual" return (void *) __p; #pragma GCC diagnostic pop } } return ((void *)0); } # 834 "/usr/include/stdlib.h" 2 3 4 extern void qsort (void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4))); # 848 "/usr/include/stdlib.h" 3 4 extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ; extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ; __extension__ extern long long int llabs (long long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ; extern div_t div (int __numer, int __denom) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ; extern ldiv_t ldiv (long int __numer, long int __denom) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ; __extension__ extern lldiv_t lldiv (long long int __numer, long long int __denom) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ; # 880 "/usr/include/stdlib.h" 3 4 extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ; extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ; extern char *gcvt (double __value, int __ndigit, char *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ; extern char *qecvt (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ; extern char *qfcvt (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ; extern char *qgcvt (long double __value, int __ndigit, char *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ; extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5))); extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5))); extern int qecvt_r (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5))); extern int qfcvt_r (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5))); extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)); extern int mbtowc (wchar_t *__restrict __pwc, const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)); extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__)); extern size_t mbstowcs (wchar_t *__restrict __pwcs, const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__access__ (__read_only__, 2))); extern size_t wcstombs (char *__restrict __s, const wchar_t *__restrict __pwcs, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__access__ (__write_only__, 1, 3))) __attribute__ ((__access__ (__read_only__, 2))); extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; # 967 "/usr/include/stdlib.h" 3 4 extern int getsubopt (char **__restrict __optionp, char *const *__restrict __tokens, char **__restrict __valuep) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ; # 1013 "/usr/include/stdlib.h" 3 4 extern int getloadavg (double __loadavg[], int __nelem) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); # 1023 "/usr/include/stdlib.h" 3 4 # 1 "/usr/include/bits/stdlib-float.h" 1 3 4 # 24 "/usr/include/bits/stdlib-float.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) double __attribute__ ((__nothrow__ , __leaf__)) atof (const char *__nptr) { return strtod (__nptr, (char **) ((void *)0)); } # 1024 "/usr/include/stdlib.h" 2 3 4 # 1035 "/usr/include/stdlib.h" 3 4 # 23 "sord-0.16.0/src/sord.c" 2 # 1 "/usr/include/string.h" 1 3 4 # 26 "/usr/include/string.h" 3 4 # 1 "/usr/include/bits/libc-header-start.h" 1 3 4 # 27 "/usr/include/string.h" 2 3 4 # 1 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stddef.h" 1 3 4 # 34 "/usr/include/string.h" 2 3 4 # 43 "/usr/include/string.h" 3 4 extern void *memcpy (void *__restrict __dest, const void *__restrict __src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memmove (void *__dest, const void *__src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memccpy (void *__restrict __dest, const void *__restrict __src, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__access__ (__write_only__, 1, 4))); extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int memcmp (const void *__s1, const void *__s2, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); # 80 "/usr/include/string.h" 3 4 extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); # 107 "/usr/include/string.h" 3 4 extern void *memchr (const void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); # 141 "/usr/include/string.h" 3 4 extern char *strcpy (char *__restrict __dest, const char *__restrict __src) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strcat (char *__restrict __dest, const char *__restrict __src) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strncat (char *__restrict __dest, const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcmp (const char *__s1, const char *__s2) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strncmp (const char *__s1, const char *__s2, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcoll (const char *__s1, const char *__s2) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strxfrm (char *__restrict __dest, const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 1, 3))); # 1 "/usr/include/bits/types/locale_t.h" 1 3 4 # 22 "/usr/include/bits/types/locale_t.h" 3 4 # 1 "/usr/include/bits/types/__locale_t.h" 1 3 4 # 27 "/usr/include/bits/types/__locale_t.h" 3 4 struct __locale_struct { struct __locale_data *__locales[13]; const unsigned short int *__ctype_b; const int *__ctype_tolower; const int *__ctype_toupper; const char *__names[13]; }; typedef struct __locale_struct *__locale_t; # 23 "/usr/include/bits/types/locale_t.h" 2 3 4 typedef __locale_t locale_t; # 173 "/usr/include/string.h" 2 3 4 extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3))); extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) __attribute__ ((__access__ (__write_only__, 1, 3))); extern char *strdup (const char *__s) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); extern char *strndup (const char *__string, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); # 246 "/usr/include/string.h" 3 4 extern char *strchr (const char *__s, int __c) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); # 273 "/usr/include/string.h" 3 4 extern char *strrchr (const char *__s, int __c) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); # 293 "/usr/include/string.h" 3 4 extern size_t strcspn (const char *__s, const char *__reject) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strspn (const char *__s, const char *__accept) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); # 323 "/usr/include/string.h" 3 4 extern char *strpbrk (const char *__s, const char *__accept) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); # 350 "/usr/include/string.h" 3 4 extern char *strstr (const char *__haystack, const char *__needle) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strtok (char *__restrict __s, const char *__restrict __delim) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); extern char *__strtok_r (char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))); extern char *strtok_r (char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))); # 407 "/usr/include/string.h" 3 4 extern size_t strlen (const char *__s) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern size_t strnlen (const char *__string, size_t __maxlen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__)); # 432 "/usr/include/string.h" 3 4 extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__access__ (__write_only__, 2, 3))); # 458 "/usr/include/string.h" 3 4 extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__)); # 1 "/usr/include/strings.h" 1 3 4 # 23 "/usr/include/strings.h" 3 4 # 1 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stddef.h" 1 3 4 # 24 "/usr/include/strings.h" 2 3 4 extern int bcmp (const void *__s1, const void *__s2, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern void bcopy (const void *__src, void *__dest, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); # 68 "/usr/include/strings.h" 3 4 extern char *index (const char *__s, int __c) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); # 96 "/usr/include/strings.h" 3 4 extern char *rindex (const char *__s, int __c) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); __extension__ extern int ffsll (long long int __ll) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int strcasecmp (const char *__s1, const char *__s2) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strncasecmp (const char *__s1, const char *__s2, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3))); extern int strncasecmp_l (const char *__s1, const char *__s2, size_t __n, locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4))); # 463 "/usr/include/string.h" 2 3 4 extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__access__ (__write_only__, 1, 2))); extern char *strsep (char **__restrict __stringp, const char *__restrict __delim) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__)); # 489 "/usr/include/string.h" 3 4 extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern char *stpcpy (char *__restrict __dest, const char *__restrict __src) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern char *__stpncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern char *stpncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); # 539 "/usr/include/string.h" 3 4 # 24 "sord-0.16.0/src/sord.c" 2 # 1 "sord-0.16.0/src/zix/digest.c" 1 # 17 "sord-0.16.0/src/zix/digest.c" # 1 "sord-0.16.0/src/zix/digest.h" 1 # 20 "sord-0.16.0/src/zix/digest.h" # 1 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stddef.h" 1 3 4 # 145 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stddef.h" 3 4 typedef long int ptrdiff_t; # 21 "sord-0.16.0/src/zix/digest.h" 2 # 1 "sord-0.16.0/src/zix/common.h" 1 # 52 "sord-0.16.0/src/zix/common.h" # 1 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stdbool.h" 1 3 4 # 53 "sord-0.16.0/src/zix/common.h" 2 # 55 "sord-0.16.0/src/zix/common.h" typedef enum { ZIX_STATUS_SUCCESS, ZIX_STATUS_ERROR, ZIX_STATUS_NO_MEM, ZIX_STATUS_NOT_FOUND, ZIX_STATUS_EXISTS, ZIX_STATUS_BAD_ARG, ZIX_STATUS_BAD_PERMS, } ZixStatus; typedef int (*ZixComparator)(const void* a, const void* b, void* user_data); typedef # 73 "sord-0.16.0/src/zix/common.h" 3 4 _Bool # 73 "sord-0.16.0/src/zix/common.h" (*ZixEqualFunc)(const void* a, const void* b); typedef void (*ZixDestroyFunc)(void* ptr); # 24 "sord-0.16.0/src/zix/digest.h" 2 static inline uint32_t zix_digest_start(void); static inline uint32_t zix_digest_add(uint32_t hash, const void* buf, const size_t len); # 18 "sord-0.16.0/src/zix/digest.c" 2 static inline uint32_t zix_digest_start(void) { return 5381; } static inline uint32_t zix_digest_add(uint32_t hash, const void* const buf, const size_t len) { const uint8_t* str = (const uint8_t*)buf; # 52 "sord-0.16.0/src/zix/digest.c" for (size_t i = 0; i < len; ++i) { hash = (hash << 5) + hash + str[i]; } return hash; } # 27 "sord-0.16.0/src/sord.c" 2 # 1 "sord-0.16.0/src/zix/hash.c" 1 # 17 "sord-0.16.0/src/zix/hash.c" # 1 "/usr/include/assert.h" 1 3 4 # 18 "sord-0.16.0/src/zix/hash.c" 2 # 1 "sord-0.16.0/src/zix/hash.h" 1 # 20 "sord-0.16.0/src/zix/hash.h" # 1 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stddef.h" 1 3 4 # 21 "sord-0.16.0/src/zix/hash.h" 2 # 36 "sord-0.16.0/src/zix/hash.h" typedef struct ZixHashImpl ZixHash; typedef uint32_t (*ZixHashFunc)(const void* value); typedef void (*ZixHashVisitFunc)(void* value, void* user_data); # 62 "sord-0.16.0/src/zix/hash.h" static inline ZixHash* zix_hash_new(ZixHashFunc hash_func, ZixEqualFunc equal_func, size_t value_size); static inline void zix_hash_free(ZixHash* hash); static inline size_t zix_hash_size(const ZixHash* hash); # 93 "sord-0.16.0/src/zix/hash.h" static inline ZixStatus zix_hash_insert(ZixHash* hash, const void* value, const void** inserted); # 105 "sord-0.16.0/src/zix/hash.h" static inline ZixStatus zix_hash_remove(ZixHash* hash, const void* value); static inline const void* zix_hash_find(const ZixHash* hash, const void* value); # 126 "sord-0.16.0/src/zix/hash.h" static inline void zix_hash_foreach(ZixHash* hash, ZixHashVisitFunc f, void* user_data); # 23 "sord-0.16.0/src/zix/hash.c" 2 static const unsigned sizes[] = { 53, 97, 193, 389, 769, 1543, 3079, 6151, 12289, 24593, 49157, 98317, 196613, 393241, 786433, 1572869, 3145739, 6291469, 12582917, 25165843, 50331653, 100663319, 201326611, 402653189, 805306457, 1610612741, 0 }; typedef struct ZixHashEntry { struct ZixHashEntry* next; uint32_t hash; } ZixHashEntry; struct ZixHashImpl { ZixHashFunc hash_func; ZixEqualFunc equal_func; ZixHashEntry** buckets; const unsigned* n_buckets; size_t value_size; unsigned count; }; static inline void* zix_hash_value(ZixHashEntry* entry) { return entry + 1; } static inline ZixHash* zix_hash_new(ZixHashFunc hash_func, ZixEqualFunc equal_func, size_t value_size) { ZixHash* hash = (ZixHash*)malloc(sizeof(ZixHash)); if (hash) { hash->hash_func = hash_func; hash->equal_func = equal_func; hash->n_buckets = &sizes[0]; hash->value_size = value_size; hash->count = 0; if (!(hash->buckets = (ZixHashEntry**)calloc(*hash->n_buckets, sizeof(ZixHashEntry*)))) { free(hash); return # 70 "sord-0.16.0/src/zix/hash.c" 3 4 ((void *)0) # 70 "sord-0.16.0/src/zix/hash.c" ; } } return hash; } static inline void zix_hash_free(ZixHash* hash) { for (unsigned b = 0; b < *hash->n_buckets; ++b) { ZixHashEntry* bucket = hash->buckets[b]; for (ZixHashEntry* e = bucket; e;) { ZixHashEntry* next = e->next; free(e); e = next; } } free(hash->buckets); free(hash); } static inline size_t zix_hash_size(const ZixHash* hash) { return hash->count; } static inline void insert_entry(ZixHashEntry** bucket, ZixHashEntry* entry) { entry->next = *bucket; *bucket = entry; } static inline ZixStatus rehash(ZixHash* hash, unsigned new_n_buckets) { ZixHashEntry** new_buckets = (ZixHashEntry**)calloc( new_n_buckets, sizeof(ZixHashEntry*)); if (!new_buckets) { return ZIX_STATUS_NO_MEM; } const unsigned old_n_buckets = *hash->n_buckets; for (unsigned b = 0; b < old_n_buckets; ++b) { for (ZixHashEntry* e = hash->buckets[b]; e;) { ZixHashEntry* const next = e->next; const unsigned h = e->hash % new_n_buckets; insert_entry(&new_buckets[h], e); e = next; } } free(hash->buckets); hash->buckets = new_buckets; return ZIX_STATUS_SUCCESS; } static inline ZixHashEntry* find_entry(const ZixHash* hash, const void* key, const unsigned h, const unsigned h_nomod) { for (ZixHashEntry* e = hash->buckets[h]; e; e = e->next) { if (e->hash == h_nomod && hash->equal_func(zix_hash_value(e), key)) { return e; } } return # 141 "sord-0.16.0/src/zix/hash.c" 3 4 ((void *)0) # 141 "sord-0.16.0/src/zix/hash.c" ; } static inline const void* zix_hash_find(const ZixHash* hash, const void* value) { const unsigned h_nomod = hash->hash_func(value); const unsigned h = h_nomod % *hash->n_buckets; ZixHashEntry* const entry = find_entry(hash, value, h, h_nomod); return entry ? zix_hash_value(entry) : 0; } static inline ZixStatus zix_hash_insert(ZixHash* hash, const void* value, const void** inserted) { unsigned h_nomod = hash->hash_func(value); unsigned h = h_nomod % *hash->n_buckets; ZixHashEntry* elem = find_entry(hash, value, h, h_nomod); if (elem) { # 161 "sord-0.16.0/src/zix/hash.c" 3 4 ((void) (0)) # 161 "sord-0.16.0/src/zix/hash.c" ; if (inserted) { *inserted = zix_hash_value(elem); } return ZIX_STATUS_EXISTS; } elem = (ZixHashEntry*)malloc(sizeof(ZixHashEntry) + hash->value_size); if (!elem) { return ZIX_STATUS_NO_MEM; } elem->next = # 172 "sord-0.16.0/src/zix/hash.c" 3 4 ((void *)0) # 172 "sord-0.16.0/src/zix/hash.c" ; elem->hash = h_nomod; memcpy(elem + 1, value, hash->value_size); const unsigned next_n_buckets = *(hash->n_buckets + 1); if (next_n_buckets != 0 && (hash->count + 1) >= next_n_buckets) { if (!rehash(hash, next_n_buckets)) { h = h_nomod % *(++hash->n_buckets); } } insert_entry(&hash->buckets[h], elem); ++hash->count; if (inserted) { *inserted = zix_hash_value(elem); } return ZIX_STATUS_SUCCESS; } static inline ZixStatus zix_hash_remove(ZixHash* hash, const void* value) { const unsigned h_nomod = hash->hash_func(value); const unsigned h = h_nomod % *hash->n_buckets; ZixHashEntry** next_ptr = &hash->buckets[h]; for (ZixHashEntry* e = hash->buckets[h]; e; e = e->next) { if (h_nomod == e->hash && hash->equal_func(zix_hash_value(e), value)) { *next_ptr = e->next; free(e); return ZIX_STATUS_SUCCESS; } next_ptr = &e->next; } if (hash->n_buckets != sizes) { const unsigned prev_n_buckets = *(hash->n_buckets - 1); if (hash->count - 1 <= prev_n_buckets) { if (!rehash(hash, prev_n_buckets)) { --hash->n_buckets; } } } --hash->count; return ZIX_STATUS_NOT_FOUND; } static inline void zix_hash_foreach(ZixHash* hash, ZixHashVisitFunc f, void* user_data) { for (unsigned b = 0; b < *hash->n_buckets; ++b) { ZixHashEntry* bucket = hash->buckets[b]; for (ZixHashEntry* e = bucket; e; e = e->next) { f(zix_hash_value(e), user_data); } } } # 28 "sord-0.16.0/src/sord.c" 2 # 1 "sord-0.16.0/src/zix/btree.c" 1 # 17 "sord-0.16.0/src/zix/btree.c" # 1 "/usr/include/assert.h" 1 3 4 # 18 "sord-0.16.0/src/zix/btree.c" 2 # 1 "sord-0.16.0/src/zix/btree.h" 1 # 20 "sord-0.16.0/src/zix/btree.h" # 1 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stddef.h" 1 3 4 # 21 "sord-0.16.0/src/zix/btree.h" 2 # 40 "sord-0.16.0/src/zix/btree.h" typedef struct ZixBTreeImpl ZixBTree; typedef struct ZixBTreeNodeImpl ZixBTreeNode; typedef struct ZixBTreeIterImpl ZixBTreeIter; static inline ZixBTree* zix_btree_new(ZixComparator cmp, void* cmp_data, ZixDestroyFunc destroy); static inline void zix_btree_free(ZixBTree* t); static inline size_t zix_btree_size(const ZixBTree* t); static inline ZixStatus zix_btree_insert(ZixBTree* t, void* e); # 94 "sord-0.16.0/src/zix/btree.h" static inline ZixStatus zix_btree_remove(ZixBTree* t, const void* e, void** out, ZixBTreeIter** next); static inline ZixStatus zix_btree_find(const ZixBTree* t, const void* e, ZixBTreeIter** ti); # 111 "sord-0.16.0/src/zix/btree.h" static inline ZixStatus zix_btree_lower_bound(const ZixBTree* t, const void* e, ZixBTreeIter** ti); static inline void* zix_btree_get(const ZixBTreeIter* ti); static inline ZixBTreeIter* zix_btree_begin(const ZixBTree* t); static inline # 131 "sord-0.16.0/src/zix/btree.h" 3 4 _Bool # 132 "sord-0.16.0/src/zix/btree.h" zix_btree_iter_is_end(const ZixBTreeIter* i); static inline void __attribute__((always_inline)) zix_btree_iter_increment(ZixBTreeIter* i); static inline void zix_btree_iter_free(ZixBTreeIter* i); # 24 "sord-0.16.0/src/zix/btree.c" 2 # 32 "sord-0.16.0/src/zix/btree.c" struct ZixBTreeImpl { ZixBTreeNode* root; ZixDestroyFunc destroy; ZixComparator cmp; void* cmp_data; size_t size; unsigned height; }; struct ZixBTreeNodeImpl { uint16_t is_leaf; uint16_t n_vals; void* vals[((((4096 - 2 * sizeof(uint16_t)) / sizeof(void*)) - 1) / 2)]; ZixBTreeNode* children[((((4096 - 2 * sizeof(uint16_t)) / sizeof(void*)) - 1) / 2) + 1]; }; typedef struct { ZixBTreeNode* node; unsigned index; } ZixBTreeIterFrame; struct ZixBTreeIterImpl { unsigned level; ZixBTreeIterFrame stack[]; }; # 95 "sord-0.16.0/src/zix/btree.c" static inline ZixBTreeNode* zix_btree_node_new(const # 96 "sord-0.16.0/src/zix/btree.c" 3 4 _Bool # 96 "sord-0.16.0/src/zix/btree.c" leaf) { # 98 "sord-0.16.0/src/zix/btree.c" 3 4 ((void) (0)) # 98 "sord-0.16.0/src/zix/btree.c" ; ZixBTreeNode* node = (ZixBTreeNode*)malloc(sizeof(ZixBTreeNode)); if (node) { node->is_leaf = leaf; node->n_vals = 0; } return node; } static inline ZixBTree* zix_btree_new(const ZixComparator cmp, void* const cmp_data, const ZixDestroyFunc destroy) { ZixBTree* t = (ZixBTree*)malloc(sizeof(ZixBTree)); if (t) { t->root = zix_btree_node_new( # 114 "sord-0.16.0/src/zix/btree.c" 3 4 1 # 114 "sord-0.16.0/src/zix/btree.c" ); t->destroy = destroy; t->cmp = cmp; t->cmp_data = cmp_data; t->size = 0; t->height = 1; if (!t->root) { free(t); return # 122 "sord-0.16.0/src/zix/btree.c" 3 4 ((void *)0) # 122 "sord-0.16.0/src/zix/btree.c" ; } } return t; } static inline void zix_btree_free_rec(ZixBTree* const t, ZixBTreeNode* const n) { if (n) { if (t->destroy) { for (uint16_t i = 0; i < n->n_vals; ++i) { t->destroy(n->vals[i]); } } if (!n->is_leaf) { for (uint16_t i = 0; i < n->n_vals + 1; ++i) { zix_btree_free_rec(t, n->children[i]); } } free(n); } } static inline void zix_btree_free(ZixBTree* const t) { if (t) { zix_btree_free_rec(t, t->root); free(t); } } static inline size_t zix_btree_size(const ZixBTree* const t) { return t->size; } static inline uint16_t zix_btree_max_vals(const ZixBTreeNode* const node) { return node->is_leaf ? (((4096 - 2 * sizeof(uint16_t)) / sizeof(void*)) - 1) : ((((4096 - 2 * sizeof(uint16_t)) / sizeof(void*)) - 1) / 2); } static inline uint16_t zix_btree_min_vals(const ZixBTreeNode* const node) { return ((zix_btree_max_vals(node) + 1) / 2) - 1; } static inline void zix_btree_ainsert(void** const array, const uint16_t n, const uint16_t i, void* const e) { memmove(array + i + 1, array + i, (n - i) * sizeof(e)); array[i] = e; } static inline void* zix_btree_aerase(void** const array, const uint16_t n, const uint16_t i) { void* const ret = array[i]; memmove(array + i, array + i + 1, (n - i) * sizeof(ret)); return ret; } static inline ZixBTreeNode* zix_btree_split_child(ZixBTreeNode* const n, const uint16_t i, ZixBTreeNode* const lhs) { # 199 "sord-0.16.0/src/zix/btree.c" 3 4 ((void) (0)) # 199 "sord-0.16.0/src/zix/btree.c" ; # 200 "sord-0.16.0/src/zix/btree.c" 3 4 ((void) (0)) # 200 "sord-0.16.0/src/zix/btree.c" ; # 201 "sord-0.16.0/src/zix/btree.c" 3 4 ((void) (0)) # 201 "sord-0.16.0/src/zix/btree.c" ; # 202 "sord-0.16.0/src/zix/btree.c" 3 4 ((void) (0)) # 202 "sord-0.16.0/src/zix/btree.c" ; const uint16_t max_n_vals = zix_btree_max_vals(lhs); ZixBTreeNode* rhs = zix_btree_node_new(lhs->is_leaf); if (!rhs) { return # 207 "sord-0.16.0/src/zix/btree.c" 3 4 ((void *)0) # 207 "sord-0.16.0/src/zix/btree.c" ; } lhs->n_vals = max_n_vals / 2; rhs->n_vals = max_n_vals - lhs->n_vals - 1; memcpy(rhs->vals, lhs->vals + lhs->n_vals + 1, rhs->n_vals * sizeof(void*)); if (!lhs->is_leaf) { memcpy(rhs->children, lhs->children + lhs->n_vals + 1, (rhs->n_vals + 1) * sizeof(ZixBTreeNode*)); } zix_btree_ainsert(n->vals, n->n_vals, i, lhs->vals[lhs->n_vals]); zix_btree_ainsert((void**)n->children, ++n->n_vals, i + 1, rhs); return rhs; } static inline uint16_t zix_btree_node_find(const ZixBTree* const t, const ZixBTreeNode* const n, const void* const e, # 240 "sord-0.16.0/src/zix/btree.c" 3 4 _Bool # 240 "sord-0.16.0/src/zix/btree.c" * const equal) { uint16_t first = 0; uint16_t len = n->n_vals; while (len > 0) { const uint16_t half = len >> 1; const uint16_t i = first + half; const int cmp = t->cmp(n->vals[i], e, t->cmp_data); if (cmp == 0) { *equal = # 249 "sord-0.16.0/src/zix/btree.c" 3 4 1 # 249 "sord-0.16.0/src/zix/btree.c" ; len = half; } else if (cmp < 0) { const uint16_t chop = half + 1; first += chop; len -= chop; } else { len = half; } } # 259 "sord-0.16.0/src/zix/btree.c" 3 4 ((void) (0)) # 259 "sord-0.16.0/src/zix/btree.c" ; return first; } static inline ZixStatus zix_btree_insert(ZixBTree* const t, void* const e) { ZixBTreeNode* parent = # 266 "sord-0.16.0/src/zix/btree.c" 3 4 ((void *)0) # 266 "sord-0.16.0/src/zix/btree.c" ; ZixBTreeNode* n = t->root; uint16_t i = 0; while (n) { if (n->n_vals == zix_btree_max_vals(n)) { if (!parent) { if (!(parent = zix_btree_node_new( # 274 "sord-0.16.0/src/zix/btree.c" 3 4 0 # 274 "sord-0.16.0/src/zix/btree.c" ))) { return ZIX_STATUS_NO_MEM; } t->root = parent; parent->children[0] = n; ++t->height; } ZixBTreeNode* const rhs = zix_btree_split_child(parent, i, n); if (!rhs) { return ZIX_STATUS_NO_MEM; } const int cmp = t->cmp(parent->vals[i], e, t->cmp_data); if (cmp == 0) { return ZIX_STATUS_EXISTS; } else if (cmp < 0) { n = rhs; ++i; } } # 297 "sord-0.16.0/src/zix/btree.c" 3 4 ((void) (0)) # 297 "sord-0.16.0/src/zix/btree.c" ; # 299 "sord-0.16.0/src/zix/btree.c" 3 4 _Bool # 299 "sord-0.16.0/src/zix/btree.c" equal = # 299 "sord-0.16.0/src/zix/btree.c" 3 4 0 # 299 "sord-0.16.0/src/zix/btree.c" ; i = zix_btree_node_find(t, n, e, &equal); if (equal) { return ZIX_STATUS_EXISTS; } else if (!n->is_leaf) { parent = n; n = n->children[i]; } else { zix_btree_ainsert(n->vals, n->n_vals++, i, e); break; } } ++t->size; return ZIX_STATUS_SUCCESS; } static inline ZixBTreeIter* zix_btree_iter_new(const ZixBTree* const t) { const size_t s = t->height * sizeof(ZixBTreeIterFrame); ZixBTreeIter* const i = (ZixBTreeIter*)malloc(sizeof(ZixBTreeIter) + s); if (i) { i->level = 0; } return i; } static inline void zix_btree_iter_set_frame(ZixBTreeIter* const ti, ZixBTreeNode* const n, const uint16_t i) { if (ti) { ti->stack[ti->level].node = n; ti->stack[ti->level].index = i; } } static inline # 341 "sord-0.16.0/src/zix/btree.c" 3 4 _Bool # 342 "sord-0.16.0/src/zix/btree.c" zix_btree_node_is_minimal(ZixBTreeNode* const n) { # 344 "sord-0.16.0/src/zix/btree.c" 3 4 ((void) (0)) # 344 "sord-0.16.0/src/zix/btree.c" ; return n->n_vals == zix_btree_min_vals(n); } static inline ZixBTreeNode* zix_btree_rotate_left(ZixBTreeNode* const parent, const uint16_t i) { ZixBTreeNode* const lhs = parent->children[i]; ZixBTreeNode* const rhs = parent->children[i + 1]; lhs->vals[lhs->n_vals++] = parent->vals[i]; if (!lhs->is_leaf) { lhs->children[lhs->n_vals] = (ZixBTreeNode*)zix_btree_aerase( (void**)rhs->children, rhs->n_vals, 0); } parent->vals[i] = zix_btree_aerase(rhs->vals, --rhs->n_vals, 0); return lhs; } static inline ZixBTreeNode* zix_btree_rotate_right(ZixBTreeNode* const parent, const uint16_t i) { ZixBTreeNode* const lhs = parent->children[i - 1]; ZixBTreeNode* const rhs = parent->children[i]; zix_btree_ainsert(rhs->vals, rhs->n_vals++, 0, parent->vals[i - 1]); if (!lhs->is_leaf) { zix_btree_ainsert((void**)rhs->children, rhs->n_vals, 0, lhs->children[lhs->n_vals]); } parent->vals[i - 1] = lhs->vals[--lhs->n_vals]; return rhs; } static inline ZixBTreeNode* zix_btree_merge(ZixBTree* const t, ZixBTreeNode* const n, const uint16_t i) { ZixBTreeNode* const lhs = n->children[i]; ZixBTreeNode* const rhs = n->children[i + 1]; # 401 "sord-0.16.0/src/zix/btree.c" 3 4 ((void) (0)) # 401 "sord-0.16.0/src/zix/btree.c" ; # 402 "sord-0.16.0/src/zix/btree.c" 3 4 ((void) (0)) # 402 "sord-0.16.0/src/zix/btree.c" ; lhs->vals[lhs->n_vals++] = zix_btree_aerase(n->vals, n->n_vals, i); zix_btree_aerase((void**)n->children, n->n_vals, i + 1); memcpy(lhs->vals + lhs->n_vals, rhs->vals, rhs->n_vals * sizeof(void*)); if (!lhs->is_leaf) { memcpy(lhs->children + lhs->n_vals, rhs->children, (rhs->n_vals + 1) * sizeof(void*)); } lhs->n_vals += rhs->n_vals; if (--n->n_vals == 0) { # 421 "sord-0.16.0/src/zix/btree.c" 3 4 ((void) (0)) # 421 "sord-0.16.0/src/zix/btree.c" ; t->root = lhs; free(n); } free(rhs); return lhs; } static inline void* zix_btree_remove_min(ZixBTree* const t, ZixBTreeNode* n) { while (!n->is_leaf) { if (zix_btree_node_is_minimal(n->children[0])) { if (!zix_btree_node_is_minimal(n->children[1])) { n = zix_btree_rotate_left(n, 0); } else { n = zix_btree_merge(t, n, 0); } } else { n = n->children[0]; } } return zix_btree_aerase(n->vals, --n->n_vals, 0); } static inline void* zix_btree_remove_max(ZixBTree* const t, ZixBTreeNode* n) { while (!n->is_leaf) { if (zix_btree_node_is_minimal(n->children[n->n_vals])) { if (!zix_btree_node_is_minimal(n->children[n->n_vals - 1])) { n = zix_btree_rotate_right(n, n->n_vals); } else { n = zix_btree_merge(t, n, n->n_vals - 1); } } else { n = n->children[n->n_vals]; } } return n->vals[--n->n_vals]; } static inline ZixStatus zix_btree_remove(ZixBTree* const t, const void* const e, void** const out, ZixBTreeIter** const next) { ZixBTreeNode* n = t->root; ZixBTreeIter* ti = # 481 "sord-0.16.0/src/zix/btree.c" 3 4 ((void *)0) # 481 "sord-0.16.0/src/zix/btree.c" ; const # 482 "sord-0.16.0/src/zix/btree.c" 3 4 _Bool # 482 "sord-0.16.0/src/zix/btree.c" user_iter = next && *next; if (next) { if (!*next && !(*next = zix_btree_iter_new(t))) { return ZIX_STATUS_NO_MEM; } ti = *next; ti->level = 0; } while ( # 491 "sord-0.16.0/src/zix/btree.c" 3 4 1 # 491 "sord-0.16.0/src/zix/btree.c" ) { # 496 "sord-0.16.0/src/zix/btree.c" 3 4 ((void) (0)) # 496 "sord-0.16.0/src/zix/btree.c" ; # 498 "sord-0.16.0/src/zix/btree.c" 3 4 _Bool # 498 "sord-0.16.0/src/zix/btree.c" equal = # 498 "sord-0.16.0/src/zix/btree.c" 3 4 0 # 498 "sord-0.16.0/src/zix/btree.c" ; const uint16_t i = zix_btree_node_find(t, n, e, &equal); zix_btree_iter_set_frame(ti, n, i); if (n->is_leaf) { if (equal) { *out = zix_btree_aerase(n->vals, --n->n_vals, i); if (ti && i == n->n_vals) { if (i == 0) { ti->stack[ti->level = 0].node = # 507 "sord-0.16.0/src/zix/btree.c" 3 4 ((void *)0) # 507 "sord-0.16.0/src/zix/btree.c" ; } else { --ti->stack[ti->level].index; zix_btree_iter_increment(ti); } } --t->size; return ZIX_STATUS_SUCCESS; } else { if (ti && !user_iter) { zix_btree_iter_free(ti); *next = # 519 "sord-0.16.0/src/zix/btree.c" 3 4 ((void *)0) # 519 "sord-0.16.0/src/zix/btree.c" ; } return ZIX_STATUS_NOT_FOUND; } } else if (equal) { if (!zix_btree_node_is_minimal(n->children[i])) { *out = n->vals[i]; n->vals[i] = zix_btree_remove_max(t, n->children[i]); --t->size; return ZIX_STATUS_SUCCESS; } else if (!zix_btree_node_is_minimal(n->children[i + 1])) { *out = n->vals[i]; n->vals[i] = zix_btree_remove_min(t, n->children[i + 1]); --t->size; return ZIX_STATUS_SUCCESS; } else { n = zix_btree_merge(t, n, i); } } else { if (zix_btree_node_is_minimal(n->children[i])) { if (i > 0 && !zix_btree_node_is_minimal(n->children[i - 1])) { n = zix_btree_rotate_right(n, i); } else if (i < n->n_vals && !zix_btree_node_is_minimal(n->children[i + 1])) { n = zix_btree_rotate_left(n, i); } else { if (i < n->n_vals) { n = zix_btree_merge(t, n, i); } else { n = zix_btree_merge(t, n, i - 1); if (ti) { --ti->stack[ti->level].index; } } } } else { n = n->children[i]; } } if (ti) { ++ti->level; } } # 571 "sord-0.16.0/src/zix/btree.c" 3 4 ((void) (0)) # 571 "sord-0.16.0/src/zix/btree.c" ; return ZIX_STATUS_ERROR; } static inline ZixStatus zix_btree_find(const ZixBTree* const t, const void* const e, ZixBTreeIter** const ti) { ZixBTreeNode* n = t->root; if (!(*ti = zix_btree_iter_new(t))) { return ZIX_STATUS_NO_MEM; } while (n) { # 586 "sord-0.16.0/src/zix/btree.c" 3 4 _Bool # 586 "sord-0.16.0/src/zix/btree.c" equal = # 586 "sord-0.16.0/src/zix/btree.c" 3 4 0 # 586 "sord-0.16.0/src/zix/btree.c" ; const uint16_t i = zix_btree_node_find(t, n, e, &equal); zix_btree_iter_set_frame(*ti, n, i); if (equal) { return ZIX_STATUS_SUCCESS; } else if (n->is_leaf) { break; } else { ++(*ti)->level; n = n->children[i]; } } zix_btree_iter_free(*ti); *ti = # 602 "sord-0.16.0/src/zix/btree.c" 3 4 ((void *)0) # 602 "sord-0.16.0/src/zix/btree.c" ; return ZIX_STATUS_NOT_FOUND; } static inline ZixStatus zix_btree_lower_bound(const ZixBTree* const t, const void* const e, ZixBTreeIter** const ti) { if (!t) { *ti = # 612 "sord-0.16.0/src/zix/btree.c" 3 4 ((void *)0) # 612 "sord-0.16.0/src/zix/btree.c" ; return ZIX_STATUS_BAD_ARG; } ZixBTreeNode* n = t->root; # 617 "sord-0.16.0/src/zix/btree.c" 3 4 _Bool # 617 "sord-0.16.0/src/zix/btree.c" found = # 617 "sord-0.16.0/src/zix/btree.c" 3 4 0 # 617 "sord-0.16.0/src/zix/btree.c" ; unsigned found_level = 0; if (!(*ti = zix_btree_iter_new(t))) { return ZIX_STATUS_NO_MEM; } while (n) { # 624 "sord-0.16.0/src/zix/btree.c" 3 4 _Bool # 624 "sord-0.16.0/src/zix/btree.c" equal = # 624 "sord-0.16.0/src/zix/btree.c" 3 4 0 # 624 "sord-0.16.0/src/zix/btree.c" ; const uint16_t i = zix_btree_node_find(t, n, e, &equal); zix_btree_iter_set_frame(*ti, n, i); if (equal) { found_level = (*ti)->level; found = # 631 "sord-0.16.0/src/zix/btree.c" 3 4 1 # 631 "sord-0.16.0/src/zix/btree.c" ; } if (n->is_leaf) { break; } else { ++(*ti)->level; n = n->children[i]; # 639 "sord-0.16.0/src/zix/btree.c" 3 4 ((void) (0)) # 639 "sord-0.16.0/src/zix/btree.c" ; } } const ZixBTreeIterFrame* const frame = &(*ti)->stack[(*ti)->level]; if (frame->index == frame->node->n_vals) { if (found) { (*ti)->level = found_level; } else { (*ti)->stack[0].node = # 650 "sord-0.16.0/src/zix/btree.c" 3 4 ((void *)0) # 650 "sord-0.16.0/src/zix/btree.c" ; } } return ZIX_STATUS_SUCCESS; } static inline void* zix_btree_get(const ZixBTreeIter* const ti) { const ZixBTreeIterFrame* const frame = &ti->stack[ti->level]; printf("%d\n", ti->level); if (frame->index >= frame->node->n_vals) printf("overflow!\n"); return frame->node->vals[frame->index]; } static inline ZixBTreeIter* zix_btree_begin(const ZixBTree* const t) { ZixBTreeIter* const i = zix_btree_iter_new(t); if (!i) { return # 676 "sord-0.16.0/src/zix/btree.c" 3 4 ((void *)0) # 676 "sord-0.16.0/src/zix/btree.c" ; } else if (t->size == 0) { i->stack[0].node = # 678 "sord-0.16.0/src/zix/btree.c" 3 4 ((void *)0) # 678 "sord-0.16.0/src/zix/btree.c" ; } else { ZixBTreeNode* n = t->root; i->stack[0].node = n; i->stack[0].index = 0; while (!n->is_leaf) { n = n->children[0]; ++i->level; i->stack[i->level].node = n; i->stack[i->level].index = 0; } } return i; } static inline # 693 "sord-0.16.0/src/zix/btree.c" 3 4 _Bool # 694 "sord-0.16.0/src/zix/btree.c" zix_btree_iter_is_end(const ZixBTreeIter* const i) { return !i || i->stack[0].node == # 696 "sord-0.16.0/src/zix/btree.c" 3 4 ((void *)0) # 696 "sord-0.16.0/src/zix/btree.c" ; } static inline void __attribute__((always_inline)) zix_btree_iter_increment(ZixBTreeIter* const i) { ZixBTreeIterFrame* f = &i->stack[i->level]; if (f->node->is_leaf) { printf("l\n"); # 707 "sord-0.16.0/src/zix/btree.c" 3 4 ((void) (0)) # 707 "sord-0.16.0/src/zix/btree.c" ; if (++f->index == f->node->n_vals) { printf("e\n"); f = &i->stack[i->level]; while (i->level > 0 && f->index == f->node->n_vals) { f = &i->stack[--i->level]; # 714 "sord-0.16.0/src/zix/btree.c" 3 4 ((void) (0)) # 714 "sord-0.16.0/src/zix/btree.c" ; } if (f->index == f->node->n_vals) { # 719 "sord-0.16.0/src/zix/btree.c" 3 4 ((void) (0)) # 719 "sord-0.16.0/src/zix/btree.c" ; f->node = # 720 "sord-0.16.0/src/zix/btree.c" 3 4 ((void *)0) # 720 "sord-0.16.0/src/zix/btree.c" ; f->index = 0; } } } else { printf("i\n"); # 727 "sord-0.16.0/src/zix/btree.c" 3 4 ((void) (0)) # 727 "sord-0.16.0/src/zix/btree.c" ; ZixBTreeNode* child = f->node->children[++f->index]; f = &i->stack[++i->level]; f->node = child; f->index = 0; while (!f->node->is_leaf) { child = f->node->children[0]; f = &i->stack[++i->level]; f->node = child; f->index = 0; } } } static inline void zix_btree_iter_free(ZixBTreeIter* const i) { free(i); } # 29 "sord-0.16.0/src/sord.c" 2 # 1 "config/sord_config.h" 1 # 31 "sord-0.16.0/src/sord.c" 2 # 1 "sord-0.16.0/src/sord_internal.h" 1 # 20 "sord-0.16.0/src/sord_internal.h" # 1 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stddef.h" 1 3 4 # 21 "sord-0.16.0/src/sord_internal.h" 2 # 1 "../../includes/sord/sord.h" 1 # 24 "../../includes/sord/sord.h" # 1 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stddef.h" 1 3 4 # 25 "../../includes/sord/sord.h" 2 # 1 "../../includes/serd/serd.h" 1 # 24 "../../includes/serd/serd.h" # 1 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stdarg.h" 1 3 4 # 25 "../../includes/serd/serd.h" 2 # 1 "/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/include/stddef.h" 1 3 4 # 26 "../../includes/serd/serd.h" 2 # 64 "../../includes/serd/serd.h" typedef struct SerdEnvImpl SerdEnv; typedef struct SerdReaderImpl SerdReader; # 82 "../../includes/serd/serd.h" typedef struct SerdWriterImpl SerdWriter; typedef enum { SERD_SUCCESS, SERD_FAILURE, SERD_ERR_UNKNOWN, SERD_ERR_BAD_SYNTAX, SERD_ERR_BAD_ARG, SERD_ERR_NOT_FOUND, SERD_ERR_ID_CLASH, SERD_ERR_BAD_CURIE, SERD_ERR_INTERNAL } SerdStatus; typedef enum { SERD_TURTLE = 1, SERD_NTRIPLES = 2 } SerdSyntax; typedef enum { SERD_EMPTY_S = 1 << 1, SERD_EMPTY_O = 1 << 2, SERD_ANON_S_BEGIN = 1 << 3, SERD_ANON_O_BEGIN = 1 << 4, SERD_ANON_CONT = 1 << 5, SERD_LIST_S_BEGIN = 1 << 6, SERD_LIST_O_BEGIN = 1 << 7, SERD_LIST_CONT = 1 << 8 } SerdStatementFlag; typedef uint32_t SerdStatementFlags; # 144 "../../includes/serd/serd.h" typedef enum { SERD_NOTHING = 0, SERD_LITERAL = 1, # 167 "../../includes/serd/serd.h" SERD_URI = 2, # 176 "../../includes/serd/serd.h" SERD_CURIE = 3, # 186 "../../includes/serd/serd.h" SERD_BLANK = 4 } SerdType; typedef enum { SERD_HAS_NEWLINE = 1, SERD_HAS_QUOTE = 1 << 1 } SerdNodeFlag; typedef uint32_t SerdNodeFlags; typedef struct { const uint8_t* buf; size_t n_bytes; size_t n_chars; SerdNodeFlags flags; SerdType type; } SerdNode; typedef struct { const uint8_t* buf; size_t len; } SerdChunk; typedef struct { SerdStatus status; const uint8_t* filename; unsigned line; unsigned col; const char* fmt; va_list* args; } SerdError; # 241 "../../includes/serd/serd.h" typedef struct { SerdChunk scheme; SerdChunk authority; SerdChunk path_base; SerdChunk path; SerdChunk query; SerdChunk fragment; } SerdURI; # 258 "../../includes/serd/serd.h" typedef enum { SERD_STYLE_ABBREVIATED = 1, SERD_STYLE_ASCII = 1 << 1, SERD_STYLE_RESOLVED = 1 << 2, SERD_STYLE_CURIED = 1 << 3, SERD_STYLE_BULK = 1 << 4 } SerdStyle; # 274 "../../includes/serd/serd.h" const uint8_t* serd_strerror(SerdStatus status); # 285 "../../includes/serd/serd.h" size_t serd_strlen(const uint8_t* str, size_t* n_bytes, SerdNodeFlags* flags); # 296 "../../includes/serd/serd.h" double serd_strtod(const char* str, char** endptr); # 310 "../../includes/serd/serd.h" void* serd_base64_decode(const uint8_t* str, size_t len, size_t* size); static const SerdURI SERD_URI_NULL = { { # 321 "../../includes/serd/serd.h" 3 4 ((void *)0) # 321 "../../includes/serd/serd.h" , 0}, { # 321 "../../includes/serd/serd.h" 3 4 ((void *)0) # 321 "../../includes/serd/serd.h" , 0}, { # 321 "../../includes/serd/serd.h" 3 4 ((void *)0) # 321 "../../includes/serd/serd.h" , 0}, { # 321 "../../includes/serd/serd.h" 3 4 ((void *)0) # 321 "../../includes/serd/serd.h" , 0}, { # 321 "../../includes/serd/serd.h" 3 4 ((void *)0) # 321 "../../includes/serd/serd.h" , 0}, { # 321 "../../includes/serd/serd.h" 3 4 ((void *)0) # 321 "../../includes/serd/serd.h" , 0} }; # 331 "../../includes/serd/serd.h" const uint8_t* serd_uri_to_path(const uint8_t* uri); # 343 "../../includes/serd/serd.h" uint8_t* serd_file_uri_parse(const uint8_t* uri, uint8_t** hostname); # 351 "../../includes/serd/serd.h" 3 4 _Bool # 352 "../../includes/serd/serd.h" serd_uri_string_has_scheme(const uint8_t* utf8); SerdStatus serd_uri_parse(const uint8_t* utf8, SerdURI* out); void serd_uri_resolve(const SerdURI* uri, const SerdURI* base, SerdURI* out); typedef size_t (*SerdSink)(const void* buf, size_t len, void* stream); size_t serd_uri_serialise(const SerdURI* uri, SerdSink sink, void* stream); # 387 "../../includes/serd/serd.h" size_t serd_uri_serialise_relative(const SerdURI* uri, const SerdURI* base, const SerdURI* root, SerdSink sink, void* stream); static const SerdNode SERD_NODE_NULL = { # 401 "../../includes/serd/serd.h" 3 4 ((void *)0) # 401 "../../includes/serd/serd.h" , 0, 0, 0, SERD_NOTHING }; SerdNode serd_node_from_string(SerdType type, const uint8_t* str); SerdNode serd_node_copy(const SerdNode* node); # 425 "../../includes/serd/serd.h" 3 4 _Bool # 426 "../../includes/serd/serd.h" serd_node_equals(const SerdNode* a, const SerdNode* b); SerdNode serd_node_new_uri_from_node(const SerdNode* uri_node, const SerdURI* base, SerdURI* out); SerdNode serd_node_new_uri_from_string(const uint8_t* str, const SerdURI* base, SerdURI* out); # 456 "../../includes/serd/serd.h" SerdNode serd_node_new_file_uri(const uint8_t* path, const uint8_t* hostname, SerdURI* out, # 461 "../../includes/serd/serd.h" 3 4 _Bool # 461 "../../includes/serd/serd.h" escape); # 473 "../../includes/serd/serd.h" SerdNode serd_node_new_uri(const SerdURI* uri, const SerdURI* base, SerdURI* out); # 489 "../../includes/serd/serd.h" SerdNode serd_node_new_relative_uri(const SerdURI* uri, const SerdURI* base, const SerdURI* root, SerdURI* out); # 511 "../../includes/serd/serd.h" SerdNode serd_node_new_decimal(double d, unsigned frac_digits); SerdNode serd_node_new_integer(int64_t i); # 531 "../../includes/serd/serd.h" SerdNode serd_node_new_blob(const void* buf, size_t size, # 533 "../../includes/serd/serd.h" 3 4 _Bool # 533 "../../includes/serd/serd.h" wrap_lines); void serd_node_free(SerdNode* node); # 557 "../../includes/serd/serd.h" typedef SerdStatus (*SerdErrorSink)(void* handle, const SerdError* error); typedef SerdStatus (*SerdBaseSink)(void* handle, const SerdNode* uri); typedef SerdStatus (*SerdPrefixSink)(void* handle, const SerdNode* name, const SerdNode* uri); typedef SerdStatus (*SerdStatementSink)(void* handle, SerdStatementFlags flags, const SerdNode* graph, const SerdNode* subject, const SerdNode* predicate, const SerdNode* object, const SerdNode* object_datatype, const SerdNode* object_lang); # 598 "../../includes/serd/serd.h" typedef SerdStatus (*SerdEndSink)(void* handle, const SerdNode* node); # 610 "../../includes/serd/serd.h" SerdEnv* serd_env_new(const SerdNode* base_uri); void serd_env_free(SerdEnv* env); const SerdNode* serd_env_get_base_uri(const SerdEnv* env, SerdURI* out); SerdStatus serd_env_set_base_uri(SerdEnv* env, const SerdNode* uri); SerdStatus serd_env_set_prefix(SerdEnv* env, const SerdNode* name, const SerdNode* uri); SerdStatus serd_env_set_prefix_from_strings(SerdEnv* env, const uint8_t* name, const uint8_t* uri); # 659 "../../includes/serd/serd.h" 3 4 _Bool # 660 "../../includes/serd/serd.h" serd_env_qualify(const SerdEnv* env, const SerdNode* uri, SerdNode* prefix, SerdChunk* suffix); SerdStatus serd_env_expand(const SerdEnv* env, const SerdNode* curie, SerdChunk* uri_prefix, SerdChunk* uri_suffix); SerdNode serd_env_expand_node(const SerdEnv* env, const SerdNode* node); void serd_env_foreach(const SerdEnv* env, SerdPrefixSink func, void* handle); # 701 "../../includes/serd/serd.h" SerdReader* serd_reader_new(SerdSyntax syntax, void* handle, void (*free_handle)(void*), SerdBaseSink base_sink, SerdPrefixSink prefix_sink, SerdStatementSink statement_sink, SerdEndSink end_sink); # 718 "../../includes/serd/serd.h" void serd_reader_set_strict(SerdReader* reader, # 720 "../../includes/serd/serd.h" 3 4 _Bool # 720 "../../includes/serd/serd.h" strict); void serd_reader_set_error_sink(SerdReader* reader, SerdErrorSink error_sink, void* handle); void* serd_reader_get_handle(const SerdReader* reader); # 750 "../../includes/serd/serd.h" void serd_reader_add_blank_prefix(SerdReader* reader, const uint8_t* prefix); # 762 "../../includes/serd/serd.h" void serd_reader_set_default_graph(SerdReader* reader, const SerdNode* graph); SerdStatus serd_reader_read_file(SerdReader* reader, const uint8_t* uri); # 783 "../../includes/serd/serd.h" SerdStatus serd_reader_start_stream(SerdReader* me, FILE* file, const uint8_t* name, # 788 "../../includes/serd/serd.h" 3 4 _Bool # 788 "../../includes/serd/serd.h" bulk); # 798 "../../includes/serd/serd.h" SerdStatus serd_reader_read_chunk(SerdReader* me); SerdStatus serd_reader_end_stream(SerdReader* me); SerdStatus serd_reader_read_file_handle(SerdReader* reader, FILE* file, const uint8_t* name); SerdStatus serd_reader_read_string(SerdReader* me, const uint8_t* utf8); void serd_reader_free(SerdReader* reader); # 841 "../../includes/serd/serd.h" SerdWriter* serd_writer_new(SerdSyntax syntax, SerdStyle style, SerdEnv* env, const SerdURI* base_uri, SerdSink sink, void* stream); void serd_writer_free(SerdWriter* writer); SerdEnv* serd_writer_get_env(SerdWriter* writer); size_t serd_file_sink(const void* buf, size_t len, void* stream); # 882 "../../includes/serd/serd.h" size_t serd_chunk_sink(const void* buf, size_t len, void* stream); uint8_t* serd_chunk_sink_finish(SerdChunk* stream); void serd_writer_set_error_sink(SerdWriter* writer, SerdErrorSink error_sink, void* handle); void serd_writer_chop_blank_prefix(SerdWriter* writer, const uint8_t* prefix); SerdStatus serd_writer_set_base_uri(SerdWriter* writer, const SerdNode* uri); # 936 "../../includes/serd/serd.h" SerdStatus serd_writer_set_root_uri(SerdWriter* writer, const SerdNode* uri); SerdStatus serd_writer_set_prefix(SerdWriter* writer, const SerdNode* name, const SerdNode* uri); SerdStatus serd_writer_write_statement(SerdWriter* writer, SerdStatementFlags flags, const SerdNode* graph, const SerdNode* subject, const SerdNode* predicate, const SerdNode* object, const SerdNode* object_datatype, const SerdNode* object_lang); SerdStatus serd_writer_end_anon(SerdWriter* writer, const SerdNode* node); SerdStatus serd_writer_finish(SerdWriter* writer); # 29 "../../includes/sord/sord.h" 2 # 66 "../../includes/sord/sord.h" typedef struct SordWorldImpl SordWorld; # 75 "../../includes/sord/sord.h" typedef struct SordModelImpl SordModel; # 84 "../../includes/sord/sord.h" typedef struct SordInserterImpl SordInserter; typedef struct SordIterImpl SordIter; typedef struct SordNodeImpl SordNode; typedef const SordNode* SordQuad[4]; typedef enum { SORD_SUBJECT = 0, SORD_PREDICATE = 1, SORD_OBJECT = 2, SORD_GRAPH = 3 } SordQuadIndex; typedef enum { SORD_URI = 1, SORD_BLANK = 2, SORD_LITERAL = 3 } SordNodeType; typedef enum { SORD_SPO = 1, SORD_SOP = 1 << 1, SORD_OPS = 1 << 2, SORD_OSP = 1 << 3, SORD_PSO = 1 << 4, SORD_POS = 1 << 5 } SordIndexOption; # 148 "../../includes/sord/sord.h" SordWorld* sord_world_new(void); void sord_world_free(SordWorld* world); void sord_world_set_error_sink(SordWorld* world, SerdErrorSink error_sink, void* handle); # 183 "../../includes/sord/sord.h" SordNode* sord_new_uri(SordWorld* world, const uint8_t* uri); SordNode* sord_new_relative_uri(SordWorld* world, const uint8_t* str, const uint8_t* base_uri); SordNode* sord_new_blank(SordWorld* world, const uint8_t* str); SordNode* sord_new_literal(SordWorld* world, SordNode* datatype, const uint8_t* str, const char* lang); SordNode* sord_node_copy(const SordNode* node); void sord_node_free(SordWorld* world, SordNode* node); SordNodeType sord_node_get_type(const SordNode* node); const uint8_t* sord_node_get_string(const SordNode* node); const uint8_t* sord_node_get_string_counted(const SordNode* node, size_t* bytes); const uint8_t* sord_node_get_string_measured(const SordNode* node, size_t* bytes, size_t* chars); const char* sord_node_get_language(const SordNode* node); SordNode* sord_node_get_datatype(const SordNode* node); SerdNodeFlags sord_node_get_flags(const SordNode* node); # 295 "../../includes/sord/sord.h" # 296 "../../includes/sord/sord.h" 3 4 _Bool # 297 "../../includes/sord/sord.h" sord_node_is_inline_object(const SordNode* node); # 305 "../../includes/sord/sord.h" 3 4 _Bool # 306 "../../includes/sord/sord.h" sord_node_equals(const SordNode* a, const SordNode* b); const SerdNode* sord_node_to_serd_node(const SordNode* node); SordNode* sord_node_from_serd_node(SordWorld* world, SerdEnv* env, const SerdNode* node, const SerdNode* datatype, const SerdNode* lang); # 348 "../../includes/sord/sord.h" SordModel* sord_new(SordWorld* world, unsigned indices, # 352 "../../includes/sord/sord.h" 3 4 _Bool # 352 "../../includes/sord/sord.h" graphs); void sord_free(SordModel* model); SordWorld* sord_get_world(SordModel* model); size_t sord_num_nodes(const SordWorld* world); size_t sord_num_quads(const SordModel* model); SordIter* sord_begin(const SordModel* model); SordIter* sord_find(SordModel* model, const SordQuad pat); SordIter* sord_search(SordModel* model, const SordNode* s, const SordNode* p, const SordNode* o, const SordNode* g); SordNode* sord_get(SordModel* model, const SordNode* s, const SordNode* p, const SordNode* o, const SordNode* g); # 429 "../../includes/sord/sord.h" 3 4 _Bool # 430 "../../includes/sord/sord.h" sord_ask(SordModel* model, const SordNode* s, const SordNode* p, const SordNode* o, const SordNode* g); uint64_t sord_count(SordModel* model, const SordNode* s, const SordNode* p, const SordNode* o, const SordNode* g); # 453 "../../includes/sord/sord.h" 3 4 _Bool # 454 "../../includes/sord/sord.h" sord_contains(SordModel* model, const SordQuad pat); # 463 "../../includes/sord/sord.h" # 464 "../../includes/sord/sord.h" 3 4 _Bool # 465 "../../includes/sord/sord.h" sord_add(SordModel* model, const SordQuad quad); void sord_remove(SordModel* model, const SordQuad quad); # 486 "../../includes/sord/sord.h" SerdStatus sord_erase(SordModel* model, SordIter* iter); # 499 "../../includes/sord/sord.h" SordInserter* sord_inserter_new(SordModel* model, SerdEnv* env); void sord_inserter_free(SordInserter* inserter); SerdStatus sord_inserter_set_base_uri(SordInserter* inserter, const SerdNode* uri); SerdStatus sord_inserter_set_prefix(SordInserter* inserter, const SerdNode* name, const SerdNode* uri); SerdStatus sord_inserter_write_statement(SordInserter* inserter, SerdStatementFlags flags, const SerdNode* graph, const SerdNode* subject, const SerdNode* predicate, const SerdNode* object, const SerdNode* object_datatype, const SerdNode* object_lang); # 557 "../../includes/sord/sord.h" void sord_iter_get(const SordIter* iter, SordQuad quad); const SordNode* sord_iter_get_node(const SordIter* iter, SordQuadIndex index); const SordModel* sord_iter_get_model(SordIter* iter); # 581 "../../includes/sord/sord.h" 3 4 _Bool # 582 "../../includes/sord/sord.h" sord_iter_next(SordIter* iter); # 588 "../../includes/sord/sord.h" 3 4 _Bool # 589 "../../includes/sord/sord.h" sord_iter_end(const SordIter* iter); void sord_iter_free(SordIter* iter); # 611 "../../includes/sord/sord.h" # 612 "../../includes/sord/sord.h" 3 4 _Bool # 613 "../../includes/sord/sord.h" sord_quad_match(const SordQuad x, const SordQuad y); # 624 "../../includes/sord/sord.h" SerdReader* sord_new_reader(SordModel* model, SerdEnv* env, SerdSyntax syntax, SordNode* graph); # 635 "../../includes/sord/sord.h" 3 4 _Bool # 636 "../../includes/sord/sord.h" sord_write(SordModel* model, SerdWriter* writer, SordNode* graph); # 646 "../../includes/sord/sord.h" 3 4 _Bool # 647 "../../includes/sord/sord.h" sord_write_iter(SordIter* iter, SerdWriter* writer); # 24 "sord-0.16.0/src/sord_internal.h" 2 # 32 "sord-0.16.0/src/sord_internal.h" typedef struct { size_t refs_as_obj; } SordResourceMetadata; typedef struct { SordNode* datatype; char lang[16]; } SordLiteralMetadata; struct SordNodeImpl { SerdNode node; size_t refs; union { SordResourceMetadata res; SordLiteralMetadata lit; } meta; }; # 32 "sord-0.16.0/src/sord.c" 2 # 71 "sord-0.16.0/src/sord.c" typedef enum { SPO, SOP, OPS, OSP, PSO, POS, GSPO, GSOP, GOPS, GOSP, GPSO, GPOS } SordOrder; # 98 "sord-0.16.0/src/sord.c" static const int orderings[12][3 + 1] = { { 0, 1, 2, 3 }, { 0, 2, 1, 3 }, { 2, 1, 0, 3 }, { 2, 0, 1, 3 }, { 1, 0, 2, 3 }, { 1, 2, 0, 3 }, { 3, 0, 1, 2 }, { 3, 0, 2, 1 }, { 3, 2, 1, 0 }, { 3, 2, 0, 1 }, { 3, 1, 0, 2 }, { 3, 1, 2, 0 } }; struct SordWorldImpl { ZixHash* nodes; SerdErrorSink error_sink; void* error_handle; }; struct SordModelImpl { SordWorld* world; ZixBTree* indices[12]; size_t n_quads; size_t n_iters; }; typedef enum { ALL, SINGLE, RANGE, FILTER_RANGE, FILTER_ALL } SearchMode; struct SordIterImpl { const SordModel* sord; ZixBTreeIter* cur; SordQuad pat; SordOrder order; SearchMode mode; int n_prefix; # 144 "sord-0.16.0/src/sord.c" 3 4 _Bool # 144 "sord-0.16.0/src/sord.c" end; # 145 "sord-0.16.0/src/sord.c" 3 4 _Bool # 145 "sord-0.16.0/src/sord.c" skip_graphs; }; static uint32_t sord_node_hash(const void* n) { const SordNode* node = (const SordNode*)n; uint32_t hash = zix_digest_start(); hash = zix_digest_add(hash, node->node.buf, node->node.n_bytes); hash = zix_digest_add(hash, &node->node.type, sizeof(node->node.type)); if (node->node.type == SERD_LITERAL) { hash = zix_digest_add(hash, &node->meta.lit, sizeof(node->meta.lit)); } return hash; } static # 161 "sord-0.16.0/src/sord.c" 3 4 _Bool # 162 "sord-0.16.0/src/sord.c" sord_node_hash_equal(const void* a, const void* b) { const SordNode* a_node = (const SordNode*)a; const SordNode* b_node = (const SordNode*)b; return (a_node == b_node) || ((a_node->node.type == b_node->node.type) && (a_node->node.type != SERD_LITERAL || (a_node->meta.lit.datatype == b_node->meta.lit.datatype && !strncmp(a_node->meta.lit.lang, b_node->meta.lit.lang, sizeof(a_node->meta.lit.lang)))) && (serd_node_equals(&a_node->node, &b_node->node))); } static void error(SordWorld* world, SerdStatus st, const char* fmt, ...) { va_list args; # 180 "sord-0.16.0/src/sord.c" 3 4 __builtin_va_start( # 180 "sord-0.16.0/src/sord.c" args # 180 "sord-0.16.0/src/sord.c" 3 4 , # 180 "sord-0.16.0/src/sord.c" fmt # 180 "sord-0.16.0/src/sord.c" 3 4 ) # 180 "sord-0.16.0/src/sord.c" ; const SerdError e = { st, # 181 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 181 "sord-0.16.0/src/sord.c" , 0, 0, fmt, &args }; if (world->error_sink) { world->error_sink(world->error_handle, &e); } else { fprintf( # 185 "sord-0.16.0/src/sord.c" 3 4 stderr # 185 "sord-0.16.0/src/sord.c" , "error: "); vfprintf( # 186 "sord-0.16.0/src/sord.c" 3 4 stderr # 186 "sord-0.16.0/src/sord.c" , fmt, args); } # 188 "sord-0.16.0/src/sord.c" 3 4 __builtin_va_end( # 188 "sord-0.16.0/src/sord.c" args # 188 "sord-0.16.0/src/sord.c" 3 4 ) # 188 "sord-0.16.0/src/sord.c" ; } SordWorld* sord_world_new(void) { SordWorld* world = (SordWorld*)malloc(sizeof(SordWorld)); world->error_sink = # 195 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 195 "sord-0.16.0/src/sord.c" ; world->error_handle = # 196 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 196 "sord-0.16.0/src/sord.c" ; world->nodes = zix_hash_new( sord_node_hash, sord_node_hash_equal, sizeof(SordNode)); return world; } static void free_node_entry(void* value, void* user_data) { SordNode* node = (SordNode*)value; if (node->node.type == SERD_LITERAL) { sord_node_free((SordWorld*)user_data, node->meta.lit.datatype); } free((uint8_t*)node->node.buf); } void sord_world_free(SordWorld* world) { zix_hash_foreach(world->nodes, free_node_entry, world); zix_hash_free(world->nodes); free(world); } void sord_world_set_error_sink(SordWorld* world, SerdErrorSink error_sink, void* handle) { world->error_sink = error_sink; world->error_handle = handle; } static inline int sord_node_compare(const SordNode* a, const SordNode* b) { if (a == b || !a || !b) { return 0; } else if (a->node.type != b->node.type) { return a->node.type - b->node.type; } int cmp = 0; switch (a->node.type) { case SERD_URI: case SERD_BLANK: return strcmp((const char*)a->node.buf, (const char*)b->node.buf); case SERD_LITERAL: cmp = strcmp((const char*)sord_node_get_string(a), (const char*)sord_node_get_string(b)); if (cmp == 0) { if (!a->meta.lit.datatype || !b->meta.lit.datatype) { cmp = a->meta.lit.datatype - b->meta.lit.datatype; } else { cmp = strcmp((const char*)a->meta.lit.datatype->node.buf, (const char*)b->meta.lit.datatype->node.buf); } } if (cmp == 0) { cmp = strcmp(a->meta.lit.lang, b->meta.lit.lang); } default: break; } return cmp; } # 267 "sord-0.16.0/src/sord.c" 3 4 _Bool # 268 "sord-0.16.0/src/sord.c" sord_node_equals(const SordNode* a, const SordNode* b) { return a == b; } static inline # 274 "sord-0.16.0/src/sord.c" 3 4 _Bool # 275 "sord-0.16.0/src/sord.c" sord_id_match(const SordNode* a, const SordNode* b) { return !a || !b || (a == b); } static inline # 280 "sord-0.16.0/src/sord.c" 3 4 _Bool # 281 "sord-0.16.0/src/sord.c" sord_quad_match_inline(const SordQuad x, const SordQuad y) { return sord_id_match(x[0], y[0]) && sord_id_match(x[1], y[1]) && sord_id_match(x[2], y[2]) && sord_id_match(x[3], y[3]); } # 289 "sord-0.16.0/src/sord.c" 3 4 _Bool # 290 "sord-0.16.0/src/sord.c" sord_quad_match(const SordQuad x, const SordQuad y) { return sord_quad_match_inline(x, y); } static int sord_quad_compare(const void* x_ptr, const void* y_ptr, void* user_data) { const int* const ordering = (const int*)user_data; const SordNode*const*const x = (const SordNode*const*)x_ptr; const SordNode*const*const y = (const SordNode*const*)y_ptr; for (int i = 0; i < 3 + 1; ++i) { const int idx = ordering[i]; const int cmp = sord_node_compare(x[idx], y[idx]); if (cmp) { return cmp; } } return 0; } static inline # 318 "sord-0.16.0/src/sord.c" 3 4 _Bool # 319 "sord-0.16.0/src/sord.c" sord_iter_forward(SordIter* iter) { if (!iter->skip_graphs) { zix_btree_iter_increment(iter->cur); return zix_btree_iter_is_end(iter->cur); } SordNode** key = (SordNode**)zix_btree_get(iter->cur); const SordQuad initial = { key[0], key[1], key[2], key[3] }; zix_btree_iter_increment(iter->cur); while (!zix_btree_iter_is_end(iter->cur)) { key = (SordNode**)zix_btree_get(iter->cur); for (int i = 0; i < 3; ++i) if (key[i] != initial[i]) return # 333 "sord-0.16.0/src/sord.c" 3 4 0 # 333 "sord-0.16.0/src/sord.c" ; zix_btree_iter_increment(iter->cur); } return # 338 "sord-0.16.0/src/sord.c" 3 4 1 # 338 "sord-0.16.0/src/sord.c" ; } static inline # 345 "sord-0.16.0/src/sord.c" 3 4 _Bool # 346 "sord-0.16.0/src/sord.c" sord_iter_seek_match(SordIter* iter) { for (iter->end = # 348 "sord-0.16.0/src/sord.c" 3 4 1 # 348 "sord-0.16.0/src/sord.c" ; !zix_btree_iter_is_end(iter->cur); sord_iter_forward(iter)) { const SordNode** const key = (const SordNode**)zix_btree_get(iter->cur); if (sord_quad_match_inline(key, iter->pat)) return (iter->end = # 353 "sord-0.16.0/src/sord.c" 3 4 0 # 353 "sord-0.16.0/src/sord.c" ); } return # 355 "sord-0.16.0/src/sord.c" 3 4 1 # 355 "sord-0.16.0/src/sord.c" ; } static inline # 363 "sord-0.16.0/src/sord.c" 3 4 _Bool # 364 "sord-0.16.0/src/sord.c" sord_iter_seek_match_range(SordIter* iter) { # 366 "sord-0.16.0/src/sord.c" 3 4 ((void) (0)) # 366 "sord-0.16.0/src/sord.c" ; do { const SordNode** key = (const SordNode**)zix_btree_get(iter->cur); if (sord_quad_match_inline(key, iter->pat)) return # 372 "sord-0.16.0/src/sord.c" 3 4 0 # 372 "sord-0.16.0/src/sord.c" ; for (int i = 0; i < iter->n_prefix; ++i) { const int idx = orderings[iter->order][i]; if (!sord_id_match(key[idx], iter->pat[idx])) { iter->end = # 377 "sord-0.16.0/src/sord.c" 3 4 1 # 377 "sord-0.16.0/src/sord.c" ; return # 378 "sord-0.16.0/src/sord.c" 3 4 1 # 378 "sord-0.16.0/src/sord.c" ; } } } while (!sord_iter_forward(iter)); return (iter->end = # 383 "sord-0.16.0/src/sord.c" 3 4 1 # 383 "sord-0.16.0/src/sord.c" ); } static SordIter* sord_iter_new(const SordModel* sord, ZixBTreeIter* cur, const SordQuad pat, SordOrder order, SearchMode mode, int n_prefix) { SordIter* iter = (SordIter*)malloc(sizeof(SordIter)); iter->sord = sord; iter->cur = cur; iter->order = order; iter->mode = mode; iter->n_prefix = n_prefix; iter->end = # 396 "sord-0.16.0/src/sord.c" 3 4 0 # 396 "sord-0.16.0/src/sord.c" ; iter->skip_graphs = order < GSPO; for (int i = 0; i < 3 + 1; ++i) { iter->pat[i] = pat[i]; } switch (iter->mode) { case ALL: case SINGLE: case RANGE: # 406 "sord-0.16.0/src/sord.c" 3 4 ((void) (0)) # 408 "sord-0.16.0/src/sord.c" ; break; case FILTER_RANGE: sord_iter_seek_match_range(iter); break; case FILTER_ALL: sord_iter_seek_match(iter); break; } # 426 "sord-0.16.0/src/sord.c" ++((SordModel*)sord)->n_iters; return iter; } const SordModel* sord_iter_get_model(SordIter* iter) { return iter->sord; } void sord_iter_get(const SordIter* iter, SordQuad id) { SordNode** key = (SordNode**)zix_btree_get(iter->cur); for (int i = 0; i < 3 + 1; ++i) { id[i] = key[i]; } } const SordNode* sord_iter_get_node(const SordIter* iter, SordQuadIndex index) { return (!sord_iter_end(iter) ? ((SordNode**)zix_btree_get(iter->cur))[index] : # 450 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 450 "sord-0.16.0/src/sord.c" ); } static # 453 "sord-0.16.0/src/sord.c" 3 4 _Bool # 454 "sord-0.16.0/src/sord.c" sord_iter_scan_next(SordIter* iter) { if (iter->end) { return # 457 "sord-0.16.0/src/sord.c" 3 4 1 # 457 "sord-0.16.0/src/sord.c" ; } const SordNode** key; if (!iter->end) { switch (iter->mode) { case ALL: break; case SINGLE: iter->end = # 467 "sord-0.16.0/src/sord.c" 3 4 1 # 467 "sord-0.16.0/src/sord.c" ; ; break; case RANGE: ; key = (const SordNode**)zix_btree_get(iter->cur); # 474 "sord-0.16.0/src/sord.c" 3 4 ((void) (0)) # 474 "sord-0.16.0/src/sord.c" ; for (int i = 0; i < iter->n_prefix; ++i) { const int idx = orderings[iter->order][i]; if (!sord_id_match(key[idx], iter->pat[idx])) { iter->end = # 478 "sord-0.16.0/src/sord.c" 3 4 1 # 478 "sord-0.16.0/src/sord.c" ; ; break; } } break; case FILTER_RANGE: sord_iter_seek_match_range(iter); break; case FILTER_ALL: sord_iter_seek_match(iter); break; } } else { ; } if (iter->end) { ; return # 499 "sord-0.16.0/src/sord.c" 3 4 1 # 499 "sord-0.16.0/src/sord.c" ; } else { return # 507 "sord-0.16.0/src/sord.c" 3 4 0 # 507 "sord-0.16.0/src/sord.c" ; } } # 511 "sord-0.16.0/src/sord.c" 3 4 _Bool # 512 "sord-0.16.0/src/sord.c" sord_iter_next(SordIter* iter) { if (iter->end) { return # 515 "sord-0.16.0/src/sord.c" 3 4 1 # 515 "sord-0.16.0/src/sord.c" ; } iter->end = sord_iter_forward(iter); return sord_iter_scan_next(iter); } # 522 "sord-0.16.0/src/sord.c" 3 4 _Bool # 523 "sord-0.16.0/src/sord.c" sord_iter_end(const SordIter* iter) { return !iter || iter->end; } void sord_iter_free(SordIter* iter) { ; if (iter) { --((SordModel*)iter->sord)->n_iters; zix_btree_iter_free(iter->cur); free(iter); } } static inline # 544 "sord-0.16.0/src/sord.c" 3 4 _Bool # 545 "sord-0.16.0/src/sord.c" sord_has_index(SordModel* sord, SordOrder* order, int* n_prefix, # 545 "sord-0.16.0/src/sord.c" 3 4 _Bool # 545 "sord-0.16.0/src/sord.c" graphs) { if (graphs) { *order = (SordOrder)(*order + GSPO); *n_prefix += 1; } return sord->indices[*order]; } # 562 "sord-0.16.0/src/sord.c" static inline SordOrder sord_best_index(SordModel* sord, const SordQuad pat, SearchMode* mode, int* n_prefix) { const # 568 "sord-0.16.0/src/sord.c" 3 4 _Bool # 568 "sord-0.16.0/src/sord.c" graph_search = (pat[3] != 0); const unsigned sig = (pat[0] ? 1 : 0) * 0x100 + (pat[1] ? 1 : 0) * 0x010 + (pat[2] ? 1 : 0) * 0x001; SordOrder good[2] = { (SordOrder)-1, (SordOrder)-1 }; # 586 "sord-0.16.0/src/sord.c" *mode = RANGE; *n_prefix = 0; switch (sig) { case 0x000: # 590 "sord-0.16.0/src/sord.c" 3 4 ((void) (0)) # 590 "sord-0.16.0/src/sord.c" ; *mode = RANGE; *n_prefix = 1; return GSPO; case 0x111: *mode = SINGLE; return graph_search ? GSPO : SPO; case 0x001: *mode = RANGE; good[0] = OPS; good[1] = OSP; *n_prefix = 1; break; case 0x010: *mode = RANGE; good[0] = POS; good[1] = PSO; *n_prefix = 1; break; case 0x011: *mode = RANGE; good[0] = OPS; good[1] = POS; *n_prefix = 2; break; case 0x100: *mode = RANGE; good[0] = SPO; good[1] = SOP; *n_prefix = 1; break; case 0x101: *mode = RANGE; good[0] = SOP; good[1] = OSP; *n_prefix = 2; break; case 0x110: *mode = RANGE; good[0] = SPO; good[1] = PSO; *n_prefix = 2; break; } if (*mode == RANGE) { if (sord_has_index(sord, &good[0], n_prefix, graph_search)) { return good[0]; } else if (sord_has_index(sord, &good[1], n_prefix, graph_search)) { return good[1]; } } switch (sig) { case 0x011: *mode = FILTER_RANGE; good[0] = OSP; good[1] = PSO; *n_prefix = 1; break; case 0x101: *mode = FILTER_RANGE; good[0] = SPO; good[1] = OPS; *n_prefix = 1; break; default: break; } if (*mode == FILTER_RANGE) { if (sord_has_index(sord, &good[0], n_prefix, graph_search)) { return good[0]; } else if (sord_has_index(sord, &good[1], n_prefix, graph_search)) { return good[1]; } } if (graph_search) { *mode = FILTER_RANGE; *n_prefix = 1; return GSPO; } else { *mode = FILTER_ALL; return SPO; } } SordModel* sord_new(SordWorld* world, unsigned indices, # 642 "sord-0.16.0/src/sord.c" 3 4 _Bool # 642 "sord-0.16.0/src/sord.c" graphs) { SordModel* sord = (SordModel*)malloc(sizeof(struct SordModelImpl)); sord->world = world; sord->n_quads = 0; sord->n_iters = 0; for (unsigned i = 0; i < (12 / 2); ++i) { const int* const ordering = orderings[i]; const int* const g_ordering = orderings[i + (12 / 2)]; if (indices & (1 << i)) { sord->indices[i] = zix_btree_new( sord_quad_compare, (void*)ordering, # 655 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 655 "sord-0.16.0/src/sord.c" ); if (graphs) { sord->indices[i + (12 / 2)] = zix_btree_new( sord_quad_compare, (void*)g_ordering, # 658 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 658 "sord-0.16.0/src/sord.c" ); } else { sord->indices[i + (12 / 2)] = # 660 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 660 "sord-0.16.0/src/sord.c" ; } } else { sord->indices[i] = # 663 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 663 "sord-0.16.0/src/sord.c" ; sord->indices[i + (12 / 2)] = # 664 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 664 "sord-0.16.0/src/sord.c" ; } } if (!sord->indices[SPO]) { sord->indices[SPO] = zix_btree_new( sord_quad_compare, (void*)orderings[SPO], # 670 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 670 "sord-0.16.0/src/sord.c" ); } if (graphs && !sord->indices[GSPO]) { sord->indices[GSPO] = zix_btree_new( sord_quad_compare, (void*)orderings[GSPO], # 674 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 674 "sord-0.16.0/src/sord.c" ); } return sord; } static void sord_node_free_internal(SordWorld* world, SordNode* node) { # 683 "sord-0.16.0/src/sord.c" 3 4 ((void) (0)) # 683 "sord-0.16.0/src/sord.c" ; const uint8_t* const buf = node->node.buf; if (zix_hash_remove(world->nodes, node)) { error(world, SERD_ERR_INTERNAL, "failed to remove node from hash\n"); } free((uint8_t*)buf); } static void sord_add_quad_ref(SordModel* sord, const SordNode* node, SordQuadIndex i) { if (node) { # 701 "sord-0.16.0/src/sord.c" 3 4 ((void) (0)) # 701 "sord-0.16.0/src/sord.c" ; ++((SordNode*)node)->refs; if (node->node.type != SERD_LITERAL && i == SORD_OBJECT) { ++((SordNode*)node)->meta.res.refs_as_obj; } } } static void sord_drop_quad_ref(SordModel* sord, const SordNode* node, SordQuadIndex i) { if (!node) { return; } # 716 "sord-0.16.0/src/sord.c" 3 4 ((void) (0)) # 716 "sord-0.16.0/src/sord.c" ; if (node->node.type != SERD_LITERAL && i == SORD_OBJECT) { # 718 "sord-0.16.0/src/sord.c" 3 4 ((void) (0)) # 718 "sord-0.16.0/src/sord.c" ; --((SordNode*)node)->meta.res.refs_as_obj; } if (--((SordNode*)node)->refs == 0) { sord_node_free_internal(sord_get_world(sord), (SordNode*)node); } } void sord_free(SordModel* sord) { if (!sord) return; SordQuad tup; SordIter* i = sord_begin(sord); for (; !sord_iter_end(i); sord_iter_next(i)) { sord_iter_get(i, tup); for (int t = 0; t < 3 + 1; ++t) { sord_drop_quad_ref(sord, tup[t], (SordQuadIndex)t); } } sord_iter_free(i); ZixBTreeIter* t = zix_btree_begin(sord->indices[SPO]); for (; !zix_btree_iter_is_end(t); zix_btree_iter_increment(t)) { free(zix_btree_get(t)); } zix_btree_iter_free(t); for (unsigned o = 0; o < 12; ++o) if (sord->indices[o]) zix_btree_free(sord->indices[o]); free(sord); } SordWorld* sord_get_world(SordModel* sord) { return sord->world; } size_t sord_num_quads(const SordModel* sord) { return sord->n_quads; } size_t sord_num_nodes(const SordWorld* world) { return zix_hash_size(world->nodes); } SordIter* sord_begin(const SordModel* sord) { if (sord_num_quads(sord) == 0) { return # 780 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 780 "sord-0.16.0/src/sord.c" ; } else { ZixBTreeIter* cur = zix_btree_begin(sord->indices[SPO]); SordQuad pat = { 0, 0, 0, 0 }; return sord_iter_new(sord, cur, pat, SPO, ALL, 0); } } SordIter* sord_find(SordModel* sord, const SordQuad pat) { if (!pat[0] && !pat[1] && !pat[2] && !pat[3]) return sord_begin(sord); SearchMode mode; int n_prefix; const SordOrder index_order = sord_best_index(sord, pat, &mode, &n_prefix); ; if (pat[0] && pat[1] && pat[2] && pat[3]) mode = SINGLE; ZixBTree* const db = sord->indices[index_order]; ZixBTreeIter* cur = # 805 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 805 "sord-0.16.0/src/sord.c" ; zix_btree_lower_bound(db, pat, &cur); if (zix_btree_iter_is_end(cur)) { ; zix_btree_iter_free(cur); return # 810 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 810 "sord-0.16.0/src/sord.c" ; } const SordNode** const key = (const SordNode**)zix_btree_get(cur); if (!key || ( (mode == RANGE || mode == SINGLE) && !sord_quad_match_inline(pat, key) )) { ; zix_btree_iter_free(cur); return # 817 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 817 "sord-0.16.0/src/sord.c" ; } return sord_iter_new(sord, cur, pat, index_order, mode, n_prefix); } SordIter* sord_search(SordModel* model, const SordNode* s, const SordNode* p, const SordNode* o, const SordNode* g) { SordQuad pat = { s, p, o, g }; return sord_find(model, pat); } SordNode* sord_get(SordModel* model, const SordNode* s, const SordNode* p, const SordNode* o, const SordNode* g) { if (( # 841 "sord-0.16.0/src/sord.c" 3 4 _Bool # 841 "sord-0.16.0/src/sord.c" )s + ( # 841 "sord-0.16.0/src/sord.c" 3 4 _Bool # 841 "sord-0.16.0/src/sord.c" )p + ( # 841 "sord-0.16.0/src/sord.c" 3 4 _Bool # 841 "sord-0.16.0/src/sord.c" )o != 2) { return # 842 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 842 "sord-0.16.0/src/sord.c" ; } SordIter* i = sord_search(model, s, p, o, g); SordNode* ret = # 846 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 846 "sord-0.16.0/src/sord.c" ; if (!s) { ret = sord_node_copy(sord_iter_get_node(i, SORD_SUBJECT)); } else if (!p) { ret = sord_node_copy(sord_iter_get_node(i, SORD_PREDICATE)); } else if (!o) { ret = sord_node_copy(sord_iter_get_node(i, SORD_OBJECT)); } sord_iter_free(i); return ret; } # 859 "sord-0.16.0/src/sord.c" 3 4 _Bool # 860 "sord-0.16.0/src/sord.c" sord_ask(SordModel* model, const SordNode* s, const SordNode* p, const SordNode* o, const SordNode* g) { SordQuad pat = { s, p, o, g }; return sord_contains(model, pat); } uint64_t sord_count(SordModel* model, const SordNode* s, const SordNode* p, const SordNode* o, const SordNode* g) { SordIter* i = sord_search(model, s, p, o, g); uint64_t n = 0; for (; !sord_iter_end(i); sord_iter_next(i)) { ++n; } sord_iter_free(i); return n; } # 886 "sord-0.16.0/src/sord.c" 3 4 _Bool # 887 "sord-0.16.0/src/sord.c" sord_contains(SordModel* sord, const SordQuad pat) { SordIter* iter = sord_find(sord, pat); # 890 "sord-0.16.0/src/sord.c" 3 4 _Bool # 890 "sord-0.16.0/src/sord.c" ret = (iter != # 890 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 890 "sord-0.16.0/src/sord.c" ); sord_iter_free(iter); return ret; } static uint8_t* sord_strndup(const uint8_t* str, size_t len) { uint8_t* dup = (uint8_t*)malloc(len + 1); memcpy(dup, str, len + 1); return dup; } SordNodeType sord_node_get_type(const SordNode* node) { switch (node->node.type) { case SERD_URI: return SORD_URI; case SERD_BLANK: return SORD_BLANK; default: return SORD_LITERAL; } __builtin_unreachable(); } const uint8_t* sord_node_get_string(const SordNode* node) { return node->node.buf; } const uint8_t* sord_node_get_string_counted(const SordNode* node, size_t* bytes) { *bytes = node->node.n_bytes; return node->node.buf; } const uint8_t* sord_node_get_string_measured(const SordNode* node, size_t* bytes, size_t* chars) { *bytes = node->node.n_bytes; *chars = node->node.n_chars; return node->node.buf; } const char* sord_node_get_language(const SordNode* node) { if (node->node.type != SERD_LITERAL || !node->meta.lit.lang[0]) { return # 944 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 944 "sord-0.16.0/src/sord.c" ; } return node->meta.lit.lang; } SordNode* sord_node_get_datatype(const SordNode* node) { return (node->node.type == SERD_LITERAL) ? node->meta.lit.datatype : # 952 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 952 "sord-0.16.0/src/sord.c" ; } SerdNodeFlags sord_node_get_flags(const SordNode* node) { return node->node.flags; } # 961 "sord-0.16.0/src/sord.c" 3 4 _Bool # 962 "sord-0.16.0/src/sord.c" sord_node_is_inline_object(const SordNode* node) { return (node->node.type == SERD_BLANK) && (node->meta.res.refs_as_obj == 1); } static SordNode* sord_insert_node(SordWorld* world, const SordNode* key, # 968 "sord-0.16.0/src/sord.c" 3 4 _Bool # 968 "sord-0.16.0/src/sord.c" copy) { SordNode* node = # 970 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 970 "sord-0.16.0/src/sord.c" ; ZixStatus st = zix_hash_insert(world->nodes, key, (const void**)&node); switch (st) { case ZIX_STATUS_EXISTS: ++node->refs; break; case ZIX_STATUS_SUCCESS: # 977 "sord-0.16.0/src/sord.c" 3 4 ((void) (0)) # 977 "sord-0.16.0/src/sord.c" ; if (copy) { node->node.buf = sord_strndup(node->node.buf, node->node.n_bytes); } if (node->node.type == SERD_LITERAL) { node->meta.lit.datatype = sord_node_copy(node->meta.lit.datatype); } return node; default: error(world, SERD_ERR_INTERNAL, "error inserting node `%s'\n", key->node.buf); } if (!copy) { free((uint8_t*)key->node.buf); } return node; } static SordNode* sord_new_uri_counted(SordWorld* world, const uint8_t* str, size_t n_bytes, size_t n_chars, # 1000 "sord-0.16.0/src/sord.c" 3 4 _Bool # 1000 "sord-0.16.0/src/sord.c" copy) { if (!serd_uri_string_has_scheme(str)) { error(world, SERD_ERR_BAD_ARG, "attempt to map invalid URI `%s'\n", str); return # 1005 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 1005 "sord-0.16.0/src/sord.c" ; } const SordNode key = { { str, n_bytes, n_chars, 0, SERD_URI }, 1, { { 0 } } }; return sord_insert_node(world, &key, copy); } SordNode* sord_new_uri(SordWorld* world, const uint8_t* str) { const SerdNode node = serd_node_from_string(SERD_URI, str); return sord_new_uri_counted(world, str, node.n_bytes, node.n_chars, # 1019 "sord-0.16.0/src/sord.c" 3 4 1 # 1019 "sord-0.16.0/src/sord.c" ); } SordNode* sord_new_relative_uri(SordWorld* world, const uint8_t* str, const uint8_t* base_str) { if (serd_uri_string_has_scheme(str)) { return sord_new_uri(world, str); } SerdURI buri = SERD_URI_NULL; SerdNode base = serd_node_new_uri_from_string(base_str, # 1031 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 1031 "sord-0.16.0/src/sord.c" , &buri); SerdNode node = serd_node_new_uri_from_string(str, &buri, # 1032 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 1032 "sord-0.16.0/src/sord.c" ); SordNode* ret = sord_new_uri_counted( world, node.buf, node.n_bytes, node.n_chars, # 1035 "sord-0.16.0/src/sord.c" 3 4 0 # 1035 "sord-0.16.0/src/sord.c" ); serd_node_free(&base); return ret; } static SordNode* sord_new_blank_counted(SordWorld* world, const uint8_t* str, size_t n_bytes, size_t n_chars) { const SordNode key = { { str, n_bytes, n_chars, 0, SERD_BLANK }, 1, { { 0 } } }; return sord_insert_node(world, &key, # 1049 "sord-0.16.0/src/sord.c" 3 4 1 # 1049 "sord-0.16.0/src/sord.c" ); } SordNode* sord_new_blank(SordWorld* world, const uint8_t* str) { const SerdNode node = serd_node_from_string(SERD_URI, str); return sord_new_blank_counted(world, str, node.n_bytes, node.n_chars); } static SordNode* sord_new_literal_counted(SordWorld* world, SordNode* datatype, const uint8_t* str, size_t n_bytes, size_t n_chars, SerdNodeFlags flags, const char* lang) { SordNode key = { { str, n_bytes, n_chars, flags, SERD_LITERAL }, 1, { { 0 } } }; key.meta.lit.datatype = sord_node_copy(datatype); memset(key.meta.lit.lang, 0, sizeof(key.meta.lit.lang)); if (lang) { strncpy(key.meta.lit.lang, lang, sizeof(key.meta.lit.lang)); } return sord_insert_node(world, &key, # 1077 "sord-0.16.0/src/sord.c" 3 4 1 # 1077 "sord-0.16.0/src/sord.c" ); } SordNode* sord_new_literal(SordWorld* world, SordNode* datatype, const uint8_t* str, const char* lang) { SerdNodeFlags flags = 0; size_t n_bytes = 0; size_t n_chars = serd_strlen(str, &n_bytes, &flags); return sord_new_literal_counted(world, datatype, str, n_bytes, n_chars, flags, lang); } SordNode* sord_node_from_serd_node(SordWorld* world, SerdEnv* env, const SerdNode* sn, const SerdNode* datatype, const SerdNode* lang) { if (!sn) { return # 1100 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 1100 "sord-0.16.0/src/sord.c" ; } SordNode* datatype_node = # 1103 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 1103 "sord-0.16.0/src/sord.c" ; SordNode* ret = # 1104 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 1104 "sord-0.16.0/src/sord.c" ; switch (sn->type) { case SERD_NOTHING: return # 1107 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 1107 "sord-0.16.0/src/sord.c" ; case SERD_LITERAL: datatype_node = sord_node_from_serd_node( world, env, datatype, # 1110 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 1110 "sord-0.16.0/src/sord.c" , # 1110 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 1110 "sord-0.16.0/src/sord.c" ), ret = sord_new_literal_counted( world, datatype_node, sn->buf, sn->n_bytes, sn->n_chars, sn->flags, lang ? (const char*)lang->buf : # 1118 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 1118 "sord-0.16.0/src/sord.c" ); sord_node_free(world, datatype_node); return ret; case SERD_URI: if (serd_uri_string_has_scheme(sn->buf)) { return sord_new_uri_counted( world, sn->buf, sn->n_bytes, sn->n_chars, # 1124 "sord-0.16.0/src/sord.c" 3 4 1 # 1124 "sord-0.16.0/src/sord.c" ); } else { SerdURI base_uri; serd_env_get_base_uri(env, &base_uri); SerdURI abs_uri; SerdNode abs_uri_node = serd_node_new_uri_from_node( sn, &base_uri, &abs_uri); ret = sord_new_uri_counted(world, abs_uri_node.buf, abs_uri_node.n_bytes, abs_uri_node.n_chars, # 1135 "sord-0.16.0/src/sord.c" 3 4 1 # 1135 "sord-0.16.0/src/sord.c" ); serd_node_free(&abs_uri_node); return ret; } case SERD_CURIE: { SerdChunk uri_prefix; SerdChunk uri_suffix; if (serd_env_expand(env, sn, &uri_prefix, &uri_suffix)) { error(world, SERD_ERR_BAD_CURIE, "failed to expand CURIE `%s'\n", sn->buf); return # 1145 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 1145 "sord-0.16.0/src/sord.c" ; } const size_t uri_len = uri_prefix.len + uri_suffix.len; uint8_t* buf = (uint8_t*)malloc(uri_len + 1); memcpy(buf, uri_prefix.buf, uri_prefix.len); memcpy(buf + uri_prefix.len, uri_suffix.buf, uri_suffix.len); buf[uri_len] = '\0'; ret = sord_new_uri_counted( world, buf, uri_len, serd_strlen(buf, # 1153 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 1153 "sord-0.16.0/src/sord.c" , # 1153 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 1153 "sord-0.16.0/src/sord.c" ), # 1153 "sord-0.16.0/src/sord.c" 3 4 0 # 1153 "sord-0.16.0/src/sord.c" ); return ret; } case SERD_BLANK: return sord_new_blank_counted(world, sn->buf, sn->n_bytes, sn->n_chars); } return # 1159 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 1159 "sord-0.16.0/src/sord.c" ; } const SerdNode* sord_node_to_serd_node(const SordNode* node) { return node ? &node->node : &SERD_NODE_NULL; } void sord_node_free(SordWorld* world, SordNode* node) { if (!node) { return; } else if (node->refs == 0) { error(world, SERD_ERR_BAD_ARG, "attempt to free garbage node\n"); } else if (--node->refs == 0) { sord_node_free_internal(world, node); } } SordNode* sord_node_copy(const SordNode* node) { SordNode* copy = (SordNode*)node; if (copy) { ++copy->refs; } return copy; } static inline # 1190 "sord-0.16.0/src/sord.c" 3 4 _Bool # 1191 "sord-0.16.0/src/sord.c" sord_add_to_index(SordModel* sord, const SordNode** tup, SordOrder order) { return !zix_btree_insert(sord->indices[order], tup); } # 1196 "sord-0.16.0/src/sord.c" 3 4 _Bool # 1197 "sord-0.16.0/src/sord.c" sord_add(SordModel* sord, const SordQuad tup) { ; if (!tup[0] || !tup[1] || !tup[2]) { error(sord->world, SERD_ERR_BAD_ARG, "attempt to add quad with NULL field\n"); return # 1203 "sord-0.16.0/src/sord.c" 3 4 0 # 1203 "sord-0.16.0/src/sord.c" ; } else if (sord->n_iters > 0) { error(sord->world, SERD_ERR_BAD_ARG, "added tuple during iteration\n"); } const SordNode** quad = (const SordNode**)malloc(sizeof(SordQuad)); memcpy(quad, tup, sizeof(SordQuad)); for (unsigned i = 0; i < 12; ++i) { if (sord->indices[i] && (i < GSPO || tup[3])) { if (!sord_add_to_index(sord, quad, (SordOrder)i)) { # 1214 "sord-0.16.0/src/sord.c" 3 4 ((void) (0)) # 1214 "sord-0.16.0/src/sord.c" ; free(quad); return # 1216 "sord-0.16.0/src/sord.c" 3 4 0 # 1216 "sord-0.16.0/src/sord.c" ; } } } for (int i = 0; i < 3 + 1; ++i) sord_add_quad_ref(sord, tup[i], (SordQuadIndex)i); ++sord->n_quads; return # 1225 "sord-0.16.0/src/sord.c" 3 4 1 # 1225 "sord-0.16.0/src/sord.c" ; } void sord_remove(SordModel* sord, const SordQuad tup) { ; if (sord->n_iters > 0) { error(sord->world, SERD_ERR_BAD_ARG, "remove with iterator\n"); } SordNode* quad = # 1236 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 1236 "sord-0.16.0/src/sord.c" ; for (unsigned i = 0; i < 12; ++i) { if (sord->indices[i] && (i < GSPO || tup[3])) { if (zix_btree_remove(sord->indices[i], tup, (void**)&quad, # 1239 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 1239 "sord-0.16.0/src/sord.c" )) { # 1240 "sord-0.16.0/src/sord.c" 3 4 ((void) (0)) # 1240 "sord-0.16.0/src/sord.c" ; return; } } } free(quad); for (int i = 0; i < 3 + 1; ++i) sord_drop_quad_ref(sord, tup[i], (SordQuadIndex)i); --sord->n_quads; } SerdStatus sord_erase(SordModel* sord, SordIter* iter) { if (sord->n_iters > 1) { error(sord->world, SERD_ERR_BAD_ARG, "erased with many iterators\n"); return SERD_ERR_BAD_ARG; } SordQuad tup; sord_iter_get(iter, tup); ; SordNode* quad = # 1267 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 1267 "sord-0.16.0/src/sord.c" ; for (unsigned i = 0; i < 12; ++i) { if (sord->indices[i] && (i < GSPO || tup[3])) { if (zix_btree_remove(sord->indices[i], tup, (void**)&quad, i == iter->order ? &iter->cur : # 1271 "sord-0.16.0/src/sord.c" 3 4 ((void *)0) # 1271 "sord-0.16.0/src/sord.c" )) { return (i == 0) ? SERD_ERR_NOT_FOUND : SERD_ERR_INTERNAL; } } } iter->end = zix_btree_iter_is_end(iter->cur); sord_iter_scan_next(iter); free(quad); for (int i = 0; i < 3 + 1; ++i) sord_drop_quad_ref(sord, tup[i], (SordQuadIndex)i); --sord->n_quads; return SERD_SUCCESS; } # 18 "sord.c" 2 # 1 "sord-0.16.0/src/syntax.c" 1 # 17 "sord-0.16.0/src/syntax.c" # 1 "/usr/include/assert.h" 1 3 4 # 18 "sord-0.16.0/src/syntax.c" 2 # 26 "sord-0.16.0/src/syntax.c" struct SordInserterImpl { SordModel* model; SerdEnv* env; }; SordInserter* sord_inserter_new(SordModel* model, SerdEnv* env) { SordInserter* inserter = (SordInserter*)malloc(sizeof(SordInserter)); inserter->model = model; inserter->env = env; return inserter; } void sord_inserter_free(SordInserter* inserter) { free(inserter); } SerdStatus sord_inserter_set_base_uri(SordInserter* inserter, const SerdNode* uri_node) { return serd_env_set_base_uri(inserter->env, uri_node); } SerdStatus sord_inserter_set_prefix(SordInserter* inserter, const SerdNode* name, const SerdNode* uri_node) { return serd_env_set_prefix(inserter->env, name, uri_node); } SerdStatus sord_inserter_write_statement(SordInserter* inserter, SerdStatementFlags flags, const SerdNode* graph, const SerdNode* subject, const SerdNode* predicate, const SerdNode* object, const SerdNode* object_datatype, const SerdNode* object_lang) { SordWorld* world = sord_get_world(inserter->model); SerdEnv* env = inserter->env; SordNode* g = sord_node_from_serd_node(world, env, graph, # 75 "sord-0.16.0/src/syntax.c" 3 4 ((void *)0) # 75 "sord-0.16.0/src/syntax.c" , # 75 "sord-0.16.0/src/syntax.c" 3 4 ((void *)0) # 75 "sord-0.16.0/src/syntax.c" ); SordNode* s = sord_node_from_serd_node(world, env, subject, # 76 "sord-0.16.0/src/syntax.c" 3 4 ((void *)0) # 76 "sord-0.16.0/src/syntax.c" , # 76 "sord-0.16.0/src/syntax.c" 3 4 ((void *)0) # 76 "sord-0.16.0/src/syntax.c" ); SordNode* p = sord_node_from_serd_node(world, env, predicate, # 77 "sord-0.16.0/src/syntax.c" 3 4 ((void *)0) # 77 "sord-0.16.0/src/syntax.c" , # 77 "sord-0.16.0/src/syntax.c" 3 4 ((void *)0) # 77 "sord-0.16.0/src/syntax.c" ); SordNode* o = sord_node_from_serd_node(world, env, object, object_datatype, object_lang); if (!s || !p || !o) { return SERD_ERR_BAD_ARG; } const SordQuad tup = { s, p, o, g }; sord_add(inserter->model, tup); sord_node_free(world, o); sord_node_free(world, p); sord_node_free(world, s); sord_node_free(world, g); return SERD_SUCCESS; } SerdReader* sord_new_reader(SordModel* model, SerdEnv* env, SerdSyntax syntax, SordNode* graph) { SordInserter* inserter = sord_inserter_new(model, env); SerdReader* reader = serd_reader_new( syntax, inserter, (void (*)(void*))sord_inserter_free, (SerdBaseSink)sord_inserter_set_base_uri, (SerdPrefixSink)sord_inserter_set_prefix, (SerdStatementSink)sord_inserter_write_statement, # 110 "sord-0.16.0/src/syntax.c" 3 4 ((void *)0) # 110 "sord-0.16.0/src/syntax.c" ); if (graph) { serd_reader_set_default_graph(reader, sord_node_to_serd_node(graph)); } return reader; } static SerdStatus write_statement(SordModel* sord, SerdWriter* writer, SordQuad tup, SerdStatementFlags flags) { const SordNode* s = tup[SORD_SUBJECT]; const SordNode* p = tup[SORD_PREDICATE]; const SordNode* o = tup[SORD_OBJECT]; const SordNode* d = sord_node_get_datatype(o); const SerdNode* ss = sord_node_to_serd_node(s); const SerdNode* sp = sord_node_to_serd_node(p); const SerdNode* so = sord_node_to_serd_node(o); const SerdNode* sd = sord_node_to_serd_node(d); const char* lang_str = sord_node_get_language(o); size_t lang_len = lang_str ? strlen(lang_str) : 0; SerdNode language = SERD_NODE_NULL; if (lang_str) { language.type = SERD_LITERAL; language.n_bytes = lang_len; language.n_chars = lang_len; language.buf = (const uint8_t*)lang_str; }; if (sord_node_is_inline_object(s) && !(flags & SERD_ANON_CONT)) { return SERD_SUCCESS; } SerdStatus st = SERD_SUCCESS; if (sord_node_is_inline_object(o)) { SordQuad sub_pat = { o, 0, 0, 0 }; SordIter* sub_iter = sord_find(sord, sub_pat); SerdStatementFlags start_flags = flags | ((sub_iter) ? SERD_ANON_O_BEGIN : SERD_EMPTY_O); st = serd_writer_write_statement( writer, start_flags, # 159 "sord-0.16.0/src/syntax.c" 3 4 ((void *)0) # 159 "sord-0.16.0/src/syntax.c" , ss, sp, so, sd, &language); if (!st && sub_iter) { flags |= SERD_ANON_CONT; for (; !st && !sord_iter_end(sub_iter); sord_iter_next(sub_iter)) { SordQuad sub_tup; sord_iter_get(sub_iter, sub_tup); st = write_statement(sord, writer, sub_tup, flags); } sord_iter_free(sub_iter); serd_writer_end_anon(writer, so); } } else { st = serd_writer_write_statement( writer, flags, # 173 "sord-0.16.0/src/syntax.c" 3 4 ((void *)0) # 173 "sord-0.16.0/src/syntax.c" , ss, sp, so, sd, &language); } return st; } # 179 "sord-0.16.0/src/syntax.c" 3 4 _Bool # 180 "sord-0.16.0/src/syntax.c" sord_write(SordModel* model, SerdWriter* writer, SordNode* graph) { SordQuad pat = { 0, 0, 0, graph }; SordIter* iter = sord_find(model, pat); return sord_write_iter(iter, writer); } # 189 "sord-0.16.0/src/syntax.c" 3 4 _Bool # 190 "sord-0.16.0/src/syntax.c" sord_write_iter(SordIter* iter, SerdWriter* writer) { if (!iter) { return # 194 "sord-0.16.0/src/syntax.c" 3 4 0 # 194 "sord-0.16.0/src/syntax.c" ; } SordModel* model = (SordModel*)sord_iter_get_model(iter); SerdStatus st = SERD_SUCCESS; for (; !st && !sord_iter_end(iter); sord_iter_next(iter)) { SordQuad tup; sord_iter_get(iter, tup); st = write_statement(model, writer, tup, 0); } sord_iter_free(iter); return !st; } # 19 "sord.c" 2
Become a Patron
Sponsor on GitHub
Donate via PayPal
Compiler Explorer Shop
Source on GitHub
Mailing list
Installed libraries
Wiki
Report an issue
How it works
Contact the author
CE on Mastodon
CE on Bluesky
Statistics
Changelog
Version tree