Initial revision
[ssr] / StraySrc / Libraries / Steel / h / choices
1 /*
2 * choices.h
3 *
4 * Handling the global choices repository
5 *
6 * © 1994-1998 Straylight
7 */
8
9 /*----- Licensing note ----------------------------------------------------*
10 *
11 * This file is part of Straylight's Steel library.
12 *
13 * Steel 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 * Steel 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 Steel. If not, write to the Free Software Foundation,
25 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 */
27
28 #ifndef __choices_h
29 #define __choices_h
30
31 #ifndef BOOL
32 #define BOOL int
33 #define TRUE 1
34 #define FALSE 0
35 #endif
36
37 /*
38 * void choices_setName(char *progname)
39 *
40 * Use
41 * Sets the name of the application as used by choices. The name is
42 * truncated to 10 characters if necessary. If no name is specified (i.e.
43 * you don't call this routine) then the name of the application (as passed
44 * to wimpt_init) is assumed.
45 */
46
47 void choices_setName(char *progname);
48
49 /*
50 * char *choices_name(char *leaf,BOOL writable)
51 *
52 * Use
53 * Locates the name of the specified resource. If you want to open a file
54 * for writing, you should set the writable flag. Otherwise, this routine
55 * will try to find the name of a file which already exists.
56 *
57 * If you only want to read a file, this routine will first look at
58 * <Choices$Dir>.leaf, and then at <resPrefix>.leaf, and return whichever
59 * is found first. If neither exists, a name is returned as for the
60 * writable case.
61 *
62 * If you want to write a file, then <Choices$Dir>.leaf is returned, unless
63 * Choices$Dir is unset, in which case <resPrefix>.leaf is returned.
64 *
65 * resPrefix is the prefix passed to res through res_init or res_setPrefix.
66 */
67
68 char *choices_name(char *leaf,BOOL writable);
69
70 #endif