X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=src%2Fstream.h;h=578b1403ba8e3a68edd2dfb3ddec7c9b23ce32a7;hb=53fe9495a46d16106fa91cfa589e312e882428dd;hp=3fd4fcba07717fee0ec1b74f890d4cb0a31811a2;hpb=0b8b3b9c20937f7b522274ad83739816d8ef21e3;p=rodin%2Fchimara.git diff --git a/src/stream.h b/src/stream.h index 3fd4fcb..578b140 100644 --- a/src/stream.h +++ b/src/stream.h @@ -9,14 +9,19 @@ enum StreamType { STREAM_TYPE_WINDOW, STREAM_TYPE_MEMORY, - STREAM_TYPE_FILE, - STREAM_TYPE_UNICODE_MEMORY, - STREAM_TYPE_UNICODE_FILE + STREAM_TYPE_FILE }; +/** + * glk_stream_struct: + * + * This is an opaque structure (see + * Opaque Structures and should not be accessed directly. + */ struct glk_stream_struct { - glui32 rock; + /*< private >*/ + glui32 magic, rock; /* Pointer to the list node in the global stream list that contains this stream */ GList* stream_list; @@ -24,15 +29,22 @@ struct glk_stream_struct glui32 file_mode; glui32 read_count; glui32 write_count; - enum StreamType stream_type; + enum StreamType type; /* Specific to window stream: the window this stream is connected to */ winid_t window; + /* For memory and file streams */ + gboolean unicode; /* Specific to memory streams */ - gchar *memory_buffer; - glui32 *memory_buffer_unicode; - glui32 buffer_len; + gchar *buffer; + glui32 *ubuffer; + glui32 mark; + glui32 buflen; + /* Specific to file streams */ + FILE *file_pointer; + gboolean binary; + gchar *filename; /* Displayable filename in UTF-8 for error handling */ }; -strid_t window_stream_new(winid_t window); - +G_GNUC_INTERNAL strid_t window_stream_new(winid_t window); +G_GNUC_INTERNAL void stream_close_common(strid_t str, stream_result_t *result); #endif