home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sd386v50.zip / sd386src.zip / AFILE.H < prev    next >
Text File  |  1996-02-27  |  7KB  |  109 lines

  1. /*****************************************************************************/
  2. /* File:                                             IBM INTERNAL USE ONLY   */
  3. /*   afile.h                                                                 */
  4. /*                                                                           */
  5. /* Description:                                                              */
  6. /*                                                                           */
  7. /* In-Storage File Structure                                                 */
  8. /*                                                                           */
  9. /* There is one of these structures for each module in the ring of active    */
  10. /* modules.  They are created by the makefp and fakefp procedures.           */
  11. /*                                                                           */
  12. /* For each line in the file, there is an element in the offset vector that  */
  13. /* locates a (flags, text) sequence for that line.  The "source" field points*/
  14. /* to the first line (sequence) of the file.                                 */
  15. /*                                                                           */
  16. /* History:                                                                  */
  17. /*                                                                           */
  18. /*...Release 1.00 (Pre-release 1)                                            */
  19. /*...                                                                        */
  20. /*... 08/30/91  235   Joe       Cleanup/rewrite ascroll() to fix several bugs*/
  21. /*...                                                                        */
  22. /*...Release 1.00 (After pre-release 1.08)                                   */
  23. /*...                                                                        */
  24. /*... 02/12/92  521   Joe       Port to C-Set/2.                             */
  25. /*...                                                                        */
  26. /*                                                                           */
  27. /*****************************************************************************/
  28.  
  29.  
  30. typedef struct afile {
  31.     struct afile *next;
  32.     UINT   (* shower)(struct afile*,UCHAR*); /*  return type chg to uint. 521*/
  33.     DEBFILE *pdf;                 /* debug file for this afile               */
  34.     UINT     mid;                 /* module ID from the linker               */
  35.     UINT     mseg;                /* module selector for disassembly      827*/
  36.     UCHAR   *source;              /* start of source buffer for file         */
  37.     USHORT  *offtab;              /* pointer to table of line offsets     100*/
  38.     UINT     Tlines;              /* # of lines total in source file         */
  39.     UINT     Nlines;              /* # of lines in source buffer (1..N)      */
  40.     UINT     Nbias;               /* # of lines skipped in source file       */
  41.     UINT     topline;             /* Line number of top line (0..N) - Nbias  */
  42.     UINT     csrline;             /* Line number of cursor (0..N) - Nbias    */
  43.     UINT     hotline;             /* Line number of last find (0..N) - Nbias */
  44.     UINT     hotaddr;             /* Address of last find                    */
  45.     UINT     skipcols;            /* # of cols skiped on left (0..N)         */
  46.     UINT     Nshown;              /* # of lines shown on screen (1..N)       */
  47.     UINT     topoff;              /* top offset for ASM display              */
  48.     CSR      csr;                 /* current cursor data                  827*/
  49.     USHORT   flags;               /* state data                           235*/
  50.     UCHAR    sview;               /* view in mixed source/disasm mode        */
  51.                                   /* MIXEDN    1 multiple source lines.      */
  52.                                   /* NOSRC     2 no source at all.           */
  53.     struct
  54.     {
  55.       UINT   StartAddr;
  56.       int    StartLine;
  57.     } AsmView;
  58.  
  59.     int   sfi;                    /* source file index for this file.        */
  60.     UCHAR filename[1];            /* full path name of file                  */
  61. } AFILE;
  62.  
  63.  
  64. /*****************************************************************************/
  65. /* Values for the flags byte preceeding each line of text in file. The high  */
  66. /* order 4 bits MUST be zero in these flay bytes because the Decode routine  */
  67. /* uses this convention to detect the end of a line.                         */
  68. /*****************************************************************************/
  69. #define LINE_OK 0x01              /* segment offset known for this line      */
  70. #define LINE_BP 0x02              /* active breakpoint on this line          */
  71.  
  72. /*****************************************************************************/
  73. /* This macro defines the size of a new AFILE. The filename member           */
  74. /* is a length prefixed z-string. This is why you see an n+1 in              */
  75. /* the macro expansion.                                                      */
  76. /*****************************************************************************/
  77. #define SizeOfAFILE(n) (n+1+sizeof(AFILE))
  78.  
  79. /*****************************************************************************/
  80. /*         Predicate for determining if C soucre code is available.          */
  81. /*****************************************************************************/
  82.  
  83. #define ASMSRCVIEWS   2                 /*                                106*/
  84. #define MIXEDN        1                 /* multiple source lines.         106*/
  85. #define NOSRC         2                 /* no source at all.              106*/
  86.  
  87.  
  88. /*****************************************************************************/
  89. /* View flags.                                                            235*/
  90. /*****************************************************************************/
  91.  
  92. #define AF_ZOOM          0x0001     /* show the currently executing line  235*/
  93. #define AF_SYNC          0x0002     /* synchronize ASM and SOURCE views   235*/
  94. #define AF_HUGE          0x0004     /* compressed source exceeds 64K      235*/
  95. #define AF_FAKE          0x0008     /* fake name for module               235*/
  96. #define ASM_VIEW_NEW     0x0020     /* new assembler view.                235*/
  97. #define ASM_VIEW_REFRESH 0x0040     /* refresh of current view.           235*/
  98. #define ASM_VIEW_TOGGLE  0x0080     /* asm/source & asm/asm toggle.       235*/
  99. #define ASM_VIEW_CHANGE  0x0100     /* change views.                      235*/
  100. #define ASM_VIEW_NEXT    0x0200     /* next asm view.                     235*/
  101. #define ASM_VIEW_MNE     0x0400     /* change mnemonics.                  235*/
  102.  
  103. /*****************************************************************************/
  104. /* On a pagefp( fp,lno) we will have LINESBEFORE lines in the source buffer  */
  105. /* before the lno.                                                           */
  106. /*****************************************************************************/
  107.  
  108. #define LINESBEFORE 500
  109.