updated libraries
This commit is contained in:
parent
b26803cb1b
commit
87324ea3ab
4
Makefile
4
Makefile
@ -6,7 +6,7 @@
|
||||
# By: houtworm <codam@houtworm.net> +#+ #
|
||||
# +#+ #
|
||||
# Created: 2023/10/26 10:46:29 by houtworm #+# #+# #
|
||||
# Updated: 2023/10/26 17:30:17 by houtworm ######## odam.nl #
|
||||
# Updated: 2023/10/26 17:49:09 by houtworm ######## odam.nl #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
@ -41,7 +41,7 @@ fclean: clean
|
||||
|
||||
re: fclean all
|
||||
|
||||
$(OBJ): $(SRC)
|
||||
$(OBJ): $(SRC) Makefile cub3d.h
|
||||
@mkdir -p $(dir $@)
|
||||
@printf "\e[1;34mBuilding $@\n\e[0;00m"
|
||||
@$(CC) $(CFLAGS) -c $(@:obj/%.o=src/%.c) -o $@
|
||||
|
@ -1,12 +1,12 @@
|
||||
# **************************************************************************** #
|
||||
# #
|
||||
# .--. _ #
|
||||
# Makefile |o_o || | #
|
||||
# Makefile :+: :+: #
|
||||
# |:_/ || |_ _ ___ __ #
|
||||
# By: djonker <djonker@student.codam.nl> // \ \ __| | | \ \/ / #
|
||||
# (| | )|_| |_| |> < #
|
||||
# Created: 2021/05/27 01:24:02 by djonker /'\_ _/`\__|\__,_/_/\_\ #
|
||||
# Updated: 2023/02/20 20:37:06 by houtworm \___)=(___/ #
|
||||
# Updated: 2023/10/26 18:00:26 by houtworm ######## odam.nl #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
@ -33,7 +33,7 @@ fclean: clean
|
||||
|
||||
re: fclean all
|
||||
|
||||
$(OBJ): $(SRC)
|
||||
$(OBJ): $(SRC) get_next_line.h Makefile
|
||||
@mkdir -p $(dir $@)
|
||||
@printf "\e[1;34mBuilding $@\n\e[0;00m"
|
||||
@$(CC) $(CFLAGS) -c $(@:obj/%.o=src/%.c) -o $@
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* get_next_line.h |o_o || | */
|
||||
/* get_next_line.h :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2020/12/19 06:09:11 by djonker #+# #+# */
|
||||
/* Updated: 2023/03/09 03:26:07 by houtworm \___)=(___/ */
|
||||
/* Created: 2023/10/26 18:51:25 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/26 18:51:26 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* get_next_line.c |o_o || | */
|
||||
/* get_next_line.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/03/15 22:51:05 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/20 20:32:05 by houtworm \___)=(___/ */
|
||||
/* Created: 2023/10/26 18:52:17 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/26 18:52:18 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* get_next_line_utils.c :+: :+: :+: */
|
||||
/* get_next_line_utils.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/04/05 07:45:24 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:54:10 by houtworm ### ########.fr */
|
||||
/* Created: 2023/10/26 18:52:21 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/26 18:52:21 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* maina.c |o_o || | */
|
||||
/* maina.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/15 03:43:05 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/21 00:36:49 by houtworm \___)=(___/ */
|
||||
/* Created: 2023/10/26 18:52:45 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/26 18:52:45 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* mainb.c |o_o || | */
|
||||
/* mainb.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/15 03:43:05 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/21 00:36:03 by houtworm \___)=(___/ */
|
||||
/* Created: 2023/10/26 18:52:48 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/26 18:52:48 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* mainc.c |o_o || | */
|
||||
/* mainc.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/15 03:43:05 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/21 00:35:58 by houtworm \___)=(___/ */
|
||||
/* Created: 2023/10/26 18:52:50 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/26 18:52:51 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* maind.c |o_o || | */
|
||||
/* maind.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/15 03:43:05 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/21 00:35:54 by houtworm \___)=(___/ */
|
||||
/* Created: 2023/10/26 18:52:53 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/26 18:52:54 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* maine.c |o_o || | */
|
||||
/* maine.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/15 03:43:05 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/23 15:00:31 by houtworm \___)=(___/ */
|
||||
/* Created: 2023/10/26 18:52:56 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/26 18:52:56 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* mainf.c |o_o || | */
|
||||
/* mainf.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/15 03:43:05 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/21 00:35:34 by houtworm \___)=(___/ */
|
||||
/* Created: 2023/10/26 18:52:59 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/26 18:52:59 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* maing.c |o_o || | */
|
||||
/* maing.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/15 03:43:05 by djonker #+# #+# */
|
||||
/* Updated: 2023/03/01 01:41:42 by houtworm \___)=(___/ */
|
||||
/* Created: 2023/10/26 18:53:02 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/26 18:53:02 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* maina.c |o_o || | */
|
||||
/* maina.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/15 03:43:05 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/21 00:42:59 by houtworm \___)=(___/ */
|
||||
/* Created: 2023/10/26 18:53:05 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/26 18:53:05 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* mainb.c |o_o || | */
|
||||
/* mainb.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/15 03:43:05 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/21 00:43:10 by houtworm \___)=(___/ */
|
||||
/* Created: 2023/10/26 18:53:08 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/26 18:53:08 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* mainc.c |o_o || | */
|
||||
/* mainc.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/15 03:43:05 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/21 00:43:21 by houtworm \___)=(___/ */
|
||||
/* Created: 2023/10/26 18:53:10 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/26 18:53:11 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* maind.c |o_o || | */
|
||||
/* maind.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/15 03:43:05 by djonker #+# #+# */
|
||||
/* Updated: 2023/03/01 01:24:29 by houtworm \___)=(___/ */
|
||||
/* Created: 2023/10/26 18:53:14 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/26 18:53:14 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* maine.c |o_o || | */
|
||||
/* maine.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/15 03:43:05 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/23 15:00:34 by houtworm \___)=(___/ */
|
||||
/* Created: 2023/10/26 18:53:18 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/26 18:53:18 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* mainf.c |o_o || | */
|
||||
/* mainf.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/15 03:43:05 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/21 00:44:00 by houtworm \___)=(___/ */
|
||||
/* Created: 2023/10/26 18:53:21 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/26 18:53:22 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* maing.c |o_o || | */
|
||||
/* maing.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/15 03:43:05 by djonker #+# #+# */
|
||||
/* Updated: 2023/03/01 01:39:22 by houtworm \___)=(___/ */
|
||||
/* Created: 2023/10/26 18:53:24 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/26 18:53:25 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
BIN
getnextline/tests/tmp/binary
Executable file
BIN
getnextline/tests/tmp/binary
Executable file
Binary file not shown.
41
getnextline/tests/tmp/get_next_line.h
Normal file
41
getnextline/tests/tmp/get_next_line.h
Normal file
@ -0,0 +1,41 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* get_next_line.h :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2023/10/26 18:51:25 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/26 18:51:26 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef GET_NEXT_LINE_H
|
||||
# define GET_NEXT_LINE_H
|
||||
|
||||
# include <unistd.h>
|
||||
# include <stdlib.h>
|
||||
# include <fcntl.h>
|
||||
|
||||
# ifndef BUFFER_SIZE
|
||||
# define BUFFER_SIZE 300
|
||||
# endif
|
||||
|
||||
struct s_gnl
|
||||
{
|
||||
char b[BUFFER_SIZE + 1];
|
||||
int fd;
|
||||
};
|
||||
|
||||
int get_next_line(int fd, char **line);
|
||||
int findnewline(struct s_gnl *strct);
|
||||
int newline(struct s_gnl *strct, char **line);
|
||||
int blimit(int l, struct s_gnl *strct, char **line, char *t);;
|
||||
int nonewline(int l, struct s_gnl *strct, char **line);
|
||||
char *gnl_substr(char const *s, unsigned int start, size_t len);
|
||||
void *gnl_memcpy(void *dst, const void *src, size_t n);
|
||||
size_t gnl_strlen(char *str);
|
||||
void gnl_bzero(void *s, size_t n);
|
||||
char *gnl_strjoin(char const *s1, char const *s2);
|
||||
|
||||
#endif
|
18
getnextline/tests/tmp/memorycheck
Normal file
18
getnextline/tests/tmp/memorycheck
Normal file
@ -0,0 +1,18 @@
|
||||
==2845039== Memcheck, a memory error detector
|
||||
==2845039== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
|
||||
==2845039== Using Valgrind-3.21.0 and LibVEX; rerun with -h for copyright info
|
||||
==2845039== Command: ./tests/tmp/binary
|
||||
==2845039==
|
||||
==2845039==
|
||||
==2845039== Process terminating with default action of signal 2 (SIGINT)
|
||||
==2845039== at 0x4986BF0: open (open64.c:41)
|
||||
==2845039== by 0x1091BF: main (in /home/houtworm/Projects/codam/Core/02getnextline/tests/tmp/binary)
|
||||
==2845039==
|
||||
==2845039== HEAP SUMMARY:
|
||||
==2845039== in use at exit: 0 bytes in 0 blocks
|
||||
==2845039== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
|
||||
==2845039==
|
||||
==2845039== All heap blocks were freed -- no leaks are possible
|
||||
==2845039==
|
||||
==2845039== For lists of detected and suppressed errors, rerun with: -s
|
||||
==2845039== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
|
3
getnextline/tests/tmp/norm
Normal file
3
getnextline/tests/tmp/norm
Normal file
@ -0,0 +1,3 @@
|
||||
./src/get_next_line_utils.c: OK!
|
||||
./src/get_next_line.c: OK!
|
||||
./get_next_line.h: OK!
|
10
getnextline/tests/tmp/output
Normal file
10
getnextline/tests/tmp/output
Normal file
@ -0,0 +1,10 @@
|
||||
<<1>>1 character on a line
|
||||
<<1>>1
|
||||
<<1>>1
|
||||
<<1>>empty line
|
||||
<<1>>
|
||||
<<1>>
|
||||
<<1>>3000 characters on a line
|
||||
<<1>>123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
<<1>>123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
<<0>>
|
0
getnextline/tests/tmp/relink
Normal file
0
getnextline/tests/tmp/relink
Normal file
8
libft/.gitignore
vendored
8
libft/.gitignore
vendored
@ -1,8 +0,0 @@
|
||||
*.pdf
|
||||
*.o
|
||||
*.a
|
||||
LICENSE
|
||||
obj
|
||||
tests/tmp
|
||||
.git
|
||||
.ccls-cache
|
@ -1,18 +1,18 @@
|
||||
# **************************************************************************** #
|
||||
# #
|
||||
# :::::::: #
|
||||
# Makefile |o_o || | #
|
||||
# Makefile :+: :+: #
|
||||
# +:+ #
|
||||
# By: djonker <marvin@codam.nl> +#+ #
|
||||
# +#+ #
|
||||
# Created: 2020/10/27 15:02:02 by djonker #+# #+# #
|
||||
# Updated: 2023/02/23 15:40:38 by houtworm \___)=(___/ #
|
||||
# Updated: 2023/10/26 18:29:23 by houtworm ######## odam.nl #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
NAME =libft.a
|
||||
CC =gcc
|
||||
FC =-Wall -Werror -Wextra -fsanitize=address
|
||||
FC =-Wall -Werror -Wextra# -g -fsanitize=address
|
||||
FAR =ar -rs
|
||||
RM =rm -f
|
||||
SRC =src/ft_atoi.c \
|
||||
@ -138,7 +138,24 @@ SRC =src/ft_atoi.c \
|
||||
src/ft_islneg.c \
|
||||
src/ft_ldeclen.c \
|
||||
src/ft_isallbyte.c \
|
||||
src/ft_getpwd.c
|
||||
src/ft_getuser.c \
|
||||
src/ft_gethome.c \
|
||||
src/ft_getpwd.c \
|
||||
src/ft_vastrjoin.c \
|
||||
src/ft_vafree.c \
|
||||
src/ft_intrchr.c \
|
||||
src/ft_system.c \
|
||||
src/ft_getpaths.c \
|
||||
src/ft_getenvval.c \
|
||||
src/ft_seminit.c \
|
||||
src/ft_semwait.c \
|
||||
src/ft_semfree.c \
|
||||
src/ft_gettimemsdate.c \
|
||||
src/ft_mkdir.c \
|
||||
src/ft_rmdir.c \
|
||||
src/ft_abspathcmd.c \
|
||||
src/ft_cppbzero.c \
|
||||
src/ft_cpptostr.c
|
||||
BSRC =src/ft_lstadd_back.c \
|
||||
src/ft_lstadd_front.c \
|
||||
src/ft_lstclear.c \
|
||||
|
@ -1,10 +1,33 @@
|
||||
# Functions
|
||||
## striteri
|
||||
void ft_striteri(char *s, void (*f)(unsigned int, char*));
|
||||
# Libft
|
||||
Libft is a self written implementation of some of the standard c function.\
|
||||
It also includes a lot of undocumented functions not in the standard c library.\
|
||||
Nonetheless the functions have been named somewhat properly and the code should be easy to read.
|
||||
|
||||
# Tester
|
||||
## general
|
||||
check for -Wall -Werror -Wextra
|
||||
Think of more edge cases for all functions
|
||||
## add tests extra
|
||||
check if function exists in .h and run the tests for that fucntion
|
||||
---
|
||||
## Todo
|
||||
#### Write ft_striteri
|
||||
`void ft_striteri(char *s, void (*f)(unsigned int, char*));`
|
||||
|
||||
|
||||
---
|
||||
## Usage
|
||||
1. Simply clone or download the repository
|
||||
2. Run `make` in the cloned directory
|
||||
3. You can include the created libft.a in your own programs
|
||||
|
||||
---
|
||||
## Tester
|
||||
#### Todo
|
||||
- Add striteri test
|
||||
- check for -Wall -Werror -Wextra
|
||||
- Think of more edge cases for all functions
|
||||
- Extra functions, check if function exists in .h and run the tests for that fucntion
|
||||
- putchar 4 should print 0
|
||||
|
||||
#### Usage
|
||||
1. Download test.sh and the tests folder into your own project directory
|
||||
2. Make the file executable `chmod +x test.sh`
|
||||
3. Run `./test.sh` to start the test
|
||||
|
||||
---
|
||||
[This project is part of the studies at 42](https://42.fr/en/homepage/)
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* libft.h |o_o || | */
|
||||
/* libft.h :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2020/11/11 16:02:53 by djonker #+# #+# */
|
||||
/* Updated: 2023/03/05 20:30:31 by houtworm \___)=(___/ */
|
||||
/* Updated: 2023/10/25 07:05:24 by djonker ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -16,6 +16,9 @@
|
||||
# include <unistd.h>
|
||||
# include <stdlib.h>
|
||||
# include <stdarg.h>
|
||||
# include <fcntl.h>
|
||||
# include <sys/stat.h>
|
||||
# include <sys/wait.h>
|
||||
|
||||
typedef struct s_list
|
||||
{
|
||||
@ -160,5 +163,24 @@ int ft_islneg(long long n);
|
||||
char *ft_dtoa(long double n);
|
||||
int ft_isallbyte(char *str, char byte);
|
||||
char *ft_getpwd(char **envp, int slash);
|
||||
char *ft_getuser(char **envp);
|
||||
char *ft_gethome(char **envp);
|
||||
char *ft_getos(void);
|
||||
char *ft_gethost(void);
|
||||
char *ft_vastrjoin(int n, ...);
|
||||
void ft_vafree(int n, ...);
|
||||
int ft_intrchr(const char *s, int c);
|
||||
char *ft_system(char *command, char **envp, char *file);
|
||||
char **ft_getpaths(char **envp, int i);
|
||||
char *ft_getenvval(char **envp, char *var);
|
||||
char *ft_abspathcmd(char **paths, char *command);
|
||||
void ft_cppbzero(char **cpp);
|
||||
char *ft_cpptostr(char **cpp);
|
||||
int ft_seminit(char *file, int number);
|
||||
int ft_semwait(char *file);
|
||||
int ft_semfree(char *file);
|
||||
long long ft_gettimemsdate(char **envp, char *file);
|
||||
int ft_mkdir(char *dirname, char **envp);
|
||||
int ft_rmdir(char *dirname, char **envp);
|
||||
|
||||
#endif
|
||||
|
34
libft/src/ft_abspathcmd.c
Normal file
34
libft/src/ft_abspathcmd.c
Normal file
@ -0,0 +1,34 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_abspathcmd.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2023/03/20 16:39:22 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/18 16:55:36 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../libft.h"
|
||||
|
||||
char *ft_abspathcmd(char **paths, char *cmd)
|
||||
{
|
||||
char *absolute;
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
if (!paths)
|
||||
return (cmd);
|
||||
if (cmd && ft_chrstr('/', cmd))
|
||||
absolute = ft_strdup(cmd);
|
||||
else
|
||||
absolute = ft_strjoin(paths[i], cmd);
|
||||
while (access(absolute, F_OK) && paths[i] && !ft_chrstr('/', cmd))
|
||||
{
|
||||
free(absolute);
|
||||
i++;
|
||||
absolute = ft_strjoin(paths[i], cmd);
|
||||
}
|
||||
return (absolute);
|
||||
}
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_around.c :+: :+: :+: */
|
||||
/* ft_around.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/02 07:26:00 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:42:07 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:55:37 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_arrlen.c :+: :+: :+: */
|
||||
/* ft_arrlen.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/06 17:38:27 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:42:08 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:55:38 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_atodec.c :+: :+: :+: */
|
||||
/* ft_atodec.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/02 05:48:34 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:42:08 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:55:41 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_atof.c :+: :+: :+: */
|
||||
/* ft_atof.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/02 05:48:34 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:42:08 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:55:42 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_atoi.c :+: :+: :+: */
|
||||
/* ft_atoi.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2020/11/01 19:08:11 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:42:09 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:55:42 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_atol.c :+: :+: :+: */
|
||||
/* ft_atol.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2020/11/01 19:08:11 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:36:46 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:55:43 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_atou.c |o_o || | */
|
||||
/* ft_atou.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2020/11/01 19:08:11 by djonker #+# #+# */
|
||||
/* Updated: 2023/03/05 21:13:18 by houtworm \___)=(___/ */
|
||||
/* Updated: 2023/10/18 16:55:43 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_bitswap.c :+: :+: :+: */
|
||||
/* ft_bitswap.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <djonker@student.codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/05/17 06:29:44 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:38:18 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:55:44 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_btoi.c :+: :+: :+: */
|
||||
/* ft_btoi.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/01/18 13:44:56 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:36:46 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:55:44 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_bzero.c |o_o || | */
|
||||
/* ft_bzero.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2020/11/01 08:35:25 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/22 02:01:25 by djonker \___)=(___/ */
|
||||
/* Updated: 2023/10/18 16:55:45 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_calloc.c |o_o || | */
|
||||
/* ft_calloc.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2020/11/01 21:20:32 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/25 16:18:01 by houtworm \___)=(___/ */
|
||||
/* Updated: 2023/10/25 05:52:55 by djonker ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -25,7 +25,7 @@ void *ft_calloc(size_t count, size_t size)
|
||||
}
|
||||
p = malloc(count * size);
|
||||
if (p == NULL)
|
||||
return (0x0);
|
||||
exit(1);
|
||||
if (p)
|
||||
{
|
||||
t = p;
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_chrstr.c :+: :+: :+: */
|
||||
/* ft_chrstr.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2020/11/15 02:30:48 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:36:47 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:55:46 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_cntarg.c |o_o || | */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* :::::::: */
|
||||
/* ft_cntarg.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2023/02/07 00:38:26 by houtworm #+# #+# */
|
||||
/* Updated: 2023/02/21 01:43:17 by houtworm \___)=(___/ */
|
||||
/* Updated: 2023/10/18 16:56:12 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* .--. _ */
|
||||
/* ft_cntchr.c :+: :+: :+: */
|
||||
/* |:_/ || |_ _ ___ __ */
|
||||
/* By: djonker <djonker@student.codam.nl> // \ \ __| | | \ \/ / */
|
||||
/* (| | )|_| |_| |> < */
|
||||
/* Created: 2021/06/11 17:23:36 by djonker /'\_ _/`\__|\__,_/_/\_\ */
|
||||
/* Updated: 2023/02/07 00:38:41 by houtworm ### ########.fr */
|
||||
/* :::::::: */
|
||||
/* ft_cntchr.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <djonker@student.codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/06/11 17:23:36 by djonker #+# #+# */
|
||||
/* Updated: 2023/10/18 16:56:12 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_cntwrd.c :+: :+: :+: */
|
||||
/* ft_cntwrd.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2020/11/21 20:37:04 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:38:43 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:56:13 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_cntwrds.c :+: :+: :+: */
|
||||
/* ft_cntwrds.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2020/11/21 20:37:04 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:38:44 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:56:13 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
25
libft/src/ft_cppbzero.c
Normal file
25
libft/src/ft_cppbzero.c
Normal file
@ -0,0 +1,25 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_cppbzero.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2023/09/18 12:17:56 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/18 16:56:14 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../libft.h"
|
||||
|
||||
void ft_cppbzero(char **cpp)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
while (cpp[i])
|
||||
{
|
||||
ft_bzero(cpp[i], ft_strlen(cpp[i]));
|
||||
i++;
|
||||
}
|
||||
}
|
36
libft/src/ft_cpptostr.c
Normal file
36
libft/src/ft_cpptostr.c
Normal file
@ -0,0 +1,36 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_cpptostr.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2023/09/18 12:17:01 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/19 00:19:29 by djonker ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../libft.h"
|
||||
|
||||
char *ft_cpptostr(char **cpp)
|
||||
{
|
||||
int i;
|
||||
char *ret;
|
||||
char *temp;
|
||||
char *temp2;
|
||||
|
||||
i = 1;
|
||||
if (cpp[0])
|
||||
temp2 = ft_strdup(cpp[0]);
|
||||
while (cpp[i])
|
||||
{
|
||||
temp = ft_strjoin(temp2, cpp[i]);
|
||||
free(temp2);
|
||||
temp2 = ft_strdup(temp);
|
||||
free(temp);
|
||||
i++;
|
||||
}
|
||||
ret = ft_strdup(temp2);
|
||||
free(temp2);
|
||||
return (ret);
|
||||
}
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_ddtoi.c :+: :+: :+: */
|
||||
/* ft_ddtoi.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/01/31 01:24:28 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:38:44 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:56:15 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_declen.c :+: :+: :+: */
|
||||
/* ft_declen.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/02 04:29:09 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:38:45 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:56:15 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_dtoa.c :+: :+: :+: */
|
||||
/* ft_dtoa.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/02 03:46:17 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:38:46 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:56:16 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_dtoh.c :+: :+: :+: */
|
||||
/* ft_dtoh.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/01/31 02:22:34 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:38:47 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:56:16 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_factor.c :+: :+: :+: */
|
||||
/* ft_factor.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/01 04:03:20 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:38:48 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:56:25 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_fczero.c :+: :+: :+: */
|
||||
/* ft_fczero.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/02 04:29:09 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:38:49 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:56:25 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_flolen.c :+: :+: :+: */
|
||||
/* ft_flolen.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/02 04:00:01 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:38:50 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:56:26 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_fnprim.c :+: :+: :+: */
|
||||
/* ft_fnprim.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/01 04:42:24 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:38:50 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:56:26 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_frearr.c :+: :+: :+: */
|
||||
/* ft_frearr.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2020/12/11 21:54:13 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:39:42 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:56:27 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_frenarr.c :+: :+: :+: */
|
||||
/* ft_frenarr.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2020/12/11 21:54:13 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:39:47 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:56:27 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_fround.c :+: :+: :+: */
|
||||
/* ft_fround.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/02 07:42:16 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:39:49 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:56:28 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_ftoa.c :+: :+: :+: */
|
||||
/* ft_ftoa.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/02 03:46:17 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:39:49 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:56:28 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_ftoi.c :+: :+: :+: */
|
||||
/* ft_ftoi.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/02 21:30:30 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:39:50 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:56:29 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
34
libft/src/ft_getenvval.c
Normal file
34
libft/src/ft_getenvval.c
Normal file
@ -0,0 +1,34 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_getenvval.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2023/02/17 02:40:22 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/18 16:56:29 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../libft.h"
|
||||
|
||||
char *ft_getenvval(char **envp, char *var)
|
||||
{
|
||||
char *value;
|
||||
int i;
|
||||
char *temp;
|
||||
|
||||
temp = ft_strjoin(var, "=");
|
||||
i = -1;
|
||||
while (envp[++i])
|
||||
if (ft_strncmp(envp[i], temp, ft_strlen(temp)) == 0)
|
||||
break ;
|
||||
if (!envp[i])
|
||||
{
|
||||
free(temp);
|
||||
return (NULL);
|
||||
}
|
||||
value = ft_substr(envp[i], ft_strlen(temp), ft_strlen(envp[i]));
|
||||
free(temp);
|
||||
return (value);
|
||||
}
|
28
libft/src/ft_gethome.c
Normal file
28
libft/src/ft_gethome.c
Normal file
@ -0,0 +1,28 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_gethome.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2023/02/17 02:40:22 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/18 16:56:39 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../libft.h"
|
||||
|
||||
char *ft_gethome(char **envp)
|
||||
{
|
||||
char *home;
|
||||
int i;
|
||||
|
||||
i = -1;
|
||||
while (envp[++i])
|
||||
if (ft_strncmp(envp[i], "HOME=", 5) == 0)
|
||||
break ;
|
||||
if (!envp[i])
|
||||
return (NULL);
|
||||
home = ft_substr(envp[i], 5, ft_strlen(envp[i]));
|
||||
return (home);
|
||||
}
|
27
libft/src/ft_gethost.c
Normal file
27
libft/src/ft_gethost.c
Normal file
@ -0,0 +1,27 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_gethost.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2023/10/09 07:45:51 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/18 16:59:03 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../../minishell.h"
|
||||
|
||||
char *ft_gethost(void)
|
||||
{
|
||||
int fd;
|
||||
char *line;
|
||||
char *host;
|
||||
|
||||
fd = open("/etc/hostname", O_RDONLY);
|
||||
get_next_line(fd, &line);
|
||||
host = ft_strdup(line);
|
||||
free(line);
|
||||
close(fd);
|
||||
return (host);
|
||||
}
|
60
libft/src/ft_getos.c
Normal file
60
libft/src/ft_getos.c
Normal file
@ -0,0 +1,60 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_getos.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2023/10/09 07:45:51 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/19 00:22:24 by djonker ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../../minishell.h"
|
||||
|
||||
char *ft_getosfromline(char *line)
|
||||
{
|
||||
int ret;
|
||||
char *os;
|
||||
int i;
|
||||
|
||||
ret = 0;
|
||||
i = 0;
|
||||
while (line[i] != '\"')
|
||||
i++;
|
||||
i++;
|
||||
os = ft_calloc(ft_strlen(line), 8);
|
||||
while (line[i] != ' ' && line[i] != '\"')
|
||||
{
|
||||
os[ret] = line[i];
|
||||
ret++;
|
||||
i++;
|
||||
}
|
||||
os[ret] = '\0';
|
||||
return (os);
|
||||
}
|
||||
|
||||
char *ft_getos(void)
|
||||
{
|
||||
int fd;
|
||||
char *line;
|
||||
int ret;
|
||||
char *os;
|
||||
|
||||
fd = open("/etc/os-release", O_RDONLY);
|
||||
ret = 1;
|
||||
while (ret > 0)
|
||||
{
|
||||
ret = get_next_line(fd, &line);
|
||||
if (!ft_strncmp(line, "PRETTY_NAME:", 7))
|
||||
{
|
||||
os = ft_getosfromline(line);
|
||||
free(line);
|
||||
close(fd);
|
||||
return (os);
|
||||
}
|
||||
free (line);
|
||||
}
|
||||
close(fd);
|
||||
return (NULL);
|
||||
}
|
42
libft/src/ft_getpaths.c
Normal file
42
libft/src/ft_getpaths.c
Normal file
@ -0,0 +1,42 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_getpaths.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2023/03/20 16:39:22 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/18 16:59:06 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../libft.h"
|
||||
|
||||
char **ft_getpaths(char **envp, int i)
|
||||
{
|
||||
char **paths;
|
||||
char **temp;
|
||||
char *firsttemp;
|
||||
|
||||
i = -1;
|
||||
while (envp[++i])
|
||||
if (ft_strncmp(envp[i], "PATH=", 5) == 0)
|
||||
break ;
|
||||
if (!envp[i])
|
||||
return (0);
|
||||
else
|
||||
temp = ft_split(envp[i], ':');
|
||||
if (!temp)
|
||||
return (0);
|
||||
paths = ft_calloc(sizeof(char *) * (ft_arrlen(temp) + 1), 1);
|
||||
firsttemp = ft_substr(temp[0], 5, ft_strlen(temp[0]));
|
||||
if (!paths || !firsttemp)
|
||||
return (0);
|
||||
paths[0] = ft_strjoin(firsttemp, "/");
|
||||
free(firsttemp);
|
||||
i = 0;
|
||||
while (temp[++i])
|
||||
paths[i] = ft_strjoin(temp[i], "/");
|
||||
ft_frearr(temp);
|
||||
return (paths);
|
||||
}
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* .--. _ */
|
||||
/* ft_getpwd.c |o_o || | */
|
||||
/* |:_/ || |_ _ ___ __ */
|
||||
/* By: houtworm <codam@houtworm.net> // \ \ __| | | \ \/ / */
|
||||
/* (| | )|_| |_| |> < */
|
||||
/* Created: 2023/02/17 02:40:22 by houtworm /'\_ _/`\__|\__,_/_/\_\ */
|
||||
/* Updated: 2023/02/17 02:55:28 by houtworm \___)=(___/ */
|
||||
/* :::::::: */
|
||||
/* ft_getpwd.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2023/02/17 02:40:22 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/18 16:59:07 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
24
libft/src/ft_gettimemsdate.c
Normal file
24
libft/src/ft_gettimemsdate.c
Normal file
@ -0,0 +1,24 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_gettimemsdate.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2023/10/17 20:10:03 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/19 00:04:18 by djonker ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../libft.h"
|
||||
|
||||
long long ft_gettimemsdate(char **envp, char *file)
|
||||
{
|
||||
char *date;
|
||||
long long currenttime;
|
||||
|
||||
date = ft_system("date +%s%3N", envp, file);
|
||||
currenttime = ft_atol(date);
|
||||
free(date);
|
||||
return (currenttime);
|
||||
}
|
28
libft/src/ft_getuser.c
Normal file
28
libft/src/ft_getuser.c
Normal file
@ -0,0 +1,28 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_getuser.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2023/02/17 02:40:22 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/18 16:59:09 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../libft.h"
|
||||
|
||||
char *ft_getuser(char **envp)
|
||||
{
|
||||
char *user;
|
||||
int i;
|
||||
|
||||
i = -1;
|
||||
while (envp[++i])
|
||||
if (ft_strncmp(envp[i], "USER=", 5) == 0)
|
||||
break ;
|
||||
if (!envp[i])
|
||||
return (NULL);
|
||||
user = ft_substr(envp[i], 5, ft_strlen(envp[i]));
|
||||
return (user);
|
||||
}
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_htod.c :+: :+: :+: */
|
||||
/* ft_htod.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/01/31 03:18:45 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:39:51 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:10 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_htoi.c :+: :+: :+: */
|
||||
/* ft_htoi.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/01/31 01:24:28 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:39:52 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:11 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_iftof.c :+: :+: :+: */
|
||||
/* ft_iftof.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/02 22:27:51 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:39:52 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:12 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_intlen.c :+: :+: :+: */
|
||||
/* ft_intlen.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2020/11/13 02:04:46 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:39:54 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:14 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
28
libft/src/ft_intrchr.c
Normal file
28
libft/src/ft_intrchr.c
Normal file
@ -0,0 +1,28 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_intrchr.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2020/11/11 16:14:50 by djonker #+# #+# */
|
||||
/* Updated: 2023/10/18 16:59:15 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../libft.h"
|
||||
|
||||
int ft_intrchr(const char *s, int c)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!s)
|
||||
return (-1);
|
||||
i = 0;
|
||||
while (s[i] != '\0')
|
||||
i++;
|
||||
i--;
|
||||
while (i >= 0 && s[i] != c)
|
||||
i--;
|
||||
return (i);
|
||||
}
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* .--. _ */
|
||||
/* ft_isallbyte.c |o_o || | */
|
||||
/* |:_/ || |_ _ ___ __ */
|
||||
/* By: houtworm <codam@houtworm.net> // \ \ __| | | \ \/ / */
|
||||
/* (| | )|_| |_| |> < */
|
||||
/* Created: 2023/02/21 01:43:42 by houtworm /'\_ _/`\__|\__,_/_/\_\ */
|
||||
/* Updated: 2023/02/21 01:43:44 by houtworm \___)=(___/ */
|
||||
/* :::::::: */
|
||||
/* ft_isallbyte.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2023/02/21 01:43:42 by houtworm #+# #+# */
|
||||
/* Updated: 2023/10/18 16:59:16 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -14,6 +14,8 @@
|
||||
|
||||
int ft_isallbyte(char *str, char byte)
|
||||
{
|
||||
if (!str)
|
||||
return (1);
|
||||
while (*str == byte)
|
||||
str++;
|
||||
if (!*str)
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_isalnum.c :+: :+: :+: */
|
||||
/* ft_isalnum.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2020/11/11 15:56:37 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:39:54 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:16 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_isalpha.c :+: :+: :+: */
|
||||
/* ft_isalpha.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2020/11/01 19:10:41 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:39:55 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:17 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_isascii.c :+: :+: :+: */
|
||||
/* ft_isascii.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2020/11/01 19:10:41 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:39:56 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:18 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_isdigit.c :+: :+: :+: */
|
||||
/* ft_isdigit.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2020/11/01 19:10:41 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:39:56 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:19 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_islneg.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* :::::::: */
|
||||
/* ft_islneg.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2022/12/25 11:39:27 by houtworm #+# #+# */
|
||||
/* Updated: 2023/02/07 00:39:57 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:20 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_islowc.c :+: :+: :+: */
|
||||
/* ft_islowc.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/04/13 17:57:31 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:39:58 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:21 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_isneg.c :+: :+: :+: */
|
||||
/* ft_isneg.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/02 03:38:29 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:39:59 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:21 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_isodigit.c :+: :+: :+: */
|
||||
/* ft_isodigit.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/06 17:19:46 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:40:00 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:22 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_isprim.c :+: :+: :+: */
|
||||
/* ft_isprim.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/01 04:32:30 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:40:00 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:23 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_isprint.c :+: :+: :+: */
|
||||
/* ft_isprint.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2020/11/01 19:10:41 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:40:01 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:24 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_isuppc.c :+: :+: :+: */
|
||||
/* ft_isuppc.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/04/13 17:57:31 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:40:02 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:25 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_isxdigit.c :+: :+: :+: */
|
||||
/* ft_isxdigit.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/06 17:19:46 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:40:03 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:27 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_itoa.c :+: :+: :+: */
|
||||
/* ft_itoa.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2020/11/12 23:20:24 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:40:04 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:28 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_itob.c |o_o || | */
|
||||
/* ft_itob.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/01/04 04:42:54 by djonker #+# #+# */
|
||||
/* Updated: 2023/03/07 05:07:51 by houtworm \___)=(___/ */
|
||||
/* Updated: 2023/10/18 16:59:33 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_itoba.c :+: :+: :+: */
|
||||
/* ft_itoba.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/01/04 04:42:54 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:40:05 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:29 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_itodd.c :+: :+: :+: */
|
||||
/* ft_itodd.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/01/31 03:00:29 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:40:07 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:34 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_itof.c :+: :+: :+: */
|
||||
/* ft_itof.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/02 22:18:50 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:40:07 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:35 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_itoh.c |o_o || | */
|
||||
/* ft_itoh.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/01/31 03:00:29 by djonker #+# #+# */
|
||||
/* Updated: 2023/03/05 20:33:06 by houtworm \___)=(___/ */
|
||||
/* Updated: 2023/10/18 16:59:36 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_itohx.c :+: :+: :+: */
|
||||
/* ft_itohx.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/01/31 03:00:29 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:40:09 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:47 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_itoo.c :+: :+: :+: */
|
||||
/* ft_itoo.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/01 01:30:17 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:40:25 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:47 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_itooa.c :+: :+: :+: */
|
||||
/* ft_itooa.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/02/01 01:30:17 by djonker #+# #+# */
|
||||
/* Updated: 2023/02/07 00:40:25 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:47 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* ft_itozh.c |o_o || | */
|
||||
/* ft_itozh.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: djonker <marvin@codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2021/01/31 03:00:29 by djonker #+# #+# */
|
||||
/* Updated: 2023/03/07 05:15:26 by houtworm \___)=(___/ */
|
||||
/* Updated: 2023/10/18 16:59:48 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_ldeclen.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* :::::::: */
|
||||
/* ft_ldeclen.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2022/12/25 11:30:37 by houtworm #+# #+# */
|
||||
/* Updated: 2023/02/07 00:40:29 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:48 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_lftoa.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* :::::::: */
|
||||
/* ft_lftoa.c :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: houtworm <codam@houtworm.net> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2022/12/25 11:38:35 by houtworm #+# #+# */
|
||||
/* Updated: 2023/02/07 00:40:29 by houtworm ### ########.fr */
|
||||
/* Updated: 2023/10/18 16:59:49 by houtworm ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user