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

⟦d65ddf68c⟧ Ada Source

    Length: 18432 (0x4800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Ncmvc_Server, seg_00de15

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 Cmvc;
with Ftp;
with Ftp_Name_Map;
with Ftp_Profile;
with Io;
with Rpc;
with Rpc_Server;
with String_Utilities;
with Transport_Interchange;
with Transport_Stream;
package body Ncmvc_Server is

    package Su renames String_Utilities;
    package Ti renames Transport_Interchange;

    Username : constant String := "ncmvc";
    Password : constant String := "sauerkraut";

    function Remote_To_Local
                (Remote_Name, Server_Context : String) return String is
    begin
        return  
           Ftp_Name_Map.Remote_To_Local (File_Name   => Remote_Name,
                                         Local_Roof  => Server_Context,
                                         Remote_Roof => "",
                                         Remote_Type => "unix");
    end Remote_To_Local;

    function Local_To_Remote
                (Local_Name, Remote_Context : String) return String is

        Ltr        : constant String  :=
           Ftp_Name_Map.Local_To_Remote (File_Name   => Local_Name,
                                         Local_Roof  => "",
                                         Remote_Roof => Remote_Context,
                                         Remote_Type => "unix");  
        Last_Slash : constant Natural :=
           Su.Reverse_Locate
              (Fragment => "/", Within => Ltr, Ignore_Case => True);

        Last_Underscore : constant Natural :=
           Su.Reverse_Locate
              (Fragment => "_", Within => Ltr, Ignore_Case => True);

        Has_Extension : constant Boolean   := Last_Slash < Last_Underscore;
        Remote_Name   : String (Ltr'Range) := Ltr;
    begin  
        if Has_Extension then
            -- Hello_C     is mapped to Hello.c
            -- Hello_World is mapped to Hello.World (which is bad)
            --[to be fixed]
            --
            Remote_Name (Last_Underscore)                     := '.';
            Remote_Name (Last_Slash .. Last_Underscore)       :=
               Su.Capitalize (Remote_Name (Last_Slash .. Last_Underscore));
            Remote_Name (Last_Underscore .. Remote_Name'Last) :=
               Su.Lower_Case (Remote_Name
                                 (Last_Underscore .. Remote_Name'Last));
        else
            -- Hello is mapped to Hello
            --
            Remote_Name (Last_Slash .. Remote_Name'Last) :=
               Su.Capitalize (Remote_Name (Last_Slash .. Remote_Name'Last));
        end if;

        Io.Echo_Line ("Local_to_remote: remote_name = " & Remote_Name);
        return Remote_Name;
    end Local_To_Remote;

    procedure Check_Out (Stream : Transport_Stream.Stream_Id;
                         Id     : Rpc.Transaction_Id) is separate;

    procedure Check_In (Stream : Transport_Stream.Stream_Id;
                        Id     : Rpc.Transaction_Id) is separate;

    procedure Make_Controlled (Stream : Transport_Stream.Stream_Id;
                               Id     : Rpc.Transaction_Id) is separate;

    procedure Make_Uncontrolled (Stream : Transport_Stream.Stream_Id;
                                 Id     : Rpc.Transaction_Id) is separate;

    procedure Show_History (Stream : Transport_Stream.Stream_Id;
                            Id     : Rpc.Transaction_Id) is separate;


    procedure Process_Call (Stream  : Transport_Stream.Stream_Id;
                            Id      : Rpc.Transaction_Id;
                            Version : Rpc.Version_Number;
                            Proc    : Rpc.Procedure_Number) is
    begin
        case Proc is
            when Ncmvc_Defs.Proc_Number.Check_Out =>
                Check_Out (Stream, Id);
            when Ncmvc_Defs.Proc_Number.Check_In =>
                Check_In (Stream, Id);
            when Ncmvc_Defs.Proc_Number.Make_Controlled =>
                Make_Controlled (Stream, Id);
            when Ncmvc_Defs.Proc_Number.Make_Uncontrolled =>
                Make_Uncontrolled (Stream, Id);
            when Ncmvc_Defs.Proc_Number.Show_History =>
                Show_History (Stream, Id);
            when others =>
                raise Rpc.No_Such_Procedure;
        end case;
    end Process_Call;

    procedure Serve_Gets is new Rpc_Server.Serve
                                   (Program => Ncmvc_Defs.Program,
                                    Supported => (0, Rpc.Version_Number'Last),
                                    Process_Call => Process_Call);


    procedure Serve (Connection : Transport.Connection_Id) is
    begin
        Serve_Gets (Connection);
    end Serve;


end Ncmvc_Server;

E3 Meta Data

    nblk1=11
    nid=6
    hdr6=c
        [0x00] rec0=22 rec1=00 rec2=01 rec3=014
        [0x01] rec0=00 rec1=00 rec2=08 rec3=010
        [0x02] rec0=15 rec1=00 rec2=09 rec3=052
        [0x03] rec0=17 rec1=00 rec2=0d rec3=022
        [0x04] rec0=16 rec1=00 rec2=05 rec3=00e
        [0x05] rec0=15 rec1=00 rec2=0e rec3=000
        [0x06] rec0=15 rec1=00 rec2=06 rec3=000
        [0x07] rec0=14 rec1=00 rec2=05 rec3=012
        [0x08] rec0=15 rec1=00 rec2=06 rec3=000
        [0x09] rec0=14 rec1=00 rec2=05 rec3=012
        [0x0a] rec0=15 rec1=00 rec2=06 rec3=000
        [0x0b] rec0=14 rec1=00 rec2=05 rec3=012
        [0x0c] rec0=15 rec1=00 rec2=06 rec3=000
        [0x0d] rec0=15 rec1=00 rec2=06 rec3=000
        [0x0e] rec0=15 rec1=00 rec2=06 rec3=000
        [0x0f] rec0=00 rec1=00 rec2=00 rec3=000
        [0x10] rec0=00 rec1=00 rec2=00 rec3=000
    tail 0x2170a9f34821a75b7260b 0x42a00088462063203
Free Block Chain:
  0x6: 0000  00 02 01 c2 80 0b 6f 63 65 73 73 5f 43 61 6c 6c  ┆      ocess_Call┆
  0x2: 0000  00 0a 00 30 80 24 6f 63 65 64 75 72 65 20 4d 61  ┆   0 $ocedure Ma┆
  0xa: 0000  00 04 03 fc 80 0f 2e 54 72 61 6e 73 66 65 72 5f  ┆      .Transfer_┆
  0x4: 0000  00 10 03 fc 80 3a 74 5f 4e 61 6d 65 20 20 20 20  ┆     :t_Name    ┆
  0x10: 0000  00 0f 00 f5 80 34 20 20 20 20 20 20 20 20 20 20  ┆     4          ┆
  0xf: 0000  00 03 00 e3 80 22 76 65 72 2e 42 65 67 69 6e 5f  ┆     "ver.Begin_┆
  0x3: 0000  00 0b 03 fc 80 1a 5f 4e 61 6d 65 20 3a 20 63 6f  ┆      _Name : co┆
  0xb: 0000  00 07 00 8f 80 48 20 20 20 20 20 20 20 20 20 20  ┆     H          ┆
  0x7: 0000  00 0c 03 fc 80 26 65 6d 6f 74 65 5f 54 79 70 65  ┆     &emote_Type┆
  0xc: 0000  00 11 03 fc 80 3f 20 20 20 20 20 20 20 20 20 20  ┆     ?          ┆
  0x11: 0000  00 00 02 69 80 06 75 6d 62 65 72 3b 06 00 3e 20  ┆   i  umber;  > ┆