mirror of
https://github.com/DavidGailleton/42-ft_printf.git
synced 2026-11-01 11:42:03 +01:00
Merge mandatory and bonus into a single ft_printf, fix edge cases, add README
- 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>
This commit is contained in:
1 parent
b620f5ecdb
commit
c8a9ee10cf
24 files changed
+608
-678
No files matched your search
+32
-10
@@ -6,23 +6,45 @@
|
||||
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/11/17 10:52:23 by dgaillet #+# #+# */
|
||||
/* Updated: 2025/11/17 12:47:41 by dgaillet ### ########lyon.fr */
|
||||
/* Updated: 2025/11/21 12:10:56 by dgaillet ### ########lyon.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef FT_PRINTF_H
|
||||
# define FT_PRINTF_H
|
||||
|
||||
int ft_printf(const char *first_arg, ...) __attribute__((format(printf, 1, 2)));
|
||||
int ft_printf(const char *first_arg, ...);
|
||||
typedef struct s_arg
|
||||
{
|
||||
char arg;
|
||||
int padding;
|
||||
int minus;
|
||||
int zero;
|
||||
int dot;
|
||||
int hash;
|
||||
int space;
|
||||
int plus;
|
||||
} t_arg;
|
||||
|
||||
int ft_putnbr_base(unsigned long long nbr, char *base, int base_size);
|
||||
int ft_printf(const char *first_arg, ...) __attribute__((format(printf,
|
||||
1, 2)));
|
||||
int ft_printf(const char *first_arg, ...);
|
||||
|
||||
int print_char(char c);
|
||||
int print_str(char *str);
|
||||
int print_pointer(unsigned long long p);
|
||||
int print_number(int nbr);
|
||||
int print_unsigned(unsigned int nbr);
|
||||
int print_hex(unsigned long long p, int upper);
|
||||
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
|
||||
Reference in new issue
Block a user