• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: SystemConfiguration framework and Carbon CFM - continued
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SystemConfiguration framework and Carbon CFM - continued


  • Subject: Re: SystemConfiguration framework and Carbon CFM - continued
  • From: Quinn <email@hidden>
  • Date: Wed, 22 Jun 2005 17:39:18 +0100

At 19:17 +0400 22/6/05, Igor Garnov wrote:
Where did I go wrong?

Did you do anything special to the function pointer that you supply when you register the callback associated with the runloop source. You will need to. SCF expects the callback to be a Mach-O-style callback (a pointer to code), which CFM function pointers aren't (they're a pointer to a TVector). Check out the CFM_MachO_CFM sample on our web site for the standard technique for handling this.


<http://developer.apple.com/samplecode/CFM_MachO_CFM/CFM_MachO_CFM.html>

Meanwhile, when it comes to variables residing in SCF, I do the following - is this right?

if ( bJaguarAndLater )
{
_kSCDynamicStoreDomainState = ( CFStringRef )CFBundleGetDataPointerForName( cfBundle, CFSTR( "kSCDynamicStoreDomainState" ) );
_kSCCompAnyRegex = ( CFStringRef )CFBundleGetDataPointerForName( cfBundle, CFSTR( "kSCCompAnyRegex" ) );
_kSCEntNetIPv4 = ( CFStringRef )CFBundleGetDataPointerForName( cfBundle, CFSTR( "kSCEntNetIPv4" ) );
}
else
{
_kSCDynamicStoreDomainState = CFSTR( "State:" );
_kSCCompAnyRegex = CFSTR( "[^/]+" );
_kSCEntNetIPv4 = CFSTR( "IPv4" );
}

As a rule I recommend that you don't test version numbers. Rather, just get the pointer and, if it's NULL, replace it with a constant string. For example:


_kSCDynamicStoreDomainState = ( CFStringRef )CFBundleGetDataPointerForName( cfBundle, CFSTR( "kSCDynamicStoreDomainState" ) );
if (_kSCDynamicStoreDomainState == NULL) {
_kSCDynamicStoreDomainState = CFSTR( "State:" );
}


S+E
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >SystemConfiguration framework and Carbon CFM - continued (From: Igor Garnov <email@hidden>)

  • Prev by Date: WG: AW: PPP_PATH
  • Next by Date: streaming upload of a file
  • Previous by thread: SystemConfiguration framework and Carbon CFM - continued
  • Next by thread: WG: AW: PPP_PATH
  • Index(es):
    • Date
    • Thread