Compare commits
3 Commits
4592bbeec0
...
bdf52892a0
Author | SHA1 | Date | |
---|---|---|---|
|
bdf52892a0 | ||
|
87005dc165 | ||
|
05dc32471f |
4
Makefile
4
Makefile
@ -6,7 +6,7 @@
|
|||||||
# By: achubuko <marvin@42.fr> +#+ +:+ +#+ #
|
# By: achubuko <marvin@42.fr> +#+ +:+ +#+ #
|
||||||
# +#+#+#+#+#+ +#+ #
|
# +#+#+#+#+#+ +#+ #
|
||||||
# Created: 2023/12/02 21:33:22 by achubuko #+# #+# #
|
# 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
|
%.o: %.c %.h
|
||||||
$(CC) $(CFLAGS) -c -o $@ $<
|
$(CC) $(CFLAGS) -c -o $@ $<
|
||||||
$(NAME): $(ofiles)
|
$(NAME): $(ofiles)
|
||||||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $(LOADLIBES) $(LDLIBS) $@ $^
|
||||||
|
12
ex00/digits_to_words.c
Normal file
12
ex00/digits_to_words.c
Normal 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
14
ex00/digits_to_words.h
Normal 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
|
@ -6,7 +6,7 @@
|
|||||||
/* By: achubuko <marvin@42.fr> +#+ +:+ +#+ */
|
/* By: achubuko <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/12/02 21:56:30 by achubuko #+# #+# */
|
/* 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"
|
#include "ft_utils.h"
|
||||||
@ -15,3 +15,13 @@ uint32_t ft_atoui32(char *str)
|
|||||||
{
|
{
|
||||||
return (*str - '0');
|
return (*str - '0');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t ft_strlen(char *s)
|
||||||
|
{
|
||||||
|
size_t l;
|
||||||
|
|
||||||
|
l = 0;
|
||||||
|
while (*s++)
|
||||||
|
l++;
|
||||||
|
return (l);
|
||||||
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: achubuko <marvin@42.fr> +#+ +:+ +#+ */
|
/* By: achubuko <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/12/02 21:01:21 by achubuko #+# #+# */
|
/* 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"
|
#include "main.h"
|
||||||
@ -18,5 +18,5 @@ int main(int argc, char **argv)
|
|||||||
write(1, "Error: program requires 1 or 2 arguments passed!", 48);
|
write(1, "Error: program requires 1 or 2 arguments passed!", 48);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
write(1, argv[1], 1);
|
write(1, argv[1], ft_strlen(argv[1]));
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,13 @@
|
|||||||
/* By: achubuko <marvin@42.fr> +#+ +:+ +#+ */
|
/* By: achubuko <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/12/02 21:14:25 by achubuko #+# #+# */
|
/* 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
|
#ifndef MAIN_H
|
||||||
# define MAIN_H
|
# define MAIN_H
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
|
# include "digits_to_words.h"
|
||||||
|
# include "ft_utils.h"
|
||||||
#endif
|
#endif
|
||||||
|
2
tests/.gitignore
vendored
Normal file
2
tests/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/test_*
|
||||||
|
!test_*.c
|
@ -6,7 +6,7 @@
|
|||||||
# By: achubuko <marvin@42.fr> +#+ +:+ +#+ #
|
# By: achubuko <marvin@42.fr> +#+ +:+ +#+ #
|
||||||
# +#+#+#+#+#+ +#+ #
|
# +#+#+#+#+#+ +#+ #
|
||||||
# Created: 2023/12/02 22:04:03 by achubuko #+# #+# #
|
# 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
|
NAME := test_ft_utils
|
||||||
|
Binary file not shown.
Reference in New Issue
Block a user