From 5a68f60c5d62363e50eb9fd0f28666dc3d03963b Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 31 Oct 2024 14:51:47 +0100 Subject: [PATCH] docs: Adding the char/ and convert/ documentation folder --- .clangd | 4 ++++ .gitignore | 53 +++++++++++++++++++++++++++++++++++++++++++++++ char/ft_isalnum.c | 8 ++++++- char/ft_isalpha.c | 8 ++++++- char/ft_isascii.c | 8 ++++++- char/ft_isdigit.c | 8 ++++++- char/ft_isprint.c | 8 ++++++- char/ft_tolower.c | 8 ++++++- char/ft_toupper.c | 8 ++++++- convert/ft_atoi.c | 8 ++++++- convert/ft_itoa.c | 8 ++++++- 11 files changed, 120 insertions(+), 9 deletions(-) create mode 100644 .clangd create mode 100644 .gitignore diff --git a/.clangd b/.clangd new file mode 100644 index 0000000..5f65c4b --- /dev/null +++ b/.clangd @@ -0,0 +1,4 @@ +CompilerFlags: + Add: + - "-xc" + - "-I/Users/raphael/Documents/42_cursus/circle0/libft/includes" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d564185 --- /dev/null +++ b/.gitignore @@ -0,0 +1,53 @@ +to_do* +# Prerequisites +*.d + +# Object files +*.o +*.ko +*.obj +*.elf + +# Linker output +*.ilk +*.map +*.exp + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ +*.su +*.idb +*.pdb + +# Kernel Module Compile Results +*.mod* +*.cmd +.tmp_versions/ +modules.order +Module.symvers +Mkfile.old +dkms.conf diff --git a/char/ft_isalnum.c b/char/ft_isalnum.c index 0de3565..6898862 100644 --- a/char/ft_isalnum.c +++ b/char/ft_isalnum.c @@ -6,12 +6,18 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/11/06 12:47:28 by rparodi #+# #+# */ -/* Updated: 2023/11/07 10:38:08 by rparodi ### ########.fr */ +/* Updated: 2024/10/31 12:54:42 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" +/** + * @brief Check if the character is alpha-numeric + * + * @param c the character + * @return the character if alphanumeric or 0 if not + */ int ft_isalnum(int c) { if (ft_isalpha(c) || ft_isdigit(c)) diff --git a/char/ft_isalpha.c b/char/ft_isalpha.c index 1d9f36f..8f93d59 100644 --- a/char/ft_isalpha.c +++ b/char/ft_isalpha.c @@ -6,12 +6,18 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/11/06 11:58:37 by rparodi #+# #+# */ -/* Updated: 2023/11/07 10:38:08 by rparodi ### ########.fr */ +/* Updated: 2024/10/31 12:54:40 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" +/** + * @brief Check if the character is alpha + * + * @param c the character + * @return the character if alpha or 0 if not + */ int ft_isalpha(int c) { if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) diff --git a/char/ft_isascii.c b/char/ft_isascii.c index 2c0bad9..942e780 100644 --- a/char/ft_isascii.c +++ b/char/ft_isascii.c @@ -6,12 +6,18 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/11/06 14:04:26 by rparodi #+# #+# */ -/* Updated: 2023/11/08 18:23:33 by rparodi ### ########.fr */ +/* Updated: 2024/10/31 12:49:55 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" +/** + * @brief Check if the character is in the ascii table + * + * @param c the character + * @return the character if in the ascii table or 0 if not + */ int ft_isascii(int c) { if (c == 0) diff --git a/char/ft_isdigit.c b/char/ft_isdigit.c index 5bde7f0..ac3315e 100644 --- a/char/ft_isdigit.c +++ b/char/ft_isdigit.c @@ -6,12 +6,18 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/11/06 12:44:28 by rparodi #+# #+# */ -/* Updated: 2023/11/07 10:35:36 by rparodi ### ########.fr */ +/* Updated: 2024/10/31 12:49:05 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" +/** + * @brief Check if the character is alpha numeric + * + * @param c the character + * @return the character if numeric or 0 if not + */ int ft_isdigit(int c) { if (c >= '0' && c <= '9') diff --git a/char/ft_isprint.c b/char/ft_isprint.c index 5997448..d77c82a 100644 --- a/char/ft_isprint.c +++ b/char/ft_isprint.c @@ -6,12 +6,18 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/11/06 14:06:53 by rparodi #+# #+# */ -/* Updated: 2023/11/07 17:01:22 by rparodi ### ########.fr */ +/* Updated: 2024/10/31 12:50:37 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" +/** + * @brief Check if the character is printable + * + * @param c the character + * @return the character if can be print or 0 if not + */ int ft_isprint(int c) { if (c >= 32 && c <= 126) diff --git a/char/ft_tolower.c b/char/ft_tolower.c index a520567..5130815 100644 --- a/char/ft_tolower.c +++ b/char/ft_tolower.c @@ -6,12 +6,18 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/11/07 10:38:54 by rparodi #+# #+# */ -/* Updated: 2023/11/07 16:59:18 by rparodi ### ########.fr */ +/* Updated: 2024/10/31 12:55:28 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" +/** + * @brief convert the upper case to lower case + * + * @param c the character + * @return the character to lower case if is on upper + */ int ft_tolower(int c) { if (c >= 'A' && c <= 'Z') diff --git a/char/ft_toupper.c b/char/ft_toupper.c index a320bce..d3c01b4 100644 --- a/char/ft_toupper.c +++ b/char/ft_toupper.c @@ -6,12 +6,18 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/11/07 10:44:26 by rparodi #+# #+# */ -/* Updated: 2023/11/08 18:08:21 by rparodi ### ########.fr */ +/* Updated: 2024/10/31 12:55:14 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" +/** + * @brief convert the lower case to upper case + * + * @param c the character + * @return the character to upper case if is on lower + */ int ft_toupper(int c) { if (c >= 'a' && c <= 'z') diff --git a/convert/ft_atoi.c b/convert/ft_atoi.c index 8f0c074..801b643 100644 --- a/convert/ft_atoi.c +++ b/convert/ft_atoi.c @@ -6,7 +6,7 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/11/08 17:22:41 by rparodi #+# #+# */ -/* Updated: 2023/11/13 12:20:14 by rparodi ### ########.fr */ +/* Updated: 2024/10/31 13:02:58 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ @@ -33,6 +33,12 @@ static int ft_check_sign(const char *nptr, int *i) return (1); } +/** + * @brief Converts string to integer + * + * @param nptr the string that will be converted + * @return The integer on the string + */ int ft_atoi(const char *nptr) { int i; diff --git a/convert/ft_itoa.c b/convert/ft_itoa.c index fa4265f..6104fe3 100644 --- a/convert/ft_itoa.c +++ b/convert/ft_itoa.c @@ -6,7 +6,7 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/11/09 13:56:30 by rparodi #+# #+# */ -/* Updated: 2023/11/13 19:50:31 by rparodi ### ########.fr */ +/* Updated: 2024/10/31 13:02:55 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ @@ -25,6 +25,12 @@ static size_t ft_check_sign(char *str, long *nb) return (0); } +/** + * @brief Converts integer to string + * + * @param n the integer that will be converted + * @return The string with this integer + */ char *ft_itoa(int n) { size_t i;