home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 2 / FFMCD02.bin / new / dev / misc / flexcat / c_c_v21.sd < prev    next >
Text File  |  1993-12-21  |  2KB  |  81 lines

  1. ##stringtype C
  2. ##shortstrings
  3. /****************************************************************
  4.    This file was created automatically by `FlexCat V1.0'
  5.    Do NOT edit by hand!
  6. ****************************************************************/
  7.  
  8. #ifndef %b_CAT_H
  9. #include "%b_cat.h"
  10. #endif    /*  !%b_CAT_H            */
  11.  
  12. #ifndef CLIB_LOCALE_PROTOS_H
  13. #include <clib/locale_protos.h>
  14. #endif    /*  !CLIB_LOCALE_PROTOS_H   */
  15.  
  16. #ifdef AZTEC_C
  17. #ifndef __PRAGMAS_LOCALE_LIB_H
  18. #include <pragmas/locale_lib.h>
  19. #endif /*   !PRAGMAS_LOCALE_LIB_H   */
  20. #endif /*   AZTEC_C            */
  21.  
  22. static LONG %b_Version = %v;
  23. static const STRPTR %b_BuiltInLanguage = (STRPTR) %l;
  24.  
  25. struct FC_Type
  26. {   LONG   ID;
  27.     STRPTR Str;
  28. };
  29.  
  30.  
  31. static const struct FC_Type %b_Array [] =
  32. {
  33.     %i, (STRPTR) %s,
  34. };
  35.  
  36.  
  37. static struct Catalog *%b_Catalog = NULL;
  38.  
  39. void Open%bCatalog(struct Locale *loc, STRPTR language)
  40. { LONG tag, tagarg;
  41.   extern struct Library *LocaleBase;
  42.  
  43.   if (language == NULL)
  44.   { tag = TAG_IGNORE;
  45.   }
  46.   else
  47.   { tag = OC_Language;
  48.     tagarg = (LONG) language;
  49.   }
  50.   if (LocaleBase != NULL  &&  %b_Catalog == NULL)
  51.   { %b_Catalog = OpenCatalog(loc, (STRPTR) "%b.catalog",
  52.                  OC_BuiltInLanguage, %b_BuiltInLanguage,
  53.                  tag, tagarg,
  54.                  OC_Version, %b_Version,
  55.                  TAG_DONE);
  56.   }
  57. }
  58.  
  59. void Close%bCatalog(void)
  60. { if (LocaleBase != NULL)
  61.   { CloseCatalog(%b_Catalog);
  62.   }
  63.   %b_Catalog = NULL;
  64. }
  65.  
  66. STRPTR Get%bString(LONG strnum)
  67. { STRPTR defaultstr = NULL;
  68.   LONG i;
  69.  
  70.   for (i = 0;  i < sizeof(%b_Array)/sizeof(struct FC_Type);  i++)
  71.     { if (%b_Array[i].ID == strnum)
  72.       { defaultstr = %b_Array[i].Str;
  73.     break;
  74.       }
  75.     }
  76.   if (%b_Catalog == NULL)
  77.   { return(defaultstr);
  78.   }
  79.   return(GetCatalogStr(%b_Catalog, strnum, defaultstr));
  80. }
  81.