Repository navigation
Expand file tree
/
Copy path_printf.3
More file actions
79 lines (67 loc) · 1.97 KB
/
Copy path_printf.3
File metadata and controls
79 lines (67 loc) · 1.97 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
.TH "man _printf" "3" "2025-07-25" "" "_printf manual page"
.SH "NAME"
_printf
.SH "SYNOPSIS"
.B
#include "main.h"
.B
int _printf(const char *format,...);
.SH "DESCRIPTION"
_printf writes a string of characters and variadic arguments on the standard output.
.PP
Variadic arguments can be different types : int, char, strings (char*). Doubles and floats are not supported yet.
.PP
_printf function should print each variadic argument according to its type.
.PP
The type of variadic arguments passed to _printf function should be mentioned with a
.B
specifier
in order to be correctly formatted.
.br
Specifiers are indicated by % followed by a specific character.
.br
Specifiers must be written in the "const char*format" string.
.br
.B The first specifier must be written according to the first variadic argument given to _printf.
.br
.B The second specifier must be written according to the second variadic argument given to _printf.
.br
.B Etc...
.PP
Flags, width, precision and lenght modifiers are not supported yet.
.B Specifiers :
.B %c
is used to format a character. "c" stands for "character".
.br
.B %s
is used to format a string of characters. "s" stands for "string".
.br
.B %i or %d
are used to format an integer. "i" stands for "integer" and "d" stands for "decimal".
.B Notes about specifiers :
If "%" is the only character given to the function. It should not print and return -1 value.
.br
If "%" is followed by "%", function should print only one "%".
.br
If "%" is followed by an
.B unknown specifier
, function should print "%" and the following character.
.SH "RETURN VALUE"
If _printf succeeds, it returns the number of characters printed, null bytes excluded.
If empty string is given, _printf should return (0).
If _printf
.B
returns -1,
it means :
.br
1/ const char* format is null
.br
2/ const char* format is equal to "%"
.SH "AUTHOR(S)"
---
.br
Mathieu Majérus - wrote the code, manpage, readme, flowchart
.br
---
.br
Maxime Regnier - contributed to the flowchart