##rem $Id$
##stringtype C
##shortstrings

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

   This file was created automatically by `%fv'
   from "%f0".

   Do NOT edit by hand!

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

/* Include files */
#include <libraries/gadtools.h>
#include <proto/locale.h>
#include <string.h>

#include "%b_cat.h"

/* Variables */
struct FC_String %b_Strings[] =
{
   { %s, %d },
   { NULL, 0 }
};

static struct Catalog *%bCatalog;

void Open%bCatalog()
{
   if(LocaleBase != NULL)
   {
      if ((%bCatalog = OpenCatalog(NULL, (STRPTR)"%b.catalog",
                                         OC_BuiltInLanguage, (STRPTR)%l,
                                         OC_Version, %v,
                                         TAG_DONE)) != NULL)
      {
         struct FC_String *fc;

         for(fc = %b_Strings; fc->Str; fc++)
         {
            fc->Str = (const char *)GetCatalogStr(%bCatalog, fc->Id, (STRPTR)fc->Str);
         }
      }
   }
}

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

void LocalizeStringArray(STRPTR *Array)
{
   STRPTR *x;

   for(x = Array; *x != NULL; x++)
   {
      *x = strdup(%b_Strings[(int)*x].Str);
   }
}
