CASA/c_adlib/ad_gk/native/ad_gk.h

109 lines
2.1 KiB
C
Raw Normal View History

#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>
#define SUCCESS 0
#define FAILURE -1
#define KEY_SIZE 128
#define VAL_SIZE 128
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
};
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);
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);
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;
typedef struct _OperationCompleted
{
char *OperationName;
GnomeKeyringResult result;
}OperationCompleted;
#endif