]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/forms_gettext.C
xforms clean-up, described in detail in my mail of 31 May. See
[lyx.git] / src / frontends / xforms / forms_gettext.C
1 /**
2  * \file forms_gettext.C
3  * Copyright 2002 the LyX Team
4  * Read the file COPYING
5  *
6  * \author Angus Leeming, leeming@lyx.org
7  */
8 #include <config.h>
9
10 #ifdef __GNUG__
11 #pragma implementation
12 #endif
13
14 #include "forms_gettext.h"
15
16 #include FORMS_H_LOCATION
17
18 // Extract shortcut from <ident>|<shortcut> string
19 char const * flyx_shortcut_extract(char const * sc)
20 {
21         // Find '|' in the sc and return the string after that.
22         register char const * sd = sc;
23         while (sd[0]!= 0 && sd[0] != '|') ++sd;
24
25         if (sd[0] == '|') {
26                 ++sd;
27                 return sd;
28         }
29         return "";
30 }
31
32
33 // Extract identifier from <ident>|<shortcut> string
34 char const * flyx_ident_extract(char const * sc)
35 {
36         register char const * se = sc;
37         while (se[0]!= 0 && se[0] != '|') ++se;
38
39         if (se[0] == 0) return sc;
40
41         char * sb = new char[se - sc + 1];
42         int index = 0;
43         register char const * sd = sc;
44         while (sd != se) {
45                 sb[index] = sd[0];
46                 ++index; ++sd;
47         }
48         sb[index] = 0;
49         return sb;
50 }