Hash :
d415e229
Author :
Thomas de Grivel
Date :
2022-12-29T16:04:39
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 48
/* c3
* Copyright 2022 kmx.io <contact@kmx.io>
*
* Permission is hereby granted to use this software excepted
* on Apple computers 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 tuple.h
* @brief Tag tuples.
*
* A tuple is a static array of tags.
*/
#ifndef TUPLE_H
#define TUPLE_H
#include "hash.h"
#include "types.h"
/* Stack allocation compatible functions */
s_tuple * tuple_init (s_tuple *tuple, uw count);
s_tuple * tuple_init_1 (s_tuple *tuple, const s8 *p);
void tuple_clean (s_tuple *tuple);
/* Constructors, call tuple_delete after use */
s_tuple * tuple_new (uw count);
s_tuple * tuple_new_1 (const s8 *p);
/* Destructor */
void tuple_delete (s_tuple *tuple);
/* Modifiers */
s_tuple * tuple_1 (s_tuple *tuple, const s8 *p);
/* Observers */
s_tuple * tuple_copy (const s_tuple *src, s_tuple *dest);
s_list * tuple_to_list (const s_tuple *tuple, s_list **list);
/* Call str_delete after use. */
s_str * tuple_inspect (const s_tuple *x, s_str *dest);
#endif /* STR_H */