home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************
- This file was created automatically by `FlexCat V1.1'
- Do NOT edit by hand!
- ****************************************************************/
-
- #ifndef FlexCat_CAT_H
- #include "FlexCat_cat.h"
- #endif /* !FlexCat_CAT_H */
-
- #include <clib/locale_protos.h>
-
- #ifdef AZTEC_C
- #include <pragmas/locale_lib.h>
- #endif /* AZTEC_C */
-
- #if defined(__SASC) || defined(_DCC) || defined(__MAXON__)
- #include <pragmas/locale_pragmas.h>
- #endif /* __SASC || _DCC || __MAXON__ */
-
- #ifdef __GNUC__
- #include <inline/locale.h>
- #endif /* __GNUC__ */
-
-
-
-
- static LONG FlexCat_Version = 0;
- static const STRPTR FlexCat_BuiltInLanguage = (STRPTR) "english";
-
- struct FC_Type
- { LONG ID;
- STRPTR Str;
- };
-
-
- static const struct FC_Type FlexCat_Array [] =
- {
- msgMemoryError, (STRPTR) "Out of memory!",
- msgWarning, (STRPTR) "%s, Line %d; warning: "\
- "",
- msgExpectedHex, (STRPTR) "Expected hex character (one of [0-9a-4A-F]).",
- msgExpectedOctal, (STRPTR) "Expected octal character (one of [0-7]).",
- msgNoCatalogDescription, (STRPTR) "Cannot open catalog description %s.",
- msgNoLengthBytes, (STRPTR) "LengthBytes > %d (sizeof long) not possible.",
- msgUnknownCDCommand, (STRPTR) "Unknown catalog description command",
- msgUnexpectedBlanks, (STRPTR) "Unexpected blanks.",
- msgNoIdentifier, (STRPTR) "Missing identifier.",
- msgNoLeadingBracket, (STRPTR) "Missing '('.",
- msgDoubleID, (STRPTR) "ID number used twice.",
- msgDoubleIdentifier, (STRPTR) "Identifier redeclared.",
- msgNoMinLen, (STRPTR) "Expected MinLen (character '/').",
- msgNoMaxLen, (STRPTR) "Expected MaxLen (character '/').",
- msgNoTrailingBracket, (STRPTR) "Expected ')'.",
- msgExtraCharacters, (STRPTR) "Extra characters at the end of the line.",
- msgNoString, (STRPTR) "Unexpected end of file (missing catalog string).",
- msgShortString, (STRPTR) "String too short.",
- msgLongString, (STRPTR) "String too long.",
- msgNoCatalogTranslation, (STRPTR) "Cannot open catalog translation file %s.",
- msgNoCTCommand, (STRPTR) "Missing catalog translation command. (Expected second '#'.)",
- msgUnknownCTCommand, (STRPTR) "Unknown catalog translation command.",
- msgNoCTVersion, (STRPTR) "Missing catalog translation version.",
- msgNoCTLanguage, (STRPTR) "Missing catalog translation language.",
- msgNoCatalog, (STRPTR) "Cannot open catalog file %s.",
- msgNoNewCTFile, (STRPTR) "Cannot create catalog translation file %s.",
- msgUnknownIdentifier, (STRPTR) "%s missing in catalog description.",
- msgNoSourceDescription, (STRPTR) "Cannot open source description file %s.",
- msgNoSource, (STRPTR) "Cannot open source file %s.",
- msgUnknownStringType, (STRPTR) "Unknown string type.",
- msgNoTerminateBracket, (STRPTR) "Unexpected end of line. (Missing ')')",
- msgUsage, (STRPTR) "Usage:\tFlexCat CDFILE/A,CTFILE,CATALOG/K,NEWCTFILE/K,SOURCES/M\n\n"\
- " CDFILE:\tcatalog description file to scan.\n"\
- " CTFILE:\tcatalog translation file to scan.\n"\
- " CATALOG:\tcatalog file to create.\n"\
- " NEWCTFILE:\tcatalog translation file to create.\n"\
- " SOURCES:\tsources to create; must be something like sfile=sdfile,\n"\
- "\t\twhere sfile is a sourcefile and sdfile is a source\n"\
- "\t\tdescription file.\n",
- msgNoCTArgument, (STRPTR) "Creating a catalog needs a catalog translation file as argument.",
- msgNoBinChars, (STRPTR) "Binary characters in stringtype None.",
- };
-
-
- static struct Catalog *FlexCat_Catalog = NULL;
-
- void OpenFlexCatCatalog(struct Locale *loc, STRPTR language)
- { LONG tag, tagarg;
- extern struct Library *LocaleBase;
-
- if (LocaleBase != NULL && FlexCat_Catalog == NULL)
- { if (language == NULL)
- { tag = TAG_IGNORE;
- }
- else
- { tag = OC_Language;
- tagarg = (LONG) language;
- }
- FlexCat_Catalog = OpenCatalog(loc, (STRPTR) "FlexCat.catalog",
- OC_BuiltInLanguage, FlexCat_BuiltInLanguage,
- tag, tagarg,
- OC_Version, FlexCat_Version,
- TAG_DONE);
- }
- }
-
- void CloseFlexCatCatalog(void)
- { if (LocaleBase != NULL)
- { CloseCatalog(FlexCat_Catalog);
- }
- FlexCat_Catalog = NULL;
- }
-
- STRPTR GetFlexCatString(LONG strnum)
- { STRPTR defaultstr = NULL;
- LONG i;
-
- for (i = 0; i < sizeof(FlexCat_Array)/sizeof(struct FC_Type); i++)
- { if (FlexCat_Array[i].ID == strnum)
- { defaultstr = FlexCat_Array[i].Str;
- break;
- }
- }
- if (FlexCat_Catalog == NULL)
- { return(defaultstr);
- }
- return(GetCatalogStr(FlexCat_Catalog, strnum, defaultstr));
- }
-