|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 16384 (0x4000)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Xlbp_Host, seg_004f6d
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦this⟧
with Xlbt_Arithmetic;
use Xlbt_Arithmetic;
with Xlbt_Basic;
use Xlbt_Basic;
with Xlbt_Host;
use Xlbt_Host;
with Xlbt_Misc;
use Xlbt_Misc;
with Xlbt_Reply;
use Xlbt_Reply;
with Xlbt_Request;
use Xlbt_Request;
with Xlbt_String;
use Xlbt_String;
with Xlbip_Get_Reply;
use Xlbip_Get_Reply;
with Xlbip_Internal;
use Xlbip_Internal;
with Xlbip_Put_Request;
use Xlbip_Put_Request;
package body Xlbp_Host is
------------------------------------------------------------------------------
-- X Library Host Access Control
--
-- Xlbp_Host - Control access to the X server on a host-name basis.
------------------------------------------------------------------------------
-- Copyright 1989 - 1991 by Rational, Santa Clara, California.
-- Copyright 1985 - 1989 by the Massachusetts Institute of Technology
--
-- All Rights Reserved.
--
-- Permission to use, copy, modify, and distribute this software and its
-- documentation for any purpose and without fee is hereby granted,
-- provided that the above copyright notice(s) appear in all copies and that
-- both that copyright notice(s) and this permission notice appear in
-- supporting documentation, and that the names of MIT or Rational not be
-- used in advertising or publicity pertaining to distribution of the software
-- without specific, written prior permission.
--
-- MIT and Rational disclaim all warranties with regard to this software,
-- including all implied warranties of merchantability and fitness, in no
-- event shall MIT or Rational be liable for any special, indirect or
-- consequential damages or any damages whatsoever resulting from loss of use,
-- data or profits, whether in an action of contract, negligence or other
-- tortious action, arising out of or in connection with the use or performance
-- of this software.
------------------------------------------------------------------------------
--\x0c
procedure X_Add_Host (Display : X_Display;
Host : X_Host_Address) is
------------------------------------------------------------------------------
-- X_Add_Host
------------------------------------------------------------------------------
Host_Address_String : constant X_String := Host.Address.all;
Host_Address_Length : S_Natural := Host_Address_String'Length;
Extra_Words : U_Short := U_Short (Host_Address_Length + 3) / 4 * 4;
begin
----Lock the display.
Lock_Display (Display);
begin
----Send the request; the address string follows it.
Put_X_Change_Hosts_Request
(Display, (Kind => Change_Hosts,
Length => X_Change_Hosts_Request'Size / 32
+ Extra_Words,
Pad => 0,
Mode => Host_Insert,
Host_Family => Host.Family,
Host_Length => U_Short (Host_Address_Length)),
Host_Address_Length);
Put_X_String (Display, Host_Address_String);
----Catch unexpected exceptions.
exception
when others =>
Unlock_Display (Display);
raise;
end;
----Unlock the display and sync up.
Unlock_Display (Display);
Sync_Handle (Display);
end X_Add_Host;
--\x0c
procedure X_Add_Hosts (Display : X_Display;
Hosts : X_Host_Address_Array) is
------------------------------------------------------------------------------
-- Add each of the hosts is a list of hosts.
------------------------------------------------------------------------------
begin
for I in Hosts'Range loop
X_Add_Host (Display, Hosts (I));
end loop;
end X_Add_Hosts;
--\x0c
function X_List_Hosts (Display : X_Display) return X_Host_List is
------------------------------------------------------------------------------
-- Obtain a list of valid hosts from the server.
------------------------------------------------------------------------------
Reply : X_Reply_Contents;
Host : X_Wire_Host_Reply;
Succ : X_Status;
begin
----Lock the display.
Lock_Display (Display);
begin
----Send the request for a list of hosts.
Put_X_List_Hosts_Request
(Display, (Kind => List_Hosts,
Length => X_List_Hosts_Request'Size / 32,
Pad => 0));
----Get the reply header.
Get_Reply (Display => Display,
Code => List_Hosts,
Reply => Reply,
Extra => 0,
Discard => False,
Status => Succ);
----If we failed to get a reply then return as if there were no hosts.
if Succ = Failed then
Unlock_Display (Display);
Sync_Handle (Display);
return None_X_Host_List;
end if;
----If we succeeded but there are no hosts then return an empty list.
if Reply.List_Hosts.N_Hosts = 0 then
Unlock_Display (Display);
Sync_Handle (Display);
return None_X_Host_List;
end if;
----Allocate a new array to hold the info.
declare
Outbuf : X_Host_List;
begin
Outbuf.Enabled := To_Boolean (Reply.List_Hosts.Enabled);
----Read each of the host addresses.
Outbuf.List := new X_Host_Address_Array
(1 .. S_Natural
(Reply.List_Hosts.N_Hosts));
for Op in 1 .. S_Natural (Reply.List_Hosts.N_Hosts) loop
Get_X_Wire_Host_Reply (Display, Host);
Outbuf.List (Op) :=
(Family => Host.Family,
Address => new X_String
(1 .. S_Natural (Host.Name_Length)));
Get_X_String (Display, Outbuf.List (Op).Address.all);
end loop;
Unlock_Display (Display);
Sync_Handle (Display);
return Outbuf;
exception
when others =>
Free_X_Host_List (Outbuf);
raise;
end;
----Catch unexpected exceptions before passing them on.
exception
when others =>
Unlock_Display (Display);
raise;
end;
end X_List_Hosts;
--\x0c
procedure X_Remove_Host (Display : X_Display;
Host : X_Host_Address) is
------------------------------------------------------------------------------
-- X_Remove_Host
------------------------------------------------------------------------------
Host_Address_String : constant X_String := Host.Address.all;
Host_Address_Length : S_Natural := Host_Address_String'Length;
Extra_Words : U_Short := U_Short (Host_Address_Length + 3) / 4 * 4;
begin
----Lock the display.
Lock_Display (Display);
begin
----Send the request; the address follows it.
Put_X_Change_Hosts_Request
(Display, (Kind => Change_Hosts,
Length => X_Change_Hosts_Request'Size / 32
+ Extra_Words,
Pad => 0,
Mode => Host_Delete,
Host_Family => Host.Family,
Host_Length => U_Short (Host_Address_Length)),
Host_Address_Length);
Put_X_String (Display, Host_Address_String);
----Catch unexpected exceptions.
exception
when others =>
Unlock_Display (Display);
raise;
end;
----Unlock the display and sync up.
Unlock_Display (Display);
Sync_Handle (Display);
end X_Remove_Host;
--\x0c
procedure X_Remove_Hosts (Display : X_Display;
Hosts : X_Host_Address_Array) is
------------------------------------------------------------------------------
-- Remove each of the hosts is a list of hosts.
------------------------------------------------------------------------------
begin
for I in Hosts'Range loop
X_Remove_Host (Display, Hosts (I));
end loop;
end X_Remove_Hosts;
--\x0c
procedure X_Disable_Access_Control (Display : X_Display) is
begin
X_Set_Access_Control (Display, Disable_Access);
end X_Disable_Access_Control;
--\x0c
procedure X_Enable_Access_Control (Display : X_Display) is
begin
X_Set_Access_Control (Display, Enable_Access);
end X_Enable_Access_Control;
--\x0c
procedure X_Set_Access_Control (Display : X_Display;
Mode : X_Change_Access) is
begin
----Lock up the display.
Lock_Display (Display);
begin
----Send the request.
Put_X_Set_Access_Control_Request
(Display, (Kind => Set_Access_Control,
Length => X_Set_Access_Control_Request'Size / 32,
Mode => Mode));
----Catch unexpected exceptions.
exception
when others =>
Unlock_Display (Display);
raise;
end;
----Unlock the display and call the Synchandler.
Unlock_Display (Display);
Sync_Handle (Display);
end X_Set_Access_Control;
--\x0c
procedure X_Kill_Client (Display : X_Display;
Resource : X_Id) is
------------------------------------------------------------------------------
-- X_Kill_Client
------------------------------------------------------------------------------
begin
----Lock the display.
Lock_Display (Display);
begin
----Send the request.
Put_X_Kill_Client_Request
(Display, (Kind => Kill_Client,
Length => X_Kill_Client_Request'Size / 32,
Pad => 0,
Id => Resource));
----Catch unexpected exceptions.
exception
when others =>
Unlock_Display (Display);
raise;
end;
----Unlock the display; sync up; and return.
Unlock_Display (Display);
Sync_Handle (Display);
end X_Kill_Client;
--\x0c
procedure X_Set_Close_Down_Mode (Display : X_Display;
Mode : X_Close_Down_Mode) is
------------------------------------------------------------------------------
-- X_Set_Close_Down_Mode
------------------------------------------------------------------------------
begin
----Lock the display.
Lock_Display (Display);
begin
----Send the request.
Put_X_Set_Close_Down_Mode_Request
(Display, (Kind => Set_Close_Down_Mode,
Length => X_Set_Close_Down_Mode_Request'Size / 32,
Mode => Mode));
----Catch unexpected exceptions.
exception
when others =>
Unlock_Display (Display);
raise;
end;
----Unlock; sync up; and return.
Unlock_Display (Display);
Sync_Handle (Display);
end X_Set_Close_Down_Mode;
--\x0c
procedure X_Add_To_Save_Set (Display : X_Display;
Window : X_Window) is
begin
X_Change_Save_Set (Display, Window, Set_Mode_Insert);
end X_Add_To_Save_Set;
--\x0c
procedure X_Change_Save_Set (Display : X_Display;
Window : X_Window;
Mode : X_Change_Save_Set_Mode) is
begin
----Lock the display.
Lock_Display (Display);
begin
Put_X_Change_Save_Set_Request
(Display, (Kind => Change_Save_Set,
Length => X_Change_Save_Set_Request'Size / 32,
Mode => Mode,
Window => Window));
----Catch unexpected exceptions.
exception
when others =>
Unlock_Display (Display);
raise;
end;
----Unlock the display; sync up; and return.
Unlock_Display (Display);
Sync_Handle (Display);
end X_Change_Save_Set;
--\x0c
procedure X_Remove_From_Save_Set (Display : X_Display;
Window : X_Window) is
begin
X_Change_Save_Set (Display, Window, Set_Mode_Delete);
end X_Remove_From_Save_Set;
--\x0c
end Xlbp_Host;
nblk1=f
nid=0
hdr6=1e
[0x00] rec0=23 rec1=00 rec2=01 rec3=088
[0x01] rec0=12 rec1=00 rec2=02 rec3=004
[0x02] rec0=16 rec1=00 rec2=03 rec3=06e
[0x03] rec0=20 rec1=00 rec2=04 rec3=000
[0x04] rec0=1f rec1=00 rec2=05 rec3=030
[0x05] rec0=00 rec1=00 rec2=0f rec3=004
[0x06] rec0=1e rec1=00 rec2=06 rec3=024
[0x07] rec0=17 rec1=00 rec2=07 rec3=030
[0x08] rec0=1c rec1=00 rec2=08 rec3=006
[0x09] rec0=1e rec1=00 rec2=09 rec3=00a
[0x0a] rec0=24 rec1=00 rec2=0a rec3=00e
[0x0b] rec0=23 rec1=00 rec2=0b rec3=000
[0x0c] rec0=22 rec1=00 rec2=0c rec3=038
[0x0d] rec0=24 rec1=00 rec2=0d rec3=00e
[0x0e] rec0=1b rec1=00 rec2=0e rec3=000
tail 0x217006d1681978293113c 0x42a00088462063203