summaryrefslogtreecommitdiff
path: root/PACE/pace/posix/stdio.h
diff options
context:
space:
mode:
Diffstat (limited to 'PACE/pace/posix/stdio.h')
-rw-r--r--PACE/pace/posix/stdio.h202
1 files changed, 172 insertions, 30 deletions
diff --git a/PACE/pace/posix/stdio.h b/PACE/pace/posix/stdio.h
index bee28898ca0..31c1f692452 100644
--- a/PACE/pace/posix/stdio.h
+++ b/PACE/pace/posix/stdio.h
@@ -13,8 +13,8 @@
*
* ============================================================================ */
-#ifndef PACE_STDIO_H_POSIX
-#define PACE_STDIO_H_POSIX
+#ifndef PACE_STDIO_H
+#define PACE_STDIO_H
#include <stdio.h>
#include <stdarg.h>
@@ -23,36 +23,178 @@
extern "C" {
#endif /* PACE_HAS_CPLUSPLUS */
-#define PACE_BUFSIZ BUFSIZ
-#define PACE_EOF EOF
-#define PACE_FILENAME_MAX FILENAME_MAX
-#define PACE_L_ctermid L_ctermid
-#define PACE_L_cuserid L_cuserid
-#ifndef PACE_NULL
-#define PACE_NULL NULL
-#endif /* PACE_NULL */
-#define PACE_SEEK_CUR SEEK_CUR
-#define PACE_SEEK_END SEEK_END
-#define PACE_SEEK_SET SEEK_SET
-#define PACE_TMP_MAX TMP_MAX
-#define pace_stderr stderr
-#define pace_stdout stdout
-#define pace_stdin stdin
-
-#ifndef PACE_FPOS_T
-#define PACE_FPOS_T
-typedef fpos_t pace_fpos_t;
-#endif /* PACE_FPOS_T */
-
-#ifndef PACE_SIZE_T
-#define PACE_SIZE_T
- typedef size_t pace_size_t;
-#endif /* PACE_SIZE_T */
-
-typedef FILE PACE_FILE;
+ #define pace_stderr stderr;
+
+ #define pace_stdout stdout;
+
+ #define pace_stdin stdin;
+
+ PACE_INLINE void pace_clearerr (FILE * stream);
+
+ 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_ferror (FILE * stream);
+
+ PACE_INLINE int pace_feof (FILE * stream);
+
+ 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_remove (const char * path);
+
+ 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.
+ */
+
+ PACE_INLINE void pace_setbuf (FILE * stream, char * buf);
+
+ #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 FILE * pace_tmpfile ();
+
+ PACE_INLINE char * pace_tmpnam (char * s);
+
+ PACE_INLINE int pace_ungetc (int c, FILE * stream);
+
+ PACE_INLINE int pace_vsprintf (char * buffer,
+ const char * format,
+ va_list argptr);
#if defined (PACE_HAS_CPLUSPLUS)
}
#endif /* PACE_HAS_CPLUSPLUS */
-#endif /* PACE_STDIO_H_POSIX */
+#if defined (PACE_HAS_INLINE)
+# include "pace/posix/stdio.inl"
+#endif /* PACE_HAS_INLINE */
+
+#endif /* PACE_STDIO_H */