home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / utility / misc / cyber14.lha / CyberCron / Source / TextTable.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-29  |  855 b   |  50 lines

  1. /*
  2.  * TextTable.c
  3.  *
  4.  * This file contains all the magic to support locale.library.  It provides a
  5.  * simple GetString() function that will get a string from locale.library.
  6.  */
  7.  
  8. #include <exec/types.h>
  9. #include <libraries/locale.h>
  10. #include <libraries/gadtools.h>
  11.  
  12. #include <clib/exec_protos.h>
  13. #include <pragmas/exec_lib.h>
  14.  
  15. #include <clib/locale_protos.h>
  16. struct LocaleBase *LocaleBase = NULL;
  17.  
  18. #include <pragmas/locale_lib.h>
  19.  
  20. #include <exec/memory.h>
  21. #include <utility/tagitem.h>
  22.  
  23. #include <stdarg.h>
  24.  
  25. #define STRINGARRAY
  26. #include "CyberCronStrings.h"
  27.  
  28. struct Catalog *MyCatalog = NULL;
  29.  
  30. STRPTR GetString(LONG id)
  31. {
  32.     LONG i;
  33.     STRPTR local;
  34.  
  35.     i = 0;
  36.     local = NULL;
  37.  
  38.     while (!local) {
  39.         if (AppStrings[i].as_ID == id)
  40.             local = AppStrings[i].as_Str;
  41.         else
  42.             i++;
  43.     }
  44.  
  45.     if (LocaleBase)
  46.         local = GetCatalogStr(MyCatalog, id, local);
  47.  
  48.     return local;
  49. }
  50.