Fri, 20 Oct 2023 01:09:45 -0500
Implement ProtocolFileTransfer
Testing Done:
Ran the unit tests under valgrind.
Bugs closed: PIDGIN-17833
Reviewed at https://reviews.imfreedom.org/r/2643/
|
41714
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * This library is free software; you can redistribute it and/or |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
6 | * modify it under the terms of the GNU Lesser General Public |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * License as published by the Free Software Foundation; either |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * version 2 of the License, or (at your option) any later version. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | * |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | * This library is distributed in the hope that it will be useful, |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * Lesser General Public License for more details. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | * |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | * You should have received a copy of the GNU Lesser General Public |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
16 | * License along with this library; if not, see <https://www.gnu.org/licenses/>. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
17 | */ |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION) |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
20 | # error "only <purple.h> may be included directly" |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | #endif |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | #ifndef PURPLE_CONNECTION_ERROR_INFO_H |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | #define PURPLE_CONNECTION_ERROR_INFO_H |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | #include <glib.h> |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | #include <glib-object.h> |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | G_BEGIN_DECLS |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | /** |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | * PurpleConnectionError: |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | * @PURPLE_CONNECTION_ERROR_NETWORK_ERROR: There was an error sending or |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | * receiving on the network socket, or there was some protocol error |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | * (such as the server sending malformed data). |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | * @PURPLE_CONNECTION_ERROR_INVALID_USERNAME: The username supplied was not |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | * valid. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | * @PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED: The username, password or |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | * some other credential was incorrect. Use |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | * #PURPLE_CONNECTION_ERROR_INVALID_USERNAME instead if the username |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | * is known to be invalid. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | * @PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE: libpurple doesn't speak |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | * any of the authentication methods the server offered. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
44 | * @PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT: libpurple was built without SSL |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
45 | * support, and the connection needs SSL. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
46 | * @PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR: There was an error negotiating |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
47 | * SSL on this connection, or the server does not support encryption |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
48 | * but an account option was set to require it. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
49 | * @PURPLE_CONNECTION_ERROR_NAME_IN_USE: Someone is already connected to the |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | * server using the name you are trying to connect with. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | * @PURPLE_CONNECTION_ERROR_INVALID_SETTINGS: The username/server/other |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
52 | * preference for the account isn't valid. For instance, on IRC the |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 | * username cannot contain white space. This reason should not be used |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | * for incorrect passwords etc: use |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
55 | * #PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED for that. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
56 | * @PURPLE_CONNECTION_ERROR_CERT_NOT_PROVIDED: The server did not provide a |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
57 | * SSL certificate. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | * @PURPLE_CONNECTION_ERROR_CERT_UNTRUSTED: The server's SSL certificate could |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | * not be trusted. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
60 | * @PURPLE_CONNECTION_ERROR_CERT_EXPIRED: The server's SSL certificate has |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
61 | * expired. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | * @PURPLE_CONNECTION_ERROR_CERT_NOT_ACTIVATED: The server's SSL certificate is |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
63 | * not yet valid. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
64 | * @PURPLE_CONNECTION_ERROR_CERT_HOSTNAME_MISMATCH: The server's SSL |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
65 | * certificate did not match its hostname. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
66 | * @PURPLE_CONNECTION_ERROR_CERT_FINGERPRINT_MISMATCH: The server's SSL |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 | * certificate does not have the expected fingerprint. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
68 | * @PURPLE_CONNECTION_ERROR_CERT_SELF_SIGNED: The server's SSL certificate is |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
69 | * self-signed. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
70 | * @PURPLE_CONNECTION_ERROR_CERT_OTHER_ERROR: There was some other error |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
71 | * validating the server's SSL certificate. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
72 | * @PURPLE_CONNECTION_ERROR_OTHER_ERROR: Some other error occurred which fits |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
73 | * into none of the other categories. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
74 | * |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
75 | * Possible errors that can cause a connection to be closed. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
76 | */ |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
77 | typedef enum |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
78 | { |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
79 | PURPLE_CONNECTION_ERROR_NETWORK_ERROR = 0, |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
80 | PURPLE_CONNECTION_ERROR_INVALID_USERNAME = 1, |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
81 | PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED = 2, |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
82 | PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE = 3, |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
83 | PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT = 4, |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 | PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR = 5, |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
85 | PURPLE_CONNECTION_ERROR_NAME_IN_USE = 6, |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
86 | |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
87 | /* TODO This reason really shouldn't be necessary. Usernames and |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
88 | * other account preferences should be validated when the |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
89 | * account is created. */ |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
90 | PURPLE_CONNECTION_ERROR_INVALID_SETTINGS = 7, |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
91 | |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
92 | PURPLE_CONNECTION_ERROR_CERT_NOT_PROVIDED = 8, |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
93 | PURPLE_CONNECTION_ERROR_CERT_UNTRUSTED = 9, |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
94 | PURPLE_CONNECTION_ERROR_CERT_EXPIRED = 10, |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
95 | PURPLE_CONNECTION_ERROR_CERT_NOT_ACTIVATED = 11, |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
96 | PURPLE_CONNECTION_ERROR_CERT_HOSTNAME_MISMATCH = 12, |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
97 | PURPLE_CONNECTION_ERROR_CERT_FINGERPRINT_MISMATCH = 13, |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
98 | PURPLE_CONNECTION_ERROR_CERT_SELF_SIGNED = 14, |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
99 | PURPLE_CONNECTION_ERROR_CERT_OTHER_ERROR = 15, |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
100 | |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
101 | PURPLE_CONNECTION_ERROR_CUSTOM_TEMPORARY = 16, |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
102 | PURPLE_CONNECTION_ERROR_CUSTOM_FATAL = 17, |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
103 | |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
104 | /* purple_connection_error() in connection.c uses the fact that |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
105 | * this is the last member of the enum when sanity-checking; if other |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
106 | * reasons are added after it, the check must be updated. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
107 | */ |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
108 | PURPLE_CONNECTION_ERROR_OTHER_ERROR = 18 |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
109 | } PurpleConnectionError; |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
110 | |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
111 | /** |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
112 | * PurpleConnectionErrorInfo: |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
113 | * @type: The type of error. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
114 | * @description: A localised, human-readable description of the error. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
115 | * |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
116 | * Holds the type of an error along with its description. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
117 | */ |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
118 | typedef struct |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
119 | { |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
120 | PurpleConnectionError type; |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
121 | char *description; |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
122 | } PurpleConnectionErrorInfo; |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
123 | |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
124 | |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
125 | #define PURPLE_TYPE_CONNECTION_ERROR_INFO (purple_connection_error_info_get_type()) |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
126 | GType purple_connection_error_info_get_type(void); |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
127 | |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
128 | /** |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
129 | * purple_connection_error_info_new: |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
130 | * @type: The [enum@Purple.ConnectionError] of the error. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
131 | * @description: The description of the error. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
132 | * |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
133 | * Creates a new error info with the given properties. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
134 | * |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
135 | * Returns: (transfer full): The new instance. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
136 | * |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
137 | * Since: 3.0.0 |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
138 | */ |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
139 | PurpleConnectionErrorInfo *purple_connection_error_info_new(PurpleConnectionError type, const gchar *description); |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
140 | |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
141 | /** |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
142 | * purple_connection_error_info_copy: |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
143 | * @info: The instance to copy. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
144 | * |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
145 | * Creates a copy of @info. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
146 | * |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
147 | * Returns: (transfer full): A new copy of @info. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
148 | * |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
149 | * Since: 3.0.0 |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
150 | */ |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
151 | PurpleConnectionErrorInfo *purple_connection_error_info_copy(PurpleConnectionErrorInfo *info); |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
152 | |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
153 | /** |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
154 | * purple_connection_error_info_free: |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
155 | * @info: The instance to free. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
156 | * |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
157 | * Frees the memory associated with @info. |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
158 | * |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
159 | * Since: 3.0.0 |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
160 | */ |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
161 | void purple_connection_error_info_free(PurpleConnectionErrorInfo *info); |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
162 | |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
163 | G_END_DECLS |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
164 | |
|
318204db6284
Split PurpleConnectionErrorInfo out to its own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
165 | #endif /* PURPLE_CONNECTION_ERROR_INFO_H */ |