home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / files / util / misc / multiuser / src / library / locale.c < prev    next >
C/C++ Source or Header  |  1994-06-29  |  1KB  |  53 lines

  1. /************************************************************
  2. * MultiUser - MultiUser Task/File Support System                *
  3. * ---------------------------------------------------------    *
  4. * Locale Routines                                                            *
  5. * ---------------------------------------------------------    *
  6. * © Copyright 1993-1994 Geert Uytterhoeven                        *
  7. * All Rights Reserved.                                                    *
  8. ************************************************************/
  9.  
  10. #include <string.h>
  11.  
  12. #include <proto/exec.h>
  13. #include <proto/locale.h>
  14. #include <exec/semaphores.h>
  15.  
  16. #include "Config.h"
  17. #include "Locale.h"
  18. #include "LibHeader.h"
  19.  
  20. #undef LocaleBase
  21. #define LocaleBase li->li_LocaleBase
  22.  
  23. void OpenLoc(struct LocaleInfo *li)
  24. {
  25.     li->li_LocaleBase = muBase->LogInfo.li_LocaleBase;
  26.     if    (LocaleBase)
  27.         li->li_Catalog = OpenCatalog(0,MULTIUSERCATALOGNAME,
  28.                                      OC_BuiltInLanguage,"english",
  29.                                      OC_Version,MULTIUSERCATALOGVERSION,
  30.                                      TAG_DONE);
  31.     else
  32.         li->li_Catalog = 0;
  33. }
  34.  
  35. void CloseLoc(struct LocaleInfo *li)
  36. {
  37.     if(LocaleBase)
  38.         CloseCatalog(li->li_Catalog);
  39. }
  40.  
  41.  
  42. STRPTR GetLocStr(LONG id)
  43.  
  44. {
  45.    struct LocaleInfo li;
  46.     STRPTR s;
  47.     
  48.     OpenLoc(&li);
  49.     s = GetLocS(&li,id);
  50.     CloseLoc(&li);
  51.     return(s);
  52. }
  53.