home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / psion / opp16f_zip / INCLUDE / P / FILE.OPH < prev    next >
Encoding:
Text File  |  1995-12-21  |  6.9 KB  |  245 lines

  1. #define P_FILE_OPH
  2.  
  3. #define P_MAXDEVNAME 4
  4.  
  5. STRUCT P_RQPKT
  6.     pstat%
  7.     a1%
  8.     a2%
  9. ENDS
  10.  
  11. /* all I/O control blocks must start with this header */
  12.  
  13. STRUCT P_ICB
  14.     picb%
  15.     vec%
  16. ENDS
  17.  
  18. STRUCT P_IRQ
  19.     func%
  20.     r#(SIZEOF(P_RQPKT))
  21. ENDS
  22.  
  23. /* Wait Handler defines */
  24.  
  25. #define P_SIGNAL_UNUSED 0  /* signal not used by waithandler */ 
  26. #define P_SIGNAL_ENABLE 1 /* signal used by handler,I/O's still pending */ 
  27. #define P_SIGNAL_DISABLE 2 /* signal used by handler,no I/O's pending */ 
  28.  
  29. /* open service mode flags */
  30.  
  31. #define P_FOPEN 0x0000 /* Open i/o service */ 
  32. #define P_FCREATE 0x0001 /* Create file */ 
  33. #define P_FREPLACE 0x0002 /* Replace file */ 
  34. #define P_FAPPEND 0x0003 /* Append records */ 
  35. #define P_FUNIQUE 0x0004 /* Unique file open */ 
  36. #define P_FSER_MASK 0x000f /* File service mask */ 
  37. #define P_FSTREAM 0x0000 /* Stream access to a binary file */ 
  38. #define P_FSTREAM_TEXT 0x0010 /* Stream access to a text file */ 
  39. #define P_FTEXT 0x0020 /* Record access to a text file */ 
  40. #define P_FDIR 0x0030 /* Record access to a directory file */ 
  41. #define P_FFORMAT 0x0040 /* Format a device */
  42. #define P_FDEVICE 0x0050 /* Record access to device name list */ 
  43. #define P_FNODE 0x0060 /* Record access to node name list */ 
  44. #define P_FMT_MASK 0x00f0 /* File format mask */ 
  45. #define P_FUPDATE 0x0100 /* Read and write access */ 
  46. #define P_FRANDOM 0x0200 /* Random access */ 
  47. #define P_FSHARE 0x0400 /* File can be shared */ 
  48. #define P_FACC_MASK 0x0f00 /* mask for access types */ 
  49. #define P_FLOWDENSITY  0x1000
  50.  
  51. /* p_io/p_iow function constants */
  52.  
  53. /* Generic I/O functions */
  54.  
  55. #define P_FPANIC 0 /* Panic the device */ 
  56. #define P_FREAD 1 /* Read */ 
  57. #define P_FWRITE 2 /* Write */ 
  58. #define P_FCLOSE 3 /* Close */ 
  59. #define P_FCANCEL 4 /* Cancel io */ 
  60. #define P_FATTACH 5 /* attach this pseudo device */ 
  61. #define P_FDETACH 6 /* detach this pseudo device */ 
  62. #define P_FSET 7 /* set channel characteristics */ 
  63. #define P_FSENSE 8 /* sense channel characteristics */ 
  64. #define P_FFLUSH 9 /* Flush buffers */ 
  65.  
  66. /* Now follows the device specific functions */
  67. /* Timer device driver */
  68.  
  69. #define P_FRELATIVE P_FREAD /* Relative timer */ 
  70. #define P_FABSOLUTE P_FWRITE /* Absolute timer */ 
  71.  
  72. /* Files */
  73.  
  74. #define P_FSEEK 10 /* Seek */ 
  75. #define P_FSETEOF 11 /* Set end of file */ 
  76.  
  77. /* Data Link I/O + wserv */
  78.  
  79. #define P_FCONNECT 10 /* Queue a link connect request */ 
  80. #define P_FDISCONNECT 11 /* Disconnect the link */ 
  81.  
  82. /* wserv functions */
  83.  
  84. #define P_FWRITE_REPLY 12 /* P_FWRITE + read a reply from the server */ 
  85.  
  86. /* Serial/llmac */
  87.  
  88. #define P_FTEST 10 /* return no. of bytes in serial receieve buffer */ 
  89. #define P_FCTRL 11 /* serial port control lines */ 
  90. #define P_FINQ 12 /* inquire of device capabilities */ 
  91. #define P_FRSUPER 13 /* read a supervisory frame (p_llmac) */ 
  92. #define P_FSTOP 14 /* stop LLMAC mode */ 
  93. #define P_FSTART 15 /* start LLMAC mode */ 
  94.  
  95. /* Serial LDD to Serial PDD I/O defines */
  96.  
  97. #define P_FENABLE 16 /* Enable transmit interrupts */ 
  98. #define P_FSETINT 17 /* set the serial Interrupt code ptrs */
  99.  
  100. /* modem functions */
  101.  
  102. #define P_FMINIT 16 /* modem initialization function */ 
  103. #define P_FMDIAL 17 /* modem dial function */ 
  104. #define P_FMWAITCALL 18 /* wait for an incoming call */ 
  105. #define P_FMSENSE 19 /* Sense Modem characteristics */ 
  106. #define P_FMSET 20 /* Set Modem characteristics */ 
  107. #define P_FMCANCEL 21 /* Cancel outstanding mode request */ 
  108. #define P_FMWRITE 22 /* Write a configuration string to modem with timeout */ 
  109.  
  110. /* p_seek() mode constants */
  111.  
  112. #define P_FABS 1 /* Position absolute in the file */ 
  113. #define P_FEND 2 /* Position relative from the end of file */ 
  114. #define P_FCUR 3 /* Position relative to the current pos */ 
  115. #define P_FRSENSE 4 /* Sense the record position */ 
  116. #define P_FRSET 5 /* Set the record position */ 
  117. #define P_FREWIND 6 /* Rewind a text file */ 
  118.  
  119. /* defines for changing directories */
  120.  
  121. #define P_CD_ROOT 0   /* goto root directory */ 
  122. #define P_CD_PARENT 1  /* goto parent directory */ 
  123. #define P_CD_SUBDIR 2  /* goto subdirectory */ 
  124.  
  125. /* masks for status flag of P_INFO */
  126.  
  127. #define P_FAWRITE 0x01 /* can the file be written to? */ 
  128. #define P_FAHIDDEN 0x02 /* set if file is hidden */ 
  129. #define P_FASYSTEM 0x04 /* set if file is a system file */ 
  130. #define P_FAVOLUME 0x08 /* set if the name is a volume name */ 
  131. #define P_FADIR  0x10 /* set if file is a directory file */ 
  132. #define P_FAMOD  0x20 /* has the file been modified? */ 
  133. #define P_FAREAD  0x100 /* can the file be read? */ 
  134. #define P_FAEXEC  0x200 /* is the file executable? */ 
  135. #define P_FASTREAM 0x400 /* is the file a byte stream file? */ 
  136. #define P_FATEXT  0x800 /* is it a text file? */ 
  137.  
  138. /* File system File information - p_finfo() */
  139.  
  140. STRUCT P_INFO
  141.     version%
  142.     status%
  143.     size&
  144.     modst&
  145.     spare#(4)
  146. ENDS
  147.  
  148. #define P_VOLUMENAME  32
  149. #define P_FMEDIA_UNKNOWN 0
  150. #define P_FMEDIA_FLOPPY 1
  151. #define P_FMEDIA_HARDDISK 2
  152. #define P_FMEDIA_FLASH 3
  153. #define P_FMEDIA_RAM 4
  154. #define P_FMEDIA_ROM 5
  155. #define P_FMEDIA_WRITEPROTECTED 6
  156. #define P_FMEDIA_COMPRESSIBLE 0x8000 /* Worth compressing deleted records */ 
  157. #define P_FMEDIA_DYNAMIC 0x4000 /* Media size is dynamic */ 
  158. #define P_FMEDIA_INTERNAL 0x2000 /* Media is internal */ 
  159. #define P_FMEDIA_DUAL_DENSITY 0x1000
  160. #define P_FMEDIA_FORMATTABLE 0x800
  161.  
  162. /* File System Device information - p_dinfo() */
  163.  
  164. STRUCT P_DINFO
  165.     version%
  166.     mediatype%
  167.     removable%
  168.     size&
  169.     free&
  170.     name#(P_VOLUMENAME)
  171.     batterystate%
  172.     spare#(16)
  173. ENDS
  174.  
  175. #define P_FSYSTYPE_FLAT 0
  176. #define P_FSYSTYPE_HIER 1
  177.  
  178. /* File System Node information - p_ninfo() */
  179.  
  180. STRUCT P_NINFO
  181.     version%
  182.     type%
  183.     formattable%
  184.     spare#(26)
  185. ENDS
  186.  
  187. /* Flag defines for p_fparse */
  188.  
  189. #define P_PWILD_ANY 0x01 /* contains one or more wildcards */ 
  190. #define P_PWILD_NAME 0x02 /* the name field contains wildcards */ 
  191. #define P_PWILD_EXT 0x04 /* the extension contains wildcards */ 
  192.  
  193. /* Full file system parse - p_fparse() */
  194.  
  195. #define P_FSYSNAMESIZE 5
  196.  
  197. STRUCT P_FPARSE
  198.     system#
  199.     device#
  200.     path#
  201.     name#
  202.     ext#
  203.     flags#
  204. ENDS
  205.  
  206. /* AC: OPL parse$() return structure */
  207.  
  208. STRUCT P_OPL_PARSE
  209.     system%
  210.     device%
  211.     path%
  212.     name%
  213.     ext%
  214.     flags%
  215. ENDS
  216.  
  217. /* structure used with FilStatusGet OS call */
  218.  
  219. STRUCT file_info
  220.     format%        /* buffer format version, =2 */
  221.     attr%        /* attributes, see above defines */
  222.     size&
  223.     modified&    /* time last modified */
  224. ENDS
  225.  
  226. #define P_FBLKSHIFT 9 /* Block shift factor */ 
  227. #define P_FBLKSIZE 0x200 /* Block size */ 
  228. #define P_FMAXRSIZE 0x100 /* Maximum text record size */ 
  229. #define P_FMAXSSIZE 0x4000 /* Maximum stream read/write length */ 
  230. #define P_FSIZRPOS 4 /* array size for storing r/w position */ 
  231. #define P_MAXDEV 128 /* Maximum device name size */ 
  232. #define P_MAXPATH 128 /* Maximum path size */ 
  233. #define P_MAXNAME 128 /* Maximum name size */ 
  234. #define P_MAXEXTN 128 /* Maximum extension size */ 
  235. #define P_FNAMESIZE 128 /* Maximum file name size */ 
  236.  
  237. /* BINARY FILE SIGNATURE FOR APPLICATION FILES */
  238.  
  239. STRUCT P_FSIG
  240.     app_id#(3)
  241.     chk_sum#
  242.     file_vn#
  243.     app_vn#
  244. ENDS
  245.