rayforce-sys 1.1.0

Raw FFI bindings to the RayforceDB v2 core (librayforce)
Documentation
/*
 *   Copyright (c) 2025-2026 Anton Kundenko <singaraiona@gmail.com>
 *   All rights reserved.

 *   Permission is hereby granted, free of charge, to any person obtaining a copy
 *   of this software and associated documentation files (the "Software"), to deal
 *   in the Software without restriction, including without limitation the rights
 *   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *   copies of the Software, and to permit persons to whom the Software is
 *   furnished to do so, subject to the following conditions:

 *   The above copyright notice and this permission notice shall be included in all
 *   copies or substantial portions of the Software.

 *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 *   SOFTWARE.
 */

#ifndef RAY_SPLAY_H
#define RAY_SPLAY_H

#include <rayforce.h>

struct ray_sym_domain_s;

/* Splayed table I/O.
 *
 * sym_path names the table's symfile (domain): save distinct-merges the
 * table's SYM vocabulary into it (append-only) and encodes SYM columns
 * as positions; load attaches its FILE domain to every SYM column.
 * Symbol-free tables neither write nor require a symfile; a SYM column
 * with no resolvable symfile is a loud "sym" error. */
ray_err_t ray_splay_save(ray_t* tbl, const char* dir, const char* sym_path);
ray_err_t ray_splay_save_bulk(ray_t* tbl, const char* dir, const char* sym_path);
ray_t*    ray_splay_load(const char* dir, const char* sym_path);
ray_t*    ray_read_splayed(const char* dir, const char* sym_path);

/* Append chunk-zone index regions to a freshly-streamed splayed store's column
 * files so later mmap loads get block-skip.  Best-effort, per numeric column. */
void      ray_splay_build_indexes(const char* dir, ray_t* tbl);

/* Partition loader entry: the parted reader opens root/sym ONCE and
 * passes the shared domain to every partition's columns. */
ray_t*    ray_read_splayed_dom(const char* dir, struct ray_sym_domain_s* dom);

#endif /* RAY_SPLAY_H */