NWwsprintf(3nw)


NWwsprintf -- allows order of values in format string to differ from order of parameter values

Synopsis

   #include <time.h> or #define NWL_EXCLUDE_TIME 
   #include <stdio.h> or #define NWL_EXCLUDE_FILE 
   #include <nwlocale.h> 
   

int far cdecl NWwsprintf (char NWFAR *buffer, char NWFAR *format, parameter_1, parameter_2);

Description

The parameters are as follows:

buffer
(OUT) Points to the buffer receiving the formatted data.

format
(IN) Points to the format string determining how the data will be formatted before sending it to the output buffer.

parameter_1, parameter_2
(IN) Specifies the user-supplied variable list of parameters whose values are used in the formatted output.

Return values

Number of bytes output.

Notices

Each token in the format string to be replaced by an argument value must be delimited in the following form:
   %n 
where n is an integer between 1 and 99.

For example:

   NWwsprintf(buffer, "Directory %1%s contains: %2%d files.",\dir_name, dir_count); 
returns
   Directory dir_name contains 
   dir_count files 
while
   NWwsprintf(buffer,"%2%d files exist in directory %1%s.",\ dir_name, dir_count); 
returns
   dir_count files exist in directory dir_name. 
Otherwise, NWwsprintf is the same as C standard sprintf.

For information about formatting data, see printf in any C manual.

Services

Internationalization

NCP calls

None
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.