upload tizen2.0 source
[framework/uifw/xorg/lib/libxau.git] / include / X11 / Xauth.h
1 /*
2
3 Copyright 1988, 1998  The Open Group
4
5 Permission to use, copy, modify, distribute, and sell this software and its
6 documentation for any purpose is hereby granted without fee, provided that
7 the above copyright notice appear in all copies and that both that
8 copyright notice and this permission notice appear in supporting
9 documentation.
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
17 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
21 Except as contained in this notice, the name of The Open Group shall not be
22 used in advertising or otherwise to promote the sale, use or other dealings
23 in this Software without prior written authorization from The Open Group.
24
25 */
26
27 #ifndef _Xauth_h
28 #define _Xauth_h
29
30 typedef struct xauth {
31     unsigned short   family;
32     unsigned short   address_length;
33     char            *address;
34     unsigned short   number_length;
35     char            *number;
36     unsigned short   name_length;
37     char            *name;
38     unsigned short   data_length;
39     char            *data;
40 } Xauth;
41
42 #ifndef _XAUTH_STRUCT_ONLY
43
44 # include   <X11/Xfuncproto.h>
45 # include   <X11/Xfuncs.h>
46
47 # include   <stdio.h>
48
49 # define FamilyLocal (256)      /* not part of X standard (i.e. X.h) */
50 # define FamilyWild  (65535)
51 # define FamilyNetname    (254)   /* not part of X standard */
52 # define FamilyKrb5Principal (253) /* Kerberos 5 principal name */
53 # define FamilyLocalHost (252)  /* for local non-net authentication */
54
55
56 _XFUNCPROTOBEGIN
57
58 char *XauFileName(void);
59
60 Xauth *XauReadAuth(
61 FILE*   /* auth_file */
62 );
63
64 int XauLockAuth(
65 _Xconst char*   /* file_name */,
66 int             /* retries */,
67 int             /* timeout */,
68 long            /* dead */
69 );
70
71 int XauUnlockAuth(
72 _Xconst char*   /* file_name */
73 );
74
75 int XauWriteAuth(
76 FILE*           /* auth_file */,
77 Xauth*          /* auth */
78 );
79
80 Xauth *XauGetAuthByAddr(
81 #if NeedWidePrototypes
82 unsigned int    /* family */,
83 unsigned int    /* address_length */,
84 #else
85 unsigned short  /* family */,
86 unsigned short  /* address_length */,
87 #endif
88 _Xconst char*   /* address */,
89 #if NeedWidePrototypes
90 unsigned int    /* number_length */,
91 #else
92 unsigned short  /* number_length */,
93 #endif
94 _Xconst char*   /* number */,
95 #if NeedWidePrototypes
96 unsigned int    /* name_length */,
97 #else
98 unsigned short  /* name_length */,
99 #endif
100 _Xconst char*   /* name */
101 );
102
103 Xauth *XauGetBestAuthByAddr(
104 #if NeedWidePrototypes
105 unsigned int    /* family */,
106 unsigned int    /* address_length */,
107 #else
108 unsigned short  /* family */,
109 unsigned short  /* address_length */,
110 #endif
111 _Xconst char*   /* address */,
112 #if NeedWidePrototypes
113 unsigned int    /* number_length */,
114 #else
115 unsigned short  /* number_length */,
116 #endif
117 _Xconst char*   /* number */,
118 int             /* types_length */,
119 char**          /* type_names */,
120 _Xconst int*    /* type_lengths */
121 );
122
123 void XauDisposeAuth(
124 Xauth*          /* auth */
125 );
126
127 _XFUNCPROTOEND
128
129 /* Return values from XauLockAuth */
130
131 # define LOCK_SUCCESS   0       /* lock succeeded */
132 # define LOCK_ERROR     1       /* lock unexpectely failed, check errno */
133 # define LOCK_TIMEOUT   2       /* lock failed, timeouts expired */
134
135 #endif /* _XAUTH_STRUCT_ONLY */
136
137 #endif /* _Xauth_h */