libpurple/circularbuffer.h

Mon, 03 Feb 2014 22:40:31 +0530

author
Ankit Vani <a@nevitus.org>
date
Mon, 03 Feb 2014 22:40:31 +0530
branch
gtkdoc-conversion
changeset 35436
a69d2e5604c5
parent 35433
8dcae6cd6628
child 35487
494f09f7f331
child 37058
04ebc4a2fac7
permissions
-rw-r--r--

Swap @title and @short_description roles

20147
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
1 /* Purple is the legal property of its developers, whose names are too numerous
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
2 * to list here. Please refer to the COPYRIGHT file distributed with this
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
3 * source distribution.
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
4 *
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
7 * the Free Software Foundation; either version 2 of the License, or
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
8 * (at your option) any later version.
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
9 *
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
13 * GNU General Public License for more details.
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
14 *
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
16 * along with this program; if not, write to the Free Software
19859
71d37b57eff2 The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 15884
diff changeset
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
18 */
35433
8dcae6cd6628 Add section blocks for account.h to connection.h
Ankit Vani <a@nevitus.org>
parents: 35397
diff changeset
19 /**
8dcae6cd6628 Add section blocks for account.h to connection.h
Ankit Vani <a@nevitus.org>
parents: 35397
diff changeset
20 * SECTION:circularbuffer
8dcae6cd6628 Add section blocks for account.h to connection.h
Ankit Vani <a@nevitus.org>
parents: 35397
diff changeset
21 * @section_id: libpurple-circularbuffer
35436
a69d2e5604c5 Swap @title and @short_description roles
Ankit Vani <a@nevitus.org>
parents: 35433
diff changeset
22 * @short_description: <filename>circularbuffer.h</filename>
a69d2e5604c5 Swap @title and @short_description roles
Ankit Vani <a@nevitus.org>
parents: 35433
diff changeset
23 * @title: Buffer Utility Functions
35433
8dcae6cd6628 Add section blocks for account.h to connection.h
Ankit Vani <a@nevitus.org>
parents: 35397
diff changeset
24 */
8dcae6cd6628 Add section blocks for account.h to connection.h
Ankit Vani <a@nevitus.org>
parents: 35397
diff changeset
25
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
26 #ifndef PURPLE_CIRCULAR_BUFFER_H
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
27 #define PURPLE_CIRCULAR_BUFFER_H
14013
86dac5633bd9 [gaim-migrate @ 16496]
Mark Doliner <markdoliner@pidgin.im>
parents: 13233
diff changeset
28
86dac5633bd9 [gaim-migrate @ 16496]
Mark Doliner <markdoliner@pidgin.im>
parents: 13233
diff changeset
29 #include <glib.h>
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
30 #include <glib-object.h>
13230
44b216532ea2 [gaim-migrate @ 15594]
Mark Doliner <markdoliner@pidgin.im>
parents: 13213
diff changeset
31
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
32 #define PURPLE_TYPE_CIRCULAR_BUFFER (purple_circular_buffer_get_type())
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
33 #define PURPLE_CIRCULAR_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_CIRCULAR_BUFFER, PurpleCircularBuffer))
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
34 #define PURPLE_CIRCULAR_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_CIRCULAR_BUFFER, PurpleCircularBufferClass))
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
35 #define PURPLE_IS_CIRCULAR_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_CIRCULAR_BUFFER))
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
36 #define PURPLE_IS_CIRCULAR_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_CIRCULAR_BUFFER))
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
37 #define PURPLE_CIRCULAR_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_CIRCULAR_BUFFER, PurpleCircularBufferClass))
13230
44b216532ea2 [gaim-migrate @ 15594]
Mark Doliner <markdoliner@pidgin.im>
parents: 13213
diff changeset
38
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
39 typedef struct _PurpleCircularBuffer PurpleCircularBuffer;
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
40 typedef struct _PurpleCircularBufferClass PurpleCircularBufferClass;
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
41
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
42 struct _PurpleCircularBuffer {
34691
3acdd397a9c1 Removed reserved fields from instance structs.
Ankit Vani <a@nevitus.org>
parents: 34570
diff changeset
43 /*< private >*/
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
44 GObject parent;
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
45 };
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
46
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
47 struct _PurpleCircularBufferClass {
34691
3acdd397a9c1 Removed reserved fields from instance structs.
Ankit Vani <a@nevitus.org>
parents: 34570
diff changeset
48 /*< private >*/
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
49 GObjectClass parent;
13230
44b216532ea2 [gaim-migrate @ 15594]
Mark Doliner <markdoliner@pidgin.im>
parents: 13213
diff changeset
50
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
51 void (*grow)(PurpleCircularBuffer *buffer, gsize len);
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
52 void (*append)(PurpleCircularBuffer *buffer, gconstpointer src, gsize len);
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
53 gsize (*max_read_size)(const PurpleCircularBuffer *buffer);
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
54 gboolean (*mark_read)(PurpleCircularBuffer *buffer, gsize len);
13230
44b216532ea2 [gaim-migrate @ 15594]
Mark Doliner <markdoliner@pidgin.im>
parents: 13213
diff changeset
55
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
56 void (*purple_reserved1)(void);
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
57 void (*purple_reserved2)(void);
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
58 void (*purple_reserved3)(void);
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
59 void (*purple_reserved4)(void);
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
60 };
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
61
32787
7072f190d6ad Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 20147
diff changeset
62 G_BEGIN_DECLS
7072f190d6ad Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 20147
diff changeset
63
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
64 GType purple_circular_buffer_get_type(void);
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
65
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
66 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
67 * purple_circular_buffer_new:
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35071
diff changeset
68 * @growsize: The amount that the buffer should grow the first time data
13213
8dcf2385a862 [gaim-migrate @ 15576]
Mark Doliner <markdoliner@pidgin.im>
parents: 13201
diff changeset
69 * is appended and every time more space is needed. Pass in
8dcf2385a862 [gaim-migrate @ 15576]
Mark Doliner <markdoliner@pidgin.im>
parents: 13201
diff changeset
70 * "0" to use the default of 256 bytes.
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
71 *
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
72 * Creates a new circular buffer. This will not allocate any memory for the
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
73 * actual buffer until data is appended to it.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
74 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35071
diff changeset
75 * Returns: The new PurpleCircularBuffer.
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
76 */
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
77 PurpleCircularBuffer *purple_circular_buffer_new(gsize growsize);
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
78
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
79 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
80 * purple_circular_buffer_append:
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35071
diff changeset
81 * @buf: The PurpleCircularBuffer to which to append the data
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35071
diff changeset
82 * @src: pointer to the data to copy into the buffer
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35071
diff changeset
83 * @len: number of bytes to copy into the buffer
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
84 *
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
85 * Append data to the PurpleCircularBuffer. This will grow the internal
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
86 * buffer to fit the added data, if needed.
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
87 */
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
88 void purple_circular_buffer_append(PurpleCircularBuffer *buf, gconstpointer src, gsize len);
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
89
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
90 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
91 * purple_circular_buffer_get_max_read:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
92 * @buf: the PurpleCircularBuffer for which to determine the maximum
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
93 * contiguous bytes that can be read.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
94 *
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
95 * Determine the maximum number of contiguous bytes that can be read from the
35071
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
96 * PurpleCircularBuffer.
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
97 * Note: This may not be the total number of bytes that are buffered - a
35057
312f92e61d21 Fixed some doc comments
Ankit Vani <a@nevitus.org>
parents: 34691
diff changeset
98 * subsequent call after calling purple_circular_buffer_mark_read() may indicate
312f92e61d21 Fixed some doc comments
Ankit Vani <a@nevitus.org>
parents: 34691
diff changeset
99 * more data is available to read.
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
100 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35071
diff changeset
101 * Returns: the number of bytes that can be read from the PurpleCircularBuffer
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
102 */
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
103 gsize purple_circular_buffer_get_max_read(const PurpleCircularBuffer *buf);
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
104
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
105 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
106 * purple_circular_buffer_mark_read:
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35071
diff changeset
107 * @buf: The PurpleCircularBuffer to mark bytes read from
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35071
diff changeset
108 * @len: The number of bytes to mark as read
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
109 *
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
110 * Mark the number of bytes that have been read from the buffer.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
111 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35071
diff changeset
112 * Returns: TRUE if we successfully marked the bytes as having been read, FALSE
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
113 * otherwise.
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
114 */
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
115 gboolean purple_circular_buffer_mark_read(PurpleCircularBuffer *buf, gsize len);
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
116
35071
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
117 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
118 * purple_circular_buffer_grow:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
119 * @buffer: The PurpleCircularBuffer to grow.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
120 * @len: The number of bytes the buffer should be able to hold.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
121 *
35071
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
122 * Increases the buffer size by a multiple of grow size, so that it can hold at
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
123 * least 'len' bytes.
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
124 */
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
125 void purple_circular_buffer_grow(PurpleCircularBuffer *buffer, gsize len);
35071
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
126
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
127 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
128 * purple_circular_buffer_get_grow_size:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
129 * @buffer: The PurpleCircularBuffer from which to get grow size.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
130 *
35071
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
131 * Returns the number of bytes by which the buffer grows when more space is
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
132 * needed.
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
133 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35071
diff changeset
134 * Returns: The grow size of the buffer.
35071
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
135 */
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
136 gsize purple_circular_buffer_get_grow_size(const PurpleCircularBuffer *buffer);
35071
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
137
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
138 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
139 * purple_circular_buffer_get_used:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
140 * @buffer: The PurpleCircularBuffer from which to get used count.
35071
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
141 *
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
142 * Returns the number of bytes of this buffer that contain unread data.
35071
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
143 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35071
diff changeset
144 * Returns: The number of bytes that contain unread data.
35071
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
145 */
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
146 gsize purple_circular_buffer_get_used(const PurpleCircularBuffer *buffer);
35071
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
147
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
148 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
149 * purple_circular_buffer_get_output:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
150 * @buffer: The PurpleCircularBuffer from which to get the output pointer.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
151 *
35071
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
152 * Returns the output pointer of the buffer, where unread data is available.
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
153 * Use purple_circular_buffer_get_max_read() to determine the number of
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
154 * contiguous bytes that can be read from this output. After reading the data,
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
155 * call purple_circular_buffer_mark_read() to mark the retrieved data as read.
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
156 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35071
diff changeset
157 * Returns: The output pointer for the buffer.
35071
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
158 */
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
159 const gchar *purple_circular_buffer_get_output(const PurpleCircularBuffer *buffer);
35071
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
160
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
161 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
162 * purple_circular_buffer_reset:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
163 * @buffer: The PurpleCircularBuffer to reset.
35071
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
164 *
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
165 * Resets the buffer contents.
35071
1eedcfcb91ef Added doc comments for new PurpleCircularBuffer functions. Removed purple_circular_buffer_get_input from public API.
Ankit Vani <a@nevitus.org>
parents: 35057
diff changeset
166 */
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
167 void purple_circular_buffer_reset(PurpleCircularBuffer *buffer);
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
168
32787
7072f190d6ad Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 20147
diff changeset
169 G_END_DECLS
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
170
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
171 #endif /* PURPLE_CIRCULAR_BUFFER_H */
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
172

mercurial