4 * Copyright (C) 1993-1999 by Jochen Wiedmann and Marcin Orlowski
5 * Copyright (C) 2002-2015 FlexCat Open Source Team
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include <proto/exec.h>
29 #include <proto/utility.h>
30 #include <proto/intuition.h>
31 #include <proto/locale.h>
32 #include <proto/codesets.h>
34 #if defined(__amigaos3__) || defined(__MORPHOS__) || defined(__AROS__)
36 struct UtilityBase
*UtilityBase
= NULL
;
38 struct Library
*UtilityBase
= NULL
;
40 struct IntuitionBase
*IntuitionBase
= NULL
;
41 #if defined(__MORPHOS__)
42 struct Library
*LocaleBase
= NULL
;
44 struct LocaleBase
*LocaleBase
= NULL
;
47 struct Library
*CodesetsBase
= NULL
;
49 #if defined(__amigaos4__)
50 struct CodesetsIFace
*ICodesets
= NULL
;
56 #if defined(__amigaos3__) || defined(__MORPHOS__) || defined(__AROS__)
59 (UtilityBase
= (struct UtilityBase
*)OpenLibrary("utility.library", 37)) != NULL
&&
61 (UtilityBase
= OpenLibrary("utility.library", 37)) != NULL
&&
63 (IntuitionBase
= (struct IntuitionBase
*)OpenLibrary("intuition.library", 37)) != NULL
&&
64 #if defined(__MORPHOS__)
65 (LocaleBase
= (struct Library
*)OpenLibrary("locale.library", 37)) != NULL
)
67 (LocaleBase
= (struct LocaleBase
*)OpenLibrary("locale.library", 37)) != NULL
)
71 if((CodesetsBase
= OpenLibrary(CODESETSNAME
, CODESETSVER
)) &&
72 GETINTERFACE(ICodesets
, CodesetsBase
))
83 #if defined(__amigaos3__) || defined(__MORPHOS__) || defined(__AROS__)
84 if(UtilityBase
!= NULL
)
86 CloseLibrary((struct Library
*)UtilityBase
);
89 if(IntuitionBase
!= NULL
)
91 CloseLibrary((struct Library
*)IntuitionBase
);
94 if(LocaleBase
!= NULL
)
96 CloseLibrary((struct Library
*)LocaleBase
);
101 if(CodesetsBase
!= NULL
)
103 DROPINTERFACE(ICodesets
);
104 CloseLibrary(CodesetsBase
);