docs: Adding the doxygen on all my function

This commit is contained in:
Raphael 2024-10-31 18:16:00 +01:00
parent 707e9a4177
commit f5bcbeac3c
38 changed files with 342 additions and 43 deletions

View file

@ -6,12 +6,18 @@
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/07 16:43:13 by rparodi #+# #+# */
/* Updated: 2023/11/07 17:25:28 by rparodi ### ########.fr */
/* Updated: 2024/10/31 17:54:25 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/**
* @brief Sets a block of memory to zero
*
* @param s Pointer to the memory area to be set at zero
* @param n Number of bytes to set to zero
*/
void ft_bzero(void *s, size_t n)
{
ft_memset(s, 0, n);

View file

@ -6,12 +6,18 @@
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/07 16:47:17 by rparodi #+# #+# */
/* Updated: 2023/11/13 14:47:17 by rparodi ### ########.fr */
/* Updated: 2024/10/31 17:55:30 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/**
* @brief Allocates and zeroes memory for an array
*
* @param nmemb Number of elements to allocate
* @param size Size of each element in bytes
*/
void *ft_calloc(size_t nmemb, size_t size)
{
size_t total;

View file

@ -6,12 +6,22 @@
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/07 16:48:30 by rparodi #+# #+# */
/* Updated: 2023/11/07 18:45:57 by rparodi ### ########.fr */
/* Updated: 2024/10/31 17:59:07 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/**
* @brief Scans memory for a byte
*
* @param s Pointer to the memory area to scan
* @param c Byte value to search for
* @param n Number of bytes to scan in s
*
* @return A pointer to the matching byte in memory, or NULL if the byte
is not found within the first n bytes
*/
void *ft_memchr(const void *s, int c, size_t n)
{
size_t i;

View file

@ -6,12 +6,24 @@
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/07 16:49:04 by rparodi #+# #+# */
/* Updated: 2023/11/07 18:46:15 by rparodi ### ########.fr */
/* Updated: 2024/10/31 17:59:48 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/**
* @brief Compares two memory blocks
*
* @param s1 Pointer to the first memory area
* @param s2 Pointer to the second memory area
* @param n Number of bytes to compare
*
* @return An integer indicating the relationship between the two memory areas:
* - `< 0` if `s1` is less than `s2`
* - `0` if `s1` equals `s2`
* - `> 0` if `s1` is greater than `s2`
*/
int ft_memcmp(const void *s1, const void *s2, size_t n)
{
size_t i;

View file

@ -6,12 +6,21 @@
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/07 16:49:46 by rparodi #+# #+# */
/* Updated: 2023/11/13 19:14:23 by rparodi ### ########.fr */
/* Updated: 2024/10/31 17:57:31 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/**
* @brief Copies memory from source to destination
*
* @param dest Pointer to the destination memory area
* @param src Pointer to the source memory area
* @param n Number of bytes to copy from src to dest
*
* @return A pointer to the destination memory area dest
*/
void *ft_memcpy(void *dest, const void *src, size_t n)
{
char *d;

View file

@ -6,7 +6,7 @@
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/07 16:51:35 by rparodi #+# #+# */
/* Updated: 2023/11/13 19:55:40 by rparodi ### ########.fr */
/* Updated: 2024/10/31 18:15:19 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
@ -37,6 +37,15 @@ char *ft_checks(char *s, char *d, size_t n)
return (d);
}
/**
* @brief Copies memory with overlap handling
*
* @param dest Pointer to the destination memory area
* @param src Pointer to the source memory area
* @param n Number of bytes to copy from src to dest
*
* @return A pointer to the destination memory area dest
*/
void *ft_memmove(void *dest, const void *src, size_t n)
{
char *d;

View file

@ -6,12 +6,21 @@
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/07 16:50:29 by rparodi #+# #+# */
/* Updated: 2023/11/07 18:58:02 by rparodi ### ########.fr */
/* Updated: 2024/10/31 17:56:59 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/**
* @brief Fills a block of memory with a specified byte
*
* @param s Pointer to the memory area to fill
* @param c Byte value to be set in the memory
* @param n Number of bytes to be set to the value c
*
* @return A pointer to the memory area s
*/
void *ft_memset(void *s, int c, size_t n)
{
char *str;