DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦20dd0fd3e⟧ Ada Source

    Length: 11264 (0x2c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Xlbp_Sync, seg_004f8b

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with Xlbt_Arithmetic;  
use Xlbt_Arithmetic;  
with Xlbt_Basic;  
use Xlbt_Basic;  
with Xlbt_Display2;  
use Xlbt_Display2;  
with Xlbt_Proc_Var;  
use Xlbt_Proc_Var;  
with Xlbt_Reply;  
use Xlbt_Reply;  
with Xlbt_Request;  
use Xlbt_Request;

with Xlbp_Proc_Var;  
use Xlbp_Proc_Var;

with Xlbit_Library4;  
use Xlbit_Library4;

with Xlbip_Get_Reply;  
use Xlbip_Get_Reply;  
with Xlbip_Internal;  
use Xlbip_Internal;  
with Xlbip_Put_Request;  
use Xlbip_Put_Request;

with Xlbmt_Network_Types;  
use Xlbmt_Network_Types;  
with Xlbmt_Parameters;  
use Xlbmt_Parameters;

package body Xlbp_Sync is
------------------------------------------------------------------------------
-- X Library Synchronize
--
-- Xlbp_Sync - Error detection server synchronization.
------------------------------------------------------------------------------
-- 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.
------------------------------------------------------------------------------
-- ****************************************************************************
-- * Date      - /Name/ Comment
-- *
-- *  7-NOV-90 - /GEB/ Implement the new multitasking protection scheme for
-- *           -  library state.
-- ****************************************************************************

--\x0c
    procedure X_Sync (Display : X_Display;  
                      Discard : Boolean) is
------------------------------------------------------------------------------
-- Like X_Flush but in addition it waits until all events and errors resulting
-- from the flushed requests (or requests prior to the flushed events) have
-- returned from the server.  Discard tells us whether to discard all events
-- or not.  Error events are always passed to the X_Error routine.
------------------------------------------------------------------------------
        Reprec : X_Reply_Contents;  
        Void   : X_Status;  
    begin

----Lock the display.

        Lock_Display (Display);  
        begin

----Send the request.

            Put_X_Get_Input_Focus_Request  
               (Display, (Kind   => Get_Input_Focus,  
                          Length => X_Get_Input_Focus_Request'Size / 32,  
                          Pad    => 0));

----Get the reply (and ignore it).

            Get_Reply (Display => Display,  
                       Code    => Get_Input_Focus,  
                       Reply   => Reprec,  
                       Extra   => 0,  
                       Discard => True,  
                       Status  => Void);

----Discard all pending events (if requested).

            if Discard and then Display.Head /= null then  
                declare  
                    Ev : X_Queued_Event;  
                begin  
                    while Display.Head /= None_X_Queued_Event loop  
                        Ev           := Display.Head;  
                        Display.Head := Ev.Next;  
                        if Display.Q_Free_Len >= X_Max_Q_Free then  
                            Free_X_Queued_Event (Ev);  
                        else  
                            Ev.Next            := Display.Q_Free;  
                            Display.Q_Free     := Ev;  
                            Display.Q_Free_Len := Display.Q_Free_Len + 1;  
                        end if;  
                    end loop;  
                end;  
                Display.Head  := null;  
                Display.Tail  := null;  
                Display.Q_Len := 0;  
            end if;

----Catch unexpected exceptions and unlock the display before passing them on.

        exception  
            when others =>  
                Unlock_Display (Display);  
                raise;  
        end;

----Unlock the display and return.

        Unlock_Display (Display);

    end X_Sync;

--\x0c
    procedure Private_X_Sync_Function (Display : X_Display) is
------------------------------------------------------------------------------
-- Default X_Synchandler_Pv value for all displays.
------------------------------------------------------------------------------
    begin  
        X_Sync (Display, Discard => False);  
    end Private_X_Sync_Function;

    function Default_X_Sync_Function_Type is  
       new Proc_Var_X_Synchandler.Value (Private_X_Sync_Function);

--\x0c
    function X_Synchronize (Display : X_Display;  
                            Onoff   : Boolean)  
                           return Proc_Var_X_Synchandler.Pv is
------------------------------------------------------------------------------
--  Turns the usage of the X_Set_After_Function on and off.
------------------------------------------------------------------------------
        Temp : Proc_Var_X_Synchandler.Pv;  
    begin

----Lock the display against meddling.

        Lock_Display (Display);

----Make the swap.

        Temp := Proc_Var_X_Synchandler.To_Pv (Display.Synchandler);  
        if Onoff then  
            Display.Synchandler := X_Lib_Default_X_Sync_Function;  
        else  
            Display.Synchandler := None_X_Procedure_Variable;
            -- None_X_Synchandler_Type
        end if;

----Unlock the display and return our old value.

        Unlock_Display (Display);  
        return Temp;

    end X_Synchronize;

--\x0c
    function X_Set_After_Function (Display : X_Display;  
                                   Funct   : Proc_Var_X_Synchandler.Pv)  
                                  return Proc_Var_X_Synchandler.Pv is
------------------------------------------------------------------------------
-- Set the function that will be called after each and every server request
-- is queued.  The previous "after" function is returned.
------------------------------------------------------------------------------
        use Proc_Var_X_Synchandler;  
        Temp : Proc_Var_X_Synchandler.Pv;  
    begin

        Lock_Display (Display);  
        Temp := Proc_Var_X_Synchandler.To_Pv (Display.Synchandler);  
        Display.Synchandler := Proc_Var_X_Synchandler.From_Pv (Funct);  
        Unlock_Display (Display);  
        return Temp;

    end X_Set_After_Function;

--\x0c
begin

    X_Lib_Default_X_Sync_Function :=  
       Proc_Var_X_Synchandler.From_Pv (Default_X_Sync_Function_Type);

end Xlbp_Sync;  

E3 Meta Data

    nblk1=a
    nid=0
    hdr6=14
        [0x00] rec0=28 rec1=00 rec2=01 rec3=03c
        [0x01] rec0=11 rec1=00 rec2=02 rec3=044
        [0x02] rec0=12 rec1=00 rec2=03 rec3=072
        [0x03] rec0=20 rec1=00 rec2=04 rec3=052
        [0x04] rec0=00 rec1=00 rec2=0a rec3=004
        [0x05] rec0=19 rec1=00 rec2=05 rec3=044
        [0x06] rec0=02 rec1=00 rec2=09 rec3=02e
        [0x07] rec0=1a rec1=00 rec2=06 rec3=018
        [0x08] rec0=1c rec1=00 rec2=07 rec3=044
        [0x09] rec0=14 rec1=00 rec2=08 rec3=000
    tail 0x217006f9081978368f129 0x42a00088462063203