Re: Using SystemConfiguration API inside KEXT
Re: Using SystemConfiguration API inside KEXT
- Subject: Re: Using SystemConfiguration API inside KEXT
- From: Jamison Hope <email@hidden>
- Date: Tue, 11 May 2010 17:20:25 -0400
On May 11, 2010, at 4:36 PM, John B Brown wrote:
As you say, a decidedly non-portable framework
(SystemConfiguration)
even an Apple proprietary form, but the call as listed in the
original note, <SystemConfiguration/SystemConfiguration.h>, looks
like classic C language. Ie. look under the include tree.
I suggested there was no way that call could produce the header
because the file did not exist as the include call described.
It got out of hand because the classic C language #include,
according to my reading of the replies, apparently does not work in
the Apple compile system. Or maybe it does. I looked at the
referenced manual pages and still could not find anything to meet
the original call.
Well actually, according to the C language spec:
"A preprocessing directive of the form
#include <h-char-sequence> new-line
searches a sequence of implementation-defined places for a header
identified uniquely by
the specified sequence between the<and>delimiters, and causes the
replacement of that
directive bythe entire contents of the header."
-- http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf
So, <SystemConfiguration/SystemConfiguration.h> just needs to uniquely
identify a file. The spec doesn't say anything about slashes
necessarily being interpreted as path directory delimiters.
GCC (and Clang) on Mac OS X does treat it as a relative path, and will
find <sys/cdefs.h> at /usr/include/sys/cdefs.h, but it also knows how
to find headers inside of frameworks, in which case <Foo/Bar.h>
translates to Foo.framework/Headers/Bar.h. I'm not sure which takes
precedence (i.e. what if there's also a /usr/include/Foo/Bar.h).
Anyway, the key phrase in the C specification is "implementation-
defined". "#include <SystemConfiguration/SystemConfiguration.h>" *is*
Standard C.
--
Jamison Hope
The PTR Group
www.theptrgroup.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden