Re: Using SystemConfiguration API inside KEXT
Re: Using SystemConfiguration API inside KEXT
- Subject: Re: Using SystemConfiguration API inside KEXT
- From: John B Brown <email@hidden>
- Date: Tue, 11 May 2010 15:45:11 -0600
Dear Jamison,
Thank you. That is about as concise an explanation as I've seen so far.
What you are describing does not appear to be either ANSI or
traditional C, unless I misunderstand Harbison and Steele.
Shalom,
John B. Brown.
[email@hidden]
358 High Street,
Buffalo, Wyoming
82834
"Freedom is not worth having if it does not include
the freedom to make mistakes" Mahatma Gandhi
"If any question why we died, tell them,
because our fathers lied." Rudyard Kipling
"A man who does not know the truth is just an idiot
but a man who knows the truth and calls it a lie
is a crook." Bertolt Brecht
"I wonder whether the world is being run
by smart people who are putting us on
or by imbeciles who really mean it." Mark Twain
On 5/11/10 3:20 PM, Jamison Hope wrote:
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