2017-05-02 21:30:46 +00:00
|
|
|
/* -*-comment-start: "//";comment-end:""-*-
|
2018-07-22 12:24:36 +00:00
|
|
|
* GNU Mes --- Maxwell Equations of Software
|
2017-11-21 18:22:26 +00:00
|
|
|
* Copyright © 2016,2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
2017-05-02 21:30:46 +00:00
|
|
|
*
|
2018-07-22 12:24:36 +00:00
|
|
|
* This file is part of GNU Mes.
|
2017-05-02 21:30:46 +00:00
|
|
|
*
|
2018-07-22 12:24:36 +00:00
|
|
|
* GNU Mes is free software; you can redistribute it and/or modify it
|
2017-05-02 21:30:46 +00:00
|
|
|
* under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
* your option) any later version.
|
|
|
|
*
|
2018-07-22 12:24:36 +00:00
|
|
|
* GNU Mes is distributed in the hope that it will be useful, but
|
2017-05-02 21:30:46 +00:00
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2018-07-22 12:24:36 +00:00
|
|
|
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
2017-05-02 21:30:46 +00:00
|
|
|
*/
|
2017-05-23 05:16:08 +00:00
|
|
|
#ifndef __MES_STDIO_H
|
|
|
|
#define __MES_STDIO_H 1
|
2017-05-02 15:00:07 +00:00
|
|
|
|
2019-05-07 22:25:41 +00:00
|
|
|
#include <mes/lib.h>
|
2017-05-02 15:00:07 +00:00
|
|
|
|
2019-05-29 14:15:12 +00:00
|
|
|
#if SYSTEM_LIBC
|
2017-05-02 21:30:46 +00:00
|
|
|
#ifndef _GNU_SOURCE
|
|
|
|
#define _GNU_SOURCE
|
|
|
|
#endif
|
2017-07-23 13:49:03 +00:00
|
|
|
#undef __MES_STDIO_H
|
2017-05-02 21:30:46 +00:00
|
|
|
#include_next <stdio.h>
|
|
|
|
|
2019-05-29 14:15:12 +00:00
|
|
|
#else // ! SYSTEM_LIBC
|
2017-05-02 21:30:46 +00:00
|
|
|
|
2018-08-26 20:41:52 +00:00
|
|
|
#ifndef _IOFBF
|
2019-05-18 11:27:42 +00:00
|
|
|
#define _IOFBF 0 /* Fully buffered. */
|
|
|
|
#define _IOLBF 1 /* Line buffered. */
|
|
|
|
#define _IONBF 2 /* No buffering. */
|
2018-08-26 20:41:52 +00:00
|
|
|
#endif
|
|
|
|
|
2018-05-30 19:55:39 +00:00
|
|
|
#ifndef BUFSIZ
|
|
|
|
#define BUFSIZ 256
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef L_tmpnam
|
|
|
|
#define L_tmpnam 100
|
|
|
|
#endif
|
|
|
|
|
2018-06-19 18:23:38 +00:00
|
|
|
#include <sys/types.h>
|
2018-06-03 16:54:26 +00:00
|
|
|
|
|
|
|
#define stdin (FILE*)0
|
|
|
|
#define stdout (FILE*)1
|
|
|
|
#define stderr (FILE*)2
|
2017-05-23 05:16:08 +00:00
|
|
|
|
|
|
|
#define SEEK_SET 0
|
|
|
|
#define SEEK_CUR 1
|
|
|
|
#define SEEK_END 2
|
|
|
|
|
2018-05-29 16:15:22 +00:00
|
|
|
FILE *fdopen (int fd, char const *mode);
|
|
|
|
FILE *fopen (char const *file_name, char const *mode);
|
2017-08-06 11:53:56 +00:00
|
|
|
int eputc (int c);
|
2019-05-18 11:27:42 +00:00
|
|
|
int eputs (char const *s);
|
|
|
|
int fclose (FILE * stream);
|
|
|
|
int feof (FILE * stream);
|
|
|
|
int ferror (FILE * stream);
|
|
|
|
int fflush (FILE * stream);
|
|
|
|
int fgetc (FILE * stream);
|
|
|
|
char *fgets (char *s, int size, FILE * stream);
|
|
|
|
int fprintf (FILE * stream, char const *format, ...);
|
|
|
|
int fpurge (FILE * stream);
|
|
|
|
int fputc (int c, FILE * stream);
|
|
|
|
int fputs (char const *s, FILE * stream);
|
2019-09-06 17:04:50 +00:00
|
|
|
int fscanf (FILE * stream, char const *template, ...);
|
2019-05-18 11:27:42 +00:00
|
|
|
int fseek (FILE * stream, long offset, int whence);
|
|
|
|
int getc (FILE * stream);
|
2018-06-19 18:23:38 +00:00
|
|
|
int getchar (void);
|
2018-08-26 20:41:52 +00:00
|
|
|
char *getlogin (void);
|
2019-05-18 11:27:42 +00:00
|
|
|
int printf (char const *format, ...);
|
|
|
|
int putc (int c, FILE * stream);
|
2017-07-24 11:23:15 +00:00
|
|
|
int putchar (int c);
|
2019-05-18 11:27:42 +00:00
|
|
|
int puts (char const *s);
|
2017-07-24 18:19:49 +00:00
|
|
|
int remove (char const *file_name);
|
2019-05-18 11:27:42 +00:00
|
|
|
int setvbuf (FILE * stream, char *buf, int mode, size_t size);
|
|
|
|
int snprintf (char *str, size_t size, char const *format, ...);
|
|
|
|
int sprintf (char *str, char const *format, ...);
|
2019-09-06 17:04:50 +00:00
|
|
|
int sscanf (char const *str, char const *format, ...);
|
2019-05-18 11:27:42 +00:00
|
|
|
int ungetc (int c, FILE * stream);
|
|
|
|
long ftell (FILE * stream);
|
|
|
|
size_t fread (void *ptr, size_t size, size_t count, FILE * stream);
|
|
|
|
size_t freadahead (FILE * fp);
|
|
|
|
size_t fwrite (void const *ptr, size_t size, size_t count, FILE * stream);
|
2017-05-23 05:16:08 +00:00
|
|
|
|
2019-05-29 14:15:12 +00:00
|
|
|
#endif // ! SYSTEM_LIBC
|
2017-05-02 21:30:46 +00:00
|
|
|
|
2017-05-23 05:16:08 +00:00
|
|
|
#endif // __MES_STDIO_H
|