~brian-murray/lightdm/bug-967229

« back to all changes in this revision

Viewing changes to src/xauth.h

  • Committer: robert.ancell at canonical
  • Date: 2011-02-12 00:48:57 UTC
  • Revision ID: robert.ancell@canonical.com-20110212004857-45gpv6k0m0uf0liv
Update changelog link

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2010-2011 Robert Ancell.
 
2
 * Copyright (C) 2010 Robert Ancell.
3
3
 * Author: Robert Ancell <robert.ancell@canonical.com>
4
4
 * 
5
5
 * This program is free software: you can redistribute it and/or modify it under
9
9
 * license.
10
10
 */
11
11
 
12
 
#ifndef _XAUTHORITY_H_
13
 
#define _XAUTHORITY_H_
 
12
#ifndef _XAUTH_H_
 
13
#define _XAUTH_H_
14
14
 
15
15
#include <glib-object.h>
16
16
#include <gio/gio.h>
17
17
 
18
18
G_BEGIN_DECLS
19
19
 
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));
22
22
 
23
 
typedef struct XAuthorityPrivate XAuthorityPrivate;
 
23
typedef struct XAuthorizationPrivate XAuthorizationPrivate;
24
24
 
25
25
typedef struct
26
26
{
27
27
    GObject         parent_instance;
28
 
    XAuthorityPrivate *priv;
29
 
} XAuthority;
 
28
    XAuthorizationPrivate *priv;
 
29
} XAuthorization;
30
30
 
31
31
typedef struct
32
32
{
33
33
    GObjectClass parent_class;
34
 
} XAuthorityClass;
35
 
 
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
46
 
 
47
 
typedef enum
48
 
{
49
 
   XAUTH_WRITE_MODE_REPLACE,
50
 
   XAUTH_WRITE_MODE_REMOVE,
51
 
   XAUTH_WRITE_MODE_SET  
52
 
} XAuthWriteMode;
 
34
} XAuthorizationClass;
53
35
 
54
36
GType xauth_get_type (void);
55
37
 
56
 
XAuthority *xauth_new (guint16 family, const guint8 *address, gsize address_length, const gchar *number, const gchar *name, const guint8 *data, gsize data_length);
57
 
 
58
 
XAuthority *xauth_new_cookie (guint16 family, const guint8 *address, gsize address_length, const gchar *number);
59
 
 
60
 
void xauth_set_family (XAuthority *auth, guint16 family);
61
 
 
62
 
guint16 xauth_get_family (XAuthority *auth);
63
 
 
64
 
void xauth_set_address (XAuthority *auth, const guint8 *address, gsize address_length);
65
 
 
66
 
const guint8 *xauth_get_address (XAuthority *auth);
67
 
 
68
 
const gsize xauth_get_address_length (XAuthority *auth);
69
 
 
70
 
void xauth_set_number (XAuthority *auth, const gchar *number);
71
 
 
72
 
const gchar *xauth_get_number (XAuthority *auth);
73
 
 
74
 
void xauth_set_authorization_name (XAuthority *auth, const gchar *name);
75
 
 
76
 
const gchar *xauth_get_authorization_name (XAuthority *auth);
77
 
 
78
 
void xauth_set_authorization_data (XAuthority *auth, const guint8 *data, gsize data_length);
79
 
 
80
 
const guint8 *xauth_get_authorization_data (XAuthority *auth);
81
 
 
82
 
guint8 *xauth_copy_authorization_data (XAuthority *auth);
83
 
 
84
 
gsize xauth_get_authorization_data_length (XAuthority *auth);
85
 
 
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);
 
39
 
 
40
XAuthorization *xauth_new_cookie (void);
 
41
 
 
42
const gchar *xauth_get_authorization_name (XAuthorization *auth);
 
43
 
 
44
const guchar *xauth_get_authorization_data (XAuthorization *auth);
 
45
 
 
46
gsize xauth_get_authorization_data_length (XAuthorization *auth);
 
47
 
 
48
GFile *xauth_write (XAuthorization *auth, const gchar *username, const gchar *path, GError **error);
87
49
 
88
50
G_END_DECLS
89
51
 
90
 
#endif /* _XAUTHORITY_H_ */
 
52
#endif /* _XAUTH_H_ */