Added 42 headers with the creation time set to the time of creation at home.
authorLukas Jiriste <ljiriste@student.42prague.com>
Wed, 28 Jun 2023 08:15:06 +0000 (10:15 +0200)
committerLukas Jiriste <ljiriste@student.42prague.com>
Wed, 28 Jun 2023 08:15:06 +0000 (10:15 +0200)
Also changed formatting to comply with the norm.

12 files changed:
ex00/ft_foreach.c
ex01/ft_map.c
ex02/ft_any.c
ex03/ft_count_if.c
ex04/ft_is_sort.c
ex05/headers/operators.h
ex05/headers/utils.h
ex05/sources/main.c
ex05/sources/operators.c
ex05/sources/utils.c
ex06/ft_sort_string_tab.c
ex06/main.c

index 8638acc97c2d7b7bf6194678673a693b87e14169..bf67919c2a2bb66340833e6911bc1de70ebb6bea 100644 (file)
@@ -1,6 +1,16 @@
-//27.06.2023 20:28
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   ft_foreach.c                                       :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: ljiriste <marvin@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   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;
 
index c5655fac6e3c766b0c61566deaeac88bb9fd368c..cecac240605b7dc57a9213da574826187f06b66f 100644 (file)
@@ -1,8 +1,18 @@
-//27.06.2023 20:30
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   ft_map.c                                           :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: ljiriste <marvin@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2023/06/27 20:30:34 by ljiriste          #+#    #+#             */
+/*   Updated: 2023/06/28 10:06:20 by ljiriste         ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
 
 #include <stdlib.h>
 
-int    *ft_map(int *tab, int length, int(*f)(int))
+int    *ft_map(int *tab, int length, int (*f)(int))
 {
        int     i;
        int     *res;
index 4946797a54bf02d77643685b8dc6c73f6e21eb03..090d8f4ebf6b55b95d8211ee8d3c34100574cde9 100644 (file)
@@ -1,9 +1,19 @@
-//27.06.2023 20:39
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   ft_any.c                                           :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: ljiriste <marvin@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   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);
 }
index d4179e2a5d6bdd9fd7d85151ec32d97033b77149..acea8435d50aa5d27474d034e842b2f737212e20 100644 (file)
@@ -1,6 +1,16 @@
-//27.06.2023 20:41
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   ft_count_if.c                                      :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: ljiriste <marvin@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   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;
index c932987bb97fbe2f55fa326dd935271c654750c4..168b3b7aa0d5f201b758baf893302054d0aad58c 100644 (file)
@@ -1,6 +1,16 @@
-//27.06.2023 20:48
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   ft_is_sort.c                                       :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: ljiriste <marvin@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   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;
 
index a8691e04985b2c160f9405c02e026871377dcf0d..3bc2794f57278d7084e48a21220fbb67b6cf6388 100644 (file)
@@ -1,4 +1,14 @@
-//28.06.2023 06:21
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   operators.h                                        :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: ljiriste <marvin@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   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
index 28040845ace35387b276c0e579da95f08307ee82..c33e577ac95285f77b38a797cf5f2397b8a98a90 100644 (file)
@@ -1,4 +1,14 @@
-//28.06.2023 06:47
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   utils.h                                            :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: ljiriste <marvin@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   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
index a90e8001e8870c7ed83d30d05ed181d973b03d54..612008323d4c624e75529754f9932e415e35cfa3 100644 (file)
@@ -1,10 +1,20 @@
-//27.06.2023 20:53
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   main.c                                             :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: ljiriste <marvin@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2023/06/28 20:53:06 by ljiriste          #+#    #+#             */
+/*   Updated: 2023/06/28 10:10:18 by ljiriste         ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
 
 #include <unistd.h>
 #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);
index 4acc3235205625c4dc10ae3c18397b67655a46c0..4ff4e120777c59dca85257d9ee6b9ee4cfbed1b2 100644 (file)
@@ -1,4 +1,14 @@
-//28.06.2023 6:23
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   operators.c                                        :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: ljiriste <marvin@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   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);
 }
index d47bbab60ebf8fd75cc1749851892bf61285e677..e9e0a6140b31cbe37e5f690d8554df458a7848a3 100644 (file)
@@ -1,4 +1,14 @@
-//28.06.2023 6:37
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   utils.c                                            :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: ljiriste <marvin@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2023/06/28 06:37:35 by ljiriste          #+#    #+#             */
+/*   Updated: 2023/06/28 10:11:02 by ljiriste         ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
 
 #include <unistd.h>
 #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');
 }
index 5c2f09ba29abb8596fb968d4386f1be19f1734e4..b86c13bddf9f84091cc439a4dd9c5eb11f609fdf 100644 (file)
@@ -1,4 +1,14 @@
-// 28.06.2023 07:13
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   ft_sort_string_tab.c                               :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: ljiriste <marvin@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   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)
        {
index bcbd32ec7cb092b860d292b94aeae7ba77d7804e..3ade81ccdeecec253c45147460afa7e4f0921810 100644 (file)
@@ -1,4 +1,14 @@
-//28.06.2023 07:29
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   main.c                                             :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: ljiriste <marvin@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2023/06/28 07:29:06 by ljiriste          #+#    #+#             */
+/*   Updated: 2023/06/28 09:55:37 by ljiriste         ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
 
 #include <unistd.h>