home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / CBMDevKit3.dms / CBMDevKit3.adf / locale / locale.lha / helloworld / helloworld.c next >
Encoding:
C/C++ Source or Header  |  1993-11-04  |  1.7 KB  |  66 lines

  1. ;/*
  2. ;Sample use of CatComp
  3. ;
  4. CatComp helloworld.cd CFILE helloworld_strings.h OBJFILE helloworld_strings.o
  5. CatComp helloworld.cd helloworld.ct CATALOG Catalogs/Français/helloworld.catalog
  6. SC RESOPT PARM=REGISTERS UCHAR CONSTLIB STREQ ANSI NOSTKCHK NOICONS OPT OPTPEEP helloworld.c
  7. Slink LIB:c.o helloworld.o helloworld_strings.o TO HelloWorld LIB LIB:sc.lib SC SD
  8. Quit
  9. */
  10.  
  11. /*
  12. COPYRIGHT: Unless otherwise noted, all files are Copyright (c) 1992-1993
  13. Commodore-Amiga, Inc.  All rights reserved.
  14.  
  15. DISCLAIMER: This software is provided "as is".  No representations or
  16. warranties are made with respect to the accuracy, reliability, performance,
  17. currentness, or operation of this software, and all use is at your own risk.
  18. Neither commodore nor the authors assume any responsibility or liability
  19. whatsoever with respect to your use of this software.
  20. */
  21.  
  22. #include <exec/types.h>
  23. #include <libraries/locale.h>
  24. #include <stdio.h>
  25. #include <dos.h>
  26.  
  27. #include <clib/exec_protos.h>
  28. #include <clib/locale_protos.h>
  29.  
  30. #include <pragmas/exec_pragmas.h>
  31. #include <pragmas/locale_pragmas.h>
  32.  
  33. #define CATCOMP_NUMBERS
  34. #include "helloworld_strings.h"
  35.  
  36.  
  37. extern struct Library *SysBase;
  38. struct Library *LocaleBase;
  39. struct Library *DOSBase;
  40.  
  41.  
  42. STRPTR __asm GetString(register __a0 struct LocaleInfo *li,
  43.                        register __d0 LONG stringNum);
  44.  
  45.  
  46. VOID main(VOID)
  47. {
  48. struct LocaleInfo li;
  49.  
  50.     li.li_Catalog = NULL;
  51.     if (LocaleBase = OpenLibrary("locale.library",38))
  52.     {
  53.         li.li_LocaleBase = LocaleBase;
  54.         li.li_Catalog    = OpenCatalogA(NULL,"helloworld.catalog",NULL);
  55.     }
  56.  
  57.     printf("%s\n",GetString(&li,MSG_HELLO));
  58.     printf("%s\n",GetString(&li,MSG_BYE));
  59.  
  60.     if (LocaleBase)
  61.     {
  62.         CloseCatalog(li.li_Catalog);
  63.         CloseLibrary(LocaleBase);
  64.     }
  65. }
  66.