Hash :
36d3d3d0
Author :
Thomas de Grivel
Date :
2025-09-12T14:39:57
fix cfn_apply that returns a pointer as result type, set the pointer type and target type before calling the ffi.
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 42 43 44 45 46 47
/* 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.
*/
/**
* @file counter.h
* @brief Integer counter
*
* Functions that define, increment, or decrement a counter.
*/
#ifndef LIBKC3_COUNTER_H
#define LIBKC3_COUNTER_H
#include "types.h"
extern s_ht g_counter_ht;
/* Stack-allocation compatible functions, call counter_clean
after use. */
void counter_clean (s_counter *c);
s_counter * counter_init (s_counter *c, s_ident *ident, s_tag *value);
/* Heap-allocation functions, call counter_delete after use. */
void counter_delete (s_counter *c);
s_counter * counter_new (s_ident *ident, s_tag *value);
/* Operators. */
s_tag * counter_decrement (s_counter *c, s_tag *positive,
s_tag *dest);
s_tag * counter_get (s_counter *c, s_tag *dest);
s_tag * counter_increment (s_counter *c, s_tag *positive,
s_tag *dest);
/* Hash table of counters. */
s_counter ** counter_find (const s_ident *ident, s_counter **dest);
void counter_ht_clean (s_ht *ht);
s_ht * counter_ht_init (s_ht *ht);
#endif /* LIBKC3_COUNTER_H */