cdds_printf - append definition to dictionary

SYNOPSIS

#include "cdds.h"

int cdds_printf(alias, fmt, ...);

const char *alias
const char *fmt

[ Description | Examples ]


DESCRIPTION

cdds_printf appends a definition to a dictionary. The print dictionary must have been previously selected by cdds_dict, or related function. The name of the definition is specified by alias. If a null alias is specified (i.e. NULL, zero length string, or a string that only contains white space) then the value is appended to the current print definition.

The definition is controlled by a format string and optional arguments. The new value is created, as specified by the ANSI standard for the stdio sprintf function.

The function returns the number of characters appended. EOF is returned, if an error is detected or a print definition does not exist.

No function is provided to over write existing definitions; history can't be changed. An existing name can be appended again, which effectively redefines its value.

See cdds_scanf for a description of alias definitions.

EXAMPLES

float gamma[9];
int j;

j = cdds_printf("alpha", "%f\n", 3.14);

j = cdds_printf("beta", "%s %i %f\n",
                "ABC", 5, 3.3);

/* append list of float values */
j = cdds_printf("gamma", "");
for(n = 0; n < 9; n++) {
   j = cdds_printf("", " %f", gamma[n]);
}
j = cdds_printf("", "\n");
    

SEE ALSO

cdds_dict Select DDS dictionary and mode
cdds_printt Append definition to dictionary
cdds_printv Append definition to dictionary
    

AUTHOR

R. L. Selzler, EPTG (Oct 1995)