2005-10-11 21:51:00 +02:00
|
|
|
#ifndef _AD_GK_H_
|
|
|
|
#define _AD_GK_H_
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <glib.h>
|
|
|
|
#include <gnome-keyring.h>
|
2005-12-16 23:09:58 +01:00
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
2005-10-11 21:51:00 +02:00
|
|
|
|
|
|
|
#define SUCCESS 0
|
|
|
|
#define FAILURE -1
|
|
|
|
|
|
|
|
#define KEY_SIZE 128
|
|
|
|
#define VAL_SIZE 128
|
|
|
|
|
2005-12-16 11:29:25 +01:00
|
|
|
|
|
|
|
enum KeyringResultExtended { GNOME_KEYRING_RESULT_NO_SUCH_ITEM = 128,
|
|
|
|
GNOME_KEYRING_RESULT_CANNOT_DELETE_SECRET_VALUE,
|
|
|
|
GNOME_KEYRING_RESULT_MALFORMED_XML,
|
|
|
|
GNOME_KEYRING_RESULT_CANNOT_CREATE_KEYRING
|
|
|
|
};
|
|
|
|
|
2005-10-11 21:51:00 +02:00
|
|
|
typedef struct _KeyringInfo
|
|
|
|
{
|
|
|
|
int32_t lockOnIdle;
|
|
|
|
uint32_t lockTimeout;
|
|
|
|
uint32_t mTime;
|
|
|
|
uint32_t cTime;
|
|
|
|
int32_t isLocked;
|
|
|
|
}KeyringInfo;
|
|
|
|
|
|
|
|
typedef struct _ItemInfo
|
|
|
|
{
|
|
|
|
int32_t itemType;
|
|
|
|
char *displayName;
|
|
|
|
char *secret;
|
|
|
|
uint32_t mTime;
|
|
|
|
uint32_t cTime;
|
|
|
|
}ItemInfo;
|
|
|
|
|
|
|
|
typedef struct _Attribute
|
|
|
|
{
|
|
|
|
uint32_t type;
|
|
|
|
char *key;
|
|
|
|
char *value;
|
|
|
|
}Attribute;
|
|
|
|
|
|
|
|
|
|
|
|
int GetKeyrings(GList **retList);
|
|
|
|
int GetKeyringInfo(char *keyring,KeyringInfo *info);
|
|
|
|
int GetItems(char *keyring, GList **itemList);
|
|
|
|
int GetItemInfo(char *keyring, int itemId, ItemInfo *info);
|
|
|
|
int GetAttributeList(char *keyring, int itemId, GList **);
|
|
|
|
int FreeAttributeList(GList *attrList);
|
|
|
|
|
2006-01-05 00:49:07 +01:00
|
|
|
int
|
|
|
|
UnlockRing(char *keyring, char *password);
|
2005-12-16 11:29:25 +01:00
|
|
|
int
|
|
|
|
SetItemAttributes (char *keyring, guint32 item_id, Attribute **attrs, int length);
|
|
|
|
int
|
|
|
|
CreateItem(char *keyring, int32_t itemType, char *display_name, char *secret, Attribute **attrs, int attrcnt);
|
|
|
|
int
|
|
|
|
RemoveItem (char *keyring, guint32 itemid);
|
|
|
|
int
|
|
|
|
SetPassword (char *keyring, guint32 itemid, char *secret);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-10-11 21:51:00 +02:00
|
|
|
typedef struct _GetKeyringsCbData
|
|
|
|
{
|
|
|
|
GList **keyringList;
|
|
|
|
GMainLoop *loop;
|
|
|
|
}GetKeyringsCbData;
|
|
|
|
|
|
|
|
typedef struct _GetKeyringInfoCbData
|
|
|
|
{
|
|
|
|
KeyringInfo *info;
|
|
|
|
GMainLoop *loop;
|
|
|
|
}GetKeyringInfoCbData;
|
|
|
|
|
|
|
|
typedef struct _GetItemsCbData
|
|
|
|
{
|
|
|
|
GList **itemList;
|
|
|
|
GMainLoop *loop;
|
|
|
|
}GetItemsCbData;
|
|
|
|
|
|
|
|
typedef struct _GetItemInfoCbData
|
|
|
|
{
|
|
|
|
ItemInfo *info;
|
|
|
|
GMainLoop *loop;
|
|
|
|
}GetItemInfoCbData;
|
|
|
|
|
|
|
|
typedef struct _GetAttributeListCbData
|
|
|
|
{
|
|
|
|
GList **attrList;
|
|
|
|
GMainLoop *loop;
|
|
|
|
}GetAttributeListCbData;
|
2005-12-16 11:29:25 +01:00
|
|
|
typedef struct _OperationCompleted
|
|
|
|
{
|
|
|
|
char *OperationName;
|
|
|
|
GnomeKeyringResult result;
|
|
|
|
|
|
|
|
}OperationCompleted;
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-10-11 21:51:00 +02:00
|
|
|
#endif
|