rem: KPrintF( "OpenLibs returns TRUE\n" );
context: OpenLibs ( void ){  KPrintF( "OpenLibs()\n" );  /* Intuition Library */  IntuitionBase = (struct IntuitionBase *) OpenLibrary( "intuition.library", 37 );  if( IntuitionBase == NULL)  {    Alert(AN_Unknown|AG_OpenLib|AO_Intuition);    return FALSE;  }  /* DOS Library */  DOSBase = (struct DosLibrary *) OpenLibrary( "dos.library", 37 );  if( DOSBase == NULL)  {    Req( "Unable to open 'dos.library'." );    return FALSE;  }  /* Graphics Library */  GfxBase = (struct GfxBase *) OpenLibrary( "graphics.library", 37 );  if( GfxBase == NULL)  {    Req( "Unable to open 'graphics.library'." );    return FALSE;  }  /* GadTools Library */  GadToolsBase = OpenLibrary( "gadtools.library", 37 );  if( GadToolsBase == NULL)  {    Req( "Unable to open 'gadtools.library'." );    return FALSE;  }  /* IFFParse Library */  IFFParseBase = OpenLibrary( "iffparse.library", 37 );  if( IFFParseBase == NULL)  {    Req( "Unable to open 'iffparse.library'." );    return FALSE;  }  /* Locale Library */  LocaleBase = (struct LocaleBase*) OpenLibrary( "locale.library", 38 );  /* Timer Device */  TimerIO = (struct timerequest *) AllocVec( sizeof(struct timerequest),                                             MEMF_PUBLIC | MEMF_CLEAR );  if( TimerIO == NULL)  {    Req( "Out of memory." );    return FALSE;  }  timeval = (struct timeval *) AllocVec( sizeof(struct timeval),                                         MEMF_PUBLIC | MEMF_CLEAR);  if( timeval == NULL)  {    Req( "Out of memory." );    return FALSE;  }  if( OpenDevice( "timer.device",                  UNIT_MICROHZ,                  (struct IORequest *)                  TimerIO,                  0) != 0 )  {    Req( "Unable to open 'timer.device'." );    return FALSE;  }  TimerBase = (struct Device *) TimerIO->tr_node.io_Device;  /* Utility Library */  UtilityBase = (struct UtilityBase *) OpenLibrary( "utility.library", 37 );  if( UtilityBase == NULL)  {    Req( "Unable to open 'utility.library'." );    return FALSE;  }  // Fill in some defaults...  AddByteMonoPtr         = AddByteMono;  AddByteStereoPtr       = AddByteStereo;  AddBytesMonoPtr        = AddBytesMono;  AddBytesStereoPtr      = AddBytesStereo;  AddWordMonoPtr         = AddWordMono;  AddWordStereoPtr       = AddWordStereo;  AddWordsMonoPtr        = AddWordsMono;  AddWordsStereoPtr      = AddWordsStereo;  AddByteMonoBPtr        = AddByteMonoB;  AddByteStereoBPtr      = AddByteStereoB;  AddBytesMonoBPtr       = AddBytesMonoB;  AddBytesStereoBPtr     = AddBytesStereoB;  AddWordMonoBPtr        = AddWordMonoB;  AddWordStereoBPtr      = AddWordStereoB;  AddWordsMonoBPtr       = AddWordsMonoB;  AddWordsStereoBPtr     = AddWordsStereoB;  AddLofiByteMonoPtr     = AddLofiByteMono;  AddLofiByteStereoPtr   = AddLofiByteStereo;  AddLofiBytesMonoPtr    = AddLofiBytesMono;  AddLofiBytesStereoPtr  = AddLofiBytesStereo;  AddLofiWordMonoPtr     = AddLofiWordMono;  AddLofiWordStereoPtr   = AddLofiWordStereo;  AddLofiWordsMonoPtr    = AddLofiWordsMono;  AddLofiWordsStereoPtr  = AddLofiWordsStereo;  AddLofiByteMonoBPtr    = AddLofiByteMonoB;  AddLofiByteStereoBPtr  = AddLofiByteStereoB;  AddLofiBytesMonoBPtr   = AddLofiBytesMonoB;  AddLofiBytesStereoBPtr = AddLofiBytesStereoB;  AddLofiWordMonoBPtr    = AddLofiWordMonoB;  AddLofiWordStereoBPtr  = AddLofiWordStereoB;  AddLofiWordsMonoBPtr   = AddLofiWordsMonoB;  AddLofiWordsStereoBPtr = AddLofiWordsStereoB;  /* MorphOS/PowerUp/WarpOS loading     Strategy:      1) If MorphOS is running, use it.      2) If WarpUp is running, use it.      4) If neither of them are running, try WarpUp.  */  // Check if MorpOS is running.  Forbid();  MorphOSRes  = FindResident( "MorphOS" );  Permit();  if( MorphOSRes == NULL  )  {    // Open WarpUp    PowerPCBase = OpenLibrary( "powerpc.library", 14 );  }  if( MorphOSRes != NULL )  {    MixBackend  = MB_MORPHOS;  }  else if( PowerPCBase != NULL )  {    ULONG* version = NULL;    ULONG* revision = NULL;    MixBackend = MB_WARPUP;    /* Load our code to PPC..  */    PPCObject = AHILoadObject( "DEVS:ahi.elf" );    if( PPCObject != NULL )    {      int r = ~0;      AHIGetELFSymbol( "__LIB_Version", (void*) &version );      AHIGetELFSymbol( "__LIB_Revision", (void*) &revision );          if( version == NULL || revision == NULL )      {        Req( "Unable to fetch version information from 'ahi.elf'." );      }      if( *version != Version || *revision != Revision )      {        Req( "'ahi.elf' version %ld.%ld doesn't match 'ahi.device' %ld.%ld.",             *version, *revision, Version, Revision );        return FALSE;      }      r &= GetSymbol( AddByteMono     );      r &= GetSymbol( AddByteStereo   );      r &= GetSymbol( AddBytesMono    );      r &= GetSymbol( AddBytesStereo  );      r &= GetSymbol( AddWordMono     );      r &= GetSymbol( AddWordStereo   );      r &= GetSymbol( AddWordsMono    );      r &= GetSymbol( AddWordsStereo  );      r &= GetSymbol( AddByteMonoB    );      r &= GetSymbol( AddByteStereoB  );      r &= GetSymbol( AddBytesMonoB   );      r &= GetSymbol( AddBytesStereoB );      r &= GetSymbol( AddWordMonoB    );      r &= GetSymbol( AddWordStereoB  );      r &= GetSymbol( AddWordsMonoB   );      r &= GetSymbol( AddWordsStereoB );      r &= GetSymbol( AddLofiByteMono     );      r &= GetSymbol( AddLofiByteStereo   );      r &= GetSymbol( AddLofiBytesMono    );      r &= GetSymbol( AddLofiBytesStereo  );      r &= GetSymbol( AddLofiWordMono     );      r &= GetSymbol( AddLofiWordStereo   );      r &= GetSymbol( AddLofiWordsMono    );      r &= GetSymbol( AddLofiWordsStereo  );      r &= GetSymbol( AddLofiByteMonoB    );      r &= GetSymbol( AddLofiByteStereoB  );      r &= GetSymbol( AddLofiBytesMonoB   );      r &= GetSymbol( AddLofiBytesStereoB );      r &= GetSymbol( AddLofiWordMonoB    );      r &= GetSymbol( AddLofiWordStereoB  );      r &= GetSymbol( AddLofiWordsMonoB   );      r &= GetSymbol( AddLofiWordsStereoB );      if( r == 0 )      {        Req( "Unable to fetch all symbols from ELF object." );        return FALSE;      }    }    else    {      MixBackend = MB_NATIVE;    }  }  OpenahiCatalog(NULL, NULL);  {    char buf[2];        if( GetVar( "AHINoBetaRequester", buf, sizeof( buf ), 0 ) == -1 )    {      const char* backend = "Internal error";      switch( MixBackend )      {        case MB_NATIVE:          backend = "AmigaOS/" CPU;          break;        case MB_WARPUP:          backend = "WarpUp";          break;                  case MB_MORPHOS:          backend = "MorphOS/" CPU;          break;      }      Req( "This is a beta release of AHI. The latest supported \n"           "version is 4.180, which can be found at\n"           "<URL:http://www.lysator.liu.se/~lcs/ahi.html>.\n"           "\n"           "Detailed bug reports and patches are welcome.\n"           "Sound kernel in use: %s.\n"           "\n"           "/Martin Blom <martin@blom.org>\n",           backend );    }  }  KPrintF( "OpenLibs returns TRUE\n" );  return TRUE;}