Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Related Pages

fmt: Formatting Functions


Defines

#define FMT_ULONG_LEN   40

Functions

unsigned fmt_pad (char *buffer, unsigned width, char pad)
unsigned fmt_sign_pad (char *buffer, int sign, unsigned width, char pad)

Variables

const char fmt_lcase_digits [36]
const char fmt_ucase_digits [36]

Detailed Description

Function Naming
  1. Prefix
  2. Data type
  3. Conversion type
  4. Width / Padding

For example, fmt_sdecw formats a signed integer using decimal with width padding.

Calling Convention
Parameters to the fmt functions are passed in the following order. The presence of all parameters, except for buffer, is dependant on which function is being used.

  1. buffer : The character string into which to put the data result. If this is NULL, no data is written, and only the length is calculated. This is useful for determining how long a formatted string might be.
  2. number or data : The input data item to convert.
  3. width : The minimum output width.
  4. pad : The character with which to pad the output.
  5. base : The numerical base to use.
  6. digits : The array of digits to use.

Return Value
All fmt functions return the number of bytes written to the buffer space.

Define Documentation

#define FMT_ULONG_LEN   40
 

The maximum space used by a formatted number.

This value is long enough for 2^128 plus a trailing NUL byte.


Function Documentation

unsigned fmt_pad char *  buffer,
unsigned  width,
char  pad
 

Format a pad character.

unsigned fmt_sign_pad char *  buffer,
int  sign,
unsigned  width,
char  pad
 

Format padding for a signed number.


Variable Documentation

const char fmt_lcase_digits[36]
 

Array of digits for lower-case conversions.

const char fmt_ucase_digits[36]
 

Array of digits for upper-case conversions.


Generated on Wed Mar 8 13:34:49 2006 for bglibs by  doxygen 1.4.4