12
#ifndef _XAUTHORITY_H_
13
#define _XAUTHORITY_H_
15
15
#include <glib-object.h>
16
16
#include <gio/gio.h>
20
#define XAUTHORITY_TYPE (xauth_get_type())
21
#define XAUTHORITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XAUTHORITY_TYPE, XAuthority));
20
#define XAUTH_TYPE (xauth_get_type())
21
#define XAUTH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XAUTH_TYPE, XAuthorization));
23
typedef struct XAuthorityPrivate XAuthorityPrivate;
23
typedef struct XAuthorizationPrivate XAuthorizationPrivate;
27
27
GObject parent_instance;
28
XAuthorityPrivate *priv;
28
XAuthorizationPrivate *priv;
33
33
GObjectClass parent_class;
36
#define XAUTH_FAMILY_INTERNET 0
37
#define XAUTH_FAMILY_DECNET 1
38
#define XAUTH_FAMILY_CHAOS 2
39
#define XAUTH_FAMILY_SERVER_INTERPRETED 5
40
#define XAUTH_FAMILY_INTERNET6 6
41
#define XAUTH_FAMILY_LOCALHOST 252
42
#define XAUTH_FAMILY_KRB5_PRINCIPAL 253
43
#define XAUTH_FAMILY_NETNAME 254
44
#define XAUTH_FAMILY_LOCAL 256
45
#define XAUTH_FAMILY_WILD 65535
49
XAUTH_WRITE_MODE_REPLACE,
50
XAUTH_WRITE_MODE_REMOVE,
34
} XAuthorizationClass;
54
36
GType xauth_get_type (void);
56
XAuthority *xauth_new (guint16 family, const guint8 *address, gsize address_length, const gchar *number, const gchar *name, const guint8 *data, gsize data_length);
58
XAuthority *xauth_new_cookie (guint16 family, const guint8 *address, gsize address_length, const gchar *number);
60
void xauth_set_family (XAuthority *auth, guint16 family);
62
guint16 xauth_get_family (XAuthority *auth);
64
void xauth_set_address (XAuthority *auth, const guint8 *address, gsize address_length);
66
const guint8 *xauth_get_address (XAuthority *auth);
68
const gsize xauth_get_address_length (XAuthority *auth);
70
void xauth_set_number (XAuthority *auth, const gchar *number);
72
const gchar *xauth_get_number (XAuthority *auth);
74
void xauth_set_authorization_name (XAuthority *auth, const gchar *name);
76
const gchar *xauth_get_authorization_name (XAuthority *auth);
78
void xauth_set_authorization_data (XAuthority *auth, const guint8 *data, gsize data_length);
80
const guint8 *xauth_get_authorization_data (XAuthority *auth);
82
guint8 *xauth_copy_authorization_data (XAuthority *auth);
84
gsize xauth_get_authorization_data_length (XAuthority *auth);
86
gboolean xauth_write (XAuthority *auth, XAuthWriteMode mode, GFile *file, GError **error);
38
XAuthorization *xauth_new (const gchar *name, const guchar *data, gsize data_length);
40
XAuthorization *xauth_new_cookie (void);
42
const gchar *xauth_get_authorization_name (XAuthorization *auth);
44
const guchar *xauth_get_authorization_data (XAuthorization *auth);
46
gsize xauth_get_authorization_data_length (XAuthorization *auth);
48
GFile *xauth_write (XAuthorization *auth, const gchar *username, const gchar *path, GError **error);
90
#endif /* _XAUTHORITY_H_ */
52
#endif /* _XAUTH_H_ */