view dstep/corefoundation/CFMessagePort.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 source

/**
 * Copyright: Copyright (c) 2009 Jacob Carlborg.
 * Authors: Jacob Carlborg
 * Version: Initial created: Jul 12, 2009 
 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
 */
module dstep.corefoundation.CFMessagePort;

import dstep.corefoundation.CFBase;
import dstep.corefoundation.CFData;
import dstep.corefoundation.CFDictionary;
import dstep.corefoundation.CFRunLoop;
import dstep.corefoundation.CFString;
import dstep.objc.bridge.Bridge;
import dstep.objc.objc : id;

struct __CFMessagePort;
alias __CFMessagePort* CFMessagePortRef;

extern (C)
{
	alias void function (CFMessagePortRef, void*) CFMessagePortInvalidationCallBack;
	alias CFDataRef function (CFMessagePortRef, int, CFDataRef, void*) CFMessagePortCallBack;
}

enum
{
	kCFMessagePortSuccess = 0,
	kCFMessagePortSendTimeout = -1,
	kCFMessagePortReceiveTimeout = -2,
	kCFMessagePortIsInvalid = -3,
	kCFMessagePortTransportError = -4
}

struct CFMessagePortContext
{
	int version_;
	void* info;
}

extern (C)
{
	uint CFMessagePortGetTypeID ();
	CFMessagePortRef CFMessagePortCreateLocal (CFAllocatorRef allocator, CFStringRef name, CFMessagePortCallBack* callout, CFMessagePortContext* context, char* shouldFreeInfo);
	CFMessagePortRef CFMessagePortCreateRemote (CFAllocatorRef allocator, CFStringRef name);
	ubyte CFMessagePortIsRemote (CFMessagePortRef ms);
	CFStringRef CFMessagePortGetName (CFMessagePortRef ms);
	ubyte CFMessagePortSetName (CFMessagePortRef ms, CFStringRef newName);
	void CFMessagePortGetContext (CFMessagePortRef ms, CFMessagePortContext* context);
	void CFMessagePortInvalidate (CFMessagePortRef ms);
	ubyte CFMessagePortIsValid (CFMessagePortRef ms);
	CFMessagePortInvalidationCallBack* CFMessagePortGetInvalidationCallBack (CFMessagePortRef ms);
	void CFMessagePortSetInvalidationCallBack (CFMessagePortRef ms, CFMessagePortInvalidationCallBack* callout);
	int CFMessagePortSendRequest (CFMessagePortRef remote, int msgid, CFDataRef data, double sendTimeout, double rcvTimeout, CFStringRef replyMode, CFDataRef* returnData);
	CFRunLoopSourceRef CFMessagePortCreateRunLoopSource (CFAllocatorRef allocator, CFMessagePortRef local, int order);
}