chiark / gitweb /
Create readable text `.bas' for each tokenized BASIC `,ffb' file.
[ssr] / StraySrc / Libraries / Sapphire / sh / res
1 ;
2 ; res.sh
3 ;
4 ; Locating resources
5 ;
6 ; © 1994-1998 Straylight
7 ;
8
9 ;----- Licensing note -------------------------------------------------------
10 ;
11 ; This file is part of Straylight's Sapphire library.
12 ;
13 ; Sapphire is free software; you can redistribute it and/or modify
14 ; it under the terms of the GNU General Public License as published by
15 ; the Free Software Foundation; either version 2, or (at your option)
16 ; any later version.
17 ;
18 ; Sapphire is distributed in the hope that it will be useful,
19 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 ; GNU General Public License for more details.
22 ;
23 ; You should have received a copy of the GNU General Public License
24 ; along with Sapphire.  If not, write to the Free Software Foundation,
25 ; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
27 ;----- Overview -------------------------------------------------------------
28 ;
29 ; Functions provided:
30 ;
31 ;  res_exists
32 ;  res_country
33 ;  res_find
34 ;  res_init
35
36                 [       :LNOT::DEF:res__dfn
37                 GBLL    res__dfn
38
39 ; --- res_exists ---
40 ;
41 ; On entry:     R0 == pointer to pathname
42 ;
43 ; On exit:      CS if the file exists, CC otherwise
44 ;
45 ; Use:          Tries to find the named file.  The file is deemed to exist
46 ;               if OS_File can return a valid object type for it (i.e. not
47 ;               `non-existant object' or actually raising errors).
48
49                 IMPORT  res_exists
50
51 ; --- res_country ---
52 ;
53 ; On entry:     R0 == pointer to a buffer to use
54 ;
55 ; On exit:      R0 == pointer to country name (may not be in the buffer)
56 ;
57 ; Use:          Reads the name of the current country.  If no name can be
58 ;               found, it returns a pointer to the string `UK' which should
59 ;               do as a suitable default
60
61                 IMPORT  res_country
62
63 ; --- res_find ---
64 ;
65 ; On entry:     R0 == pointer to resource filename
66 ;               R1 == pointer to buffer to build filename in
67 ;
68 ; On exit:      R0 == pointer to start of full pathname (R1 on entry)
69 ;               R1 == pointer to terminating null character
70 ;               CS if the file could actually be found, CC otherwise
71 ;
72 ; Use:          Locates a resource file.  It searches, in order:
73 ;
74 ;               * resPrefix.Resources.leaf[suffix]
75 ;               * resPrefix.Resources.country.leaf[suffix]
76 ;               * resPrefix.leaf[suffix]
77 ;
78 ;               returning the last if none of them could be found.  Note
79 ;               that `country' here is the currently configured country
80 ;               setting, and `suffix' is the WIMP mode aspect ratio suffix
81 ;               for the current mode (RISC OS 3 only).
82
83                 IMPORT  res_find
84
85 ; --- res_init ---
86 ;
87 ; On entry:     R0 == pointer to application name
88 ;
89 ; On exit:      --
90 ;
91 ; Use:          Initialises the resource prefix to <appname$Dir>
92
93                 IMPORT  res_init
94
95                 ]
96
97 ;----- That's all, folks ----------------------------------------------------
98
99                 END