annotate src/log.h @ 13598:41e40b323dc3

[gaim-migrate @ 15984] Previously our file transfer dialog showed "time elapsed" as the current time minus the time when the transfer was added to the ft dialog. When sending a file, the transfer is added when you offer the file to the remote user, not when the transfer actually starts. This meant the "time elapsed" was longer than it should have been, which threw off the transfer rate. This should fix that. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 09 Apr 2006 17:38:38 +0000
parents 0a8b72b12cef
children 51d436a267ac
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 * @file log.h Logging API
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 * @ingroup core
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 *
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 * gaim
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
6 *
8046
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 7586
diff changeset
7 * Gaim is the legal property of its developers, whose names are too numerous
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 7586
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 7586
diff changeset
9 * source distribution.
7440
8c0527c91a92 [gaim-migrate @ 8045]
Nathan Walp <nwalp@pidgin.im>
parents: 7431
diff changeset
10 *
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * (at your option) any later version.
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 *
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 * GNU General Public License for more details.
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 *
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 */
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25 #ifndef _GAIM_LOG_H_
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
26 #define _GAIM_LOG_H_
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
28 #include <stdio.h>
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
30
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
31 /********************************************************
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
32 * DATA STRUCTURES **************************************
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
33 ********************************************************/
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
34
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
35 typedef struct _GaimLog GaimLog;
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
36 typedef struct _GaimLogLogger GaimLogLogger;
10822
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
37 typedef struct _GaimLogCommonLoggerData GaimLogCommonLoggerData;
11025
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
38 typedef struct _GaimLogSet GaimLogSet;
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
39
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
40 typedef enum {
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
41 GAIM_LOG_IM,
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
42 GAIM_LOG_CHAT,
10348
64bc206c7473 [gaim-migrate @ 11562]
Mark Doliner <mark@kingant.net>
parents: 10231
diff changeset
43 GAIM_LOG_SYSTEM
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
44 } GaimLogType;
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
45
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
46 typedef enum {
10348
64bc206c7473 [gaim-migrate @ 11562]
Mark Doliner <mark@kingant.net>
parents: 10231
diff changeset
47 GAIM_LOG_READ_NO_NEWLINE = 1
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
48 } GaimLogReadFlags;
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
49
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
50 #include "account.h"
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
51 #include "conversation.h"
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
52
11177
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
53 typedef void (*GaimLogSetCallback) (GHashTable *sets, GaimLogSet *set);
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
54
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
55 /**
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
56 * A log logger.
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
57 *
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
58 * This struct gets filled out and is included in the GaimLog. It contains everything
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
59 * needed to write and read from logs.
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
60 */
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
61 struct _GaimLogLogger {
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
62 char *name; /**< The logger's name */
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
63 char *id; /**< an identifier to refer to this logger */
7440
8c0527c91a92 [gaim-migrate @ 8045]
Nathan Walp <nwalp@pidgin.im>
parents: 7431
diff changeset
64
8c0527c91a92 [gaim-migrate @ 8045]
Nathan Walp <nwalp@pidgin.im>
parents: 7431
diff changeset
65 /** This gets called when the log is first created.
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
66 I don't think this is actually needed. */
10812
d087e928ffd1 [gaim-migrate @ 12465]
Luke Schierer <lschiere@pidgin.im>
parents: 10566
diff changeset
67 void (*create)(GaimLog *log);
7440
8c0527c91a92 [gaim-migrate @ 8045]
Nathan Walp <nwalp@pidgin.im>
parents: 7431
diff changeset
68
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
69 /** This is used to write to the log file */
13059
1b71ad2eccdb [gaim-migrate @ 15421]
Nathan Walp <nwalp@pidgin.im>
parents: 12835
diff changeset
70 gsize (*write)(GaimLog *log,
7440
8c0527c91a92 [gaim-migrate @ 8045]
Nathan Walp <nwalp@pidgin.im>
parents: 7431
diff changeset
71 GaimMessageFlags type,
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
72 const char *from,
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
73 time_t time,
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
74 const char *message);
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
75
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
76 /** Called when the log is destroyed */
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
77 void (*finalize)(GaimLog *log);
7440
8c0527c91a92 [gaim-migrate @ 8045]
Nathan Walp <nwalp@pidgin.im>
parents: 7431
diff changeset
78
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
79 /** This function returns a sorted GList of available GaimLogs */
8898
de87e510ff9a [gaim-migrate @ 9667]
Mark Doliner <mark@kingant.net>
parents: 8735
diff changeset
80 GList *(*list)(GaimLogType type, const char *name, GaimAccount *account);
7440
8c0527c91a92 [gaim-migrate @ 8045]
Nathan Walp <nwalp@pidgin.im>
parents: 7431
diff changeset
81
8c0527c91a92 [gaim-migrate @ 8045]
Nathan Walp <nwalp@pidgin.im>
parents: 7431
diff changeset
82 /** Given one of the logs returned by the logger's list function,
8c0527c91a92 [gaim-migrate @ 8045]
Nathan Walp <nwalp@pidgin.im>
parents: 7431
diff changeset
83 * this returns the contents of the log in GtkIMHtml markup */
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
84 char *(*read)(GaimLog *log, GaimLogReadFlags *flags);
10231
84cf3fc8a2cb [gaim-migrate @ 11366]
Mark Doliner <mark@kingant.net>
parents: 10171
diff changeset
85
7556
219903d29401 [gaim-migrate @ 8170]
Sean Egan <seanegan@gmail.com>
parents: 7456
diff changeset
86 /** Given one of the logs returned by the logger's list function,
219903d29401 [gaim-migrate @ 8170]
Sean Egan <seanegan@gmail.com>
parents: 7456
diff changeset
87 * this returns the size of the log in bytes */
219903d29401 [gaim-migrate @ 8170]
Sean Egan <seanegan@gmail.com>
parents: 7456
diff changeset
88 int (*size)(GaimLog *log);
8096
81079e3eda47 [gaim-migrate @ 8795]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
89
81079e3eda47 [gaim-migrate @ 8795]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
90 /** Returns the total size of all the logs. If this is undefined a default
81079e3eda47 [gaim-migrate @ 8795]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
91 * implementation is used */
8898
de87e510ff9a [gaim-migrate @ 9667]
Mark Doliner <mark@kingant.net>
parents: 8735
diff changeset
92 int (*total_size)(GaimLogType type, const char *name, GaimAccount *account);
8573
7dcd6f26e4a7 [gaim-migrate @ 9321]
Luke Schierer <lschiere@pidgin.im>
parents: 8096
diff changeset
93
7dcd6f26e4a7 [gaim-migrate @ 9321]
Luke Schierer <lschiere@pidgin.im>
parents: 8096
diff changeset
94 /** This function returns a sorted GList of available system GaimLogs */
7dcd6f26e4a7 [gaim-migrate @ 9321]
Luke Schierer <lschiere@pidgin.im>
parents: 8096
diff changeset
95 GList *(*list_syslog)(GaimAccount *account);
11025
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
96
11177
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
97 /** Adds GaimLogSets to a GHashTable. By passing the data in the GaimLogSets
11025
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
98 * to list, the caller can get every available GaimLog from the logger.
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
99 * Loggers using gaim_log_common_writer() (or otherwise storing their
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
100 * logs in the same directory structure as the stock loggers) do not
11177
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
101 * need to implement this function.
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
102 *
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
103 * Loggers which implement this function must create a GaimLogSet,
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
104 * then call @a cb with @a sets and the newly created GaimLogSet. */
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
105 void (*get_log_sets)(GaimLogSetCallback cb, GHashTable *sets);
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
106 };
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
107
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
108 /**
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
109 * A log. Not the wooden type.
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
110 */
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
111 struct _GaimLog {
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
112 GaimLogType type; /**< The type of log this is */
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
113 char *name; /**< The name of this log */
7440
8c0527c91a92 [gaim-migrate @ 8045]
Nathan Walp <nwalp@pidgin.im>
parents: 7431
diff changeset
114 GaimAccount *account; /**< The account this log is taking
13119
fcde3faa1f57 [gaim-migrate @ 15481]
Richard Laager <rlaager@wiktel.com>
parents: 13059
diff changeset
115 place on */
11292
ef9280fdc511 [gaim-migrate @ 13492]
Richard Laager <rlaager@wiktel.com>
parents: 11177
diff changeset
116 GaimConversation *conv; /**< The conversation being logged */
7440
8c0527c91a92 [gaim-migrate @ 8045]
Nathan Walp <nwalp@pidgin.im>
parents: 7431
diff changeset
117 time_t time; /**< The time this conversation
13119
fcde3faa1f57 [gaim-migrate @ 15481]
Richard Laager <rlaager@wiktel.com>
parents: 13059
diff changeset
118 started, converted to the local timezone */
fcde3faa1f57 [gaim-migrate @ 15481]
Richard Laager <rlaager@wiktel.com>
parents: 13059
diff changeset
119
7440
8c0527c91a92 [gaim-migrate @ 8045]
Nathan Walp <nwalp@pidgin.im>
parents: 7431
diff changeset
120 GaimLogLogger *logger; /**< The logging mechanism this log
13119
fcde3faa1f57 [gaim-migrate @ 15481]
Richard Laager <rlaager@wiktel.com>
parents: 13059
diff changeset
121 is to use */
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
122 void *logger_data; /**< Data used by the log logger */
13119
fcde3faa1f57 [gaim-migrate @ 15481]
Richard Laager <rlaager@wiktel.com>
parents: 13059
diff changeset
123 struct tm *tm; /**< The time this conversation
fcde3faa1f57 [gaim-migrate @ 15481]
Richard Laager <rlaager@wiktel.com>
parents: 13059
diff changeset
124 started, saved with original
fcde3faa1f57 [gaim-migrate @ 15481]
Richard Laager <rlaager@wiktel.com>
parents: 13059
diff changeset
125 timezone data, if available and
fcde3faa1f57 [gaim-migrate @ 15481]
Richard Laager <rlaager@wiktel.com>
parents: 13059
diff changeset
126 if struct tm has the BSD
fcde3faa1f57 [gaim-migrate @ 15481]
Richard Laager <rlaager@wiktel.com>
parents: 13059
diff changeset
127 timezone fields, else @c NULL.
fcde3faa1f57 [gaim-migrate @ 15481]
Richard Laager <rlaager@wiktel.com>
parents: 13059
diff changeset
128 Do NOT modify anything in this struct.*/
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
129 };
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
130
10822
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
131 /**
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
132 * A common logger_data struct containing a file handle and path, as well
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
133 * as a pointer to something else for additional data.
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
134 */
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
135 struct _GaimLogCommonLoggerData {
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
136 char *path;
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
137 FILE *file;
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
138 void *extra_data;
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
139 };
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
140
11025
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
141 /**
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
142 * Describes available logs.
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
143 *
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
144 * By passing the elements of this struct to gaim_log_get_logs(), the caller
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
145 * can get all available GaimLogs.
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
146 */
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
147 struct _GaimLogSet {
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
148 GaimLogType type; /**< The type of logs available */
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
149 char *name; /**< The name of the logs available */
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
150 GaimAccount *account; /**< The account the available logs
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
151 took place on. This will be
11503
cd0c8830d881 [gaim-migrate @ 13748]
Richard Laager <rlaager@wiktel.com>
parents: 11292
diff changeset
152 @c NULL if the account no longer
11025
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
153 exists. (Depending on a
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
154 logger's implementation of
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
155 list, it may not be possible
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
156 to load such logs.) */
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
157 gboolean buddy; /**< Is this (account, name) a buddy
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
158 on the buddy list? */
11177
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
159 char *normalized_name; /**< The normalized version of
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
160 @a name. It must be set, and
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
161 may be set to the same pointer
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
162 value as @a name. */
11025
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
163 };
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
164
5944
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5934
diff changeset
165 #ifdef __cplusplus
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5934
diff changeset
166 extern "C" {
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5934
diff changeset
167 #endif
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5934
diff changeset
168
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
169 /***************************************/
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
170 /** @name Log Functions */
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
171 /***************************************/
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
172 /*@{*/
7440
8c0527c91a92 [gaim-migrate @ 8045]
Nathan Walp <nwalp@pidgin.im>
parents: 7431
diff changeset
173
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
174 /**
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
175 * Creates a new log
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 * @param type The type of log this is.
11025
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
178 * @param name The name of this conversation (screenname, chat name,
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
179 * etc.)
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
180 * @param account The account the conversation is occurring on
11292
ef9280fdc511 [gaim-migrate @ 13492]
Richard Laager <rlaager@wiktel.com>
parents: 11177
diff changeset
181 * @param conv The conversation being logged
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
182 * @param time The time this conversation started
13119
fcde3faa1f57 [gaim-migrate @ 15481]
Richard Laager <rlaager@wiktel.com>
parents: 13059
diff changeset
183 * @param tm The time this conversation started, with timezone data,
fcde3faa1f57 [gaim-migrate @ 15481]
Richard Laager <rlaager@wiktel.com>
parents: 13059
diff changeset
184 * if available and if struct tm has the BSD timezone fields.
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
185 * @return The new log
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
186 */
11292
ef9280fdc511 [gaim-migrate @ 13492]
Richard Laager <rlaager@wiktel.com>
parents: 11177
diff changeset
187 GaimLog *gaim_log_new(GaimLogType type, const char *name, GaimAccount *account,
13119
fcde3faa1f57 [gaim-migrate @ 15481]
Richard Laager <rlaager@wiktel.com>
parents: 13059
diff changeset
188 GaimConversation *conv, time_t time, const struct tm *tm);
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
189
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
190 /**
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
191 * Frees a log
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 * @param log The log to destroy
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 void gaim_log_free(GaimLog *log);
7440
8c0527c91a92 [gaim-migrate @ 8045]
Nathan Walp <nwalp@pidgin.im>
parents: 7431
diff changeset
196
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
197 /**
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
198 * Writes to a log file. Assumes you have checked preferences already.
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 * @param log The log to write to
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
201 * @param type The type of message being logged
11503
cd0c8830d881 [gaim-migrate @ 13748]
Richard Laager <rlaager@wiktel.com>
parents: 11292
diff changeset
202 * @param from Whom this message is coming from, or @c NULL for
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
203 * system messages
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
204 * @param time A timestamp in UNIX time
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
205 * @param message The message to log
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
206 */
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
207 void gaim_log_write(GaimLog *log,
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
208 GaimMessageFlags type,
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
209 const char *from,
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
210 time_t time,
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
211 const char *message);
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
212
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
213 /**
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
214 * Reads from a log
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
215 *
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
216 * @param log The log to read from
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
217 * @param flags The returned logging flags.
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
218 *
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
219 * @return The contents of this log in Gaim Markup.
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
220 */
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
221 char *gaim_log_read(GaimLog *log, GaimLogReadFlags *flags);
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
222
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
223 /**
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
224 * Returns a list of all available logs
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
225 *
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
226 * @param type The type of the log
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
227 * @param name The name of the log
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
228 * @param account The account
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
229 * @return A sorted list of GaimLogs
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
230 */
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
231 GList *gaim_log_get_logs(GaimLogType type, const char *name, GaimAccount *account);
7440
8c0527c91a92 [gaim-migrate @ 8045]
Nathan Walp <nwalp@pidgin.im>
parents: 7431
diff changeset
232
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
233 /**
11177
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
234 * Returns a GHashTable of GaimLogSets.
11025
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
235 *
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
236 * A "log set" here means the information necessary to gather the
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
237 * GaimLogs for a given buddy/chat. This information would be passed
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
238 * to gaim_log_list to get a list of GaimLogs.
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
239 *
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
240 * The primary use of this function is to get a list of everyone the
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
241 * user has ever talked to (assuming he or she uses logging).
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
242 *
11177
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
243 * The GHashTable that's returned will free all log sets in it when
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
244 * destroyed. If a GaimLogSet is removed from the GHashTable, it
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
245 * must be freed with gaim_log_set_free().
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
246 *
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
247 * @return A GHashTable of all available unique GaimLogSets
11025
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
248 */
11177
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
249 GHashTable *gaim_log_get_log_sets(void);
11025
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
250
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
251 /**
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
252 * Returns a list of all available system logs
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 account The account
11177
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
255 * @return A sorted list of GaimLogs
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
256 */
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
257 GList *gaim_log_get_system_logs(GaimAccount *account);
8573
7dcd6f26e4a7 [gaim-migrate @ 9321]
Luke Schierer <lschiere@pidgin.im>
parents: 8096
diff changeset
258
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
259 /**
10822
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
260 * Returns the size of a log
10566
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 log The log
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
263 * @return The size of the log, in bytes
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
264 */
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
265 int gaim_log_get_size(GaimLog *log);
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
266
10566
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 size, in bytes, of all available logs in this conversation
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 * @param type The type of the log
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
271 * @param name The name of the log
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
272 * @param account The account
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
273 * @return The size in bytes
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 int gaim_log_get_total_size(GaimLogType type, const char *name, GaimAccount *account);
8573
7dcd6f26e4a7 [gaim-migrate @ 9321]
Luke Schierer <lschiere@pidgin.im>
parents: 8096
diff changeset
276
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
277 /**
10822
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
278 * Returns the default logger directory Gaim uses for a given account
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
279 * and username. This would be where Gaim stores logs created by
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
280 * the built-in text or HTML loggers.
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
281 *
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
282 * @param type The type of the log.
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
283 * @param name The name of the log.
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
284 * @param account The account.
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
285 * @return The default logger directory for Gaim.
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
286 */
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
287 char *gaim_log_get_log_dir(GaimLogType type, const char *name, GaimAccount *account);
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
288
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
289 /**
11025
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
290 * Implements GCompareFunc for GaimLogs
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
291 *
11177
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
292 * @param y A GaimLog
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
293 * @param z Another GaimLog
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
294 * @return A value as specified by GCompareFunc
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
295 */
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
296 gint gaim_log_compare(gconstpointer y, gconstpointer z);
11025
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
297
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
298 /**
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
299 * Implements GCompareFunc for GaimLogSets
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
300 *
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
301 * @param y A GaimLogSet
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
302 * @param z Another GaimLogSet
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
303 * @return A value as specified by GCompareFunc
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
304 */
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
305 gint gaim_log_set_compare(gconstpointer y, gconstpointer z);
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
306
11177
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
307 /**
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
308 * Frees a log set
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
309 *
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
310 * @param set The log set to destroy
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
311 */
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
312 void gaim_log_set_free(GaimLogSet *set);
3924db2b1ca8 [gaim-migrate @ 13285]
Richard Laager <rlaager@wiktel.com>
parents: 11035
diff changeset
313
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
314 /*@}*/
8573
7dcd6f26e4a7 [gaim-migrate @ 9321]
Luke Schierer <lschiere@pidgin.im>
parents: 8096
diff changeset
315
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
316 /******************************************/
10822
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
317 /** @name Common Logger Functions */
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
318 /******************************************/
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
319 /*@{*/
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
320
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
321 /**
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
322 * Opens a new log file in the standard Gaim log location
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
323 * with the given file extension, named for the current time,
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
324 * for writing. If a log file is already open, the existing
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
325 * file handle is retained. The log's logger_data value is
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
326 * set to a GaimLogCommonLoggerData struct containing the log
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
327 * file handle and log path.
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
328 *
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
329 * @param log The log to write to.
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
330 * @param ext The file extension to give to this log file.
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
331 */
11292
ef9280fdc511 [gaim-migrate @ 13492]
Richard Laager <rlaager@wiktel.com>
parents: 11177
diff changeset
332 void gaim_log_common_writer(GaimLog *log, const char *ext);
10822
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
333
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
334 /**
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
335 * Returns a sorted GList of GaimLogs of the requested type.
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
336 * This function should only be used with logs that are written
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
337 * with gaim_log_common_writer().
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
338 *
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
339 * @param type The type of the logs being listed.
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
340 * @param name The name of the log.
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
341 * @param account The account of the log.
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
342 * @param ext The file extension this log format uses.
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
343 * @param logger A reference to the logger struct for this log.
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
344 *
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
345 * @return A sorted GList of GaimLogs matching the parameters.
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
346 */
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
347 GList *gaim_log_common_lister(GaimLogType type, const char *name,
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
348 GaimAccount *account, const char *ext,
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
349 GaimLogLogger *logger);
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
350
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
351 /**
13388
0a8b72b12cef [gaim-migrate @ 15761]
Richard Laager <rlaager@wiktel.com>
parents: 13119
diff changeset
352 * Returns the total size of all the logs for a given user, with
0a8b72b12cef [gaim-migrate @ 15761]
Richard Laager <rlaager@wiktel.com>
parents: 13119
diff changeset
353 * a given extension. This is the "common" implemention of a
0a8b72b12cef [gaim-migrate @ 15761]
Richard Laager <rlaager@wiktel.com>
parents: 13119
diff changeset
354 * logger's total_size function.
0a8b72b12cef [gaim-migrate @ 15761]
Richard Laager <rlaager@wiktel.com>
parents: 13119
diff changeset
355 * This function should only be used with logs that are written
0a8b72b12cef [gaim-migrate @ 15761]
Richard Laager <rlaager@wiktel.com>
parents: 13119
diff changeset
356 * with gaim_log_common_writer().
0a8b72b12cef [gaim-migrate @ 15761]
Richard Laager <rlaager@wiktel.com>
parents: 13119
diff changeset
357 *
0a8b72b12cef [gaim-migrate @ 15761]
Richard Laager <rlaager@wiktel.com>
parents: 13119
diff changeset
358 * @param type The type of the logs being sized.
0a8b72b12cef [gaim-migrate @ 15761]
Richard Laager <rlaager@wiktel.com>
parents: 13119
diff changeset
359 * @param name The name of the logs to size
0a8b72b12cef [gaim-migrate @ 15761]
Richard Laager <rlaager@wiktel.com>
parents: 13119
diff changeset
360 * (e.g. the username or chat name).
0a8b72b12cef [gaim-migrate @ 15761]
Richard Laager <rlaager@wiktel.com>
parents: 13119
diff changeset
361 * @param account The account of the log.
0a8b72b12cef [gaim-migrate @ 15761]
Richard Laager <rlaager@wiktel.com>
parents: 13119
diff changeset
362 * @param ext The file extension this log format uses.
0a8b72b12cef [gaim-migrate @ 15761]
Richard Laager <rlaager@wiktel.com>
parents: 13119
diff changeset
363 *
0a8b72b12cef [gaim-migrate @ 15761]
Richard Laager <rlaager@wiktel.com>
parents: 13119
diff changeset
364 * @return The size of all the logs with the specified extension
0a8b72b12cef [gaim-migrate @ 15761]
Richard Laager <rlaager@wiktel.com>
parents: 13119
diff changeset
365 * for the specified user.
0a8b72b12cef [gaim-migrate @ 15761]
Richard Laager <rlaager@wiktel.com>
parents: 13119
diff changeset
366 */
0a8b72b12cef [gaim-migrate @ 15761]
Richard Laager <rlaager@wiktel.com>
parents: 13119
diff changeset
367 int gaim_log_common_total_sizer(GaimLogType type, const char *name,
0a8b72b12cef [gaim-migrate @ 15761]
Richard Laager <rlaager@wiktel.com>
parents: 13119
diff changeset
368 GaimAccount *account, const char *ext);
0a8b72b12cef [gaim-migrate @ 15761]
Richard Laager <rlaager@wiktel.com>
parents: 13119
diff changeset
369
0a8b72b12cef [gaim-migrate @ 15761]
Richard Laager <rlaager@wiktel.com>
parents: 13119
diff changeset
370 /**
10822
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
371 * Returns the size of a given GaimLog.
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
372 * This function should only be used with logs that are written
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
373 * with gaim_log_common_writer().
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
374 *
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
375 * @param log The GaimLog to size.
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
376 *
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
377 * @return An integer indicating the size of the log in bytes.
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
378 */
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
379 int gaim_log_common_sizer(GaimLog *log);
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
380 /*@}*/
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
381
5c5120837bab [gaim-migrate @ 12484]
Mark Doliner <mark@kingant.net>
parents: 10812
diff changeset
382 /******************************************/
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
383 /** @name Logger Functions */
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
384 /******************************************/
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
385 /*@{*/
7440
8c0527c91a92 [gaim-migrate @ 8045]
Nathan Walp <nwalp@pidgin.im>
parents: 7431
diff changeset
386
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
387 /**
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
388 * Creates a new logger
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
389 *
11503
cd0c8830d881 [gaim-migrate @ 13748]
Richard Laager <rlaager@wiktel.com>
parents: 11292
diff changeset
390 * @param id The logger's id.
cd0c8830d881 [gaim-migrate @ 13748]
Richard Laager <rlaager@wiktel.com>
parents: 11292
diff changeset
391 * @param name The logger's name.
cd0c8830d881 [gaim-migrate @ 13748]
Richard Laager <rlaager@wiktel.com>
parents: 11292
diff changeset
392 * @param functions The number of functions being passed. The following
cd0c8830d881 [gaim-migrate @ 13748]
Richard Laager <rlaager@wiktel.com>
parents: 11292
diff changeset
393 * functions are currently available (in order): @c create,
cd0c8830d881 [gaim-migrate @ 13748]
Richard Laager <rlaager@wiktel.com>
parents: 11292
diff changeset
394 * @c write, @c finalize, @c list, @c read, @c size,
cd0c8830d881 [gaim-migrate @ 13748]
Richard Laager <rlaager@wiktel.com>
parents: 11292
diff changeset
395 * @c total_size, @c list_syslog, @c get_log_sets. For
cd0c8830d881 [gaim-migrate @ 13748]
Richard Laager <rlaager@wiktel.com>
parents: 11292
diff changeset
396 * details on these functions, see GaimLogLogger.
cd0c8830d881 [gaim-migrate @ 13748]
Richard Laager <rlaager@wiktel.com>
parents: 11292
diff changeset
397 * Functions may not be skipped. For example, passing
cd0c8830d881 [gaim-migrate @ 13748]
Richard Laager <rlaager@wiktel.com>
parents: 11292
diff changeset
398 * @c create and @c write is acceptable (for a total of
cd0c8830d881 [gaim-migrate @ 13748]
Richard Laager <rlaager@wiktel.com>
parents: 11292
diff changeset
399 * two functions). Passing @c create and @c finalize,
cd0c8830d881 [gaim-migrate @ 13748]
Richard Laager <rlaager@wiktel.com>
parents: 11292
diff changeset
400 * however, is not. To accomplish that, the caller must
cd0c8830d881 [gaim-migrate @ 13748]
Richard Laager <rlaager@wiktel.com>
parents: 11292
diff changeset
401 * pass @c create, @c NULL (a placeholder for @c write),
cd0c8830d881 [gaim-migrate @ 13748]
Richard Laager <rlaager@wiktel.com>
parents: 11292
diff changeset
402 * and @c finalize (for a total of 3 functions).
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
403 *
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
404 * @return The new logger
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
405 */
11503
cd0c8830d881 [gaim-migrate @ 13748]
Richard Laager <rlaager@wiktel.com>
parents: 11292
diff changeset
406 GaimLogLogger *gaim_log_logger_new(const char *id, const char *name, int functions, ...);
11025
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
407
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
408 /**
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
409 * Frees a logger
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
410 *
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
411 * @param logger The logger to free
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
412 */
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
413 void gaim_log_logger_free(GaimLogLogger *logger);
7440
8c0527c91a92 [gaim-migrate @ 8045]
Nathan Walp <nwalp@pidgin.im>
parents: 7431
diff changeset
414
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
415 /**
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
416 * Adds a new logger
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
417 *
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
418 * @param logger The new logger to add
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
419 */
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
420 void gaim_log_logger_add (GaimLogLogger *logger);
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
421
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
422 /**
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
423 *
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
424 * Removes a logger
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
425 *
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
426 * @param logger The logger to remove
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
427 */
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
428 void gaim_log_logger_remove (GaimLogLogger *logger);
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
429
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
430 /**
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
431 *
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
432 * Sets the current logger
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
433 *
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
434 * @param logger The logger to set
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
435 */
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
436 void gaim_log_logger_set (GaimLogLogger *logger);
7440
8c0527c91a92 [gaim-migrate @ 8045]
Nathan Walp <nwalp@pidgin.im>
parents: 7431
diff changeset
437
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
438 /**
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
439 *
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
440 * Returns the current logger
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
441 *
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
442 * @return logger The current logger
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
443 */
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
444 GaimLogLogger *gaim_log_logger_get (void);
7440
8c0527c91a92 [gaim-migrate @ 8045]
Nathan Walp <nwalp@pidgin.im>
parents: 7431
diff changeset
445
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
446 /**
11025
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
447 * Returns a GList containing the IDs and names of the registered
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
448 * loggers.
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
449 *
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
450 * @return The list of IDs and names.
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
451 */
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
452 GList *gaim_log_logger_get_options(void);
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
453
12737
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 11503
diff changeset
454 /**************************************************************************/
12835
6a81da55d4d4 [gaim-migrate @ 15183]
Richard Laager <rlaager@wiktel.com>
parents: 12737
diff changeset
455 /** @name Log Subsystem */
12737
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 11503
diff changeset
456 /**************************************************************************/
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 11503
diff changeset
457 /*@{*/
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 11503
diff changeset
458
11025
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
459 /**
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
460 * Initializes the log subsystem.
8d2007d738d5 [gaim-migrate @ 12899]
Mark Doliner <mark@kingant.net>
parents: 10822
diff changeset
461 */
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
462 void gaim_log_init(void);
12737
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 11503
diff changeset
463
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 11503
diff changeset
464 /**
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 11503
diff changeset
465 * Returns the log subsystem handle.
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 11503
diff changeset
466 *
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 11503
diff changeset
467 * @return The log subsystem handle.
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 11503
diff changeset
468 */
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 11503
diff changeset
469 void *gaim_log_get_handle(void);
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 11503
diff changeset
470
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 11503
diff changeset
471 /**
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 11503
diff changeset
472 * Uninitializes the log subsystem.
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 11503
diff changeset
473 */
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 11503
diff changeset
474 void gaim_log_uninit(void);
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 11503
diff changeset
475
10566
62fc579810f4 [gaim-migrate @ 11949]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10348
diff changeset
476 /*@}*/
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
477
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
478
5944
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5934
diff changeset
479 #ifdef __cplusplus
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5934
diff changeset
480 }
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5934
diff changeset
481 #endif
7440
8c0527c91a92 [gaim-migrate @ 8045]
Nathan Walp <nwalp@pidgin.im>
parents: 7431
diff changeset
482
7431
643cbc9a6035 [gaim-migrate @ 8036]
Sean Egan <seanegan@gmail.com>
parents: 6695
diff changeset
483 #endif /* _GAIM_LOG_H_ */