feat: changing the textures style: removing test libft
This commit is contained in:
parent
29b932b948
commit
05e32c3ab5
247 changed files with 234 additions and 11272 deletions
|
|
@ -1,46 +0,0 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_list_types.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/12/07 10:37:44 by bgoulard #+# #+# */
|
||||
/* Updated: 2024/05/19 17:48:07 by bgoulard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef FT_LIST_TYPES_H
|
||||
# define FT_LIST_TYPES_H
|
||||
|
||||
# include <stdbool.h>
|
||||
# define FTLIST_SUCCESS 0
|
||||
# define FTLIST_FAILURE 1
|
||||
|
||||
/// @brief Structure representing a node in a list
|
||||
/// @param data The data of the node
|
||||
/// @param next The next node
|
||||
typedef struct s_list
|
||||
{
|
||||
void *data;
|
||||
struct s_list *next;
|
||||
} t_list;
|
||||
|
||||
/// @brief Structure representing a node in a doubly linked list
|
||||
/// @param data The data of the node
|
||||
/// @param next The next node
|
||||
/// @param prev The previous node
|
||||
typedef struct s_dl_list
|
||||
{
|
||||
struct s_dl_list *next;
|
||||
struct s_dl_list *prev;
|
||||
void *data;
|
||||
} t_dlist;
|
||||
|
||||
/// @brief Type of function to apply on a doubly linked list node
|
||||
typedef void (*t_dnode_apply)(t_dlist *);
|
||||
|
||||
/// @brief Type of function to apply on a simply linked list node
|
||||
typedef void (*t_lnode_apply)(t_list *);
|
||||
|
||||
#endif /* FT_LIST_TYPES_H */
|
||||
|
|
@ -1,187 +0,0 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_math.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/18 18:59:37 by bgoulard #+# #+# */
|
||||
/* Updated: 2024/08/21 21:38:22 by bgoulard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef FT_MATH_H
|
||||
# define FT_MATH_H
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Module: FT_MATH */
|
||||
/* Prefix: ft_* */
|
||||
/* */
|
||||
/* The FT_MATH module provides a way to handle task or queries related */
|
||||
/* to arithmetic operations. */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
# include "ft_math_types.h"
|
||||
# include <stddef.h>
|
||||
|
||||
/// @brief Return the nearest aligned value of size on the alignment
|
||||
/// @param size The size to align
|
||||
/// @param alignment The alignment to use
|
||||
/// @return The aligned value of size on the alignment
|
||||
/// @note Optimized for power of 2 alignment
|
||||
size_t ft_align_2(size_t size, size_t alignment);
|
||||
|
||||
/// @brief Return the nearest aligned value of size on the alignment
|
||||
/// @param size The size to align
|
||||
/// @param alignment The alignment to use
|
||||
/// @return The aligned value of size on the alignment
|
||||
/// @note See: ft_align_2 for an optimized version for power of 2
|
||||
size_t ft_align(size_t size, size_t alignment);
|
||||
|
||||
/// @brief return the logaritm of the number in the specified base
|
||||
/// @param nbr number to get the logaritm
|
||||
/// @param base base of the logaritm
|
||||
/// @return the logaritm of the number in the specified base. in case of error
|
||||
/// return -1
|
||||
int ft_llogof(long long nbr, int base);
|
||||
|
||||
/// @brief return the logaritm of the number in the specified base
|
||||
/// @param nbr number to get the logaritm
|
||||
/// @param base base of the logaritm
|
||||
/// @return the logaritm of the number in the specified base. in case of error
|
||||
/// return -1
|
||||
int ft_ullogof(unsigned long long nbr, int base);
|
||||
|
||||
/// @brief return the logaritm of the number in the specified base
|
||||
/// @param nbr number to get the logaritm
|
||||
/// @param base base of the logaritm
|
||||
/// @return the logaritm of the number in the specified base. in case of error
|
||||
/// return -1
|
||||
int ft_logof(int nbr, int base);
|
||||
|
||||
/// @brief return the logaritm of the number in the specified base
|
||||
/// @param nbr number to get the logaritm
|
||||
/// @param base base of the logaritm
|
||||
/// @return the logaritm of the number in the specified base. in case of error
|
||||
/// return -1
|
||||
int ft_log(int nbr);
|
||||
|
||||
/// @brief returns the minimum of a and b
|
||||
/// @param a first number
|
||||
/// @param b second number
|
||||
/// @return the smallest between a and b
|
||||
int ft_min(int a, int b);
|
||||
|
||||
/// @brief returns the maximum of a and b
|
||||
/// @param a first number
|
||||
/// @param b second number
|
||||
/// @return the biggest between a and b
|
||||
int ft_max(int a, int b);
|
||||
|
||||
/// @brief Clamp a value between a minimum and a maximum
|
||||
/// @param value The value to clamp
|
||||
/// @param min The minimum value
|
||||
/// @param max The maximum value
|
||||
/// @return The clamped value between or at the minimum or maximum
|
||||
/// @note This is a clamp function aka inferior and superior to min and max
|
||||
/// are set to min and max
|
||||
/// @file ft_clamp.c
|
||||
int ft_clamp(int value, int min, int max);
|
||||
|
||||
/// @brief Clamp a value between a minimum and a maximum
|
||||
/// @param value The value to clamp
|
||||
/// @param min The minimum value
|
||||
/// @param max The maximum value
|
||||
/// @return The clamped value between or at the minimum or maximum
|
||||
/// @note See ft_clamp.
|
||||
/// @file ft_clamp.c
|
||||
float ft_clamp_f(float value, float min, float max);
|
||||
|
||||
/// @brief Clamp a value between a minimum and a maximum
|
||||
/// @param value The value to clamp
|
||||
/// @param min The minimum value
|
||||
/// @param max The maximum value
|
||||
/// @return The clamped value between or at the minimum or maximum
|
||||
/// @note See ft_clamp.
|
||||
/// @file ft_clamp.c
|
||||
double ft_clamp_d(double value, double min, double max);
|
||||
|
||||
/// @brief Take a value in a range and puts it in another range of 1 to new_max
|
||||
/// @param value The value to range
|
||||
/// @param min The minimum value of the range
|
||||
/// @param max The maximum value of the range
|
||||
/// @param new_max The maximum value of the new range
|
||||
/// @return The value ranged between 1 and new_max
|
||||
int ft_range(int value, int min, int max, int new_max);
|
||||
|
||||
/// @brief Take a value in a range and puts it in another range of 1 to new_max
|
||||
/// @param value The value to range
|
||||
/// @param min The minimum value of the range
|
||||
/// @param max The maximum value of the range
|
||||
/// @param new_max The maximum value of the new range
|
||||
/// @return The value ranged between 1 and new_max
|
||||
/// @note See ft_range.
|
||||
float ft_range_f(float value, float min, float max, float new_max);
|
||||
|
||||
/// @brief Take a value in a range and puts it in another range of 1 to new_max
|
||||
/// @param value The value to range
|
||||
/// @param min The minimum value of the range
|
||||
/// @param max The maximum value of the range
|
||||
/// @param new_max The maximum value of the new range
|
||||
/// @return The value ranged between 1 and new_max
|
||||
/// @note See ft_range.
|
||||
double ft_range_d(double value, double min, double max, double new_max);
|
||||
|
||||
/// @brief Return the absolute value of a
|
||||
/// @param a The value to get the absolute value
|
||||
/// @return The absolute value of a
|
||||
int ft_abs(int a);
|
||||
|
||||
/// @brief Return the rounded value of x
|
||||
/// @param x The value to round
|
||||
/// @return The rounded value of x
|
||||
/// @note This function round the value to the nearest integer
|
||||
double ft_round(double x);
|
||||
|
||||
/// @brief Return the power of a number x to the power of y
|
||||
/// @param x The number to power
|
||||
/// @param y The power
|
||||
/// @return The result of x to the power of y
|
||||
size_t ft_pow(size_t x, size_t y);
|
||||
|
||||
/// @brief Return the root square of a number
|
||||
/// @param nb The number to get the root square
|
||||
/// @return The root square of nb
|
||||
/// @note This function use the newton's method to get the root square
|
||||
/// @note If nb is negative, return -1
|
||||
/// @file ft_sqrt.c
|
||||
double ft_sqrt(double nb);
|
||||
|
||||
/// @brief Return the absolute value of a
|
||||
/// @param a The value to get the absolute value
|
||||
/// @return The absolute value of a
|
||||
/// @note See ft_abs.
|
||||
double ft_complex_abs(t_complex nb);
|
||||
|
||||
/// @brief Add a long to a complex number
|
||||
/// @param nb The complex number to add the factor
|
||||
/// @param factor The factor to add to the complex number
|
||||
/// @return The complex number with the factor added
|
||||
/// @note See ft_complex_addl.
|
||||
t_complex ft_complex_addl(t_complex nb, long factor);
|
||||
|
||||
/// @brief Multiply a complex number by a long
|
||||
/// @param nb The complex number to multiply
|
||||
/// @param factor The factor to multiply the complex number
|
||||
/// @return The complex number multiplied by the factor
|
||||
t_complex ft_complex_mull(t_complex nb, long factor);
|
||||
|
||||
/// @brief Multiply a complex number by a double
|
||||
/// @param nb The complex number to multiply
|
||||
/// @param factor The factor to multiply the complex number
|
||||
/// @return The complex number multiplied by the factor
|
||||
t_complex ft_complex_muld(t_complex nb, double factor);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue