Skip to content
Snippets Groups Projects
Select Git revision
  • ddd6e0f25a8a1aa0ad77aaeeab8757f1350c6ae5
  • master default protected
2 results

vectors.h

Blame
  • vectors.h 844 B
    /*
        Autheur		: Abivarman KANDIAH
        Date		: 22/02/2022
        Fichier		: vectors.h
        Descritpion : Vectors functions header
    */
    
    #ifndef _VECTORS_H_
    #define _VECTORS_H_
    
    #define VECTOR_INIT_CAPACITY 4
    
    #include <stdio.h>
    #include <stdlib.h>
    #include <stdint.h>
    #include <stdbool.h>
    #include <assert.h>
    
    typedef int type;
    typedef struct vector_* vector;
    
    vector vector_create();
    int vector_length(vector vec);
    void vector_push(vector vec, type element);
    type vector_pop(vector vec);
    void vector_set(vector vec, int index, type element);
    type vector_get(vector vec, int index);
    type vector_remove(vector vec, int index);
    void vector_insert(vector vec, type element, int index);
    void vector_empty(vector vec);
    void vector_free(vector vec);
    void vector_print(vector vec, void (*print)(type));
    void vector_map(vector vec, type (*f)(type));
    
    #endif