Skip to content
Snippets Groups Projects
Commit 4daea9f7 authored by thib's avatar thib
Browse files

init

parent cd37ff04
No related branches found
No related tags found
No related merge requests found
...@@ -2,4 +2,5 @@ ...@@ -2,4 +2,5 @@
*.o *.o
*/*.o */*.o
*/*.x */*.x
*.gch
cc=gcc
LIBS=-Wextra -Wall -g -fsanitize=address -fsanitize=leak -lm
lst_vec.x: lst_vec.o
$(cc) -o $@ $^ $(LIBS)
lst_vec.o: lst_vec.c lst_vec.h
$(cc) -c $^ $(LIBS)
clean:
rm -f *.o *.x *.gch
#include "lst_vec.h"
#include <stdio.h>
#include <stdlib.h>
int main() {
return EXIT_SUCCESS;
}
\ No newline at end of file
#ifndef _LST_VEC_H_
#define _LST_VEC_H_
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <assert.h>
typedef struct _element {
void *data;
struct _element *next;
} element;
typedef element* lst_vector;
lst_vector lst_vector_init();
int lst_vector_length(lst_vector *v);
element lst_vector_push(lst_vector *v, void *element);
element lst_vector_pop(lst_vector *v);
lst_vector lst_vector_set(lst_vector *v, int index, void *element);
element lst_vector_get(lst_vector *v, int index);
element lst_vector_remove(lst_vector *v, int index);
lst_vector lst_vector_insert(lst_vector *v, void *element, int index);
void lst_vector_empty(lst_vector **v);
lst_vector lst_vector_map(lst_vector *v, void *(*f)(void *));
lst_vector lst_vector_filter(lst_vector *v, bool (*f)(void *));
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment