forked from Tahani-Saber/printf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.h
63 lines (57 loc) · 1.31 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
53
54
55
56
57
58
59
60
61
62
63
#ifndef MAIN_H
#define MAIN_H
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdarg.h>
#include <string.h>
#define MINUS_FLAG 1
#define PLUS_FLAG 2
#define ZERO_FLAG 4
#define HASH_FLAG 8
#define SPACE_FLAG 16
/**
* struct flags - flags to be considered when calling printf.
*
* @plus: '+' character
* @space: ' ' character
* @hash: '#' character
*/
typedef struct flags
{
int plus;
int space;
int hash;
} flags_t;
int _putchar(char);
int _strlen(char *);
int print_str(va_list, flags_t *);
int print_char(va_list, flags_t *);
int print_100symbol(va_list, flags_t *);
int _printf(const char *, ...);
int (*get_op_func(char))(va_list, flags_t *);
int print_rev(va_list, flags_t *);
int print_rot13(va_list, flags_t *);
int print_int(va_list, flags_t *);
int print_uint(va_list, flags_t *);
int print_hex(va_list, flags_t *);
int print_octal(va_list, flags_t *);
int print_HEX(va_list, flags_t *);
int convert(unsigned long int, int, int);
int num_of_digits(unsigned int);
int print_bin(va_list, flags_t *);
int get_flags(char, flags_t *);
int print_STR(va_list, flags_t *);
int print_ptr(va_list args, flags_t *flag);
/**
* struct op - Struct op
*
* @op: the specifier
* @func: the function associated
*/
typedef struct op
{
char *op;
int (*func)(va_list, flags_t *);
} op_t;
#endif /* MAIN_H */