API Reference

type News_Server_Type , subtype Article_Type , procedure Null_Procedure , subtype News_Group_Tree , procedure Null_Procedure , function KeyOf , subtype Message_ID_Tree

 
   type News_Server_Type is new Server with private; 
 
   subtype Article_Type is Message; 
 
   procedure Null_Procedure (X : in out News_Group); 
 
   package News_Group_Structures is new ASCL.Net.Data_Structures 
     (Data_Type => News_Group, Deallocate => Null_Procedure); 
 
   package News_Group_Trees is new News_Group_Structures.Trees 
     (Key => Unbounded_String, KeyOf => Name, "<" => "<"); 
 
   package News_Group_Search_Trees is new 
     News_Group_Trees.Binary_Tree; 
   use News_Group_Search_Trees; 
 
   subtype News_Group_Tree is  News_Group_Search_Trees.Binary_Tree_Type; 
 
   procedure Null_Procedure (X : in out Message_Id); 
 
   function KeyOf (Object : in Message_Id) return Unbounded_String; 
 
   package Message_ID_Structures is new ASCL.Net.Data_Structures 
     (Data_Type => Message_Id, Deallocate => Null_Procedure); 
 
   package Message_ID_Trees is new Message_ID_Structures.Trees 
     (Key => Unbounded_String, KeyOf => KeyOf, "<" => "<"); 
 
   package Message_ID_Search_Trees is new 
     Message_Id_Trees.Binary_Tree; 
   use Message_ID_Search_Trees; 
 
   subtype Message_ID_Tree is Message_Id_Search_Trees.Binary_Tree_Type; 
 

procedure Open

   procedure Open (News_Server : in out News_Server_Type;  
                   Host_Name   : in     Unbounded_String; 
                   Port        : in     Port_Number); 
 

opens a connection to the specified news server, raises Server_In_Use if the newsserver is already connected.

procedure Open

   procedure Open (The_Server : in out News_Server_Type;  
                   Host_Name  : in     Unbounded_String); 

procedure Close

   procedure Close (NewsServer: in out News_Server_Type);  

function Host_Name

   function Host_Name (NewsServer : in News_Server_Type) return  
     Unbounded_String; 

function Current_Newsgroup

   function Current_Newsgroup (NewsServer : in News_Server_Type) return  
     Unbounded_String; 

Returns the current newsgroup name

procedure Article

   procedure Article (Message    :    out Article_Type;  
                      Server     : in     News_Server_Type'Class; 
                      Message_Id : in     String); 
 

procedure Article

   procedure Article (Message :    out Article_Type;  
                      Server  : in     News_Server_Type'Class; 
                      Number  : in     Integer                := 0); 

gets the specified article from the news server, if number is not specified then the current article is retrived.

the head command, from section 3.1

procedure Head

   procedure Head (Message    :    out Article_Type;  
                   Server     : in     News_Server_Type'Class; 
                   Message_Id : in     String); 
 

procedure Head

   procedure Head (Message :    out Article_Type;  
                   Server  : in     News_Server_Type'Class; 
                   Number  : in     Integer                := 0); 

gets the specified header from the news server, if number is not specified then the current header is retrived.

the body command, from section 3.1

procedure Get_Body

   procedure Get_Body (Message    : in out Article_Type;  
                       Server     : in     News_Server_Type'Class; 
                       Message_Id : in     String); 
 

procedure Get_Body

   procedure Get_Body (Message : in out Article_Type;  
                       Server  : in     News_Server_Type'Class; 
                       Number  : in     Integer                := 0); 

gets the specified body from the news server, if number is not specified then the current body is retrived.

the stat command, from section 3.1

procedure Stat

   procedure Stat (Server : in out News_Server_Type'Class;  
                   Number : in Integer); 

Sets the message pointer to the message with the specified number the Group command, from section 3.2

procedure Group

   procedure Group (Server    : in out News_server_Type;  
                    NewsGroup : in     String); 

sets the current group to Newsgroup the Last command, from section 3.5

procedure Last

   procedure Last (NewsServer : in out News_Server_Type;  
                   Number     :    out Integer; 
                   Id         :    out Message_Id); 

sets the current article pointer to the previous article the List command, from section 3.6

procedure List

   procedure List (NewsServer : in     News_Server_Type;  
                   Group_Tree : in out News_Group_Tree'Class); 

returns a binary search tree of all the newsgroups provided by the server the Newgroups command, from section 3.7

procedure NewGroups

   procedure NewGroups (NewsServer : in     News_Server_Type;  
                        Since      : in     Time; 
                        Tree       : in out News_Group_Tree'Class); 

returns a binary search tree of the new newsgroups created since the specified Time

The NewNews command, from section 3.8

procedure NewNews

   procedure NewNews (NewsServer : in     News_Server_Type;  
                      NewsGroups : in     String; 
                      Since      : in     Time; 
                      Id_Tree    : in out Message_Id_Tree'Class); 

returns a binary search tree of all the new news articles in the specified newsgroups.

The Next command, from section 3.9

procedure Next

   procedure Next (NewsServer : in     News_Server_Type'CLass;  
                   Number     :    out Integer; 
                   Id         :    out Message_Id); 

sets the current article to the next one. Number is the new articles number within the newsgroup, and Id is the unique message id. The Post command, from section 3.10

procedure Post

   procedure Post (Server  : in     News_Server_Type'CLass;  
                   Message : in out Article_Type);