Re: SystemConfiguration framework and Carbon CFM
Re: SystemConfiguration framework and Carbon CFM
- Subject: Re: SystemConfiguration framework and Carbon CFM
- From: Quinn <email@hidden>
- Date: Wed, 22 Jun 2005 12:11:42 +0100
At 14:54 -0700 21/6/05, Duane Murphy wrote:
I believe that this will not work (at least how I think you are
suggesting). You must use the real pointers. Even though this variable
have content, the addresses of these items are used, not the content.
(This may have changed in recent OS's, but older OS's, I believe this
was the case.)
It depends on the API. In situations like this, most frameworks use
these constants as CFDictionary keys. In that case, using a copy of
the constant works because they strings have the same hash and
compare as equal (using CFEqual). However, some frameworks do actual
pointer comparison, in which case you'd better be using the same
pointer [1].
I should note that System Configuration framework fits into the
former bucket. In fact, prior to 10.2, SCF didn't export constants
for its keys. Rather, the definitions were simply macros that
expanded to the CFSTR macro.
To this day, if you want to be compatible with 10.1's SCF, you have
to include "SCSchemaDefinitions_10_1.h" after including the framework.
#include <SystemConfiguration/SystemConfiguration.h>
#include <SystemConfiguration/SCSchemaDefinitions_10_1.h>
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
[1] The example of this that cropped up recently is that pre-release
builds of Tiger required you to use the real kMDItemPath constant,
not just a CFString that had the same value <rdar://problem/3899285>.
We changed this before we Tiger GM.
_______________________________________________
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