Debian Codegraph @

src/byzanzqueue.h

raw symbols SCIP
1 /* desktop session recorder
2 * Copyright (C) 2009 Benjamin Otte <[email protected]>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 3 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #include <gio/gio.h>
19
20 #ifndef __HAVE_BYZANZ_QUEUE_H__
21 #define __HAVE_BYZANZ_QUEUE_H__
22
23 typedef struct _ByzanzQueue ByzanzQueue;
24 typedef struct _ByzanzQueueClass ByzanzQueueClass;
25
26 #define BYZANZ_QUEUE_FILE_SIZE 16 * 1024 * 1024
27
28 #define BYZANZ_TYPE_QUEUE (byzanz_queue_get_type())
29 #define BYZANZ_IS_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BYZANZ_TYPE_QUEUE))
30 #define BYZANZ_IS_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BYZANZ_TYPE_QUEUE))
31 #define BYZANZ_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BYZANZ_TYPE_QUEUE, ByzanzQueue))
32 #define BYZANZ_QUEUE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BYZANZ_TYPE_QUEUE, ByzanzQueueClass))
33 #define BYZANZ_QUEUE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BYZANZ_TYPE_QUEUE, ByzanzQueueClass))
34
35 struct _ByzanzQueue {
36 GObject object;
37
38 GOutputStream * output; /* stream to use for writing to the queue */
39 GInputStream * input; /* stream to use for reading to the queue */
40
41 volatile int shared_count; /* shared ref count of queue, output and input stream */
42
43 GAsyncQueue * files; /* the files that still need to be processed */
44 guint output_closed:1;/* the output stream is closed. Must take async queue lock to access */
45 guint input_closed:1; /* the input stream is closed. Must take async queue lock to access */
46 };
47
48 struct _ByzanzQueueClass {
49 GObjectClass object_class;
50 };
51
52 GType byzanz_queue_get_type (void) G_GNUC_CONST;
53
54 ByzanzQueue * byzanz_queue_new (void);
55
56 GOutputStream * byzanz_queue_get_output_stream (ByzanzQueue * queue);
57 GInputStream * byzanz_queue_get_input_stream (ByzanzQueue * queue);
58
59
60 #endif /* __HAVE_BYZANZ_QUEUE_H__ */