Fixed a warning (missing type cast)
[tangerine.git] / rom / exec / findresident.c
blobbc672ccb864f1629eb044b135ddbab5fff13c3a1
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Search a resident module by name
6 Lang: english
7 */
8 #include "exec_intern.h"
9 #include <string.h>
10 #include <exec/resident.h>
11 #include <proto/exec.h>
13 /*****************************************************************************
15 NAME */
17 AROS_LH1(struct Resident *, FindResident,
19 /* SYNOPSIS */
20 AROS_LHA(const UBYTE *, name, A1),
22 /* LOCATION */
23 struct ExecBase *, SysBase, 16, Exec)
25 /* FUNCTION
26 Search for a Resident module in the system resident list.
28 INPUTS
29 name - pointer to the name of a Resident module to find
31 RESULT
32 pointer to the Resident module (struct Resident *), or null if
33 not found.
35 NOTES
37 EXAMPLE
39 BUGS
41 SEE ALSO
43 INTERNALS
45 *****************************************************************************/
47 AROS_LIBFUNC_INIT
48 AROS_LIBBASE_EXT_DECL(struct ExecBase *,SysBase)
50 ULONG *list;
52 list = SysBase->ResModules;
54 if(list)
56 while(*list)
59 If bit 31 is set, this doesn't point to a Resident module, but
60 to another list of modules.
62 if(*list & 0x80000000) list = (ULONG *)(*list & 0x7fffffff);
64 if(!(strcmp( ((struct Resident *)*list)->rt_Name, name)) )
66 return (struct Resident *)*list;
69 list++;
73 return NULL;
74 AROS_LIBFUNC_EXIT
75 } /* FindResident */