Thu, 15 May 2014 23:02:22 +0200
Coverity: fix null pointer dereferences
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
1 | /* purple |
| 5872 | 2 | * |
| 15884 | 3 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 5 | * source distribution. | |
| 7440 | 6 | * |
| 5872 | 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 18 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18412
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5872 | 20 | */ |
|
35487
494f09f7f331
Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents:
35486
diff
changeset
|
21 | |
|
494f09f7f331
Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents:
35486
diff
changeset
|
22 | #ifndef _PURPLE_LOG_H_ |
|
494f09f7f331
Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents:
35486
diff
changeset
|
23 | #define _PURPLE_LOG_H_ |
|
35440
467bb21b82a1
Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents:
35419
diff
changeset
|
24 | /** |
|
467bb21b82a1
Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents:
35419
diff
changeset
|
25 | * SECTION:log |
|
467bb21b82a1
Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents:
35419
diff
changeset
|
26 | * @section_id: libpurple-log |
|
467bb21b82a1
Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents:
35419
diff
changeset
|
27 | * @short_description: <filename>log.h</filename> |
|
467bb21b82a1
Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents:
35419
diff
changeset
|
28 | * @title: Logging API |
|
467bb21b82a1
Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents:
35419
diff
changeset
|
29 | * @see_also: <link linkend="chapter-signals-log">Log signals</link> |
|
467bb21b82a1
Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents:
35419
diff
changeset
|
30 | */ |
|
467bb21b82a1
Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents:
35419
diff
changeset
|
31 | |
| 7431 | 32 | #include <stdio.h> |
| 5872 | 33 | |
|
34792
09228ea79272
Added GBoxed to certificate, certificate pool, xfer, log
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
34 | #define PURPLE_TYPE_LOG (purple_log_get_type()) |
| 5872 | 35 | |
| 7431 | 36 | /******************************************************** |
| 37 | * DATA STRUCTURES ************************************** | |
| 38 | ********************************************************/ | |
| 39 | ||
| 15884 | 40 | typedef struct _PurpleLog PurpleLog; |
| 41 | typedef struct _PurpleLogLogger PurpleLogLogger; | |
| 42 | typedef struct _PurpleLogCommonLoggerData PurpleLogCommonLoggerData; | |
| 43 | typedef struct _PurpleLogSet PurpleLogSet; | |
| 7431 | 44 | |
| 45 | typedef enum { | |
| 15884 | 46 | PURPLE_LOG_IM, |
| 47 | PURPLE_LOG_CHAT, | |
| 48 | PURPLE_LOG_SYSTEM | |
| 49 | } PurpleLogType; | |
| 7431 | 50 | |
| 51 | typedef enum { | |
| 15884 | 52 | PURPLE_LOG_READ_NO_NEWLINE = 1 |
| 53 | } PurpleLogReadFlags; | |
| 7431 | 54 | |
| 55 | #include "account.h" | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
56 | #include "conversations.h" |
| 7431 | 57 | |
| 15884 | 58 | typedef void (*PurpleLogSetCallback) (GHashTable *sets, PurpleLogSet *set); |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
59 | |
| 7431 | 60 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
61 | * PurpleLogLogger: |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
62 | * @name: The logger's name |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
63 | * @id: An identifier to refer to this logger |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
64 | * @create: This gets called when the log is first created. I don't think |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
65 | * this is actually needed. |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
66 | * @write: This is used to write to the log file |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
67 | * @finalize: Called when the log is destroyed |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
68 | * @list: This function returns a sorted #GList of available PurpleLogs |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
69 | * @read: Given one of the logs returned by the logger's list function, |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
70 | * this returns the contents of the log in #GtkWebView markup |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
71 | * @size: Given one of the logs returned by the logger's list function, |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
72 | * this returns the size of the log in bytes |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
73 | * @total_size: Returns the total size of all the logs. If this is undefined a |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
74 | * default implementation is used |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
75 | * @list_syslog: This function returns a sorted #GList of available system |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
76 | * #PurpleLog's |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
77 | * @get_log_sets: Adds #PurpleLogSet's to a #GHashTable. By passing the data in |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
78 | * the #PurpleLogSet's to list, the caller can get every |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
79 | * available #PurpleLog from the logger. Loggers using |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
80 | * purple_log_common_writer() (or otherwise storing their logs in |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
81 | * the same directory structure as the stock loggers) do not |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
82 | * need to implement this function. |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
83 | * <sbr/>Loggers which implement this function must create a |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
84 | * #PurpleLogSet, then call @cb with @sets and the newly created |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
85 | * #PurpleLogSet. |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
86 | * @remove: Attempts to delete the specified log, indicating success or |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
87 | * failure |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
88 | * @is_deletable: Tests whether a log is deletable |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
89 | * |
| 7431 | 90 | * A log logger. |
| 91 | * | |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
92 | * This struct gets filled out and is included in the PurpleLog. It contains |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
93 | * everything needed to write and read from logs. |
| 7431 | 94 | */ |
| 15884 | 95 | struct _PurpleLogLogger { |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
96 | char *name; |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
97 | char *id; |
| 7440 | 98 | |
| 15884 | 99 | void (*create)(PurpleLog *log); |
| 7440 | 100 | |
| 15884 | 101 | gsize (*write)(PurpleLog *log, |
|
34620
e49aa67344e1
Renamed PurpleConversationMessageFlags back to PurpleMessageFlags.
Ankit Vani <a@nevitus.org>
parents:
34605
diff
changeset
|
102 | PurpleMessageFlags type, |
| 7431 | 103 | const char *from, |
| 104 | time_t time, | |
| 105 | const char *message); | |
| 106 | ||
| 15884 | 107 | void (*finalize)(PurpleLog *log); |
| 7440 | 108 | |
| 15884 | 109 | GList *(*list)(PurpleLogType type, const char *name, PurpleAccount *account); |
| 7440 | 110 | |
| 15884 | 111 | char *(*read)(PurpleLog *log, PurpleLogReadFlags *flags); |
|
10231
047177cee39f
[gaim-migrate @ 11366]
Andrew Hart <arhart@users.sourceforge.net>
parents:
10171
diff
changeset
|
112 | |
| 15884 | 113 | int (*size)(PurpleLog *log); |
| 8096 | 114 | |
| 15884 | 115 | int (*total_size)(PurpleLogType type, const char *name, PurpleAccount *account); |
| 8573 | 116 | |
| 15884 | 117 | GList *(*list_syslog)(PurpleAccount *account); |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
118 | |
| 15884 | 119 | void (*get_log_sets)(PurpleLogSetCallback cb, GHashTable *sets); |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
120 | |
|
16116
bccaa68c86ad
"delete" is a reserved word in C++, rename the "delete" member of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
121 | gboolean (*remove)(PurpleLog *log); |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
122 | |
| 15884 | 123 | gboolean (*is_deletable)(PurpleLog *log); |
|
16743
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
16116
diff
changeset
|
124 | |
|
35024
eb3afb7643ce
Added /*< private >*/ for padding members, clean them up and add missing ones
Ankit Vani <a@nevitus.org>
parents:
34792
diff
changeset
|
125 | /*< private >*/ |
|
16743
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
16116
diff
changeset
|
126 | void (*_purple_reserved1)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
16116
diff
changeset
|
127 | void (*_purple_reserved2)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
16116
diff
changeset
|
128 | void (*_purple_reserved3)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
16116
diff
changeset
|
129 | void (*_purple_reserved4)(void); |
| 5872 | 130 | }; |
| 131 | ||
| 7431 | 132 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
133 | * PurpleLog: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
134 | * @type: The type of log this is |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
135 | * @name: The name of this log |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
136 | * @account: The account this log is taking place on |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
137 | * @conv: The conversation being logged |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
138 | * @time: The time this conversation started, converted to the local |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
139 | * timezone |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
140 | * @logger: The logging mechanism this log is to use |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
141 | * @logger_data: Data used by the log logger |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
142 | * @tm: The time this conversation started, saved with original |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
143 | * timezone data, if available and if struct tm has the BSD |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
144 | * timezone fields, else %NULL. Do NOT modify anything in this |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
145 | * struct. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
146 | * |
| 7431 | 147 | * A log. Not the wooden type. |
| 148 | */ | |
| 15884 | 149 | struct _PurpleLog { |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
150 | PurpleLogType type; |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
151 | char *name; |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
152 | PurpleAccount *account; |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
153 | PurpleConversation *conv; |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
154 | time_t time; |
|
13120
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13059
diff
changeset
|
155 | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
156 | PurpleLogLogger *logger; |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
157 | void *logger_data; |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
158 | struct tm *tm; |
|
13624
c6577def4e2a
[gaim-migrate @ 16009]
Richard Laager <rlaager@pidgin.im>
parents:
13389
diff
changeset
|
159 | |
|
c6577def4e2a
[gaim-migrate @ 16009]
Richard Laager <rlaager@pidgin.im>
parents:
13389
diff
changeset
|
160 | /* IMPORTANT: Some code in log.c allocates these without zeroing them. |
|
c6577def4e2a
[gaim-migrate @ 16009]
Richard Laager <rlaager@pidgin.im>
parents:
13389
diff
changeset
|
161 | * IMPORTANT: Update that code if you add members here. */ |
| 5872 | 162 | }; |
| 163 | ||
| 10822 | 164 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
165 | * PurpleLogCommonLoggerData: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
166 | * |
| 10822 | 167 | * A common logger_data struct containing a file handle and path, as well |
| 168 | * as a pointer to something else for additional data. | |
| 169 | */ | |
| 15884 | 170 | struct _PurpleLogCommonLoggerData { |
| 10822 | 171 | char *path; |
| 172 | FILE *file; | |
| 173 | void *extra_data; | |
| 174 | }; | |
| 7431 | 175 | |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
176 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
177 | * PurpleLogSet: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
178 | * @type: The type of logs available |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
179 | * @name: The name of the logs available |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
180 | * @account: The account the available logs took place on. This will be |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
181 | * %NULL if the account no longer exists. (Depending on a |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
182 | * logger's implementation of list, it may not be possible to |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
183 | * load such logs.) |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
184 | * @buddy: Is this (account, name) a buddy on the buddy list? |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
185 | * @normalized_name: The normalized version of @name. It must be set, and may |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
186 | * be set to the same pointer value as @name. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
187 | * |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
188 | * Describes available logs. |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
189 | * |
| 15884 | 190 | * By passing the elements of this struct to purple_log_get_logs(), the caller |
| 191 | * can get all available PurpleLogs. | |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
192 | */ |
| 15884 | 193 | struct _PurpleLogSet { |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
194 | PurpleLogType type; |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
195 | char *name; |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
196 | PurpleAccount *account; |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
197 | gboolean buddy; |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
198 | char *normalized_name; |
|
13624
c6577def4e2a
[gaim-migrate @ 16009]
Richard Laager <rlaager@pidgin.im>
parents:
13389
diff
changeset
|
199 | |
|
c6577def4e2a
[gaim-migrate @ 16009]
Richard Laager <rlaager@pidgin.im>
parents:
13389
diff
changeset
|
200 | /* IMPORTANT: Some code in log.c allocates these without zeroing them. |
|
c6577def4e2a
[gaim-migrate @ 16009]
Richard Laager <rlaager@pidgin.im>
parents:
13389
diff
changeset
|
201 | * IMPORTANT: Update that code if you add members here. */ |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
202 | }; |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
203 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32438
diff
changeset
|
204 | G_BEGIN_DECLS |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5934
diff
changeset
|
205 | |
| 10566 | 206 | /***************************************/ |
| 35472 | 207 | /* Log Functions */ |
| 10566 | 208 | /***************************************/ |
| 7440 | 209 | |
| 10566 | 210 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
211 | * purple_log_get_type: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
212 | * |
|
35462
901dfa763f15
Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents:
35440
diff
changeset
|
213 | * Returns: The #GType for the #PurpleLog boxed structure. |
|
901dfa763f15
Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents:
35440
diff
changeset
|
214 | */ |
|
901dfa763f15
Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents:
35440
diff
changeset
|
215 | /* TODO Boxing of PurpleLog is a temporary solution to having a GType for |
|
34792
09228ea79272
Added GBoxed to certificate, certificate pool, xfer, log
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
216 | * logs. This should rather be a GObject instead of a GBoxed. |
|
09228ea79272
Added GBoxed to certificate, certificate pool, xfer, log
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
217 | */ |
|
09228ea79272
Added GBoxed to certificate, certificate pool, xfer, log
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
218 | GType purple_log_get_type(void); |
|
09228ea79272
Added GBoxed to certificate, certificate pool, xfer, log
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
219 | |
|
09228ea79272
Added GBoxed to certificate, certificate pool, xfer, log
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
220 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
221 | * purple_log_new: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
222 | * @type: The type of log this is. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
223 | * @name: The name of this conversation (buddy name, chat name, |
| 10566 | 224 | * etc.) |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
225 | * @account: The account the conversation is occurring on |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
226 | * @conv: The conversation being logged |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
227 | * @time: The time this conversation started |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
228 | * @tm: The time this conversation started, with timezone data, |
|
13120
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13059
diff
changeset
|
229 | * if available and if struct tm has the BSD timezone fields. |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
230 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
231 | * Creates a new log |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
232 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
233 | * Returns: The new log |
| 10566 | 234 | */ |
| 15884 | 235 | PurpleLog *purple_log_new(PurpleLogType type, const char *name, PurpleAccount *account, |
| 236 | PurpleConversation *conv, time_t time, const struct tm *tm); | |
| 7431 | 237 | |
| 10566 | 238 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
239 | * purple_log_free: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
240 | * @log: The log to destroy |
| 10566 | 241 | * |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
242 | * Frees a log |
| 10566 | 243 | */ |
| 15884 | 244 | void purple_log_free(PurpleLog *log); |
| 7440 | 245 | |
| 10566 | 246 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
247 | * purple_log_write: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
248 | * @log: The log to write to |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
249 | * @type: The type of message being logged |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
250 | * @from: Whom this message is coming from, or %NULL for |
| 10566 | 251 | * system messages |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
252 | * @time: A timestamp in UNIX time |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
253 | * @message: The message to log |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
254 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
255 | * Writes to a log file. Assumes you have checked preferences already. |
| 10566 | 256 | */ |
| 15884 | 257 | void purple_log_write(PurpleLog *log, |
|
34620
e49aa67344e1
Renamed PurpleConversationMessageFlags back to PurpleMessageFlags.
Ankit Vani <a@nevitus.org>
parents:
34605
diff
changeset
|
258 | PurpleMessageFlags type, |
| 10566 | 259 | const char *from, |
| 260 | time_t time, | |
| 261 | const char *message); | |
| 7431 | 262 | |
| 10566 | 263 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
264 | * purple_log_read: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
265 | * @log: The log to read from |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
266 | * @flags: The returned logging flags. |
| 10566 | 267 | * |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
268 | * Reads from a log |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
269 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
270 | * Returns: The contents of this log in Purple Markup. |
| 10566 | 271 | */ |
| 15884 | 272 | char *purple_log_read(PurpleLog *log, PurpleLogReadFlags *flags); |
| 7431 | 273 | |
| 10566 | 274 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
275 | * purple_log_get_logs: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
276 | * @type: The type of the log |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
277 | * @name: The name of the log |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
278 | * @account: The account |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
279 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
280 | * Returns a list of all available logs |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
281 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
282 | * Returns: A sorted list of PurpleLogs |
| 10566 | 283 | */ |
| 15884 | 284 | GList *purple_log_get_logs(PurpleLogType type, const char *name, PurpleAccount *account); |
| 7440 | 285 | |
| 10566 | 286 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
287 | * purple_log_get_log_sets: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
288 | * |
| 15884 | 289 | * Returns a GHashTable of PurpleLogSets. |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
290 | * |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
291 | * A "log set" here means the information necessary to gather the |
| 15884 | 292 | * PurpleLogs for a given buddy/chat. This information would be passed |
| 293 | * to purple_log_list to get a list of PurpleLogs. | |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
294 | * |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
295 | * The primary use of this function is to get a list of everyone the |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
296 | * user has ever talked to (assuming he or she uses logging). |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
297 | * |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
298 | * The GHashTable that's returned will free all log sets in it when |
| 15884 | 299 | * destroyed. If a PurpleLogSet is removed from the GHashTable, it |
| 300 | * must be freed with purple_log_set_free(). | |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
301 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
302 | * Returns: A GHashTable of all available unique PurpleLogSets |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
303 | */ |
| 15884 | 304 | GHashTable *purple_log_get_log_sets(void); |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
305 | |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
306 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
307 | * purple_log_get_system_logs: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
308 | * @account: The account |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
309 | * |
| 10566 | 310 | * Returns a list of all available system logs |
| 311 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
312 | * Returns: A sorted list of PurpleLogs |
| 10566 | 313 | */ |
| 15884 | 314 | GList *purple_log_get_system_logs(PurpleAccount *account); |
| 8573 | 315 | |
| 10566 | 316 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
317 | * purple_log_get_size: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
318 | * @log: The log |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
319 | * |
| 10822 | 320 | * Returns the size of a log |
| 10566 | 321 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
322 | * Returns: The size of the log, in bytes |
| 10566 | 323 | */ |
| 15884 | 324 | int purple_log_get_size(PurpleLog *log); |
| 5872 | 325 | |
| 10566 | 326 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
327 | * purple_log_get_total_size: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
328 | * @type: The type of the log |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
329 | * @name: The name of the log |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
330 | * @account: The account |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
331 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
332 | * Returns the size, in bytes, of all available logs in this conversation |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
333 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
334 | * Returns: The size in bytes |
| 10566 | 335 | */ |
| 15884 | 336 | int purple_log_get_total_size(PurpleLogType type, const char *name, PurpleAccount *account); |
| 8573 | 337 | |
| 10566 | 338 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
339 | * purple_log_get_activity_score: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
340 | * @type: The type of the log |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
341 | * @name: The name of the log |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
342 | * @account: The account |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
343 | * |
|
25883
059b74032730
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@pidgin.im>
parents:
20889
diff
changeset
|
344 | * Returns the activity score of a log, based on total size in bytes, |
|
059b74032730
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@pidgin.im>
parents:
20889
diff
changeset
|
345 | * which is then decayed based on age |
|
059b74032730
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@pidgin.im>
parents:
20889
diff
changeset
|
346 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
347 | * Returns: The activity score |
|
25883
059b74032730
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@pidgin.im>
parents:
20889
diff
changeset
|
348 | */ |
|
059b74032730
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@pidgin.im>
parents:
20889
diff
changeset
|
349 | int purple_log_get_activity_score(PurpleLogType type, const char *name, PurpleAccount *account); |
|
059b74032730
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@pidgin.im>
parents:
20889
diff
changeset
|
350 | |
|
059b74032730
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@pidgin.im>
parents:
20889
diff
changeset
|
351 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
352 | * purple_log_is_deletable: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
353 | * @log: The log |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
354 | * |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
355 | * Tests whether a log is deletable |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
356 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
357 | * A return value of %FALSE indicates that purple_log_delete() will fail on this |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
358 | * log, unless something changes between the two calls. A return value of %TRUE, |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
359 | * however, does not guarantee the log can be deleted. |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
360 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
361 | * Returns: A boolean indicating if the log is deletable |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
362 | */ |
| 15884 | 363 | gboolean purple_log_is_deletable(PurpleLog *log); |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
364 | |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
365 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
366 | * purple_log_delete: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
367 | * @log: The log |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
368 | * |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
369 | * Deletes a log |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
370 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
371 | * Returns: A boolean indicating success or failure |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
372 | */ |
| 15884 | 373 | gboolean purple_log_delete(PurpleLog *log); |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
374 | |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
375 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
376 | * purple_log_get_log_dir: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
377 | * @type: The type of the log. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
378 | * @name: The name of the log. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
379 | * @account: The account. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
380 | * |
| 15884 | 381 | * Returns the default logger directory Purple uses for a given account |
| 382 | * and username. This would be where Purple stores logs created by | |
| 10822 | 383 | * the built-in text or HTML loggers. |
| 384 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
385 | * Returns: The default logger directory for Purple. |
| 10822 | 386 | */ |
| 15884 | 387 | char *purple_log_get_log_dir(PurpleLogType type, const char *name, PurpleAccount *account); |
| 10822 | 388 | |
| 389 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
390 | * purple_log_compare: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
391 | * @y: A PurpleLog |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
392 | * @z: Another PurpleLog |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
393 | * |
| 15884 | 394 | * Implements GCompareFunc for PurpleLogs |
| 10566 | 395 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
396 | * Returns: A value as specified by GCompareFunc |
| 10566 | 397 | */ |
| 15884 | 398 | gint purple_log_compare(gconstpointer y, gconstpointer z); |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
399 | |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
400 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
401 | * purple_log_set_compare: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
402 | * @y: A PurpleLogSet |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
403 | * @z: Another PurpleLogSet |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
404 | * |
| 15884 | 405 | * Implements GCompareFunc for PurpleLogSets |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
406 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
407 | * Returns: A value as specified by GCompareFunc |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
408 | */ |
| 15884 | 409 | gint purple_log_set_compare(gconstpointer y, gconstpointer z); |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
410 | |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
411 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
412 | * purple_log_set_free: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
413 | * @set: The log set to destroy |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
414 | * |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
415 | * Frees a log set |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
416 | */ |
| 15884 | 417 | void purple_log_set_free(PurpleLogSet *set); |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
418 | |
| 10566 | 419 | /******************************************/ |
| 35472 | 420 | /* Common Logger Functions */ |
| 10822 | 421 | /******************************************/ |
| 422 | ||
| 423 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
424 | * purple_log_common_writer: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
425 | * @log: The log to write to. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
426 | * @ext: The file extension to give to this log file. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
427 | * |
| 15884 | 428 | * Opens a new log file in the standard Purple log location |
| 10822 | 429 | * with the given file extension, named for the current time, |
| 430 | * for writing. If a log file is already open, the existing | |
| 431 | * file handle is retained. The log's logger_data value is | |
| 15884 | 432 | * set to a PurpleLogCommonLoggerData struct containing the log |
| 10822 | 433 | * file handle and log path. |
| 434 | * | |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
435 | * This function is intended to be used as a "common" |
| 35419 | 436 | * implementation of a logger's <literal>write</literal> function. |
| 15884 | 437 | * It should only be passed to purple_log_logger_new() and never |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
438 | * called directly. |
| 10822 | 439 | */ |
| 15884 | 440 | void purple_log_common_writer(PurpleLog *log, const char *ext); |
| 10822 | 441 | |
| 442 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
443 | * purple_log_common_lister: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
444 | * @type: The type of the logs being listed. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
445 | * @name: The name of the log. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
446 | * @account: The account of the log. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
447 | * @ext: The file extension this log format uses. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
448 | * @logger: A reference to the logger struct for this log. |
| 10822 | 449 | * |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
450 | * Returns a sorted GList of PurpleLogs of the requested type. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
451 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
452 | * This function should only be used with logs that are written |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
453 | * with purple_log_common_writer(). It's intended to be used as |
| 35419 | 454 | * a "common" implementation of a logger's <literal>list</literal> function. |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
455 | * It should only be passed to purple_log_logger_new() and never |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
456 | * called directly. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
457 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
458 | * Returns: A sorted GList of PurpleLogs matching the parameters. |
| 10822 | 459 | */ |
| 15884 | 460 | GList *purple_log_common_lister(PurpleLogType type, const char *name, |
| 461 | PurpleAccount *account, const char *ext, | |
| 462 | PurpleLogLogger *logger); | |
| 10822 | 463 | |
| 464 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
465 | * purple_log_common_total_sizer: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
466 | * @type: The type of the logs being sized. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
467 | * @name: The name of the logs to size |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
468 | * (e.g. the username or chat name). |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
469 | * @account: The account of the log. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
470 | * @ext: The file extension this log format uses. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
471 | * |
|
13389
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
472 | * Returns the total size of all the logs for a given user, with |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
473 | * a given extension. |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
474 | * |
|
13389
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
475 | * This function should only be used with logs that are written |
| 15884 | 476 | * with purple_log_common_writer(). It's intended to be used as |
| 35419 | 477 | * a "common" implementation of a logger's <literal>total_size</literal> |
| 478 | * function. It should only be passed to purple_log_logger_new() and never | |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
479 | * called directly. |
|
13389
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
480 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
481 | * Returns: The size of all the logs with the specified extension |
|
13389
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
482 | * for the specified user. |
|
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
483 | */ |
| 15884 | 484 | int purple_log_common_total_sizer(PurpleLogType type, const char *name, |
| 485 | PurpleAccount *account, const char *ext); | |
|
13389
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
486 | |
|
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
487 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
488 | * purple_log_common_sizer: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
489 | * @log: The PurpleLog to size. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
490 | * |
| 15884 | 491 | * Returns the size of a given PurpleLog. |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
492 | * |
| 10822 | 493 | * This function should only be used with logs that are written |
| 15884 | 494 | * with purple_log_common_writer(). It's intended to be used as |
| 35419 | 495 | * a "common" implementation of a logger's <literal>size</literal> function. |
| 15884 | 496 | * It should only be passed to purple_log_logger_new() and never |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
497 | * called directly. |
| 10822 | 498 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
499 | * Returns: An integer indicating the size of the log in bytes. |
| 10822 | 500 | */ |
| 15884 | 501 | int purple_log_common_sizer(PurpleLog *log); |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
502 | |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
503 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
504 | * purple_log_common_deleter: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
505 | * @log: The PurpleLog to delete. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
506 | * |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
507 | * Deletes a log |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
508 | * |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
509 | * This function should only be used with logs that are written |
| 15884 | 510 | * with purple_log_common_writer(). It's intended to be used as |
| 35419 | 511 | * a "common" implementation of a logger's <literal>delete</literal> function. |
| 15884 | 512 | * It should only be passed to purple_log_logger_new() and never |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
513 | * called directly. |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
514 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
515 | * Returns: A boolean indicating success or failure. |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
516 | */ |
| 15884 | 517 | gboolean purple_log_common_deleter(PurpleLog *log); |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
518 | |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
519 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
520 | * purple_log_common_is_deletable: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
521 | * @log: The PurpleLog to check. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
522 | * |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
523 | * Checks to see if a log is deletable |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
524 | * |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
525 | * This function should only be used with logs that are written |
| 15884 | 526 | * with purple_log_common_writer(). It's intended to be used as |
| 35419 | 527 | * a "common" implementation of a logger's <literal>is_deletable</literal> |
| 528 | * function. It should only be passed to purple_log_logger_new() and never | |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
529 | * called directly. |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
530 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
531 | * Returns: A boolean indicating if the log is deletable. |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
532 | */ |
| 15884 | 533 | gboolean purple_log_common_is_deletable(PurpleLog *log); |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
534 | |
| 10822 | 535 | /******************************************/ |
| 35472 | 536 | /* Logger Functions */ |
| 10566 | 537 | /******************************************/ |
| 7440 | 538 | |
| 10566 | 539 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
540 | * purple_log_logger_new: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
541 | * @id: The logger's id. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
542 | * @name: The logger's name. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
543 | * @functions: The number of functions being passed. The following |
| 35419 | 544 | * functions are currently available (in order): |
| 545 | * <literal>create</literal>, <literal>write</literal>, | |
| 546 | * <literal>finalize</literal>, <literal>list</literal>, | |
| 547 | * <literal>read</literal>, <literal>size</literal>, | |
| 548 | * <literal>total_size</literal>, <literal>list_syslog</literal>, | |
| 549 | * <literal>get_log_sets</literal>, <literal>remove</literal>, | |
| 550 | * <literal>is_deletable</literal>. | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
551 | * For details on these functions, see PurpleLogLogger. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
552 | * Functions may not be skipped. For example, passing |
| 35419 | 553 | * <literal>create</literal> and <literal>write</literal> is |
| 554 | * acceptable (for a total of two functions). Passing | |
| 555 | * <literal>create</literal> and <literal>finalize</literal>, | |
| 556 | * however, is not. To accomplish that, the caller must pass | |
| 557 | * <literal>create</literal>, %NULL (a placeholder for | |
| 558 | * <literal>write</literal>), and <literal>finalize</literal> | |
| 559 | * (for a total of 3 functions). | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
560 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
561 | * Creates a new logger |
| 10566 | 562 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
563 | * Returns: The new logger |
| 10566 | 564 | */ |
| 15884 | 565 | PurpleLogLogger *purple_log_logger_new(const char *id, const char *name, int functions, ...); |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
566 | |
| 10566 | 567 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
568 | * purple_log_logger_free: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
569 | * @logger: The logger to free |
| 10566 | 570 | * |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
571 | * Frees a logger |
| 10566 | 572 | */ |
| 15884 | 573 | void purple_log_logger_free(PurpleLogLogger *logger); |
| 7440 | 574 | |
| 10566 | 575 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
576 | * purple_log_logger_add: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
577 | * @logger: The new logger to add |
| 10566 | 578 | * |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
579 | * Adds a new logger |
| 10566 | 580 | */ |
| 15884 | 581 | void purple_log_logger_add (PurpleLogLogger *logger); |
| 7431 | 582 | |
| 10566 | 583 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
584 | * purple_log_logger_remove: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
585 | * @logger: The logger to remove |
| 10566 | 586 | * |
| 587 | * Removes a logger | |
| 588 | */ | |
| 15884 | 589 | void purple_log_logger_remove (PurpleLogLogger *logger); |
| 7431 | 590 | |
| 10566 | 591 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
592 | * purple_log_logger_set: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
593 | * @logger: The logger to set |
| 10566 | 594 | * |
| 595 | * Sets the current logger | |
| 596 | */ | |
| 15884 | 597 | void purple_log_logger_set (PurpleLogLogger *logger); |
| 7440 | 598 | |
| 10566 | 599 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
600 | * purple_log_logger_get: |
| 10566 | 601 | * |
| 602 | * Returns the current logger | |
| 603 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
604 | * Returns: logger The current logger |
| 10566 | 605 | */ |
| 15884 | 606 | PurpleLogLogger *purple_log_logger_get (void); |
| 7440 | 607 | |
| 10566 | 608 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
609 | * purple_log_logger_get_options: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
610 | * |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
611 | * Returns a GList containing the IDs and names of the registered |
| 10566 | 612 | * loggers. |
| 613 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
614 | * Returns: The list of IDs and names. |
| 10566 | 615 | */ |
| 15884 | 616 | GList *purple_log_logger_get_options(void); |
| 7431 | 617 | |
|
12737
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
618 | /**************************************************************************/ |
| 35472 | 619 | /* Log Subsystem */ |
|
12737
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
620 | /**************************************************************************/ |
|
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
621 | |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
622 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
623 | * purple_log_init: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
624 | * |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
625 | * Initializes the log subsystem. |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
626 | */ |
| 15884 | 627 | void purple_log_init(void); |
|
12737
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
628 | |
|
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
629 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
630 | * purple_log_get_handle: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
631 | * |
|
12737
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
632 | * Returns the log subsystem handle. |
|
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
633 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
634 | * Returns: The log subsystem handle. |
|
12737
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
635 | */ |
| 15884 | 636 | void *purple_log_get_handle(void); |
|
12737
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
637 | |
|
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
638 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
639 | * purple_log_uninit: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
640 | * |
|
12737
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
641 | * Uninitializes the log subsystem. |
|
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
642 | */ |
| 15884 | 643 | void purple_log_uninit(void); |
|
12737
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
644 | |
| 5872 | 645 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32438
diff
changeset
|
646 | G_END_DECLS |
| 7440 | 647 | |
| 15884 | 648 | #endif /* _PURPLE_LOG_H_ */ |