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
|
2020-12-13 21:15:12 +00:00
|
|
|
* Copyright © 2016,2017,2018,2019,2020 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
|
|
|
|
2020-10-18 13:55:24 +01:00
|
|
|
char* cast_intp_to_charp (int const *i);
|
|
|
|
char* cast_long_to_charp (long i);
|
|
|
|
long cast_charp_to_long (char const *);
|
|
|
|
long cast_int_to_long (int i);
|
|
|
|
long cast_voidp_to_long (void const *);
|
|
|
|
|
|
|
|
// #define cast_intp_to_charp(x) ((char*) x)
|
|
|
|
// #define cast_long_to_charp(x) ((char*) x)
|
|
|
|
// #define cast_charp_to_long(x) ((long) x)
|
|
|
|
// #define cast_int_to_long(x) ((long) x)
|
|
|
|
// #define cast_voidp_to_long(x) ((long) x)
|
|
|
|
|
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);
|
2019-06-25 11:51:44 +01:00
|
|
|
double abtod (char const **p, int base);
|
2019-03-03 09:04:33 +00:00
|
|
|
long abtol (char const **p, int base);
|
2020-01-12 17:42:25 +00:00
|
|
|
char *dtoab (double number, int base, int signed_p);
|
2019-03-03 09:04:33 +00:00
|
|
|
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 *ultoa (unsigned long number);
|
|
|
|
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);
|
2019-06-25 22:10:52 +01:00
|
|
|
char * _getcwd (char *buffer, size_t size);
|
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
|
|
|
|
2019-06-08 14:36:22 +01:00
|
|
|
extern char *__brk;
|
|
|
|
extern void (*__call_at_exit) (void);
|
2019-06-25 18:05:58 +01:00
|
|
|
|
2019-07-27 21:58:49 +01:00
|
|
|
#define __FILEDES_MAX 512
|
|
|
|
|
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
|
|
|
|
|
2020-11-21 15:09:13 +00:00
|
|
|
long __mesabi_imod (long a, long b);
|
|
|
|
long __mesabi_idiv (long a, long b);
|
|
|
|
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);
|
2020-11-21 15:09:13 +00:00
|
|
|
|
2020-11-22 19:41:07 +00:00
|
|
|
void *__memcpy (void *dest, void const *src, size_t n);
|
2020-11-22 19:42:49 +00:00
|
|
|
void *__memmove (void *dest, void const *src, size_t n);
|
2020-11-22 19:43:35 +00:00
|
|
|
void *__memset (void *s, int c, size_t n);
|
2020-11-22 19:41:07 +00:00
|
|
|
|
2019-05-07 23:25:41 +01:00
|
|
|
#endif //__MES_LIB_H
|