2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
7 #include <exec/types.h>
8 #include <exec/libraries.h>
9 #include <dos/dosextens.h>
10 #include <aros/libcall.h>
11 #include <aros/debug.h>
12 #include <hidd/unixio.h>
14 #include <proto/exec.h>
15 #include <proto/oop.h>
16 #include <proto/alib.h>
18 #include <aros/symbolsets.h>
19 #include LC_LIBDEFS_FILE
21 OOP_Object
*unixio
= NULL
;
24 static int InitData(LIBBASETYPEPTR LIBBASE
)
26 struct TagItem tags
[] = {
27 {0 , (IPTR
)"oss.library" },
28 {0 , (IPTR
)AROS_ARCHITECTURE
},
32 LIBBASE
->UnixIOAttrBase
= OOP_ObtainAttrBase(IID_Hidd_UnixIO
);
33 if (!LIBBASE
->UnixIOAttrBase
)
36 /* Initialise tag IDs only after getting UnixIOAttrBase */
37 tags
[0].ti_Tag
= aHidd_UnixIO_Opener
;
38 tags
[1].ti_Tag
= aHidd_UnixIO_Architecture
;
40 unixio
= OOP_NewObject(NULL
, CLID_Hidd_UnixIO
, tags
);
41 if (!unixio
) return FALSE
;
46 static int OpenLib(LIBBASETYPEPTR LIBBASE
)
48 /* Allow only one opener */
50 return ((struct Library
*)LIBBASE
)->lib_OpenCnt
? FALSE
: TRUE
;
53 static int CleanUp(LIBBASETYPEPTR LIBBASE
)
55 if (LIBBASE
->UnixIOAttrBase
)
56 OOP_ReleaseAttrBase(IID_Hidd_UnixIO
);
58 /* UnixIO is a singletone, there's no need to dispose it */
63 ADD2INITLIB(InitData
, 0);
64 ADD2OPENLIB(OpenLib
, 0);
65 ADD2EXPUNGELIB(CleanUp
, 0);
66 ADD2LIBS("unixio.hidd", 0, static struct Library
*, unixioBase
);