home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 230.lha / FileIO_II / FileIO.i < prev    next >
Text File  |  1989-04-05  |  5KB  |  139 lines

  1.  ;This is the assembly language INCLUDE file for the FileIO requester
  2.  
  3. ; The file IO which is returned by GetFileIO() looks like this
  4. ;
  5. ;  The FileIO structure (264 bytes):
  6. ;FileIO dc.w  0      ;Flags WORD
  7. ;       ds.b  30     ;FileName buffer (contents must be NULL terminated)
  8. ;       ds.b  132    ;DrawerName buffer
  9. ;       ds.b  30     ;DiskName buffer
  10. ;       dc.l   0     ;DOS filehandle lock
  11. ;       dc.w   0     ;NameCount (total # of filenames in filename list)
  12. ;       dc.w   0     ;NameStart (ID of filename in top "select name" display)
  13. ;       dc.w   0     ;CurrentPick (ID of filename selected and highlighted)
  14. ;       dc.l NameKey ;address of Remember structure for filename list
  15. ;       dc.w   0     ;VolumeIndex (ID of current disk being examined)
  16. ;       dc.w   0     ;VolumeCount (total # of DOS disk devices in disk list)
  17. ;       dc.l VolKey  ;address of Remember structure for disk list
  18. ;the next 2 fields are for WB pattern match (i.e. Icon files displayed only)
  19. ;       dc.w   0     ;DiskObjectType to match
  20. ;       dc.l   0     ;ToolTypes string address to match
  21. ;       dc.l   0     ;address of extension string to match
  22. ;       dc.w   0     ;size of extension string
  23. ;       dc.l   0     ;address of CustomHandler structure
  24. ;       dc.w   0     ;X position of the requester
  25. ;       dc.w   0     ;Y position of the requester
  26. ;       dc.l   0     ;free bytes on current disk
  27. ;       dc.l   0     ;bytesize of selected file (or 0 if the file doesn't exist yet)
  28. ;       dc.l   0     ;WindowTitle
  29. ;       dc.l   0     ;Buffer
  30. ;       dc.l   0     ;Rawkey Code
  31. ;       dc.l   0     ;OriginalLock (do not alter)
  32. ;       dc.b   0     ;Error number
  33. ;       dc.b   0     ;DrawMode
  34. ;       dc.b   0     ;PenA
  35. ;       dc.b   0     ;PenB
  36.  
  37. ; so here are the offsets from the base for each field:
  38.  
  39. FILEIO_FLAGS     equ 0
  40. FILEIO_FILENAME  equ 2
  41. FILEIO_DRAWER    equ 32
  42. FILEIO_DISK      equ 164
  43. FILEIO_LOCK      equ 194
  44. FILEIO_NAMECOUNT equ 198
  45. FILEIO_NAMESTART equ 200
  46. FILEIO_CURRPICK  equ 202
  47. FILEIO_FILELIST  equ 204
  48. FILEIO_VOLINDEX  equ 208
  49. FILEIO_VOLCOUNT  equ 210
  50. FILEIO_VOLLIST   equ 212
  51. FILEIO_MATCHTYPE equ 216
  52. FILEIO_TOOLTYPES equ 218
  53. FILEIO_EXTENSION equ 222
  54. FILEIO_EXTSIZE   equ 226
  55. FILEIO_CUSTOM    equ 228
  56. FILEIO_X         equ 232
  57. FILEIO_Y         equ 234
  58. FILEIO_FREEBYTES equ 236
  59. FILEIO_FILESIZE  equ 240
  60. FILEIO_TITLE     equ 244
  61. FILEIO_BUFFER    equ 248
  62. FILEIO_RAWCODE   equ 252
  63. FILEIO_ORIGINALLOCK equ 256
  64. FILEIO_ERRNO     equ 260
  65. FILEIO_DRAWMODE  equ 261
  66. FILEIO_PENA      equ 262
  67. FILEIO_PENB      equ 263
  68.  
  69. SIZEOF_FILEIO    equ 264
  70.  
  71. ;  So, to access the FileIO's Tooltypes field, you can do this
  72. ;
  73. ;move.l  myFileIO,a0             ;the base returned from GetFileIO()
  74. ;move.l  FILEIO_TOOLTYPES(a0),d0 ;get the value in this field
  75.  
  76. ; Here the the flag bit numbers
  77.  
  78. NO_CARE_REDRAW   equ 0
  79. USE_DEVICE_NAMES equ 1
  80. EXTENSION_MATCH  equ 2
  81. DOUBLECLICK_OFF  equ 3
  82. WBENCH_MATCH     equ 4
  83. MATCH_OBJECTTYPE equ 5
  84. MATCH_TOOLTYPE   equ 6
  85. INFO_SUPPRESS    equ 7
  86.  
  87. ALLOCATED_FILEIO equ 8  ;NEVER alter this
  88. CUSTOM_HANDLERS  equ 9
  89. WINDOW_OPENED    equ 10 ;NEVER alter this
  90. TITLE_CHANGED    equ 11
  91. DISK_HAS_CHANGED equ 13
  92.  
  93. ; So to enable the USE_DEVICE_NAMES feature, do this
  94. ;
  95. ;movea.l  myFileIO,a0           ;the base
  96. ;move.w   FILEIO_FLAGS(a0),d0   ;get the current flags
  97. ;bset.l   #USE_DEVICE_NAMES,d0  ;enable this feature (clear the bit to disable)
  98. ;move.w   d0,FILEIO_FLAGS(a0)   ;save the new flags
  99.  
  100.  ;======= ERRNO numbers returned in FileIO error field =========
  101.  
  102. ERR_MANUAL  equ 1   ;the path was entered manually via the title bar with no
  103.                     ;errors or cancellation.
  104. ERR_SUCCESS equ 0   ;everything went OK in DoFileIO() or DoFileIOWindow()
  105. ERR_CANCEL  equ -1  ;the filename procedure was CANCELED by the user
  106. ERR_WINDOW  equ -2  ;the window couldn't open (in DoFileIOWindow())
  107. ERR_APPGADG equ -3  ;the requester was CANCELED by an application gadget
  108.                     ;(via an installed CUSTOM gadget handler returning TRUE)
  109.  
  110.  ;====== AutoFileMessage() numbers =========
  111. ALERT_OUTOFMEM       equ  0
  112. ALERT_BAD_DIRECTORY  equ  1
  113. READ_WRITE_ERROR     equ  2 ; Error in reading or writing file
  114.  ;The next 3 display "YES" and "NO" prompts, returning d0=1 for yes, 0 for no
  115. FILE_EXISTS          equ  3 ; File already exists. Overwrite?
  116. SAVE_CHANGES         equ  4 ; Changes have been made. Save them?
  117. REALLY_QUIT          equ  5 ; Do you really want to quit?
  118.  
  119.  ;======FileIO library routine vector offsets from library base=====
  120. _LVODoFileIOWindow  equ -30
  121. _LVOGetFileIO       equ -36
  122. _LVODoFileIO        equ -42
  123. _LVOGetFullPathname equ -48
  124. _LVOAutoFileMessage equ -54
  125. _LVOReleaseFileIO   equ -60
  126. _LVOAutoMessage     equ -66
  127. _LVOSetWaitPointer  equ -72
  128. _LVOResetBuffer     equ -78
  129. _LVOAutoMessageLen  equ -84
  130. _LVOAutoPrompt3     equ -90
  131. _LVOUserEntry       equ -96
  132. _LVOPromptUserEntry equ -102
  133. _LVOGetRawkey       equ -108
  134. _LVODecodeRawkey    equ -114
  135. _LVOTypeFilename    equ -120
  136. _LVOSetTitle        equ -126
  137. _LVOResetTitle      equ -132
  138. _LVOParseString     equ -138
  139.