home *** CD-ROM | disk | FTP | other *** search
/ World of A1200 / World_Of_A1200.iso / programs / commodity / newedit18b / newedit_source.lha / Catalog.h next >
C/C++ Source or Header  |  1994-05-30  |  3KB  |  154 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. #define MSG_ERROR_NOCLIPBOARD 5
  41.  
  42. #endif /* CATCOMP_NUMBERS */
  43.  
  44.  
  45. /****************************************************************************/
  46.  
  47.  
  48. #ifdef CATCOMP_STRINGS
  49.  
  50. #define MSG_CX_DESCRIPTION_STR "New functions in string gadgets"
  51. #define MSG_HAILSTRING_STR "NewEdit installed...\n"
  52. #define MSG_BYEBYE_STR "NewEdit removed\n"
  53. #define MSG_ERROR_MEMORY_STR "Insufficient memory!\n"
  54. #define MSG_ERROR_LIBRARY_STR "Can't open '%s', version %ld\n"
  55. #define MSG_ERROR_NOCLIPBOARD_STR "Cant open and initialize the clipboard\n"
  56.  
  57. #endif /* CATCOMP_STRINGS */
  58.  
  59.  
  60. /****************************************************************************/
  61.  
  62.  
  63. #ifdef CATCOMP_ARRAY
  64.  
  65. struct CatCompArrayType
  66. {
  67.     LONG   cca_ID;
  68.     STRPTR cca_Str;
  69. };
  70.  
  71. static const struct CatCompArrayType CatCompArray[] =
  72. {
  73.     {MSG_CX_DESCRIPTION,(STRPTR)MSG_CX_DESCRIPTION_STR},
  74.     {MSG_HAILSTRING,(STRPTR)MSG_HAILSTRING_STR},
  75.     {MSG_BYEBYE,(STRPTR)MSG_BYEBYE_STR},
  76.     {MSG_ERROR_MEMORY,(STRPTR)MSG_ERROR_MEMORY_STR},
  77.     {MSG_ERROR_LIBRARY,(STRPTR)MSG_ERROR_LIBRARY_STR},
  78.     {MSG_ERROR_NOCLIPBOARD,(STRPTR)MSG_ERROR_NOCLIPBOARD_STR},
  79. };
  80.  
  81. #endif /* CATCOMP_ARRAY */
  82.  
  83.  
  84. /****************************************************************************/
  85.  
  86.  
  87. #ifdef CATCOMP_BLOCK
  88.  
  89. static const char CatCompBlock[] =
  90. {
  91.     "\x00\x00\x00\x00\x00\x20"
  92.     MSG_CX_DESCRIPTION_STR "\x00"
  93.     "\x00\x00\x00\x01\x00\x16"
  94.     MSG_HAILSTRING_STR "\x00"
  95.     "\x00\x00\x00\x02\x00\x12"
  96.     MSG_BYEBYE_STR "\x00\x00"
  97.     "\x00\x00\x00\x03\x00\x16"
  98.     MSG_ERROR_MEMORY_STR "\x00"
  99.     "\x00\x00\x00\x04\x00\x1E"
  100.     MSG_ERROR_LIBRARY_STR "\x00"
  101.     "\x00\x00\x00\x05\x00\x28"
  102.     MSG_ERROR_NOCLIPBOARD_STR "\x00"
  103. };
  104.  
  105. #endif /* CATCOMP_BLOCK */
  106.  
  107.  
  108. /****************************************************************************/
  109.  
  110.  
  111. struct LocaleInfo
  112. {
  113.     APTR li_LocaleBase;
  114.     APTR li_Catalog;
  115. };
  116.  
  117.  
  118. #ifdef CATCOMP_CODE
  119.  
  120. STRPTR GetString(struct LocaleInfo *li, LONG stringNum)
  121. {
  122. LONG   *l;
  123. UWORD  *w;
  124. STRPTR  builtIn;
  125.  
  126.     l = (LONG *)CatCompBlock;
  127.  
  128.     while (*l != stringNum)
  129.     {
  130.         w = (UWORD *)((ULONG)l + 4);
  131.         l = (LONG *)((ULONG)l + (ULONG)*w + 6);
  132.     }
  133.     builtIn = (STRPTR)((ULONG)l + 6);
  134.  
  135. #define XLocaleBase LocaleBase
  136. #define LocaleBase li->li_LocaleBase
  137.     
  138.     if (LocaleBase)
  139.         return(GetCatalogStr(li->li_Catalog,stringNum,builtIn));
  140. #define LocaleBase XLocaleBase
  141. #undef XLocaleBase
  142.  
  143.     return(builtIn);
  144. }
  145.  
  146.  
  147. #endif /* CATCOMP_CODE */
  148.  
  149.  
  150. /****************************************************************************/
  151.  
  152.  
  153. #endif /* CATALOG_H */
  154.