xref: /llvm-project-15.0.7/libc/docs/stdio.rst (revision 12aae7d9)
1=============================
2StdIO Functions in LLVM-libc
3=============================
4
5-------
6Summary
7-------
8
9This document tracks the status of the implementation of stdio functions in LLVM
10Libc.
11
12---------------
13Source location
14---------------
15
16-   The main source for string functions is located at:
17    ``libc/src/stdio`` with subdirectories for internal implementations.
18
19---------------------
20Implementation Status
21---------------------
22
23Formatted Input/Output Functions
24================================
25
26These functions take in format strings and arguments of various types and
27convert either to or from those arguments. These functions are the current focus
28(owner: michaelrj).
29
30=============  =========
31Function_Name  Available
32=============  =========
33\*printf       WIP
34\*scanf
35=============  =========
36
37``FILE`` Access
38===============
39
40These functions are used to interact with the ``FILE`` object type, which is an
41I/O stream, often used to represent a file on the host's hard drive. Currently
42the ``FILE`` object is only available on linux.
43
44=============  =========
45Function_Name  Available
46=============  =========
47fopen          YES
48freopen
49fclose         YES
50fflush         YES
51setbuf
52setvbuf
53ftell
54fgetpos
55fseek          YES
56fsetpos
57rewind
58tmpfile
59clearerr       YES
60feof           YES
61ferror         YES
62flockfile      YES
63funlockfile    YES
64=============  =========
65
66Operations on system files
67==========================
68
69These functions operate on files on the host's system, without using the
70``FILE`` object type. They only take the name of the file being operated on.
71
72=============  =========
73Function_Name  Available
74=============  =========
75remove
76rename
77tmpnam
78=============  =========
79
80Unformatted ``FILE`` Input/Output Functions
81===========================================
82
83The ``gets`` function was removed in C11 for having no bounds checking and
84therefor being impossible to use safely.
85
86=============  =========
87Function_Name  Available
88=============  =========
89(f)getc
90fgets
91getchar
92fread          YES
93(f)putc
94(f)puts
95putchar
96fwrite         YES
97ungetc
98=============  =========
99