libsyminfo(3)

NAME
libsyminfo - Library for accessing symbol information

DESCRIPTION
Typically access to symbol information from a mach-o is done via the command line tool nm. This data can be examined and processed to determine what a binary exports or imports. With the advent of Symdex(A symbol index used by Mac OS X Build & Integration), there was desire to avoid constant invocations to a command line tool. libsyminfo gives a object oriented approach written in C to allow clients to extract import and export information from a mach-o binary.

API
Defined in libsyminfo.h. NMList NMCreate(char *fileName) Creates a NMList object(opaque struct), with import and export information. This information is stored in opaque structs called NMSymbols. The NMList also object holds information about the binaries subumbrellas and what libraries this binary is a subframework of, if that applicable. If the binary is a library the short name is also stored in the NMList. NMSymbols *NMGetImports(NMList nmList) Access function for retrieving the imports from a NMList object. NMSymbols *NMGetExports(NMList nmList) Access function for retrieving the exports from a NMList object. NMDependencies NMGetLibraryInfo(NMList nmList) Access function for retrieving a NMDependencies object(opaque struct), which holds subframework and subumbrella information. char *NMGetShortName(NMList nmList) Access function for retrieving the short name(if it exists) from a NMList. For example if the NMList was for /usr/lib/libSystem.B.dylib the short name would be libSystem. char *NMGetSymbolName(NMSymbols symbol) Access function to retrieve the symbol name from a NMSymbols opaque struct. const char *NMGetSymbolArch(NMSymbols symbol); Access function to retrieve the symbol's architecture from a NMSymbols opaque struct. char *NMGetSymbolOrdinal(NMSymbols symbol) Access function to retrieve the symbols library ordinal from a NMSymbols opaque struct. unsigned int NMGetExportCount(NMList nmList) Access function for number of exports in a NMList. unsigned int NMGetImportCount(NMList nmList) Access funcation for the number of imports in a NMList. char **NMGetSubFrameworks(NMDependencies deps) Access function for the SubFrameworks of a NMDependencies opaque struct. char **NMGetSubUmbrellas(NMDependencies deps) Access function for the SubUmbrellas of a NMDependencies opaque struct. unsigned int NMGetSubUmbrellaCount(NMDependencies deps) Access function for the number of SubUmbrellas from a NMDependencies opaque struct. unsigned int NMGetSubFrameworkCount(NMDependencies deps) Access function for the number of SubFrameworks from a NMDependencies opaque struct. void NMFree(NMList nmList) Function used to free the memory allocated by a NMList. void NMFreeSymbols(NMSymbols symbol) Function used to free the memory allocated by NMSymbols. void NMFreeDependencies(NMDependencies deps) Function used to free the memory allocated by NMDependencies. NMSymbols NMCreateSymbols(char *name, char *arch,char *ordinal) Function used to create NMSymbols. NMDependencies NMCreateDependencies(char **subUmbrellas, char **subFrameworks, int nSubUmbrellas,int nSubFrameworks) Function used to create NMDependencies.

SEE ALSO
nm(1)