cdds_printf - append definition to dictionary


SYNOPSIS

#include "cdds.h"

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

const char *alias
const char *fmt

[ Description | Output | Examples ]


DESCRIPTION

cdds_printf appends a definition to a dictionary. The "print" dictionary must have been previously selected by cdds_dict, cddx_dict, or cddx_out.

One definition name may be specified by alias. If specified, a new definition is appended to the "print" dictionary. If a null alias is specified (i.e. NULL, zero length string, or a string that only contains white space) then information is appended to the current definition.

cdds_printf is controlled by the format string fmt and optional arguments. fmt is an ANSI C standard format string for the stdio sprintf function. It converts optional arguments "..." following the rules of the ANSI C standard for sprintf.

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

OUTPUT

The contents of the current "print" dictionary are changed.

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

The return value is the number of characters written, or negative (EOF) if an error occurred. Zero is returned, if an output dictionary is not open.

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
cddx_dict Select DDS dictionary and mode
cddx_out  Open output
    

AUTHOR

R. L. Selzler, EPTG (Oct 1995)