Blame include/X11/Xauth.h

Packit Service f89583
/*
Packit Service f89583
Packit Service f89583
Copyright 1988, 1998  The Open Group
Packit Service f89583
Packit Service f89583
Permission to use, copy, modify, distribute, and sell this software and its
Packit Service f89583
documentation for any purpose is hereby granted without fee, provided that
Packit Service f89583
the above copyright notice appear in all copies and that both that
Packit Service f89583
copyright notice and this permission notice appear in supporting
Packit Service f89583
documentation.
Packit Service f89583
Packit Service f89583
The above copyright notice and this permission notice shall be included in
Packit Service f89583
all copies or substantial portions of the Software.
Packit Service f89583
Packit Service f89583
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Packit Service f89583
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Packit Service f89583
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
Packit Service f89583
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
Packit Service f89583
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
Packit Service f89583
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Packit Service f89583
Packit Service f89583
Except as contained in this notice, the name of The Open Group shall not be
Packit Service f89583
used in advertising or otherwise to promote the sale, use or other dealings
Packit Service f89583
in this Software without prior written authorization from The Open Group.
Packit Service f89583
Packit Service f89583
*/
Packit Service f89583
Packit Service f89583
#ifndef _Xauth_h
Packit Service f89583
#define _Xauth_h
Packit Service f89583
Packit Service f89583
/* struct xauth is full of implicit padding to properly align the pointers
Packit Service f89583
   after the length fields.   We can't clean that up without breaking ABI,
Packit Service f89583
   so tell clang not to bother complaining about it. */
Packit Service f89583
#ifdef __clang__
Packit Service f89583
#pragma clang diagnostic push
Packit Service f89583
#pragma clang diagnostic ignored "-Wpadded"
Packit Service f89583
#endif
Packit Service f89583
Packit Service f89583
typedef struct xauth {
Packit Service f89583
    unsigned short   family;
Packit Service f89583
    unsigned short   address_length;
Packit Service f89583
    char    	    *address;
Packit Service f89583
    unsigned short   number_length;
Packit Service f89583
    char    	    *number;
Packit Service f89583
    unsigned short   name_length;
Packit Service f89583
    char    	    *name;
Packit Service f89583
    unsigned short   data_length;
Packit Service f89583
    char   	    *data;
Packit Service f89583
} Xauth;
Packit Service f89583
Packit Service f89583
#ifdef __clang__
Packit Service f89583
#pragma clang diagnostic pop
Packit Service f89583
#endif
Packit Service f89583
Packit Service f89583
#ifndef _XAUTH_STRUCT_ONLY
Packit Service f89583
Packit Service f89583
# include   <X11/Xfuncproto.h>
Packit Service f89583
# include   <X11/Xfuncs.h>
Packit Service f89583
Packit Service f89583
# include   <stdio.h>
Packit Service f89583
Packit Service f89583
# define FamilyLocal (256)	/* not part of X standard (i.e. X.h) */
Packit Service f89583
# define FamilyWild  (65535)
Packit Service f89583
# define FamilyNetname    (254)   /* not part of X standard */
Packit Service f89583
# define FamilyKrb5Principal (253) /* Kerberos 5 principal name */
Packit Service f89583
# define FamilyLocalHost (252)	/* for local non-net authentication */
Packit Service f89583
Packit Service f89583
Packit Service f89583
_XFUNCPROTOBEGIN
Packit Service f89583
Packit Service f89583
char *XauFileName(void);
Packit Service f89583
Packit Service f89583
Xauth *XauReadAuth(
Packit Service f89583
FILE*	/* auth_file */
Packit Service f89583
);
Packit Service f89583
Packit Service f89583
int XauLockAuth(
Packit Service f89583
_Xconst char*	/* file_name */,
Packit Service f89583
int		/* retries */,
Packit Service f89583
int		/* timeout */,
Packit Service f89583
long		/* dead */
Packit Service f89583
);
Packit Service f89583
Packit Service f89583
int XauUnlockAuth(
Packit Service f89583
_Xconst char*	/* file_name */
Packit Service f89583
);
Packit Service f89583
Packit Service f89583
int XauWriteAuth(
Packit Service f89583
FILE*		/* auth_file */,
Packit Service f89583
Xauth*		/* auth */
Packit Service f89583
);
Packit Service f89583
Packit Service f89583
Xauth *XauGetAuthByAddr(
Packit Service f89583
#if NeedWidePrototypes
Packit Service f89583
unsigned int	/* family */,
Packit Service f89583
unsigned int	/* address_length */,
Packit Service f89583
#else
Packit Service f89583
unsigned short	/* family */,
Packit Service f89583
unsigned short	/* address_length */,
Packit Service f89583
#endif
Packit Service f89583
_Xconst char*	/* address */,
Packit Service f89583
#if NeedWidePrototypes
Packit Service f89583
unsigned int	/* number_length */,
Packit Service f89583
#else
Packit Service f89583
unsigned short	/* number_length */,
Packit Service f89583
#endif
Packit Service f89583
_Xconst char*	/* number */,
Packit Service f89583
#if NeedWidePrototypes
Packit Service f89583
unsigned int	/* name_length */,
Packit Service f89583
#else
Packit Service f89583
unsigned short	/* name_length */,
Packit Service f89583
#endif
Packit Service f89583
_Xconst char*	/* name */
Packit Service f89583
);
Packit Service f89583
Packit Service f89583
Xauth *XauGetBestAuthByAddr(
Packit Service f89583
#if NeedWidePrototypes
Packit Service f89583
unsigned int	/* family */,
Packit Service f89583
unsigned int	/* address_length */,
Packit Service f89583
#else
Packit Service f89583
unsigned short	/* family */,
Packit Service f89583
unsigned short	/* address_length */,
Packit Service f89583
#endif
Packit Service f89583
_Xconst char*	/* address */,
Packit Service f89583
#if NeedWidePrototypes
Packit Service f89583
unsigned int	/* number_length */,
Packit Service f89583
#else
Packit Service f89583
unsigned short	/* number_length */,
Packit Service f89583
#endif
Packit Service f89583
_Xconst char*	/* number */,
Packit Service f89583
int		/* types_length */,
Packit Service f89583
char**		/* type_names */,
Packit Service f89583
_Xconst int*	/* type_lengths */
Packit Service f89583
);
Packit Service f89583
Packit Service f89583
void XauDisposeAuth(
Packit Service f89583
Xauth*		/* auth */
Packit Service f89583
);
Packit Service f89583
Packit Service f89583
_XFUNCPROTOEND
Packit Service f89583
Packit Service f89583
/* Return values from XauLockAuth */
Packit Service f89583
Packit Service f89583
# define LOCK_SUCCESS	0	/* lock succeeded */
Packit Service f89583
# define LOCK_ERROR	1	/* lock unexpectely failed, check errno */
Packit Service f89583
# define LOCK_TIMEOUT	2	/* lock failed, timeouts expired */
Packit Service f89583
Packit Service f89583
#endif /* _XAUTH_STRUCT_ONLY */
Packit Service f89583
Packit Service f89583
#endif /* _Xauth_h */