Initial revision
[ssr] / StraySrc / Libraries / Sapphire / sh / choices / choices
1 ;
2 ; choices.choices.sh
3 ;
4 ; Locate user-configurable resource files
5 ;
6 ; © 1995-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 ; choices_useChoices
32 ; choices_find
33
34 [ :LNOT::DEF:choices__dfn
35 GBLL choices__dfn
36
37 ; --- choices_useChoices ---
38 ;
39 ; On entry: R0 == 0 to disable use of `Choices', >0 to enable, or <0 to
40 ; read
41 ;
42 ; On exit: R0 == previous setting
43 ;
44 ; Use: This call allows an application to determine whether its
45 ; user-configurable resources are looked for in Acorn's
46 ; `Choices' directory, or only in the application's directory.
47 ;
48 ; An application would typically make this call after parsing
49 ; its command-line options, to allow a Network Manager to
50 ; enable the `Choices' support.
51
52 IMPORT choices_useChoices
53
54 ; --- choices_find ---
55 ;
56 ; On entry: R0 == pointer to resource filename
57 ; R1 == pointer to buffer to build filename in
58 ; R2 == flags:
59 ; bit 0 == file will be written to (use Choices$Write)
60 ;
61 ; On exit: R0 == pointer to filename
62 ; R1 == pointer to terminating NULL
63 ; CS if the file was found, else CC
64 ;
65 ; Use: Locates a user-configurable resource file. The search order
66 ; depends on (a) whether the file will be written (bit 0 of R2)
67 ; and (b) whether the use of Acorn's `Choices' system is
68 ; enabled.
69 ;
70 ; The search order is as follows:
71 ;
72 ; * Choices:appName.leaf / <Choices$Write>.appName.leaf
73 ; * res_find(leaf)
74 ;
75 ; (i.e. it looks in the `Choices' structure first, and if that
76 ; fails, it will use res_find).
77
78 IMPORT choices_find
79
80 ]
81
82 ;----- That's all, folks ----------------------------------------------------
83
84 END