128 for (i = 0; i < sizeof_buf; i++)
156 file->
to_write (file, buf, strlen (buf));
187 _(
"ui_file_data: bad magic number"));
214 file->
to_put (file, write, dest);
222 file->
to_write (file, buf, length_buf);
242 return file->
to_read (file, buf, length_buf);
248 return file->
to_fseek (file, offset, whence);
353 acc.
buffer = xstrdup (
"");
362 struct obstack *obstack = (
struct obstack *) context;
364 obstack_grow (obstack, buffer, length);
372 *length = obstack_object_size (obstack);
373 obstack_1grow (obstack,
'\0');
374 return obstack_finish (obstack);
420 _(
"mem_file_delete: bad magic number"));
421 if (stream->
buffer != NULL)
439 _(
"mem_file_rewind: bad magic number"));
452 _(
"mem_file_put: bad magic number"));
466 _(
"mem_file_write: bad magic number"));
467 if (stream->
buffer == NULL)
472 memcpy (stream->
buffer, buffer, length_buffer);
521 stdio->
fd = fileno (file);
541 _(
"stdio_file_delete: bad magic number"));
544 fclose (stdio->
file);
556 _(
"stdio_file_flush: bad magic number"));
557 fflush (stdio->
file);
567 _(
"stdio_file_read: bad magic number"));
575 FD_SET (stdio->
fd, &readfds);
576 if (
gdb_select (stdio->
fd + 1, &readfds, NULL, NULL, NULL) == -1)
580 return read (stdio->
fd, buf, length_buf);
590 _(
"stdio_file_write: bad magic number"));
592 if (fwrite (buf, length_buf, 1, stdio->
file))
600 const char *buf,
long length_buf)
616 if (write (stdio->
fd, buf, length_buf))
629 _(
"stdio_file_fputs: bad magic number"));
631 if (fputs (linebuffer, stdio->
file))
644 _(
"stdio_file_isatty: bad magic number"));
645 return (isatty (stdio->
fd));
655 _(
"stdio_file_fseek: bad magic number"));
657 return fseek (stdio->
file, offset, whence);
665 stderr_file_write (
struct ui_file *
file,
const char *buf,
long length_buf)
675 stderr_file_fputs (
const char *linebuffer,
struct ui_file *
file)
751 struct ui_file *two,
int close_two)
776 _(
"tee_file_delete: bad magic number"));
792 _(
"tee_file_flush: bad magic number"));
804 _(
"tee_file_write: bad magic number"));
816 _(
"tee_file_fputs: bad magic number"));
828 _(
"tee_file_isatty: bad magic number"));
ssize_t read(int fd, void *buf, size_t count)
static ui_file_isatty_ftype stdio_file_isatty
static ui_file_isatty_ftype null_file_isatty
static ui_file_fputs_ftype stdio_file_fputs
static ui_file_write_ftype null_file_write
void set_ui_file_isatty(struct ui_file *file, ui_file_isatty_ftype *isatty_ptr)
ui_file_isatty_ftype * to_isatty
static void do_ui_file_xstrdup(void *context, const char *buffer, long length)
ui_file_fputs_ftype * to_fputs
static int stdio_file_magic
static ui_file_delete_ftype null_file_delete
static ui_file_rewind_ftype null_file_rewind
void( ui_file_fputs_ftype)(const char *, struct ui_file *stream)
void fputs_unfiltered(const char *buf, struct ui_file *file)
ui_file_write_ftype * to_write
static void do_ui_file_obsavestring(void *context, const char *buffer, long length)
void( ui_file_delete_ftype)(struct ui_file *stream)
int ui_file_isatty(struct ui_file *file)
static ui_file_write_ftype tee_file_write
char * ui_file_xstrdup(struct ui_file *file, long *length)
void ui_file_delete(struct ui_file *file)
void ui_file_put(struct ui_file *file, ui_file_put_method_ftype *write, void *dest)
void set_ui_file_read(struct ui_file *file, ui_file_read_ftype *read_ptr)
struct ui_file * gdb_stdout
struct ui_file * gdb_fopen(const char *name, const char *mode)
void internal_error(const char *file, int line, const char *fmt,...)
static ui_file_put_ftype mem_file_put
void( ui_file_write_ftype)(struct ui_file *stream, const char *buf, long length_buf)
static ui_file_read_ftype null_file_read
static ui_file_write_ftype null_file_write_async_safe
FILE * gdb_fopen_cloexec(const char *filename, const char *opentype)
int ui_file_fseek(struct ui_file *file, long offset, int whence)
static ui_file_write_ftype stdio_file_write
void set_ui_file_rewind(struct ui_file *file, ui_file_rewind_ftype *rewind_ptr)
static ui_file_isatty_ftype tee_file_isatty
static ui_file_flush_ftype tee_file_flush
struct ui_file * stderr_fileopen(void)
ui_file_write_async_safe_ftype * to_write_async_safe
static ui_file_flush_ftype stdio_file_flush
static ui_file_delete_ftype mem_file_delete
static ui_file_rewind_ftype mem_file_rewind
void set_ui_file_flush(struct ui_file *file, ui_file_flush_ftype *flush_ptr)
void ui_file_write_async_safe(struct ui_file *file, const char *buf, long length_buf)
static ui_file_fseek_ftype null_file_fseek
struct ui_file * ui_file_new(void)
void set_ui_file_fseek(struct ui_file *file, ui_file_fseek_ftype *fseek_ptr)
char * ui_file_obsavestring(struct ui_file *file, struct obstack *obstack, long *length)
ui_file_delete_ftype * to_delete
ui_file_rewind_ftype * to_rewind
long( ui_file_read_ftype)(struct ui_file *stream, char *buf, long length_buf)
int( ui_file_fseek_ftype)(struct ui_file *stream, long offset, int whence)
void( ui_file_flush_ftype)(struct ui_file *stream)
static ui_file_write_ftype mem_file_write
int gdb_select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
struct ui_file * tee_file_new(struct ui_file *one, int close_one, struct ui_file *two, int close_two)
ui_file_put_ftype * to_put
static int mem_file_magic
static ui_file_write_async_safe_ftype stdio_file_write_async_safe
struct ui_file * mem_fileopen(void)
void ui_file_write_for_put(void *data, const char *buffer, long length_buffer)
ui_file_fseek_ftype * to_fseek
void( ui_file_put_ftype)(struct ui_file *stream, ui_file_put_method_ftype *method, void *context)
static int tee_file_magic
PTR xrealloc(PTR ptr, size_t size)
void set_ui_file_write_async_safe(struct ui_file *file, ui_file_write_async_safe_ftype *write_async_safe_ptr)
static struct ui_file * stdio_file_new(FILE *file, int close_p)
static ui_file_fseek_ftype stdio_file_fseek
int( ui_file_isatty_ftype)(struct ui_file *stream)
ui_file_flush_ftype * to_flush
static ui_file_read_ftype stdio_file_read
void set_ui_file_data(struct ui_file *file, void *data, ui_file_delete_ftype *delete_ptr)
void set_ui_file_fputs(struct ui_file *file, ui_file_fputs_ftype *fputs_ptr)
void ui_file_write(struct ui_file *file, const char *buf, long length_buf)
long ui_file_read(struct ui_file *file, char *buf, long length_buf)
static ui_file_flush_ftype null_file_flush
static ui_file_fputs_ftype null_file_fputs
static struct ui_file * mem_file_new(void)
static ui_file_delete_ftype stdio_file_delete
void ui_file_rewind(struct ui_file *file)
void( ui_file_write_async_safe_ftype)(struct ui_file *stream, const char *buf, long length_buf)
void * ui_file_data(struct ui_file *file)
static ui_file_put_ftype null_file_put
static ui_file_delete_ftype tee_file_delete
void gdb_flush(struct ui_file *file)
struct ui_file * stdio_fileopen(FILE *file)
void set_ui_file_write(struct ui_file *file, ui_file_write_ftype *write_ptr)
void( ui_file_rewind_ftype)(struct ui_file *stream)
void set_ui_file_put(struct ui_file *file, ui_file_put_ftype *put_ptr)
ui_file_read_ftype * to_read
static ui_file_fputs_ftype tee_file_fputs
void( ui_file_put_method_ftype)(void *object, const char *buffer, long length_buffer)