 Ŀ
   $$$$$$$  $$$$$   $$$$$$$$$$      $$$$$$$$$    Ŀ   
   $.%%%%$$ $%%%$  $%%%%%%%%%.$    $%%%%%%%.$$    NEW PACKET GENERATION    
   $%%%%%%$$$%%%$  $%%%%%%%%%%$   $%%%%%%%%%.$        Version 1.02         
   $%%%$%%%$$%%%$  $%%%$$$$$%%$  $%%%$$$$$%%%$                             
   $%%%$$%%%$%%%$  $%%%$   $%%$  $%%%$   $$$$$       (C) 1996-1998         
   $%%%$$$%%.%%%$  $%%%$$$$$%%$  $%%%$                     by              
   $%%%$ $$%%%%%$  $%%%%%%%%%%$  $%%%$  $$$$          the NPG-Team         
   $%%%$  $$%%%%$  $%%%$$$$$$$   $%%%$ $%%%%$                              
   $%%%$   $$%%%$  $%%%$         $%%%$  $$%%$              a               
   $%%%$    $%%%$  $%%%$         $%%%$$$$.%%$         sub-division         
   $%%%$    $%%%$  $%%%$         $%%%%%%%%%%$              of              
   $%%%$    $%%%$  $%%%$          $%%%%%%%%'$      Radiation Software      
   $$$$$    $$$$$  $$$$            $$$$$CGS$                               
                                                    
 

  This file contains information on how to program RUN-applications for NPG
  The examples which are included are written in PASCAL. I'm not very good
  in C/C++, but I'll try to add some C/C++ examples aswell in the near
  future.

  When a RUN-application is executed by NPG it will given a few parameters
  These parameters are described below.

    Parameter number      Function                     Example/Possibilities 

           0                Exe-filename from the        RTT.EXE
                            RUN-program  

           1                MyCall + SSID                NL1CGS-0

           2                UserCall + SSID              NL1BAR-15

           3                User Level                   0..9,
                                                         255=sysop

           4                Times Executed               0..255

           5                Channel                      0..20

           6                Info Byte                    0 = User Parameters
                                                         1 = Connection
                                                         2 = Disconnection

           7                Address of parameters        12345:34321
                                                         (only if info  )
                                                         (is equal zero )
                                                         Structure:FrameBlock
                                                            

   Parameter 7 contains the address of the original parameters submitted
   by the user to the run program.


   Also the way a run-program is exited is very important.
   We have used the following EXIT-codes:

            0 - Stop program, no output

            1 - Stop program, TNC-Commands in USERS.NPT
                              USER-Text in USERS.NPU
                First handle TNC-Commands and then User-text.

            2 - Stop program, TNC-Commands in USERS.NPT
                              USER-Text in USERS.NPU
                First handle USER-Text en then TNC-Commands.

            3 - Increase "Times Executed" by 1, No output.
                Program will be executed again next time.

            4 - Increase "Times Executed" by 1.
                TNC-Commands in USERS.NPT
                USER-Text in USERS.NPU
                First handle TNC-Commands and then User-text.
                Program will be executed again next time.

            5 - Increase "Times Executed" by 1.
                TNC-Commands in USERS.NPT
                USER-Text in USERS.NPU
                First handle USER-Tekst and then TNC-Commands.
                Program will be executed again next time.


   USERDATA.NPG
   

    In this file all user-data is stored. The construction of
	this file is described below.

    
      UserData     = Record
                       UserCall    : String [ 9];
                       UserName    : String [20];
                       NoC         : LongInt;
                       Level       : Byte;
                       LastCon     : DateTime;
                       NewCon      : DateTime;
                       Ctext       : String[80];
                     End;

      DateTime     = Record
                       Year,Month,Day,
                       Hour,Min,Sec: Word;
                     End;
    

       UserCall  - Callsign of user
       UserName  - Name of user
       NoC       - Number of Connections
       Level     - User Level (1-9, 0 = reject)
       LastCon   - Last made connection
       NewCon    - Active connection info
       Ctext     - Personal connect-text for user


   User Information Interrupt (Default Int 102)
   

   It's possible to request more information from NPG
   by using an interrupt. 102 (66h) is the standard interrupt
   that is used.
   

   This interrupt contains the following functions:


    Function:  Ah = 0
    
     Description  : NPG Version number
     Output       : Ah = High version number
                    Al = Low verion number (after the dot).


    Function:  Ah = 1
    
     Description  : Request channel info       
     Output       : Pointer to a record      
                     Es = Segment Channel_Rec
                     Bx = Offset Channel_Rec (for more information
                                              look further is this doc
                                              for CHANNEL_REC)


    Function:  Ah = 2
    
     Description  : Request active sysop channel
     Output       : Al = Active channel


    Function:  Ah = 3
    
     Description  : Request Number of channels
     Output       : Al = Number of channels


    Function:  Ah = 4
    
     Description  : Request Monitor Heard list
     Output       : Pointer to an array with calls which are heard
                    last. (see MHeard_rec for structure)
                     Es = Segment MHeard
                     Bx = Offset MHeard


   Channel_Rec
   
      Channel_Rec  = Record
                       UserCall    : String [ 9]; {User Callsign         }
                       MyCall      : String [ 9]; {Sysop Callsign        }
                       DefProg     : String [12]; {Default Program       }
                       CurProg     : String [12]; {Current Program       }
                       ExecLevel   : Byte;        {Execution Level       }
                       ConnectMode : Byte;        {0 = disconnected      }
                                                  {1 = incoming connect  }
                                                  {2 = outgoing connect  }
                       Hours,
                       Mins,
                       Secs        : Word;        {Connection Time       }
                       initcall   : String [9];   {Initialization mycall }
                     End;


   FrameBlock (parameter 7)
   
      FrameBlock    = Record
                        FrameLength : Word;
                        Buffer      : Array [0..255] Of Byte;
                      End;


   TncRec (USERS.NPT)
   
      TncRec       = Record
                       Channel     : Byte;
                       TncCommand  : String [80];
                     End;


   UserRec (USERS.NPU)
   
      UserRec      = Record
                       Channel     : Byte; {Destination channel}
                       Mode        : Byte;
                            { 0 = Send UserText as File                       }
                            { 1 = Send UserText as File + Erase it afterwards }
                            { 2 = Send UserText as normal text                }
                            { 3 = Send Frame block as text (see FrameBlock)   }
                       UserText    : String [80]; {Text/File to send}
                     End;


   MHeard_Rec
   
      MHeardRec    = Record
                       Call : String [9]; {Callsign}
                       Time : Longint;    {Packed DateTime}
                     End;

