Mercurial > projects > dstep
diff dstep/coreservices/carboncore/Endian.d @ 11:07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sat, 01 Aug 2009 15:03:28 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dstep/coreservices/carboncore/Endian.d Sat Aug 01 15:03:28 2009 +0200 @@ -0,0 +1,84 @@ +/** + * Copyright: Copyright (c) 2009 Jacob Carlborg. + * Authors: Jacob Carlborg + * Version: Initial created: Jul 21, 2009 + * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) + */ +module dstep.coreservices.carboncore.Endian; + +//import dstep.AvailabilityMacros; +import dstep.coreservices.carboncore.ConditionalMacros; +import dstep.coreservices.carboncore.MacTypes; +//import dstep.libkern.OSByteOrder; +import dstep.objc.bridge.TypeEncoding; + + +extern (C) +{ + alias int function (uint, uint, short, void*, uint, ubyte, void*) CoreEndianFlipProc; +} + +// This is needed otherwise the enums will fail compiling with gdc +version (GNU) +{ + private + { + const __kCoreEndianResourceManagerDomain = getOSType!("rsrc"); + const __kCoreEndianAppleEventManagerDomain = getOSType!("aevt"); + + } +} + +enum +{ + kCoreEndianResourceManagerDomain = getOSType!("rsrc"), + kCoreEndianAppleEventManagerDomain = getOSType!("aevt") +} + +struct BigEndianLong +{ + int bigEndianValue; +} + + +struct BigEndianUnsignedLong +{ + uint bigEndianValue; +} + + +struct BigEndianShort +{ + short bigEndianValue; +} + + +struct BigEndianUnsignedShort +{ + ushort bigEndianValue; +} + + +struct BigEndianFixed +{ + int bigEndianValue; +} + + +struct BigEndianUnsignedFixed +{ + uint bigEndianValue; +} + + +struct BigEndianOSType +{ + uint bigEndianValue; +} + +extern (C) +{ + int CoreEndianInstallFlipper (uint dataDomain, uint dataType, CoreEndianFlipProc proc, void* refcon); + int CoreEndianGetFlipper (uint dataDomain, uint dataType, CoreEndianFlipProc* proc, void** refcon); + int CoreEndianFlipData (uint dataDomain, uint dataType, short id, void* data, uint dataLen, ubyte currentlyNative); +} \ No newline at end of file