Compare commits

...

3 Commits

Author SHA1 Message Date
Aleksei Chubukov
bdf52892a0 create empty digits_to_words src, implement ft_strlen 2023-12-02 23:46:24 +04:00
Aleksei Chubukov
87005dc165 add .gitignore for tests 2023-12-02 23:34:00 +04:00
Aleksei Chubukov
05dc32471f minor changes 2023-12-02 23:32:22 +04:00
9 changed files with 47 additions and 8 deletions

View File

@ -6,7 +6,7 @@
# By: achubuko <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/12/02 21:33:22 by achubuko #+# #+# #
# Updated: 2023/12/02 21:48:05 by achubuko ### ########.fr #
# Updated: 2023/12/02 23:31:19 by achubuko ### ########.fr #
# #
# **************************************************************************** #
@ -45,4 +45,4 @@ ofiles = $(foreach f, $(cfiles), $(subst .c,.o,$f))
%.o: %.c %.h
$(CC) $(CFLAGS) -c -o $@ $<
$(NAME): $(ofiles)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
$(CC) $(CFLAGS) $(LDFLAGS) -o $(LOADLIBES) $(LDLIBS) $@ $^

12
ex00/digits_to_words.c Normal file
View File

@ -0,0 +1,12 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* digits_to_words.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: achubuko <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/02 23:40:54 by achubuko #+# #+# */
/* Updated: 2023/12/02 23:43:18 by achubuko ### ########.fr */
/* */
/* ************************************************************************** */
#include "digits_to_words.h"

14
ex00/digits_to_words.h Normal file
View File

@ -0,0 +1,14 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* digits_to_words.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: achubuko <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/02 23:35:43 by achubuko #+# #+# */
/* Updated: 2023/12/02 23:36:29 by achubuko ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef DIGITS_TO_WORDS_H
# define DIGITS_TO_WORDS_H
#endif

View File

@ -6,7 +6,7 @@
/* By: achubuko <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/02 21:56:30 by achubuko #+# #+# */
/* Updated: 2023/12/02 22:41:05 by achubuko ### ########.fr */
/* Updated: 2023/12/02 23:45:23 by achubuko ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_utils.h"
@ -15,3 +15,13 @@ uint32_t ft_atoui32(char *str)
{
return (*str - '0');
}
size_t ft_strlen(char *s)
{
size_t l;
l = 0;
while (*s++)
l++;
return (l);
}

View File

@ -6,7 +6,7 @@
/* By: achubuko <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/02 21:01:21 by achubuko #+# #+# */
/* Updated: 2023/12/02 21:55:21 by achubuko ### ########.fr */
/* Updated: 2023/12/02 23:45:57 by achubuko ### ########.fr */
/* */
/* ************************************************************************** */
#include "main.h"
@ -18,5 +18,5 @@ int main(int argc, char **argv)
write(1, "Error: program requires 1 or 2 arguments passed!", 48);
return (1);
}
write(1, argv[1], 1);
write(1, argv[1], ft_strlen(argv[1]));
}

View File

@ -6,12 +6,13 @@
/* By: achubuko <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/02 21:14:25 by achubuko #+# #+# */
/* Updated: 2023/12/02 21:25:18 by achubuko ### ########.fr */
/* Updated: 2023/12/02 23:43:11 by achubuko ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef MAIN_H
# define MAIN_H
# include <unistd.h>
# include <stdlib.h>
# include "digits_to_words.h"
# include "ft_utils.h"
#endif

2
tests/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/test_*
!test_*.c

View File

@ -6,7 +6,7 @@
# By: achubuko <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/12/02 22:04:03 by achubuko #+# #+# #
# Updated: 2023/12/02 23:06:56 by achubuko ### ########.fr #
# Updated: 2023/12/02 23:31:12 by achubuko ### ########.fr #
# #
# **************************************************************************** #
NAME := test_ft_utils

Binary file not shown.