home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / comal3-2.dms / in.adf / ModuleDev / Comal.i < prev    next >
Encoding:
Text File  |  1993-04-10  |  5.6 KB  |  173 lines

  1.     IFND    EXEC_TYPES_I
  2.  
  3. **
  4. ** Structure Building Macros
  5. **
  6. STRUCTURE   MACRO                    ; structure name, initial offset
  7. \1            EQU     0
  8. SOFFSET     SET     \2
  9.               ENDM
  10.  
  11. FPTR          MACRO                    ; function pointer (32 bits - all bits valid)
  12. \1            EQU     SOFFSET
  13. SOFFSET     SET     SOFFSET+4
  14.               ENDM
  15.  
  16. BOOL          MACRO                    ; boolean (16 bits)
  17. \1            EQU     SOFFSET
  18. SOFFSET     SET     SOFFSET+2
  19.               ENDM
  20.  
  21. BYTE          MACRO                    ; byte (8 bits)
  22. \1            EQU     SOFFSET
  23. SOFFSET     SET     SOFFSET+1
  24.               ENDM
  25.  
  26. UBYTE          MACRO                    ; unsigned byte (8 bits)
  27. \1            EQU     SOFFSET
  28. SOFFSET     SET     SOFFSET+1
  29.               ENDM
  30.  
  31. WORD          MACRO                    ; word (16 bits)
  32. \1            EQU     SOFFSET
  33. SOFFSET     SET     SOFFSET+2
  34.               ENDM
  35.  
  36. UWORD          MACRO                    ; unsigned word (16 bits)
  37. \1            EQU     SOFFSET
  38. SOFFSET     SET     SOFFSET+2
  39.               ENDM
  40.  
  41. LONG          MACRO                    ; long (32 bits)
  42. \1            EQU     SOFFSET
  43. SOFFSET     SET     SOFFSET+4
  44.               ENDM
  45.  
  46. ULONG          MACRO                    ; unsigned long (32 bits)
  47. \1            EQU     SOFFSET
  48. SOFFSET     SET     SOFFSET+4
  49.               ENDM
  50.  
  51. FLOAT          MACRO                    ; C float (32 bits)
  52. \1            EQU     SOFFSET
  53. SOFFSET     SET     SOFFSET+4
  54.               ENDM
  55. DOUBLE        MACRO                    ; C double (64 bits)
  56. \1            EQU        SOFFSET
  57. SOFFSET        SET        SOFFSET+8
  58.               ENDM
  59.  
  60. APTR          MACRO                    ; untyped pointer (32 bits - all bits valid)
  61. \1            EQU     SOFFSET
  62. SOFFSET     SET     SOFFSET+4
  63.               ENDM
  64.  
  65. RPTR          MACRO                    ; signed relative pointer (16 bits)
  66. \1            EQU     SOFFSET
  67. SOFFSET     SET     SOFFSET+2
  68.               ENDM
  69.  
  70. LABEL          MACRO                    ; Define a label without bumping the offset
  71. \1            EQU     SOFFSET
  72.               ENDM
  73.  
  74. STRUCT        MACRO                    ; Define a sub-structure
  75. \1            EQU     SOFFSET
  76. SOFFSET     SET     SOFFSET+\2
  77.               ENDM
  78.  
  79. ALIGNWORD   MACRO                    ; Align structure offset to nearest word
  80. SOFFSET     SET     (SOFFSET+1)&$fffffffe
  81.         ENDM
  82.  
  83. ALIGNLONG   MACRO                    ; Align structure offset to nearest longword
  84. SOFFSET     SET     (SOFFSET+3)&$fffffffc
  85.               ENDM
  86.  
  87.  
  88.     ENDC    ; EXEC_TYPES_I
  89.  
  90.  
  91.   STRUCTURE COMALSTRUC,0     ; Comal structure
  92.     UWORD CS_BreakFlags      ;
  93.     UWORD CS_Flags           ; See definitions below
  94.     APTR  CS_CurrWorkBottom  ; Current start of workspace
  95.     APTR  CS_CurrWorkTop     ; Current top of workspace
  96.     APTR  CS_MinStack        ; Safe low value of stack
  97.     APTR  CS_IO_Screen       ; Input/output screen
  98.     APTR  CS_CommPort        ; Port to comunicate with parent
  99.     APTR  CS_ID              ; ASCII ID string for this project
  100.     APTR  CS_MainPrgBuf      ; Main program buffer
  101.     APTR  CS_PrgEnv          ; Current program environment
  102.     APTR  CS_WorkStart       ; Start of workspace
  103.     APTR  CS_WorkEnd         ; End of useable workspace
  104.     ULONG CS_WorkLength      ; Total length of workspace
  105.     APTR  CS_SortTable       ; String sort table
  106.     APTR  CS_ComalPath       ; Home directory for comal
  107.   LABEL COMALSTRUC_SIZEOF
  108.  
  109. ; Break flags definitions (bit numbers)
  110. BF_Esc:       EQU     0
  111.  
  112. ; Flags definition (bit numbers)
  113. F_EscMinus:   EQU     0      ; Trap escaping is active (TRAP ESC-)
  114. F_EscPress:   EQU     1      ; Break pressed during TRAP ESC-
  115.  
  116.  
  117.   STRUCTURE MODULESTRUC,0       ; Module structure
  118.     APTR  MS_NextModule         ; Link to next module structure
  119.     APTR  MS_Name               ; Pointer to name of module
  120.     UBYTE MS_Type               ; Modules type - see below
  121.     UBYTE MS_Flags              ; Flags - se below
  122.     APTR  MS_PrgMem             ; Segment or program buffer
  123.     APTR  MS_PrgEnv             ; Only used in comal modules
  124.     APTR  MS_ModuleLine         ; Only used in comal modules
  125.     WORD  MS_NumType            ; Number of types defined in modul
  126.     APTR  MS_Types              ; Array of types defined in module
  127.     WORD  MS_NumName            ; Number of names defined in modul
  128.     APTR  MS_Names              ; Array of exported names
  129.     APTR  MS_Signal             ; Address of signal routine
  130.  
  131.   LABEL MODULESTRUC_SIZEOF
  132.  
  133. ; Module types
  134. LOCALMODULE   EQU     1         ; Local module
  135. EXTERNMODULE  EQU     2         ; External module
  136. CODEMODULE    EQU     3         ; External machine coded module
  137.  
  138. ;***********************************************************************
  139. ;
  140. ;         Standard type identifiers
  141. ;
  142. ;***********************************************************************
  143.  
  144. StringTypeId:  EQU     -1
  145. FloatTypeId:   EQU     -2
  146. UlongTypeId:   EQU     -3
  147. LongTypeId:    EQU     -4
  148. UshortTypeId:  EQU     -5
  149. ShortTypeId:   EQU     -6
  150. UbyteTypeId:   EQU     -7
  151. ByteTypeId:    EQU     -8
  152. StrucTypeId:   EQU     -9
  153. ArrayTypeId:   EQU    -10
  154. FuncTypeId:    EQU    -11
  155. ProcTypeId:    EQU    -12
  156. PointerTypeId: EQU    -13
  157.  
  158. ; Comal library vector offsets
  159. ;
  160. _LVOErrorNumber:       EQU    -6   ; Send error code
  161. _LVOErrorText:         EQU   -12   ; Send error text
  162. _LVOExecBreak:         EQU   -18   ; Execute break
  163. _LVOLockComalWindow:   EQU   -24   ; Get shared lock for standard IO window
  164. _LVOUnlockComalWindow: EQU   -30   ; Release lock for standard IO window
  165. _LVOAddComalDevice:    EQU   -36   ; Add new IO device
  166. _LVORemComalDevice:    EQU   -42   ; Remove IO device
  167. _LVOComalWait:         EQU   -48   ; Wait for signal
  168. _LVOAddExcept:         EQU   -54   ; Add exception routine
  169. _LVORemExcept:         EQU   -60   ; Remove exception routine
  170. _LVOAddSignal:         EQU   -66   ; Add Comal signal
  171. _LVORemSignal:         EQU   -72   ; Remove Comal signal
  172. _LVOGetAccept:         EQU   -78   ; Set up requester
  173.