feat: adding internal header
- Adding the internal header allow to don't get all the function needed by printf in the main header
This commit is contained in:
parent
237eb5b820
commit
a1f18a6f97
4 changed files with 53 additions and 5 deletions
48
includes/_internal.h
Normal file
48
includes/_internal.h
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* _internal.h :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2025/09/19 17:15:50 by rparodi #+# #+# */
|
||||||
|
/* Updated: 2025/09/19 17:25:25 by rparodi ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#ifndef _INTERNAL_H
|
||||||
|
# define _INTERNAL_H
|
||||||
|
|
||||||
|
# include <stdarg.h>
|
||||||
|
# include <stdint.h>
|
||||||
|
# include <stddef.h>
|
||||||
|
|
||||||
|
typedef int (*t_func)(va_list, int fd);
|
||||||
|
|
||||||
|
typedef struct s_format
|
||||||
|
{
|
||||||
|
char character;
|
||||||
|
t_func function;
|
||||||
|
} t_format;
|
||||||
|
|
||||||
|
size_t ft_strlen(const char *str);
|
||||||
|
|
||||||
|
char *itoa_base(uint64_t nbr, char *base);
|
||||||
|
|
||||||
|
int flag_c(va_list args, int fd);
|
||||||
|
|
||||||
|
int flag_i(va_list args, int fd);
|
||||||
|
|
||||||
|
int flag_p(va_list args, int fd);
|
||||||
|
|
||||||
|
int flag_percent(va_list args, int fd);
|
||||||
|
|
||||||
|
int flag_s(va_list args, int fd);
|
||||||
|
|
||||||
|
int flag_u(va_list args, int fd);
|
||||||
|
|
||||||
|
int flag_x(va_list args, int fd);
|
||||||
|
|
||||||
|
int flag_x_maj(va_list args, int fd);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -6,11 +6,11 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/09/17 17:44:34 by rparodi #+# #+# */
|
/* Created: 2025/09/17 17:44:34 by rparodi #+# #+# */
|
||||||
/* Updated: 2025/09/19 15:35:38 by rparodi ### ########.fr */
|
/* Updated: 2025/09/19 17:17:12 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include "ft_printf.h"
|
#include "_internal.h"
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include "ft_printf.h"
|
#include "_internal.h"
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,11 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/09/18 15:00:27 by rparodi #+# #+# */
|
/* Created: 2025/09/18 15:00:27 by rparodi #+# #+# */
|
||||||
/* Updated: 2025/09/19 16:06:27 by rparodi ### ########.fr */
|
/* Updated: 2025/09/19 17:19:45 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include "ft_printf.h"
|
#include "_internal.h"
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue