Subversion Repositories SvarDOS

Rev

Rev 1273 | Rev 1278 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1273 Rev 1277
Line 24... Line 24...
24
 
24
 
25
#ifndef SVARLANG_H
25
#ifndef SVARLANG_H
26
#define SVARLANG_H
26
#define SVARLANG_H
27
 
27
 
28
/* library version */
28
/* library version */
29
#define SVARLANGVER "20230630"
29
#define SVARLANGVER "20230709"
30
 
30
 
31
/* returns a pointer to a string with the SvarLANG's library version,
31
/* returns a pointer to a string with the SvarLANG's library version,
32
 * independently of the SVARLANGVER string above. */
32
 * independently of the SVARLANGVER string above. */
33
const char *svarlang_getver(void);
33
const char *svarlang_getver(void);
34
 
34
 
35
/* loads translations for program progname, language lang, in paths.
35
/* loads lang translations from file fname.
36
 *
36
 *
37
 * only the two first letters of the lang strings are meaningful and they are
37
 * only the two first letters of the lang strings are meaningful and they are
38
 * case insensitive.
38
 * case insensitive.
39
 *
39
 *
40
 * paths can be either a directory path (like "C:\DATA") or a list of paths
-
 
41
 * separated by a semicolon (example: "C:\DATA;.\LANGS;."). It may also be
-
 
42
 * NULL, in which case only the current directory will be searched.
-
 
43
 *
-
 
44
 * a typical call would be this: svarlang_load("myprog", "PL", NULL);
40
 * a typical call would be: svarlang_load("myprog.lng", "PL");
45
 *
41
 *
46
 * this function returns 0 on success, non-zero otherwise. It is still possible
42
 * this function returns 0 on success, non-zero otherwise. It is still possible
47
 * to call svarlang_strid() after a load failure, the previously loaded
43
 * to call svarlang_strid() after a load failure, the previously loaded
48
 * language will be used then, or the default language if no loading has been
44
 * language will be used then, or the default language if no loading has been
49
 * done yet. */
45
 * done yet. */
50
int svarlang_load(const char *progname, const char *lang, const char *paths);
46
int svarlang_load(const char *fname, const char *lang);
51
 
47
 
52
 
48
 
53
/* same as svarlang_load(), but relies on getenv() to pull LANG and NLSPATH.
49
/* this relies on getenv() to pull LANG and NLSPATH variables and looks
-
 
50
 * for a translation file named "%NLSPATH%\progname.lng".
54
 * this call should be used only by "CORE" SvarDOS programs. */
51
 * this call should be used only by "CORE" SvarDOS programs. */
55
int svarlang_autoload(const char *progname);
52
int svarlang_autoload_nlspath(const char *progname);
56
 
53
 
-
 
54
/* alias to svarlang_autoload_nlspath() */
-
 
55
int svarlang_autoload(const char *progname);
57
 
56
 
58
/* Returns a pointer to the string "id". Does not require svalang_load() to be
57
/* Returns a pointer to the string "id". Does not require svalang_load() to be
59
 * executed, but then it will only return the reference language strings.
58
 * executed, but then it will only return the reference language strings.
60
 * a string id is the concatenation of the CATS-style identifiers, for example
59
 * a string id is the concatenation of the CATS-style identifiers, for example
61
 * string 1,0 becomes 0x0100, string 2.10 is 0x020A, etc.
60
 * string 1,0 becomes 0x0100, string 2.10 is 0x020A, etc.