core-invoice-sys 1.0.0

C ABI for core-invoice (Python/WASM bind to this)
Documentation
/* Generated by cbindgen. Compare with crates/core-invoice-sys/include/core_invoice.h. Opaque 0/1/2 contract; no Invoice struct. */

#ifndef CORE_INVOICE_H
#define CORE_INVOICE_H

#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

/**
 * 0 valid, 1 invalid, 2 unreadable / bad args. Same contract as the CLI.
 *
 * `profile` NULL means auto from BT-24 (CustomizationID).
 * Known slugs: en16931, peppol, pint, pint-my.
 * `xml` must outlive the call. `err` is `err_len` writable bytes, UTF-8, always NUL-terminated if err_len > 0.
 */
int core_invoice_validate_ubl(const char *xml,
                              const char *profile,
                              char *err,
                              uintptr_t err_len);

/**
 * Same as [`core_invoice_validate_ubl`]: syntax is the document element (UBL or CII).
 */
int core_invoice_validate(const char *xml, const char *profile, char *err, uintptr_t err_len);

/**
 * Convert through the semantic model. `to` is `ubl` or `cii`.
 * On success writes XML into `out` (NUL-terminated). Same 0/1/2 as CLI convert.
 */
int core_invoice_convert(const char *xml,
                         const char *to,
                         const char *profile,
                         char *out,
                         uintptr_t out_len,
                         char *err,
                         uintptr_t err_len);

/**
 * Semantic diff. 0 identical, 1 differ, 2 unreadable. Writes the report into `out`.
 */
int core_invoice_diff(const char *left,
                      const char *right,
                      char *out,
                      uintptr_t out_len,
                      char *err,
                      uintptr_t err_len);

/**
 * Writes crate version into `out`. Always 0 unless `out` is null (2).
 */
int core_invoice_version(char *out, uintptr_t out_len);

#endif  /* CORE_INVOICE_H */