Sun, 15 Apr 2007 03:43:17 +0000
propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
to branch 'im.pidgin.rlaager.merging.msnp13-and-pidgin' (head 198222e01a7dc9f8795f68ec618a48c3478e04a8)
| 5872 | 1 | /** |
| 2 | * @file log.h Logging API | |
| 3 | * @ingroup core | |
| 4 | * | |
| 15884 | 5 | * purple |
| 5872 | 6 | * |
| 15884 | 7 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 8 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 9 | * source distribution. | |
| 7440 | 10 | * |
| 5872 | 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License as published by | |
| 13 | * the Free Software Foundation; either version 2 of the License, or | |
| 14 | * (at your option) any later version. | |
| 15 | * | |
| 16 | * This program is distributed in the hope that it will be useful, | |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | * GNU General Public License for more details. | |
| 20 | * | |
| 21 | * You should have received a copy of the GNU General Public License | |
| 22 | * along with this program; if not, write to the Free Software | |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 | */ | |
| 15884 | 25 | #ifndef _PURPLE_LOG_H_ |
| 26 | #define _PURPLE_LOG_H_ | |
| 5872 | 27 | |
| 7431 | 28 | #include <stdio.h> |
| 5872 | 29 | |
| 30 | ||
| 7431 | 31 | /******************************************************** |
| 32 | * DATA STRUCTURES ************************************** | |
| 33 | ********************************************************/ | |
| 34 | ||
| 15884 | 35 | typedef struct _PurpleLog PurpleLog; |
| 36 | typedef struct _PurpleLogLogger PurpleLogLogger; | |
| 37 | typedef struct _PurpleLogCommonLoggerData PurpleLogCommonLoggerData; | |
| 38 | typedef struct _PurpleLogSet PurpleLogSet; | |
| 7431 | 39 | |
| 40 | typedef enum { | |
| 15884 | 41 | PURPLE_LOG_IM, |
| 42 | PURPLE_LOG_CHAT, | |
| 43 | PURPLE_LOG_SYSTEM | |
| 44 | } PurpleLogType; | |
| 7431 | 45 | |
| 46 | typedef enum { | |
| 15884 | 47 | PURPLE_LOG_READ_NO_NEWLINE = 1 |
| 48 | } PurpleLogReadFlags; | |
| 7431 | 49 | |
| 50 | #include "account.h" | |
| 51 | #include "conversation.h" | |
| 52 | ||
| 15884 | 53 | typedef void (*PurpleLogSetCallback) (GHashTable *sets, PurpleLogSet *set); |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
54 | |
| 7431 | 55 | /** |
| 56 | * A log logger. | |
| 57 | * | |
| 15884 | 58 | * This struct gets filled out and is included in the PurpleLog. It contains everything |
| 7431 | 59 | * needed to write and read from logs. |
| 60 | */ | |
| 15884 | 61 | struct _PurpleLogLogger { |
| 7431 | 62 | char *name; /**< The logger's name */ |
| 63 | char *id; /**< an identifier to refer to this logger */ | |
| 7440 | 64 | |
| 65 | /** This gets called when the log is first created. | |
| 7431 | 66 | I don't think this is actually needed. */ |
| 15884 | 67 | void (*create)(PurpleLog *log); |
| 7440 | 68 | |
| 7431 | 69 | /** This is used to write to the log file */ |
| 15884 | 70 | gsize (*write)(PurpleLog *log, |
| 71 | PurpleMessageFlags type, | |
| 7431 | 72 | const char *from, |
| 73 | time_t time, | |
| 74 | const char *message); | |
| 75 | ||
| 76 | /** Called when the log is destroyed */ | |
| 15884 | 77 | void (*finalize)(PurpleLog *log); |
| 7440 | 78 | |
| 15884 | 79 | /** This function returns a sorted GList of available PurpleLogs */ |
| 80 | GList *(*list)(PurpleLogType type, const char *name, PurpleAccount *account); | |
| 7440 | 81 | |
| 82 | /** Given one of the logs returned by the logger's list function, | |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
83 | * this returns the contents of the log in GtkIMHtml markup */ |
| 15884 | 84 | char *(*read)(PurpleLog *log, PurpleLogReadFlags *flags); |
|
10231
047177cee39f
[gaim-migrate @ 11366]
Andrew Hart <arhart@users.sourceforge.net>
parents:
10171
diff
changeset
|
85 | |
| 7556 | 86 | /** Given one of the logs returned by the logger's list function, |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
87 | * this returns the size of the log in bytes */ |
| 15884 | 88 | int (*size)(PurpleLog *log); |
| 8096 | 89 | |
| 90 | /** Returns the total size of all the logs. If this is undefined a default | |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
91 | * implementation is used */ |
| 15884 | 92 | int (*total_size)(PurpleLogType type, const char *name, PurpleAccount *account); |
| 8573 | 93 | |
| 15884 | 94 | /** This function returns a sorted GList of available system PurpleLogs */ |
| 95 | GList *(*list_syslog)(PurpleAccount *account); | |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
96 | |
| 15884 | 97 | /** Adds PurpleLogSets to a GHashTable. By passing the data in the PurpleLogSets |
| 98 | * to list, the caller can get every available PurpleLog from the logger. | |
| 99 | * Loggers using purple_log_common_writer() (or otherwise storing their | |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
100 | * logs in the same directory structure as the stock loggers) do not |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
101 | * need to implement this function. |
|
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
102 | * |
| 15884 | 103 | * Loggers which implement this function must create a PurpleLogSet, |
| 104 | * then call @a cb with @a sets and the newly created PurpleLogSet. */ | |
| 105 | void (*get_log_sets)(PurpleLogSetCallback cb, GHashTable *sets); | |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
106 | |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
107 | /* Attempts to delete the specified log, indicating success or failure */ |
|
16116
bccaa68c86ad
"delete" is a reserved word in C++, rename the "delete" member of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
108 | gboolean (*remove)(PurpleLog *log); |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
109 | |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
110 | /* Tests whether a log is deletable */ |
| 15884 | 111 | gboolean (*is_deletable)(PurpleLog *log); |
| 5872 | 112 | }; |
| 113 | ||
| 7431 | 114 | /** |
| 115 | * A log. Not the wooden type. | |
| 116 | */ | |
| 15884 | 117 | struct _PurpleLog { |
| 118 | PurpleLogType type; /**< The type of log this is */ | |
| 7431 | 119 | char *name; /**< The name of this log */ |
| 15884 | 120 | PurpleAccount *account; /**< The account this log is taking |
|
13120
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13059
diff
changeset
|
121 | place on */ |
| 15884 | 122 | PurpleConversation *conv; /**< The conversation being logged */ |
| 7440 | 123 | time_t time; /**< The time this conversation |
|
13120
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13059
diff
changeset
|
124 | started, converted to the local timezone */ |
|
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13059
diff
changeset
|
125 | |
| 15884 | 126 | PurpleLogLogger *logger; /**< The logging mechanism this log |
|
13120
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13059
diff
changeset
|
127 | is to use */ |
| 7431 | 128 | void *logger_data; /**< Data used by the log logger */ |
|
13120
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13059
diff
changeset
|
129 | struct tm *tm; /**< The time this conversation |
|
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13059
diff
changeset
|
130 | started, saved with original |
|
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13059
diff
changeset
|
131 | timezone data, if available and |
|
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13059
diff
changeset
|
132 | if struct tm has the BSD |
|
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13059
diff
changeset
|
133 | timezone fields, else @c NULL. |
|
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13059
diff
changeset
|
134 | Do NOT modify anything in this struct.*/ |
|
13624
c6577def4e2a
[gaim-migrate @ 16009]
Richard Laager <rlaager@pidgin.im>
parents:
13389
diff
changeset
|
135 | |
|
c6577def4e2a
[gaim-migrate @ 16009]
Richard Laager <rlaager@pidgin.im>
parents:
13389
diff
changeset
|
136 | /* IMPORTANT: Some code in log.c allocates these without zeroing them. |
|
c6577def4e2a
[gaim-migrate @ 16009]
Richard Laager <rlaager@pidgin.im>
parents:
13389
diff
changeset
|
137 | * IMPORTANT: Update that code if you add members here. */ |
| 5872 | 138 | }; |
| 139 | ||
| 10822 | 140 | /** |
| 141 | * A common logger_data struct containing a file handle and path, as well | |
| 142 | * as a pointer to something else for additional data. | |
| 143 | */ | |
| 15884 | 144 | struct _PurpleLogCommonLoggerData { |
| 10822 | 145 | char *path; |
| 146 | FILE *file; | |
| 147 | void *extra_data; | |
| 148 | }; | |
| 7431 | 149 | |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
150 | /** |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
151 | * Describes available logs. |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
152 | * |
| 15884 | 153 | * By passing the elements of this struct to purple_log_get_logs(), the caller |
| 154 | * can get all available PurpleLogs. | |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
155 | */ |
| 15884 | 156 | struct _PurpleLogSet { |
| 157 | PurpleLogType type; /**< The type of logs available */ | |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
158 | char *name; /**< The name of the logs available */ |
| 15884 | 159 | PurpleAccount *account; /**< The account the available logs |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
160 | took place on. This will be |
|
11503
9f15d4c089b9
[gaim-migrate @ 13748]
Richard Laager <rlaager@pidgin.im>
parents:
11292
diff
changeset
|
161 | @c NULL if the account no longer |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
162 | exists. (Depending on a |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
163 | logger's implementation of |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
164 | list, it may not be possible |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
165 | to load such logs.) */ |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
166 | gboolean buddy; /**< Is this (account, name) a buddy |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
167 | on the buddy list? */ |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
168 | char *normalized_name; /**< The normalized version of |
|
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
169 | @a name. It must be set, and |
|
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
170 | may be set to the same pointer |
|
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
171 | value as @a name. */ |
|
13624
c6577def4e2a
[gaim-migrate @ 16009]
Richard Laager <rlaager@pidgin.im>
parents:
13389
diff
changeset
|
172 | |
|
c6577def4e2a
[gaim-migrate @ 16009]
Richard Laager <rlaager@pidgin.im>
parents:
13389
diff
changeset
|
173 | /* IMPORTANT: Some code in log.c allocates these without zeroing them. |
|
c6577def4e2a
[gaim-migrate @ 16009]
Richard Laager <rlaager@pidgin.im>
parents:
13389
diff
changeset
|
174 | * IMPORTANT: Update that code if you add members here. */ |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
175 | }; |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
176 | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5934
diff
changeset
|
177 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5934
diff
changeset
|
178 | extern "C" { |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5934
diff
changeset
|
179 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5934
diff
changeset
|
180 | |
| 10566 | 181 | /***************************************/ |
| 182 | /** @name Log Functions */ | |
| 183 | /***************************************/ | |
| 184 | /*@{*/ | |
| 7440 | 185 | |
| 10566 | 186 | /** |
| 187 | * Creates a new log | |
| 188 | * | |
| 189 | * @param type The type of log this is. | |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
190 | * @param name The name of this conversation (screenname, chat name, |
| 10566 | 191 | * etc.) |
| 192 | * @param account The account the conversation is occurring on | |
|
11292
13068c68def6
[gaim-migrate @ 13492]
Richard Laager <rlaager@pidgin.im>
parents:
11177
diff
changeset
|
193 | * @param conv The conversation being logged |
| 10566 | 194 | * @param time The time this conversation started |
|
13120
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13059
diff
changeset
|
195 | * @param tm The time this conversation started, with timezone data, |
|
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13059
diff
changeset
|
196 | * if available and if struct tm has the BSD timezone fields. |
| 10566 | 197 | * @return The new log |
| 198 | */ | |
| 15884 | 199 | PurpleLog *purple_log_new(PurpleLogType type, const char *name, PurpleAccount *account, |
| 200 | PurpleConversation *conv, time_t time, const struct tm *tm); | |
| 7431 | 201 | |
| 10566 | 202 | /** |
| 203 | * Frees a log | |
| 204 | * | |
| 205 | * @param log The log to destroy | |
| 206 | */ | |
| 15884 | 207 | void purple_log_free(PurpleLog *log); |
| 7440 | 208 | |
| 10566 | 209 | /** |
| 210 | * Writes to a log file. Assumes you have checked preferences already. | |
| 211 | * | |
| 212 | * @param log The log to write to | |
| 213 | * @param type The type of message being logged | |
|
11503
9f15d4c089b9
[gaim-migrate @ 13748]
Richard Laager <rlaager@pidgin.im>
parents:
11292
diff
changeset
|
214 | * @param from Whom this message is coming from, or @c NULL for |
| 10566 | 215 | * system messages |
| 216 | * @param time A timestamp in UNIX time | |
| 217 | * @param message The message to log | |
| 218 | */ | |
| 15884 | 219 | void purple_log_write(PurpleLog *log, |
| 220 | PurpleMessageFlags type, | |
| 10566 | 221 | const char *from, |
| 222 | time_t time, | |
| 223 | const char *message); | |
| 7431 | 224 | |
| 10566 | 225 | /** |
| 226 | * Reads from a log | |
| 227 | * | |
| 228 | * @param log The log to read from | |
| 229 | * @param flags The returned logging flags. | |
| 230 | * | |
| 15884 | 231 | * @return The contents of this log in Purple Markup. |
| 10566 | 232 | */ |
| 15884 | 233 | char *purple_log_read(PurpleLog *log, PurpleLogReadFlags *flags); |
| 7431 | 234 | |
| 10566 | 235 | /** |
| 236 | * Returns a list of all available logs | |
| 237 | * | |
| 238 | * @param type The type of the log | |
| 239 | * @param name The name of the log | |
| 240 | * @param account The account | |
| 15884 | 241 | * @return A sorted list of PurpleLogs |
| 10566 | 242 | */ |
| 15884 | 243 | GList *purple_log_get_logs(PurpleLogType type, const char *name, PurpleAccount *account); |
| 7440 | 244 | |
| 10566 | 245 | /** |
| 15884 | 246 | * Returns a GHashTable of PurpleLogSets. |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
247 | * |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
248 | * A "log set" here means the information necessary to gather the |
| 15884 | 249 | * PurpleLogs for a given buddy/chat. This information would be passed |
| 250 | * to purple_log_list to get a list of PurpleLogs. | |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
251 | * |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
252 | * The primary use of this function is to get a list of everyone the |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
253 | * user has ever talked to (assuming he or she uses logging). |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
254 | * |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
255 | * The GHashTable that's returned will free all log sets in it when |
| 15884 | 256 | * destroyed. If a PurpleLogSet is removed from the GHashTable, it |
| 257 | * must be freed with purple_log_set_free(). | |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
258 | * |
| 15884 | 259 | * @return A GHashTable of all available unique PurpleLogSets |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
260 | */ |
| 15884 | 261 | GHashTable *purple_log_get_log_sets(void); |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
262 | |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
263 | /** |
| 10566 | 264 | * Returns a list of all available system logs |
| 265 | * | |
| 266 | * @param account The account | |
| 15884 | 267 | * @return A sorted list of PurpleLogs |
| 10566 | 268 | */ |
| 15884 | 269 | GList *purple_log_get_system_logs(PurpleAccount *account); |
| 8573 | 270 | |
| 10566 | 271 | /** |
| 10822 | 272 | * Returns the size of a log |
| 10566 | 273 | * |
| 274 | * @param log The log | |
| 275 | * @return The size of the log, in bytes | |
| 276 | */ | |
| 15884 | 277 | int purple_log_get_size(PurpleLog *log); |
| 5872 | 278 | |
| 10566 | 279 | /** |
| 280 | * Returns the size, in bytes, of all available logs in this conversation | |
| 281 | * | |
| 282 | * @param type The type of the log | |
| 283 | * @param name The name of the log | |
| 284 | * @param account The account | |
| 285 | * @return The size in bytes | |
| 286 | */ | |
| 15884 | 287 | int purple_log_get_total_size(PurpleLogType type, const char *name, PurpleAccount *account); |
| 8573 | 288 | |
| 10566 | 289 | /** |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
290 | * Tests whether a log is deletable |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
291 | * |
| 15884 | 292 | * A return value of @c FALSE indicates that purple_log_delete() will fail on this |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
293 | * log, unless something changes between the two calls. A return value of @c TRUE, |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
294 | * however, does not guarantee the log can be deleted. |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
295 | * |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
296 | * @param log The log |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
297 | * @return A boolean indicating if the log is deletable |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
298 | */ |
| 15884 | 299 | gboolean purple_log_is_deletable(PurpleLog *log); |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
300 | |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
301 | /** |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
302 | * Deletes a log |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
303 | * |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
304 | * @param log The log |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
305 | * @return A boolean indicating success or failure |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
306 | */ |
| 15884 | 307 | gboolean purple_log_delete(PurpleLog *log); |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
308 | |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
309 | /** |
| 15884 | 310 | * Returns the default logger directory Purple uses for a given account |
| 311 | * and username. This would be where Purple stores logs created by | |
| 10822 | 312 | * the built-in text or HTML loggers. |
| 313 | * | |
| 314 | * @param type The type of the log. | |
| 315 | * @param name The name of the log. | |
| 316 | * @param account The account. | |
| 15884 | 317 | * @return The default logger directory for Purple. |
| 10822 | 318 | */ |
| 15884 | 319 | char *purple_log_get_log_dir(PurpleLogType type, const char *name, PurpleAccount *account); |
| 10822 | 320 | |
| 321 | /** | |
| 15884 | 322 | * Implements GCompareFunc for PurpleLogs |
| 10566 | 323 | * |
| 15884 | 324 | * @param y A PurpleLog |
| 325 | * @param z Another PurpleLog | |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
326 | * @return A value as specified by GCompareFunc |
| 10566 | 327 | */ |
| 15884 | 328 | gint purple_log_compare(gconstpointer y, gconstpointer z); |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
329 | |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
330 | /** |
| 15884 | 331 | * Implements GCompareFunc for PurpleLogSets |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
332 | * |
| 15884 | 333 | * @param y A PurpleLogSet |
| 334 | * @param z Another PurpleLogSet | |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
335 | * @return A value as specified by GCompareFunc |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
336 | */ |
| 15884 | 337 | gint purple_log_set_compare(gconstpointer y, gconstpointer z); |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
338 | |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
339 | /** |
|
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
340 | * Frees a log set |
|
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
341 | * |
|
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
342 | * @param set The log set to destroy |
|
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
343 | */ |
| 15884 | 344 | void purple_log_set_free(PurpleLogSet *set); |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
345 | |
| 10566 | 346 | /*@}*/ |
| 8573 | 347 | |
| 10566 | 348 | /******************************************/ |
| 10822 | 349 | /** @name Common Logger Functions */ |
| 350 | /******************************************/ | |
| 351 | /*@{*/ | |
| 352 | ||
| 353 | /** | |
| 15884 | 354 | * Opens a new log file in the standard Purple log location |
| 10822 | 355 | * with the given file extension, named for the current time, |
| 356 | * for writing. If a log file is already open, the existing | |
| 357 | * file handle is retained. The log's logger_data value is | |
| 15884 | 358 | * set to a PurpleLogCommonLoggerData struct containing the log |
| 10822 | 359 | * file handle and log path. |
| 360 | * | |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
361 | * This function is intended to be used as a "common" |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
362 | * implementation of a logger's @c write function. |
| 15884 | 363 | * It should only be passed to purple_log_logger_new() and never |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
364 | * called directly. |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
365 | * |
| 10822 | 366 | * @param log The log to write to. |
| 367 | * @param ext The file extension to give to this log file. | |
| 368 | */ | |
| 15884 | 369 | void purple_log_common_writer(PurpleLog *log, const char *ext); |
| 10822 | 370 | |
| 371 | /** | |
| 15884 | 372 | * Returns a sorted GList of PurpleLogs of the requested type. |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
373 | * |
| 10822 | 374 | * This function should only be used with logs that are written |
| 15884 | 375 | * with purple_log_common_writer(). It's intended to be used as |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
376 | * a "common" implementation of a logger's @c list function. |
| 15884 | 377 | * It should only be passed to purple_log_logger_new() and never |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
378 | * called directly. |
| 10822 | 379 | * |
| 380 | * @param type The type of the logs being listed. | |
| 381 | * @param name The name of the log. | |
| 382 | * @param account The account of the log. | |
| 383 | * @param ext The file extension this log format uses. | |
| 384 | * @param logger A reference to the logger struct for this log. | |
| 385 | * | |
| 15884 | 386 | * @return A sorted GList of PurpleLogs matching the parameters. |
| 10822 | 387 | */ |
| 15884 | 388 | GList *purple_log_common_lister(PurpleLogType type, const char *name, |
| 389 | PurpleAccount *account, const char *ext, | |
| 390 | PurpleLogLogger *logger); | |
| 10822 | 391 | |
| 392 | /** | |
|
13389
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
393 | * Returns the total size of all the logs for a given user, with |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
394 | * a given extension. |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
395 | * |
|
13389
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
396 | * This function should only be used with logs that are written |
| 15884 | 397 | * with purple_log_common_writer(). It's intended to be used as |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
398 | * a "common" implementation of a logger's @c total_size function. |
| 15884 | 399 | * It should only be passed to purple_log_logger_new() and never |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
400 | * called directly. |
|
13389
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
401 | * |
|
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
402 | * @param type The type of the logs being sized. |
|
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
403 | * @param name The name of the logs to size |
|
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
404 | * (e.g. the username or chat name). |
|
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
405 | * @param account The account of the log. |
|
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
406 | * @param ext The file extension this log format uses. |
|
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
407 | * |
|
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
408 | * @return The size of all the logs with the specified extension |
|
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
409 | * for the specified user. |
|
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
410 | */ |
| 15884 | 411 | int purple_log_common_total_sizer(PurpleLogType type, const char *name, |
| 412 | PurpleAccount *account, const char *ext); | |
|
13389
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
413 | |
|
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
414 | /** |
| 15884 | 415 | * Returns the size of a given PurpleLog. |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
416 | * |
| 10822 | 417 | * This function should only be used with logs that are written |
| 15884 | 418 | * with purple_log_common_writer(). It's intended to be used as |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
419 | * a "common" implementation of a logger's @c size function. |
| 15884 | 420 | * It should only be passed to purple_log_logger_new() and never |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
421 | * called directly. |
| 10822 | 422 | * |
| 15884 | 423 | * @param log The PurpleLog to size. |
| 10822 | 424 | * |
| 425 | * @return An integer indicating the size of the log in bytes. | |
| 426 | */ | |
| 15884 | 427 | int purple_log_common_sizer(PurpleLog *log); |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
428 | |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
429 | /** |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
430 | * Deletes a log |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
431 | * |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
432 | * This function should only be used with logs that are written |
| 15884 | 433 | * with purple_log_common_writer(). It's intended to be used as |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
434 | * a "common" implementation of a logger's @c delete function. |
| 15884 | 435 | * It should only be passed to purple_log_logger_new() and never |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
436 | * called directly. |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
437 | * |
| 15884 | 438 | * @param log The PurpleLog to delete. |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
439 | * |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
440 | * @return A boolean indicating success or failure. |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
441 | */ |
| 15884 | 442 | gboolean purple_log_common_deleter(PurpleLog *log); |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
443 | |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
444 | /** |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
445 | * Checks to see if a log is deletable |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
446 | * |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
447 | * This function should only be used with logs that are written |
| 15884 | 448 | * with purple_log_common_writer(). It's intended to be used as |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
449 | * a "common" implementation of a logger's @c is_deletable function. |
| 15884 | 450 | * It should only be passed to purple_log_logger_new() and never |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
451 | * called directly. |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
452 | * |
| 15884 | 453 | * @param log The PurpleLog to check. |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
454 | * |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
455 | * @return A boolean indicating if the log is deletable. |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
456 | */ |
| 15884 | 457 | gboolean purple_log_common_is_deletable(PurpleLog *log); |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
458 | |
| 10822 | 459 | /*@}*/ |
| 460 | ||
| 461 | /******************************************/ | |
| 10566 | 462 | /** @name Logger Functions */ |
| 463 | /******************************************/ | |
| 464 | /*@{*/ | |
| 7440 | 465 | |
| 10566 | 466 | /** |
| 467 | * Creates a new logger | |
| 468 | * | |
|
11503
9f15d4c089b9
[gaim-migrate @ 13748]
Richard Laager <rlaager@pidgin.im>
parents:
11292
diff
changeset
|
469 | * @param id The logger's id. |
|
9f15d4c089b9
[gaim-migrate @ 13748]
Richard Laager <rlaager@pidgin.im>
parents:
11292
diff
changeset
|
470 | * @param name The logger's name. |
|
9f15d4c089b9
[gaim-migrate @ 13748]
Richard Laager <rlaager@pidgin.im>
parents:
11292
diff
changeset
|
471 | * @param functions The number of functions being passed. The following |
|
9f15d4c089b9
[gaim-migrate @ 13748]
Richard Laager <rlaager@pidgin.im>
parents:
11292
diff
changeset
|
472 | * functions are currently available (in order): @c create, |
|
9f15d4c089b9
[gaim-migrate @ 13748]
Richard Laager <rlaager@pidgin.im>
parents:
11292
diff
changeset
|
473 | * @c write, @c finalize, @c list, @c read, @c size, |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
474 | * @c total_size, @c list_syslog, @c get_log_sets, |
|
16116
bccaa68c86ad
"delete" is a reserved word in C++, rename the "delete" member of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
475 | * @c remove, @c is_deletable. |
| 15884 | 476 | * For details on these functions, see PurpleLogLogger. |
|
11503
9f15d4c089b9
[gaim-migrate @ 13748]
Richard Laager <rlaager@pidgin.im>
parents:
11292
diff
changeset
|
477 | * Functions may not be skipped. For example, passing |
|
9f15d4c089b9
[gaim-migrate @ 13748]
Richard Laager <rlaager@pidgin.im>
parents:
11292
diff
changeset
|
478 | * @c create and @c write is acceptable (for a total of |
|
9f15d4c089b9
[gaim-migrate @ 13748]
Richard Laager <rlaager@pidgin.im>
parents:
11292
diff
changeset
|
479 | * two functions). Passing @c create and @c finalize, |
|
9f15d4c089b9
[gaim-migrate @ 13748]
Richard Laager <rlaager@pidgin.im>
parents:
11292
diff
changeset
|
480 | * however, is not. To accomplish that, the caller must |
|
9f15d4c089b9
[gaim-migrate @ 13748]
Richard Laager <rlaager@pidgin.im>
parents:
11292
diff
changeset
|
481 | * pass @c create, @c NULL (a placeholder for @c write), |
|
9f15d4c089b9
[gaim-migrate @ 13748]
Richard Laager <rlaager@pidgin.im>
parents:
11292
diff
changeset
|
482 | * and @c finalize (for a total of 3 functions). |
| 10566 | 483 | * |
| 484 | * @return The new logger | |
| 485 | */ | |
| 15884 | 486 | PurpleLogLogger *purple_log_logger_new(const char *id, const char *name, int functions, ...); |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
487 | |
| 10566 | 488 | /** |
| 489 | * Frees a logger | |
| 490 | * | |
| 491 | * @param logger The logger to free | |
| 492 | */ | |
| 15884 | 493 | void purple_log_logger_free(PurpleLogLogger *logger); |
| 7440 | 494 | |
| 10566 | 495 | /** |
| 496 | * Adds a new logger | |
| 497 | * | |
| 498 | * @param logger The new logger to add | |
| 499 | */ | |
| 15884 | 500 | void purple_log_logger_add (PurpleLogLogger *logger); |
| 7431 | 501 | |
| 10566 | 502 | /** |
| 503 | * | |
| 504 | * Removes a logger | |
| 505 | * | |
| 506 | * @param logger The logger to remove | |
| 507 | */ | |
| 15884 | 508 | void purple_log_logger_remove (PurpleLogLogger *logger); |
| 7431 | 509 | |
| 10566 | 510 | /** |
| 511 | * | |
| 512 | * Sets the current logger | |
| 513 | * | |
| 514 | * @param logger The logger to set | |
| 515 | */ | |
| 15884 | 516 | void purple_log_logger_set (PurpleLogLogger *logger); |
| 7440 | 517 | |
| 10566 | 518 | /** |
| 519 | * | |
| 520 | * Returns the current logger | |
| 521 | * | |
| 522 | * @return logger The current logger | |
| 523 | */ | |
| 15884 | 524 | PurpleLogLogger *purple_log_logger_get (void); |
| 7440 | 525 | |
| 10566 | 526 | /** |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
527 | * Returns a GList containing the IDs and names of the registered |
| 10566 | 528 | * loggers. |
| 529 | * | |
| 530 | * @return The list of IDs and names. | |
| 531 | */ | |
| 15884 | 532 | GList *purple_log_logger_get_options(void); |
| 7431 | 533 | |
|
12737
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
534 | /**************************************************************************/ |
|
12835
edc2ec6ae9f3
[gaim-migrate @ 15183]
Richard Laager <rlaager@pidgin.im>
parents:
12737
diff
changeset
|
535 | /** @name Log Subsystem */ |
|
12737
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
536 | /**************************************************************************/ |
|
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
537 | /*@{*/ |
|
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
538 | |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
539 | /** |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
540 | * Initializes the log subsystem. |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
541 | */ |
| 15884 | 542 | void purple_log_init(void); |
|
12737
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
543 | |
|
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
544 | /** |
|
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
545 | * Returns the log subsystem handle. |
|
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
546 | * |
|
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
547 | * @return The log subsystem handle. |
|
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
548 | */ |
| 15884 | 549 | void *purple_log_get_handle(void); |
|
12737
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
550 | |
|
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
551 | /** |
|
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
552 | * Uninitializes the log subsystem. |
|
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
553 | */ |
| 15884 | 554 | void purple_log_uninit(void); |
|
12737
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
555 | |
| 10566 | 556 | /*@}*/ |
| 7431 | 557 | |
| 5872 | 558 | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5934
diff
changeset
|
559 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5934
diff
changeset
|
560 | } |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5934
diff
changeset
|
561 | #endif |
| 7440 | 562 | |
| 15884 | 563 | #endif /* _PURPLE_LOG_H_ */ |