home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / rom / exec / initcode.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-07  |  1.5 KB  |  78 lines

  1. /*
  2.     (C) 1995 AROS - The Amiga Replacement OS
  3.     $Id: initcode.c,v 1.4 1997/02/01 20:03:17 ldp Exp $    $Log
  4.     Desc:
  5.     Lang: english
  6. */
  7. #include "exec_intern.h"
  8. #include <exec/resident.h>
  9. #include <proto/exec.h>
  10.  
  11. /*****************************************************************************
  12.  
  13.     NAME */
  14.  
  15.     AROS_LH2(void, InitCode,
  16.  
  17. /*  SYNOPSIS */
  18.     AROS_LHA(ULONG, startClass, D0),
  19.     AROS_LHA(ULONG, version, D1),
  20.  
  21. /*  LOCATION */
  22.     struct ExecBase *, SysBase, 12, Exec)
  23.  
  24. /*  FUNCTION
  25.     Traverse the ResModules array and InitResident() all modules with
  26.     versions greater than or equal to version, and of a class equal to
  27.     startClass.
  28.  
  29.     INPUTS
  30.     startClass - which type of module to start
  31.     version - a version number
  32.  
  33.     RESULT
  34.  
  35.     NOTES
  36.  
  37.     EXAMPLE
  38.  
  39.     BUGS
  40.  
  41.     SEE ALSO
  42.  
  43.     INTERNALS
  44.  
  45.     HISTORY
  46.     29-10-95    digulla automatically created from
  47.                 exec_lib.fd and clib/exec_protos.h
  48.  
  49. *****************************************************************************/
  50. {
  51.     AROS_LIBFUNC_INIT
  52.     AROS_LIBBASE_EXT_DECL(struct ExecBase *,SysBase)
  53.  
  54.     ULONG *list = SysBase->ResModules;
  55.  
  56.     if(list)
  57.     {
  58.     while(*list)
  59.     {
  60.         /*
  61.         If bit 31 is set, this doesn't point to a Resident module, but
  62.         to another list of modules.
  63.         */
  64.         if(*list & 0x80000000) list = (ULONG *)(*list & 0x7fffffff);
  65.  
  66.         if( (((struct Resident *)*list)->rt_Version >= (UBYTE)version)
  67.          && (((struct Resident *)*list)->rt_Flags & (UBYTE)startClass) )
  68.         {
  69.         InitResident((struct Resident *)*list, NULL);
  70.         }
  71.  
  72.         list++;
  73.     }
  74.     }
  75.  
  76.     AROS_LIBFUNC_EXIT
  77. } /* InitCode */
  78.