git: Line endings of README.txt
[projects/chimara/chimara.git] / libchimara / stream.h
index 0ea398e377fc98bf561e629ac9ce4434e4527fdc..33497ceb2d11f36b17cc1afedde5b59cc66fe7e4 100644 (file)
@@ -2,14 +2,18 @@
 #define STREAM_H
 
 #include <gtk/gtk.h>
+#include "chimara-glk-private.h"
 #include "glk.h"
+#include "gi_dispa.h"
 #include "window.h"
+#include "fileref.h"
 
 enum StreamType
 {
        STREAM_TYPE_WINDOW,
        STREAM_TYPE_MEMORY,
-       STREAM_TYPE_FILE
+       STREAM_TYPE_FILE,
+       STREAM_TYPE_RESOURCE
 };
 
 /**
@@ -22,6 +26,7 @@ struct glk_stream_struct
 {
        /*< private >*/
        glui32 magic, rock;
+       gidispatch_rock_t disprock;
        /* Pointer to the list node in the global stream list that contains this
        stream */
        GList* stream_list;
@@ -32,21 +37,30 @@ struct glk_stream_struct
        enum StreamType type;
        /* Specific to window stream: the window this stream is connected to */
        winid_t window;
-       /* For memory and file streams */
+       /* For memory, file, and resource streams */
        gboolean unicode;
-       /* Specific to memory streams */
-       gchar *buffer;
+       /* For file and resource streams */
+       gboolean binary;
+       /* For memory and resource streams */
+       char *buffer;
        glui32 *ubuffer;
        glui32 mark;
+       glui32 endmark;
        glui32 buflen;
+       /* Specific to memory streams */
+       gidispatch_rock_t buffer_rock;
        /* Specific to file streams */
        FILE *file_pointer;
-       gboolean binary;
        gchar *filename; /* Displayable filename in UTF-8 for error handling */
+       glui32 lastop; /* 0, filemode_Write, or filemode_Read */
 
        gchar *style; /* Name of the current style */
+       gchar *glk_style; /* Name of the current glk style override */
+       gboolean hyperlink_mode; /* When turned on, text written to the stream will be a hyperlink */
 };
 
-G_GNUC_INTERNAL strid_t window_stream_new(winid_t window);
+G_GNUC_INTERNAL strid_t file_stream_new(frefid_t fileref, glui32 fmode, glui32 rock, gboolean unicode);
+G_GNUC_INTERNAL strid_t stream_new_common(glui32 rock);
 G_GNUC_INTERNAL void stream_close_common(strid_t str, stream_result_t *result);
+
 #endif