-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lis.h
72 lines (63 loc) · 1.94 KB
/
ft_lis.h
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lis.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lgasc <lgasc@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/20 16:15:17 by lgasc #+# #+# */
/* Updated: 2024/02/28 16:44:17 by lgasc ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FT_LIS_H
# define FT_LIS_H
# include <assert.h>
# include <stddef.h>
# include <stdlib.h>
# include "libft/libft.h"
# ifdef TEST
# include "ft_printf/ft_printf.h"
# endif
t_int_array ft_lis_circular(t_ilist list);
//t_int_array ft_lis(t_ilist list)
// __attribute__ ((nonnull))
// __attribute__ ((warn_unused_result));
//enum e_firstness
//{
// HasPrecedent,
// IsFirst
//};
# ifdef TEST
# ifndef __clang__
// TODO: Rename to "Khipu" or some related word.
///`.ranks`: array of the rank of each element
/// (0 is base, 1 is after 0, 2 is after 1, etc etc)
///`.knots`: array of the position of the precedent
/// defined for each element of nonzero rank
typedef struct __attribute__ ((designated_init)) s_khipu
{
size_t amount;
size_t *ranks;
size_t *knots;
} t_khipu;
# define FT_LIS_H_ATTRIBUTES
# endif
# endif
# ifndef FT_LIS_H_ATTRIBUTES
//struct s_end_predecessor
//{
// enum
// {
// HasPredecessor,
// IsFirst
// } e_is_first;
// size_t previous;
//};
typedef struct s_khipu
{
size_t amount;
size_t *ranks;
size_t *knots;
} t_khipu;
# endif
#endif