LAL  7.2.4.1-d5ae9e8
LALStdio.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2007 Jolien Creighton
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with with program; see the file COPYING. If not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * MA 02110-1301 USA
18 */
19 
20 /**
21  * \defgroup LALStdio_h Header LALStdio.h
22  * \ingroup lal_std
23  *
24  * \brief Provides LAL functions similar to the non-file functions in <tt><stdio.h></tt>.
25  *
26  * ### Synopsis ###
27  *
28  * \code
29  * #include <lal/LALStdio.h>
30  * #include <lal/FileIO.h>
31  * \endcode
32  *
33  */
34 /** @{ */
35 
36 #ifndef _LALSTDIO_H
37 #define _LALSTDIO_H
38 
39 #include <stdio.h>
40 #include <stdarg.h>
41 #include <inttypes.h>
42 #include <lal/LALConfig.h>
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #elif 0
47 } /* so that editors will match preceding brace */
48 #endif
49 
50 #define LALFopen fopen
51 #define LALFclose fclose
52 
53 /**
54  * \name Format macros for printing (U)INT2
55  */
56 /** @{ */
57 #define LAL_INT2_PRId PRId16
58 #define LAL_INT2_PRIi PRIi16
59 #define LAL_INT2_PRIo PRIo16
60 #define LAL_INT2_PRIu PRIu16
61 #define LAL_INT2_PRIx PRIx16
62 #define LAL_INT2_PRIX PRIX16
63 /** @} */
64 
65 /**
66  * \name Format macros for printing (U)INT4
67  */
68 /** @{ */
69 #define LAL_INT4_PRId PRId32
70 #define LAL_INT4_PRIi PRIi32
71 #define LAL_INT4_PRIo PRIo32
72 #define LAL_INT4_PRIu PRIu32
73 #define LAL_INT4_PRIx PRIx32
74 #define LAL_INT4_PRIX PRIX32
75 /** @} */
76 
77 /**
78  * \name Format macros for printing (U)INT8
79  */
80 /** @{ */
81 #define LAL_INT8_PRId PRId64
82 #define LAL_INT8_PRIi PRIi64
83 #define LAL_INT8_PRIo PRIo64
84 #define LAL_INT8_PRIu PRIu64
85 #define LAL_INT8_PRIx PRIx64
86 #define LAL_INT8_PRIX PRIX64
87 /** @} */
88 
89 /**
90  * \name Format macros for scanning (U)INT2
91  */
92 /** @{ */
93 #define LAL_INT2_SCNd SCNd16
94 #define LAL_INT2_SCNi SCNi16
95 #define LAL_INT2_SCNo SCNo16
96 #define LAL_INT2_SCNu SCNu16
97 #define LAL_INT2_SCNx SCNx16
98 /** @} */
99 
100 /**
101  * \name Format macros for scanning (U)INT4
102  */
103 /** @{ */
104 #define LAL_INT4_SCNd SCNd32
105 #define LAL_INT4_SCNi SCNi32
106 #define LAL_INT4_SCNo SCNo32
107 #define LAL_INT4_SCNu SCNu32
108 #define LAL_INT4_SCNx SCNx32
109 /** @} */
110 
111 /**
112  * \name Format macros for scanning (U)INT8
113  */
114 /** @{ */
115 #define LAL_INT8_SCNd SCNd64
116 #define LAL_INT8_SCNi SCNi64
117 #define LAL_INT8_SCNo SCNo64
118 #define LAL_INT8_SCNu SCNu64
119 #define LAL_INT8_SCNx SCNx64
120 /** @} */
121 
122 /**
123  * \name Format macros for printing and scanning (U)INT* (decimal only) and REAL*
124  */
125 /** @{ */
126 #define LAL_INT2_FORMAT LAL_INT2_SCNd
127 #define LAL_INT4_FORMAT LAL_INT4_SCNd
128 #define LAL_INT8_FORMAT LAL_INT8_SCNd
129 #define LAL_UINT2_FORMAT LAL_INT2_SCNu
130 #define LAL_UINT4_FORMAT LAL_INT4_SCNu
131 #define LAL_UINT8_FORMAT LAL_INT8_SCNu
132 #define LAL_REAL4_FORMAT "g"
133 #define LAL_REAL8_FORMAT "lg"
134 /** @} */
135 
136 /** @} */
137 
138 #if 0
139 { /* so that editors will match succeeding brace */
140 #elif defined(__cplusplus)
141 }
142 #endif
143 #endif /* _LALSTDIO_H */