chiark / gitweb /
Initial revision
[ssr] / StraySrc / Libraries / Steel / h / msgs
1 /*
2  * msgs.h
3  *
4  * Handling message files
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 __msgs_h
29 #define __msgs_h
30
31 /*----- Implementation limits ---------------------------------------------*
32  *
33  * These limits are not enforced.  Woe betides anyone who oversteps them.
34  */
35
36 #define msgs_TAG_MAX 20
37 #define msgs_MSG_MAX 1024
38 #define msgs_VARIANT_MAX 10
39
40 /*----- Functions ---------------------------------------------------------*/
41
42 /*
43  * void msgs_init(void)
44  *
45  * Use
46  *  Loads the messages file `Messages' using msgs_readfile.
47  */
48
49 void msgs_init(void);
50
51 /*
52  * void msgs_readfile(char *name)
53  *
54  * Use
55  *  Merges the file named into the current messages.  Duplicates are likely
56  *  to cause problems, so try to avoid them.  The file is found using the
57  *  res_findname mechanism.
58  *
59  * Parameters
60  *  char *name == pointer to the name of the messages file
61  */
62
63 void msgs_readfile(char *name);
64
65 /*
66  * char *msgs_lookup(char *tag)
67  *
68  * Use
69  *  Looks up a message given its tag.  The tag may optionally be followed by
70  *  a default string, which is returned if the message is not found.  If no
71  *  default is supplied, and the message tag is not found, the tag is
72  *  returned.
73  *
74  * Parameters
75  *  char *tag == pointer to tag string to find
76  */
77
78 char *msgs_lookup(char *tag);
79
80 /*
81  * void msgs_delete(void)
82  *
83  * Use
84  *  Removes all messages from memory.
85  */
86
87 void msgs_delete(void);
88
89 #endif