61 lines
2.0 KiB
C
61 lines
2.0 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* libftprintf.h :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2022/01/18 15:26:06 by gbaconni #+# #+# */
|
|
/* Updated: 2022/04/25 13:18:21 by gbaconni ### lausanne.ch */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef LIBFTPRINTF_H
|
|
# define LIBFTPRINTF_H
|
|
# include "libft/libft.h"
|
|
# include <stdlib.h>
|
|
# include <stdarg.h>
|
|
# include <unistd.h>
|
|
|
|
# if defined (__APPLE__)
|
|
# define NIL "0x0"
|
|
# else
|
|
# define NIL "(nil)"
|
|
# endif
|
|
|
|
/* Helper */
|
|
|
|
int ft_skipchars(const char *s, char *chars);
|
|
char *ft_strrev(char *s);
|
|
char *ft_ltoa_base(long n, char *base);
|
|
int ft_putchar(int c);
|
|
int ft_puts(const char *s);
|
|
char *ft_unescape(const char *str);
|
|
|
|
/* Mandatory */
|
|
|
|
int ft_printf(const char *format, ...);
|
|
int ft_vprintf(char const *format, va_list ap);
|
|
int ft_vprintf_char(const char *format, va_list ap);
|
|
int ft_vprintf_string(const char *format, va_list ap);
|
|
int ft_vprintf_pointer(const char *format, va_list ap);
|
|
int ft_vprintf_decimal(const char *format, va_list ap);
|
|
int ft_vprintf_hexadecimal(const char *format, va_list ap);
|
|
int ft_vprintf_percent(const char *format, va_list ap);
|
|
int ft_vprintf_escape(const char *format, va_list ap);
|
|
int ft_vprintf_other(const char *format, va_list ap);
|
|
|
|
/* Bonus */
|
|
|
|
enum {
|
|
F_HASH = 1 << 0,
|
|
F_ZERO = 1 << 1,
|
|
F_MINUS = 1 << 2,
|
|
F_SPACE = 1 << 3,
|
|
F_PLUS = 1 << 4
|
|
};
|
|
|
|
int ft_vprintf_flags_bonus(const char *format, va_list ap);
|
|
|
|
#endif
|