Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:14:31

0001 /*
0002 
0003 Copyright 1988, 1998  The Open Group
0004 
0005 Permission to use, copy, modify, distribute, and sell this software and its
0006 documentation for any purpose is hereby granted without fee, provided that
0007 the above copyright notice appear in all copies and that both that
0008 copyright notice and this permission notice appear in supporting
0009 documentation.
0010 
0011 The above copyright notice and this permission notice shall be included in
0012 all copies or substantial portions of the Software.
0013 
0014 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
0017 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
0018 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0019 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0020 
0021 Except as contained in this notice, the name of The Open Group shall not be
0022 used in advertising or otherwise to promote the sale, use or other dealings
0023 in this Software without prior written authorization from The Open Group.
0024 
0025 */
0026 
0027 #ifndef _Xauth_h
0028 #define _Xauth_h
0029 
0030 /* struct xauth is full of implicit padding to properly align the pointers
0031    after the length fields.   We can't clean that up without breaking ABI,
0032    so tell clang not to bother complaining about it. */
0033 #ifdef __clang__
0034 #pragma clang diagnostic push
0035 #pragma clang diagnostic ignored "-Wpadded"
0036 #endif
0037 
0038 typedef struct xauth {
0039     unsigned short   family;
0040     unsigned short   address_length;
0041     char            *address;
0042     unsigned short   number_length;
0043     char            *number;
0044     unsigned short   name_length;
0045     char            *name;
0046     unsigned short   data_length;
0047     char        *data;
0048 } Xauth;
0049 
0050 #ifdef __clang__
0051 #pragma clang diagnostic pop
0052 #endif
0053 
0054 #ifndef _XAUTH_STRUCT_ONLY
0055 
0056 # include   <X11/Xfuncproto.h>
0057 # include   <X11/Xfuncs.h>
0058 
0059 # include   <stdio.h>
0060 
0061 # define FamilyLocal (256)  /* not part of X standard (i.e. X.h) */
0062 # define FamilyWild  (65535)
0063 # define FamilyNetname    (254)   /* not part of X standard */
0064 # define FamilyKrb5Principal (253) /* Kerberos 5 principal name */
0065 # define FamilyLocalHost (252)  /* for local non-net authentication */
0066 
0067 
0068 _XFUNCPROTOBEGIN
0069 
0070 char *XauFileName(void);
0071 
0072 Xauth *XauReadAuth(
0073 FILE*   /* auth_file */
0074 );
0075 
0076 int XauLockAuth(
0077 _Xconst char*   /* file_name */,
0078 int     /* retries */,
0079 int     /* timeout */,
0080 long        /* dead */
0081 );
0082 
0083 int XauUnlockAuth(
0084 _Xconst char*   /* file_name */
0085 );
0086 
0087 int XauWriteAuth(
0088 FILE*       /* auth_file */,
0089 Xauth*      /* auth */
0090 );
0091 
0092 Xauth *XauGetAuthByAddr(
0093 #if NeedWidePrototypes
0094 unsigned int    /* family */,
0095 unsigned int    /* address_length */,
0096 #else
0097 unsigned short  /* family */,
0098 unsigned short  /* address_length */,
0099 #endif
0100 _Xconst char*   /* address */,
0101 #if NeedWidePrototypes
0102 unsigned int    /* number_length */,
0103 #else
0104 unsigned short  /* number_length */,
0105 #endif
0106 _Xconst char*   /* number */,
0107 #if NeedWidePrototypes
0108 unsigned int    /* name_length */,
0109 #else
0110 unsigned short  /* name_length */,
0111 #endif
0112 _Xconst char*   /* name */
0113 );
0114 
0115 Xauth *XauGetBestAuthByAddr(
0116 #if NeedWidePrototypes
0117 unsigned int    /* family */,
0118 unsigned int    /* address_length */,
0119 #else
0120 unsigned short  /* family */,
0121 unsigned short  /* address_length */,
0122 #endif
0123 _Xconst char*   /* address */,
0124 #if NeedWidePrototypes
0125 unsigned int    /* number_length */,
0126 #else
0127 unsigned short  /* number_length */,
0128 #endif
0129 _Xconst char*   /* number */,
0130 int     /* types_length */,
0131 char**      /* type_names */,
0132 _Xconst int*    /* type_lengths */
0133 );
0134 
0135 void XauDisposeAuth(
0136 Xauth*      /* auth */
0137 );
0138 
0139 _XFUNCPROTOEND
0140 
0141 /* Return values from XauLockAuth */
0142 
0143 # define LOCK_SUCCESS   0   /* lock succeeded */
0144 # define LOCK_ERROR 1   /* lock unexpectedly failed, check errno */
0145 # define LOCK_TIMEOUT   2   /* lock failed, timeouts expired */
0146 
0147 #endif /* _XAUTH_STRUCT_ONLY */
0148 
0149 #endif /* _Xauth_h */