home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / include / x11 / ice / iceutil.h < prev   
Encoding:
C/C++ Source or Header  |  1996-10-17  |  3.5 KB  |  139 lines

  1. /* $XConsortium: ICEutil.h,v 1.5 94/04/17 20:15:27 mor Exp $ */
  2. /******************************************************************************
  3.  
  4.  
  5. Copyright (c) 1993  X Consortium
  6.  
  7. Permission is hereby granted, free of charge, to any person obtaining a copy
  8. of this software and associated documentation files (the "Software"), to deal
  9. in the Software without restriction, including without limitation the rights
  10. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11. copies of the Software, and to permit persons to whom the Software is
  12. furnished to do so, subject to the following conditions:
  13.  
  14. The above copyright notice and this permission notice shall be included in
  15. all copies or substantial portions of the Software.
  16.  
  17. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  20. X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  21. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  22. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23.  
  24. Except as contained in this notice, the name of the X Consortium shall not be
  25. used in advertising or otherwise to promote the sale, use or other dealings
  26. in this Software without prior written authorization from the X Consortium.
  27.  
  28. Author: Ralph Mor, X Consortium
  29. ******************************************************************************/
  30.  
  31. #ifndef _ICEUTIL_H_
  32. #define _ICEUTIL_H_
  33.  
  34. #include <stdio.h>
  35.  
  36. /*
  37.  * Data structure for entry in ICE authority file
  38.  */
  39.  
  40. typedef struct {
  41.     char            *protocol_name;
  42.     unsigned short  protocol_data_length;
  43.     char           *protocol_data;
  44.     char            *network_id;
  45.     char            *auth_name;
  46.     unsigned short  auth_data_length;
  47.     char           *auth_data;
  48. } IceAuthFileEntry;
  49.  
  50.  
  51. /*
  52.  * Authentication data maintained in memory.
  53.  */
  54.  
  55. typedef struct {
  56.     char            *protocol_name;
  57.     char        *network_id;
  58.     char            *auth_name;
  59.     unsigned short  auth_data_length;
  60.     char           *auth_data;
  61. } IceAuthDataEntry;
  62.  
  63.  
  64. /*
  65.  * Return values from IceLockAuthFile
  66.  */
  67.  
  68. #define IceAuthLockSuccess    0   /* lock succeeded */
  69. #define IceAuthLockError    1   /* lock unexpectely failed, check errno */
  70. #define IceAuthLockTimeout    2   /* lock failed, timeouts expired */
  71.  
  72.  
  73. /*
  74.  * Function Prototypes
  75.  */
  76.  
  77. extern char *IceAuthFileName (
  78. #if NeedFunctionPrototypes
  79.     void
  80. #endif
  81. );
  82.  
  83. extern int IceLockAuthFile (
  84. #if NeedFunctionPrototypes
  85.     char *        /* file_name */,
  86.     int            /* retries */,
  87.     int            /* timeout */,
  88.     long        /* dead */
  89. #endif
  90. );
  91.  
  92. extern void IceUnlockAuthFile (
  93. #if NeedFunctionPrototypes
  94.     char *        /* file_name */
  95. #endif
  96. );
  97.  
  98. extern IceAuthFileEntry *IceReadAuthFileEntry (
  99. #if NeedFunctionPrototypes
  100.     FILE *        /* auth_file */
  101. #endif
  102. );
  103.  
  104. extern void IceFreeAuthFileEntry (
  105. #if NeedFunctionPrototypes
  106.     IceAuthFileEntry *    /* auth */
  107. #endif
  108. );
  109.  
  110. extern Status IceWriteAuthFileEntry (
  111. #if NeedFunctionPrototypes
  112.     FILE *        /* auth_file */,
  113.     IceAuthFileEntry *    /* auth */
  114. #endif
  115. );
  116.  
  117. extern IceAuthFileEntry *IceGetAuthFileEntry (
  118. #if NeedFunctionPrototypes
  119.     char *        /* protocol_name */,
  120.     char *        /* network_id */,
  121.     char *        /* auth_name */
  122. #endif
  123. );
  124.  
  125. extern char *IceGenerateMagicCookie (
  126. #if NeedFunctionPrototypes
  127.     int            /* len */
  128. #endif
  129. );
  130.  
  131. extern void IceSetPaAuthData (
  132. #if NeedFunctionPrototypes
  133.     int            /* numEntries */,
  134.     IceAuthDataEntry *    /* entries */
  135. #endif
  136. );
  137.  
  138. #endif /* _ICEUTIL_H_ */
  139.