summaryrefslogtreecommitdiff
path: root/PACE/pace/stdio.h
blob: 064200b2de1149ba406169eb837d2a5056f85063 (plain)
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
/* $Id$

 * ============================================================================
 *
 * = LIBRARY
 *    pace
 *
 * = FILENAME
 *    stdio.h
 *
 * = AUTHOR
 *    Luther Baker
 *
 * ============================================================================ */


#ifndef PACE_STDIO_H
#define PACE_STDIO_H


#include "pace/defines.h"
#include <stdio.h>
#include <stdarg.h>


# if defined (PACE_HAS_CPLUSPLUS)
extern "C" {
# endif /* PACE_HAS_CPLUSPLUS */

  #define pace_stderr stderr;

  #define pace_stdout stdout;

  #define pace_stdin stdin;

  PACE_INLINE char * pace_ctermid (char * s);

  PACE_INLINE int pace_fclose (FILE * stream);

  PACE_INLINE FILE * pace_fdopen (int fildes, const char * type);

  PACE_INLINE int pace_fflush (FILE * stream);

  PACE_INLINE int pace_fileno (FILE * stream);

  PACE_INLINE int pace_fgetc (FILE * stream);

  PACE_INLINE char * pace_fgets (char * s, int n, FILE * stream);

  PACE_INLINE void pace_flockfile (FILE * file);
  /* Requires PACE_HAS_REENTRANT. */

  PACE_INLINE FILE * pace_fopen (const char * filename, const char * mode);

  #define pace_fprintf(X) fprintf X
  /* int fprintf (FILE *stream, const char *format, (*//* args *//*) ... );
   *
   * PLEASE PAY SPECIAL ATTENTION HERE!
   * This is a macro and requires an additional set of parenthesis
   * surrounding the arguments.
   */

  PACE_INLINE int pace_fputc (int c, FILE * stream);

  PACE_INLINE int pace_fputs (const char * s, FILE * stream);

  PACE_INLINE size_t pace_fread (void * ptr,
                                 size_t size,
                                 size_t number_of_items,
                                 FILE * stream);

  PACE_INLINE FILE * pace_freopen (const char * filename,
                                   const char * mode,
                                   FILE * stream);

  #define pace_fscanf(X) fscanf X
  /* int fscanf (FILE*stream, const char *format, ... );
   *
   * PLEASE PAY SPECIAL ATTENTION HERE!
   * This is a macro and requires an additional set of parenthesis
   * surrounding the arguments.
   */

  PACE_INLINE int pace_fseek (FILE * stream, long offset, int whence);

  PACE_INLINE int pace_fseek (FILE * stream, pace_off_t offset, int whence);
  /* Not in POSIX spec. */

  PACE_INLINE long pace_ftell (FILE * stream);

  PACE_INLINE pace_off_t pace_ftello (FILE * stream);
  /* Not in POSIX spec. */

  PACE_INLINE size_t pace_fwrite (const void * ptr,
  /* Not in POSIX spec. */        size_t size,
                                  size_t number_of_items,
                                  FILE * stream);

  PACE_INLINE int pace_trylockfile (FILE * file);
  /* Requires PACE_HAS_REENTRANT. */

  PACE_INLINE void pace_funlockfile (FILE * file);
  /* Requires PACE_HAS_REENTRANT. */

  PACE_INLINE int pace_getc (FILE * stream);

  PACE_INLINE int pace_getc_unlocked (FILE * stream);
  /* Requires PACE_HAS_REENTRANT. */

  PACE_INLINE int pace_getchar ();

  PACE_INLINE int pace_getchar_unlocked ();
  /* Requires PACE_HAS_REENTRANT. */

  PACE_INLINE char *PACE_gets (char * s);

  PACE_INLINE int pace_getw (FILE * stream);
  /* Not in POSIX spec. */

  PACE_INLINE void pace_perror (const char * s);

  #define pace_printf(X) printf X
  /* int printf (const char *format, (*//* args*//*) ... );
   *
   * PLEASE PAY SPECIAL ATTENTION HERE!
   * This is a macro and requires an additional set of parenthesis
   * surrounding the arguments.
   */

  PACE_INLINE int pace_putc (int c, FILE * stream);

  PACE_INLINE int pace_putc_unlocked (int c, FILE * stream);
  /* Requires PACE_HAS_REENTRANT. */

  PACE_INLINE int pace_putchar (int c);

  PACE_INLINE int pace_putchar_unlocked (int c);
  /* Requires PACE_HAS_REENTRANT. */

  PACE_INLINE int pace_puts (const char * s);

  PACE_INLINE int pace_putw (int w, FILE * stream);
  /* Not in POSIX spec. */

  PACE_INLINE int pace_rename (const char * old_name,
                               const char * new_name);

  PACE_INLINE void pace_rewind (FILE * stream);

  PACE_INLINE int pace_sprintf (char * buf, const char * format, ... );

  #define pace_scanf(X) scanf X
  /* int scanf (const char *format, ... );
   *
   * PLEASE PAY SPECIAL ATTENTION HERE!
   * This is a macro and requires an additional set of parenthesis
   * surrounding the arguments.
   */

  #define pace_sscanf(X) sscanf X
  /* int sscanf (const char *s, const char *format, ... );
   *
   * PLEASE PAY SPECIAL ATTENTION HERE!
   * This is a macro and requires an additional set of parenthesis
   * surrounding the arguments.
   */

  #define pace_snprintf(X) snprintf X
  /* int snprintf (char *s, size_t  n, const char *format, (*//* args*//*) ... );
   *
   * PLEASE PAY SPECIAL ATTENTION HERE!
   * This is a macro and requires an additional set of parenthesis
   * surrounding the arguments.
   */

  PACE_INLINE int pace_vsprintf (char * buffer,
                                 const char * format,
                                 va_list argptr);

  PACE_INLINE FILE * pace_tmpfile ();

# if defined (PACE_HAS_CPLUSPLUS)
}
# endif /* PACE_HAS_CPLUSPLUS */

# if defined (PACE_HAS_INLINE)
# include "stdio.inl"
# endif /* PACE_HAS_INLINE */


#endif /* PACE_STDIO_H */