#include <cogent.h>
char* PT_PointString(
PT_pCPOINT point, char* format, char* buffer )
;
The point whose value is to be returned.
A printf-style format directive used to format the point value. Only the actual formatting directive, beginning with % and ending with one of [sfgGeEdicouxX] is acceptable. If this argument is NULL, then default formatting will be done.
A character buffer to be filled with the formatting result. It is the programmer's responsibility to ensure that the buffer is large enough to hold the formatted point value.
A pointer to a buffer containing the formatted value. This may or may not be a pointer to the input buffer. In any case, it is not subject to memory management (free or realloc), though buffer may be.
This function attempts to produce a character string that represents the point value. Integer and real values will be written to the buffer using sprintf along with the format string. If no format string is given, then %g is used for real, and %d is used for integer. If %s is given to a point which not of type string, then the value will first be formatted into a string using the default style, and then formatted again using the %s directive in order to achieve the necessary spacing (e.g., formatting the integer 5 to "%-s" will generate a right-justified string as "5"). The return value will be either a pointer to the point value (in the case of an unformatted point of type PT_TYPE_STRING), or a pointer to the argument buffer.
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.