Hash :
4c6b7321
Author :
Thomas de Grivel
Date :
2025-08-01T19:37:07
fact_init_1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
/* kc3
* Copyright from 2022 to 2025 kmx.io <contact@kmx.io>
*
* Permission is hereby granted to use this software granted the above
* copyright notice and this permission paragraph are included in all
* copies and substantial portions of this software.
*
* THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
* PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
* AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
* THIS SOFTWARE.
*/
#ifndef LIBKC3_FACT_H
#define LIBKC3_FACT_H
#include "types.h"
/* Stack-allocation compatible functions. Call fact_clean after use. */
#define fact_clean(fact) do {} while(0)
void fact_clean_all (s_fact *fact);
s_fact * fact_init (s_fact *fact, s_tag *subject,
s_tag *predicate, s_tag *object);
s_fact * fact_init_1 (s_fact *fact, const char *p);
s_fact * fact_init_cast (s_fact *fact, const s_sym * const *type,
s_tag *tag);
s_fact * fact_init_copy (s_fact *fact, const s_fact *src);
s_fact * fact_init_fact_w (s_fact *fact, s_fact_w *fact_w);
/* Stack-allocation compatible functions. Call fact_w_clean
after use. */
s_fact_w * fact_w_init (s_fact_w *fact);
s_fact_w * fact_w_init_fact (s_fact_w *fact, s_fact *src);
void fact_w_clean (s_fact_w *fact);
/* Observers */
uw * fact_hash_uw (const s_fact *fact, uw *dest);
/* Operators */
s_fact_w * fact_w_eval (s_fact_w *fact, s_fact_w *dest);
#endif /* LIBKC3_FACT_H */