Hash :
7f2f72e4
Author :
Thomas de Grivel
Date :
2024-03-04T14:19:12
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
/* c3
* Copyright 2022-2024 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 tuple.h
* @brief Tag tuples.
*
* A tuple is a static array of tags.
*/
#ifndef LIBC3_TUPLE_H
#define LIBC3_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 char *p);
s_tuple * tuple_init_2 (s_tuple *tuple, const s_tag *a, const s_tag *b);
s_tuple * tuple_init_cast (s_tuple *tuple, const s_tag *tag);
s_tuple * tuple_init_copy (s_tuple *tuple, const s_tuple *src);
void tuple_clean (s_tuple *tuple);
/* Constructors, call tuple_delete after use */
s_tuple * tuple_new (uw count);
s_tuple * tuple_new_1 (const char *p);
/* Destructor */
void tuple_delete (s_tuple *tuple);
/* Modifiers */
s_tuple * tuple_1 (s_tuple *tuple, const char *p);
/* Observers */
s_list * tuple_to_list (const s_tuple *tuple, s_list **list);
s_str * tuple_inspect (const s_tuple *x, s_str *dest);
#endif /* LIBC3_TUPLE_H */