home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / commodities / newedit / catalog.h < prev    next >
C/C++ Source or Header  |  1993-03-06  |  3KB  |  149 lines

  1. #ifndef CATALOG_H
  2. #define CATALOG_H
  3.  
  4.  
  5. /****************************************************************************/
  6.  
  7.  
  8. /* This file was created automatically by CatComp.
  9.  * Do NOT edit by hand!
  10.  */
  11.  
  12.  
  13. #ifndef EXEC_TYPES_H
  14. #include <exec/types.h>
  15. #endif
  16.  
  17. #ifdef CATCOMP_ARRAY
  18. #undef CATCOMP_NUMBERS
  19. #undef CATCOMP_STRINGS
  20. #define CATCOMP_NUMBERS
  21. #define CATCOMP_STRINGS
  22. #endif
  23.  
  24. #ifdef CATCOMP_BLOCK
  25. #undef CATCOMP_STRINGS
  26. #define CATCOMP_STRINGS
  27. #endif
  28.  
  29.  
  30. /****************************************************************************/
  31.  
  32.  
  33. #ifdef CATCOMP_NUMBERS
  34.  
  35. #define MSG_CX_DESCRIPTION 0
  36. #define MSG_HAILSTRING 1
  37. #define MSG_BYEBYE 2
  38. #define MSG_ERROR_MEMORY 3
  39. #define MSG_ERROR_LIBRARY 4
  40.  
  41. #endif /* CATCOMP_NUMBERS */
  42.  
  43.  
  44. /****************************************************************************/
  45.  
  46.  
  47. #ifdef CATCOMP_STRINGS
  48.  
  49. #define MSG_CX_DESCRIPTION_STR "Neue Funktionen in Stringgadgets"
  50. #define MSG_HAILSTRING_STR "NewEdit installiert...\n"
  51. #define MSG_BYEBYE_STR "NewEdit beendet.\n"
  52. #define MSG_ERROR_MEMORY_STR "Zuwenig freier Speicherplatz!\n"
  53. #define MSG_ERROR_LIBRARY_STR "Kann '%s' Version %ld nicht öffnen.\n"
  54.  
  55. #endif /* CATCOMP_STRINGS */
  56.  
  57.  
  58. /****************************************************************************/
  59.  
  60.  
  61. #ifdef CATCOMP_ARRAY
  62.  
  63. struct CatCompArrayType
  64. {
  65.     LONG   cca_ID;
  66.     STRPTR cca_Str;
  67. };
  68.  
  69. static const struct CatCompArrayType CatCompArray[] =
  70. {
  71.     {MSG_CX_DESCRIPTION,(STRPTR)MSG_CX_DESCRIPTION_STR},
  72.     {MSG_HAILSTRING,(STRPTR)MSG_HAILSTRING_STR},
  73.     {MSG_BYEBYE,(STRPTR)MSG_BYEBYE_STR},
  74.     {MSG_ERROR_MEMORY,(STRPTR)MSG_ERROR_MEMORY_STR},
  75.     {MSG_ERROR_LIBRARY,(STRPTR)MSG_ERROR_LIBRARY_STR},
  76. };
  77.  
  78. #endif /* CATCOMP_ARRAY */
  79.  
  80.  
  81. /****************************************************************************/
  82.  
  83.  
  84. #ifdef CATCOMP_BLOCK
  85.  
  86. static const char CatCompBlock[] =
  87. {
  88.     "\x00\x00\x00\x00\x00\x22"
  89.     MSG_CX_DESCRIPTION_STR "\x00\x00"
  90.     "\x00\x00\x00\x01\x00\x18"
  91.     MSG_HAILSTRING_STR "\x00"
  92.     "\x00\x00\x00\x02\x00\x12"
  93.     MSG_BYEBYE_STR "\x00"
  94.     "\x00\x00\x00\x03\x00\x20"
  95.     MSG_ERROR_MEMORY_STR "\x00\x00"
  96.     "\x00\x00\x00\x04\x00\x26"
  97.     MSG_ERROR_LIBRARY_STR "\x00\x00"
  98. };
  99.  
  100. #endif /* CATCOMP_BLOCK */
  101.  
  102.  
  103. /****************************************************************************/
  104.  
  105.  
  106. struct LocaleInfo
  107. {
  108.     APTR li_LocaleBase;
  109.     APTR li_Catalog;
  110. };
  111.  
  112.  
  113. #ifdef CATCOMP_CODE
  114.  
  115. STRPTR GetString(struct LocaleInfo *li, LONG stringNum)
  116. {
  117. LONG   *l;
  118. UWORD  *w;
  119. STRPTR  builtIn;
  120.  
  121.     l = (LONG *)CatCompBlock;
  122.  
  123.     while (*l != stringNum)
  124.     {
  125.         w = (UWORD *)((ULONG)l + 4);
  126.         l = (LONG *)((ULONG)l + (ULONG)*w + 6);
  127.     }
  128.     builtIn = (STRPTR)((ULONG)l + 6);
  129.  
  130. #define XLocaleBase LocaleBase
  131. #define LocaleBase li->li_LocaleBase
  132.     
  133.     if (LocaleBase)
  134.         return(GetCatalogStr(li->li_Catalog,stringNum,builtIn));
  135. #define LocaleBase XLocaleBase
  136. #undef XLocaleBase
  137.  
  138.     return(builtIn);
  139. }
  140.  
  141.  
  142. #endif /* CATCOMP_CODE */
  143.  
  144.  
  145. /****************************************************************************/
  146.  
  147.  
  148. #endif /* CATALOG_H */
  149.