libpurple/keyring.h

Thu, 10 Jul 2008 20:56:48 +0000

author
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
date
Thu, 10 Jul 2008 20:56:48 +0000
branch
soc.2008.masterpassword
changeset 33972
b55f819a1239
parent 33971
96eff57a4349
child 33973
b193c0e9044b
permissions
-rw-r--r--

Fixed the internal keyring, as well as a couple typedefs.

33965
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
1 /**
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
2 * @file keyring.h Keyring plugin API
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
3 * @ingroup core
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
4 */
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
5
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
6 /* purple
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
7 *
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
8 * Purple is the legal property of its developers, whose names are too numerous
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
10 * source distribution.
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
11 *
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
12 * This program is free software; you can redistribute it and/or modify
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
13 * it under the terms of the GNU General Public License as published by
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
15 * (at your option) any later version.
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
16 *
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
17 * This program is distributed in the hope that it will be useful,
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
20 * GNU General Public License for more details.
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
21 *
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
23 * along with this program; if not, write to the Free Software
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
25 */
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
26
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
27 #ifndef _PURPLE_KEYRING_H_
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
28 #define _PURPLE_KEYRING_H_
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
29
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
30 #include <glib.h>
33965
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
31 #include "account.h"
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
32
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
33 /********************************************************
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
34 * DATA STRUCTURES **************************************
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
35 ********************************************************/
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
36
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
37 typedef struct _PurpleKeyring PurpleKeyring; /* TODO : move back as public struct */
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
38 typedef struct _PurpleKeyringPasswordNode PurpleKeyringPasswordNode; /* opaque struct */
33965
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
39
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
40
33971
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
41
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
42 /**
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
43 * XXX maybe strip a couple GError* if they're not used
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
44 * since they should only be interresting for the callback
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
45 * --> ability to forward errors ?
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
46 */
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
47
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
48 /* callbacks */
33971
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
49 typedef void (*PurpleKeyringReadCallback)(const PurpleAccount * account,
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
50 gchar * password,
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
51 GError ** error,
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
52 gpointer data);
33970
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
53 typedef void (*PurpleKeyringSaveCallback)(const PurpleAccount * account, GError ** error, gpointer data);
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
54 typedef void (*PurpleKeyringChangeMasterCallback)(int result, GError * error, gpointer data);
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
55 typedef void (*PurpleKeyringImportCallback)(GError ** error, gpointer data); /* XXX add a gboolean result or just use error ? */
33972
b55f819a1239 Fixed the internal keyring, as well as a couple typedefs.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33971
diff changeset
56 typedef void (*PurpleKeyringExportCallback)(PurpleKeyringPasswordNode * result, GError ** error, gpointer data);
33965
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
57
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
58 //gboolean purple_keyring_import_password(const PurpleKeyringPasswordNode * passwordnode);
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
59
33970
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
60
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
61 /* pointers to the keyring's functions */
33970
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
62 // FIXME : only callback should care about errors
33966
09490ce8a695 updated the internal keyring plugin, added a few comments in libpurple for future reference.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33965
diff changeset
63 typedef void (*PurpleKeyringRead)(const PurpleAccount * account, GError ** error, PurpleKeyringReadCallback cb, gpointer data);
09490ce8a695 updated the internal keyring plugin, added a few comments in libpurple for future reference.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33965
diff changeset
64 typedef void (*PurpleKeyringSave)(const PurpleAccount * account, gchar * password, GError ** error, PurpleKeyringSaveCallback cb, gpointer data);
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
65 typedef void (*PurpleKeyringClose)(GError ** error);
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
66 typedef void (*PurpleKeyringChangeMaster)(GError ** error, PurpleKeyringChangeMasterCallback cb, gpointer data);
33965
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
67 typedef void (*PurpleKeyringFree)(gchar * password, GError ** error);
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
68
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
69 /**
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
70 * TODO :
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
71 * - add GErrors in there
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
72 * - add callback, it needs to be async
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
73 * - typedefs for callbacks
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
74 */
33971
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
75 typedef void (*PurpleKeyringImportPassword)(const PurpleKeyringPasswordNode * nodeinfo, GError ** error, PurpleKeyringImportCallback cb, gpointer data);
33970
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
76
33972
b55f819a1239 Fixed the internal keyring, as well as a couple typedefs.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33971
diff changeset
77 typedef void (*PurpleKeyringExportPassword)(const PurpleAccount * account,GError ** error, PurpleKeyringExportCallback cb, gpointer data);
33965
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
78
33971
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
79 /* information about a keyring */
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
80 struct _PurpleKeyring
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
81 {
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
82 char * name;
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
83 PurpleKeyringRead read_password;
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
84 PurpleKeyringSave save_password;
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
85 PurpleKeyringClose close_keyring;
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
86 PurpleKeyringFree free_password;
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
87 PurpleKeyringChangeMaster change_master;
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
88 PurpleKeyringImportPassword import_password;
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
89 PurpleKeyringExportPassword export_password;
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
90 gpointer r1; /* RESERVED */
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
91 gpointer r2; /* RESERVED */
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
92 gpointer r3; /* RESERVED */
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
93 };
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
94
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
95
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
96
33965
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
97
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
98 /***************************************/
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
99 /** @name Keyring plugin wrapper API */
33965
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
100 /***************************************/
bd73051d75eb started writing a header file and some ideas for the API
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
diff changeset
101
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
102 /* manipulate keyring list, used by config interface */
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
103 const GList * purple_keyring_get_keyringlist(void);
33970
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
104 const PurpleKeyring * purple_keyring_get_inuse(void);
33968
ca1e1985b5f2 update on keyring code
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33967
diff changeset
105
33970
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
106 // FIXME : needs to be async so it can detect errors and undo changes
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
107 void
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
108 purple_keyring_set_inuse_got_pw_cb(const PurpleAccount * account,
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
109 gchar * password,
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
110 GError ** error,
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
111 gpointer data);
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
112
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
113 /* register a keyring plugin */
33970
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
114 // XXX : function to unregister a keyring ?
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
115 void purple_plugin_keyring_register(PurpleKeyring * info);
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
116
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
117 /* used by account.c while reading a password from xml */
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
118 gboolean purple_keyring_import_password(const PurpleKeyringPasswordNode * passwordnode,
33968
ca1e1985b5f2 update on keyring code
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33967
diff changeset
119 GError ** error,
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
120 PurpleKeyringImportCallback cb,
33968
ca1e1985b5f2 update on keyring code
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33967
diff changeset
121 gpointer data);
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
122 /**
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
123 * used by account.c while syncing accounts
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
124 * returned data must be g_free()'d
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
125 */
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
126 void purple_keyring_export_password(PurpleAccount * account,
33968
ca1e1985b5f2 update on keyring code
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33967
diff changeset
127 GError ** error,
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
128 PurpleKeyringImportCallback cb,
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
129 gpointer data);
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
130
33968
ca1e1985b5f2 update on keyring code
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33967
diff changeset
131
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
132 /* functions called from the code to access passwords (account.h):
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
133 purple_account_get_password() <- TODO : rewrite these functions :)
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
134 purple_account_set_password()
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
135 so these functions will call : */
33968
ca1e1985b5f2 update on keyring code
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33967
diff changeset
136 void purple_keyring_get_password(const PurpleAccount *account,
ca1e1985b5f2 update on keyring code
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33967
diff changeset
137 GError ** error,
ca1e1985b5f2 update on keyring code
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33967
diff changeset
138 PurpleKeyringReadCallback cb,
ca1e1985b5f2 update on keyring code
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33967
diff changeset
139 gpointer data);
ca1e1985b5f2 update on keyring code
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33967
diff changeset
140 void purple_keyring_set_password(const PurpleAccount * account,
ca1e1985b5f2 update on keyring code
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33967
diff changeset
141 gchar * password,
ca1e1985b5f2 update on keyring code
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33967
diff changeset
142 GError ** error,
ca1e1985b5f2 update on keyring code
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33967
diff changeset
143 PurpleKeyringSaveCallback cb,
ca1e1985b5f2 update on keyring code
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33967
diff changeset
144 gpointer data);
33966
09490ce8a695 updated the internal keyring plugin, added a few comments in libpurple for future reference.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33965
diff changeset
145
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
146 /* accessors for data structure fields */
33970
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
147 /* PurpleKeyring */
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
148 /*
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
149 * TODO : constructor/destructor
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
150 * move it back as public. It would actually make much more sense
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
151 * since devs could build static structure
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
152 */
33970
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
153 const char * purple_keyring_get_name(const PurpleKeyring * info);
33971
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
154 PurpleKeyringRead purple_keyring_get_read_password(const PurpleKeyring * info);
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
155 PurpleKeyringSave purple_keyring_get_save_password(const PurpleKeyring * info);
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
156 PurpleKeyringClose purple_keyring_get_close_keyring(const PurpleKeyring * info);
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
157 PurpleKeyringFree purple_keyring_get_free_password(const PurpleKeyring * info);
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
158 PurpleKeyringChangeMaster purple_keyring_get_change_master(const PurpleKeyring * info);
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
159 PurpleKeyringImportPassword purple_keyring_get_import_password(const PurpleKeyring * info);
96eff57a4349 Fixed warnings
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33970
diff changeset
160 PurpleKeyringExportPassword purple_keyring_get_export_password(const PurpleKeyring * info);
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
161
33970
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
162 void purple_keyring_set_name(PurpleKeyring * info, char * name); /* must be static, will not be auto-freed upon destruction */
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
163 void purple_keyring_set_read_password(PurpleKeyring * info, PurpleKeyringRead read);
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
164 void purple_keyring_set_save_password(PurpleKeyring * info, PurpleKeyringSave save);
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
165 void purple_keyring_set_close_keyring(PurpleKeyring * info, PurpleKeyringClose close);
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
166 void purple_keyring_set_free_password(PurpleKeyring * info, PurpleKeyringFree free);
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
167 void purple_keyring_set_change_master(PurpleKeyring * info, PurpleKeyringChangeMaster change_master);
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
168 void purple_keyring_set_import_password(PurpleKeyring * info, PurpleKeyringImportPassword import_password);
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
169 void purple_keyring_set_export_password(PurpleKeyring * info, PurpleKeyringExportPassword export_password);
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
170
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
171 /* PurpleKeyringPasswordNode */
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
172
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
173 PurpleKeyringPasswordNode * purple_keyring_password_node_new(void);
33970
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
174 void purple_keyring_password_node_delete(PurpleKeyringPasswordNode * node);
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
175
33970
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
176 const PurpleAccount *
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
177 purple_keyring_password_node_get_account(const PurpleKeyringPasswordNode * info);
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
178
33972
b55f819a1239 Fixed the internal keyring, as well as a couple typedefs.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33971
diff changeset
179 const char * purple_keyring_password_node_get_encryption(const PurpleKeyringPasswordNode * info); /* info to be kept must be copied */
b55f819a1239 Fixed the internal keyring, as well as a couple typedefs.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33971
diff changeset
180 const char * purple_keyring_password_node_get_mode(const PurpleKeyringPasswordNode * info); /* strings will be freed after use*/
b55f819a1239 Fixed the internal keyring, as well as a couple typedefs.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33971
diff changeset
181 const char * purple_keyring_password_node_get_data(const PurpleKeyringPasswordNode * info); /* (in most cases) */
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
182
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
183 void purple_keyring_password_node_set_account(PurpleKeyringPasswordNode * info, PurpleAccount * account);
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
184 void purple_keyring_password_node_set_encryption(PurpleKeyringPasswordNode * info, const char * encryption);
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
185 void purple_keyring_password_node_set_mode(PurpleKeyringPasswordNode * info, const char * mode);
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
186 void purple_keyring_password_node_set_data(PurpleKeyringPasswordNode * info, const char * data);
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
187
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
188 /* prepare some stuff at startup */
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
189 void purple_keyring_init();
33966
09490ce8a695 updated the internal keyring plugin, added a few comments in libpurple for future reference.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33965
diff changeset
190
09490ce8a695 updated the internal keyring plugin, added a few comments in libpurple for future reference.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33965
diff changeset
191 /***************************************/
09490ce8a695 updated the internal keyring plugin, added a few comments in libpurple for future reference.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33965
diff changeset
192 /** @name Error Codes */
09490ce8a695 updated the internal keyring plugin, added a few comments in libpurple for future reference.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33965
diff changeset
193 /***************************************/
09490ce8a695 updated the internal keyring plugin, added a few comments in libpurple for future reference.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33965
diff changeset
194
33970
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
195 #define ERR_PIDGINKEYRING purple_keyring_error_domain()
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
196 GQuark purple_keyring_error_domain(void);
33966
09490ce8a695 updated the internal keyring plugin, added a few comments in libpurple for future reference.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33965
diff changeset
197
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
198 enum
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
199 {
33970
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
200 ERR_OK = 0, /* no error */
33968
ca1e1985b5f2 update on keyring code
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33967
diff changeset
201 ERR_NOPASSWD = 1, /* no stored password */
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
202 ERR_NOACCOUNT, /* account not found */
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
203 ERR_WRONGPASS, /* user submitted wrong password when prompted */
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
204 ERR_WRONGFORMAT, /* data passed is not in suitable format*/
33970
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
205 ERR_NOKEYRING, /* no keyring configured */
4b6a0141a242 Fixed syntax and types error. keyring.c and keyring.h will now compile, but will issue warnings with -Wall
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33968
diff changeset
206 ERR_NOCHANNEL
33967
9fac87349244 wrote more of the API and plaintext plugin. commit so i can revert, non-working code.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33966
diff changeset
207 } PurpleKeyringError;
33968
ca1e1985b5f2 update on keyring code
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33967
diff changeset
208
ca1e1985b5f2 update on keyring code
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33967
diff changeset
209
ca1e1985b5f2 update on keyring code
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33967
diff changeset
210 #endif /* _PURPLE_KEYRING_H_ */

mercurial