2010-05-15 Michael Snyder <msnyder@vmware.com>
[deliverable/binutils-gdb.git] / gdb / ui-file.h
index 989c343dfa096963e01410910e3a7ad316ec1c9b..bb94f4bdd37df4453eb92c9d634ab238ca9e7485 100644 (file)
@@ -1,11 +1,12 @@
 /* UI_FILE - a generic STDIO like output stream.
-   Copyright 1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2007, 2008, 2009, 2010
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    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,
    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-1307, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef UI_FILE_H
 #define UI_FILE_H
 
+struct obstack;
 struct ui_file;
 
 /* Create a generic ui_file object with null methods. */
@@ -41,6 +41,9 @@ extern void set_ui_file_write (struct ui_file *stream, ui_file_write_ftype *fput
 typedef void (ui_file_fputs_ftype) (const char *, struct ui_file * stream);
 extern void set_ui_file_fputs (struct ui_file *stream, ui_file_fputs_ftype * fputs);
 
+typedef long (ui_file_read_ftype) (struct ui_file * stream, char *buf, long length_buf);
+extern void set_ui_file_read (struct ui_file *stream, ui_file_read_ftype *fread);
+
 typedef int (ui_file_isatty_ftype) (struct ui_file * stream);
 extern void set_ui_file_isatty (struct ui_file *stream, ui_file_isatty_ftype * isatty);
 
@@ -72,11 +75,16 @@ extern void ui_file_put (struct ui_file *src, ui_file_put_method_ftype *write, v
 
 /* Returns a freshly allocated buffer containing the entire contents
    of FILE (as determined by ui_file_put()) with a NUL character
-   appended.  LENGTH is set to the size of the buffer minus that
-   appended NUL. */
+   appended.  LENGTH, if not NULL, is set to the size of the buffer
+   minus that appended NUL. */
 extern char *ui_file_xstrdup (struct ui_file *file, long *length);
 
+/* Similar to ui_file_xstrdup, but return a new string allocated on
+   OBSTACK.  */
+extern char *ui_file_obsavestring (struct ui_file *file,
+                                  struct obstack *obstack, long *length);
 
+extern long ui_file_read (struct ui_file *file, char *buf, long length_buf);
 
 /* Create/open a memory based file. Can be used as a scratch buffer
    for collecting output. */
This page took 0.026051 seconds and 4 git commands to generate.