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