
 February 23rd, 2005 - Rev 5


 The "zbar.dat" file internal structure:       (1) means note 1, etc.
Ŀ
                                                                     
    Binary sequence #  (incremented every new pamphlet issued)      
                                                                    
           ZTree:  @  New filename in pamphlet                     
            Cmd    w  Screen status change (same filename)         
            (5)    ^  Shift/Ctrl-key entry                         
                   ~  Shift/Ctrl/Alt-key entry                     
                   Q  Ztree quitting                               
                   h  Hold pre-command                             
                   y  AA pre-command                               
                   Y  AA command       Checksum  (1)              
                                                                  
             Full path                 Copy of sequence #       
                           NULL                                
    ÿ                                ÿÿ                        
    AAxxxx--@-DC:\ztw\test.txt*entryline*CSAA                        
      Ĵ                                                     
          Page (D or F)           NULL                        
                                                                
                           Entered by ZTree "Y" command user.   
    ZTreeٳ                                                        
   window  Cmd Char:  01h-FFh               (6)                   
   handle              s - simple Y command  (2)                   
    (7)                t - Ctrl-Y command    (2)                   
                                                                   
          Z screen status  (8)                                     
                                                                    
          Return flag from AA:   k  simple OK for handshake  (3)    
           ZTree sets             t  tag the file             (3)    
           this character         u  untag the file           (3)    
           to a hyphen            e  file operation error  (3)(4)    
                                  s  command syntax error  (3)(4)    
                                                                     


 Notes:

 (1) Checksums are generated using R16 (Rotate-16bit) type.
     Description:
       Start
       CS word to null.
       Pointer to beginning of string (sequence #)
       Loop: (until 2nd null is processed)
         Rotate left CS 1 bit
         Add the character from string to CS (w/MSB=0)
         Increment pointer
       End loop

 (2) When a Y or Ctrl-Y command is issued, ZTree informs the AA
      if it was a simple Y or a tagged Ctrl-Y operation by
      means of this flag: "s" for Y, "t" for Ctrl-Y.

 (3) When an Y or Ctrl-Y command is issued, the corresponding
      application must respond with a return flag.
      This flag is the 7th character in the string and can receive
      a few values as response.  See above.
     ZTree will wait indefinitely for an response from the AA
      when issuing a Y or Ctrl-Y command, but can be interrupted
      by hitting the Esc key.

 (4) If the return flag from a Y or Ctrl-Y command is an error
      (either "e" or "s"), the AA should store a message into the
      "entry line" position of the zbar.dat structure.  The length
      of such error messages should be kept under 73 characters
      to avoid truncation.
     The final NULL, the new checksum and a copy of the sequence
      number have to be refreshed by the AA before writing to
      the file.
     If the format violates the zbar.dat structure rules or the
      checksum doesn't match, ZTree will not display the error
      message in its lower lines.

 (5) When ZTree starts, the standard "@" is used.
     When a keyboard command is issued, the "^" is used for the
      Sh/Ctrl-X commands and "~" for the Sh/Ctrl/Alt-X ones.
     When ZTree quits, "Q" is used as a command.
     When the user enters Y cmd, ZTree uses a "y" pre-command
      while waiting for the user to finish the entry and "Y"
      command when the entry is finished.
     When the user enters a C or M command, ZTree puts an
      "h" pre-command to instruct the AA to stop any work with
      the current file.
     When the filename under the bar changes, ZTree updates
      the path and uses an "@" as command.
     When the screen changes format and the filename is the same,
      ZTree changes the status and uses "w" as command.

 (6) Codes generated with the Sh/Ctrl or Sh/Ctrl/Alt keys.
      See the SCKeys.kbd for a list of keyboard codes available.

 (7) ZTree window handle of the instance that last wrote to the
      pamphlet. Value is X86 standard little endian dword.

 (8) Ztree screen status informs the AAs what type of screen
      is being used in Z so they can adjust their owns.
         n - Normal screen is in use.
         l - Left pane is active in split-view.
         r - Right pane is active in split-view.
         7 - Auto-view is in use.
         v - Internal Viewer is in use (in standard mode)
         x - Execute screen is in use.
         m - Menu screen is in use.
	 s - Statistics screen is in use.
