rentzsch.com: tales from the red shed

class-dump Headers

Notes
Steve Nygard wrote the little-known but powerful and handy class-dump tool. This command line tool, given a binary executable, will extract and print corresponding ObjC class, protocol and category source-code header definitions.

I added a new option to class-dump: -H. Instead of just writing out a single long stream of ObjC header code, the -H option will attempt to create one header (.h) file per ObjC class, category and protocol. It uses heuristics to generate the correct #import statements, though circular references need to be manually fixed up with a forward declaration somewhere. Header files are generated within the current directory, so be sure you're in the directory you want to populate first, or you may have a mess to clean up!

Steve's really busy preparing for a move now, so he lacks cycles to mainline the addition. Last thing Steve needs right now is more pressure, so I'm distributing the patched version (including source and a binary) myself. class-dump.wolf.2.1.5.tgz (100K)

I've bracketed all my modifications in
// begin wolf
...
// end wolf
comment blocks, which should help hilight the changes I've made.

Sunday, August 17, 2003
12:49 AM