libpurple/circularbuffer.h

Mon, 30 Jun 2025 14:22:13 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Mon, 30 Jun 2025 14:22:13 -0500
changeset 43269
1523eab3b5a0
parent 42656
df9aafbae930
permissions
-rw-r--r--

Update the flatpak to gnome 48 and to the matching birb version

The birb version was missed here when it was updated.

Testing Done:
Built the flatpak with the instructions in the readme.

Reviewed at https://reviews.imfreedom.org/r/4038/

42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42400
diff changeset
1 /*
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42400
diff changeset
2 * Purple - Internet Messaging Library
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42400
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42400
diff changeset
4 *
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42400
diff changeset
5 * Purple is the legal property of its developers, whose names are too numerous
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42400
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
7 * source distribution.
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
8 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42400
diff changeset
9 * This library is free software; you can redistribute it and/or modify it
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42400
diff changeset
10 * under the terms of the GNU General Public License as published by the Free
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42400
diff changeset
11 * Software Foundation; either version 2 of the License, or (at your option)
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42400
diff changeset
12 * any later version.
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
13 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42400
diff changeset
14 * This library is distributed in the hope that it will be useful, but WITHOUT
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42400
diff changeset
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42400
diff changeset
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42400
diff changeset
17 * more details.
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
18 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42400
diff changeset
19 * You should have received a copy of the GNU General Public License along with
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42400
diff changeset
20 * this library; if not, see <https://www.gnu.org/licenses/>.
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
21 */
35487
494f09f7f331 Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents: 35436
diff changeset
22
40474
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 39978
diff changeset
23 #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 39978
diff changeset
24 # error "only <purple.h> may be included directly"
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 39978
diff changeset
25 #endif
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 39978
diff changeset
26
35487
494f09f7f331 Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents: 35436
diff changeset
27 #ifndef PURPLE_CIRCULAR_BUFFER_H
494f09f7f331 Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents: 35436
diff changeset
28 #define PURPLE_CIRCULAR_BUFFER_H
35433
8dcae6cd6628 Add section blocks for account.h to connection.h
Ankit Vani <a@nevitus.org>
parents: 35397
diff changeset
29
14013
86dac5633bd9 [gaim-migrate @ 16496]
Mark Doliner <markdoliner@pidgin.im>
parents: 13233
diff changeset
30 #include <glib.h>
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
31 #include <glib-object.h>
13230
44b216532ea2 [gaim-migrate @ 15594]
Mark Doliner <markdoliner@pidgin.im>
parents: 13213
diff changeset
32
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
33 #include "purpleversion.h"
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
34
39661
c8f98b167882 Change some libpurple object to GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39380
diff changeset
35 G_BEGIN_DECLS
13230
44b216532ea2 [gaim-migrate @ 15594]
Mark Doliner <markdoliner@pidgin.im>
parents: 13213
diff changeset
36
42656
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42612
diff changeset
37 /**
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42612
diff changeset
38 * PurpleCircularBuffer:
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42612
diff changeset
39 *
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42612
diff changeset
40 * A circular buffer implementation.
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42612
diff changeset
41 *
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42612
diff changeset
42 * Since: 3.0
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42612
diff changeset
43 */
39661
c8f98b167882 Change some libpurple object to GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39380
diff changeset
44 #define PURPLE_TYPE_CIRCULAR_BUFFER (purple_circular_buffer_get_type())
42400
64c85dc25cd4 Tag some miscellanous Since and exports
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42391
diff changeset
45
64c85dc25cd4 Tag some miscellanous Since and exports
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42391
diff changeset
46 PURPLE_AVAILABLE_IN_3_0
39661
c8f98b167882 Change some libpurple object to GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39380
diff changeset
47 G_DECLARE_DERIVABLE_TYPE(PurpleCircularBuffer, purple_circular_buffer, PURPLE,
c8f98b167882 Change some libpurple object to GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39380
diff changeset
48 CIRCULAR_BUFFER, GObject)
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
49
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
50 struct _PurpleCircularBufferClass {
34691
3acdd397a9c1 Removed reserved fields from instance structs.
Ankit Vani <a@nevitus.org>
parents: 34570
diff changeset
51 /*< private >*/
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
52 GObjectClass parent;
13230
44b216532ea2 [gaim-migrate @ 15594]
Mark Doliner <markdoliner@pidgin.im>
parents: 13213
diff changeset
53
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
54 void (*grow)(PurpleCircularBuffer *buffer, gsize len);
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
55 void (*append)(PurpleCircularBuffer *buffer, gconstpointer src, gsize len);
39380
3088866c22f4 libpurple: Port almost self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents: 38715
diff changeset
56 gsize (*max_read_size)(PurpleCircularBuffer *buffer);
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
57 gboolean (*mark_read)(PurpleCircularBuffer *buffer, gsize len);
13230
44b216532ea2 [gaim-migrate @ 15594]
Mark Doliner <markdoliner@pidgin.im>
parents: 13213
diff changeset
58
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
59 void (*purple_reserved1)(void);
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
60 void (*purple_reserved2)(void);
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
61 void (*purple_reserved3)(void);
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
62 void (*purple_reserved4)(void);
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
63 };
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
64
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
65 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
66 * purple_circular_buffer_new:
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35071
diff changeset
67 * @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
68 * is appended and every time more space is needed. Pass in
8dcf2385a862 [gaim-migrate @ 15576]
Mark Doliner <markdoliner@pidgin.im>
parents: 13201
diff changeset
69 * "0" to use the default of 256 bytes.
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
70 *
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
71 * 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
72 * 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
73 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35071
diff changeset
74 * Returns: The new PurpleCircularBuffer.
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
75 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
76 * Since: 3.0
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
77 */
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
78 PURPLE_AVAILABLE_IN_3_0
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
79 PurpleCircularBuffer *purple_circular_buffer_new(gsize growsize);
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
80
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
81 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
82 * purple_circular_buffer_append:
38715
98d5a19c04a9 Fix inconsistent parameter names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 37094
diff changeset
83 * @buffer: The PurpleCircularBuffer to which to append the data
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35071
diff changeset
84 * @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
85 * @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
86 *
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
87 * 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
88 * buffer to fit the added data, if needed.
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
89 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
90 * Since: 3.0
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
91 */
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
92 PURPLE_AVAILABLE_IN_3_0
38715
98d5a19c04a9 Fix inconsistent parameter names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 37094
diff changeset
93 void purple_circular_buffer_append(PurpleCircularBuffer *buffer, gconstpointer src, gsize len);
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
94
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
95 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
96 * purple_circular_buffer_get_max_read:
38715
98d5a19c04a9 Fix inconsistent parameter names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 37094
diff changeset
97 * @buffer: the PurpleCircularBuffer for which to determine the maximum
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
98 * 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
99 *
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
100 * 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
101 * PurpleCircularBuffer.
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
102 * 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
103 * 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
104 * more data is available to read.
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
105 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35071
diff changeset
106 * Returns: the number of bytes that can be read from the PurpleCircularBuffer
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
107 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
108 * Since: 3.0
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
109 */
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
110 PURPLE_AVAILABLE_IN_3_0
39380
3088866c22f4 libpurple: Port almost self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents: 38715
diff changeset
111 gsize purple_circular_buffer_get_max_read(PurpleCircularBuffer *buffer);
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
112
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
113 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
114 * purple_circular_buffer_mark_read:
38715
98d5a19c04a9 Fix inconsistent parameter names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 37094
diff changeset
115 * @buffer: The PurpleCircularBuffer to mark bytes read from
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35071
diff changeset
116 * @len: The number of bytes to mark as read
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
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 * 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
119 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35071
diff changeset
120 * 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
121 * otherwise.
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
122 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
123 * Since: 3.0
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
124 */
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
125 PURPLE_AVAILABLE_IN_3_0
38715
98d5a19c04a9 Fix inconsistent parameter names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 37094
diff changeset
126 gboolean purple_circular_buffer_mark_read(PurpleCircularBuffer *buffer, gsize len);
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
127
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
128 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
129 * purple_circular_buffer_grow:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
130 * @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
131 * @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
132 *
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
133 * 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
134 * least 'len' bytes.
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
135 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
136 * Since: 3.0
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 */
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
138 PURPLE_AVAILABLE_IN_3_0
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
139 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
140
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 * 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
143 * @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
144 *
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 * 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
146 * 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
147 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35071
diff changeset
148 * Returns: The grow size of the buffer.
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
149 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
150 * Since: 3.0
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
151 */
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
152 PURPLE_AVAILABLE_IN_3_0
39380
3088866c22f4 libpurple: Port almost self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents: 38715
diff changeset
153 gsize purple_circular_buffer_get_grow_size(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
154
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 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
156 * 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
157 * @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
158 *
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
159 * 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
160 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35071
diff changeset
161 * Returns: The number of bytes that contain unread data.
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
162 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
163 * Since: 3.0
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 */
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
165 PURPLE_AVAILABLE_IN_3_0
39380
3088866c22f4 libpurple: Port almost self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents: 38715
diff changeset
166 gsize purple_circular_buffer_get_used(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
167
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
168 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
169 * 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
170 * @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
171 *
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
172 * 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
173 * 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
174 * 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
175 * 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
176 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35071
diff changeset
177 * Returns: The output pointer for the buffer.
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
178 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
179 * Since: 3.0
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
180 */
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
181 PURPLE_AVAILABLE_IN_3_0
39380
3088866c22f4 libpurple: Port almost self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents: 38715
diff changeset
182 const gchar *purple_circular_buffer_get_output(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
183
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
184 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
185 * purple_circular_buffer_reset:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
186 * @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
187 *
39975
f691f3812205 Add some unit tests for the circular buffer.. they're not great, was just trying to test somethings
Gary Kramlich <grim@reaperworld.com>
parents: 39380
diff changeset
188 * Resets the buffer input and output pointers to the start of the buffer.
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
189 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
190 * Since: 3.0
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
191 */
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41686
diff changeset
192 PURPLE_AVAILABLE_IN_3_0
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
193 void purple_circular_buffer_reset(PurpleCircularBuffer *buffer);
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
194
32787
7072f190d6ad Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 20147
diff changeset
195 G_END_DECLS
13201
8c224ef70efa [gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
196
34529
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
197 #endif /* PURPLE_CIRCULAR_BUFFER_H */
68cf25486001 GObjectify PurpleCircBuffer as PurpleCircularBuffer (from gobjectification branch)
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
198

mercurial