view dstep/coreservices/cfnetwork/CFHost.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 22, 2009 
 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
 */
module dstep.coreservices.cfnetwork.CFHost;

//import dstep.Availability;
import dstep.coreservices.cfnetwork.CFNetworkDefs;
import dstep.corefoundation.CFStream;
import dstep.corefoundation.CoreFoundation;

struct __CFHost;

alias __CFHost* CFHostRef;
alias int CFHostInfoType;

extern (C)
{
	alias void function (CFHostRef, int, CFStreamError*, void*) CFHostClientCallBack;
}

extern (C)
{
	extern
	{
		const int kCFStreamErrorDomainNetDB;
		const int kCFStreamErrorDomainSystemConfiguration;
	}
}

enum /*CFHostInfoType*/ 
{
	kCFHostAddresses = 0,
	kCFHostNames = 1,
	kCFHostReachability = 2
}

struct CFHostClientContext
{
	int version_;
	void* info;
	CFAllocatorRetainCallBack retain;
	CFAllocatorReleaseCallBack release;
	CFAllocatorCopyDescriptionCallBack copyDescription;
}

extern (C)
{
	uint CFHostGetTypeID ();
	CFHostRef CFHostCreateWithName (CFAllocatorRef allocator, CFStringRef hostname);
	CFHostRef CFHostCreateWithAddress (CFAllocatorRef allocator, CFDataRef addr);
	CFHostRef CFHostCreateCopy (CFAllocatorRef alloc, CFHostRef host);
	ubyte CFHostStartInfoResolution (CFHostRef theHost, int info, CFStreamError* error);
	CFArrayRef CFHostGetAddressing (CFHostRef theHost, char* hasBeenResolved);
	CFArrayRef CFHostGetNames (CFHostRef theHost, char* hasBeenResolved);
	CFDataRef CFHostGetReachability (CFHostRef theHost, char* hasBeenResolved);
	void CFHostCancelInfoResolution (CFHostRef theHost, int info);
	ubyte CFHostSetClient (CFHostRef theHost, CFHostClientCallBack clientCB, CFHostClientContext* clientContext);
	void CFHostScheduleWithRunLoop (CFHostRef theHost, CFRunLoopRef runLoop, CFStringRef runLoopMode);
	void CFHostUnscheduleFromRunLoop (CFHostRef theHost, CFRunLoopRef runLoop, CFStringRef runLoopMode);
}