-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.h
52 lines (50 loc) · 1.41 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
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef MAIN_H
#define MAIN_H
#include <stdlib.h>
#include <stdarg.h>
/**
* struct flags - struct containing flags to "turn on"
* when a flag specifier is passed to _printf()
* @plus: flag for the '+' character
* @space: flag for the ' ' character
* @hash: flag for the '#' character
*/
typedef struct flags
{
int plus;
int space;
int hash;
} flags_t;
/**
* struct printHandler - struct to choose the right function depending
* on the format specifier passed to _printf()
* @c: format specifier
* @f: pointer to the correct printing function
*/
typedef struct printHandler
{
char c;
int (*f)(va_list ap, flags_t *f);
} ph;
int print_int(va_list l, flags_t *f);
void print_number(int n);
int print_unsigned(va_list l, flags_t *f);
int count_digit(int i);
int print_hex(va_list l, flags_t *f);
int print_hex_big(va_list l, flags_t *f);
int print_binary(va_list l, flags_t *f);
int print_octal(va_list l, flags_t *f);
char *convert(unsigned long int num, int base, int lowercase);
int _printf(const char *format, ...);
int (*get_print(char s))(va_list, flags_t *);
int get_flag(char s, flags_t *f);
int print_string(va_list l, flags_t *f);
int print_char(va_list l, flags_t *f);
int _putchar(char c);
int _puts(char *str);
int print_rot13(va_list l, flags_t *f);
int print_rev(va_list l, flags_t *f);
int print_bigS(va_list l, flags_t *f);
int print_address(va_list l, flags_t *f);
int print_percent(va_list l, flags_t *f);
#endif