Kernel/debug - Clean up Debug() method, bind to #define config
[tpg/acess2.git] / Usermode / Applications / gui_ate_src / strings.c
1 /*
2  * Acess Text Editor (ATE)
3  * - By John Hodge (thePowersGang)
4  *
5  * strings.c
6  * - String Localisation
7  */
8 #include "strings.h"
9 #include <string.h>
10
11 struct keyval_str
12 {
13         const char      *key;
14         const char      *val;
15 };
16
17 const struct keyval_str gaDisplayStrings[] = {
18         {"BtnNew", "New"},
19         {"BtnOpen", "Open"},
20         {"BtnSave", "Save"},
21         {"BtnClose", "Close"},
22         {"BtnUndo", "Undo"},
23         {"BtnRedo", "Redo"},
24         {"BtnCut", "Cut"},
25         {"BtnCopy", "Copy"},
26         {"BtnPaste", "Paste"},
27         {"BtnSearch", "Search"},
28         {"BtnReplace", "Replace"},
29         };
30 const int       ciNumDisplayStrings = sizeof(gaDisplayStrings)/sizeof(gaDisplayStrings[0]);
31 const struct keyval_str gaImageStrings[] = {
32         {"BtnNew", "file:///Acess/Apps/AxWin/3.0/toolbar_new.sif"},
33         {"BtnOpen", "file:///Acess/Apps/AxWin/3.0/toolbar_open.sif"},
34         {"BtnSave", "file:///Acess/Apps/AxWin/3.0/toolbar_save.sif"}
35         };
36 const int       ciNumImageStrings = sizeof(gaImageStrings)/sizeof(gaImageStrings[0]);
37
38 const char *getstr(const char *key)
39 {
40          int    i;
41         for(i = 0; i < ciNumDisplayStrings; i ++)
42         {
43                 if( strcmp(key, gaDisplayStrings[i].key) == 0 )
44                         return gaDisplayStrings[i].val;
45         }
46         return "-nostr-";
47 }
48
49 const char *getimg(const char *key)
50 {
51          int    i;
52         for(i = 0; i < ciNumImageStrings; i ++)
53         {
54                 if( strcmp(key, gaImageStrings[i].key) == 0 )
55                         return gaImageStrings[i].val;
56         }
57         return NULL;
58 }

UCC git Repository :: git.ucc.asn.au