From 79383565aa706681413c09195acb1f3c7ce1ce84 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 15 Oct 2018 15:44:47 +0200 Subject: [PATCH] mescc: Mes C Library: oputs: New function. * lib/mes/oputc.c: New file. * lib/libmes.c: Include it. * include/libmes.h: Declare it. --- include/libmes.h | 1 + lib/libmes.c | 1 + lib/mes/oputc.c | 27 +++++++++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 lib/mes/oputc.c diff --git a/include/libmes.h b/include/libmes.h index 8dd439d7..c22d0181 100644 --- a/include/libmes.h +++ b/include/libmes.h @@ -43,6 +43,7 @@ int isspace (int c); int isxdigit (int c); int _open3 (char const *file_name, int flags, int mask); int _open2 (char const *file_name, int flags); +int oputc (int c); int oputs (char const* s); ssize_t write (int filedes, void const *buffer, size_t size); char *search_path (char const *file_name); diff --git a/lib/libmes.c b/lib/libmes.c index d3266186..77425ff0 100644 --- a/lib/libmes.c +++ b/lib/libmes.c @@ -47,3 +47,4 @@ #endif // POSIX #include +#include diff --git a/lib/mes/oputc.c b/lib/mes/oputc.c new file mode 100644 index 00000000..b16ed3be --- /dev/null +++ b/lib/mes/oputc.c @@ -0,0 +1,27 @@ +/* -*-comment-start: "//";comment-end:""-*- + * GNU Mes --- Maxwell Equations of Software + * Copyright © 2018 Jan (janneke) Nieuwenhuizen + * + * This file is part of GNU Mes. + * + * GNU Mes is free software; you can redistribute it and/or modify it + * 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. + * + * GNU Mes is distributed in the hope that it will be useful, but + * 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 + * along with GNU Mes. If not, see . + */ + +#include + +int +oputc (int c) +{ + return fdputc (c, STDOUT); +}