#ifndef LOCALE_H
#define LOCALE_H


/****************************************************************************/


/* This file was created automatically by CatComp.
 * Do NOT edit by hand!
 */


#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif

#ifdef CATCOMP_ARRAY
#undef CATCOMP_NUMBERS
#undef CATCOMP_STRINGS
#define CATCOMP_NUMBERS
#define CATCOMP_STRINGS
#endif

#ifdef CATCOMP_BLOCK
#undef CATCOMP_STRINGS
#define CATCOMP_STRINGS
#endif


/****************************************************************************/


#ifdef CATCOMP_NUMBERS

#define MSG_STDTX 100
#define MSG_INSTL 101
#define MSG_INSTS 102
#define MSG_INSTH 103
#define MSG_GROUP 104
#define MSG_OPTOS 105
#define MSG_NUMBR 106
#define MSG_DIMEN 107
#define MSG_COMMT 108
#define MSG_MATHM 109
#define MSG_MATHS 110
#define MSG_INSCR 111
#define MSG_MCARG 112
#define MSG_ISPEL 113
#define MSG_PARSR 114

#endif /* CATCOMP_NUMBERS */


/****************************************************************************/


#ifdef CATCOMP_STRINGS

#define MSG_STDTX_STR "Standard text"
#define MSG_INSTL_STR "Long instructions"
#define MSG_INSTS_STR "Short instructions"
#define MSG_INSTH_STR "Hidden instructions"
#define MSG_GROUP_STR "Groups {}"
#define MSG_OPTOS_STR "Options []"
#define MSG_NUMBR_STR "Numbers"
#define MSG_DIMEN_STR "Dimensions"
#define MSG_COMMT_STR "Comments"
#define MSG_MATHM_STR "Math mode"
#define MSG_MATHS_STR "Lower - Exponent"
#define MSG_INSCR_STR "Uncutable car"
#define MSG_MCARG_STR "Macro arguments"
#define MSG_ISPEL_STR "ISpell Errors"
#define MSG_PARSR_STR "TeX script cached parser"

#endif /* CATCOMP_STRINGS */


/****************************************************************************/


#ifdef CATCOMP_ARRAY

struct CatCompArrayType
{
    LONG   cca_ID;
    STRPTR cca_Str;
};

static const struct CatCompArrayType CatCompArray[] =
{
    {MSG_STDTX,(STRPTR)MSG_STDTX_STR},
    {MSG_INSTL,(STRPTR)MSG_INSTL_STR},
    {MSG_INSTS,(STRPTR)MSG_INSTS_STR},
    {MSG_INSTH,(STRPTR)MSG_INSTH_STR},
    {MSG_GROUP,(STRPTR)MSG_GROUP_STR},
    {MSG_OPTOS,(STRPTR)MSG_OPTOS_STR},
    {MSG_NUMBR,(STRPTR)MSG_NUMBR_STR},
    {MSG_DIMEN,(STRPTR)MSG_DIMEN_STR},
    {MSG_COMMT,(STRPTR)MSG_COMMT_STR},
    {MSG_MATHM,(STRPTR)MSG_MATHM_STR},
    {MSG_MATHS,(STRPTR)MSG_MATHS_STR},
    {MSG_INSCR,(STRPTR)MSG_INSCR_STR},
    {MSG_MCARG,(STRPTR)MSG_MCARG_STR},
    {MSG_ISPEL,(STRPTR)MSG_ISPEL_STR},
    {MSG_PARSR,(STRPTR)MSG_PARSR_STR},
};

#endif /* CATCOMP_ARRAY */


/****************************************************************************/


#ifdef CATCOMP_BLOCK

static const char CatCompBlock[] =
{
    "\x00\x00\x00\x64\x00\x0E"
    MSG_STDTX_STR "\x00"
    "\x00\x00\x00\x65\x00\x12"
    MSG_INSTL_STR "\x00"
    "\x00\x00\x00\x66\x00\x14"
    MSG_INSTS_STR "\x00\x00"
    "\x00\x00\x00\x67\x00\x14"
    MSG_INSTH_STR "\x00"
    "\x00\x00\x00\x68\x00\x0A"
    MSG_GROUP_STR "\x00"
    "\x00\x00\x00\x69\x00\x0C"
    MSG_OPTOS_STR "\x00\x00"
    "\x00\x00\x00\x6A\x00\x08"
    MSG_NUMBR_STR "\x00"
    "\x00\x00\x00\x6B\x00\x0C"
    MSG_DIMEN_STR "\x00\x00"
    "\x00\x00\x00\x6C\x00\x0A"
    MSG_COMMT_STR "\x00\x00"
    "\x00\x00\x00\x6D\x00\x0A"
    MSG_MATHM_STR "\x00"
    "\x00\x00\x00\x6E\x00\x12"
    MSG_MATHS_STR "\x00\x00"
    "\x00\x00\x00\x6F\x00\x0E"
    MSG_INSCR_STR "\x00"
    "\x00\x00\x00\x70\x00\x10"
    MSG_MCARG_STR "\x00"
    "\x00\x00\x00\x71\x00\x0E"
    MSG_ISPEL_STR "\x00"
    "\x00\x00\x00\x72\x00\x1A"
    MSG_PARSR_STR "\x00\x00"
};

#endif /* CATCOMP_BLOCK */


/****************************************************************************/


struct LocaleInfo
{
    APTR li_LocaleBase;
    APTR li_Catalog;
};


#ifdef CATCOMP_CODE

STRPTR GetString(struct LocaleInfo *li, LONG stringNum)
{
LONG   *l;
UWORD  *w;
STRPTR  builtIn;

    l = (LONG *)CatCompBlock;

    while (*l != stringNum)
    {
        w = (UWORD *)((ULONG)l + 4);
        l = (LONG *)((ULONG)l + (ULONG)*w + 6);
    }
    builtIn = (STRPTR)((ULONG)l + 6);

#define XLocaleBase LocaleBase
#define LocaleBase li->li_LocaleBase
    
    if (LocaleBase)
        return(GetCatalogStr(li->li_Catalog,stringNum,builtIn));
#define LocaleBase XLocaleBase
#undef XLocaleBase

    return(builtIn);
}


#endif /* CATCOMP_CODE */


/****************************************************************************/


#endif /* LOCALE_H */
