diff --git a/README.md b/README.md index 0a99331b17358f8485d7dbab08bdd03a83e31804..0e246277ed39bfa0002af7959faa2a5920f04a91 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,6 @@ Use this command to compile the project. Use this command to clean the project. ### Run the tests -> `make run_tests` +> `make test` Use this command to start the tests. \ No newline at end of file diff --git a/main.c b/main.c index 736e7ff838d7be9a6dae00e2ed0eec868011d1e9..5d111c239522692e6fa6ce624d01fedb261c64e1 100644 --- a/main.c +++ b/main.c @@ -1,6 +1,6 @@ /* Author : Dario GENGA - * Date : 16.11.2021 - * Description : Library to manipulate the pile + * Date : 23.11.2021 + * Description : Library to manipulate the stack */ #include <stdio.h> diff --git a/stack.c b/stack.c index 4f024e2154cfac448128432229864a4ded465c8e..b5030a9ec22fd00d3809e5aa58339b3dfd7324c2 100644 --- a/stack.c +++ b/stack.c @@ -1,5 +1,5 @@ /* Author : Dario GENGA - * Date : 16.11.2021 + * Date : 23.11.2021 * Description : Library to manipulate the stack */ diff --git a/stack.h b/stack.h index 207ee6e6d117bef6fceac79054f3df878abd150e..d93292841b46cca2fae7ddea7b2160435f064e4b 100644 --- a/stack.h +++ b/stack.h @@ -1,12 +1,24 @@ /* Author : Dario GENGA - * Date : 16.11.2021 + * Date : 23.11.2021 * Description : Library to manipulate the stack */ -#ifndef _PILE_H -#define _PILE_H +#ifndef _STACK_H +#define _STACK_H #include <stdio.h> #include <stdlib.h> #include <stdbool.h> +typedef struct _stack { + int size; + int top; + int *data; +} stack; + +void stack_init(stack *s, int size); +bool stack_is_empty(stack s); +void stack_push(stack *s, int val); +void stack_pop(stack *s, int *val); +void stack_peek(stack s, int *val); +void stack_destroy(stack *s); #endif \ No newline at end of file diff --git a/test.c b/test.c index 1648701add9fde2ef97e30afdeeb940e5d490b4f..79981ebd573403f85e7855d55988173755e46cc8 100644 --- a/test.c +++ b/test.c @@ -1,6 +1,6 @@ /* Author : Dario GENGA - * Date : 16.11.2021 - * Description : Manipulate matrix + * Date : 23.11.2021 + * Description : Library to manipulate the stack */ #include "stack.h" #include <assert.h>