/************************************************************
* MultiUser - MultiUser Task/File Support System				*
* ---------------------------------------------------------	*
* Locale Routines															*
* ---------------------------------------------------------	*
* © Copyright 1993-1994 Geert Uytterhoeven						*
* All Rights Reserved.													*
************************************************************/

#include <string.h>

#include <proto/exec.h>
#include <proto/locale.h>
#include <exec/semaphores.h>

#include "Config.h"
#include "Locale.h"
#include "LibHeader.h"

#undef LocaleBase
#define LocaleBase li->li_LocaleBase

void OpenLoc(struct LocaleInfo *li)
{
	li->li_LocaleBase = muBase->LogInfo.li_LocaleBase;
	if	(LocaleBase)
		li->li_Catalog = OpenCatalog(0,MULTIUSERCATALOGNAME,
		                             OC_BuiltInLanguage,"english",
		                             OC_Version,MULTIUSERCATALOGVERSION,
		                             TAG_DONE);
	else
		li->li_Catalog = 0;
}

void CloseLoc(struct LocaleInfo *li)
{
	if(LocaleBase)
		CloseCatalog(li->li_Catalog);
}


STRPTR GetLocStr(LONG id)

{
   struct LocaleInfo li;
	STRPTR s;
	
	OpenLoc(&li);
	s = GetLocS(&li,id);
	CloseLoc(&li);
	return(s);
}
