MUI/BetterString: Move SDI*.h headers to include/SDI/SDI_*.h
[AROS.git] / workbench / classes / zune / betterstring / mcp / C_c.sd
blob8f50c09fb95449bcc434753681a99e5b89c7ca44
1 ##stringtype C
2 ##shortstrings
3 /***************************************************************************
5  BetterString.mcc - A better String gadget MUI Custom Class
6  Copyright (C) 1997-2000 Allan Odgaard
7  Copyright (C) 2005-2007 by BetterString.mcc Open Source Team
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Lesser General Public
11  License as published by the Free Software Foundation; either
12  version 2.1 of the License, or (at your option) any later version.
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  Lesser General Public License for more details.
19  BetterString class Support Site:  http://www.sf.net/projects/bstring-mcc/
21  $Id: C_c.sd 180 2009-06-02 17:13:38Z damato $
23 ***************************************************************************/
25 /****************************************************************
26    This file was created automatically by `FlexCat V1.3'
27 ****************************************************************/
29 #include <proto/locale.h>
31 #include <SDI/SDI_compiler.h>
33 struct FC_Type { const long ID; const char *Str; };
35 const struct FC_Type _%i = { %d, %s };
37 static struct Catalog *BS_Catalog = NULL;
39 /*** Catalog functions ***/
40 /// GetStr()
41 const char *GetStr(APTR fcstr)
43   const char *defaultstr = ((struct FC_Type *)fcstr)->Str;
45   if(LocaleBase)
46   {
47     return GetCatalogStr(BS_Catalog, ((struct FC_Type *)fcstr)->ID, (STRPTR)defaultstr);
48   }
50   return defaultstr;
52 ///
53 /// GetStripStr()
54 // function that will strip out the special menusigns
55 const char *GetStripStr(APTR fcstr)
57    const char *loc_str = GetStr(fcstr);
59    return (0 == loc_str[1] ? &loc_str[2] : loc_str);
61 ///
62 /// CloseCat()
63 void CloseCat(void)
65   if (LocaleBase) CloseCatalog(BS_Catalog);
66   BS_Catalog = NULL;
68 ///
69 /// OpenCat(void)
70 void OpenCat(void)
72   static const struct TagItem tags[] = {
73                                          { OC_BuiltInLanguage, (IPTR)%l },
74                                          { OC_Version,         %v },
75                                          { TAG_DONE,           0  }
76                                        };
78   if(LocaleBase && !BS_Catalog)
79     BS_Catalog = OpenCatalogA(NULL, (STRPTR)"%b.catalog", (struct TagItem *)&tags[0]);
81 ///