libpurple/purpletags.h

Sun, 16 Jul 2023 03:24:38 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Sun, 16 Jul 2023 03:24:38 -0500
changeset 42239
a453c0c955e9
parent 42238
48bb3244b5ea
child 42387
d9350cda1556
permissions
-rw-r--r--

Add purple_tags_remove_with_value

This is just a wrapper around purple_tags_remove that builds the tag out of a
name and value.

Testing Done:
Ran the unit tests.

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

41736
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Purple - Internet Messaging Library
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * Purple is the legal property of its developers, whose names are too numerous
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * source distribution.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * (at your option) any later version.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * GNU General Public License for more details.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 * along with this program; if not, see <https://www.gnu.org/licenses/>.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 # error "only <purple.h> may be included directly"
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25 #endif
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 #ifndef PURPLE_TAGS_H
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 #define PURPLE_TAGS_H
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 #include <glib.h>
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 #include <gio/gio.h>
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 #define PURPLE_TYPE_TAGS (purple_tags_get_type())
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34 G_DECLARE_FINAL_TYPE(PurpleTags, purple_tags, PURPLE, TAGS, GObject)
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 /**
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 * PurpleTags:
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 * Tags is an object that can be used to keep track of arbitrary tags on
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 * objects. Tags are simple strings that use the first ':' to delimit a value.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 * For example: `foo` is a tag with just a name and no value, but `foo:bar` is
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 * a tag with a name and value. Please note this distinction when the API calls
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 * for a name versus a tag which would be the name and the value.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 * Since: 3.0.0
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 */
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 G_BEGIN_DECLS
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 /**
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 * purple_tags_new:
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 * Creates a new tags object.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 * Returns: (transfer full): The new tags object.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 * Since: 3.0.0
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 */
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 PurpleTags *purple_tags_new(void);
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 /**
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 * purple_tags_lookup:
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 * @tags: The instance.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 * @name: The name of the tag to check if it exists.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 * @found: (out) (nullable): A return address for a boolean on whether the tag
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 * was found or not.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 * Gets the value of @name if it exists in @tags.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 * If @found is non %NULL, it will be set to %TRUE if @name was found.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72 * Returns: The value of the first tag matching @name. If there is no value,
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 * %NULL is returned.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 * Since: 3.0.0
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76 */
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 const gchar *purple_tags_lookup(PurpleTags *tags, const gchar *name, gboolean *found);
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 /**
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 * purple_tags_get:
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81 * @tags: The instance.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
82 * @name: The name of the tag to get.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
83 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84 * Gets the first tag that matches @name.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
85 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86 * Returns: The value of the first tag matching @name. If there is no value,
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87 * %NULL is returned.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
88 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
89 * Since: 3.0.0
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
90 */
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
91 const gchar *purple_tags_get(PurpleTags *tags, const gchar *name);
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93 /**
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94 * purple_tags_add:
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95 * @tags: The instance.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96 * @tag: The tag data.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
97 *
41908
9d2735c0e848 Don't allow duplicate tags in PurpleTags
Gary Kramlich <grim@reaperworld.com>
parents: 41892
diff changeset
98 * Adds @tag to @tags. If the tag already exists, the existing tag will be
9d2735c0e848 Don't allow duplicate tags in PurpleTags
Gary Kramlich <grim@reaperworld.com>
parents: 41892
diff changeset
99 * replaced.
41736
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
100 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
101 * Since: 3.0.0
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
102 */
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
103 void purple_tags_add(PurpleTags *tags, const gchar *tag);
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
105 /**
41945
fd826d652e7d Add purple_tags_add_with_value to help people not have to construct their own tags
Gary Kramlich <grim@reaperworld.com>
parents: 41908
diff changeset
106 * purple_tags_add_with_value:
fd826d652e7d Add purple_tags_add_with_value to help people not have to construct their own tags
Gary Kramlich <grim@reaperworld.com>
parents: 41908
diff changeset
107 * @tags: The instance.
fd826d652e7d Add purple_tags_add_with_value to help people not have to construct their own tags
Gary Kramlich <grim@reaperworld.com>
parents: 41908
diff changeset
108 * @name: The name of the tag.
fd826d652e7d Add purple_tags_add_with_value to help people not have to construct their own tags
Gary Kramlich <grim@reaperworld.com>
parents: 41908
diff changeset
109 * @value: (nullable): The value of the tag.
fd826d652e7d Add purple_tags_add_with_value to help people not have to construct their own tags
Gary Kramlich <grim@reaperworld.com>
parents: 41908
diff changeset
110 *
fd826d652e7d Add purple_tags_add_with_value to help people not have to construct their own tags
Gary Kramlich <grim@reaperworld.com>
parents: 41908
diff changeset
111 * Formats @name and @value into a tag and adds it to @tags. If the tag already
fd826d652e7d Add purple_tags_add_with_value to help people not have to construct their own tags
Gary Kramlich <grim@reaperworld.com>
parents: 41908
diff changeset
112 * exists, the existing tag will be replaced.
fd826d652e7d Add purple_tags_add_with_value to help people not have to construct their own tags
Gary Kramlich <grim@reaperworld.com>
parents: 41908
diff changeset
113 *
fd826d652e7d Add purple_tags_add_with_value to help people not have to construct their own tags
Gary Kramlich <grim@reaperworld.com>
parents: 41908
diff changeset
114 * Since: 3.0.0
fd826d652e7d Add purple_tags_add_with_value to help people not have to construct their own tags
Gary Kramlich <grim@reaperworld.com>
parents: 41908
diff changeset
115 */
fd826d652e7d Add purple_tags_add_with_value to help people not have to construct their own tags
Gary Kramlich <grim@reaperworld.com>
parents: 41908
diff changeset
116 void purple_tags_add_with_value(PurpleTags *tags, const char *name, const char *value);
fd826d652e7d Add purple_tags_add_with_value to help people not have to construct their own tags
Gary Kramlich <grim@reaperworld.com>
parents: 41908
diff changeset
117
fd826d652e7d Add purple_tags_add_with_value to help people not have to construct their own tags
Gary Kramlich <grim@reaperworld.com>
parents: 41908
diff changeset
118 /**
41736
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
119 * purple_tags_remove:
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
120 * @tags: The instance.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
121 * @tag: The tag data.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
122 *
42239
a453c0c955e9 Add purple_tags_remove_with_value
Gary Kramlich <grim@reaperworld.com>
parents: 42238
diff changeset
123 * Removes @tag from @tags. Note that this is the tag name and value not just
a453c0c955e9 Add purple_tags_remove_with_value
Gary Kramlich <grim@reaperworld.com>
parents: 42238
diff changeset
124 * the name.
41736
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
125 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
126 * Returns: %TRUE if @tag was found and removed, otherwise %FALSE.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
127 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
128 * Since: 3.0.0
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
129 */
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
130 gboolean purple_tags_remove(PurpleTags *tags, const gchar *tag);
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
131
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
132 /**
42239
a453c0c955e9 Add purple_tags_remove_with_value
Gary Kramlich <grim@reaperworld.com>
parents: 42238
diff changeset
133 * purple_tags_remove_with_value:
a453c0c955e9 Add purple_tags_remove_with_value
Gary Kramlich <grim@reaperworld.com>
parents: 42238
diff changeset
134 * @tags: The instance.
a453c0c955e9 Add purple_tags_remove_with_value
Gary Kramlich <grim@reaperworld.com>
parents: 42238
diff changeset
135 * @name: The tag name.
a453c0c955e9 Add purple_tags_remove_with_value
Gary Kramlich <grim@reaperworld.com>
parents: 42238
diff changeset
136 * @value: (nullable): The tag value.
a453c0c955e9 Add purple_tags_remove_with_value
Gary Kramlich <grim@reaperworld.com>
parents: 42238
diff changeset
137 *
a453c0c955e9 Add purple_tags_remove_with_value
Gary Kramlich <grim@reaperworld.com>
parents: 42238
diff changeset
138 * A helper function around [method@Tags.remove] that builds the tag variable
a453c0c955e9 Add purple_tags_remove_with_value
Gary Kramlich <grim@reaperworld.com>
parents: 42238
diff changeset
139 * from @name and @value.
a453c0c955e9 Add purple_tags_remove_with_value
Gary Kramlich <grim@reaperworld.com>
parents: 42238
diff changeset
140 *
a453c0c955e9 Add purple_tags_remove_with_value
Gary Kramlich <grim@reaperworld.com>
parents: 42238
diff changeset
141 * Returns: %TRUE if a tag was found and removed, otherwise %FALSE.
a453c0c955e9 Add purple_tags_remove_with_value
Gary Kramlich <grim@reaperworld.com>
parents: 42238
diff changeset
142 *
a453c0c955e9 Add purple_tags_remove_with_value
Gary Kramlich <grim@reaperworld.com>
parents: 42238
diff changeset
143 * Since: 3.0.0
a453c0c955e9 Add purple_tags_remove_with_value
Gary Kramlich <grim@reaperworld.com>
parents: 42238
diff changeset
144 */
a453c0c955e9 Add purple_tags_remove_with_value
Gary Kramlich <grim@reaperworld.com>
parents: 42238
diff changeset
145 gboolean purple_tags_remove_with_value(PurpleTags *tags, const char *name, const char *value);
a453c0c955e9 Add purple_tags_remove_with_value
Gary Kramlich <grim@reaperworld.com>
parents: 42238
diff changeset
146
a453c0c955e9 Add purple_tags_remove_with_value
Gary Kramlich <grim@reaperworld.com>
parents: 42238
diff changeset
147 /**
41736
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
148 * purple_tags_get_count:
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
149 * @tags: The instance.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
150 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
151 * Gets the number of tags in @tags.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
152 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
153 * Returns: The number of tags that @tags is keeping track of.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
154 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
155 * Since: 3.0.0
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
156 */
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
157 guint purple_tags_get_count(PurpleTags *tags);
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
158
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
159 /**
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
160 * purple_tags_get_all:
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
161 * @tags: The instance.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
162 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
163 * Gets a list of all the tags.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
164 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
165 * Returns: (transfer none) (element-type utf8): The list of all the tags.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
166 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
167 * Since: 3.0.0
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
168 */
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
169 GList *purple_tags_get_all(PurpleTags *tags);
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
170
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
171 /**
42238
48bb3244b5ea Add purple_tags_get_all_with_name
Gary Kramlich <grim@reaperworld.com>
parents: 41945
diff changeset
172 * purple_tags_get_all_with_name:
48bb3244b5ea Add purple_tags_get_all_with_name
Gary Kramlich <grim@reaperworld.com>
parents: 41945
diff changeset
173 * @tags: The instance.
48bb3244b5ea Add purple_tags_get_all_with_name
Gary Kramlich <grim@reaperworld.com>
parents: 41945
diff changeset
174 * @name: The name of the tags to get.
48bb3244b5ea Add purple_tags_get_all_with_name
Gary Kramlich <grim@reaperworld.com>
parents: 41945
diff changeset
175 *
48bb3244b5ea Add purple_tags_get_all_with_name
Gary Kramlich <grim@reaperworld.com>
parents: 41945
diff changeset
176 * Gets a list of all tags that are named @name.
48bb3244b5ea Add purple_tags_get_all_with_name
Gary Kramlich <grim@reaperworld.com>
parents: 41945
diff changeset
177 *
48bb3244b5ea Add purple_tags_get_all_with_name
Gary Kramlich <grim@reaperworld.com>
parents: 41945
diff changeset
178 * Returns: (transfer container) (element-type utf8): The list of matching
48bb3244b5ea Add purple_tags_get_all_with_name
Gary Kramlich <grim@reaperworld.com>
parents: 41945
diff changeset
179 * tags.
48bb3244b5ea Add purple_tags_get_all_with_name
Gary Kramlich <grim@reaperworld.com>
parents: 41945
diff changeset
180 *
48bb3244b5ea Add purple_tags_get_all_with_name
Gary Kramlich <grim@reaperworld.com>
parents: 41945
diff changeset
181 * Since: 3.0.0
48bb3244b5ea Add purple_tags_get_all_with_name
Gary Kramlich <grim@reaperworld.com>
parents: 41945
diff changeset
182 */
48bb3244b5ea Add purple_tags_get_all_with_name
Gary Kramlich <grim@reaperworld.com>
parents: 41945
diff changeset
183 GList *purple_tags_get_all_with_name(PurpleTags *tags, const char *name);
48bb3244b5ea Add purple_tags_get_all_with_name
Gary Kramlich <grim@reaperworld.com>
parents: 41945
diff changeset
184
48bb3244b5ea Add purple_tags_get_all_with_name
Gary Kramlich <grim@reaperworld.com>
parents: 41945
diff changeset
185 /**
41736
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
186 * purple_tags_to_string:
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
187 * @tags: The instance.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
188 * @separator: (nullable): A string to separate the items.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
189 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
190 * Creates a @separator delimited string containing each item in @tags.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
191 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
192 * Returns: (transfer full): The string representation.
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
193 *
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
194 * Since: 3.0.0
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
195 */
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
196 gchar *purple_tags_to_string(PurpleTags *tags, const gchar *separator);
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
197
41892
39e595f7d056 Add purple_tag_parse for parsing tags
Gary Kramlich <grim@reaperworld.com>
parents: 41736
diff changeset
198 /**
39e595f7d056 Add purple_tag_parse for parsing tags
Gary Kramlich <grim@reaperworld.com>
parents: 41736
diff changeset
199 * purple_tag_parse:
39e595f7d056 Add purple_tag_parse for parsing tags
Gary Kramlich <grim@reaperworld.com>
parents: 41736
diff changeset
200 * @tag: The tag.
39e595f7d056 Add purple_tag_parse for parsing tags
Gary Kramlich <grim@reaperworld.com>
parents: 41736
diff changeset
201 * @name: (nullable) (optional) (out): An optional return address for the name
39e595f7d056 Add purple_tag_parse for parsing tags
Gary Kramlich <grim@reaperworld.com>
parents: 41736
diff changeset
202 * of the tag.
39e595f7d056 Add purple_tag_parse for parsing tags
Gary Kramlich <grim@reaperworld.com>
parents: 41736
diff changeset
203 * @value: (nullable) (optional) (out): An optional return address for the
39e595f7d056 Add purple_tag_parse for parsing tags
Gary Kramlich <grim@reaperworld.com>
parents: 41736
diff changeset
204 * value of the tag.
39e595f7d056 Add purple_tag_parse for parsing tags
Gary Kramlich <grim@reaperworld.com>
parents: 41736
diff changeset
205 *
39e595f7d056 Add purple_tag_parse for parsing tags
Gary Kramlich <grim@reaperworld.com>
parents: 41736
diff changeset
206 * Splits a tag into its name and value parts.
39e595f7d056 Add purple_tag_parse for parsing tags
Gary Kramlich <grim@reaperworld.com>
parents: 41736
diff changeset
207 *
39e595f7d056 Add purple_tag_parse for parsing tags
Gary Kramlich <grim@reaperworld.com>
parents: 41736
diff changeset
208 * Since: 3.0.0
39e595f7d056 Add purple_tag_parse for parsing tags
Gary Kramlich <grim@reaperworld.com>
parents: 41736
diff changeset
209 */
39e595f7d056 Add purple_tag_parse for parsing tags
Gary Kramlich <grim@reaperworld.com>
parents: 41736
diff changeset
210 void purple_tag_parse(const char *tag, char **name, char **value);
39e595f7d056 Add purple_tag_parse for parsing tags
Gary Kramlich <grim@reaperworld.com>
parents: 41736
diff changeset
211
41736
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
212 G_END_DECLS
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
213
d78c0951ea2c Create the PurpleTags object for handling tags
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
214 #endif /* PURPLE_TAGS_H */

mercurial