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.
 
 
 
 
 
 

59 lines
2.3 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>
# include <stdio.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;
void add_string(char *str, size_t size);
t_dlist *get_last(void);
t_dlist *get_first(void);
void clean_list(void);
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);
void ft_print_char(int ch, t_opts *opts);
void ft_print_str(char *str, t_opts *opts);
void va_print_char(va_list va_ch, const char *str, t_opts *opts);
void va_print_str(va_list va_str, const char *str, t_opts *opts);
void va_print_ptr(va_list va_ptr, const char *str, t_opts *opts);
void va_print_nbr(va_list va_int, const char *str, t_opts *opts);
void va_print_unsign(va_list va_uint, const char *str, t_opts *opts);
void va_print_x(va_list va_uint, const char *str, t_opts *opts);
void va_print_x_cap(va_list va_uint, const char *str, t_opts *opts);
void va_print_perc(va_list va, const char *str, t_opts *opts);
void ft_format(const char *str, va_list args);
int ft_printf(const char *str, ...);
int ft_fprintf(FILE *file, const char *format, ...);
int ft_sprintf(char *ret, const char *format, ...);