/ libft / ft_vec.h
ft_vec.h
 1  /* ************************************************************************** */
 2  /*                                                                            */
 3  /*                                                        :::      ::::::::   */
 4  /*   ft_vec.h                                           :+:      :+:    :+:   */
 5  /*                                                    +:+ +:+         +:+     */
 6  /*   By: ll-hotel <ll-hotel@student.42lyon.fr>      +#+  +:+       +#+        */
 7  /*                                                +#+#+#+#+#+   +#+           */
 8  /*   Created: 2024/04/01 15:24:46 by ll-hotel          #+#    #+#             */
 9  /*   Updated: 2024/10/15 16:03:57 by ll-hotel         ###   ########.fr       */
10  /*                                                                            */
11  /* ************************************************************************** */
12  
13  #ifndef FT_VEC_H
14  # define FT_VEC_H
15  
16  typedef struct s_vector	t_vec;
17  
18  struct	s_vector
19  {
20  	void			*array;
21  	unsigned long	size;
22  	unsigned long	elem_size;
23  	unsigned long	allocated_size;
24  };
25  
26  void	vec_new(t_vec *vec, unsigned long elem_size);
27  void	*vec_addback(t_vec *vec, void *elem);
28  void	*vec_at(t_vec *vec, unsigned long i);
29  void	vec_clear(t_vec *vec, void (*del)(void *));
30  
31  #endif