annotate libpurple/util.h @ 32636:a617a949e545

Doxygen was complaining about this not being a valid whatchamadinger, so escape it.
author Mark Doliner <mark@kingant.net>
date Sun, 18 Sep 2011 20:20:02 +0000
parents 4d5e1dc93265
children 5aa171c8776b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2 * @file util.h Utility Functions
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3 * @ingroup core
20074
6bf32c9e15a7 remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents: 19680
diff changeset
4 */
6bf32c9e15a7 remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents: 19680
diff changeset
5
6bf32c9e15a7 remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents: 19680
diff changeset
6 /* purple
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
7 *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
8 * Purple is the legal property of its developers, whose names are too numerous
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
10 * source distribution.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
11 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
12 * This program is free software; you can redistribute it and/or modify
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
13 * it under the terms of the GNU General Public License as published by
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
15 * (at your option) any later version.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
16 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
17 * This program is distributed in the hope that it will be useful,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
20 * GNU General Public License for more details.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23 * along with this program; if not, write to the Free Software
19680
44b4e8bd759b The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 19500
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
25 *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
26 * @todo Rename the functions so that they live somewhere in the purple
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27 * namespace.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
28 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
29 #ifndef _PURPLE_UTIL_H_
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
30 #define _PURPLE_UTIL_H_
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
31
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
32 #include <stdio.h>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
33
28493
63cb8c4f3c66 Fix a bunch of doxygen warnings.
Paul Aurich <paul@darkrain42.org>
parents: 28453
diff changeset
34 /**
63cb8c4f3c66 Fix a bunch of doxygen warnings.
Paul Aurich <paul@darkrain42.org>
parents: 28453
diff changeset
35 * An opaque structure representing a URL request. Can be used to cancel
63cb8c4f3c66 Fix a bunch of doxygen warnings.
Paul Aurich <paul@darkrain42.org>
parents: 28453
diff changeset
36 * the request.
63cb8c4f3c66 Fix a bunch of doxygen warnings.
Paul Aurich <paul@darkrain42.org>
parents: 28453
diff changeset
37 */
26520
fd97c0de433d Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <paul@darkrain42.org>
parents: 25438
diff changeset
38 typedef struct _PurpleUtilFetchUrlData PurpleUtilFetchUrlData;
28493
63cb8c4f3c66 Fix a bunch of doxygen warnings.
Paul Aurich <paul@darkrain42.org>
parents: 28453
diff changeset
39 /** @copydoc _PurpleMenuAction */
26520
fd97c0de433d Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <paul@darkrain42.org>
parents: 25438
diff changeset
40 typedef struct _PurpleMenuAction PurpleMenuAction;
28493
63cb8c4f3c66 Fix a bunch of doxygen warnings.
Paul Aurich <paul@darkrain42.org>
parents: 28453
diff changeset
41 /** @copydoc _PurpleKeyValuePair */
26520
fd97c0de433d Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <paul@darkrain42.org>
parents: 25438
diff changeset
42 typedef struct _PurpleKeyValuePair PurpleKeyValuePair;
fd97c0de433d Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <paul@darkrain42.org>
parents: 25438
diff changeset
43
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
44 #include "account.h"
29537
b8235e92ede7 Include signals.h to provide PurpleCallback. I guess all the other places
maiku@pidgin.im
parents: 29523
diff changeset
45 #include "signals.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
46 #include "xmlnode.h"
18039
c588a4a9d287 A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@wiktel.com>
parents: 17412
diff changeset
47 #include "notify.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
48
26520
fd97c0de433d Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <paul@darkrain42.org>
parents: 25438
diff changeset
49
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
50 #ifdef __cplusplus
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
51 extern "C" {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
52 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
53
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
54 typedef char *(*PurpleInfoFieldFormatCallback)(const char *field, size_t len);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
55
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
56 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
57 * A key-value pair.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
58 *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
59 * This is used by, among other things, purple_gtk_combo* functions to pass in a
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
60 * list of key-value pairs so it can display a user-friendly value.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
61 */
26520
fd97c0de433d Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <paul@darkrain42.org>
parents: 25438
diff changeset
62 struct _PurpleKeyValuePair
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
63 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
64 gchar *key;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
65 void *value;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
66
26520
fd97c0de433d Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <paul@darkrain42.org>
parents: 25438
diff changeset
67 };
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
68
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
69 /**
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
70 * Creates a new PurpleMenuAction.
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
71 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
72 * @param label The text label to display for this action.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
73 * @param callback The function to be called when the action is used on
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
74 * the selected item.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
75 * @param data Additional data to be passed to the callback.
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
76 * @param children A GList of PurpleMenuActions to be added as a submenu
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
77 * of the action.
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
78 * @return The PurpleMenuAction.
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
79 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
80 PurpleMenuAction *purple_menu_action_new(const char *label, PurpleCallback callback,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
81 gpointer data, GList *children);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
82
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
83 /**
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
84 * Frees a PurpleMenuAction
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
85 *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
86 * @param act The PurpleMenuAction to free.
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
87 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
88 void purple_menu_action_free(PurpleMenuAction *act);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
89
22000
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
90 /**
32466
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
91 * Returns the label of the PurpleMenuAction.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
92 *
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
93 * @param act The PurpleMenuAction.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
94 *
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
95 * @return The label string.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
96 */
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
97 char * purple_menu_action_get_label(const PurpleMenuAction *act);
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
98
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
99 /**
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
100 * Returns the callback of the PurpleMenuAction.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
101 *
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
102 * @param act The PurpleMenuAction.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
103 *
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
104 * @return The callback function.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
105 */
32516
4d5e1dc93265 disapproval of revision '0d9c985d91b5de7f20f3443d7edbe22fb7ce80af'
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32471
diff changeset
106 PurpleCallback purple_menu_action_get_callback(const PurpleMenuAction *act);
32466
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
107
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
108 /**
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
109 * Returns the data stored in the PurpleMenuAction.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
110 *
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
111 * @param act The PurpleMenuAction.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
112 *
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
113 * @return The data.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
114 */
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
115 gpointer purple_menu_action_get_data(const PurpleMenuAction *act);
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
116
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
117 /**
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
118 * Returns the children of the PurpleMenuAction.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
119 *
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
120 * @param act The PurpleMenuAction.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
121 *
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
122 * @return The GList of children.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
123 */
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
124 GList* purple_menu_action_get_children(const PurpleMenuAction *act);
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
125
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
126 /**
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
127 * Set the label to the PurpleMenuAction.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
128 *
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
129 * @param act The menu action.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
130 * @param label The label for the menu action.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
131 */
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
132 void purple_menu_action_set_label(PurpleMenuAction *act, char *label);
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
133
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
134 /**
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
135 * Set the callback that will be used by the PurpleMenuAction.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
136 *
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
137 * @param act The menu action.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
138 * @param callback The callback.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
139 */
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
140 void purple_menu_action_set_callback(PurpleMenuAction *act, PurpleCallback callback);
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
141
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
142 /**
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
143 * Set the label to the PurpleMenuAction.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
144 *
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
145 * @param act The menu action.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
146 * @param data The data used by this PurpleMenuAction
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
147 */
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
148 void purple_menu_action_set_data(PurpleMenuAction *act, gpointer data);
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
149
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
150 /**
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
151 * Set the children of the PurpleMenuAction.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
152 *
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
153 * @param act The menu action.
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
154 * @param children The PurpleMenuAtion children
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
155 */
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
156 void purple_menu_action_set_children(PurpleMenuAction *act, GList *children);
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
157
3b2ceeb8883b Hide-a-PurpleMenuAction.
masca@cpw.pidgin.im
parents: 32356
diff changeset
158 /**
22000
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
159 * Set the appropriate presence values for the currently playing song.
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
160 *
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
161 * @param title The title of the song, @c NULL to unset the value.
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
162 * @param artist The artist of the song, can be @c NULL.
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
163 * @param album The album of the song, can be @c NULL.
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
164 */
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
165 void purple_util_set_current_song(const char *title, const char *artist,
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
166 const char *album);
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
167
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
168 /**
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
169 * Format song information.
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
170 *
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
171 * @param title The title of the song, @c NULL to unset the value.
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
172 * @param artist The artist of the song, can be @c NULL.
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
173 * @param album The album of the song, can be @c NULL.
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
174 * @param unused Currently unused, must be @c NULL.
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
175 *
28493
63cb8c4f3c66 Fix a bunch of doxygen warnings.
Paul Aurich <paul@darkrain42.org>
parents: 28453
diff changeset
176 * @return The formatted string. The caller must g_free the returned string.
22000
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
177 */
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
178 char * purple_util_format_song_info(const char *title, const char *artist,
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
179 const char *album, gpointer unused);
af0426c34c27 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21895
diff changeset
180
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
181 /**************************************************************************/
21248
5915ad785ee7 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents: 20334
diff changeset
182 /** @name Utility Subsystem */
5915ad785ee7 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents: 20334
diff changeset
183 /**************************************************************************/
5915ad785ee7 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents: 20334
diff changeset
184 /*@{*/
5915ad785ee7 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents: 20334
diff changeset
185
5915ad785ee7 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents: 20334
diff changeset
186 /**
5915ad785ee7 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents: 20334
diff changeset
187 * Initializes the utility subsystem.
5915ad785ee7 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents: 20334
diff changeset
188 */
5915ad785ee7 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents: 20334
diff changeset
189 void purple_util_init(void);
5915ad785ee7 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents: 20334
diff changeset
190
5915ad785ee7 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents: 20334
diff changeset
191 /**
5915ad785ee7 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents: 20334
diff changeset
192 * Uninitializes the util subsystem.
5915ad785ee7 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents: 20334
diff changeset
193 */
5915ad785ee7 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents: 20334
diff changeset
194 void purple_util_uninit(void);
5915ad785ee7 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents: 20334
diff changeset
195
5915ad785ee7 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents: 20334
diff changeset
196 /*@}*/
5915ad785ee7 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents: 20334
diff changeset
197
5915ad785ee7 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents: 20334
diff changeset
198 /**************************************************************************/
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
199 /** @name Base16 Functions */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
200 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
201 /*@{*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
202
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
203 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
204 * Converts a chunk of binary data to its base-16 equivalent.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
205 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
206 * @param data The data to convert.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
207 * @param len The length of the data.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
208 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
209 * @return The base-16 string in the ASCII encoding. Must be
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
210 * g_free'd when no longer needed.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
211 *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
212 * @see purple_base16_decode()
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
213 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
214 gchar *purple_base16_encode(const guchar *data, gsize len);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
215
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
216 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
217 * Converts an ASCII string of base-16 encoded data to
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
218 * the binary equivalent.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
219 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
220 * @param str The base-16 string to convert to raw data.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
221 * @param ret_len The length of the returned data. You can
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
222 * pass in NULL if you're sure that you know
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
223 * the length of the decoded data, or if you
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
224 * know you'll be able to use strlen to
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
225 * determine the length, etc.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
226 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
227 * @return The raw data. Must be g_free'd when no longer needed.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
228 *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
229 * @see purple_base16_encode()
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
230 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
231 guchar *purple_base16_decode(const char *str, gsize *ret_len);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
232
17412
ba768014f91f - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16495
diff changeset
233 /**
ba768014f91f - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16495
diff changeset
234 * Converts a chunk of binary data to a chunked base-16 representation
ba768014f91f - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16495
diff changeset
235 * (handy for key fingerprints)
ba768014f91f - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16495
diff changeset
236 *
ba768014f91f - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16495
diff changeset
237 * Example output: 01:23:45:67:89:AB:CD:EF
ba768014f91f - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16495
diff changeset
238 *
ba768014f91f - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16495
diff changeset
239 * @param data The data to convert.
ba768014f91f - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16495
diff changeset
240 * @param len The length of the data.
ba768014f91f - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16495
diff changeset
241 *
ba768014f91f - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16495
diff changeset
242 * @return The base-16 string in the ASCII chunked encoding. Must be
ba768014f91f - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16495
diff changeset
243 * g_free'd when no longer needed.
ba768014f91f - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16495
diff changeset
244 */
ba768014f91f - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16495
diff changeset
245 gchar *purple_base16_encode_chunked(const guchar *data, gsize len);
ba768014f91f - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16495
diff changeset
246
ba768014f91f - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16495
diff changeset
247
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
248 /*@}*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
249
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
250 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
251 /** @name Base64 Functions */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
252 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
253 /*@{*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
254
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
255 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
256 * Converts a chunk of binary data to its base-64 equivalent.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
257 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
258 * @param data The data to convert.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
259 * @param len The length of the data.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
260 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
261 * @return The base-64 string in the ASCII encoding. Must be
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
262 * g_free'd when no longer needed.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
263 *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
264 * @see purple_base64_decode()
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
265 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
266 gchar *purple_base64_encode(const guchar *data, gsize len);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
267
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
268 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
269 * Converts an ASCII string of base-64 encoded data to
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
270 * the binary equivalent.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
271 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
272 * @param str The base-64 string to convert to raw data.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
273 * @param ret_len The length of the returned data. You can
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
274 * pass in NULL if you're sure that you know
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
275 * the length of the decoded data, or if you
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
276 * know you'll be able to use strlen to
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
277 * determine the length, etc.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
278 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
279 * @return The raw data. Must be g_free'd when no longer needed.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
280 *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
281 * @see purple_base64_encode()
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
282 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
283 guchar *purple_base64_decode(const char *str, gsize *ret_len);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
284
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
285 /*@}*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
286
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
287 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
288 /** @name Quoted Printable Functions */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
289 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
290 /*@{*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
291
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
292 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
293 * Converts a quoted printable string back to its readable equivalent.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
294 * What is a quoted printable string, you ask? It's an encoding used
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
295 * to transmit binary data as ASCII. It's intended purpose is to send
23182
e0bcb8cfda74 Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents: 23144
diff changeset
296 * emails containing non-ASCII characters. Wikipedia has a pretty good
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
297 * explanation. Also see RFC 2045.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
298 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
299 * @param str The quoted printable ASCII string to convert to raw data.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
300 * @param ret_len The length of the returned data.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
301 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
302 * @return The readable string. Must be g_free'd when no longer needed.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
303 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
304 guchar *purple_quotedp_decode(const char *str, gsize *ret_len);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
305
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
306 /*@}*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
307
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
308 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
309 /** @name MIME Functions */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
310 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
311 /*@{*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
312
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
313 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
314 * Converts a MIME header field string back to its readable equivalent
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
315 * according to RFC 2047. Basically, a header is plain ASCII and can
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
316 * contain any number of sections called "encoded-words." The format
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
317 * of an encoded word is =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?=
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
318 * =? designates the beginning of the encoded-word
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
319 * ?= designates the end of the encoded-word
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
320 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
321 * An encoded word is segmented into three pieces by the use of a
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
322 * question mark. The first piece is the character set, the second
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
323 * piece is the encoding, and the third piece is the encoded text.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
324 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
325 * @param str The ASCII string, possibly containing any number of
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
326 * encoded-word sections.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
327 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
328 * @return The string, with any encoded-word sections decoded and
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
329 * converted to UTF-8. Must be g_free'd when no longer
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
330 * needed.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
331 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
332 char *purple_mime_decode_field(const char *str);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
333
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
334 /*@}*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
335
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
336
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
337 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
338 /** @name Date/Time Functions */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
339 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
340 /*@{*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
341
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
342 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
343 * Formats a time into the specified format.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
344 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
345 * This is essentially strftime(), but it has a static buffer
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
346 * and handles the UTF-8 conversion for the caller.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
347 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
348 * This function also provides the GNU %z formatter if the underlying C
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
349 * library doesn't. However, the format string parser is very naive, which
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
350 * means that conversions specifiers to %z cannot be guaranteed. The GNU
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
351 * strftime(3) man page describes %z as: 'The time-zone as hour offset from
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
352 * GMT. Required to emit RFC822-conformant dates
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
353 * (using "%a, %d %b %Y %H:%M:%S %z"). (GNU)'
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
354 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
355 * On Windows, this function also converts the results for %Z from a timezone
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
356 * name (as returned by the system strftime() %Z format string) to a timezone
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
357 * abbreviation (as is the case on Unix). As with %z, conversion specifiers
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
358 * should not be used.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
359 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
360 * @param format The format string, in UTF-8
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
361 * @param tm The time to format, or @c NULL to use the current local time
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
362 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
363 * @return The formatted time, in UTF-8.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
364 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
365 * @note @a format is required to be in UTF-8. This differs from strftime(),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
366 * where the format is provided in the locale charset.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
367 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
368 const char *purple_utf8_strftime(const char *format, const struct tm *tm);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
369
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
370 /**
18259
c5c265dff90c support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents: 18039
diff changeset
371 * Gets a string representation of the local timezone offset
c5c265dff90c support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents: 18039
diff changeset
372 *
c5c265dff90c support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents: 18039
diff changeset
373 * @param tm The time to get the timezone for
c5c265dff90c support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents: 18039
diff changeset
374 * @param iso TRUE to format the offset according to ISO-8601, FALSE to
c5c265dff90c support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents: 18039
diff changeset
375 * not substitute 'Z' for 0 offset, and to not separate
c5c265dff90c support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents: 18039
diff changeset
376 * hours and minutes with a colon.
c5c265dff90c support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents: 18039
diff changeset
377 */
c5c265dff90c support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents: 18039
diff changeset
378 const char *purple_get_tzoff_str(const struct tm *tm, gboolean iso);
c5c265dff90c support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents: 18039
diff changeset
379
c5c265dff90c support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents: 18039
diff changeset
380 /**
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
381 * Formats a time into the user's preferred short date format.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
382 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
383 * The returned string is stored in a static buffer, so the result
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
384 * should be g_strdup()'d if it's going to be kept.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
385 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
386 * @param tm The time to format, or @c NULL to use the current local time
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
387 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
388 * @return The date, formatted as per the user's settings.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
389 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
390 const char *purple_date_format_short(const struct tm *tm);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
391
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
392 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
393 * Formats a time into the user's preferred short date plus time format.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
394 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
395 * The returned string is stored in a static buffer, so the result
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
396 * should be g_strdup()'d if it's going to be kept.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
397 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
398 * @param tm The time to format, or @c NULL to use the current local time
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
399 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
400 * @return The timestamp, formatted as per the user's settings.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
401 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
402 const char *purple_date_format_long(const struct tm *tm);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
403
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
404 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
405 * Formats a time into the user's preferred full date and time format.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
406 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
407 * The returned string is stored in a static buffer, so the result
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
408 * should be g_strdup()'d if it's going to be kept.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
409 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
410 * @param tm The time to format, or @c NULL to use the current local time
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
411 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
412 * @return The date and time, formatted as per the user's settings.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
413 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
414 const char *purple_date_format_full(const struct tm *tm);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
415
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
416 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
417 * Formats a time into the user's preferred time format.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
418 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
419 * The returned string is stored in a static buffer, so the result
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
420 * should be g_strdup()'d if it's going to be kept.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
421 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
422 * @param tm The time to format, or @c NULL to use the current local time
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
423 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
424 * @return The time, formatted as per the user's settings.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
425 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
426 const char *purple_time_format(const struct tm *tm);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
427
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
428 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
429 * Builds a time_t from the supplied information.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
430 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
431 * @param year The year.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
432 * @param month The month.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
433 * @param day The day.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
434 * @param hour The hour.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
435 * @param min The minute.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
436 * @param sec The second.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
437 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
438 * @return A time_t.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
439 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
440 time_t purple_time_build(int year, int month, int day, int hour,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
441 int min, int sec);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
442
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
443 /** Used by purple_str_to_time to indicate no timezone offset was
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
444 * specified in the timestamp string. */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
445 #define PURPLE_NO_TZ_OFF -500000
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
446
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
447 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
448 * Parses a timestamp in jabber, ISO8601, or MM/DD/YYYY format and returns
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
449 * a time_t.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
450 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
451 * @param timestamp The timestamp
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
452 * @param utc Assume UTC if no timezone specified
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
453 * @param tm If not @c NULL, the caller can get a copy of the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
454 * struct tm used to calculate the time_t return value.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
455 * @param tz_off If not @c NULL, the caller can get a copy of the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
456 * timezone offset (from UTC) used to calculate the time_t
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
457 * return value. Note: Zero is a valid offset. As such,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
458 * the value of the macro @c PURPLE_NO_TZ_OFF indicates no
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
459 * offset was specified (which means that the local
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
460 * timezone was used in the calculation).
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
461 * @param rest If not @c NULL, the caller can get a pointer to the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
462 * part of @a timestamp left over after parsing is
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
463 * completed, if it's not the end of @a timestamp.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
464 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
465 * @return A time_t.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
466 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
467 time_t purple_str_to_time(const char *timestamp, gboolean utc,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
468 struct tm *tm, long *tz_off, const char **rest);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
469
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
470 /*@}*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
471
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
472
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
473 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
474 /** @name Markup Functions */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
475 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
476 /*@{*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
477
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
478 /**
27475
57fdb7853fc7 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents: 27107
diff changeset
479 * Escapes special characters in a plain-text string so they display
57fdb7853fc7 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents: 27107
diff changeset
480 * correctly as HTML. For example, & is replaced with &amp; and < is
57fdb7853fc7 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents: 27107
diff changeset
481 * replaced with &lt;
57fdb7853fc7 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents: 27107
diff changeset
482 *
57fdb7853fc7 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents: 27107
diff changeset
483 * This is exactly the same as g_markup_escape_text(), except that it
57fdb7853fc7 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents: 27107
diff changeset
484 * does not change ' to &apos; because &apos; is not a valid HTML 4 entity,
57fdb7853fc7 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents: 27107
diff changeset
485 * and is displayed literally in IE7.
57fdb7853fc7 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents: 27107
diff changeset
486 */
57fdb7853fc7 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents: 27107
diff changeset
487 gchar *purple_markup_escape_text(const gchar *text, gssize length);
57fdb7853fc7 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents: 27107
diff changeset
488
57fdb7853fc7 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents: 27107
diff changeset
489 /**
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
490 * Finds an HTML tag matching the given name.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
491 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
492 * This locates an HTML tag's start and end, and stores its attributes
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
493 * in a GData hash table. The names of the attributes are lower-cased
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
494 * in the hash table, and the name of the tag is case insensitive.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
495 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
496 * @param needle The name of the tag
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
497 * @param haystack The null-delimited string to search in
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
498 * @param start A pointer to the start of the tag if found
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
499 * @param end A pointer to the end of the tag if found
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
500 * @param attributes The attributes, if the tag was found. This should
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
501 * be freed with g_datalist_clear().
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
502 * @return TRUE if the tag was found
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
503 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
504 gboolean purple_markup_find_tag(const char *needle, const char *haystack,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
505 const char **start, const char **end,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
506 GData **attributes);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
507
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
508 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
509 * Extracts a field of data from HTML.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
510 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
511 * This is a scary function. See protocols/msn/msn.c and
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
512 * protocols/yahoo/yahoo_profile.c for example usage.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
513 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
514 * @param str The string to parse.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
515 * @param len The size of str.
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
516 * @param user_info The destination PurpleNotifyUserInfo to which the new
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
517 * field info should be added.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
518 * @param start_token The beginning token.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
519 * @param skip The number of characters to skip after the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
520 * start token.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
521 * @param end_token The ending token.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
522 * @param check_value The value that the last character must meet.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
523 * @param no_value_token The token indicating no value is given.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
524 * @param display_name The short descriptive name to display for this token.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
525 * @param is_link TRUE if this should be a link, or FALSE otherwise.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
526 * @param link_prefix The prefix for the link.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
527 * @param format_cb A callback to format the value before adding it.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
528 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
529 * @return TRUE if successful, or FALSE otherwise.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
530 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
531 gboolean purple_markup_extract_info_field(const char *str, int len, PurpleNotifyUserInfo *user_info,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
532 const char *start_token, int skip,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
533 const char *end_token, char check_value,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
534 const char *no_value_token,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
535 const char *display_name, gboolean is_link,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
536 const char *link_prefix,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
537 PurpleInfoFieldFormatCallback format_cb);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
538
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
539 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
540 * Converts HTML markup to XHTML.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
541 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
542 * @param html The HTML markup.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
543 * @param dest_xhtml The destination XHTML output.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
544 * @param dest_plain The destination plain-text output.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
545 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
546 void purple_markup_html_to_xhtml(const char *html, char **dest_xhtml,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
547 char **dest_plain);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
548
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
549 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
550 * Strips HTML tags from a string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
551 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
552 * @param str The string to strip HTML from.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
553 *
22659
17d1054cea03 Super minor documentation improvement
Mark Doliner <mark@kingant.net>
parents: 22609
diff changeset
554 * @return The new string without HTML. You must g_free this string
17d1054cea03 Super minor documentation improvement
Mark Doliner <mark@kingant.net>
parents: 22609
diff changeset
555 * when finished with it.
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
556 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
557 char *purple_markup_strip_html(const char *str);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
558
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
559 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
560 * Adds the necessary HTML code to turn URIs into HTML links in a string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
561 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
562 * @param str The string to linkify.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
563 *
22659
17d1054cea03 Super minor documentation improvement
Mark Doliner <mark@kingant.net>
parents: 22609
diff changeset
564 * @return The new string with all URIs surrounded in standard
17d1054cea03 Super minor documentation improvement
Mark Doliner <mark@kingant.net>
parents: 22609
diff changeset
565 * HTML <a href="whatever"></a> tags. You must g_free this
17d1054cea03 Super minor documentation improvement
Mark Doliner <mark@kingant.net>
parents: 22609
diff changeset
566 * string when finished with it.
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
567 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
568 char *purple_markup_linkify(const char *str);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
569
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
570 /**
29753
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
571 * Unescapes HTML entities to their literal characters in the text.
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
572 * For example "&amp;" is replaced by '&' and so on. Also converts
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
573 * numerical entities (e.g. "&#38;" is also '&').
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
574 *
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
575 * This function currently supports the following named entities:
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
576 * "&amp;", "&lt;", "&gt;", "&copy;", "&quot;", "&reg;", "&apos;"
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
577 *
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
578 * purple_unescape_html() is similar, but also converts "<br>" into "\n".
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
579 *
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
580 * @param text The string in which to unescape any HTML entities
29399
a8e19b69e6b4 Might as well make this comment accurate.
Paul Aurich <paul@darkrain42.org>
parents: 28493
diff changeset
581 *
29753
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
582 * @return The text with HTML entities literalized. You must g_free
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
583 * this string when finished with it.
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
584 *
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
585 * @see purple_unescape_html()
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
586 */
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
587 char *purple_unescape_text(const char *text);
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
588
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
589 /**
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
590 * Unescapes HTML entities to their literal characters and converts
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
591 * "<br>" to "\n". See purple_unescape_text() for more details.
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
592 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
593 * @param html The string in which to unescape any HTML entities
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
594 *
22659
17d1054cea03 Super minor documentation improvement
Mark Doliner <mark@kingant.net>
parents: 22609
diff changeset
595 * @return The text with HTML entities literalized. You must g_free
17d1054cea03 Super minor documentation improvement
Mark Doliner <mark@kingant.net>
parents: 22609
diff changeset
596 * this string when finished with it.
29753
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
597 *
05d727f76ca9 Combine the three purple_unescape_text()s into one.
Paul Aurich <paul@darkrain42.org>
parents: 29752
diff changeset
598 * @see purple_unescape_text()
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
599 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
600 char *purple_unescape_html(const char *html);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
601
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
602 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
603 * Returns a newly allocated substring of the HTML UTF-8 string "str".
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
604 * The markup is preserved such that the substring will have the same
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
605 * formatting as original string, even though some tags may have been
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
606 * opened before "x", or may close after "y". All open tags are closed
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
607 * at the end of the returned string, in the proper order.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
608 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
609 * Note that x and y are in character offsets, not byte offsets, and
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
610 * are offsets into an unformatted version of str. Because of this,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
611 * this function may be sensitive to changes in GtkIMHtml and may break
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
612 * when used with other UI's. libpurple users are encouraged to report and
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
613 * work out any problems encountered.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
614 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
615 * @param str The input NUL terminated, HTML, UTF-8 (or ASCII) string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
616 * @param x The character offset into an unformatted version of str to
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
617 * begin at.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
618 * @param y The character offset (into an unformatted vesion of str) of
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
619 * one past the last character to include in the slice.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
620 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
621 * @return The HTML slice of string, with all formatting retained.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
622 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
623 char *purple_markup_slice(const char *str, guint x, guint y);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
624
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
625 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
626 * Returns a newly allocated string containing the name of the tag
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
627 * located at "tag". Tag is expected to point to a '<', and contain
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
628 * a '>' sometime after that. If there is no '>' and the string is
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
629 * not NUL terminated, this function can be expected to segfault.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
630 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
631 * @param tag The string starting a HTML tag.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
632 * @return A string containing the name of the tag.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
633 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
634 char *purple_markup_get_tag_name(const char *tag);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
635
16083
f2a4b05407d7 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15823
diff changeset
636 /**
f2a4b05407d7 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15823
diff changeset
637 * Returns a constant string of the character representation of the HTML
16084
a5a831a5f186 Patch cleanups:
Richard Laager <rlaager@wiktel.com>
parents: 16083
diff changeset
638 * entity pointed to by @a text. For example, purple_markup_unescape_entity("&amp;")
a5a831a5f186 Patch cleanups:
Richard Laager <rlaager@wiktel.com>
parents: 16083
diff changeset
639 * will return "&". The @a text variable is expected to point to an '&',
a5a831a5f186 Patch cleanups:
Richard Laager <rlaager@wiktel.com>
parents: 16083
diff changeset
640 * the first character of the entity. If given an unrecognized entity, the function
a5a831a5f186 Patch cleanups:
Richard Laager <rlaager@wiktel.com>
parents: 16083
diff changeset
641 * returns @c NULL.
a5a831a5f186 Patch cleanups:
Richard Laager <rlaager@wiktel.com>
parents: 16083
diff changeset
642 *
16495
b8b2e35ec7c6 Fix purple_util_get_image_extension()'s data param. to be correctly marked as constant.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 16375
diff changeset
643 * Note that this function, unlike purple_unescape_html(), does not search
16084
a5a831a5f186 Patch cleanups:
Richard Laager <rlaager@wiktel.com>
parents: 16083
diff changeset
644 * the string for the entity, does not replace the entity, and does not
16083
f2a4b05407d7 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15823
diff changeset
645 * return a newly allocated string.
f2a4b05407d7 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15823
diff changeset
646 *
16084
a5a831a5f186 Patch cleanups:
Richard Laager <rlaager@wiktel.com>
parents: 16083
diff changeset
647 * @param text A string containing an HTML entity.
a5a831a5f186 Patch cleanups:
Richard Laager <rlaager@wiktel.com>
parents: 16083
diff changeset
648 * @param length If not @c NULL, the string length of the entity is stored in this location.
a5a831a5f186 Patch cleanups:
Richard Laager <rlaager@wiktel.com>
parents: 16083
diff changeset
649 *
16083
f2a4b05407d7 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15823
diff changeset
650 * @return A constant string containing the character representation of the given entity.
f2a4b05407d7 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15823
diff changeset
651 */
16084
a5a831a5f186 Patch cleanups:
Richard Laager <rlaager@wiktel.com>
parents: 16083
diff changeset
652 const char * purple_markup_unescape_entity(const char *text, int *length);
16083
f2a4b05407d7 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15823
diff changeset
653
f2a4b05407d7 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15823
diff changeset
654 /**
f2a4b05407d7 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15823
diff changeset
655 * Returns a newly allocated string containing the value of the CSS property specified
16084
a5a831a5f186 Patch cleanups:
Richard Laager <rlaager@wiktel.com>
parents: 16083
diff changeset
656 * in opt. The @a style argument is expected to point to a HTML inline CSS.
16201
36b09c6f7957 Doxygen updates. This eliminated all the warnings from Doxygen.
Richard Laager <rlaager@wiktel.com>
parents: 16152
diff changeset
657 * The function will seek for the CSS property and return its value.
16084
a5a831a5f186 Patch cleanups:
Richard Laager <rlaager@wiktel.com>
parents: 16083
diff changeset
658 *
16201
36b09c6f7957 Doxygen updates. This eliminated all the warnings from Doxygen.
Richard Laager <rlaager@wiktel.com>
parents: 16152
diff changeset
659 * For example, purple_markup_get_css_property("direction:rtl;color:#dc4d1b;",
36b09c6f7957 Doxygen updates. This eliminated all the warnings from Doxygen.
Richard Laager <rlaager@wiktel.com>
parents: 16152
diff changeset
660 * "color") would return "#dc4d1b".
16084
a5a831a5f186 Patch cleanups:
Richard Laager <rlaager@wiktel.com>
parents: 16083
diff changeset
661 *
16201
36b09c6f7957 Doxygen updates. This eliminated all the warnings from Doxygen.
Richard Laager <rlaager@wiktel.com>
parents: 16152
diff changeset
662 * On error or if the requested property was not found, the function returns
36b09c6f7957 Doxygen updates. This eliminated all the warnings from Doxygen.
Richard Laager <rlaager@wiktel.com>
parents: 16152
diff changeset
663 * @c NULL.
16083
f2a4b05407d7 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15823
diff changeset
664 *
f2a4b05407d7 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15823
diff changeset
665 * @param style A string containing the inline CSS text.
16084
a5a831a5f186 Patch cleanups:
Richard Laager <rlaager@wiktel.com>
parents: 16083
diff changeset
666 * @param opt The requested CSS property.
a5a831a5f186 Patch cleanups:
Richard Laager <rlaager@wiktel.com>
parents: 16083
diff changeset
667 *
a5a831a5f186 Patch cleanups:
Richard Laager <rlaager@wiktel.com>
parents: 16083
diff changeset
668 * @return The value of the requested CSS property.
16083
f2a4b05407d7 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15823
diff changeset
669 */
16084
a5a831a5f186 Patch cleanups:
Richard Laager <rlaager@wiktel.com>
parents: 16083
diff changeset
670 char * purple_markup_get_css_property(const gchar *style, const gchar *opt);
16083
f2a4b05407d7 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15823
diff changeset
671
27094
af4a4ebc6441 Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 27091
diff changeset
672 /**
af4a4ebc6441 Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 27091
diff changeset
673 * Check if the given HTML contains RTL text.
af4a4ebc6441 Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 27091
diff changeset
674 *
af4a4ebc6441 Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 27091
diff changeset
675 * @param html The HTML text.
af4a4ebc6441 Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 27091
diff changeset
676 *
af4a4ebc6441 Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 27091
diff changeset
677 * @return TRUE if the text contains RTL text, FALSE otherwise.
af4a4ebc6441 Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 27091
diff changeset
678 */
af4a4ebc6441 Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 27091
diff changeset
679 gboolean purple_markup_is_rtl(const char *html);
16083
f2a4b05407d7 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15823
diff changeset
680
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
681 /*@}*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
682
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
683
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
684 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
685 /** @name Path/Filename Functions */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
686 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
687 /*@{*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
688
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
689 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
690 * Returns the user's home directory.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
691 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
692 * @return The user's home directory.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
693 *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
694 * @see purple_user_dir()
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
695 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
696 const gchar *purple_home_dir(void);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
697
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
698 /**
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
699 * Returns the purple settings directory in the user's home directory.
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
700 * This is usually ~/.purple
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
701 *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
702 * @return The purple settings directory.
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
703 *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
704 * @see purple_home_dir()
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
705 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
706 const char *purple_user_dir(void);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
707
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
708 /**
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
709 * Define a custom purple settings directory, overriding the default (user's home directory/.purple)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
710 * @param dir The custom settings directory
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
711 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
712 void purple_util_set_user_dir(const char *dir);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
713
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
714 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
715 * Builds a complete path from the root, making any directories along
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
716 * the path which do not already exist.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
717 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
718 * @param path The path you wish to create. Note that it must start
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
719 * from the root or this function will fail.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
720 * @param mode Unix-style permissions for this directory.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
721 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
722 * @return 0 for success, nonzero on any error.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
723 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
724 int purple_build_dir(const char *path, int mode);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
725
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
726 /**
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
727 * Write a string of data to a file of the given name in the Purple
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
728 * user directory ($HOME/.purple by default). The data is typically
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
729 * a serialized version of one of Purple's config files, such as
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
730 * prefs.xml, accounts.xml, etc. And the string is typically
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
731 * obtained using xmlnode_to_formatted_str. However, this function
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
732 * should work fine for saving binary files as well.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
733 *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
734 * @param filename The basename of the file to write in the purple_user_dir.
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
735 * @param data A null-terminated string of data to write.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
736 * @param size The size of the data to save. If data is
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
737 * null-terminated you can pass in -1.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
738 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
739 * @return TRUE if the file was written successfully. FALSE otherwise.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
740 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
741 gboolean purple_util_write_data_to_file(const char *filename, const char *data,
19500
6e4b16081dff Fix purple_util_write_data_to_file signature.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 19499
diff changeset
742 gssize size);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
743
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
744 /**
19498
7589b218f89a - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18363
diff changeset
745 * Write data to a file using the absolute path.
7589b218f89a - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18363
diff changeset
746 *
7589b218f89a - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18363
diff changeset
747 * This exists for Glib backwards compatibility reasons.
7589b218f89a - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18363
diff changeset
748 *
7589b218f89a - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18363
diff changeset
749 * @param filename_full Filename to write to
7589b218f89a - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18363
diff changeset
750 * @param data A null-terminated string of data to write.
7589b218f89a - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18363
diff changeset
751 * @param size The size of the data to save. If data is
7589b218f89a - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18363
diff changeset
752 * null-terminated you can pass in -1.
7589b218f89a - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18363
diff changeset
753 *
7589b218f89a - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18363
diff changeset
754 * @return TRUE if the file was written successfully. FALSE otherwise.
7589b218f89a - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18363
diff changeset
755 *
7589b218f89a - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18363
diff changeset
756 * @todo Remove this function (use g_file_set_contents instead) when 3.0.0
7589b218f89a - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18363
diff changeset
757 * rolls around.
7589b218f89a - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18363
diff changeset
758 * @see purple_util_write_data_to_file()
7589b218f89a - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18363
diff changeset
759 *
7589b218f89a - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18363
diff changeset
760 */
7589b218f89a - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18363
diff changeset
761 gboolean
20334
58a57a0ca807 applied changes from 1095e0c294d15e95c8909d270748c5253226bfe6
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
762 purple_util_write_data_to_file_absolute(const char *filename_full, const char *data, gssize size);
19498
7589b218f89a - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18363
diff changeset
763
7589b218f89a - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18363
diff changeset
764 /**
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
765 * Read the contents of a given file and parse the results into an
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
766 * xmlnode tree structure. This is intended to be used to read
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
767 * Purple's configuration xml files (prefs.xml, pounces.xml, etc.)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
768 *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
769 * @param filename The basename of the file to open in the purple_user_dir.
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
770 * @param description A very short description of the contents of this
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
771 * file. This is used in error messages shown to the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
772 * user when the file can not be opened. For example,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
773 * "preferences," or "buddy pounces."
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
774 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
775 * @return An xmlnode tree of the contents of the given file. Or NULL, if
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
776 * the file does not exist or there was an error reading the file.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
777 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
778 xmlnode *purple_util_read_xml_from_file(const char *filename,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
779 const char *description);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
780
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
781 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
782 * Creates a temporary file and returns a file pointer to it.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
783 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
784 * This is like mkstemp(), but returns a file pointer and uses a
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
785 * pre-set template. It uses the semantics of tempnam() for the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
786 * directory to use and allocates the space for the file path.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
787 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
788 * The caller is responsible for closing the file and removing it when
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
789 * done, as well as freeing the space pointed to by @a path with
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
790 * g_free().
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
791 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
792 * @param path The returned path to the temp file.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
793 * @param binary Text or binary, for platforms where it matters.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
794 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
795 * @return A file pointer to the temporary file, or @c NULL on failure.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
796 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
797 FILE *purple_mkstemp(char **path, gboolean binary);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
798
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
799 /**
16375
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16201
diff changeset
800 * Returns an extension corresponding to the image data's file type.
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16201
diff changeset
801 *
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16201
diff changeset
802 * @param data A pointer to the image data
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16201
diff changeset
803 * @param len The length of the image data
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16201
diff changeset
804 *
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16201
diff changeset
805 * @return The appropriate extension, or "icon" if unknown.
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16201
diff changeset
806 */
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16201
diff changeset
807 const char *
16495
b8b2e35ec7c6 Fix purple_util_get_image_extension()'s data param. to be correctly marked as constant.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 16375
diff changeset
808 purple_util_get_image_extension(gconstpointer data, size_t len);
16375
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16201
diff changeset
809
18039
c588a4a9d287 A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@wiktel.com>
parents: 17412
diff changeset
810 /**
22874
02eda4bd2b22 Apply the custom smiley patches from #1187, from Jorge Villase«Ðo (Masca) and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22000
diff changeset
811 * Returns a SHA-1 hash string of the data passed in.
02eda4bd2b22 Apply the custom smiley patches from #1187, from Jorge Villase«Ðo (Masca) and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22000
diff changeset
812 */
02eda4bd2b22 Apply the custom smiley patches from #1187, from Jorge Villase«Ðo (Masca) and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22000
diff changeset
813 char *purple_util_get_image_checksum(gconstpointer image_data, size_t image_len);
02eda4bd2b22 Apply the custom smiley patches from #1187, from Jorge Villase«Ðo (Masca) and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22000
diff changeset
814
02eda4bd2b22 Apply the custom smiley patches from #1187, from Jorge Villase«Ðo (Masca) and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22000
diff changeset
815 /**
22609
eccdd341dc6e Documentation changes
Mark Doliner <mark@kingant.net>
parents: 22327
diff changeset
816 * @return A hex encoded version of the SHA-1 hash of the data passed
eccdd341dc6e Documentation changes
Mark Doliner <mark@kingant.net>
parents: 22327
diff changeset
817 * in with the correct file extention appended. The file
eccdd341dc6e Documentation changes
Mark Doliner <mark@kingant.net>
parents: 22327
diff changeset
818 * extension is determined by calling
eccdd341dc6e Documentation changes
Mark Doliner <mark@kingant.net>
parents: 22327
diff changeset
819 * purple_util_get_image_extension(). This return value must
eccdd341dc6e Documentation changes
Mark Doliner <mark@kingant.net>
parents: 22327
diff changeset
820 * be g_freed by the caller.
18039
c588a4a9d287 A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@wiktel.com>
parents: 17412
diff changeset
821 */
c588a4a9d287 A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@wiktel.com>
parents: 17412
diff changeset
822 char *purple_util_get_image_filename(gconstpointer image_data, size_t image_len);
c588a4a9d287 A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@wiktel.com>
parents: 17412
diff changeset
823
16375
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16201
diff changeset
824 /*@}*/
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16201
diff changeset
825
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16201
diff changeset
826
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16201
diff changeset
827 /**************************************************************************/
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16201
diff changeset
828 /** @name Environment Detection Functions */
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16201
diff changeset
829 /**************************************************************************/
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16201
diff changeset
830 /*@{*/
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16201
diff changeset
831
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16201
diff changeset
832 /**
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
833 * Checks if the given program name is valid and executable.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
834 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
835 * @param program The file name of the application.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
836 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
837 * @return TRUE if the program is runable.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
838 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
839 gboolean purple_program_is_valid(const char *program);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
840
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
841 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
842 * Check if running GNOME.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
843 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
844 * @return TRUE if running GNOME, FALSE otherwise.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
845 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
846 gboolean purple_running_gnome(void);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
847
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
848 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
849 * Check if running KDE.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
850 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
851 * @return TRUE if running KDE, FALSE otherwise.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
852 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
853 gboolean purple_running_kde(void);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
854
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
855 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
856 * Check if running OS X.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
857 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
858 * @return TRUE if running OS X, FALSE otherwise.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
859 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
860 gboolean purple_running_osx(void);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
861
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
862 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
863 * Returns the IP address from a socket file descriptor.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
864 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
865 * @param fd The socket file descriptor.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
866 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
867 * @return The IP address, or @c NULL on error.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
868 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
869 char *purple_fd_get_ip(int fd);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
870
30153
35a1cf247168 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <paul@darkrain42.org>
parents: 30053
diff changeset
871 /**
35a1cf247168 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <paul@darkrain42.org>
parents: 30053
diff changeset
872 * Returns the address family of a socket.
35a1cf247168 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <paul@darkrain42.org>
parents: 30053
diff changeset
873 *
35a1cf247168 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <paul@darkrain42.org>
parents: 30053
diff changeset
874 * @param fd The socket file descriptor.
35a1cf247168 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <paul@darkrain42.org>
parents: 30053
diff changeset
875 *
30156
4aa17d7c4e0a Oops, I forgot to save this before committing.
Paul Aurich <paul@darkrain42.org>
parents: 30153
diff changeset
876 * @return The address family of the socket (AF_INET, AF_INET6, etc) or -1
4aa17d7c4e0a Oops, I forgot to save this before committing.
Paul Aurich <paul@darkrain42.org>
parents: 30153
diff changeset
877 * on error.
30153
35a1cf247168 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <paul@darkrain42.org>
parents: 30053
diff changeset
878 */
35a1cf247168 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <paul@darkrain42.org>
parents: 30053
diff changeset
879 int purple_socket_get_family(int fd);
35a1cf247168 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <paul@darkrain42.org>
parents: 30053
diff changeset
880
35a1cf247168 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <paul@darkrain42.org>
parents: 30053
diff changeset
881 /**
35a1cf247168 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <paul@darkrain42.org>
parents: 30053
diff changeset
882 * Returns TRUE if a socket is capable of speaking IPv4.
35a1cf247168 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <paul@darkrain42.org>
parents: 30053
diff changeset
883 *
35a1cf247168 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <paul@darkrain42.org>
parents: 30053
diff changeset
884 * This is the case for IPv4 sockets and, on some systems, IPv6 sockets
35a1cf247168 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <paul@darkrain42.org>
parents: 30053
diff changeset
885 * (due to the IPv4-mapped address functionality).
35a1cf247168 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <paul@darkrain42.org>
parents: 30053
diff changeset
886 *
35a1cf247168 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <paul@darkrain42.org>
parents: 30053
diff changeset
887 * @param fd The socket file descriptor
35a1cf247168 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <paul@darkrain42.org>
parents: 30053
diff changeset
888 * @return TRUE if a socket can speak IPv4.
35a1cf247168 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <paul@darkrain42.org>
parents: 30053
diff changeset
889 */
35a1cf247168 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <paul@darkrain42.org>
parents: 30053
diff changeset
890 gboolean purple_socket_speaks_ipv4(int fd);
35a1cf247168 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <paul@darkrain42.org>
parents: 30053
diff changeset
891
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
892 /*@}*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
893
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
894
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
895 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
896 /** @name String Functions */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
897 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
898 /*@{*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
899
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
900 /**
25385
a6e3cb32cdd2 Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <paul@darkrain42.org>
parents: 23796
diff changeset
901 * Tests two strings for equality.
a6e3cb32cdd2 Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <paul@darkrain42.org>
parents: 23796
diff changeset
902 *
a6e3cb32cdd2 Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <paul@darkrain42.org>
parents: 23796
diff changeset
903 * Unlike strcmp(), this function will not crash if one or both of the
a6e3cb32cdd2 Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <paul@darkrain42.org>
parents: 23796
diff changeset
904 * strings are @c NULL.
a6e3cb32cdd2 Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <paul@darkrain42.org>
parents: 23796
diff changeset
905 *
a6e3cb32cdd2 Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <paul@darkrain42.org>
parents: 23796
diff changeset
906 * @param left A string
a6e3cb32cdd2 Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <paul@darkrain42.org>
parents: 23796
diff changeset
907 * @param right A string to compare with left
a6e3cb32cdd2 Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <paul@darkrain42.org>
parents: 23796
diff changeset
908 *
a6e3cb32cdd2 Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <paul@darkrain42.org>
parents: 23796
diff changeset
909 * @return @c TRUE if the strings are the same, else @c FALSE.
a6e3cb32cdd2 Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <paul@darkrain42.org>
parents: 23796
diff changeset
910 */
a6e3cb32cdd2 Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <paul@darkrain42.org>
parents: 23796
diff changeset
911 gboolean purple_strequal(const gchar *left, const gchar *right);
a6e3cb32cdd2 Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <paul@darkrain42.org>
parents: 23796
diff changeset
912
a6e3cb32cdd2 Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <paul@darkrain42.org>
parents: 23796
diff changeset
913 /**
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
914 * Normalizes a string, so that it is suitable for comparison.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
915 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
916 * The returned string will point to a static buffer, so if the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
917 * string is intended to be kept long-term, you <i>must</i>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
918 * g_strdup() it. Also, calling normalize() twice in the same line
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
919 * will lead to problems.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
920 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
921 * @param account The account the string belongs to, or NULL if you do
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
922 * not know the account. If you use NULL, the string
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
923 * will still be normalized, but if the PRPL uses a
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
924 * custom normalization function then the string may
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
925 * not be normalized correctly.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
926 * @param str The string to normalize.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
927 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
928 * @return A pointer to the normalized version stored in a static buffer.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
929 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
930 const char *purple_normalize(const PurpleAccount *account, const char *str);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
931
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
932 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
933 * Normalizes a string, so that it is suitable for comparison.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
934 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
935 * This is one possible implementation for the PRPL callback
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
936 * function "normalize." It returns a lowercase and UTF-8
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
937 * normalized version of the string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
938 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
939 * @param account The account the string belongs to.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
940 * @param str The string to normalize.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
941 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
942 * @return A pointer to the normalized version stored in a static buffer.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
943 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
944 const char *purple_normalize_nocase(const PurpleAccount *account, const char *str);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
945
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
946 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
947 * Compares two strings to see if the first contains the second as
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
948 * a proper prefix.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
949 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
950 * @param s The string to check.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
951 * @param p The prefix in question.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
952 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
953 * @return TRUE if p is a prefix of s, otherwise FALSE.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
954 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
955 gboolean purple_str_has_prefix(const char *s, const char *p);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
956
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
957 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
958 * Compares two strings to see if the second is a proper suffix
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
959 * of the first.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
960 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
961 * @param s The string to check.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
962 * @param x The suffix in question.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
963 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
964 * @return TRUE if x is a a suffix of s, otherwise FALSE.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
965 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
966 gboolean purple_str_has_suffix(const char *s, const char *x);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
967
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
968 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
969 * Duplicates a string and replaces all newline characters from the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
970 * source string with HTML linebreaks.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
971 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
972 * @param src The source string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
973 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
974 * @return The new string. Must be g_free'd by the caller.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
975 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
976 gchar *purple_strdup_withhtml(const gchar *src);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
977
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
978 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
979 * Ensures that all linefeeds have a matching carriage return.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
980 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
981 * @param str The source string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
982 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
983 * @return The string with carriage returns.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
984 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
985 char *purple_str_add_cr(const char *str);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
986
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
987 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
988 * Strips all instances of the given character from the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
989 * given string. The string is modified in place. This
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
990 * is useful for stripping new line characters, for example.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
991 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
992 * Example usage:
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
993 * purple_str_strip_char(my_dumb_string, '\n');
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
994 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
995 * @param str The string to strip characters from.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
996 * @param thechar The character to strip from the given string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
997 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
998 void purple_str_strip_char(char *str, char thechar);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
999
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1000 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1001 * Given a string, this replaces all instances of one character
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1002 * with another. This happens inline (the original string IS
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1003 * modified).
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1004 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1005 * @param string The string from which to replace stuff.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1006 * @param delimiter The character you want replaced.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1007 * @param replacement The character you want inserted in place
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1008 * of the delimiting character.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1009 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1010 void purple_util_chrreplace(char *string, char delimiter,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1011 char replacement);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1012
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1013 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1014 * Given a string, this replaces one substring with another
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1015 * and returns a newly allocated string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1016 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1017 * @param string The string from which to replace stuff.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1018 * @param delimiter The substring you want replaced.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1019 * @param replacement The substring you want inserted in place
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1020 * of the delimiting substring.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1021 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1022 * @return A new string, after performing the substitution.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1023 * free this with g_free().
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1024 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1025 gchar *purple_strreplace(const char *string, const char *delimiter,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1026 const char *replacement);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1027
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1028
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1029 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1030 * Given a string, this replaces any utf-8 substrings in that string with
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1031 * the corresponding numerical character reference, and returns a newly
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1032 * allocated string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1033 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1034 * @param in The string which might contain utf-8 substrings
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1035 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1036 * @return A new string, with utf-8 replaced with numerical character
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1037 * references, free this with g_free()
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1038 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1039 char *purple_utf8_ncr_encode(const char *in);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1040
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1041
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1042 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1043 * Given a string, this replaces any numerical character references
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1044 * in that string with the corresponding actual utf-8 substrings,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1045 * and returns a newly allocated string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1046 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1047 * @param in The string which might contain numerical character references.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1048 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1049 * @return A new string, with numerical character references
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1050 * replaced with actual utf-8, free this with g_free().
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1051 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1052 char *purple_utf8_ncr_decode(const char *in);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1053
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1054
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1055 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1056 * Given a string, this replaces one substring with another
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1057 * ignoring case and returns a newly allocated string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1058 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1059 * @param string The string from which to replace stuff.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1060 * @param delimiter The substring you want replaced.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1061 * @param replacement The substring you want inserted in place
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1062 * of the delimiting substring.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1063 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1064 * @return A new string, after performing the substitution.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1065 * free this with g_free().
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1066 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1067 gchar *purple_strcasereplace(const char *string, const char *delimiter,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1068 const char *replacement);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1069
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1070 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1071 * This is like strstr, except that it ignores ASCII case in
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1072 * searching for the substring.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1073 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1074 * @param haystack The string to search in.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1075 * @param needle The substring to find.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1076 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1077 * @return the location of the substring if found, or NULL if not
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1078 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1079 const char *purple_strcasestr(const char *haystack, const char *needle);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1080
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1081 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1082 * Returns a string representing a filesize in the appropriate
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1083 * units (MB, KB, GB, etc.)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1084 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1085 * @param size The size
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1086 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1087 * @return The string in units form. This must be freed.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1088 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1089 char *purple_str_size_to_units(size_t size);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1090
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1091 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1092 * Converts seconds into a human-readable form.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1093 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1094 * @param sec The seconds.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1095 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1096 * @return A human-readable form, containing days, hours, minutes, and
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1097 * seconds.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1098 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1099 char *purple_str_seconds_to_string(guint sec);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1100
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1101 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1102 * Converts a binary string into a NUL terminated ascii string,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1103 * replacing nonascii characters and characters below SPACE (including
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1104 * NUL) into \\xyy, where yy are two hex digits. Also backslashes are
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1105 * changed into two backslashes (\\\\). The returned, newly allocated
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1106 * string can be outputted to the console, and must be g_free()d.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1107 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1108 * @param binary A string of random data, possibly with embedded NULs
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1109 * and such.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1110 * @param len The length in bytes of the input string. Must not be 0.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1111 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1112 * @return A newly allocated ASCIIZ string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1113 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1114 char *purple_str_binary_to_ascii(const unsigned char *binary, guint len);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1115 /*@}*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1116
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1117
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1118 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1119 /** @name URI/URL Functions */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1120 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1121 /*@{*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1122
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1123 void purple_got_protocol_handler_uri(const char *uri);
15613
b0471b2a1de9 Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15421
diff changeset
1124
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1125 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1126 * Parses a URL, returning its host, port, file path, username and password.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1127 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1128 * The returned data must be freed.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1129 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1130 * @param url The URL to parse.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1131 * @param ret_host The returned host.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1132 * @param ret_port The returned port.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1133 * @param ret_path The returned path.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1134 * @param ret_user The returned username.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1135 * @param ret_passwd The returned password.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1136 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1137 gboolean purple_url_parse(const char *url, char **ret_host, int *ret_port,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1138 char **ret_path, char **ret_user, char **ret_passwd);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1139
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1140 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1141 * This is the signature used for functions that act as the callback
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1142 * to purple_util_fetch_url() or purple_util_fetch_url_request().
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1143 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1144 * @param url_data The same value that was returned when you called
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1145 * purple_fetch_url() or purple_fetch_url_request().
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1146 * @param user_data The user data that your code passed into either
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1147 * purple_util_fetch_url() or purple_util_fetch_url_request().
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1148 * @param url_text This will be NULL on error. Otherwise this
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1149 * will contain the contents of the URL.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1150 * @param len 0 on error, otherwise this is the length of buf.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1151 * @param error_message If something went wrong then this will contain
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1152 * a descriptive error message, and buf will be
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1153 * NULL and len will be 0.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1154 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1155 typedef void (*PurpleUtilFetchUrlCallback)(PurpleUtilFetchUrlData *url_data, gpointer user_data, const gchar *url_text, gsize len, const gchar *error_message);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1156
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1157 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1158 * Fetches the data from a URL, and passes it to a callback function.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1159 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1160 * @param url The URL.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1161 * @param full TRUE if this is the full URL, or FALSE if it's a
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1162 * partial URL.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1163 * @param user_agent The user agent field to use, or NULL.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1164 * @param http11 TRUE if HTTP/1.1 should be used to download the file.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1165 * @param cb The callback function.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1166 * @param data The user data to pass to the callback function.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1167 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1168 #define purple_util_fetch_url(url, full, user_agent, http11, cb, data) \
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1169 purple_util_fetch_url_request(url, full, user_agent, http11, NULL, \
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1170 FALSE, cb, data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1171
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1172 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1173 * Fetches the data from a URL, and passes it to a callback function.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1174 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1175 * @param url The URL.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1176 * @param full TRUE if this is the full URL, or FALSE if it's a
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1177 * partial URL.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1178 * @param user_agent The user agent field to use, or NULL.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1179 * @param http11 TRUE if HTTP/1.1 should be used to download the file.
23742
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1180 * @param max_len The maximum number of bytes to retrieve (-1 for unlimited)
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1181 * @param cb The callback function.
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1182 * @param data The user data to pass to the callback function.
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1183 * @deprecated In 3.0.0, we'll rename this to "purple_util_fetch_url" and get rid of the old one
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1184 */
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1185 #define purple_util_fetch_url_len(url, full, user_agent, http11, max_len, cb, data) \
32320
7df08e88d9bb Rename purple_util_fetch_url_request_len_with_account to
Mark Doliner <mark@kingant.net>
parents: 32319
diff changeset
1186 purple_util_fetch_url_request_len(NULL, url, full, user_agent, http11, NULL, \
23742
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1187 FALSE, max_len, cb, data);
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1188
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1189 /**
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1190 * Fetches the data from a URL, and passes it to a callback function.
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1191 *
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1192 * @param url The URL.
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1193 * @param full TRUE if this is the full URL, or FALSE if it's a
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1194 * partial URL.
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1195 * @param user_agent The user agent field to use, or NULL.
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1196 * @param http11 TRUE if HTTP/1.1 should be used to download the file.
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1197 * @param request A HTTP request to send to the server instead of the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1198 * standard GET
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1199 * @param include_headers
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1200 * If TRUE, include the HTTP headers in the response.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1201 * @param callback The callback function.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1202 * @param data The user data to pass to the callback function.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1203 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1204 PurpleUtilFetchUrlData *purple_util_fetch_url_request(const gchar *url,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1205 gboolean full, const gchar *user_agent, gboolean http11,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1206 const gchar *request, gboolean include_headers,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1207 PurpleUtilFetchUrlCallback callback, gpointer data);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1208
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1209 /**
23742
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1210 * Fetches the data from a URL, and passes it to a callback function.
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1211 *
27051
f303787f144d Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 26854
diff changeset
1212 * @param account The account for which the request is needed, or NULL.
f303787f144d Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 26854
diff changeset
1213 * @param url The URL.
f303787f144d Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 26854
diff changeset
1214 * @param full TRUE if this is the full URL, or FALSE if it's a
f303787f144d Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 26854
diff changeset
1215 * partial URL.
f303787f144d Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 26854
diff changeset
1216 * @param user_agent The user agent field to use, or NULL.
f303787f144d Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 26854
diff changeset
1217 * @param http11 TRUE if HTTP/1.1 should be used to download the file.
f303787f144d Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 26854
diff changeset
1218 * @param request A HTTP request to send to the server instead of the
f303787f144d Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 26854
diff changeset
1219 * standard GET
f303787f144d Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 26854
diff changeset
1220 * @param include_headers
f303787f144d Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 26854
diff changeset
1221 * If TRUE, include the HTTP headers in the response.
f303787f144d Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 26854
diff changeset
1222 * @param max_len The maximum number of bytes to retrieve (-1 for unlimited)
f303787f144d Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 26854
diff changeset
1223 * @param callback The callback function.
f303787f144d Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 26854
diff changeset
1224 * @param data The user data to pass to the callback function.
32356
161df36133ae Add this @deprecated flag back in here so we know this still needs work
Mark Doliner <mark@kingant.net>
parents: 32320
diff changeset
1225 * @deprecated In 3.0.0, we'll rename this to "purple_util_fetch_url_request" and get rid of the old one
23742
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1226 */
32320
7df08e88d9bb Rename purple_util_fetch_url_request_len_with_account to
Mark Doliner <mark@kingant.net>
parents: 32319
diff changeset
1227 PurpleUtilFetchUrlData *purple_util_fetch_url_request_len(
27051
f303787f144d Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 26854
diff changeset
1228 PurpleAccount *account, const gchar *url,
23742
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1229 gboolean full, const gchar *user_agent, gboolean http11,
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1230 const gchar *request, gboolean include_headers, gssize max_len,
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1231 PurpleUtilFetchUrlCallback callback, gpointer data);
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1232
de8f2d3e538a Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23583
diff changeset
1233 /**
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1234 * Cancel a pending URL request started with either
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1235 * purple_util_fetch_url_request() or purple_util_fetch_url().
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1236 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1237 * @param url_data The data returned when you initiated the URL fetch.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1238 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1239 void purple_util_fetch_url_cancel(PurpleUtilFetchUrlData *url_data);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1240
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1241 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1242 * Decodes a URL into a plain string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1243 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1244 * This will change hex codes and such to their ascii equivalents.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1245 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1246 * @param str The string to translate.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1247 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1248 * @return The resulting string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1249 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1250 const char *purple_url_decode(const char *str);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1251
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1252 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1253 * Encodes a URL into an escaped string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1254 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1255 * This will change non-alphanumeric characters to hex codes.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1256 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1257 * @param str The string to translate.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1258 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1259 * @return The resulting string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1260 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1261 const char *purple_url_encode(const char *str);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1262
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1263 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1264 * Checks if the given email address is syntactically valid.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1265 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1266 * @param address The email address to validate.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1267 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1268 * @return True if the email address is syntactically correct.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1269 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1270 gboolean purple_email_is_valid(const char *address);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1271
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1272 /**
22327
dc47e908965f Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <stu@nosnilmot.com>
parents: 22000
diff changeset
1273 * Checks if the given IP address is a syntactically valid IPv4 address.
dc47e908965f Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <stu@nosnilmot.com>
parents: 22000
diff changeset
1274 *
22870
3d7e9eff04d0 Assorted cleanups, mostly to the Doxygen comments. I added a few missing
Richard Laager <rlaager@wiktel.com>
parents: 22659
diff changeset
1275 * @param ip The IP address to validate.
22327
dc47e908965f Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <stu@nosnilmot.com>
parents: 22000
diff changeset
1276 *
dc47e908965f Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <stu@nosnilmot.com>
parents: 22000
diff changeset
1277 * @return True if the IP address is syntactically correct.
27545
8c41a23e6b44 Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents: 27476
diff changeset
1278 * @deprecated This function will be replaced with one that validates
8c41a23e6b44 Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents: 27476
diff changeset
1279 * as either IPv4 or IPv6 in 3.0.0. If you don't want this,
8c41a23e6b44 Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents: 27476
diff changeset
1280 * behavior, use one of the more specific functions.
22327
dc47e908965f Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <stu@nosnilmot.com>
parents: 22000
diff changeset
1281 */
dc47e908965f Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <stu@nosnilmot.com>
parents: 22000
diff changeset
1282 gboolean purple_ip_address_is_valid(const char *ip);
dc47e908965f Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <stu@nosnilmot.com>
parents: 22000
diff changeset
1283
dc47e908965f Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <stu@nosnilmot.com>
parents: 22000
diff changeset
1284 /**
27545
8c41a23e6b44 Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents: 27476
diff changeset
1285 * Checks if the given IP address is a syntactically valid IPv4 address.
8c41a23e6b44 Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents: 27476
diff changeset
1286 *
8c41a23e6b44 Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents: 27476
diff changeset
1287 * @param ip The IP address to validate.
8c41a23e6b44 Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents: 27476
diff changeset
1288 *
8c41a23e6b44 Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents: 27476
diff changeset
1289 * @return True if the IP address is syntactically correct.
8c41a23e6b44 Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents: 27476
diff changeset
1290 */
8c41a23e6b44 Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents: 27476
diff changeset
1291 gboolean purple_ipv4_address_is_valid(const char *ip);
8c41a23e6b44 Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents: 27476
diff changeset
1292
8c41a23e6b44 Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents: 27476
diff changeset
1293 /**
8c41a23e6b44 Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents: 27476
diff changeset
1294 * Checks if the given IP address is a syntactically valid IPv6 address.
8c41a23e6b44 Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents: 27476
diff changeset
1295 *
8c41a23e6b44 Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents: 27476
diff changeset
1296 * @param ip The IP address to validate.
8c41a23e6b44 Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents: 27476
diff changeset
1297 *
8c41a23e6b44 Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents: 27476
diff changeset
1298 * @return True if the IP address is syntactically correct.
8c41a23e6b44 Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents: 27476
diff changeset
1299 */
8c41a23e6b44 Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents: 27476
diff changeset
1300 gboolean purple_ipv6_address_is_valid(const char *ip);
8c41a23e6b44 Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents: 27476
diff changeset
1301
8c41a23e6b44 Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents: 27476
diff changeset
1302 /**
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1303 * This function extracts a list of URIs from the a "text/uri-list"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1304 * string. It was "borrowed" from gnome_uri_list_extract_uris
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1305 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1306 * @param uri_list An uri-list in the standard format.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1307 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1308 * @return A GList containing strings allocated with g_malloc
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1309 * that have been splitted from uri-list.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1310 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1311 GList *purple_uri_list_extract_uris(const gchar *uri_list);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1312
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1313 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1314 * This function extracts a list of filenames from a
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1315 * "text/uri-list" string. It was "borrowed" from
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1316 * gnome_uri_list_extract_filenames
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1317 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1318 * @param uri_list A uri-list in the standard format.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1319 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1320 * @return A GList containing strings allocated with g_malloc that
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1321 * contain the filenames in the uri-list. Note that unlike
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1322 * purple_uri_list_extract_uris() function, this will discard
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1323 * any non-file uri from the result value.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1324 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1325 GList *purple_uri_list_extract_filenames(const gchar *uri_list);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1326
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1327 /*@}*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1328
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1329 /**************************************************************************
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1330 * UTF8 String Functions
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1331 **************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1332 /*@{*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1333
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1334 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1335 * Attempts to convert a string to UTF-8 from an unknown encoding.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1336 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1337 * This function checks the locale and tries sane defaults.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1338 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1339 * @param str The source string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1340 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1341 * @return The UTF-8 string, or @c NULL if it could not be converted.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1342 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1343 gchar *purple_utf8_try_convert(const char *str);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1344
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1345 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1346 * Salvages the valid UTF-8 characters from a string, replacing any
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1347 * invalid characters with a filler character (currently hardcoded to
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1348 * '?').
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1349 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1350 * @param str The source string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1351 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1352 * @return A valid UTF-8 string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1353 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1354 gchar *purple_utf8_salvage(const char *str);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1355
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1356 /**
27101
bf9db4c67679 Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <paul@darkrain42.org>
parents: 27094
diff changeset
1357 * Removes unprintable characters from a UTF-8 string. These characters
bf9db4c67679 Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <paul@darkrain42.org>
parents: 27094
diff changeset
1358 * (in particular low-ASCII characters) are invalid in XML 1.0 and thus
28453
c9c038529f38 Hmm, g_unichar_isgraph is too restrictive in the characters allowed (it munges \t). Change purple_utf8_strip_unprintables to simply remove ASCII control characters instead.
Paul Aurich <paul@darkrain42.org>
parents: 27545
diff changeset
1359 * are not allowed in XMPP and are rejected by libxml2 by default.
c9c038529f38 Hmm, g_unichar_isgraph is too restrictive in the characters allowed (it munges \t). Change purple_utf8_strip_unprintables to simply remove ASCII control characters instead.
Paul Aurich <paul@darkrain42.org>
parents: 27545
diff changeset
1360 *
c9c038529f38 Hmm, g_unichar_isgraph is too restrictive in the characters allowed (it munges \t). Change purple_utf8_strip_unprintables to simply remove ASCII control characters instead.
Paul Aurich <paul@darkrain42.org>
parents: 27545
diff changeset
1361 * The returned string must be freed by the caller.
27101
bf9db4c67679 Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <paul@darkrain42.org>
parents: 27094
diff changeset
1362 *
bf9db4c67679 Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <paul@darkrain42.org>
parents: 27094
diff changeset
1363 * @param str A valid UTF-8 string.
bf9db4c67679 Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <paul@darkrain42.org>
parents: 27094
diff changeset
1364 *
bf9db4c67679 Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <paul@darkrain42.org>
parents: 27094
diff changeset
1365 * @return A newly allocated UTF-8 string without the unprintable characters.
bf9db4c67679 Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <paul@darkrain42.org>
parents: 27094
diff changeset
1366 */
bf9db4c67679 Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <paul@darkrain42.org>
parents: 27094
diff changeset
1367 gchar *purple_utf8_strip_unprintables(const gchar *str);
bf9db4c67679 Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <paul@darkrain42.org>
parents: 27094
diff changeset
1368
bf9db4c67679 Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <paul@darkrain42.org>
parents: 27094
diff changeset
1369 /**
21862
ae58ffd5e929 Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents: 21248
diff changeset
1370 * Return the UTF-8 version of gai_strerror(). It calls gai_strerror()
ae58ffd5e929 Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents: 21248
diff changeset
1371 * then converts the result to UTF-8. This function is analogous to
ae58ffd5e929 Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents: 21248
diff changeset
1372 * g_strerror().
ae58ffd5e929 Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents: 21248
diff changeset
1373 *
ae58ffd5e929 Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents: 21248
diff changeset
1374 * @param errnum The error code.
ae58ffd5e929 Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents: 21248
diff changeset
1375 *
ae58ffd5e929 Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents: 21248
diff changeset
1376 * @return The UTF-8 error message.
ae58ffd5e929 Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents: 21248
diff changeset
1377 */
ae58ffd5e929 Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents: 21248
diff changeset
1378 G_CONST_RETURN gchar *purple_gai_strerror(gint errnum);
ae58ffd5e929 Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents: 21248
diff changeset
1379
ae58ffd5e929 Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents: 21248
diff changeset
1380 /**
25082
eece2d17ab65 I'm pretty sure this is what we meant here.
Etan Reisner <pidgin@unreliablesource.net>
parents: 23796
diff changeset
1381 * Compares two UTF-8 strings case-insensitively. This comparison is
16152
a740afef2daf Slightly more descriptive
Mark Doliner <mark@kingant.net>
parents: 16084
diff changeset
1382 * more expensive than a simple g_utf8_collate() comparison because
a740afef2daf Slightly more descriptive
Mark Doliner <mark@kingant.net>
parents: 16084
diff changeset
1383 * it calls g_utf8_casefold() on each string, which allocates new
a740afef2daf Slightly more descriptive
Mark Doliner <mark@kingant.net>
parents: 16084
diff changeset
1384 * strings.
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1385 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1386 * @param a The first string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1387 * @param b The second string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1388 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1389 * @return -1 if @a is less than @a b.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1390 * 0 if @a is equal to @a b.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1391 * 1 if @a is greater than @a b.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1392 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1393 int purple_utf8_strcasecmp(const char *a, const char *b);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1394
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1395 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1396 * Case insensitive search for a word in a string. The needle string
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1397 * must be contained in the haystack string and not be immediately
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1398 * preceded or immediately followed by another alpha-numeric character.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1399 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1400 * @param haystack The string to search in.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1401 * @param needle The substring to find.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1402 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1403 * @return TRUE if haystack has the word, otherwise FALSE
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1404 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1405 gboolean purple_utf8_has_word(const char *haystack, const char *needle);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1406
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1407 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1408 * Prints a UTF-8 message to the given file stream. The function
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1409 * tries to convert the UTF-8 message to user's locale. If this
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1410 * is not possible, the original UTF-8 text will be printed.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1411 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1412 * @param filestream The file stream (e.g. STDOUT or STDERR)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1413 * @param message The message to print.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1414 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1415 void purple_print_utf8_to_console(FILE *filestream, char *message);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1416
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1417 /**
18363
700b642631bc Remove static meify from yahoochat.c and replace use of it with
Will Thompson <will.thompson@collabora.co.uk>
parents: 18259
diff changeset
1418 * Checks for messages starting (post-HTML) with "/me ", including the space.
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1419 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1420 * @param message The message to check
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1421 * @param len The message length, or -1
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1422 *
18363
700b642631bc Remove static meify from yahoochat.c and replace use of it with
Will Thompson <will.thompson@collabora.co.uk>
parents: 18259
diff changeset
1423 * @return TRUE if it starts with "/me ", and it has been removed, otherwise
700b642631bc Remove static meify from yahoochat.c and replace use of it with
Will Thompson <will.thompson@collabora.co.uk>
parents: 18259
diff changeset
1424 * FALSE
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1425 */
19408
cc36a5aac908 Fix some conversion warnings about using negative values with unsigned types. There are more, but these were easy fixes. You may think that I'm changing the API, but I'm really not - it was just wrong.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 18363
diff changeset
1426 gboolean purple_message_meify(char *message, gssize len);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1427
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1428 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1429 * Removes the underscore characters from a string used identify the mnemonic
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1430 * character.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1431 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1432 * @param in The string to strip
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1433 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1434 * @return The stripped string
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1435 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1436 char *purple_text_strip_mnemonic(const char *in);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1437
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1438 /*@}*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1439
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1440 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1441 * Adds 8 to something.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1442 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1443 * Blame SimGuy.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1444 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1445 * @param x The number to add 8 to.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1446 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1447 * @return x + 8
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1448 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1449 #define purple_add_eight(x) ((x)+8)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1450
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1451 /**
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1452 * Does the reverse of purple_escape_filename
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1453 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1454 * This will change hex codes and such to their ascii equivalents.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1455 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1456 * @param str The string to translate.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1457 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1458 * @return The resulting string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1459 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1460 const char *purple_unescape_filename(const char *str);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1461
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1462 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1463 * Escapes filesystem-unfriendly characters from a filename
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1464 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1465 * @param str The string to translate.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1466 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1467 * @return The resulting string.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1468 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1469 const char *purple_escape_filename(const char *str);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1470
15421
6d8728fd3dda Make sure the pounces, buddy-aliases, savedstatuses etc. saved before the aim/icq split works after the split. The util function _gaim_oscar_convert will be removed at a 'suitable' time in the future.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15374
diff changeset
1471 /**
15646
61b42cf81aa4 Restore default signal handlers in fork()'d children. This adds a gaim_restore_default_signal_handlers() utility function since children are made in multiple places.
Evan Schoenberg <evan.s@dreskin.net>
parents: 15613
diff changeset
1472 * Restore default signal handlers for signals which might reasonably have
61b42cf81aa4 Restore default signal handlers in fork()'d children. This adds a gaim_restore_default_signal_handlers() utility function since children are made in multiple places.
Evan Schoenberg <evan.s@dreskin.net>
parents: 15613
diff changeset
1473 * handlers. This should be called by a fork()'d child process, since child processes
61b42cf81aa4 Restore default signal handlers in fork()'d children. This adds a gaim_restore_default_signal_handlers() utility function since children are made in multiple places.
Evan Schoenberg <evan.s@dreskin.net>
parents: 15613
diff changeset
1474 * inherit the handlers of the parent.
61b42cf81aa4 Restore default signal handlers in fork()'d children. This adds a gaim_restore_default_signal_handlers() utility function since children are made in multiple places.
Evan Schoenberg <evan.s@dreskin.net>
parents: 15613
diff changeset
1475 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1476 void purple_restore_default_signal_handlers(void);
16375
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16201
diff changeset
1477
23583
399975ad001c Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23182
diff changeset
1478 /**
399975ad001c Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23182
diff changeset
1479 * Gets the host name of the machine. If it not possible to determine the
399975ad001c Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23182
diff changeset
1480 * host name, "localhost" is returned
399975ad001c Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23182
diff changeset
1481 *
399975ad001c Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23182
diff changeset
1482 * @constreturn The hostname
399975ad001c Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23182
diff changeset
1483 */
399975ad001c Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23182
diff changeset
1484 const gchar *purple_get_host_name(void);
399975ad001c Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23182
diff changeset
1485
29523
ecd2136ff818 Broke out the generation of random UUIDs to its own function
Marcus Lundblad <ml@update.uu.se>
parents: 28493
diff changeset
1486 /**
ecd2136ff818 Broke out the generation of random UUIDs to its own function
Marcus Lundblad <ml@update.uu.se>
parents: 28493
diff changeset
1487 * Returns a type 4 (random) UUID
ecd2136ff818 Broke out the generation of random UUIDs to its own function
Marcus Lundblad <ml@update.uu.se>
parents: 28493
diff changeset
1488 *
ecd2136ff818 Broke out the generation of random UUIDs to its own function
Marcus Lundblad <ml@update.uu.se>
parents: 28493
diff changeset
1489 * @return A UUID, caller is responsible for freeing it
ecd2136ff818 Broke out the generation of random UUIDs to its own function
Marcus Lundblad <ml@update.uu.se>
parents: 28493
diff changeset
1490 */
ecd2136ff818 Broke out the generation of random UUIDs to its own function
Marcus Lundblad <ml@update.uu.se>
parents: 28493
diff changeset
1491 gchar *purple_uuid_random(void);
ecd2136ff818 Broke out the generation of random UUIDs to its own function
Marcus Lundblad <ml@update.uu.se>
parents: 28493
diff changeset
1492
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1493 #ifdef __cplusplus
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1494 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1495 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1496
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15646
diff changeset
1497 #endif /* _PURPLE_UTIL_H_ */