2009-02-25 4 views
1

さらなる処理のためにMac OS Xでioregの出力を得る必要がありますが、使用するツリー構造は解析が難しいですか? XMLで出力を得る方法はありますか(例えばsystem_profilerのように)解析するのは簡単ですか?ioregの出力を解析しやすい形式で得ることは可能ですか?

+-o Root <class IORegistryEntry, retain 12> 
    | { 
    | ... 
    | } 
    | 
    +-o MacBookPro5,1 <class IOPlatformExpertDevice, registered, matched, active, busy 0, retain 25> 
    | { 
    | ... 
    | } 
    | 
    +-o AppleACPIPlatformExpert <class AppleACPIPlatformExpert, registered, matched, active, busy 0, retain 51> 
    | | { 
    | | ... 

答えて

2

長い道のりが... ioregし、それを修正するためのソースコードを入手することができ

http://www.opensource.apple.com/darwinsource/10.5.6/IOKitTools-76/ioreg.tproj/

ダウンロード:

変更#include "IOKitLibPrivate.h"#include <IOKit/IOKitLibPrivate.h>両方のファイルが同じディレクトリ内にあるときに、あなたが

cc -o ioreg ioreg.c -framework Foundation -framework IOKit -lcurses 
でコンパイルした後、コンパイルすることができます
関連する問題