LDGETSYMSTR(3X) LDGETSYMSTR(3X)
ldgetsymstr - get a symbol type string
#include <stdio.h>
#include <filehdr.h>
#include <syms.h>
#include <ldfcn.h>
int ldgetsymstr (ldptr, psymr,isym,buffer)
LDFILE *ldptr;
PSYMR *psymr;
int isym;
int flags;
char *buffer;
ldgetsymstr puts, in the caller-provided buffer, a string with whatever
type information is available on the symbol passed in. There is no
mechanism to prevent buffer overflow, so it is best to provide a large
buffer. 2048 bytes should be 10 or 20 times the size of any reasonable
string. The string put in buffer is terminated by a null(0) byte by
ldgetsymstr.
Both a symbol index (as is supplied to ldtbread ) and a pSYMR pointer
pointing to the data for the indexed symbol (previously filled by a call
to ldtbread) must be passed to ldgetsymstr.
ldgetsymstr returns SUCCESS if it has been able to access the symbol
table or NULL if it has not.
If the symbol is simply a label (as in assembler code), the string put in
the buffer will be of length 0 (that is, the zero byte of the buffer will
be set to 0).
The program must be loaded with the object file access routine library
libmld.a.
fopen(3S), ldopen(3X), ldtbread(3X), ldclose(3X), ldfcn(4).
PPPPaaaaggggeeee 1111 [ Back ]
|