home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 106 / EnigmaAmiga106CD.iso / software / sviluppo / ahisrc / device / c_c_ahi.sd < prev    next >
Encoding:
Text File  |  1999-01-15  |  2.5 KB  |  131 lines

  1. ##stringtype C
  2. ##shortstrings
  3. /* $Id: C_c_AHI.sd,v 4.2 1999/01/15 22:40:25 lcs Exp $
  4. * $Log: C_c_AHI.sd,v $
  5. * Revision 4.2  1999/01/15 22:40:25  lcs
  6. * Fixed a couple of warnings.
  7. *
  8. * Revision 4.1  1997/04/02 22:29:53  lcs
  9. * Bumped to version 4
  10. *
  11. * Revision 1.1  1997/02/03 16:22:45  lcs
  12. * Initial revision
  13. *
  14. */
  15. /****************************************************************
  16.    This file was created automatically by `%fv'
  17.    from "%f0".
  18.  
  19.    Do NOT edit by hand!
  20. ****************************************************************/
  21.  
  22. #include "ahi_def.h"
  23.  
  24. #include <libraries/locale.h>
  25. #include <proto/locale.h>
  26.  
  27.  
  28. static LONG %b_Version = %v;
  29. static const STRPTR %b_BuiltInLanguage = (STRPTR) %l;
  30.  
  31. struct FC_Type
  32. {   LONG   ID;
  33.     STRPTR Str;
  34. };
  35.  
  36.  
  37. const struct FC_Type _%i = { %d, %s };
  38.  
  39.  
  40. static struct Catalog *%b_Catalog = NULL;
  41.  
  42. void Open%bCatalog(struct Locale *loc, STRPTR language)
  43. {
  44.   LONG tag, tagarg;
  45.  
  46.   if(LocaleBase != NULL  &&  %b_Catalog == NULL)
  47.   {
  48.     if(language == NULL)
  49.     {
  50.       tag = TAG_IGNORE;
  51.     }
  52.     else
  53.     {
  54.       tag = OC_Language;
  55.       tagarg = (LONG) language;
  56.     }
  57.  
  58.     %b_Catalog = OpenCatalog(loc, (STRPTR) "%b.catalog",
  59.         OC_BuiltInLanguage, (ULONG) %b_BuiltInLanguage,
  60.         tag, tagarg,
  61.         OC_Version, %b_Version,
  62.         TAG_DONE);
  63.   }
  64. }
  65.  
  66. struct Catalog *ExtOpenCatalog(struct Locale *loc, STRPTR language)
  67. {
  68.   LONG tag, tagarg;
  69.  
  70.   if(LocaleBase != NULL)
  71.   {
  72.     if(language == NULL)
  73.     {
  74.       tag = TAG_IGNORE;
  75.     }
  76.     else
  77.     {
  78.       tag = OC_Language;
  79.       tagarg = (LONG) language;
  80.     }
  81.  
  82.     return OpenCatalog(loc, (STRPTR) "%b.catalog",
  83.         OC_BuiltInLanguage, (ULONG) %b_BuiltInLanguage,
  84.         tag, tagarg,
  85.         OC_Version, %b_Version,
  86.         TAG_DONE);
  87.   }
  88.   return NULL;
  89. }
  90.  
  91. void Close%bCatalog(void)
  92. {
  93.   if (LocaleBase != NULL)
  94.   {
  95.     CloseCatalog(%b_Catalog);
  96.   }
  97.   %b_Catalog = NULL;
  98. }
  99.  
  100. void ExtCloseCatalog(struct Catalog *catalog)
  101. {
  102.   if (LocaleBase != NULL)
  103.   {
  104.     CloseCatalog(catalog);
  105.   }
  106. }
  107.  
  108. STRPTR Get%bString(APTR fcstr)
  109. {
  110.   STRPTR defaultstr;
  111.   LONG strnum;
  112.  
  113.   strnum = ((struct FC_Type *) fcstr)->ID;
  114.   defaultstr = ((struct FC_Type *) fcstr)->Str;
  115.  
  116.   return(%b_Catalog ? GetCatalogStr(%b_Catalog, strnum, defaultstr) :
  117.               defaultstr);
  118. }
  119.  
  120. STRPTR GetString(APTR fcstr, struct Catalog *catalog)
  121. {
  122.   STRPTR defaultstr;
  123.   LONG strnum;
  124.  
  125.   strnum = ((struct FC_Type *) fcstr)->ID;
  126.   defaultstr = ((struct FC_Type *) fcstr)->Str;
  127.  
  128.   return(catalog ? GetCatalogStr(catalog, strnum, defaultstr) :
  129.               defaultstr);
  130. }
  131.