security.pp 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. (*
  2. Copyright 1996, 1998 The Open Group
  3. Permission to use, copy, modify, distribute, and sell this software and its
  4. documentation for any purpose is hereby granted without fee, provided that
  5. the above copyright notice appear in all copies and that both that
  6. copyright notice and this permission notice appear in supporting
  7. documentation.
  8. The above copyright notice and this permission notice shall be included
  9. in all copies or substantial portions of the Software.
  10. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  11. OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  12. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  13. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
  14. OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  15. ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  16. OTHER DEALINGS IN THE SOFTWARE.
  17. Except as contained in this notice, the name of The Open Group shall
  18. not be used in advertising or otherwise to promote the sale, use or
  19. other dealings in this Software without prior written authorization
  20. from The Open Group.
  21. *)
  22. {$IFNDEF FPC_DOTTEDUNITS}
  23. unit security;
  24. {$ENDIF FPC_DOTTEDUNITS}
  25. {$PACKRECORDS c}
  26. interface
  27. {$IFDEF FPC_DOTTEDUNITS}
  28. uses
  29. System.CTypes, Api.X11.X, Api.X11.Xlib;
  30. {$ELSE FPC_DOTTEDUNITS}
  31. uses
  32. ctypes, x, xlib;
  33. {$ENDIF FPC_DOTTEDUNITS}
  34. const
  35. libXext = 'Xext';
  36. {$define _XAUTH_STRUCT_ONLY}
  37. {$I xauth.inc}
  38. {$I secur.inc}
  39. type
  40. { type for returned auth ids }
  41. PXSecurityAuthorization = ^TXSecurityAuthorization;
  42. TXSecurityAuthorization = culong;
  43. PXSecurityAuthorizationAttributes = ^TXSecurityAuthorizationAttributes;
  44. TXSecurityAuthorizationAttributes = record
  45. timeout: cuint;
  46. trust_level: cuint;
  47. group: TXID;
  48. event_mask: clong;
  49. end;
  50. PXSecurityAuthorizationRevokedEvent = ^TXSecurityAuthorizationRevokedEvent;
  51. TXSecurityAuthorizationRevokedEvent = record
  52. _type: cint; { event base + XSecurityAuthorizationRevoked }
  53. serial: culong; { # of last request processed by server }
  54. send_event: TBool; { true if this came from a SendEvent request }
  55. display: PDisplay; { Display the event was read from }
  56. auth_id: TXSecurityAuthorization; { revoked authorization id }
  57. end;
  58. function XSecurityQueryExtension (
  59. dpy: PDisplay;
  60. major_version_return,
  61. minor_version_return: Pcint): TStatus; cdecl; external libXext;
  62. function XSecurityAllocXauth: PXauth; cdecl; external libXext;
  63. procedure XSecurityFreeXauth(auth: PXauth); cdecl; external libXext;
  64. function XSecurityGenerateAuthorization(
  65. dpy: PDisplay;
  66. auth_in: PXauth;
  67. valuemask: culong;
  68. attributes: PXSecurityAuthorizationAttributes;
  69. auth_id_return: PXSecurityAuthorization): PXauth; cdecl; external libXext;
  70. function XSecurityRevokeAuthorization(
  71. dpy: PDisplay;
  72. auth_id: TXSecurityAuthorization): TStatus; cdecl; external libXext;
  73. implementation
  74. end.