home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff257.lzh / FileIO / FileIO.i < prev    next >
Text File  |  1989-10-19  |  5KB  |  142 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.l   0     ;NextDisk Text (for SPECIAL_REQ)
  16. ;            dc.l   0     ;address of NextDisk handler (for SPECIAL_REQ)
  17. ;the next 2 fields are for WB pattern match (i.e. Icon files displayed only)
  18. ;            dc.w   0     ;DiskObjectType to match
  19. ;            dc.l   0     ;ToolTypes string address to match
  20. ;            dc.l   0     ;address of extension string to match
  21. ;            dc.w   0     ;size of extension string
  22. ;            dc.l   0     ;address of CustomHandler structure
  23. ;            dc.w   0     ;X position of the requester
  24. ;            dc.w   0     ;Y position of the requester
  25. ;            dc.l   0     ;free bytes on current disk
  26. ;            dc.l   0     ;bytesize of selected file (or 0 if the file doesn't exist yet)
  27. ;            dc.l   0     ;WindowTitle
  28. ;            dc.l   0     ;Buffer
  29. ;            dc.l   0     ;Rawkey Code
  30. ;            dc.l   0     ;OriginalLock (do not alter)
  31. ;            dc.b   0     ;Error number
  32. ;            dc.b   0     ;DrawMode
  33. ;            dc.b   0     ;PenA
  34. ;            dc.b   0     ;PenB
  35.  
  36. ; so here are the offsets from the base for each field:
  37.  
  38. FILEIO_FLAGS        equ 0
  39. FILEIO_FILENAME    equ 2
  40. FILEIO_DRAWER        equ 32
  41. FILEIO_DISK            equ 164
  42. FILEIO_LOCK            equ 194
  43. FILEIO_NAMECOUNT    equ 198
  44. FILEIO_NAMESTART    equ 200
  45. FILEIO_CURRPICK    equ 202
  46. FILEIO_FILELIST    equ 204
  47. FILEIO_TEXT            equ 208
  48. FILEIO_ROUTINE        equ 212
  49. FILEIO_MATCHTYPE    equ 216
  50. FILEIO_TOOLTYPES    equ 218
  51. FILEIO_EXTENSION    equ 222
  52. FILEIO_EXTSIZE        equ 226
  53. FILEIO_CUSTOM        equ 228
  54. FILEIO_X                equ 232
  55. FILEIO_Y                equ 234
  56. FILEIO_FREEBYTES    equ 236
  57. FILEIO_FILESIZE    equ 240
  58. FILEIO_TITLE        equ 244
  59. FILEIO_BUFFER        equ 248
  60. FILEIO_RAWCODE        equ 252
  61. FILEIO_ORIGINALLOCK    equ 256
  62. FILEIO_ERRNO        equ 260
  63. FILEIO_DRAWMODE    equ 261
  64. FILEIO_PENA            equ 262
  65. FILEIO_PENB            equ 263
  66.  
  67. SIZEOF_FILEIO        equ 264
  68.  
  69. ;  So, to access the FileIO's Tooltypes field, you can do this
  70. ;
  71. ;move.l  myFileIO,a0             ;the base returned from GetFileIO()
  72. ;move.l  FILEIO_TOOLTYPES(a0),d0 ;get the value in this field
  73.  
  74. ; Here the the flag bit numbers
  75.  
  76. NO_CARE_REDRAW        equ 0
  77. USE_DEVICE_NAMES    equ 1
  78. EXTENSION_MATCH    equ 2
  79. DOUBLECLICK_OFF    equ 3
  80. WBENCH_MATCH        equ 4
  81. MATCH_OBJECTTYPE    equ 5
  82. MATCH_TOOLTYPE        equ 6
  83. INFO_SUPPRESS        equ 7
  84.  
  85. ALLOCATED_FILEIO    equ 8        ;NEVER alter this
  86. CUSTOM_HANDLERS    equ 9
  87. WINDOW_OPENED        equ 10    ;NEVER alter this
  88. TITLE_CHANGED        equ 11
  89. DISK_HAS_CHANGED    equ 13
  90. SHOW_DISK_NAMES    equ 14    ;for displaying disk names instead of filenames
  91. SPECIAL_REQ            equ 15    ;for displaying lists of strings
  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. _LVONewEntryList        equ -144
  140. _LVOAddEntry            equ -150
  141. _LVOIsEntryThere        equ -156
  142.