2017-05-02 22:30:46 +01:00
|
|
|
/* -*-comment-start: "//";comment-end:""-*-
|
2018-07-22 13:24:36 +01:00
|
|
|
* GNU Mes --- Maxwell Equations of Software
|
kaem: read: Remove --bootstrap-mode.
* include/mes/lib.h[__M2__](__call_at_exit,abtod,dtoab,ultoa,
* include/sys/types.h[__M2__]: Fall back to unsigned instead of using
unsigned long.
* include/stdio.h[__M2__](fprintf, fscanf, printf, snprintf, sprintf,
sscanf): Hide prototypes.
* lib/stdlib/exit.c (exit)[__M2__]: Hide call to __call_at_exit.
* lib/linux/read.c (read)[__M2__]: Hide debugging.
* lib/linux/malloc.c (malloc)[__M2__]: Hide alignment.
__mesabi_umod, __mesabi_udiv, __mesabi_uldiv): Hide prototypes.
* scaffold/argv.kaem: Use them together with lib/mes/lib-mini.h instead of
lib/mes/* specializations. Remove --bootstrap-mode from M2-Planet call.
2022-05-03 11:54:22 +01:00
|
|
|
* Copyright © 2016,2017,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
2017-05-02 22:30:46 +01:00
|
|
|
*
|
2018-07-22 13:24:36 +01:00
|
|
|
* This file is part of GNU Mes.
|
2017-05-02 22:30:46 +01:00
|
|
|
*
|
2018-07-22 13:24:36 +01:00
|
|
|
* GNU Mes is free software; you can redistribute it and/or modify it
|
2017-05-02 22:30:46 +01: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 13:24:36 +01:00
|
|
|
* GNU Mes is distributed in the hope that it will be useful, but
|
2017-05-02 22:30:46 +01: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 13:24:36 +01:00
|
|
|
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
2017-05-02 22:30:46 +01:00
|
|
|
*/
|
2017-05-23 06:16:08 +01:00
|
|
|
#ifndef __MES_STDIO_H
|
|
|
|
#define __MES_STDIO_H 1
|
2017-05-02 16:00:07 +01:00
|
|
|
|
2019-05-07 23:25:41 +01:00
|
|
|
#include <mes/lib.h>
|
2017-05-02 16:00:07 +01:00
|
|
|
|
2019-05-29 15:15:12 +01:00
|
|
|
#if SYSTEM_LIBC
|
2017-05-02 22:30:46 +01:00
|
|
|
#ifndef _GNU_SOURCE
|
|
|
|
#define _GNU_SOURCE
|
|
|
|
#endif
|
2017-07-23 14:49:03 +01:00
|
|
|
#undef __MES_STDIO_H
|
2017-05-02 22:30:46 +01:00
|
|
|
#include_next <stdio.h>
|
|
|
|
|
2019-05-29 15:15:12 +01:00
|
|
|
#else // ! SYSTEM_LIBC
|
2017-05-02 22:30:46 +01:00
|
|
|
|
2018-08-26 21:41:52 +01:00
|
|
|
#ifndef _IOFBF
|
2019-05-18 12:27:42 +01:00
|
|
|
#define _IOFBF 0 /* Fully buffered. */
|
|
|
|
#define _IOLBF 1 /* Line buffered. */
|
|
|
|
#define _IONBF 2 /* No buffering. */
|
2018-08-26 21:41:52 +01:00
|
|
|
#endif
|
|
|
|
|
2018-05-30 20:55:39 +01:00
|
|
|
#ifndef BUFSIZ
|
|
|
|
#define BUFSIZ 256
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef L_tmpnam
|
|
|
|
#define L_tmpnam 100
|
|
|
|
#endif
|
|
|
|
|
2018-06-19 19:23:38 +01:00
|
|
|
#include <sys/types.h>
|
2018-06-03 17:54:26 +01:00
|
|
|
|
|
|
|
#define stdin (FILE*)0
|
|
|
|
#define stdout (FILE*)1
|
|
|
|
#define stderr (FILE*)2
|
2017-05-23 06:16:08 +01:00
|
|
|
|
|
|
|
#define SEEK_SET 0
|
|
|
|
#define SEEK_CUR 1
|
|
|
|
#define SEEK_END 2
|
|
|
|
|
2018-05-29 17:15:22 +01:00
|
|
|
FILE *fdopen (int fd, char const *mode);
|
|
|
|
FILE *fopen (char const *file_name, char const *mode);
|
2017-08-06 12:53:56 +01:00
|
|
|
int eputc (int c);
|
2019-05-18 12:27:42 +01: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);
|
2019-02-08 12:45:44 +00:00
|
|
|
int fileno (FILE *);
|
2019-05-18 12:27:42 +01:00
|
|
|
int fpurge (FILE * stream);
|
|
|
|
int fputc (int c, FILE * stream);
|
|
|
|
int fputs (char const *s, FILE * stream);
|
|
|
|
int fseek (FILE * stream, long offset, int whence);
|
|
|
|
int getc (FILE * stream);
|
2018-06-19 19:23:38 +01:00
|
|
|
int getchar (void);
|
2018-08-26 21:41:52 +01:00
|
|
|
char *getlogin (void);
|
2019-05-18 12:27:42 +01:00
|
|
|
int putc (int c, FILE * stream);
|
2017-07-24 12:23:15 +01:00
|
|
|
int putchar (int c);
|
2019-05-18 12:27:42 +01:00
|
|
|
int puts (char const *s);
|
2017-07-24 19:19:49 +01:00
|
|
|
int remove (char const *file_name);
|
2019-02-08 12:56:25 +00:00
|
|
|
void rewind (FILE * stream);
|
2022-11-01 09:18:44 +00:00
|
|
|
void setbuf (FILE *stream, char *buf);
|
2019-05-18 12:27:42 +01:00
|
|
|
int setvbuf (FILE * stream, char *buf, int mode, size_t size);
|
|
|
|
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 06:16:08 +01:00
|
|
|
|
kaem: read: Remove --bootstrap-mode.
* include/mes/lib.h[__M2__](__call_at_exit,abtod,dtoab,ultoa,
* include/sys/types.h[__M2__]: Fall back to unsigned instead of using
unsigned long.
* include/stdio.h[__M2__](fprintf, fscanf, printf, snprintf, sprintf,
sscanf): Hide prototypes.
* lib/stdlib/exit.c (exit)[__M2__]: Hide call to __call_at_exit.
* lib/linux/read.c (read)[__M2__]: Hide debugging.
* lib/linux/malloc.c (malloc)[__M2__]: Hide alignment.
__mesabi_umod, __mesabi_udiv, __mesabi_uldiv): Hide prototypes.
* scaffold/argv.kaem: Use them together with lib/mes/lib-mini.h instead of
lib/mes/* specializations. Remove --bootstrap-mode from M2-Planet call.
2022-05-03 11:54:22 +01:00
|
|
|
#if !__M2__
|
|
|
|
int fprintf (FILE * stream, char const *format, ...);
|
|
|
|
int fscanf (FILE * stream, char const *template, ...);
|
|
|
|
int printf (char const *format, ...);
|
|
|
|
int snprintf (char *str, size_t size, char const *format, ...);
|
|
|
|
int sprintf (char *str, char const *format, ...);
|
|
|
|
int sscanf (char const *str, char const *format, ...);
|
|
|
|
#endif // !__M2__
|
|
|
|
|
2019-05-29 15:15:12 +01:00
|
|
|
#endif // ! SYSTEM_LIBC
|
2017-05-02 22:30:46 +01:00
|
|
|
|
2017-05-23 06:16:08 +01:00
|
|
|
#endif // __MES_STDIO_H
|