##stringtype C
##shortstrings
/****************************************************************
   This file was created automatically by `FlexCat V1.1'
   Do NOT edit by hand!
****************************************************************/

#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 %b_Version = %v;
static const STRPTR %b_BuiltInLanguage = (STRPTR) %l;

struct FC_Type
{   LONG   ID;
    STRPTR Str;
};


const struct FC_Type _%i = { %d, %s };


static struct Catalog *%b_Catalog = NULL;

void Open%bCatalog(struct Locale *loc, STRPTR language)
{ LONG tag, tagarg;
  extern struct Library *LocaleBase;
  extern void Close%bCatalog(void);

  Close%bCatalog(); /* Not needed if the programmer pairs Open%bCatalog
		       and Close%bCatalog right, but does no harm.  */

  if (LocaleBase != NULL  &&  %b_Catalog == NULL)
  { if (language == NULL)
    { tag = TAG_IGNORE;
    }
    else
    { tag = OC_Language;
      tagarg = (LONG) language;
    }
    %b_Catalog = OpenCatalog(loc, (STRPTR) "%b.catalog",
				OC_BuiltInLanguage, %b_BuiltInLanguage,
				tag, tagarg,
				OC_Version, %b_Version,
				TAG_DONE);
  }
}

void Close%bCatalog(void)
{ if (LocaleBase != NULL)
  { CloseCatalog(%b_Catalog);
  }
  %b_Catalog = NULL;
}

STRPTR Get%bString(APTR fcstr)
{ STRPTR defaultstr;
  LONG strnum;

  strnum = ((struct FC_Type *) fcstr)->ID;
  defaultstr = ((struct FC_Type *) fcstr)->Str;

  return(%b_Catalog ? GetCatalogStr(%b_Catalog, strnum, defaultstr) :
		      defaultstr);
}
