-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.h
37 lines (34 loc) · 1013 Bytes
/
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
#ifndef MAIN_H
#define MAIN_H
#include <stdlib.h>
#include <stddef.h>
#include <stdarg.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
/**
* struct specifier - Structure of a format specifier
* and corresponding function.
* @c: Format specifier of the type of data to be processed.
* @spec: Function pointer to corresponding function processing the data.
*
* Description: This structure associate format specifiers with functions
* in variadic functions in order to process various types
* of data with the provided format specifier.
* The c member corresponds to the format specifier
* and the format member is a function pointer
* poiting to the function that will process the data of that type.
*/
typedef struct specifier
{
char c;
int (*spec)(va_list);
} spec_t;
int _putchar(char c);
int spec_char(va_list args);
int spec_str(va_list args);
int spec_percent(va_list args);
int spec_deci(va_list args);
int _printf(const char *format, ...);
int print_num(va_list args);
#endif