Updated copyright notices for most files.
[deliverable/binutils-gdb.git] / sim / common / callback.c
index 570e294625aeb25f14a3817d36e550a71e988dec..6134055281be002a58a1833309afcef84a037143 100644 (file)
@@ -1,5 +1,5 @@
 /* Remote target callback routines.
-   Copyright 1995, 1996, 1997, 2000, 2002, 2003, 2004
+   Copyright 1995, 1996, 1997, 2000, 2002, 2003, 2004, 2007, 2008
    Free Software Foundation, Inc.
    Contributed by Cygnus Solutions.
 
@@ -7,7 +7,7 @@
 
    This program 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 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -16,8 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with GAS; see the file COPYING.  If not, write to the Free Software
-   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* This file provides a standard way for targets to talk to the host OS
    level.  */
@@ -1137,3 +1136,21 @@ sim_cb_eprintf (host_callback *p, const char *fmt, ...)
   p->evprintf_filtered (p, fmt, ap);
   va_end (ap);
 }
+
+int
+cb_is_stdin (host_callback *cb, int fd)
+{
+  return fdbad (cb, fd) ? 0 : fdmap (cb, fd) == 0;
+}
+
+int
+cb_is_stdout (host_callback *cb, int fd)
+{
+  return fdbad (cb, fd) ? 0 : fdmap (cb, fd) == 1;
+}
+
+int
+cb_is_stderr (host_callback *cb, int fd)
+{
+  return fdbad (cb, fd) ? 0 : fdmap (cb, fd) == 2;
+}
This page took 0.023573 seconds and 4 git commands to generate.