2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Shortcut OpenLibrary call for system modules (private!)
9 #include <aros/libcall.h>
10 #include <proto/exec.h>
12 static const char * const libnames
[] =
26 static const char * const copyrights
[] =
28 "AROS Research Operating System (AROS)",
29 "Copyright © 1995-1997 ",
30 "AROS - The AROS Research OS ",
31 "Other parts © by respective owners.",
34 "exec 41.11 (27.09.1998)\r\n"
37 /*****i* exec.library/TaggedOpenLibrary **************************************
39 TaggedOpenLibrary -- open a library by tag (V39)
42 AROS_LH1(APTR
, TaggedOpenLibrary
,
45 AROS_LHA(LONG
, tag
, D0
),
48 struct ExecBase
*, SysBase
, 135, Exec
)
51 Opens a library given by tag. This is mainly meant as a shortcut so
52 other system modules don't have to contain the complete library name
53 string, to save ROM space. Additionaly, this call can be used to get a
54 pointer to one of the system copyright notices and other strings.
56 All libraries will be opened with version number 0.
58 If the library cannot be opened the first try, this function calls
59 FindResident and InitResident on the library, and tries again.
62 tag - Which library or text string to return.
65 Pointer to library or pointer to text string.
68 This is an *INTERNAL* function, and is only meant to provide backwards
69 compatibility until all original Amiga system ROM modules that use it
70 have been implemented as part of AROS. This function *WILL BE REMOVED*
71 in the future. *DO NOT USE!* This can not be emhasized enough. This
72 also applies to AROS system programmers.
79 OpenLibrary(), FindResident(), InitResident()
82 No checks are made on the validity of the tag.
84 ******************************************************************************/
94 Try to open the library. If it opened, return.
96 if((lib
= OpenLibrary(libnames
[tag
-1], 0))) return (APTR
)lib
;
99 If it didn't open, FindResident(), InitResident(), and then
100 try to open it again.
102 if(!(res
= FindResident(libnames
[tag
-1]))) return NULL
;
103 InitResident(res
, NULL
);
104 if((lib
= OpenLibrary(libnames
[tag
-1], 0))) return (APTR
)lib
;
107 if(tag
< 0) return( (APTR
)copyrights
[(-tag
)-1] );
110 If we get here, tag must be 0, or the lib didn't open.
115 } /* TaggedOpenLibrary */