Skip to content

Commit

Permalink
Start
Browse files Browse the repository at this point in the history
  • Loading branch information
loris committed Oct 29, 2023
0 parents commit 97e8e6a
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 0 deletions.
13 changes: 13 additions & 0 deletions include/get_next_line.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lgaume <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/29 03:47:35 by lgaume #+# #+# */
/* Updated: 2023/10/29 03:47:37 by lgaume ### ########.fr */
/* */
/* ************************************************************************** */


13 changes: 13 additions & 0 deletions src/get_next_line.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lgaume <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/29 03:48:00 by lgaume #+# #+# */
/* Updated: 2023/10/29 03:48:01 by lgaume ### ########.fr */
/* */
/* ************************************************************************** */


13 changes: 13 additions & 0 deletions src/get_next_line_utils.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line_utils.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lgaume <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/29 03:48:09 by lgaume #+# #+# */
/* Updated: 2023/10/29 03:48:12 by lgaume ### ########.fr */
/* */
/* ************************************************************************** */


31 changes: 31 additions & 0 deletions tests/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lgaume <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/29 03:48:45 by lgaume #+# #+# */
/* Updated: 2023/10/29 03:49:50 by lgaume ### ########.fr */
/* */
/* ************************************************************************** */

#include "../include/get_next_line.h"
#include <fcntl.h>

int main(void)
{
int fd;
char *line;

fd = open("tests/message.txt", O_RDONLY);
while (1)
{
line = get_next_line(fd);
printf("%s", line);
if (line == NULL)
break ;
free(line);
}
return (0);
}i
7 changes: 7 additions & 0 deletions tests/message.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Loris — Aujourd’hui à 03:11

L'histoire de la programmation en C est une saga fascinante qui remonte aux années 1970.
Le C a été développé par Dennis Ritchie au sein des laboratoires Bell de AT&T, en partie pour créer un système d'exploitation plus efficace appelé UNIX.
Cette nouvelle langue de programmation a été conçue pour offrir un équilibre entre la puissance et la portabilité.
Le C a rapidement gagné en popularité en raison de sa simplicité, de sa flexibilité et de ses performances.
Il a été utilisé pour développer des systèmes d'exploitation, des compilateurs, des applications système et bien plus encore.

0 comments on commit 97e8e6a

Please sign in to comment.