home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 4 / AUCD4.iso / acorn / documents / api / drafturi next >
Encoding:
Text File  |  1996-12-23  |  14.7 KB  |  396 lines

  1. Acorn URI Handler Functional Specification
  2. ==========================================
  3.  
  4. Document Status
  5. ---------------
  6.   Distribution:  General Developer Community
  7.          Title:  URI Handler Functional Specification
  8. Drawing Number:  unassigned/FS
  9.          Issue:  DRAFT 2 ***live***
  10.      Author(s):  Carl Elkins
  11.                  Tom Hughes
  12.                  Kevin Bracey
  13.           Date:  12/12/96
  14.  Change Number:  N/A
  15.     Last Issue:   N/A
  16.         
  17. Contents
  18. --------
  19. Acorn URI Handler Functional Specification                      
  20. Document Status                                                 
  21. Contents        
  22. Issue History                                                   
  23. Overview                                                        
  24. Deliverable 'product'                                           
  25. Programmer's Interface                                          
  26.         URI SWIs                                                
  27.                 URI_Version (&4E380)                            
  28.                 URI_Dispatch (&4E381)                           
  29.                 URI_RequestURI (&4E382)                 
  30.                 URI_InvalidateURI (&4E383)                      
  31.         URI Service calls                                               
  32.                 Reason 0 - URI handler started                  
  33.                 Reason 0 - URI handler started                  
  34.                 Reason 1 - URI handler dying                    
  35.                 Reason 2/3 - Request to check/process URI               
  36.         WIMP messages                                           
  37.                 Message &4E380 - URI handler started            
  38.                 Message &4E381 - URI handler dying              
  39.                 Message &4E382 - Request to check/process URI   
  40.                 Message &4E383 - URI return result              
  41.         Use of the URI filetype                                 
  42.         Use of URI environment variables                                
  43. Usage of the Acorn URI handler                                  
  44.  
  45. Issue History
  46. -------------
  47. 1       13/12/96        Original Version
  48. 2       21/12/96        Added 'handles' concept after discussions with
  49.                         S.Brodie.
  50.  
  51. Overview
  52. --------
  53. The purpose of this document is to address the recognised deficiency in the
  54. failure of existing RISC OS specifications to provide a standard method for
  55. different applications to communicate URIs (of which URLs are an example)
  56. between themselves; for example, to provide for a field in an address book
  57. program requesting that a Web browser display someone's home page.
  58.  
  59. The first part of this requirement to be addressed is the provision of a
  60. mechanism for applications to pass URIs between themselves in a uniform
  61. manner: to date, several third party developers have independently solved
  62. this problem in a variety of different ways, but there is no centrally
  63. published, universally available standard for developers to work to.
  64.  
  65. This 'central resource broker' will be extended in the future to provide
  66. mechanisms to enable more efficient handling of URIs, enabling, for example,
  67. data to be passed to an appropriate application based on the type of data as
  68. opposed to simply the method specified for retrieval of the data (as is
  69. often the case with URLs); this too will be via a service interface to the
  70. central broker.
  71.  
  72. Deliverable 'product'
  73. ---------------------
  74. The intention of this project is to deliver the specification of a suitable
  75. API to fulfil the above stated requirement, along with such software as is
  76. required to implement the underlying functionality to enable the use of this
  77. API.
  78.  
  79. In the short term, this software will take the form of a RISC OS relocatable
  80. module, though this may be enhanced and supplemented as the authors see fit.
  81.  
  82. Programmer's Interface
  83. ----------------------
  84. The application programmer's interface to the services provided by the Acorn
  85. URI handler is detailed in the following sections. This interface will be
  86. enhanced in the future, as outlined in the project overview, to provide a
  87. more comprehensive set of services, so it's worth emphasising that only
  88. those details and features of the interface specified in the following
  89. sections should be considered to be supported: anything which is not
  90. specified below should be considered to be an implementation feature of a
  91. particular version of the software, and as such liable to change, alteration
  92. or omission without notice.
  93.  
  94. The following have been allocated for the use of the Acorn URI handler
  95.  
  96. Module name             URI
  97. SWI prefix              URI
  98. SWI chunk               &4E380
  99. WIMP message chunk      &4E380
  100. Error code chunk        &810A00
  101. Service Call            &A7
  102. FileType                &F91
  103.  
  104. All environment variables containing the string _URI_ (i.e. matching *_URI_*)
  105.  
  106. URI 'handles' are utilised to identify a specific URI request when
  107. communicating with the URI handler; tasks may assume nothing about these
  108. handle values, other than that they identify a particular URI to the handler
  109. for the period of their validity.
  110.  
  111. URI SWIs
  112. --------
  113. The following SWIs are provided for external applications' use : all other
  114. URI SWIs are reserved.
  115.  
  116. URI_Version (&4E380)
  117.  
  118. On Entry
  119. R0      =       flags:  bit     meaning if set
  120.                         0-31    reserved (0)
  121. On Exit
  122. R0      =       current version *100
  123.  
  124. Interrupts
  125. Undefined.
  126.  
  127. Re-entrancy
  128. Undefined.
  129.  
  130. Use
  131. This SWI is used to inquire of the URI handler module's version number, and
  132. should be used to check for a suitable version being present before using
  133. the facilities provided.
  134.  
  135. The number returned is of the form (major version * 100) + minor version.
  136.  
  137. URI_Dispatch (&4E381)
  138.  
  139. On Entry
  140. R0      =       flags:  bit     meaning if set
  141.                         0       inform caller of result (=>R2 valid)
  142.                         1       check only, don't process (R0:0 must be set)
  143.                         2       don't attempt external process startup
  144.                         3-31    reserved (0)
  145. R1      =       pointer to 0 terminated URI string
  146. R2      =       source task handle (if bit R0:0 is set)
  147.  
  148. On Exit
  149. R0      =       flags:  0 => request accepted,
  150.                         all other values reserved
  151. R2      =       task handle of URI handler
  152. R3      =       handle of this URI (request identifier)
  153. All other registers preserved.
  154.  
  155. Interrupts
  156. Undefined.
  157.  
  158. Re-entrancy
  159. SWI is not re-entrant.
  160.  
  161. Use
  162. This SWI is used by an application to pass a URI string to the handler for
  163. dispatch, or checking for the presence of a potential servicer. Dispatch
  164. provides for optional requesting of a success/failure indication via a WIMP
  165. message − necessary since the dispatch of the URI occurs asynchronously.
  166.  
  167. When requesting a check only (R0:1 set), it is an error not to set R0:0 and
  168. provide a valid task handle in R2.
  169.  
  170. The URI will be copied to the URI handler's workspace, optionally
  171. transformed (future enhancements, such as canonicalisation, may be added),
  172. then relocatable modules will be offered the chance to handle the URI via
  173. service call &A7 ; if the service call is unclaimed, then a WIMP message
  174. will be broadcast (User_Message_Recorded), offering other tasks the chance
  175. of handling the URI. If neither of these mechanisms elicits a response, then
  176. the request will be deemed to have failed (insofar as active tasks are
  177. concerned).
  178.  
  179. If R0:2 is clear, then the 'fallback' position of checking a subset of the
  180. environment variables will be used to attempt to start a suitable task to
  181. handle the URI.
  182.  
  183. If requested, the originating task will be informed of the results of this
  184. process (via User_Message); if the URI has been processed, then the handle
  185. will cease to be valid. The handle also ceases to be valid at this point if
  186. notification has not been requested, irrespective of whether or not the URI
  187. has been processed.
  188.  
  189. URI_RequestURI (&4E382)
  190.  
  191. On Entry
  192. R0      =       flags:  bit     meaning
  193.                         0-31    reserved (0)
  194. R1      =       pointer to buffer to hold URI or 0 to read required size
  195. R2      =       length of buffer or unused (if R1 = 0)
  196. R3      =       URI handle
  197.  
  198. On Exit
  199. R2      =       offset into buffer of terminating null,
  200.                 or size of buffer required (if R1 = 0 on entry)
  201. All other registers preserved.
  202.  
  203. Interrupts
  204. Undefined.
  205.  
  206. Re-entrancy
  207. SWI is not re-entrant.
  208.  
  209. Use
  210. This SWI is used to inquire what size of buffer is required to hold the
  211. specified URI (if R1 is zero on entry), or to pass details of a buffer into
  212. which your task desires the URI to be copied.
  213.  
  214. If this is successful, then R2 should be equal to the size of the buffer: if
  215. the buffer specified on entry is not large enough, then R2 will be returned
  216. negative (indicating the number of unreturned characters), and the string
  217. returned in the buffer will still be zero-terminated i.e. buffersize-1
  218. characters of the string are returned. In this case, the URI will not be
  219. deemed to have been processed.
  220.  
  221. URI_InvalidateURI (&4E383)
  222.  
  223. On Entry
  224. R0      =       flags:  bit     meaning
  225.                         0-31    reserved (0)
  226. R3      =       URI handle
  227.  
  228. On Exit
  229. All registers preserved.
  230.  
  231. Interrupts
  232. Undefined.
  233.  
  234. Re-entrancy
  235. SWI is not re-entrant.
  236.  
  237. Use
  238. This SWI is used to mark the specified URI as being invalid.
  239.  
  240. URI Service calls
  241. -----------------
  242. Service call &A7 has been allocated for the use of the URI handler ; the
  243. following sub-reason codes are defined for the use of external applications.
  244. All other service call reason codes are reserved: a module may assume
  245. nothing about these.
  246.  
  247. Reason 0 - URI handler started
  248. On Entry
  249. R0      =       0       reason code
  250. R1      =       &A7     service call
  251.  
  252. On Exit
  253. All registers must be preserved - the call must be passed on.
  254.  
  255. Use
  256. This service call indicates that the URI handler has started.
  257.  
  258. It is intended for more specific use defined in future versions of this
  259. specification.
  260.  
  261. Reason 1 - URI handler dying
  262. On Entry
  263. R0      =       1       reason code
  264. R1      =       &A7     service call
  265.  
  266. On Exit
  267. All registers must be preserved - the call must be passed on.
  268.  
  269. Use
  270. This service call indicates that the URI handler is dying.
  271. It is intended for more specific use defined in future versions of this
  272. specification.
  273.  
  274. Reason 2/3 - Request to check/process URI
  275. On Entry
  276. R0      =       2 or 3  (reason code)
  277. R1      =       &A7     (service call)
  278. R2      =       pointer to URI string (read-only access)
  279. R3      =       handle of this URI
  280.  
  281. On Exit
  282. R1      preserved or 0 to claim
  283. All other registers preserved.
  284.  
  285. Use
  286. This service call indicates that the URI handler has been requested to
  287. dispatch the given URI for either potential processing (R0=2), or processing
  288. (R0=3). The URI string is held in the URI handler's workspace; this buffer
  289. must not be written to (if it is, behaviour is undefined). It is intended
  290. that modules which can process URIs should inspect the string at the given
  291. address, and if they can process the given URI, they should claim the
  292. service call: this is all that's required if R0=2 on entry.
  293.  
  294. If R0=3 i.e. process URI, then a call to SWI URI_RequestURI to obtain a
  295. local copy to work with must be made; this step may not be omitted, since
  296. the internal buffer is not guaranteed to remain valid after return from the
  297. service handler.
  298.  
  299. If a module cannot process the given URI, it should pass the call on with
  300. all registers preserved to allow the remainder of the dispatch mechanism to
  301. function.
  302.  
  303. WIMP messages
  304. -------------
  305. As might be expected, the URI handler communicates with other WIMP tasks via
  306. the WIMP message mechanism. The following message action codes are defined
  307. for use by external applications, with all other codes being reserved.
  308.  
  309. Message &4E380 - URI handler started
  310. Poll block
  311. R1+20   =       flags:  bit     meaning
  312.                         0-31    reserved (0)
  313. R1+24...                undefined (reserved)
  314.  
  315. Use
  316. This message is broadcast (User_Message) to indicate that the URI handler
  317. has started up. It must not be acknowledged - it is issued for information
  318. only.
  319.  
  320. Message &4E381 - URI handler dying
  321. Poll Block
  322. R1+20   =       flags:  bit     meaning
  323.                         0-31    reserved (0)
  324. R1+24...                undefined (reserved)
  325.  
  326. Use
  327. This message is broadcast (User_Message) to indicate that the URI handler is
  328. shutting down. It must not be acknowledged - it is issued for information
  329. only.
  330.  
  331. Message &4E382 - Request to check/process URI
  332. Poll Block
  333. R1+20   =       flags:  bit     meaning if set
  334.                         0       check URI only, do not process
  335.                         1-31    reserved (0)
  336. R1+24   =       pointer to URI string (URI internal buffer)
  337. R1+28   =       URI handle
  338. R1+32...                undefined (reserved)
  339.  
  340. Use
  341. This message is broadcast (User_Message_Recorded) to indicate that the URI
  342. handler has been requested to dispatch the given URI for processing, or
  343. check if any task can process the URI.
  344.  
  345. The URI string is held in the URI module's workspace; this buffer must not
  346. be written to - if it is, behaviour is undefined.
  347.  
  348. It is intended that applications which can process URIs should inspect the
  349. string at the given address to determine if they can process the given URI.
  350. If R0 bit 0 is clear,  you should then call SWI URI_RequestURI to obtain a
  351. copy to work with - this step may not be omitted, since the buffer given is
  352. not guaranteed to remain unaltered after the call returns.
  353.  
  354. If an application is able to process the given URI, then it should
  355. acknowledge the broadcast, thus preventing its being passed on to other
  356. applications, otherwise it must not acknowledge the message.
  357.  
  358. Message &4E383 - URI return result
  359. Poll Block
  360. R1+20   =       flags:  bit     meaning
  361.                         0       0 => URI was claimed for processing
  362.                                 1 => URI was not claimed for processing
  363.                         1-31    reserved (0)
  364. R1+24...                undefined (reserved)
  365.  
  366. Use
  367. This message is used by the URI handler to return result status information
  368. to a requesting task. Currently, only success or failure is indicated,
  369. though this is likely to be enhanced in a future version of the
  370. specification.
  371.  
  372. Use of the URI filetype
  373. -----------------------
  374. The use of the URI filetype is currently not defined by this specification,
  375. though the addition of this section is of high priority: it remains
  376. reserved, therefore, until a future issue of the specification.
  377.  
  378. Suitable sprites will be provided at an appropriate time to represent the
  379. filetype; these will be the only sprite definitions acceptable for use in
  380. this context.
  381.  
  382. Use of URI environment variables
  383. --------------------------------
  384. The use of environment variables by the URI handler is currently undefined,
  385. though this will be defined in a future issue of the specification : all
  386. such environment variables remain reserved, therefore.
  387.  
  388. Usage of the Acorn URI handler
  389. ------------------------------
  390. This section will contain a discussion of the anticipated modes of usage of
  391. the Acorn URI handler module; it is intended to provide guidance for
  392. application's programmers who wish to make use of the services provided by
  393. the URI handler.
  394.  
  395.  
  396.