xref: /llvm-project/libc/include/llvm-libc-macros/stdio-macros.h (revision c63112a9118277a20ae440f3f69189c0937e8f4d)
115ae08c1SSiva Chandra Reddy //===-- Macros defined in stdio.h header file -----------------------------===//
215ae08c1SSiva Chandra Reddy //
315ae08c1SSiva Chandra Reddy // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
415ae08c1SSiva Chandra Reddy // See https://llvm.org/LICENSE.txt for license information.
515ae08c1SSiva Chandra Reddy // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
615ae08c1SSiva Chandra Reddy //
715ae08c1SSiva Chandra Reddy //===----------------------------------------------------------------------===//
815ae08c1SSiva Chandra Reddy 
9330793c9SNick Desaulniers #ifndef LLVM_LIBC_MACROS_STDIO_MACROS_H
10330793c9SNick Desaulniers #define LLVM_LIBC_MACROS_STDIO_MACROS_H
1115ae08c1SSiva Chandra Reddy 
12*c63112a9Slntue #include "../llvm-libc-types/FILE.h"
13*c63112a9Slntue 
14*c63112a9Slntue #ifdef __cplusplus
15*c63112a9Slntue extern "C" FILE *stdin;
16*c63112a9Slntue extern "C" FILE *stdout;
17*c63112a9Slntue extern "C" FILE *stderr;
18*c63112a9Slntue #else
19*c63112a9Slntue extern FILE *stdin;
20*c63112a9Slntue extern FILE *stdout;
21*c63112a9Slntue extern FILE *stderr;
22*c63112a9Slntue #endif
23*c63112a9Slntue 
24*c63112a9Slntue #ifndef stdin
25*c63112a9Slntue #define stdin stdin
26*c63112a9Slntue #endif
27*c63112a9Slntue 
28*c63112a9Slntue #ifndef stdout
29*c63112a9Slntue #define stdout stdout
30*c63112a9Slntue #endif
31*c63112a9Slntue 
32*c63112a9Slntue #ifndef stderr
33*c63112a9Slntue #define stderr stderr
34*c63112a9Slntue #endif
35*c63112a9Slntue 
36d6722bcbSPetr Hosek #ifndef EOF
37d6722bcbSPetr Hosek #define EOF (-1)
38d6722bcbSPetr Hosek #endif
39d6722bcbSPetr Hosek 
4015ae08c1SSiva Chandra Reddy #define BUFSIZ 1024
4115ae08c1SSiva Chandra Reddy 
425aed6d67SMichael Jones #define _IONBF 2
435aed6d67SMichael Jones #define _IOLBF 1
445aed6d67SMichael Jones #define _IOFBF 0
455aed6d67SMichael Jones 
46*c63112a9Slntue #ifndef SEEK_SET
47*c63112a9Slntue #define SEEK_SET 0
48*c63112a9Slntue #endif
49*c63112a9Slntue 
50*c63112a9Slntue #ifndef SEEK_CUR
51*c63112a9Slntue #define SEEK_CUR 1
52*c63112a9Slntue #endif
53*c63112a9Slntue 
54*c63112a9Slntue #ifndef SEEK_END
55*c63112a9Slntue #define SEEK_END 2
56*c63112a9Slntue #endif
57*c63112a9Slntue 
58330793c9SNick Desaulniers #endif // LLVM_LIBC_MACROS_STDIO_MACROS_H
59