www.beck-ipc.com

@CHIP-RTOS C Library V2.06 - Helper Functions


helper_sprintf

String formatting like the standard library sprintf function.

int helper_sprintf (char *buffer,
                    const char *fmt, ... );

Parameters

buffer

Output parameter:   Formmatted text will be written into this buffer.

fmt

Format specifier string.   Note: Floating point types are not suppported by this implementation.

Return Value

Number of characters output to buffer not counting the final NIL string terminating character.   (If @Chip-RTOS version does not support this function, then this return value will always be zero.)

Comments

Using this function instead of the standard library sprintf will reduce a program's memory requirements.

WARNING for small and medium memory models:


Pointers which are passed to this function after the first two declared arguments must be explicitly cast as type "far".   (Compiler has no clue about these additional arguments so your help is needed.)   For example:

    helper_sprintf(buffer, format, (char far *)string);

The exception to this rule are pointers for display with the %p format.   These are taken as long by default (regardless of your program's memory model) and can be specified explicitly as near with the N input format modifier, in which case you should only pass a 16 bit pointer.   See your compiler's sprintf documentation for more details.

RTOS API

This library function invokes a RTOS software interrupt. Refer to this RTOS API function's documentation for more details.

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3
    V1.20V1.20V1.20V0.91

Supported by @CHIP-RTOS C Library since version

    CLIB
    V2.03

This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document