home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1997 #3 / amigamamagazinepolishissue03-1 / ma_1995 / 05 / ami044b.txt < prev    next >
Text File  |  1997-04-07  |  983b  |  91 lines

  1. /* Listing #2 */
  2.  
  3.  
  4.  
  5. #include <exec/execbase.h>
  6.  
  7.  
  8.  
  9. #include <proto/exec.h>
  10.  
  11.  
  12.  
  13. #include <stdio.h>
  14.  
  15. #include <stdlib.h>
  16.  
  17.  
  18.  
  19. #define OS_13 34
  20.  
  21. #define OS_20 37
  22.  
  23. #define OS_30 39
  24.  
  25. #define OS_31 40
  26.  
  27.  
  28.  
  29. void check_os(UWORD ver);
  30.  
  31.  
  32.  
  33. extern struct ExecBase *SysBase;
  34.  
  35.  
  36.  
  37. int main(int argc, char *argv[])
  38.  
  39. {
  40.  
  41.     printf("%s", SysBase->LibNode.lib_IdString); /* Biblioteka sama sië przedstawi */
  42.  
  43.     printf("Iloôê uûytkowników: %d\nWersja: %d.%d\n\n",
  44.  
  45.         SysBase->LibNode.lib_OpenCnt,
  46.  
  47.         SysBase->LibNode.lib_Version,
  48.  
  49.         SysBase->LibNode.lib_Revision);
  50.  
  51.  
  52.  
  53.     /* Spróbujmy wywoîaê check_os() */
  54.  
  55.  
  56.  
  57.     check_os(OS_13);
  58.  
  59.     printf("Mamy OS 1.3+\n");
  60.  
  61.     check_os(OS_20);
  62.  
  63.     printf("Powiem wiëcej: \"mamy OS 2.04+!\"\n");
  64.  
  65.     check_os(OS_30);
  66.  
  67.     printf("Widzë, ûe lubisz postëp.\n");
  68.  
  69.     check_os(OS_31);
  70.  
  71.     printf("Powiem wiëcej: jesteô bardziej postëpowy od nas!\n");
  72.  
  73.     return 0;
  74.  
  75. }
  76.  
  77.  
  78.  
  79. void check_os(UWORD ver)
  80.  
  81. {
  82.  
  83.     if (SysBase->LibNode.lib_Version < ver)
  84.  
  85.         /* System w wersji starszej niû wymagana */
  86.  
  87.         exit(0);
  88.  
  89. }
  90.  
  91.