My own elf programs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

48 lines
2.0 KiB

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/27 08:09:45 by narnaud #+# #+# */
/* Updated: 2021/12/21 09:39:34 by narnaud ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
# define MEM_ADD_SIZE 6
# include "libft.h"
# include <stdarg.h>
typedef struct s_opts {
int len;
int width;
int precision;
int zero : 1;
int minus : 1;
int dot : 1;
int hash : 1;
int space : 1;
int plus : 1;
} t_opts;
char *int_opts_transform(int n, char *nbr, t_opts *opts);
char *uint_opts_transform(unsigned int n, char *nbr, t_opts *opts);
char *ptr_opts_transform(char *ptr, t_opts *opts);
char *str_opts_transform(char *str, t_opts *opts);
int ft_print_char(int ch, t_opts *opts);
int ft_print_str(char *str, t_opts *opts);
int va_print_char(va_list va_ch, const char *str, t_opts *opts);
int va_print_str(va_list va_str, const char *str, t_opts *opts);
int va_print_ptr(va_list va_ptr, const char *str, t_opts *opts);
int va_print_nbr(va_list va_int, const char *str, t_opts *opts);
int va_print_unsign(va_list va_uint, const char *str, t_opts *opts);
int va_print_x(va_list va_uint, const char *str, t_opts *opts);
int va_print_x_cap(va_list va_uint, const char *str, t_opts *opts);
int va_print_perc(va_list va, const char *str, t_opts *opts);
int ft_printf(const char *str, ...);