mirror of
https://github.com/DavidGailleton/42-ft_printf.git
synced 2026-11-01 11:42:03 +01:00
- Use the flag-aware implementation for both make and make bonus
(bonus/ moved to src/, _bonus suffix dropped, bonus rule = all)
- Do not treat zero-length output (%s with "", %.0d with 0) as an error
- Return -1 without printing when a % has no conversion ("abc%", "%5")
- Keep field width with '#', '+' and ' '; ignore '0' with '-'
- Fix '#' prefix on zero, '+'/' ' with zero padding, INT_MIN negation UB
- Add README.md required by the subject
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
51 lines
1.8 KiB
C
51 lines
1.8 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_printf.h :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2025/11/17 10:52:23 by dgaillet #+# #+# */
|
|
/* Updated: 2025/11/21 12:10:56 by dgaillet ### ########lyon.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef FT_PRINTF_H
|
|
# define FT_PRINTF_H
|
|
|
|
typedef struct s_arg
|
|
{
|
|
char arg;
|
|
int padding;
|
|
int minus;
|
|
int zero;
|
|
int dot;
|
|
int hash;
|
|
int space;
|
|
int plus;
|
|
} t_arg;
|
|
|
|
int ft_printf(const char *first_arg, ...) __attribute__((format(printf,
|
|
1, 2)));
|
|
int ft_printf(const char *first_arg, ...);
|
|
|
|
int ft_putnbr_base_ll(unsigned long long nbr, char *base,
|
|
int base_size);
|
|
int ft_putnbr_base(unsigned int nbr, char *base, int base_size,
|
|
int limit);
|
|
char ft_main_arg(char *str);
|
|
int ft_check_format(const char *str);
|
|
t_arg *ft_create_arg(void);
|
|
t_arg *ft_parsing(char *str);
|
|
int print_chars(int nb, char c);
|
|
int nbr_size_base(unsigned long long nb, int base_size);
|
|
|
|
int print_char(t_arg *arg, char c);
|
|
int print_str(t_arg *arg, char *str);
|
|
int print_pointer(t_arg *arg, unsigned long long p);
|
|
int print_number(t_arg *arg, int nbr);
|
|
int print_unsigned(t_arg *arg, unsigned int nbr);
|
|
int print_hex(t_arg *arg, unsigned int nbr);
|
|
|
|
#endif
|