P_ptr_print 3porty 2011-02-27 libporty manual

NAME

P_ptr_print

SYNPOSIS

#include <libporty/host/pointers.h>

int P_ptr_print (char * str , void * ptr );
char * P_ptr_aprint (void * ptr );

Link with -lporty_host

DESCRIPTION

These functions are provided as means of converting pointers (memory addresses) to strings, since printf %p is not available on all platforms.

P_ptr_print prints ptr in Px format n str ; str should be long enough - using P_STR_STRWIDTH for minimal length is safe enough.

P_ptr_aprint print ptr in Px format n an automatically allocated buffer then return the pointer to that buffer. Caller needs to free() buffer after use.

RETURN VALUE

P_ptr_print(3porty) returns length of string (not including \0).

P_ptr_aprint(3porty) returns a newly allocated string.

SEE ALSO

P_ptr_print 3porty 2011-02-27 libporty manual