Mercurial > pidgin
annotate src/log.h @ 10702:f51e040affc6
[gaim-migrate @ 12284]
I think this leaked
committer: Tailor Script <tailor@pidgin.im>
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Sun, 20 Mar 2005 01:16:43 +0000 |
parents | 62fc579810f4 |
children | d087e928ffd1 |
rev | line source |
---|---|
5872 | 1 /** |
2 * @file log.h Logging API | |
3 * @ingroup core | |
4 * | |
5 * gaim | |
6 * | |
8046 | 7 * Gaim is the legal property of its developers, whose names are too numerous |
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 */ | |
25 #ifndef _GAIM_LOG_H_ | |
26 #define _GAIM_LOG_H_ | |
27 | |
7431 | 28 #include <stdio.h> |
5872 | 29 |
30 | |
7431 | 31 /******************************************************** |
32 * DATA STRUCTURES ************************************** | |
33 ********************************************************/ | |
34 | |
35 typedef struct _GaimLog GaimLog; | |
36 typedef struct _GaimLogLogger GaimLogLogger; | |
37 | |
38 typedef enum { | |
39 GAIM_LOG_IM, | |
40 GAIM_LOG_CHAT, | |
10348 | 41 GAIM_LOG_SYSTEM |
7431 | 42 } GaimLogType; |
43 | |
44 typedef enum { | |
10348 | 45 GAIM_LOG_READ_NO_NEWLINE = 1 |
7431 | 46 } GaimLogReadFlags; |
47 | |
48 #include "account.h" | |
49 #include "conversation.h" | |
50 | |
51 /** | |
52 * A log logger. | |
53 * | |
54 * This struct gets filled out and is included in the GaimLog. It contains everything | |
55 * needed to write and read from logs. | |
56 */ | |
9000 | 57 /*@{*/ |
7431 | 58 struct _GaimLogLogger { |
59 char *name; /**< The logger's name */ | |
60 char *id; /**< an identifier to refer to this logger */ | |
7440 | 61 |
62 /** This gets called when the log is first created. | |
7431 | 63 I don't think this is actually needed. */ |
7440 | 64 void(*create)(GaimLog *log); |
65 | |
7431 | 66 /** This is used to write to the log file */ |
7440 | 67 void(*write)(GaimLog *log, |
68 GaimMessageFlags type, | |
7431 | 69 const char *from, |
70 time_t time, | |
71 const char *message); | |
72 | |
73 /** Called when the log is destroyed */ | |
74 void (*finalize)(GaimLog *log); | |
7440 | 75 |
7431 | 76 /** This function returns a sorted GList of available GaimLogs */ |
8898 | 77 GList *(*list)(GaimLogType type, const char *name, GaimAccount *account); |
7440 | 78 |
79 /** Given one of the logs returned by the logger's list function, | |
80 * this returns the contents of the log in GtkIMHtml markup */ | |
7431 | 81 char *(*read)(GaimLog *log, GaimLogReadFlags *flags); |
10231 | 82 |
7556 | 83 /** Given one of the logs returned by the logger's list function, |
84 * this returns the size of the log in bytes */ | |
85 int (*size)(GaimLog *log); | |
8096 | 86 |
87 /** Returns the total size of all the logs. If this is undefined a default | |
88 * implementation is used */ | |
8898 | 89 int (*total_size)(GaimLogType type, const char *name, GaimAccount *account); |
8573 | 90 |
91 /** This function returns a sorted GList of available system GaimLogs */ | |
92 GList *(*list_syslog)(GaimAccount *account); | |
5872 | 93 }; |
94 | |
7431 | 95 /** |
96 * A log. Not the wooden type. | |
97 */ | |
98 struct _GaimLog { | |
99 GaimLogType type; /**< The type of log this is */ | |
100 char *name; /**< The name of this log */ | |
7440 | 101 GaimAccount *account; /**< The account this log is taking |
102 place on */ | |
103 time_t time; /**< The time this conversation | |
104 started */ | |
105 GaimLogLogger *logger; /**< The logging mechanism this log | |
106 is to use */ | |
7431 | 107 void *logger_data; /**< Data used by the log logger */ |
5872 | 108 }; |
109 | |
7431 | 110 |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5934
diff
changeset
|
111 #ifdef __cplusplus |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5934
diff
changeset
|
112 extern "C" { |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5934
diff
changeset
|
113 #endif |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5934
diff
changeset
|
114 |
10566
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
115 /***************************************/ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
116 /** @name Log Functions */ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
117 /***************************************/ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
118 /*@{*/ |
7440 | 119 |
10566
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
120 /** |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
121 * Creates a new log |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
122 * |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
123 * @param type The type of log this is. |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
124 * @param name The name of this conversation (Screenname, chat name, |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
125 * etc.) |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
126 * @param account The account the conversation is occurring on |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
127 * @param time The time this conversation started |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
128 * @return The new log |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
129 */ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
130 GaimLog *gaim_log_new(GaimLogType type, const char *name, |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
131 GaimAccount *account, time_t time); |
7431 | 132 |
10566
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
133 /** |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
134 * Frees a log |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
135 * |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
136 * @param log The log to destroy |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
137 */ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
138 void gaim_log_free(GaimLog *log); |
7440 | 139 |
10566
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
140 /** |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
141 * Writes to a log file. Assumes you have checked preferences already. |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
142 * |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
143 * @param log The log to write to |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
144 * @param type The type of message being logged |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
145 * @param from Whom this message is coming from, or NULL for |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
146 * system messages |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
147 * @param time A timestamp in UNIX time |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
148 * @param message The message to log |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
149 */ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
150 void gaim_log_write(GaimLog *log, |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
151 GaimMessageFlags type, |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
152 const char *from, |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
153 time_t time, |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
154 const char *message); |
7431 | 155 |
10566
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
156 /** |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
157 * Reads from a log |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
158 * |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
159 * @param log The log to read from |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
160 * @param flags The returned logging flags. |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
161 * |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
162 * @return The contents of this log in Gaim Markup. |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
163 */ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
164 char *gaim_log_read(GaimLog *log, GaimLogReadFlags *flags); |
7431 | 165 |
10566
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
166 /** |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
167 * Returns a list of all available logs |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
168 * |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
169 * @param type The type of the log |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
170 * @param name The name of the log |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
171 * @param account The account |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
172 * @return A sorted list of GaimLogs |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
173 */ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
174 GList *gaim_log_get_logs(GaimLogType type, const char *name, GaimAccount *account); |
7440 | 175 |
10566
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
176 /** |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
177 * Returns a list of all available system logs |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
178 * |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
179 * @param account The account |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
180 * @return A sorted list of GaimLogs |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
181 */ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
182 GList *gaim_log_get_system_logs(GaimAccount *account); |
8573 | 183 |
10566
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
184 /** |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
185 * Returns the size of a log |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
186 * |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
187 * @param log The log |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
188 * @return The size of the log, in bytes |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
189 */ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
190 int gaim_log_get_size(GaimLog *log); |
5872 | 191 |
10566
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
192 /** |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
193 * Returns the size, in bytes, of all available logs in this conversation |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
194 * |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
195 * @param type The type of the log |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
196 * @param name The name of the log |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
197 * @param account The account |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
198 * @return The size in bytes |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
199 */ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
200 int gaim_log_get_total_size(GaimLogType type, const char *name, GaimAccount *account); |
8573 | 201 |
10566
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
202 /** |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
203 * Implements GCompareFunc |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
204 * |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
205 * @param y A GaimLog |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
206 * @param z Another GaimLog |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
207 * @return A value as specified by GCompareFunc |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
208 */ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
209 gint gaim_log_compare(gconstpointer y, gconstpointer z); |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
210 /*@}*/ |
8573 | 211 |
10566
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
212 /******************************************/ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
213 /** @name Logger Functions */ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
214 /******************************************/ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
215 /*@{*/ |
7440 | 216 |
10566
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
217 /** |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
218 * Creates a new logger |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
219 * |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
220 * @param create The logger's new function. |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
221 * @param write The logger's write function. |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
222 * @param finalize The logger's finalize function. |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
223 * @param list The logger's list function. |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
224 * @param read The logger's read function. |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
225 * @param size The logger's size function. |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
226 * |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
227 * @return The new logger |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
228 */ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
229 GaimLogLogger *gaim_log_logger_new( |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
230 void(*create)(GaimLog *), |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
231 void(*write)(GaimLog *, GaimMessageFlags, const char *, time_t, const char *), |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
232 void(*finalize)(GaimLog *), |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
233 GList*(*list)(GaimLogType type, const char*, GaimAccount*), |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
234 char*(*read)(GaimLog*, GaimLogReadFlags*), |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
235 int(*size)(GaimLog*)); |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
236 /** |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
237 * Frees a logger |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
238 * |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
239 * @param logger The logger to free |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
240 */ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
241 void gaim_log_logger_free(GaimLogLogger *logger); |
7440 | 242 |
10566
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
243 /** |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
244 * Adds a new logger |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
245 * |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
246 * @param logger The new logger to add |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
247 */ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
248 void gaim_log_logger_add (GaimLogLogger *logger); |
7431 | 249 |
10566
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
250 /** |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
251 * |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
252 * Removes a logger |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
253 * |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
254 * @param logger The logger to remove |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
255 */ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
256 void gaim_log_logger_remove (GaimLogLogger *logger); |
7431 | 257 |
10566
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
258 /** |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
259 * |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
260 * Sets the current logger |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
261 * |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
262 * @param logger The logger to set |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
263 */ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
264 void gaim_log_logger_set (GaimLogLogger *logger); |
7440 | 265 |
10566
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
266 /** |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
267 * |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
268 * Returns the current logger |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
269 * |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
270 * @return logger The current logger |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
271 */ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
272 GaimLogLogger *gaim_log_logger_get (void); |
7440 | 273 |
10566
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
274 /** |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
275 * Returns a GList containing the IDs and Names of the registered log |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
276 * loggers. |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
277 * |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
278 * @return The list of IDs and names. |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
279 */ |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
280 GList *gaim_log_logger_get_options(void); |
7431 | 281 |
10566
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
282 void gaim_log_init(void); |
62fc579810f4
[gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10348
diff
changeset
|
283 /*@}*/ |
7431 | 284 |
5872 | 285 |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5934
diff
changeset
|
286 #ifdef __cplusplus |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5934
diff
changeset
|
287 } |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5934
diff
changeset
|
288 #endif |
7440 | 289 |
7431 | 290 #endif /* _GAIM_LOG_H_ */ |