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,2018,2019,2020,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
|
|
|
*/
|
|
|
|
|
2019-05-07 23:25:41 +01:00
|
|
|
#ifndef __MES_LIB_H
|
|
|
|
#define __MES_LIB_H
|
2017-05-02 22:30:46 +01:00
|
|
|
|
2019-05-07 23:25:41 +01:00
|
|
|
#include <mes/lib-mini.h>
|
2018-08-16 10:43:27 +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
|
|
|
#define __FILEDES_MAX 512
|
|
|
|
extern char *__brk;
|
|
|
|
|
core: Use casting functions.
Silence all casting errors by using casting functions.
* src/cc.c (cast_charp_to_scmp, cast_charp_to_scmpp,
cast_voidp_to_charp, cast_scmp_to_long, cast_scmp_to_charp): New function.
* src/m2.c (cast_charp_to_scmp, cast_charp_to_scmpp,
cast_voidp_to_charp, cast_scmp_to_long, cast_scmp_to_charp): New function.
* include/mes/mes.h: Declare them.
(struct scm): Add car_value, cdr_value, function.
(g_continuations): Change to long.
* src/mes.c: Silence all casting errors by using casting functions.
2020-10-18 14:44:49 +01:00
|
|
|
char *cast_intp_to_charp (int const *i);
|
|
|
|
char *cast_long_to_charp (long i);
|
2020-10-18 13:55:24 +01:00
|
|
|
long cast_charp_to_long (char const *);
|
|
|
|
long cast_int_to_long (int i);
|
|
|
|
long cast_voidp_to_long (void const *);
|
|
|
|
|
2018-07-21 10:15:48 +01:00
|
|
|
int __mes_debug ();
|
2019-03-03 09:04:33 +00:00
|
|
|
void __ungetc_init ();
|
|
|
|
void __ungetc_clear (int filedes);
|
|
|
|
void __ungetc_set (int filedes, int c);
|
|
|
|
int __ungetc_p (int filedes);
|
|
|
|
long abtol (char const **p, int base);
|
|
|
|
char *itoa (int number);
|
|
|
|
char *ltoa (long number);
|
|
|
|
char *ltoab (long x, int base);
|
2020-12-13 21:15:12 +00:00
|
|
|
char *ntoab (long number, unsigned base, int signed_p);
|
2019-03-03 09:04:33 +00:00
|
|
|
char *utoa (unsigned number);
|
2017-08-19 09:51:24 +01:00
|
|
|
int eputc (int c);
|
2018-05-29 17:15:22 +01:00
|
|
|
int fdgetc (int fd);
|
2019-06-08 14:36:22 +01:00
|
|
|
char * fdgets (char *s, int count, int fd);
|
2018-05-29 17:15:22 +01:00
|
|
|
int fdputc (int c, int fd);
|
2019-05-18 12:27:42 +01:00
|
|
|
int fdputs (char const *s, int fd);
|
2018-05-29 17:15:22 +01:00
|
|
|
int fdungetc (int c, int fd);
|
2020-12-29 17:41:45 +00:00
|
|
|
char *_getcwd (char *buffer, size_t size);
|
|
|
|
int ioctl3 (int filedes, size_t command, long data);
|
2019-06-25 18:05:58 +01:00
|
|
|
int isnumber (int c, int base);
|
2019-05-12 23:40:33 +01:00
|
|
|
int mes_open (char const *file_name, int flags, int mask);
|
2018-08-15 17:26:55 +01:00
|
|
|
int _open2 (char const *file_name, int flags);
|
2019-05-12 23:40:33 +01:00
|
|
|
int _open3 (char const *file_name, int flags, int mask);
|
2018-10-15 14:44:47 +01:00
|
|
|
int oputc (int c);
|
2019-05-18 12:27:42 +01:00
|
|
|
int oputs (char const *s);
|
2018-08-22 06:23:27 +01:00
|
|
|
char *search_path (char const *file_name);
|
2019-06-25 00:58:15 +01:00
|
|
|
ssize_t _read (int fd, void *buffer, size_t size);
|
2020-05-17 15:07:04 +01:00
|
|
|
void assert_msg (int check, char *msg);
|
2017-05-02 22:30:46 +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
|
|
|
long __mesabi_imod (long a, long b);
|
|
|
|
long __mesabi_idiv (long a, long b);
|
|
|
|
void *__memcpy (void *dest, void const *src, size_t n);
|
|
|
|
void *__memmove (void *dest, void const *src, size_t n);
|
|
|
|
void *__memset (void *s, int c, size_t n);
|
|
|
|
int __raise (int signal);
|
2019-07-27 21:58:49 +01:00
|
|
|
|
2019-06-25 18:05:58 +01:00
|
|
|
#if !SYSTEM_LIBC
|
2019-06-08 14:36:22 +01:00
|
|
|
void __assert_fail (char *s);
|
2019-07-27 21:58:49 +01:00
|
|
|
ssize_t __buffered_read (int filedes, void *buffer, size_t size);
|
|
|
|
size_t __buffered_read_clear (int filedes);
|
2019-06-08 14:36:22 +01:00
|
|
|
void _exit (int code);
|
|
|
|
long brk (void *addr);
|
|
|
|
#endif // !SYSTEM_LIBC
|
|
|
|
|
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__
|
|
|
|
extern void (*__call_at_exit) (void);
|
|
|
|
double abtod (char const **p, int base);
|
|
|
|
char *dtoab (double number, int base, int signed_p);
|
|
|
|
char *ultoa (unsigned long number);
|
2020-11-21 15:09:13 +00:00
|
|
|
unsigned long __mesabi_umod (unsigned long a, unsigned long b);
|
|
|
|
unsigned long __mesabi_udiv (unsigned long a, unsigned long b);
|
2020-12-12 21:52:13 +00:00
|
|
|
unsigned long __mesabi_uldiv (unsigned long a, unsigned long b,
|
|
|
|
unsigned long *remainder);
|
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
|
|
|
#endif
|
2020-11-22 19:41:07 +00:00
|
|
|
|
2019-05-07 23:25:41 +01:00
|
|
|
#endif //__MES_LIB_H
|