-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.h
40 lines (36 loc) · 1.38 KB
/
main.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef MAIN_H
#define MAIN_H
#include <stdarg.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdbool.h>
/**
* struct format_specifier - format specifier structure
* @fmt_sign: fomat sign parameter
* @fmt_func_ptr: format function parameter
*/
typedef struct format_specifier
{
char fmt_sign;
void (*fmt_func_ptr)(char, va_list, int *, char);
} fmt;
/* Prototypes */
int _putchar(char c);
int _printf(const char *format, ...);
int print_fmt(const char *format, va_list args,
int *count, fmt fmt_specs[]);
void char_print(char flag, va_list args, int *count, char space);
void string_print(char flag, va_list args, int *count, char space);
void int_print(char flag, va_list args, int *count, char space);
void dec_print(char flag, va_list args, int *count, char space);
void bin_print(char flag, va_list args, int *count, char space);
void uint_print(char flag, va_list args, int *count, char space);
void oct_print(char flag, va_list args, int *count, char space);
void hex_print(char flag, va_list args, int *count, char space);
void cap_hex_print(char flag, va_list args, int *count, char space);
void str_hex_print(char flag, va_list args, int *count, char space);
void ptr_print(char flag, va_list args, int *count, char space);
void zero(char *nil, int *count);
bool handle_fmt_spec(char fmt_char, va_list args,
int *count, fmt fmt_specs[], char *flag, char *space);
#endif /* MAIN_H */