aboutsummaryrefslogtreecommitdiff
path: root/src/common/common.h
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2021-09-10 10:54:12 +0200
committerCharles Cabergs <me@cacharle.xyz>2021-09-10 10:54:12 +0200
commit7a6533373ab9b0dd075f995c98dcf332a7876fac (patch)
treea9fc5df9ab01c11a24e780dab47039504f122ef3 /src/common/common.h
parentc0124777afcbbb0d5ca7d841360434f25235fb0f (diff)
downloadpush_swap-7a6533373ab9b0dd075f995c98dcf332a7876fac.tar.gz
push_swap-7a6533373ab9b0dd075f995c98dcf332a7876fac.tar.bz2
push_swap-7a6533373ab9b0dd075f995c98dcf332a7876fac.zip
Updated to norm v3
Diffstat (limited to 'src/common/common.h')
-rw-r--r--src/common/common.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/common/common.h b/src/common/common.h
index 87c4655..c4efad8 100644
--- a/src/common/common.h
+++ b/src/common/common.h
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/18 11:20:54 by cacharle #+# #+# */
-/* Updated: 2020/01/22 10:25:47 by cacharle ### ########.fr */
+/* Updated: 2021/09/10 10:33:19 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -14,24 +14,25 @@
# define COMMON_H
# include <stdlib.h>
+# include <stdbool.h>
# include "libft.h"
-typedef enum
+typedef enum e_status
{
- STATUS_SUCCESS,
- STATUS_FAILURE,
+ STATUS_FAILURE = false,
+ STATUS_SUCCESS = true,
STATUS_ERROR,
STATUS_EOF,
} t_status;
-typedef enum
+typedef enum e_stack_tag
{
STACK_NO_TAG,
STACK_A,
STACK_B
} t_stack_tag;
-typedef struct s_stack
+typedef struct s_stack
{
int *elements;
t_stack_tag tag;
@@ -43,7 +44,7 @@ typedef struct s_stack
*/
t_stack *stack_new(int size);
-void stack_destroy(t_stack *stack);
+int stack_destroy(t_stack *stack);
void stack_push(t_stack *stack, int n);
void stack_pop(t_stack *stack);
int stack_peek(t_stack *stack);