Blame include/X11/Xauth.h

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