From afb14a1a484de71f4216a082211ca582975efb28 Mon Sep 17 00:00:00 2001 From: Lukas Jiriste Date: Wed, 28 Jun 2023 10:15:06 +0200 Subject: [PATCH] Added 42 headers with the creation time set to the time of creation at home. Also changed formatting to comply with the norm. --- ex00/ft_foreach.c | 14 ++++++++++++-- ex01/ft_map.c | 14 ++++++++++++-- ex02/ft_any.c | 16 +++++++++++++--- ex03/ft_count_if.c | 14 ++++++++++++-- ex04/ft_is_sort.c | 14 ++++++++++++-- ex05/headers/operators.h | 12 +++++++++++- ex05/headers/utils.h | 12 +++++++++++- ex05/sources/main.c | 16 +++++++++++++--- ex05/sources/operators.c | 18 ++++++++++++++---- ex05/sources/utils.c | 14 ++++++++++++-- ex06/ft_sort_string_tab.c | 14 ++++++++++++-- ex06/main.c | 12 +++++++++++- 12 files changed, 145 insertions(+), 25 deletions(-) diff --git a/ex00/ft_foreach.c b/ex00/ft_foreach.c index 8638acc..bf67919 100644 --- a/ex00/ft_foreach.c +++ b/ex00/ft_foreach.c @@ -1,6 +1,16 @@ -//27.06.2023 20:28 +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_foreach.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: ljiriste +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/06/27 20:28:04 by ljiriste #+# #+# */ +/* Updated: 2023/06/28 10:05:10 by ljiriste ### ########.fr */ +/* */ +/* ************************************************************************** */ -void ft_foreach(int *tab, int length, void(*f)(int)) +void ft_foreach(int *tab, int length, void (*f)(int)) { int i; diff --git a/ex01/ft_map.c b/ex01/ft_map.c index c5655fa..cecac24 100644 --- a/ex01/ft_map.c +++ b/ex01/ft_map.c @@ -1,8 +1,18 @@ -//27.06.2023 20:30 +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_map.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: ljiriste +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/06/27 20:30:34 by ljiriste #+# #+# */ +/* Updated: 2023/06/28 10:06:20 by ljiriste ### ########.fr */ +/* */ +/* ************************************************************************** */ #include -int *ft_map(int *tab, int length, int(*f)(int)) +int *ft_map(int *tab, int length, int (*f)(int)) { int i; int *res; diff --git a/ex02/ft_any.c b/ex02/ft_any.c index 4946797..090d8f4 100644 --- a/ex02/ft_any.c +++ b/ex02/ft_any.c @@ -1,9 +1,19 @@ -//27.06.2023 20:39 +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_any.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: ljiriste +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/06/27 20:39:52 by ljiriste #+# #+# */ +/* Updated: 2023/06/28 10:07:34 by ljiriste ### ########.fr */ +/* */ +/* ************************************************************************** */ -int ft_any(char **tab, int(*f)(char*)) +int ft_any(char **tab, int (*f)(char*)) { while (*tab) - if(f(*(tab++))) + if (f(*(tab++))) return (1); return (0); } diff --git a/ex03/ft_count_if.c b/ex03/ft_count_if.c index d4179e2..acea843 100644 --- a/ex03/ft_count_if.c +++ b/ex03/ft_count_if.c @@ -1,6 +1,16 @@ -//27.06.2023 20:41 +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_count_if.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: ljiriste +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/06/27 20:41:17 by ljiriste #+# #+# */ +/* Updated: 2023/06/28 10:06:20 by ljiriste ### ########.fr */ +/* */ +/* ************************************************************************** */ -int ft_count_if(char **tab, int length, int(*f)(char*)) +int ft_count_if(char **tab, int length, int (*f)(char*)) { int i; int count; diff --git a/ex04/ft_is_sort.c b/ex04/ft_is_sort.c index c932987..168b3b7 100644 --- a/ex04/ft_is_sort.c +++ b/ex04/ft_is_sort.c @@ -1,6 +1,16 @@ -//27.06.2023 20:48 +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_is_sort.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: ljiriste +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/06/27 20:48:37 by ljiriste #+# #+# */ +/* Updated: 2023/06/28 10:06:20 by ljiriste ### ########.fr */ +/* */ +/* ************************************************************************** */ -int ft_is_sort(int *tab, int length, int(*f)(int, int)) +int ft_is_sort(int *tab, int length, int (*f)(int, int)) { int i; diff --git a/ex05/headers/operators.h b/ex05/headers/operators.h index a8691e0..3bc2794 100644 --- a/ex05/headers/operators.h +++ b/ex05/headers/operators.h @@ -1,4 +1,14 @@ -//28.06.2023 06:21 +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* operators.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: ljiriste +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/06/28 06:21:27 by ljiriste #+# #+# */ +/* Updated: 2023/06/28 10:08:48 by ljiriste ### ########.fr */ +/* */ +/* ************************************************************************** */ #ifndef OPERATORS_H # define OPERATORS_H diff --git a/ex05/headers/utils.h b/ex05/headers/utils.h index 2804084..c33e577 100644 --- a/ex05/headers/utils.h +++ b/ex05/headers/utils.h @@ -1,4 +1,14 @@ -//28.06.2023 06:47 +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* utils.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: ljiriste +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/06/28 06:47:49 by ljiriste #+# #+# */ +/* Updated: 2023/06/28 10:09:05 by ljiriste ### ########.fr */ +/* */ +/* ************************************************************************** */ #ifndef UTILS_H # define UTILS_H diff --git a/ex05/sources/main.c b/ex05/sources/main.c index a90e800..6120083 100644 --- a/ex05/sources/main.c +++ b/ex05/sources/main.c @@ -1,10 +1,20 @@ -//27.06.2023 20:53 +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* main.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: ljiriste +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/06/28 20:53:06 by ljiriste #+# #+# */ +/* Updated: 2023/06/28 10:10:18 by ljiriste ### ########.fr */ +/* */ +/* ************************************************************************** */ #include #include "operators.h" #include "utils.h" -enum operator_id +enum e_operator_id { Invalid, Add, @@ -14,7 +24,7 @@ enum operator_id Mod, }; -enum operator_id get_op_id(char *str) +enum e_operator_id get_op_id(char *str) { if (str[1] != '\0') return (Invalid); diff --git a/ex05/sources/operators.c b/ex05/sources/operators.c index 4acc323..4ff4e12 100644 --- a/ex05/sources/operators.c +++ b/ex05/sources/operators.c @@ -1,4 +1,14 @@ -//28.06.2023 6:23 +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* operators.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: ljiriste +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/06/28 06:23:24 by ljiriste #+# #+# */ +/* Updated: 2023/06/28 10:10:47 by ljiriste ### ########.fr */ +/* */ +/* ************************************************************************** */ #include "operators.h" @@ -7,17 +17,17 @@ int ft_add(int n1, int n2) return (n1 + n2); } -int ft_sub(int n1, int n2) +int ft_sub(int n1, int n2) { return (n1 - n2); } -int ft_mul(int n1, int n2) +int ft_mul(int n1, int n2) { return (n1 * n2); } -int ft_div(int n1, int n2) +int ft_div(int n1, int n2) { return (n1 / n2); } diff --git a/ex05/sources/utils.c b/ex05/sources/utils.c index d47bbab..e9e0a61 100644 --- a/ex05/sources/utils.c +++ b/ex05/sources/utils.c @@ -1,4 +1,14 @@ -//28.06.2023 6:37 +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* utils.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: ljiriste +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/06/28 06:37:35 by ljiriste #+# #+# */ +/* Updated: 2023/06/28 10:11:02 by ljiriste ### ########.fr */ +/* */ +/* ************************************************************************** */ #include #include "utils.h" @@ -36,7 +46,7 @@ int is_space(char c) return (c == ' ' || ('\t' <= c && c <= '\r')); } -int is_digit(char c) +int is_digit(char c) { return ('0' <= c && c <= '9'); } diff --git a/ex06/ft_sort_string_tab.c b/ex06/ft_sort_string_tab.c index 5c2f09b..b86c13b 100644 --- a/ex06/ft_sort_string_tab.c +++ b/ex06/ft_sort_string_tab.c @@ -1,4 +1,14 @@ -// 28.06.2023 07:13 +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_sort_string_tab.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: ljiriste +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/06/28 07:13:52 by ljiriste #+# #+# */ +/* Updated: 2023/06/28 10:06:51 by ljiriste ### ########.fr */ +/* */ +/* ************************************************************************** */ void ft_swap(char **s1, char **s2) { @@ -10,7 +20,7 @@ void ft_swap(char **s1, char **s2) return ; } -int ft_strcmp(char *s1, char *s2) +int ft_strcmp(char *s1, char *s2) { while (*s1 == *s2 && *s1 && *s2) { diff --git a/ex06/main.c b/ex06/main.c index bcbd32e..3ade81c 100644 --- a/ex06/main.c +++ b/ex06/main.c @@ -1,4 +1,14 @@ -//28.06.2023 07:29 +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* main.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: ljiriste +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/06/28 07:29:06 by ljiriste #+# #+# */ +/* Updated: 2023/06/28 09:55:37 by ljiriste ### ########.fr */ +/* */ +/* ************************************************************************** */ #include -- 2.30.2