2018-05-29 16:15:22 +00:00
|
|
|
/* -*-comment-start: "//";comment-end:""-*-
|
2018-07-22 12:24:36 +00:00
|
|
|
* GNU Mes --- Maxwell Equations of Software
|
2018-05-29 16:15:22 +00:00
|
|
|
* Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
|
|
|
*
|
2018-07-22 12:24:36 +00:00
|
|
|
* This file is part of GNU Mes.
|
2018-05-29 16:15:22 +00:00
|
|
|
*
|
2018-07-22 12:24:36 +00:00
|
|
|
* GNU Mes is free software; you can redistribute it and/or modify it
|
2018-05-29 16:15:22 +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
|
2018-05-29 16:15:22 +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/>.
|
2018-05-29 16:15:22 +00:00
|
|
|
*/
|
|
|
|
|
2019-05-07 22:25:41 +00:00
|
|
|
#include <mes/lib.h>
|
2018-06-26 04:19:51 +00:00
|
|
|
#include <stdlib.h>
|
2018-05-29 18:07:46 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include <unistd.h>
|
2018-05-29 16:15:22 +00:00
|
|
|
|
2018-08-16 09:43:27 +00:00
|
|
|
#include <ctype/isdigit.c>
|
|
|
|
#include <ctype/isxdigit.c>
|
|
|
|
#include <ctype/isspace.c>
|
|
|
|
#include <ctype/isnumber.c>
|
|
|
|
|
|
|
|
#include <mes/abtol.c>
|
|
|
|
#include <stdlib/atoi.c>
|
|
|
|
#include <mes/ntoab.c>
|
|
|
|
#include <mes/ltoab.c>
|
|
|
|
#include <mes/itoa.c>
|
2018-10-06 09:59:20 +00:00
|
|
|
#include <mes/ltoa.c>
|
2018-10-06 10:02:16 +00:00
|
|
|
#include <mes/ultoa.c>
|
2018-08-16 09:43:27 +00:00
|
|
|
#include <mes/utoa.c>
|
|
|
|
#include <mes/fdgetc.c>
|
|
|
|
#include <mes/fdputc.c>
|
|
|
|
#include <mes/fdputs.c>
|
|
|
|
#include <mes/fdungetc.c>
|
2018-06-16 18:51:16 +00:00
|
|
|
|
2019-03-23 20:44:00 +00:00
|
|
|
#if WITH_GLIBC
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <stdarg.h>
|
2019-02-15 08:28:46 +00:00
|
|
|
// The Mes C Library defines and initializes these in crt1
|
2019-03-02 11:35:18 +00:00
|
|
|
int __stdin = STDIN;
|
|
|
|
int __stdout = STDOUT;
|
|
|
|
int __stderr = STDERR;
|
|
|
|
|
|
|
|
int
|
2019-05-12 22:40:33 +00:00
|
|
|
mes_open (char const *file_name, int flags, int mask)
|
2019-03-02 11:35:18 +00:00
|
|
|
{
|
|
|
|
__ungetc_init ();
|
|
|
|
int r = open (file_name, flags, mask);
|
|
|
|
if (r > 2)
|
|
|
|
__ungetc_buf[r] = -1;
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
2018-08-16 09:43:27 +00:00
|
|
|
#include <mes/eputs.c>
|
|
|
|
#include <mes/oputs.c>
|
2019-05-12 22:40:33 +00:00
|
|
|
|
|
|
|
#else // !WITH_GLIBC
|
|
|
|
|
|
|
|
int
|
|
|
|
mes_open (char const *file_name, int flags, int mask)
|
|
|
|
{
|
|
|
|
return _open3 (file_name, flags, mask);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // !WITH_GLIBC
|
2018-05-29 18:07:46 +00:00
|
|
|
|
2018-08-16 09:43:27 +00:00
|
|
|
#include <mes/eputc.c>
|
2018-10-15 13:44:47 +00:00
|
|
|
#include <mes/oputc.c>
|