home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / edu / DITOdev.lha / DITOdev / Extensions / Source / Latinum / cat.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-23  |  2.6 KB  |  93 lines

  1. /****************************************************************
  2.    This file was created automatically by `KitCat V1.1'
  3.    Do NOT edit by hand!
  4. ****************************************************************/
  5.  
  6. #ifndef CAT_H
  7. #include "CAT.h"
  8. #endif  /*  !CAT_H           */
  9.  
  10. #ifndef CLIB_LOCALE_PROTOS_H
  11. #include <clib/locale_protos.h>
  12. #endif  /*  !CLIB_LOCALE_PROTOS_H   */
  13.  
  14. #ifdef AZTEC_C
  15. #ifndef __PRAGMAS_LOCALE_LIB_H
  16. #include <pragmas/locale_lib.h>
  17. #endif /*   !PRAGMAS_LOCALE_LIB_H   */
  18. #endif /*   AZTEC_C                 */
  19.  
  20. static LONG DITO_latinumVersion = 1;
  21. static const STRPTR DITO_latinumBuiltInLanguage = (STRPTR) "deutsch";
  22.  
  23. struct KCDITO_latinumArrayType
  24. {   LONG    cca_ID;
  25.     STRPTR  cca_Str;
  26. };
  27.  
  28. static const struct KCDITO_latinumArrayType KCDITO_latinumArray [] =
  29. {
  30.     {m_language, (STRPTR)m_language_STR},
  31.     {m_description, (STRPTR)m_description_STR},
  32.     {m_grammar, (STRPTR)m_grammar_STR},
  33.     {m_remark, (STRPTR)m_remark_STR},
  34.     {m_genitiv, (STRPTR)m_genitiv_STR},
  35.     {m_gen0, (STRPTR)m_gen0_STR},
  36.     {m_gen1, (STRPTR)m_gen1_STR},
  37.     {m_gen2, (STRPTR)m_gen2_STR},
  38.     {m_adj0, (STRPTR)m_adj0_STR},
  39.     {m_adj1, (STRPTR)m_adj1_STR},
  40.     {m_adj2, (STRPTR)m_adj2_STR},
  41.     {m_verb0, (STRPTR)m_verb0_STR},
  42.     {m_verb1, (STRPTR)m_verb1_STR},
  43.     {m_verb2, (STRPTR)m_verb2_STR},
  44.     {m_part0, (STRPTR)m_part0_STR},
  45.     {m_part1, (STRPTR)m_part1_STR},
  46.     {m_part2, (STRPTR)m_part2_STR},
  47.     {m_part3, (STRPTR)m_part3_STR},
  48. };
  49.  
  50.   extern struct Library *LocaleBase;
  51.  
  52. static struct Catalog *DITO_latinumCatalog = NULL;
  53. void OpenDITO_latinumCatalog(struct Locale *loc, STRPTR language)
  54. { LONG tag, tagarg;
  55.   CloseDITO_latinumCatalog();
  56.   if (language == NULL)
  57.   { tag = TAG_IGNORE;
  58.   }
  59.   else
  60.   { tag = OC_Language;
  61.     tagarg = (LONG) language;
  62.   }
  63.   if (LocaleBase != NULL  &&  DITO_latinumCatalog == NULL)
  64.   { DITO_latinumCatalog = OpenCatalog(loc, (STRPTR) "DITO_latinum.catalog",
  65.                              OC_BuiltInLanguage, DITO_latinumBuiltInLanguage,
  66.                              tag, tagarg,
  67.                              OC_Version, DITO_latinumVersion,
  68.                              TAG_DONE);
  69.   }
  70. }
  71.  
  72. void CloseDITO_latinumCatalog(void)
  73. { if (LocaleBase != NULL)
  74.     CloseCatalog(DITO_latinumCatalog);
  75.   DITO_latinumCatalog = NULL;
  76. }
  77.  
  78. STRPTR GetDITO_latinumString(LONG strnum)
  79. { STRPTR defaultstr = NULL;
  80.   LONG i;
  81.  
  82.   for (i = 0;  i < sizeof(KCDITO_latinumArray)/sizeof(struct KCDITO_latinumArrayType);  i++)
  83.     { if (KCDITO_latinumArray[i].cca_ID == strnum)
  84.       { defaultstr = KCDITO_latinumArray[i].cca_Str;
  85.         break;
  86.       }
  87.     }
  88.   if (DITO_latinumCatalog == NULL)
  89.   { return(defaultstr);
  90.   }
  91.   return(GetCatalogStr(DITO_latinumCatalog, strnum, defaultstr));
  92. }
  93.