Showing changes from revision #3 to #4:
Added | Removed | Changed
Warning: The current and/or previous revision contained markup errors which prevented proper diff analysis. A guess at markup correction has been made but the diff may not be a truly accurate reflection of the real changes.
Distribution: | General Release |
Title: | |
Drawing Number: | 1215,215/FS |
Issue: | 2 |
Author(s): | Carl Elkins |
Stewart Brodie | |
Kevin Bracey | |
Simon Middleton | |
Ben Laughton | |
Andrew Hodgkinson | |
Date: | 01/09/98 |
Change Number: | |
Last Issue: | 1 |
Modified for RISC OS Open Limited Wiki by ADH, 29-May-2007.
Adapted for Textile engine with layout-related changes only,
except for removal for redundant external links.
*Desktop_AcornURI
(starts the URI handler)
*URIinfo
(display information about the URI handler)
*URIdispatch
(try to launch a URI)
<notextile>*</notextile>Desktop_AcornURI
(starts the URI handler)<notextile>*</notextile>URIinfo
(display information about the URI handler)<notextile>*</notextile>URIdispatch
(try to launch a URI) This document first appeared as 1307,260/FS and went through issues 1 to 8,
with 8 being published outside of Acorn. The document number was later changed
to 1215,215/FS.
1307,260/FS | (Developers and, by issue 8, general release) | |
1 | 13/12/96 | Original Version |
2 | 21/12/96 | Added |
3 | 22/02/97 | Corrected omission of URI handle from Message_ReturnResult, clarified responsibility for invalidation of URIs |
4 | 21/04/97 | Added URI_MProcessAck message and *command documentation and updated URI filetype section |
5 | 13/06/97 | Service calls given flags, soDesktop_URI renamed toDesktop_AcornURI to match the actual module task name. URI file contents specified; includes a version number linked to the module version, so this specifies a version 5 file. |
6 | 20/06/97 | Following review of draft 5, some minor wording changes here and there; performance targets and development test strategy sections added |
7 | 21/06/97 | Reworded away from future tense to form an externally releasable specification |
8 | 10/12/97 | A couple of implied future tense references missed in Draft 7, now corrected; some minor rewording associated with this |
11/12/97 | No longer draft; settled on WIMP rather than Wimp; couple of minor typos corrected | |
05/01/98 | Few more typos fixed | |
05/02/98 | Minor tweaks to fit in with the rest of the Acorn Internet site (now uses a small style sheet like everything else, site map link added, and so-on). No changes to the content of the specification | |
19/02/98 | A few HTML style changes to make some of the section headings a bit clearer; no content change | |
23/02/98 | Colours changed to blue; now back to green again | |
1215,215/FS |
(General release) | |
1 | 02/03/98 | Document number now 1215,215/FS. Updated history, and navigation links in the page footer now include the specifications section; no other content changes |
2 | 01/09/98 | Corrected table listing allocated items in the |
This document addresses the recognised lack of existing RISC OS specifications
that describe a standard method for different applications to communicate URIs
(of which URLs are an example) between themselves; for example, to provide for
an address book requesting that a Web browser display someone’s home page.
The first part of this requirement addressed is the provision of a mechanism
for applications to pass URIs between themselves in a uniform manner. To date,
several third party developers have independently solved this problem in a
variety of different ways, as there was no centrally published, universally
available standard for developers to work to. This is such a standard.
This ‘central resource broker’ will be extended in the future to provide
mechanisms to enable more efficient handling of URIs. For example, data
may be passed to an appropriate application based on the type of data as
opposed to simply the method specified for retrieval of the data, as is often
the case with URLs. This too will be via a service interface to the central
broker.
This document describes the API created to fulfil the above stated
requirement, and relates to existing software providing the underlying
functionality.
The software takes the form of a RISC OS relocatable module, entitled
‘AcornURI’. This is a generic, OS-level software component that could
as equally sit beneath a text editor which was aware of the form of URIs
as sit beneath a Web browser or mail / news reader. Distributed alongside
the module are four sprite definitions for URI files.
The module is suitable for RISC OS 3.10 upwards, and should be stored
in !System.310.Modules.Network as ‘URI’.
The application programmer’s interface to the services provided by the Acorn
URI handler is detailed in the following sections. This interface will be
enhanced in the future, as outlined in the overview, to provide a more
comprehensive set of services; so it’s worth emphasising that only those
details and features of the interface specified in the following sections
should be considered to be supported. Any behaviour which is not specified
below should be considered to be an implementation feature of a particular
version of the software, and as such liable to change, alteration or omission
without notice.
The following have been allocated for the use of the Acorn URI handler:
Module name | AcornURI |
&4E380 | |
&4E380 | |
Error code chunk | &810A00 |
Service Call | &A7 |
FileType | &F91 |
All environment variables containing the string _URI_ (i.e. matching *_URI_*)
URI ‘handles’ are utilised to identify a specific URI request when
communicating with the URI handler; tasks may assume nothing about these
handle values, other than that they identify a particular URI to the handler
for the period of their validity.
URI_Version (&4E380) |
R0 = flags: | bit | meaning if set |
R0 = flags: | bit | meaning if set |
0-31 | reserved (0) | |
0-31 | reserved (0) |
R0 = current version * 100 |
R0 = current version * 100 |
URI_Dispatch (&4E381) |
R0 = flags: | bit | meaning if set |
R0 = flags: | bit | meaning if set |
0 | inform caller of result (=>R2 valid) | |
0 | inform caller of result (=>R2 valid) | |
1 | check only, don't process (R0:0 must be set) | |
1 | check only, don’t process (R0:0 must be set) | |
2 | don't attempt external process startup | |
2 | don’t attempt external process startup | |
3-31 | reserved (0) | |
3-31 | reserved (0) | |
R1 = pointer to 0 terminated URI string | ||
R1 = pointer to 0 terminated URI string | ||
R2 = 0, or source task handle if bit R0:0 is set and the caller is a WIMP task | ||
R2 = 0, or source task handle if bit R0:0 is set and the caller is a WIMP task |
R0 = flags: | bit | meaning if set |
R0 = flags: | bit | meaning if set |
0 | request rejected, URI won't be dispatched | |
0 | request rejected, URI won’t be dispatched | |
1-31 | reserved (0) | |
1-31 | reserved (0) | |
R2 = task handle of URI handler | ||
R2 = task handle of URI handler | ||
R3 = handle of this URI (request identifier) | ||
R3 = handle of this URI (request identifier) | ||
All other registers preserved. | ||
All other registers preserved. |
URI_RequestURI (&4E382) |
R0 = flags: | bit | meaning if set |
R0 = flags: | bit | meaning if set |
0-31 | reserved (0) | |
0-31 | reserved (0) | |
R1 = pointer to buffer to hold URI or 0 to read required size | ||
R1 = pointer to buffer to hold URI or 0 to read required size | ||
R2 = length of buffer or unused (if R1 = 0) | ||
R2 = length of buffer or unused (if R1 = 0) | ||
R3 = URI handle | ||
R3 = URI handle |
R2 = offset into buffer of terminating null, or size of buffer required (if R1 = 0 on entry) |
R2 = offset into buffer of terminating null, or size of buffer required (if R1 = 0 on entry) |
All other registers preserved. |
All other registers preserved. |
URI_InvalidateURI (&4E383) |
R0 = flags: | bit | meaning if set |
R0 = flags: | bit | meaning if set |
0-31 | reserved (0) | |
0-31 | reserved (0) | |
R3 = URI handle | ||
R3 = URI handle |
All registers preserved. |
All registers preserved. |
Service call &A7 has been allocated for the use of the URI
handler; the following sub-reason codes are defined for the use of external
applications. All other service call reason codes are reserved: a module may
assume nothing about these, and should always ignore unrecognised reason
codes – never claim such service calls.
A deliberate degree of similarly exists between the WIMP messages and
the service calls, since both provide essentially the same functionality;
clearly, messages will be convenient in environments where service calls
are not and vice versa, hence the duplication of functionality between
the two.
Reason 0: Service_URI_Started |
R0 = 0 (reason code) | ||
R0 = 0 (reason code) |
||
R1 = &A7 (service call) | ||
R1 = &A7 (service call) | ||
R2 = flags: | bit | meaning if set |
R2 = flags: | bit | meaning if set |
0-31 | reserved (0) | |
0-31 | reserved (0) |
All registers must be preserved - the call must be passed on. |
All registers must be preserved – the call must be passed on. |
Reason 1: Service_URI_Dying |
R0 = 1 (reason code) | ||
R0 = 1 (reason code) |
||
R1 = &A7 (service call) | ||
R1 = &A7 (service call) | ||
R2 = flags: | bit | meaning if set |
R2 = flags: | bit | meaning if set |
0-31 | reserved (0) | |
0-31 | reserved (0) |
All registers must be preserved - the call must be passed on. |
All registers must be preserved – the call must be passed on. |
Reason 2: Service_URI_Process |
Process or check URI |
R0 = 2 (reason code) | ||
R0 = 2 (reason code) |
||
R1 = &A7 (service call) | ||
R1 = &A7 (service call) | ||
R2 = flags: | bit | meaning if set |
R2 = flags: | bit | meaning if set |
0 | check URI only, do not process | |
0 | check URI only, do not process | |
1-31 | reserved (0) | |
1-31 | reserved (0) | |
R3 = pointer to URI string (readonly access) | ||
R3 = pointer to URI string (readonly access) | ||
R4 = handle of this URI | ||
R4 = handle of this URI |
R1 preserved or 0 to claim All other registers preserved |
R1 preserved or 0 to claim All other registers preserved |
Reason 3: Service_URI_ReturnResult |
Return result of a dispatch |
R0 = 3 (reason code) | ||
R0 = 3 (reason code) |
||
R1 = &A7 (service call) | ||
R1 = &A7 (service call) | ||
R2 = flags: | bit | meaning if set |
R2 = flags: | bit | meaning if set |
0 |
0 => URI was claimed for processing 1 => URI was not claimed for processing |
|
0 |
0 => URI was claimed for processing 1 => URI was not claimed for processing |
|
1-31 | reserved (0) | |
1-31 | reserved (0) | |
R3 = undefined (reserved (0)) | ||
R3 = undefined (reserved (0)) | ||
R4 = handle of this URI | ||
R4 = handle of this URI |
Message &4E380: URI_MStarted |
R1+20 = flags: | bit | meaning if set |
R1+20 = flags: | bit | meaning if set |
0-31 | reserved (0) | |
0-31 | reserved (0) | |
R1+24... undefined (reserved) | ||
R1+24… undefined (reserved) |
Message &4E381: URI_MDying |
R1+20 = flags: | bit | meaning if set |
R1+20 = flags: | bit | meaning if set |
0-31 | reserved (0) | |
0-31 | reserved (0) | |
R1+24... undefined (reserved) | ||
R1+24… undefined (reserved) |
Message &4E382: URI_MProcess |
Process or check URI |
R1+20 = flags: | bit | meaning if set |
R1+20 = flags: | bit | meaning if set |
0 | check URI only, do not process | |
0 | check URI only, do not process | |
0-31 | reserved (0) | |
0-31 | reserved (0) | |
R1+24 = pointer to URI string (URI internal buffer) | ||
R1+24 = pointer to URI string (URI internal buffer) | ||
R1+28 = URI handle | ||
R1+28 = URI handle | ||
R1+32... undefined (reserved) | ||
R1+32… undefined (reserved) |
Message &4E383: URI_MReturnResult |
Return result of a dispatch |
R1+20 = flags: | bit | meaning if set |
R1+20 = flags: | bit | meaning if set |
0 |
0 => URI was claimed for processing 1 => URI was not claimed for processing |
|
0 |
0 => URI was claimed for processing 1 => URI was not claimed for processing |
|
1-31 | reserved (0) | |
1-31 | reserved (0) | |
R1+24 = URI handle | ||
R1+24 = URI handle | ||
R1+28... undefined (reserved) | ||
R1+28… undefined (reserved) |
Message &4E384: URI_MProcessAck |
Acknowledge URI_MProcess |
R1+20 = flags: | bit | meaning if set |
R1+20 = flags: | bit | meaning if set |
0 | Check URI only, do not process | |
0 | Check URI only, do not process | |
1-31 | reserved (0) | |
1-31 | reserved (0) | |
R1+24 = pointer to URI string (URI internal buffer) | ||
R1+24 = pointer to URI string (URI internal buffer) | ||
R1+28 = URI handle | ||
R1+28 = URI handle | ||
R1+32... undefined (reserved) | ||
R1+32… undefined (reserved) |
<notextile>*</notextile>Desktop_AcornURI *Desktop_AcornURI
<notextile>*</notextile>Desktop_AcornURI *Desktop_AcornURI
<notextile>*</notextile>Desktop_AcornURI *Desktop_AcornURI
starts the Acorn URI handler. Do not use*Desktop_AcornURI
*Desktop
<notextile>*</notextile>Desktop_AcornURI
<notextile>*</notextile>Desktop
Do not use <notextile>*</notextile>Desktop_AcornURI, *Desktop_AcornURI, use <notextile>*</notextile>Desktop *Desktop instead.<br> instead. Syntax: <notextile>*</notextile>Desktop_AcornURI
Syntax: *Desktop_AcornURI
<notextile>*</notextile>Desktop_AcornURI<br> *Desktop_AcornURI Use <notextile>*</notextile>Desktop to start AcornURI
Use *Desktop to start AcornURI
<notextile>*</notextile>URIinfo *URIinfo
<notextile>*</notextile>URIinfo *URIinfo
<notextile>*</notextile>URIinfo *URIinfo
produces status information from the Acorn URI handler URIinfo produces status information from the Acorn URI handler.<br> handler. Syntax: <notextile>*</notextile>URIinfo
Syntax: *URIinfo
<notextile>*</notextile>URIinfo<br> *URIinfo URI_taskhandle: 4b4016d8<br> URI chain start: 021cc844<br> URI handle: 022b60d4 (action:00020000) 'http://www.acorn.com/'
URI_taskhandle: 4b4016d8
URI chain start: 021cc844
URI handle: 022b60d4 (action:00020000) 'http://www.acorn.com/'
<notextile>*</notextile>URIdispatch *URIdispatch
<notextile>*</notextile>URIdispatch *URIdispatch <uri> <uri>
<notextile>*</notextile>URIdispatch *URIdispatch
tries to lauch a given URI. No indication is given of whether or not the launch succeeded. URIdispatch tries to launch a URI.<br> URI. Syntax: <notextile>*</notextile>URIdispatch <uri>
Syntax: *URIdispatch <uri>
<notextile>*</notextile>URIdispatch *URIdispatch http://www.acorn.com/
The URI handler has a error chunk base of &810a00.
Currently defined errors are:
Name | Number | Cause |
---|---|---|
Error_URI_NoMemory | Base + 1 | There is not enough memory to complete an operation. |
Error_URI_BadURI | Base + 2 | An empty URI string is supplied (e.g. to URI_DispatchURI). |
Error_URI_BadHandle | Base + 3 | A bad URI handle has been supplied. |
Error_URI_BadFile | Base + 4 | Reported when there is an error accessing a URI file. |
Generator | Returns |
---|---|
URI_DispatchURI | Error_URI_NoMemory Error_URI_BadURI |
URI_RequestURI | Error_URI_BadHandle |
URI_InvalidateURI | Error_URI_BadHandle |
*URIDispatch | Error_URI_NoMemory |
Finally, the WIMP task may generate (through a standard WIMP error box)
Error_URI_NoMemory and Error_URI_BadFile.
URI files have the filetype &F91, with the text equivalent
‘URI’. The URI handler will deal with such files appropriately when the file is
double-clicked upon (currently, it dispatches the URI inside the file – see the
file format description below). Applications must not set an Alias$@RunType
variable for the URI filetype, nor must they deal with DataOpen messages for this
filetype. Applications may respond to DataLoad messages for the filetype as they
see fit.
Suitable sprites exist (four; medium and high resolution file sprites, small
and large variants). These are the only sprite definitions acceptable for use
in this context. The sprites should always be distributed alongside the
module.
URI files consist of a series of lines of characters. Lines are ended by
any number of control code characters (ASCII code less than 32) or the end
of the file. All lines in a file do not have to end in the same way provided
each individual line ends in a valid manner. Other white space is not ignored,
hence a single space character (ASCII code 32) followed by ASCII code 9 does
count as a line containing a single space followed by a line end marker.
URI files support comments. Comment lines start with a ‘#’ (ASCII 35) and end
in the same way as all other lines. Comment lines are not counted; any file
reader that happened to keep track of the line number it was on should not
increment the counter for a comment line. A URI file may contain any number
of comment lines, but automatic file generators are encouraged to keep
comments to a bare minimum to keep file sizes down. Generator code must
never create special comment lines which mean something to accompanying
reader code – comment lines are always skipped by the reader code and never
parsed, beyond identifying them as comments.
The line ending type of a URI file is not fixed as a specific control code
or sequence of control codes (e.g. CR+LF) to allow simple generation from a
variety of sources, including manual authoring. Given this latter possibility,
it is important to stress that unlike, say, HTML, the URI file format is
rigorously defined and must be adhered to. Incorrectly formed files are not
guaranteed to work correctly with either the Acorn URI handler or applications
which support it.
That said, the use of ASCII code 13 followed by ASCII code 10 (CR+LF) to end
lines is strongly encouraged as this is a common line ending type supported
by many different editors on many platforms. ASCII code 9 (tab) could also
be used to give the file a better visual appearence in the editor – it is
still an end of line as far as the file reader is concerned. This convention
provides the potential for greater convenience for the end-user, but must
NOT be assumed in file reading code!
Currently defined formats:
Line number | Contents | |
---|---|---|
(None at present) | 1 | |
2 | Text equivalent of the earliest module version number (as returned by URI_Version) that would fully understand the file contents; e.g. | |
3 | A fully specified URI; v0.05 of the URI handler does not attempt to canonicalise URIs, though future versions may. If this line contains only one character with ASCII code 42 ('*'), the file does not contain a URI and should be ignored (this is to allow future file formats to hold non-fully specified URIs on later lines that could be canonicalised by the URI module, without breaking legacy file reading code). | |
4 | A title string to associate with the URI. Again, if this line contains only one character with ASCII code 42 ('*'), the file does not contain a title string. Processors wishing to display title information alongside a URI may well use the URI itself instead, in this case. |
Future file formats will be backwards compatible with this one, so clients
should only check the version number of the file to know what sort of contents
to expect. So for example, if a version 100 aware application encounters a
later version file, it can assume that the first 4 lines of the file are as
described for the version 100 file; though there may be other lines which
clearly it cannot understand, and must ignore.
For example, the file format rationale may be easier to understand given the
possibility of a future format – version 101, say – which allowed non-fully
specified URIs in line 5 which can be canonicalised, and a preferred external
process to start in line 6. The file could look like this:
URI 6 * Acorn Group PLC www.acorn.com <Browse$Dir>.!Run
Currently defined variables are of the form:
Alias$Open_URI_<scheme> <file to run>
Alias$Open_URI_<scheme> <file run to>
for example,for example,
Alias$Open_URI_http <Browse$Dir>.!Run<br>
Alias$Open_URI_ftp <FTPClient$Dir>.!Run
Alias$Open_URI_http <Browse>.!Run
Alias$Open_URI_ftp <FTPClient>.!Run
If a variable such as the above is defined, then the task it names will be run. If this is successful, the URI will be redispatched in the normal way, so the task has the opportunity of dealing with it.If a variable such as the above is defined, then the task it names will
be run. If this is successful, the URI will be redispatched in the normal
way, so the task has the opportunity of dealing with it.
A comma separated list of handlers may be specified, so applications
must always add to the contents of the variables. At present, only
the first item in the list is used, though this may change in
future versions.
For compatability with existing applications, the URI handler will
support a similar scheme of system variables defined by ANT Ltd.
Details of these are at the time of writing freely available on
the ANT web site.
Final code size of version 1.00 should be about 26K. Quiescent memory
usage should be no more than 512 bytes. When active, the main
storage requirement for each URI being processed is storage of the URI
itself. This is, then, indeterminate, but unlikely to be more than
2K (not that the URI handler will have any such hard coded limits).
An additional overhead of no more than 128 bytes per URI is also
required.