home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / Tools / nShell™ 1.0.3 / src / Tech Notes / TN 3 - Transcript File Format < prev   
Encoding:
Text File  |  1994-09-06  |  2.0 KB  |  68 lines  |  [TEXT/ttxt]

  1. ===========================================================================
  2.  
  3. Number 3 - Transcript File Format
  4.  
  5. Revisions:    Sept. 6, 1994
  6.  
  7. nShell(tm) Technical Note
  8.  
  9. ===========================================================================
  10.  
  11. Shell transcripts may be saved to disk using the "Save" or "Save As..." options of the "File" menu.  This Technical Note documents the format of such transcript files.
  12.  
  13. Type and Creator
  14. ================
  15.  
  16. The Type for a transcript file is "NSHS" and its Creator is "NSHA".
  17.  
  18. General Format
  19. ==============
  20.  
  21. All information is stored within the data fork of the file. The general structure for a transcript file is:
  22.  
  23.  position  data
  24.  --------  ----
  25.     0      four byte FILE_VERSION
  26.     4      file header record (format determined by file version)
  27.     .      data (as specified by header record)
  28.     .      data (as specified by header record)
  29.  
  30. File Version
  31. ============
  32.  
  33. The FILE_VERSION is used to identify a specific version of the shell transcript file.  An ascii-long is used to make a better signature.  The current revision level is:
  34.  
  35. #define FILE_VERSION '0000'
  36.  
  37. File Header Record
  38. ==================
  39.  
  40. The file header record is written into the transcript file following the file version.  The format of this record will change with FILE_VERSION.  For version '0000', the file header is defined as:
  41.  
  42.  typedef struct {
  43.  
  44.   long  text_start;    // file position of historical text
  45.   long  text_count;    // size of historical text (in chars)
  46.   long  vars_start;    // file position of first variable record
  47.   long  vars_count;    // number of variable records
  48.  
  49.  } t_file_header;
  50.  
  51. Text Data
  52. =========
  53.  
  54. The text portion of the transcript is stored as an unformatted string of characters.  Starting at "text_start", "text_count" of these characters are written into the transcript file.
  55.  
  56. Variable Data
  57. =============
  58.  
  59. The structure used to hold variables is shown below.  Starting at "vars_start", "vars_count" of these records are written into the transcript file.
  60.  
  61.  typedef struct {
  62.  
  63.   Str32  name;
  64.   Str255 value;
  65.  
  66.  } t_file_variable;
  67.  
  68.