P_ptr_print 3porty | 2011-02-27 | libporty manual |
---|
P_ptr_print
#include <libporty/host/pointers.h>int P_ptr_print (char * str , void * ptr );
char * P_ptr_aprint (void * ptr );Link with -lporty_host
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.
P_ptr_print(3porty) returns length of string (not including \0).P_ptr_aprint(3porty) returns a newly allocated string.
P_ptr_print 3porty | 2011-02-27 | libporty manual |
---|