%external %integer %function %spec Open Update(%integer s, %string(255) f)
%external %routine %spec Close Update
%external %routine %spec Flush Output
%external %routine %spec Abandon Output

@16_1114 %routine Signal(%integer Sig Code)

%external %integer %function %spec Current Host
%external %routine %spec Select Host(%integer token)
%external %integer %function %spec Connect to Host(%string(255) GDir)
%external %routine %spec Disconnect Host(%integer Token)
%external %string (255) %function %spec Filestore Name (%integer n)

%external %predicate %spec Open News File(%string(255) name, %integer mode)
%external %predicate %spec Create News File(%string(255) name)
%external %integer %function %spec Move to Message (%integer %name n,   %c
                                                    %integer succ)
%external %predicate %spec Post(%string (255) File, Topic)
%external %routine %spec Cancel Message(%string (255) %name Topic, %integer n)
%external %routine %spec Log Message(%integer length)
%external %routine %spec Close News File
%external %routine %spec Set User

%external %string (12) %spec News Server
%constant %string News Directory = "NEWS:"
%constant %integer News Stream = 1,
                   Seen Stream = 2

%external %string (80) %spec User Name, 
                             Full Name, 
                             First Name,
                             Mail Address

%external %integer %spec Home Host
%external %integer %spec News Host

%external %integer %spec Last Message
%external %integer %spec File Length

%record %format Index fm (%short Number, %c
                          %half  Length, %c
                          %integer Position)

%constant %integer Blocksize = 512 
%constant %integer Entrysize = 8       { size of one Index fm }
%constant %integer Entries = Blocksize // Entrysize

%record %format Range fm (%short From, To,
                          %record (Range fm) %name Next)

%record %format Seen fm (%string (255) Topic,
                         %byte Subscribed,
                         %record (Range fm) %name Ranges,
                         %record (Seen fm) %name Last, 
                                                 Next)

%constant %integer No = 0,
                   Yes = 1,
                   Forwards = 1,
                   Backwards = -1

%constant %integer Total Abort = 14

%constant %string Seen File Name = "News.Seen"
%external %record (Seen fm) %map %spec Read Seen File (%string (255) File Name)


%external %routine %spec Write Seen File (%string (255) File Name,
                                          %record (Seen fm) %name F)

%record %format Topic fm (%string (255) Topic,
                          %record (Topic fm) %name Last,
                                                   Next)
%external %record (Topic fm) %map %spec Read Topics

%dynamic %integer %function %spec Edit %alias "NEWS_EDIT" -
                                       (%string (255) In, Other, Out,
                                        %integer X, Y)

%external %routine %spec Display File (%integer Start, Top, Bottom, Amount, Wait)
%external %routine %spec Safe Put Symbol (%integer Ch)
