Wed, 20 Jun 2007 01:28:57 +0000
Bring back MAXPATHLEN (which was always guaranteed to be defined earlier
anyway, zephyr was just missing the appropriate #include) and fix core.c
for building on glib < 2.4, and a small tweak to the compatibility #define
for G_GNUC_NULL_TERMINATED
|
5034
077678f7b048
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
5032
diff
changeset
|
1 | /** |
|
16256
8c912f6c4f43
Relabel the Doxygen group as libpurple
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
2 | * @defgroup core libpurple |
|
5034
077678f7b048
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
5032
diff
changeset
|
3 | * |
| 15884 | 4 | * purple |
| 2417 | 5 | * |
| 15884 | 6 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 7 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 8 | * source distribution. | |
|
6612
aac6af649208
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
9 | * |
| 2417 | 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by | |
| 12 | * the Free Software Foundation; either version 2 of the License, or | |
| 13 | * (at your option) any later version. | |
| 14 | * | |
| 15 | * This program is distributed in the hope that it will be useful, | |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 18 | * GNU General Public License for more details. | |
| 19 | * | |
| 20 | * You should have received a copy of the GNU General Public License | |
| 21 | * along with this program; if not, write to the Free Software | |
| 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 23 | */ | |
| 15884 | 24 | #ifndef _PURPLE_CORE_H_ |
| 25 | #define _PURPLE_CORE_H_ | |
| 2417 | 26 | |
| 15884 | 27 | typedef struct PurpleCore PurpleCore; |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
28 | |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
29 | typedef struct |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
30 | { |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
31 | void (*ui_prefs_init)(void); |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
32 | void (*debug_ui_init)(void); /* Unfortunate necessity. */ |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
33 | void (*ui_init)(void); |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
34 | void (*quit)(void); |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
35 | |
|
16743
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
16409
diff
changeset
|
36 | void (*_purple_reserved1)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
16409
diff
changeset
|
37 | void (*_purple_reserved2)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
16409
diff
changeset
|
38 | void (*_purple_reserved3)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
16409
diff
changeset
|
39 | void (*_purple_reserved4)(void); |
| 15884 | 40 | } PurpleCoreUiOps; |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
41 | |
|
6314
25bba03c42cd
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
42 | #ifdef __cplusplus |
|
25bba03c42cd
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
43 | extern "C" { |
|
25bba03c42cd
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
44 | #endif |
|
25bba03c42cd
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
45 | |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
46 | /** |
| 15884 | 47 | * Initializes the core of purple. |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
48 | * |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
49 | * This will setup preferences for all the core subsystems. |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
50 | * |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
51 | * @param ui The ID of the UI using the core. This should be a |
| 15884 | 52 | * unique ID, registered with the purple team. |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
53 | * |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
54 | * @return @c TRUE if successful, or @c FALSE otherwise. |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
55 | */ |
| 15884 | 56 | gboolean purple_core_init(const char *ui); |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
57 | |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
58 | /** |
| 15884 | 59 | * Quits the core of purple, which, depending on the UI, may quit the |
| 60 | * application using the purple core. | |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
61 | */ |
| 15884 | 62 | void purple_core_quit(void); |
| 2417 | 63 | |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
64 | /** |
| 15884 | 65 | * Calls purple_core_quit(). This can be used as the function |
| 66 | * passed to purple_timeout_add() when you want to shutdown Purple | |
| 67 | * in a specified amount of time. When shutting down Purple | |
|
7646
6806a6893ac0
[gaim-migrate @ 8289]
Mark Doliner <markdoliner@pidgin.im>
parents:
7082
diff
changeset
|
68 | * from a plugin, you must use this with a timeout value of 0: |
| 15884 | 69 | * purple_timeout_add(0, purple_core_quitcb, NULL); |
|
7646
6806a6893ac0
[gaim-migrate @ 8289]
Mark Doliner <markdoliner@pidgin.im>
parents:
7082
diff
changeset
|
70 | * This is ensures that code from your plugin is not being |
| 15884 | 71 | * executed when purple_core_quit() is called. Otherwise you |
| 72 | * would get a core dump after purple_core_quit() executes and | |
| 73 | * control returns to your plugin because purple_core_quit() frees | |
|
7646
6806a6893ac0
[gaim-migrate @ 8289]
Mark Doliner <markdoliner@pidgin.im>
parents:
7082
diff
changeset
|
74 | * all plugins. |
|
6806a6893ac0
[gaim-migrate @ 8289]
Mark Doliner <markdoliner@pidgin.im>
parents:
7082
diff
changeset
|
75 | */ |
| 15884 | 76 | gboolean purple_core_quit_cb(gpointer unused); |
|
7646
6806a6893ac0
[gaim-migrate @ 8289]
Mark Doliner <markdoliner@pidgin.im>
parents:
7082
diff
changeset
|
77 | |
|
6806a6893ac0
[gaim-migrate @ 8289]
Mark Doliner <markdoliner@pidgin.im>
parents:
7082
diff
changeset
|
78 | /** |
|
6612
aac6af649208
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
79 | * Returns the version of the core library. |
|
aac6af649208
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
80 | * |
|
aac6af649208
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
81 | * @return The version of the core library. |
|
aac6af649208
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
82 | */ |
| 15884 | 83 | const char *purple_core_get_version(void); |
|
6612
aac6af649208
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
84 | |
|
aac6af649208
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
85 | /** |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
86 | * Returns the ID of the UI that is using the core. |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
87 | * |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
88 | * @return The ID of the UI that is currently using the core. |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
89 | */ |
| 15884 | 90 | const char *purple_core_get_ui(void); |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
91 | |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
92 | /** |
| 15884 | 93 | * Returns a handle to the purple core. |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
94 | * |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
95 | * This is used for such things as signals. |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
96 | */ |
| 15884 | 97 | PurpleCore *purple_get_core(void); |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
98 | |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
99 | /** |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
100 | * Sets the UI ops for the core. |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
101 | * |
|
12369
5635c1f02708
[gaim-migrate @ 14673]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11035
diff
changeset
|
102 | * @param ops A UI ops structure for the core. |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
103 | */ |
| 15884 | 104 | void purple_core_set_ui_ops(PurpleCoreUiOps *ops); |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
105 | |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
106 | /** |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
107 | * Returns the UI ops for the core. |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
108 | * |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
109 | * @return The core's UI ops structure. |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
110 | */ |
| 15884 | 111 | PurpleCoreUiOps *purple_core_get_ui_ops(void); |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
112 | |
|
16409
8c153c6febdd
The core portion of the migration code. This is implemented as I described
Richard Laager <rlaager@pidgin.im>
parents:
16256
diff
changeset
|
113 | /** |
|
8c153c6febdd
The core portion of the migration code. This is implemented as I described
Richard Laager <rlaager@pidgin.im>
parents:
16256
diff
changeset
|
114 | * Migrates from .gaim to .purple. |
|
8c153c6febdd
The core portion of the migration code. This is implemented as I described
Richard Laager <rlaager@pidgin.im>
parents:
16256
diff
changeset
|
115 | * |
|
8c153c6febdd
The core portion of the migration code. This is implemented as I described
Richard Laager <rlaager@pidgin.im>
parents:
16256
diff
changeset
|
116 | * UIs MUST NOT call this if they have been told to use a custom |
|
8c153c6febdd
The core portion of the migration code. This is implemented as I described
Richard Laager <rlaager@pidgin.im>
parents:
16256
diff
changeset
|
117 | * user directory. |
|
8c153c6febdd
The core portion of the migration code. This is implemented as I described
Richard Laager <rlaager@pidgin.im>
parents:
16256
diff
changeset
|
118 | * |
|
8c153c6febdd
The core portion of the migration code. This is implemented as I described
Richard Laager <rlaager@pidgin.im>
parents:
16256
diff
changeset
|
119 | * @return A boolean indicating success or migration failure. On failure, |
|
8c153c6febdd
The core portion of the migration code. This is implemented as I described
Richard Laager <rlaager@pidgin.im>
parents:
16256
diff
changeset
|
120 | * the application must display an error to the user and then exit. |
|
8c153c6febdd
The core portion of the migration code. This is implemented as I described
Richard Laager <rlaager@pidgin.im>
parents:
16256
diff
changeset
|
121 | */ |
|
8c153c6febdd
The core portion of the migration code. This is implemented as I described
Richard Laager <rlaager@pidgin.im>
parents:
16256
diff
changeset
|
122 | gboolean purple_core_migrate(void); |
|
8c153c6febdd
The core portion of the migration code. This is implemented as I described
Richard Laager <rlaager@pidgin.im>
parents:
16256
diff
changeset
|
123 | |
|
17121
43d41f5ce17b
Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents:
16743
diff
changeset
|
124 | /** |
|
43d41f5ce17b
Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents:
16743
diff
changeset
|
125 | * Ensures that only one instance is running. |
|
43d41f5ce17b
Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents:
16743
diff
changeset
|
126 | * |
|
17122
5ba216aa4583
Style changes + removed unnecessary NULL checks.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17121
diff
changeset
|
127 | * @return A boolean such that @c TRUE indicates that this is the first instance, |
|
5ba216aa4583
Style changes + removed unnecessary NULL checks.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17121
diff
changeset
|
128 | * whereas @c FALSE indicates that there is another instance running. |
|
17883
85abd6e343df
Document the API changes.
Richard Laager <rlaager@pidgin.im>
parents:
17122
diff
changeset
|
129 | * |
|
85abd6e343df
Document the API changes.
Richard Laager <rlaager@pidgin.im>
parents:
17122
diff
changeset
|
130 | * @since 2.1.0 |
|
17121
43d41f5ce17b
Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents:
16743
diff
changeset
|
131 | */ |
|
43d41f5ce17b
Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents:
16743
diff
changeset
|
132 | gboolean purple_core_ensure_single_instance(void); |
|
43d41f5ce17b
Alternative dbus_uniq implementation
Gabriel Schulhof <nix@go-nix.ca>
parents:
16743
diff
changeset
|
133 | |
|
6314
25bba03c42cd
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
134 | #ifdef __cplusplus |
|
25bba03c42cd
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
135 | } |
|
25bba03c42cd
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
136 | #endif |
|
25bba03c42cd
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
137 | |
| 15884 | 138 | #endif /* _PURPLE_CORE_H_ */ |
| 5862 | 139 | |
| 140 | /* | |
| 141 | ||
| 142 | /===- | |
| 143 | `//"\\ """"`---.___.-"" | |
| 144 | ______-==| | | \\ _-"` | |
| 145 | __--""" ,-/-==\\ | | `\ ,' | |
| 146 | _-" /' | \\ ___ / / \ / | |
| 147 | .' / | \\ /" "\ /' / \ /' | |
|
6169
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
148 | / ____ / | \`\.__/-"" D O \_/' / \/' |
|
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
149 | /-'" """""---__ | "-/" O G R /' _--"` |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
150 | \_| / R __--_ t ), __--"" |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
151 | '""--_/ T _-"_>--<_\ h '-" \ |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
152 | {\__--_/} / \\__>--<__\ e B \ |
|
6169
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
153 | /' (_/ _-" | |__>--<__| U | |
|
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
154 | | _/) )-" | |__>--<__| R | |
|
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
155 | / /" ,_/ / /__>---<__/ N | |
|
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
156 | o-o _// /-"_>---<__-" I / |
|
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
157 | (^(" /"_>---<__- N _-" |
|
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
158 | ,/| /__>--<__/ A _-" |
|
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
159 | ,//('( |__>--<__| T / .----_ |
| 5862 | 160 | ( ( ')) |__>--<__| | /' _---_"\ |
|
6169
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
161 | `-)) )) ( |__>--<__| O | /' / "\`\ |
|
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
162 | ,/,'//( ( \__>--<__\ R \ /' // || |
| 5862 | 163 | ,( ( ((, )) "-__>--<_"-_ "--____---"' _/'/ /' |
| 164 | `"/ )` ) ,/| "-_">--<_/-__ __-" _/ | |
| 165 | ._-"//( )/ )) ` ""-'_/_/ /"""""""__--" | |
| 166 | ;'( ')/ ,)( """""""""" | |
| 167 | ' ') '( (/ | |
| 168 | ' ' ` | |
| 169 | ||
| 170 | */ |