-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.h
More file actions
36 lines (31 loc) · 817 Bytes
/
main.h
File metadata and controls
36 lines (31 loc) · 817 Bytes
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
#ifndef HEADER_FILE
#define HEADER_FILE
#include <stdarg.h>
#include <stdio.h>
#include <unistd.h>
/**
* struct placeholders - string placeholder struct
*
* @specifier: specifier character (ex: c / s / d ...etc)
* @handler_func: The handler function associated
*/
typedef struct placeholders
{
char specifier;
int (*handler_func)(va_list args);
} placeholders_t;
/* handlers */
int handle_char(va_list args);
int handle_string(va_list args);
int handle_number(va_list args);
int handle_binary(va_list args);
int handle_reversed_string(va_list args);
int handle_rot13string(va_list args);
/* functions */
int (*get_handler_func(char sp))(va_list args);
int _putchar(char c);
int _printf(const char *format, ...);
int print_string(char *str);
void print_number(int n);
int number_length(int number);
#endif