diff options
Diffstat (limited to 'viengoos/output-stdio.c')
-rw-r--r-- | viengoos/output-stdio.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/viengoos/output-stdio.c b/viengoos/output-stdio.c new file mode 100644 index 0000000..4b5dc6d --- /dev/null +++ b/viengoos/output-stdio.c @@ -0,0 +1,51 @@ +/* output-stdio.c - A unix stdio output driver. + Copyright (C) 2007 Free Software Foundation, Inc. + Written by Neal H. Walfield <neal@gnu.org>. + + This file is part of the GNU Hurd. + + The GNU Hurd 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 2, or (at + your option) any later version. + + The GNU Hurd 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 this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ + +#if HAVE_CONFIG_H +#include <config.h> +#endif + +#include "output.h" + +#include <stdio.h> +#include <unistd.h> + +static void +stdio_putchar (int chr) +{ + char c[1] = { chr }; + write (1, &c, 1); +} + + +struct output_driver stdio_output = + { + "stdio", + 0, /* init */ + 0, /* deinit */ + stdio_putchar + }; + +/* A list of all output drivers, terminated with a null pointer. */ +struct output_driver *output_drivers[] = + { + &stdio_output, + 0 + }; |