Files openen. Niet getest, omdat het schrijven naar files nog niet
[projects/chimara/chimara.git] / src / stream.h
1 #ifndef STREAM_H
2 #define STREAM_H
3
4 #include <gtk/gtk.h>
5 #include "glk.h"
6 #include "window.h"
7
8 enum StreamType
9 {
10         STREAM_TYPE_WINDOW,
11         STREAM_TYPE_MEMORY,
12         STREAM_TYPE_FILE,
13         STREAM_TYPE_UNICODE_MEMORY,
14         STREAM_TYPE_UNICODE_FILE
15 };
16
17 struct glk_stream_struct
18 {
19         glui32 rock;
20         /* Pointer to the list node in the global stream list that contains this
21         stream */
22         GList* stream_list;
23         /* Stream parameters */
24         glui32 file_mode;
25         glui32 read_count;
26         glui32 write_count;
27         enum StreamType stream_type;
28         /* Specific to window stream: the window this stream is connected to */
29         winid_t window;
30         /* Specific to memory streams */
31         gchar *memory_buffer;
32         glui32 *memory_buffer_unicode;
33         glui32 buffer_len;
34         /* Specific to file streams */
35         FILE *file_pointer;
36         gboolean binary;
37 };
38
39 strid_t window_stream_new(winid_t window);
40
41 #endif