-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.h
More file actions
35 lines (27 loc) · 767 Bytes
/
main.h
File metadata and controls
35 lines (27 loc) · 767 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
#ifndef MAIN_H
#define MAIN_H
#include <stdarg.h>
#include <stdio.h>
#include <unistd.h>
/**
* struct template - structure containing var types and matching functions
* @indic: indicates the type of the var we will need to print
* @print: function that will print the arg passed to the main function
*/
typedef struct template
{
char *indic;
int (*print)(va_list args);
} templ;
/*function to know the lenght of the string*/
int _strlen(char *str);
/*fctn to print the % if the user enters %%*/
int print_perc(va_list args);
/*annex functions depending on the type*/
int print_char(va_list args);
int print_string(va_list args);
int print_binary(va_list args);
int print_int(va_list args);
/*main function*/
int _printf(const char *format, ...);
#endif