Sat, 30 Jan 2021 02:26:08 -0600
Make PurpleWhiteboard derivable and remove purple_whiteboard_[gs]et_ui data.
Testing Done:
Compiled
Reviewed at https://reviews.imfreedom.org/r/461/
|
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 | |
|
40474
1341be8e3402
Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents:
40188
diff
changeset
|
22 | #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION) |
|
1341be8e3402
Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents:
40188
diff
changeset
|
23 | # error "only <purple.h> may be included directly" |
|
1341be8e3402
Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents:
40188
diff
changeset
|
24 | #endif |
|
1341be8e3402
Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents:
40188
diff
changeset
|
25 | |
|
39659
e4dfb99b0cef
Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38716
diff
changeset
|
26 | #ifndef PURPLE_LOG_H |
|
e4dfb99b0cef
Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38716
diff
changeset
|
27 | #define PURPLE_LOG_H |
|
35440
467bb21b82a1
Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents:
35419
diff
changeset
|
28 | /** |
|
467bb21b82a1
Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents:
35419
diff
changeset
|
29 | * SECTION:log |
|
467bb21b82a1
Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents:
35419
diff
changeset
|
30 | * @section_id: libpurple-log |
|
467bb21b82a1
Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents:
35419
diff
changeset
|
31 | * @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
|
32 | * @title: Logging API |
|
467bb21b82a1
Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents:
35419
diff
changeset
|
33 | * @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
|
34 | */ |
|
467bb21b82a1
Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents:
35419
diff
changeset
|
35 | |
| 7431 | 36 | #include <stdio.h> |
| 5872 | 37 | |
|
34792
09228ea79272
Added GBoxed to certificate, certificate pool, xfer, log
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
38 | #define PURPLE_TYPE_LOG (purple_log_get_type()) |
| 5872 | 39 | |
| 7431 | 40 | /******************************************************** |
| 41 | * DATA STRUCTURES ************************************** | |
| 42 | ********************************************************/ | |
| 43 | ||
| 15884 | 44 | typedef struct _PurpleLog PurpleLog; |
| 45 | typedef struct _PurpleLogLogger PurpleLogLogger; | |
| 46 | typedef struct _PurpleLogCommonLoggerData PurpleLogCommonLoggerData; | |
| 47 | typedef struct _PurpleLogSet PurpleLogSet; | |
| 7431 | 48 | |
| 49 | typedef enum { | |
| 15884 | 50 | PURPLE_LOG_IM, |
| 51 | PURPLE_LOG_CHAT, | |
| 52 | PURPLE_LOG_SYSTEM | |
| 53 | } PurpleLogType; | |
| 7431 | 54 | |
| 55 | typedef enum { | |
| 15884 | 56 | PURPLE_LOG_READ_NO_NEWLINE = 1 |
| 57 | } PurpleLogReadFlags; | |
| 7431 | 58 | |
| 59 | #include "account.h" | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
60 | #include "conversations.h" |
| 7431 | 61 | |
| 15884 | 62 | typedef void (*PurpleLogSetCallback) (GHashTable *sets, PurpleLogSet *set); |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
63 | |
| 7431 | 64 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
65 | * PurpleLogLogger: |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
66 | * @name: The logger's name |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
67 | * @id: An identifier to refer to this logger |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
68 | * @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
|
69 | * this is actually needed. |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
70 | * @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
|
71 | * @finalize: Called when the log is destroyed |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
72 | * @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
|
73 | * @read: Given one of the logs returned by the logger's list function, |
|
39859
6c17d9f1fc06
Remove a reference to GtkWebView
Gary Kramlich <grim@reaperworld.com>
parents:
39738
diff
changeset
|
74 | * this returns the contents of the log |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
75 | * @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
|
76 | * 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
|
77 | * @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
|
78 | * default implementation is used |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
79 | * @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
|
80 | * #PurpleLog's |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
81 | * @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
|
82 | * 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
|
83 | * available #PurpleLog from the logger. Loggers using |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
84 | * 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
|
85 | * 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
|
86 | * need to implement this function. |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
87 | * <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
|
88 | * #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
|
89 | * #PurpleLogSet. |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
90 | * @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
|
91 | * failure |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
92 | * @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
|
93 | * |
| 7431 | 94 | * A log logger. |
| 95 | * | |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
96 | * 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
|
97 | * everything needed to write and read from logs. |
| 7431 | 98 | */ |
| 15884 | 99 | struct _PurpleLogLogger { |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
100 | char *name; |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35462
diff
changeset
|
101 | char *id; |
| 7440 | 102 | |
| 15884 | 103 | void (*create)(PurpleLog *log); |
| 7440 | 104 | |
| 15884 | 105 | gsize (*write)(PurpleLog *log, |
|
34620
e49aa67344e1
Renamed PurpleConversationMessageFlags back to PurpleMessageFlags.
Ankit Vani <a@nevitus.org>
parents:
34605
diff
changeset
|
106 | PurpleMessageFlags type, |
| 7431 | 107 | const char *from, |
|
38621
1412d6b993e9
Use GDateTime in purple_log_write.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38620
diff
changeset
|
108 | GDateTime *time, |
| 7431 | 109 | const char *message); |
| 110 | ||
| 15884 | 111 | void (*finalize)(PurpleLog *log); |
| 7440 | 112 | |
| 15884 | 113 | GList *(*list)(PurpleLogType type, const char *name, PurpleAccount *account); |
| 7440 | 114 | |
| 15884 | 115 | char *(*read)(PurpleLog *log, PurpleLogReadFlags *flags); |
|
10231
047177cee39f
[gaim-migrate @ 11366]
Andrew Hart <arhart@users.sourceforge.net>
parents:
10171
diff
changeset
|
116 | |
| 15884 | 117 | int (*size)(PurpleLog *log); |
| 8096 | 118 | |
| 15884 | 119 | int (*total_size)(PurpleLogType type, const char *name, PurpleAccount *account); |
| 8573 | 120 | |
| 15884 | 121 | GList *(*list_syslog)(PurpleAccount *account); |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
122 | |
| 15884 | 123 | 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
|
124 | |
|
16116
bccaa68c86ad
"delete" is a reserved word in C++, rename the "delete" member of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
125 | 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
|
126 | |
| 15884 | 127 | 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
|
128 | |
|
35024
eb3afb7643ce
Added /*< private >*/ for padding members, clean them up and add missing ones
Ankit Vani <a@nevitus.org>
parents:
34792
diff
changeset
|
129 | /*< private >*/ |
|
16743
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
16116
diff
changeset
|
130 | 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
|
131 | 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
|
132 | 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
|
133 | void (*_purple_reserved4)(void); |
| 5872 | 134 | }; |
| 135 | ||
| 7431 | 136 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
137 | * PurpleLog: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
138 | * @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
|
139 | * @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
|
140 | * @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
|
141 | * @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
|
142 | * @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
|
143 | * timezone |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
144 | * @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
|
145 | * @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
|
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; |
|
38620
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37094
diff
changeset
|
154 | GDateTime *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; |
|
13624
c6577def4e2a
[gaim-migrate @ 16009]
Richard Laager <rlaager@pidgin.im>
parents:
13389
diff
changeset
|
158 | |
|
c6577def4e2a
[gaim-migrate @ 16009]
Richard Laager <rlaager@pidgin.im>
parents:
13389
diff
changeset
|
159 | /* IMPORTANT: Some code in log.c allocates these without zeroing them. |
|
c6577def4e2a
[gaim-migrate @ 16009]
Richard Laager <rlaager@pidgin.im>
parents:
13389
diff
changeset
|
160 | * IMPORTANT: Update that code if you add members here. */ |
| 5872 | 161 | }; |
| 162 | ||
| 10822 | 163 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
164 | * PurpleLogCommonLoggerData: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
165 | * |
| 10822 | 166 | * A common logger_data struct containing a file handle and path, as well |
| 167 | * as a pointer to something else for additional data. | |
| 168 | */ | |
| 15884 | 169 | struct _PurpleLogCommonLoggerData { |
| 10822 | 170 | char *path; |
| 171 | FILE *file; | |
| 172 | void *extra_data; | |
| 173 | }; | |
| 7431 | 174 | |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
175 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
176 | * PurpleLogSet: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
177 | * @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
|
178 | * @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
|
179 | * @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
|
180 | * %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
|
181 | * 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
|
182 | * load such logs.) |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
183 | * @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
|
184 | * @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
|
185 | * 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
|
186 | * |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
187 | * Describes available logs. |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
188 | * |
| 15884 | 189 | * By passing the elements of this struct to purple_log_get_logs(), the caller |
| 190 | * can get all available PurpleLogs. | |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
191 | */ |
| 15884 | 192 | struct _PurpleLogSet { |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
193 | PurpleLogType type; |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
194 | char *name; |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
195 | PurpleAccount *account; |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
196 | gboolean buddy; |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
197 | char *normalized_name; |
|
13624
c6577def4e2a
[gaim-migrate @ 16009]
Richard Laager <rlaager@pidgin.im>
parents:
13389
diff
changeset
|
198 | |
|
c6577def4e2a
[gaim-migrate @ 16009]
Richard Laager <rlaager@pidgin.im>
parents:
13389
diff
changeset
|
199 | /* IMPORTANT: Some code in log.c allocates these without zeroing them. |
|
c6577def4e2a
[gaim-migrate @ 16009]
Richard Laager <rlaager@pidgin.im>
parents:
13389
diff
changeset
|
200 | * IMPORTANT: Update that code if you add members here. */ |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
201 | }; |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
202 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32438
diff
changeset
|
203 | G_BEGIN_DECLS |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5934
diff
changeset
|
204 | |
| 10566 | 205 | /***************************************/ |
| 35472 | 206 | /* Log Functions */ |
| 10566 | 207 | /***************************************/ |
| 7440 | 208 | |
| 10566 | 209 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
210 | * purple_log_get_type: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
211 | * |
|
35462
901dfa763f15
Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents:
35440
diff
changeset
|
212 | * 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
|
213 | */ |
|
901dfa763f15
Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents:
35440
diff
changeset
|
214 | /* 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
|
215 | * 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
|
216 | */ |
|
09228ea79272
Added GBoxed to certificate, certificate pool, xfer, log
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
217 | GType purple_log_get_type(void); |
|
09228ea79272
Added GBoxed to certificate, certificate pool, xfer, log
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
218 | |
|
09228ea79272
Added GBoxed to certificate, certificate pool, xfer, log
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
219 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
220 | * purple_log_new: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
221 | * @type: The type of log this is. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
222 | * @name: The name of this conversation (buddy name, chat name, |
| 10566 | 223 | * etc.) |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
224 | * @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
|
225 | * @conv: The conversation being logged |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
226 | * @time: The time this conversation started |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
227 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
228 | * Creates a new log |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
229 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
230 | * Returns: The new log |
| 10566 | 231 | */ |
| 15884 | 232 | PurpleLog *purple_log_new(PurpleLogType type, const char *name, PurpleAccount *account, |
|
38620
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37094
diff
changeset
|
233 | PurpleConversation *conv, GDateTime *time); |
| 7431 | 234 | |
| 10566 | 235 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
236 | * purple_log_free: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
237 | * @log: The log to destroy |
| 10566 | 238 | * |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
239 | * Frees a log |
| 10566 | 240 | */ |
| 15884 | 241 | void purple_log_free(PurpleLog *log); |
| 7440 | 242 | |
| 10566 | 243 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
244 | * purple_log_write: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
245 | * @log: The log to write to |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
246 | * @type: The type of message being logged |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
247 | * @from: Whom this message is coming from, or %NULL for |
| 10566 | 248 | * system messages |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
249 | * @time: A timestamp in UNIX time |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
250 | * @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
|
251 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
252 | * Writes to a log file. Assumes you have checked preferences already. |
| 10566 | 253 | */ |
| 15884 | 254 | void purple_log_write(PurpleLog *log, |
|
34620
e49aa67344e1
Renamed PurpleConversationMessageFlags back to PurpleMessageFlags.
Ankit Vani <a@nevitus.org>
parents:
34605
diff
changeset
|
255 | PurpleMessageFlags type, |
| 10566 | 256 | const char *from, |
|
38621
1412d6b993e9
Use GDateTime in purple_log_write.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38620
diff
changeset
|
257 | GDateTime *time, |
| 10566 | 258 | const char *message); |
| 7431 | 259 | |
| 10566 | 260 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
261 | * purple_log_read: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
262 | * @log: The log to read from |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
263 | * @flags: The returned logging flags. |
| 10566 | 264 | * |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
265 | * Reads from a log |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
266 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
267 | * Returns: The contents of this log in Purple Markup. |
| 10566 | 268 | */ |
| 15884 | 269 | char *purple_log_read(PurpleLog *log, PurpleLogReadFlags *flags); |
| 7431 | 270 | |
| 10566 | 271 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
272 | * purple_log_get_logs: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
273 | * @type: The type of the log |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
274 | * @name: The name of the log |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
275 | * @account: The account |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
276 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
277 | * 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
|
278 | * |
|
39738
14d425a528ad
Add missing transfer annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
279 | * Returns: (element-type PurpleLog) (transfer full): A sorted list of logs. |
| 10566 | 280 | */ |
| 15884 | 281 | GList *purple_log_get_logs(PurpleLogType type, const char *name, PurpleAccount *account); |
| 7440 | 282 | |
| 10566 | 283 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
284 | * 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
|
285 | * |
| 15884 | 286 | * Returns a GHashTable of PurpleLogSets. |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
287 | * |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
288 | * A "log set" here means the information necessary to gather the |
| 15884 | 289 | * PurpleLogs for a given buddy/chat. This information would be passed |
| 290 | * to purple_log_list to get a list of PurpleLogs. | |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
291 | * |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
292 | * 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
|
293 | * user has ever talked to (assuming he or she uses logging). |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
294 | * |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
295 | * The GHashTable that's returned will free all log sets in it when |
| 15884 | 296 | * destroyed. If a PurpleLogSet is removed from the GHashTable, it |
| 297 | * must be freed with purple_log_set_free(). | |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
298 | * |
|
39738
14d425a528ad
Add missing transfer annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
299 | * Returns: (element-type PurpleLogSet PurpleLogSet) (transfer full): All |
|
14d425a528ad
Add missing transfer annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
300 | * available unique log sets. |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
301 | */ |
| 15884 | 302 | GHashTable *purple_log_get_log_sets(void); |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
303 | |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
304 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
305 | * 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
|
306 | * @account: The account |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
307 | * |
| 10566 | 308 | * Returns a list of all available system logs |
| 309 | * | |
|
39738
14d425a528ad
Add missing transfer annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
310 | * Returns: (element-type PurpleLog) (transfer full): A sorted list of logs. |
| 10566 | 311 | */ |
| 15884 | 312 | GList *purple_log_get_system_logs(PurpleAccount *account); |
| 8573 | 313 | |
| 10566 | 314 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
315 | * purple_log_get_size: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
316 | * @log: The log |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
317 | * |
| 10822 | 318 | * Returns the size of a log |
| 10566 | 319 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
320 | * Returns: The size of the log, in bytes |
| 10566 | 321 | */ |
| 15884 | 322 | int purple_log_get_size(PurpleLog *log); |
| 5872 | 323 | |
| 10566 | 324 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
325 | * purple_log_get_total_size: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
326 | * @type: The type of the log |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
327 | * @name: The name of the log |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
328 | * @account: The account |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
329 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
330 | * 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
|
331 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
332 | * Returns: The size in bytes |
| 10566 | 333 | */ |
| 15884 | 334 | int purple_log_get_total_size(PurpleLogType type, const char *name, PurpleAccount *account); |
| 8573 | 335 | |
| 10566 | 336 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
337 | * 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
|
338 | * @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
|
339 | * @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
|
340 | * @account: The account |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
341 | * |
|
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
|
342 | * 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
|
343 | * 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
|
344 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
345 | * 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
|
346 | */ |
|
059b74032730
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@pidgin.im>
parents:
20889
diff
changeset
|
347 | 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
|
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 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
350 | * purple_log_is_deletable: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
351 | * @log: The log |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
352 | * |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
353 | * 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
|
354 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
355 | * 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
|
356 | * 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
|
357 | * 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
|
358 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
359 | * 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
|
360 | */ |
| 15884 | 361 | 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
|
362 | |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
363 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
364 | * purple_log_delete: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
365 | * @log: The log |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
366 | * |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
367 | * 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
|
368 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
369 | * 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
|
370 | */ |
| 15884 | 371 | 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
|
372 | |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
373 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
374 | * 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
|
375 | * @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
|
376 | * @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
|
377 | * @account: The account. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
378 | * |
| 15884 | 379 | * Returns the default logger directory Purple uses for a given account |
| 380 | * and username. This would be where Purple stores logs created by | |
| 10822 | 381 | * the built-in text or HTML loggers. |
| 382 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
383 | * Returns: The default logger directory for Purple. |
| 10822 | 384 | */ |
| 15884 | 385 | char *purple_log_get_log_dir(PurpleLogType type, const char *name, PurpleAccount *account); |
| 10822 | 386 | |
| 387 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
388 | * purple_log_compare: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
389 | * @y: A PurpleLog |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
390 | * @z: Another PurpleLog |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
391 | * |
| 15884 | 392 | * Implements GCompareFunc for PurpleLogs |
| 10566 | 393 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
394 | * Returns: A value as specified by GCompareFunc |
| 10566 | 395 | */ |
| 15884 | 396 | gint purple_log_compare(gconstpointer y, gconstpointer z); |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
397 | |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
398 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
399 | * purple_log_set_compare: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
400 | * @y: A PurpleLogSet |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
401 | * @z: Another PurpleLogSet |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
402 | * |
| 15884 | 403 | * Implements GCompareFunc for PurpleLogSets |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
404 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
405 | * Returns: A value as specified by GCompareFunc |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
406 | */ |
| 15884 | 407 | gint purple_log_set_compare(gconstpointer y, gconstpointer z); |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
408 | |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
409 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
410 | * purple_log_set_free: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
411 | * @set: The log set to destroy |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
412 | * |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
413 | * Frees a log set |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
414 | */ |
| 15884 | 415 | void purple_log_set_free(PurpleLogSet *set); |
|
11177
534ca3ae0bfc
[gaim-migrate @ 13285]
Richard Laager <rlaager@pidgin.im>
parents:
11035
diff
changeset
|
416 | |
| 10566 | 417 | /******************************************/ |
| 35472 | 418 | /* Common Logger Functions */ |
| 10822 | 419 | /******************************************/ |
| 420 | ||
| 421 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
422 | * purple_log_common_writer: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
423 | * @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
|
424 | * @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
|
425 | * |
| 15884 | 426 | * Opens a new log file in the standard Purple log location |
| 10822 | 427 | * with the given file extension, named for the current time, |
| 428 | * for writing. If a log file is already open, the existing | |
| 429 | * file handle is retained. The log's logger_data value is | |
| 15884 | 430 | * set to a PurpleLogCommonLoggerData struct containing the log |
| 10822 | 431 | * file handle and log path. |
| 432 | * | |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
433 | * This function is intended to be used as a "common" |
| 35419 | 434 | * implementation of a logger's <literal>write</literal> function. |
| 15884 | 435 | * It should only be passed to purple_log_logger_new() and never |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
436 | * called directly. |
| 10822 | 437 | */ |
| 15884 | 438 | void purple_log_common_writer(PurpleLog *log, const char *ext); |
| 10822 | 439 | |
| 440 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
441 | * purple_log_common_lister: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
442 | * @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
|
443 | * @name: The name of the log. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
444 | * @account: The account of the log. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
445 | * @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
|
446 | * @logger: A reference to the logger struct for this log. |
| 10822 | 447 | * |
|
38716
b9bed228745a
Add many libpurple element-type annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38621
diff
changeset
|
448 | * Returns a sorted list of logs of the requested type. |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
449 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
450 | * 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
|
451 | * with purple_log_common_writer(). It's intended to be used as |
| 35419 | 452 | * 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
|
453 | * 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
|
454 | * called directly. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
455 | * |
|
39738
14d425a528ad
Add missing transfer annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
456 | * Returns: (element-type PurpleLog) (transfer full): A sorted list of logs |
|
14d425a528ad
Add missing transfer annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
457 | * matching the parameters. |
| 10822 | 458 | */ |
| 15884 | 459 | GList *purple_log_common_lister(PurpleLogType type, const char *name, |
| 460 | PurpleAccount *account, const char *ext, | |
| 461 | PurpleLogLogger *logger); | |
| 10822 | 462 | |
| 463 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
464 | * 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
|
465 | * @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
|
466 | * @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
|
467 | * (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
|
468 | * @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
|
469 | * @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
|
470 | * |
|
13389
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
471 | * 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
|
472 | * 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
|
473 | * |
|
13389
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
474 | * This function should only be used with logs that are written |
| 15884 | 475 | * with purple_log_common_writer(). It's intended to be used as |
| 35419 | 476 | * a "common" implementation of a logger's <literal>total_size</literal> |
| 477 | * 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
|
478 | * called directly. |
|
13389
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
479 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
480 | * 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
|
481 | * for the specified user. |
|
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
482 | */ |
| 15884 | 483 | int purple_log_common_total_sizer(PurpleLogType type, const char *name, |
| 484 | PurpleAccount *account, const char *ext); | |
|
13389
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
485 | |
|
27cf7d84dfd1
[gaim-migrate @ 15761]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
486 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
487 | * purple_log_common_sizer: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
488 | * @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
|
489 | * |
| 15884 | 490 | * 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
|
491 | * |
| 10822 | 492 | * This function should only be used with logs that are written |
| 15884 | 493 | * with purple_log_common_writer(). It's intended to be used as |
| 35419 | 494 | * a "common" implementation of a logger's <literal>size</literal> function. |
| 15884 | 495 | * 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
|
496 | * called directly. |
| 10822 | 497 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
498 | * Returns: An integer indicating the size of the log in bytes. |
| 10822 | 499 | */ |
| 15884 | 500 | 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
|
501 | |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
502 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
503 | * purple_log_common_deleter: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
504 | * @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
|
505 | * |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
506 | * 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
|
507 | * |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
508 | * This function should only be used with logs that are written |
| 15884 | 509 | * with purple_log_common_writer(). It's intended to be used as |
| 35419 | 510 | * a "common" implementation of a logger's <literal>delete</literal> function. |
| 15884 | 511 | * 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
|
512 | * called directly. |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
513 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
514 | * 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
|
515 | */ |
| 15884 | 516 | 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
|
517 | |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
518 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
519 | * 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
|
520 | * @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
|
521 | * |
|
15584
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
522 | * 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
|
523 | * |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
524 | * This function should only be used with logs that are written |
| 15884 | 525 | * with purple_log_common_writer(). It's intended to be used as |
| 35419 | 526 | * a "common" implementation of a logger's <literal>is_deletable</literal> |
| 527 | * 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
|
528 | * called directly. |
|
f4d9ac6f94b8
This is the core code to support log deletion. It's untested.
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
529 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
530 | * 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
|
531 | */ |
| 15884 | 532 | 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
|
533 | |
| 10822 | 534 | /******************************************/ |
| 35472 | 535 | /* Logger Functions */ |
| 10566 | 536 | /******************************************/ |
| 7440 | 537 | |
| 10566 | 538 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
539 | * purple_log_logger_new: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
540 | * @id: The logger's id. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
541 | * @name: The logger's name. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
542 | * @functions: The number of functions being passed. The following |
| 35419 | 543 | * functions are currently available (in order): |
| 544 | * <literal>create</literal>, <literal>write</literal>, | |
| 545 | * <literal>finalize</literal>, <literal>list</literal>, | |
| 546 | * <literal>read</literal>, <literal>size</literal>, | |
| 547 | * <literal>total_size</literal>, <literal>list_syslog</literal>, | |
| 548 | * <literal>get_log_sets</literal>, <literal>remove</literal>, | |
| 549 | * <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
|
550 | * 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
|
551 | * Functions may not be skipped. For example, passing |
| 35419 | 552 | * <literal>create</literal> and <literal>write</literal> is |
| 553 | * acceptable (for a total of two functions). Passing | |
| 554 | * <literal>create</literal> and <literal>finalize</literal>, | |
| 555 | * however, is not. To accomplish that, the caller must pass | |
| 556 | * <literal>create</literal>, %NULL (a placeholder for | |
| 557 | * <literal>write</literal>), and <literal>finalize</literal> | |
| 558 | * (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
|
559 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
560 | * Creates a new logger |
| 10566 | 561 | * |
| 40188 | 562 | * Returns: (transfer full): The new logger. |
| 10566 | 563 | */ |
| 15884 | 564 | 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
|
565 | |
| 10566 | 566 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
567 | * purple_log_logger_free: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
568 | * @logger: The logger to free |
| 10566 | 569 | * |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
570 | * Frees a logger |
| 10566 | 571 | */ |
| 15884 | 572 | void purple_log_logger_free(PurpleLogLogger *logger); |
| 7440 | 573 | |
| 10566 | 574 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
575 | * purple_log_logger_add: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
576 | * @logger: The new logger to add |
| 10566 | 577 | * |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
578 | * Adds a new logger |
| 10566 | 579 | */ |
| 15884 | 580 | void purple_log_logger_add (PurpleLogLogger *logger); |
| 7431 | 581 | |
| 10566 | 582 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
583 | * purple_log_logger_remove: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
584 | * @logger: The logger to remove |
| 10566 | 585 | * |
| 586 | * Removes a logger | |
| 587 | */ | |
| 15884 | 588 | void purple_log_logger_remove (PurpleLogLogger *logger); |
| 7431 | 589 | |
| 10566 | 590 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
591 | * purple_log_logger_set: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
592 | * @logger: The logger to set |
| 10566 | 593 | * |
| 594 | * Sets the current logger | |
| 595 | */ | |
| 15884 | 596 | void purple_log_logger_set (PurpleLogLogger *logger); |
| 7440 | 597 | |
| 10566 | 598 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
599 | * purple_log_logger_get: |
| 10566 | 600 | * |
| 601 | * Returns the current logger | |
| 602 | * | |
|
39738
14d425a528ad
Add missing transfer annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
603 | * Returns: (transfer none): The current logger. |
| 10566 | 604 | */ |
|
39738
14d425a528ad
Add missing transfer annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
605 | PurpleLogLogger *purple_log_logger_get(void); |
| 7440 | 606 | |
| 10566 | 607 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
608 | * 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
|
609 | * |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
610 | * Returns a GList containing the IDs and names of the registered |
| 10566 | 611 | * loggers. |
| 612 | * | |
|
38716
b9bed228745a
Add many libpurple element-type annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38621
diff
changeset
|
613 | * Returns: (element-type utf8) (transfer container): The list of IDs and names. |
| 10566 | 614 | */ |
| 15884 | 615 | GList *purple_log_logger_get_options(void); |
| 7431 | 616 | |
|
12737
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
617 | /**************************************************************************/ |
| 35472 | 618 | /* Log Subsystem */ |
|
12737
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
619 | /**************************************************************************/ |
|
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
620 | |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
621 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
622 | * purple_log_init: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
623 | * |
|
11025
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
624 | * Initializes the log subsystem. |
|
41b6449f7dff
[gaim-migrate @ 12899]
Richard Laager <rlaager@pidgin.im>
parents:
10822
diff
changeset
|
625 | */ |
| 15884 | 626 | void purple_log_init(void); |
|
12737
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
627 | |
|
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
628 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
629 | * purple_log_get_handle: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
630 | * |
|
12737
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
631 | * Returns the log subsystem handle. |
|
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
632 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35024
diff
changeset
|
633 | * Returns: The log subsystem handle. |
|
12737
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
634 | */ |
| 15884 | 635 | void *purple_log_get_handle(void); |
|
12737
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
636 | |
|
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
637 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
638 | * purple_log_uninit: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
639 | * |
|
12737
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
640 | * Uninitializes the log subsystem. |
|
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
641 | */ |
| 15884 | 642 | void purple_log_uninit(void); |
|
12737
e1300804318e
[gaim-migrate @ 15082]
Richard Laager <rlaager@pidgin.im>
parents:
11503
diff
changeset
|
643 | |
| 5872 | 644 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32438
diff
changeset
|
645 | G_END_DECLS |
| 7440 | 646 | |
|
39659
e4dfb99b0cef
Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38716
diff
changeset
|
647 | #endif /* PURPLE_LOG_H */ |