comparison src/log.h @ 8898:de87e510ff9a

[gaim-migrate @ 9667] This makes the history plugin work in chats and not just conversations. To do this I had to change some functions in log.c to pass around the GaimLogType (GAIM_LOG_IM, GAIM_LOG_CHAT, or GAIM_LOG_SYSTEM). I hope that's not a problem... Here's how I see it: When creating a new GaimLog you need 3 things, the type, your account and the name of the other person/chat. It only makes sense that you would need those same 3 things to find a log. Or to calculate log size. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 07 May 2004 02:30:02 +0000
parents 92cbf9713795
children b540c735a6ad
comparison
equal deleted inserted replaced
8897:8ffd1679df93 8898:de87e510ff9a
72 72
73 /** Called when the log is destroyed */ 73 /** Called when the log is destroyed */
74 void (*finalize)(GaimLog *log); 74 void (*finalize)(GaimLog *log);
75 75
76 /** This function returns a sorted GList of available GaimLogs */ 76 /** This function returns a sorted GList of available GaimLogs */
77 GList *(*list)(const char *name, GaimAccount *account); 77 GList *(*list)(GaimLogType type, const char *name, GaimAccount *account);
78 78
79 /** Given one of the logs returned by the logger's list function, 79 /** Given one of the logs returned by the logger's list function,
80 * this returns the contents of the log in GtkIMHtml markup */ 80 * this returns the contents of the log in GtkIMHtml markup */
81 char *(*read)(GaimLog *log, GaimLogReadFlags *flags); 81 char *(*read)(GaimLog *log, GaimLogReadFlags *flags);
82 82
84 * this returns the size of the log in bytes */ 84 * this returns the size of the log in bytes */
85 int (*size)(GaimLog *log); 85 int (*size)(GaimLog *log);
86 86
87 /** Returns the total size of all the logs. If this is undefined a default 87 /** Returns the total size of all the logs. If this is undefined a default
88 * implementation is used */ 88 * implementation is used */
89 int (*total_size)(const char *name, GaimAccount *account); 89 int (*total_size)(GaimLogType type, const char *name, GaimAccount *account);
90 90
91 /** This function returns a sorted GList of available system GaimLogs */ 91 /** This function returns a sorted GList of available system GaimLogs */
92 GList *(*list_syslog)(GaimAccount *account); 92 GList *(*list_syslog)(GaimAccount *account);
93 }; 93 };
94 94
163 char *gaim_log_read(GaimLog *log, GaimLogReadFlags *flags); 163 char *gaim_log_read(GaimLog *log, GaimLogReadFlags *flags);
164 164
165 /** 165 /**
166 * Returns a list of all available logs 166 * Returns a list of all available logs
167 * 167 *
168 * @param type The type of the log
168 * @param name The name of the log 169 * @param name The name of the log
169 * @param account The account 170 * @param account The account
170 * @return A sorted list of GaimLogs 171 * @return A sorted list of GaimLogs
171 */ 172 */
172 GList *gaim_log_get_logs(const char *name, GaimAccount *account); 173 GList *gaim_log_get_logs(GaimLogType type, const char *name, GaimAccount *account);
173 174
174 /** 175 /**
175 * Returns a list of all available system logs 176 * Returns a list of all available system logs
176 * 177 *
177 * @param account The account 178 * @param account The account
192 * 193 *
193 * @param name The name of the log 194 * @param name The name of the log
194 * @param account The account 195 * @param account The account
195 * @return The size in bytes 196 * @return The size in bytes
196 */ 197 */
197 int gaim_log_get_total_size(const char *name, GaimAccount *account); 198 int gaim_log_get_total_size(GaimLogType type, const char *name, GaimAccount *account);
198 199
199 /** 200 /**
200 * Implements GCompareFunc 201 * Implements GCompareFunc
201 * 202 *
202 * @param y A GaimLog 203 * @param y A GaimLog
219 * @param read The logger's read function. 220 * @param read The logger's read function.
220 * @param size The logger's size function. 221 * @param size The logger's size function.
221 * 222 *
222 * @return The new logger 223 * @return The new logger
223 */ 224 */
224 GaimLogLogger *gaim_log_logger_new(void(*create)(GaimLog *), 225 GaimLogLogger *gaim_log_logger_new(
225 void(*write)(GaimLog *, GaimMessageFlags, 226 void(*create)(GaimLog *),
226 const char *, time_t, const char *), 227 void(*write)(GaimLog *, GaimMessageFlags, const char *, time_t, const char *),
227 void(*finalize)(GaimLog *), 228 void(*finalize)(GaimLog *),
228 GList*(*list)(const char*, GaimAccount*), 229 GList*(*list)(GaimLogType type, const char*, GaimAccount*),
229 char*(*read)(GaimLog*, GaimLogReadFlags*), 230 char*(*read)(GaimLog*, GaimLogReadFlags*),
230 int(*size)(GaimLog*)); 231 int(*size)(GaimLog*));
231 /** 232 /**
232 * Frees a logger 233 * Frees a logger
233 * 234 *
234 * @param logger The logger to free 235 * @param logger The logger to free
235 */ 236 */