refactor: only the usefull header
- Removing all 'libft.h' mention - Using the include only on the files needed by
This commit is contained in:
parent
afb804195a
commit
905ffd4b72
48 changed files with 142 additions and 120 deletions
|
|
@ -6,11 +6,11 @@
|
|||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/09 13:56:02 by rparodi #+# #+# */
|
||||
/* Updated: 2024/10/31 18:13:39 by rparodi ### ########.fr */
|
||||
/* Updated: 2025/09/01 17:49:19 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
static int count_words(const char *str, char sep)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,11 +6,12 @@
|
|||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/07 16:32:19 by rparodi #+# #+# */
|
||||
/* Updated: 2024/10/31 18:13:01 by rparodi ### ########.fr */
|
||||
/* Updated: 2025/09/01 17:49:27 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
#include "str.h"
|
||||
#include <unistd.h>
|
||||
|
||||
/**
|
||||
* @brief Locates the first occurrence of a character in a string.
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@
|
|||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/07 16:56:56 by rparodi #+# #+# */
|
||||
/* Updated: 2024/10/31 18:07:20 by rparodi ### ########.fr */
|
||||
/* Updated: 2025/09/01 17:50:06 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
#include <unistd.h>
|
||||
|
||||
/**
|
||||
* @brief Compares two strings lexicographically.
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@
|
|||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/31 16:14:10 by rparodi #+# #+# */
|
||||
/* Updated: 2024/10/31 18:14:03 by rparodi ### ########.fr */
|
||||
/* Updated: 2025/09/01 17:36:18 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
#include <unistd.h>
|
||||
|
||||
/**
|
||||
* @brief Copies a string.
|
||||
|
|
|
|||
|
|
@ -6,11 +6,12 @@
|
|||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/07 16:53:59 by rparodi #+# #+# */
|
||||
/* Updated: 2024/10/31 18:14:44 by rparodi ### ########.fr */
|
||||
/* Updated: 2025/09/01 17:58:58 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
#include "str.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
/**
|
||||
* @brief Duplicates a string.
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@
|
|||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/09 13:57:34 by rparodi #+# #+# */
|
||||
/* Updated: 2024/10/31 18:11:04 by rparodi ### ########.fr */
|
||||
/* Updated: 2025/09/01 17:50:26 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
#include <unistd.h>
|
||||
|
||||
/**
|
||||
* @brief Applies a function to each character of a string.
|
||||
|
|
|
|||
|
|
@ -6,11 +6,12 @@
|
|||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/09 13:55:15 by rparodi #+# #+# */
|
||||
/* Updated: 2024/10/31 18:13:21 by rparodi ### ########.fr */
|
||||
/* Updated: 2025/09/01 17:58:58 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
#include "str.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
/**
|
||||
* @brief Joins two strings into a new string.
|
||||
|
|
|
|||
|
|
@ -6,11 +6,12 @@
|
|||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/08 22:28:26 by rparodi #+# #+# */
|
||||
/* Updated: 2024/10/31 18:10:19 by rparodi ### ########.fr */
|
||||
/* Updated: 2025/09/01 17:52:29 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
#include "str.h"
|
||||
#include <unistd.h>
|
||||
|
||||
static size_t ft_strnlen(char *dest, size_t size)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,11 +6,12 @@
|
|||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/07 16:55:25 by rparodi #+# #+# */
|
||||
/* Updated: 2024/10/31 18:12:13 by rparodi ### ########.fr */
|
||||
/* Updated: 2025/09/01 17:52:00 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
#include "str.h"
|
||||
#include <unistd.h>
|
||||
|
||||
/**
|
||||
* @brief Copies a string with size limit.
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@
|
|||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/07 16:56:24 by rparodi #+# #+# */
|
||||
/* Updated: 2024/10/31 18:12:19 by rparodi ### ########.fr */
|
||||
/* Updated: 2025/09/01 18:34:21 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
#include <unistd.h>
|
||||
|
||||
/**
|
||||
* @brief Computes the length of a string.
|
||||
|
|
@ -24,6 +24,8 @@ size_t ft_strlen(const char *s)
|
|||
size_t i;
|
||||
|
||||
i = 0;
|
||||
if (!s)
|
||||
return (0);
|
||||
while (s[i] != '\0')
|
||||
i++;
|
||||
return (i);
|
||||
|
|
|
|||
|
|
@ -6,11 +6,13 @@
|
|||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/09 13:56:57 by rparodi #+# #+# */
|
||||
/* Updated: 2024/10/31 18:14:29 by rparodi ### ########.fr */
|
||||
/* Updated: 2025/09/01 18:28:51 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
#include "memory.h"
|
||||
#include "str.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
/**
|
||||
* @brief Applies a function to each character of a string.
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@
|
|||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/07 16:56:56 by rparodi #+# #+# */
|
||||
/* Updated: 2024/10/31 18:13:58 by rparodi ### ########.fr */
|
||||
/* Updated: 2025/09/01 17:54:01 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
#include <unistd.h>
|
||||
|
||||
/**
|
||||
* @brief Compares two strings up to a specified number of characters.
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@
|
|||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/07 16:57:44 by rparodi #+# #+# */
|
||||
/* Updated: 2024/10/31 18:12:05 by rparodi ### ########.fr */
|
||||
/* Updated: 2025/09/01 17:54:58 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
#include <unistd.h>
|
||||
|
||||
/**
|
||||
* @brief Locates a substring within a string, up to a specified length.
|
||||
|
|
|
|||
|
|
@ -6,11 +6,12 @@
|
|||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/07 16:58:22 by rparodi #+# #+# */
|
||||
/* Updated: 2024/10/31 18:13:53 by rparodi ### ########.fr */
|
||||
/* Updated: 2025/09/01 17:49:39 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
#include "str.h"
|
||||
#include <unistd.h>
|
||||
|
||||
/**
|
||||
* @brief Locates the last occurrence of a character in a string.
|
||||
|
|
|
|||
|
|
@ -6,11 +6,12 @@
|
|||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/09 13:55:44 by rparodi #+# #+# */
|
||||
/* Updated: 2024/10/31 18:09:25 by rparodi ### ########.fr */
|
||||
/* Updated: 2025/09/01 18:26:20 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
#include "str.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
/**
|
||||
* @brief Trims specified characters from the start and end of a string.
|
||||
|
|
|
|||
|
|
@ -6,11 +6,12 @@
|
|||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/09 13:54:42 by rparodi #+# #+# */
|
||||
/* Updated: 2024/10/31 18:10:59 by rparodi ### ########.fr */
|
||||
/* Updated: 2025/09/01 18:26:29 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
#include "str.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
/**
|
||||
* @brief Extracts a substring from a string.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue