PT_PointFormat

PT_PointFormat -- formats a point according to a printf-like directive.

Syntax

#include <cogdb.h>

char* PT_PointFormat(PT_pCPOINT point, char* format, char* buffer);

Arguments

point

A point whose value should be formatted.

format

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.

buffer

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.

Returns

A pointer to the character following the formatting directive within the format string. This is useful for self-parsing a longer printf-style formatting string which contains literal strings and multiple point values.

Description

This function examines the formatting directive to determine the type of point expected, and calls one of Pt_PointString, PT_PointInt or PT_PointReal depending on the formatting directive type:

See Also

Point Structure, Storage, and Manipulation, PT_PointString, PT_PointInt, and PT_PointReal

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.