X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=src%2Fstream.h;h=0ea398e377fc98bf561e629ac9ce4434e4527fdc;hb=5a06246277a255fe6e0e465ce0f190541b7b0e16;hp=1d7f131559cdee04be2321a3792c1829bfbd2196;hpb=a8f0931a13cd86f4176a3482a6dfc5353defde9d;p=rodin%2Fchimara.git diff --git a/src/stream.h b/src/stream.h index 1d7f131..0ea398e 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,18 +29,24 @@ 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); + gchar *style; /* Name of the current style */ +}; +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