Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:26:35

0001 /******************************************************************************
0002 
0003 
0004 Copyright 1993, 1998  The Open Group
0005 
0006 Permission to use, copy, modify, distribute, and sell this software and its
0007 documentation for any purpose is hereby granted without fee, provided that
0008 the above copyright notice appear in all copies and that both that
0009 copyright notice and this permission notice appear in supporting
0010 documentation.
0011 
0012 The above copyright notice and this permission notice shall be included in
0013 all copies or substantial portions of the Software.
0014 
0015 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0016 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0017 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
0018 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
0019 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0020 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0021 
0022 Except as contained in this notice, the name of The Open Group shall not be
0023 used in advertising or otherwise to promote the sale, use or other dealings
0024 in this Software without prior written authorization from The Open Group.
0025 
0026 Author: Ralph Mor, X Consortium
0027 ******************************************************************************/
0028 
0029 #ifndef _ICEUTIL_H_
0030 #define _ICEUTIL_H_
0031 
0032 #include <X11/Xfuncproto.h>
0033 
0034 #include <stdio.h>
0035 
0036 _XFUNCPROTOBEGIN
0037 
0038 /*
0039  * Data structure for entry in ICE authority file
0040  */
0041 
0042 typedef struct {
0043     char            *protocol_name;
0044     unsigned short  protocol_data_length;
0045     char        *protocol_data;
0046     char            *network_id;
0047     char            *auth_name;
0048     unsigned short  auth_data_length;
0049     char        *auth_data;
0050 } IceAuthFileEntry;
0051 
0052 
0053 /*
0054  * Authentication data maintained in memory.
0055  */
0056 
0057 typedef struct {
0058     char            *protocol_name;
0059     char        *network_id;
0060     char            *auth_name;
0061     unsigned short  auth_data_length;
0062     char        *auth_data;
0063 } IceAuthDataEntry;
0064 
0065 
0066 /*
0067  * Return values from IceLockAuthFile
0068  */
0069 
0070 #define IceAuthLockSuccess  0   /* lock succeeded */
0071 #define IceAuthLockError    1   /* lock unexpectedly failed, check errno */
0072 #define IceAuthLockTimeout  2   /* lock failed, timeouts expired */
0073 
0074 
0075 /*
0076  * Function Prototypes
0077  */
0078 
0079 extern char *IceAuthFileName (
0080     void
0081 );
0082 
0083 extern int IceLockAuthFile (
0084     const char *    /* file_name */,
0085     int         /* retries */,
0086     int         /* timeout */,
0087     long        /* dead */
0088 );
0089 
0090 extern void IceUnlockAuthFile (
0091     const char *    /* file_name */
0092 );
0093 
0094 extern IceAuthFileEntry *IceReadAuthFileEntry (
0095     FILE *      /* auth_file */
0096 );
0097 
0098 extern void IceFreeAuthFileEntry (
0099     IceAuthFileEntry *  /* auth */
0100 );
0101 
0102 extern Status IceWriteAuthFileEntry (
0103     FILE *      /* auth_file */,
0104     IceAuthFileEntry *  /* auth */
0105 );
0106 
0107 extern IceAuthFileEntry *IceGetAuthFileEntry (
0108     const char *    /* protocol_name */,
0109     const char *    /* network_id */,
0110     const char *    /* auth_name */
0111 );
0112 
0113 extern char *IceGenerateMagicCookie (
0114     int         /* len */
0115 );
0116 
0117 extern void IceSetPaAuthData (
0118     int         /* numEntries */,
0119     IceAuthDataEntry *  /* entries */
0120 );
0121 
0122 _XFUNCPROTOEND
0123 
0124 #endif /* _ICEUTIL_H_ */