-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathman_3_printf
More file actions
74 lines (56 loc) · 2.02 KB
/
man_3_printf
File metadata and controls
74 lines (56 loc) · 2.02 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
.\" Copyright (c) 2024 by Jose N. Olmos (jose.n.olmos@outlook.com)
.TH _PRINTF 0 2024-07-01 "CHEPE, TORIN" "Atlas Programmer's Manual"
.SH NAME
_printf \- a minimal emulation of the classic printf function.
.SH SYNOPSIS
.nf
.B #include <main.h>
.PP
.BI "int _printf(const char *" format " ...); "
.fi
.SH DESCRIPTION
This minimal implementation of printf takes a mandatory format string and optional arguments
that are printed out to stdout in accordance with what the format string dictates. It returns an positive int upon success.
.SS Flag characters
(unimplemented)
.SS Field width
(unimplemented)
.SS Precision
(unimplemented)
.SS Length modifiers
(unimplemented)
.SS Conversion specifiers
In the format string after each % if one of the following characters is encountered then _printf will
attempt to print out the type specified by the letter from.
.TP
.BR d , " i"
these specifiers tell printf to take the next argument and output it as a base-ten numeral
.TP
.B c
this specifier tells printf to take the next argument and output it as a character
.TP
.B s
this specifier tells printf to take the next argument and output it as a string
.SH RETURN VALUE
Our implementation, upon successful write-out to stdout, will simply return the total number
of characters printed excluding the null-byte. If an error occurs, then _printf will just return \-1.
.SH CONFORMING TO
Betty Style, Nicole Standards
.SH NOTES
This implementation of printf came about as a group project for first trimester students at Tulsa Atlas School.
.SH BUGS
Considering the function shares behaviour with regular printf, any of the standard printf bugs are likely to be
duplicated as well. There may exist other bugs, but they remain to be discovered.
.SH EXAMPLES
the following would output string formated with a char, string, and two integers to stdout :
.EX
#include "main.h"
int main(void)
{
int len;
len = _printf("outputs: %c; %s; %d; %i\n", 'A', "tqbfjotld", 98, INT_MIN);
return (int);
}
.EE
.SH SEE ALSO
.BR printf "(3), " printf "(1), " puts (3)