| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #ifndef _Xauth_h |
| #define _Xauth_h |
|
|
| |
| |
| |
| #ifdef __clang__ |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wpadded" |
| #endif |
|
|
| typedef struct xauth { |
| unsigned short family; |
| unsigned short address_length; |
| char *address; |
| unsigned short number_length; |
| char *number; |
| unsigned short name_length; |
| char *name; |
| unsigned short data_length; |
| char *data; |
| } Xauth; |
|
|
| #ifdef __clang__ |
| #pragma clang diagnostic pop |
| #endif |
|
|
| #ifndef _XAUTH_STRUCT_ONLY |
|
|
| # include <X11/Xfuncproto.h> |
| # include <X11/Xfuncs.h> |
|
|
| # include <stdio.h> |
|
|
| # define FamilyLocal (256) |
| # define FamilyWild (65535) |
| # define FamilyNetname (254) |
| # define FamilyKrb5Principal (253) |
| # define FamilyLocalHost (252) |
|
|
|
|
| _XFUNCPROTOBEGIN |
|
|
| #ifndef __has_attribute |
| # define __has_attribute(x) 0 |
| #endif |
|
|
| #if __has_attribute(access) |
| # define XAU_ACCESS_ATTRIBUTE(X) __attribute__((access X)) |
| #else |
| # define XAU_ACCESS_ATTRIBUTE(X) |
| #endif |
|
|
| #if __has_attribute(malloc) |
| # if defined(__clang__) || (defined(__GNUC__) && __GNUC__ < 11) |
| |
| # define XAU_MALLOC_ATTRIBUTE(X) __attribute__((malloc)) |
| # else |
| # define XAU_MALLOC_ATTRIBUTE(X) __attribute__((malloc X)) |
| # endif |
| #else |
| # define XAU_MALLOC_ATTRIBUTE(X) |
| #endif |
|
|
| char *XauFileName(void); |
|
|
| void XauDisposeAuth( |
| Xauth* |
| ); |
|
|
| XAU_MALLOC_ATTRIBUTE((XauDisposeAuth, 1)) |
| Xauth *XauReadAuth( |
| FILE* |
| ); |
|
|
| XAU_ACCESS_ATTRIBUTE((read_only, 1)) |
| int XauLockAuth( |
| _Xconst char* , |
| int , |
| int , |
| long |
| ); |
|
|
| XAU_ACCESS_ATTRIBUTE((read_only, 1)) |
| int XauUnlockAuth( |
| _Xconst char* |
| ); |
|
|
| XAU_ACCESS_ATTRIBUTE((read_only, 2)) |
| int XauWriteAuth( |
| FILE* , |
| Xauth* |
| ); |
|
|
| XAU_ACCESS_ATTRIBUTE((read_only, 3, 2)) |
| XAU_ACCESS_ATTRIBUTE((read_only, 5, 4)) |
| XAU_ACCESS_ATTRIBUTE((read_only, 7, 6)) |
| Xauth *XauGetAuthByAddr( |
| #if NeedWidePrototypes |
| unsigned int , |
| unsigned int , |
| #else |
| unsigned short , |
| unsigned short , |
| #endif |
| _Xconst char* , |
| #if NeedWidePrototypes |
| unsigned int , |
| #else |
| unsigned short , |
| #endif |
| _Xconst char* , |
| #if NeedWidePrototypes |
| unsigned int , |
| #else |
| unsigned short , |
| #endif |
| _Xconst char* |
| ); |
|
|
| XAU_ACCESS_ATTRIBUTE((read_only, 3, 2)) |
| XAU_ACCESS_ATTRIBUTE((read_only, 5, 4)) |
| XAU_ACCESS_ATTRIBUTE((read_only, 7, 6)) |
| XAU_ACCESS_ATTRIBUTE((read_only, 8, 6)) |
| Xauth *XauGetBestAuthByAddr( |
| #if NeedWidePrototypes |
| unsigned int , |
| unsigned int , |
| #else |
| unsigned short , |
| unsigned short , |
| #endif |
| _Xconst char* , |
| #if NeedWidePrototypes |
| unsigned int , |
| #else |
| unsigned short , |
| #endif |
| _Xconst char* , |
| int , |
| char** , |
| _Xconst int* |
| ); |
|
|
| _XFUNCPROTOEND |
|
|
| |
|
|
| # define LOCK_SUCCESS 0 |
| # define LOCK_ERROR 1 |
| # define LOCK_TIMEOUT 2 |
|
|
| #endif |
|
|
| #endif |
|
|