• No results found

dsp_strs()

Accepts one or more null-terminated strings and displays the string on the STDOUT device.

This routine calls the write() function once for each string parameter. The display is not cleared and the function uses the current line and column for the start of the display.

Prototype #include <aclconio.h>

int dsp_strs(char * va_alist, ...);

Parameters

Return Values

Dependencies Verix eVo ACT Library write(), (see page 155 for write() example).

Example The linked example code file demonstrates use of dsp_strs().

ERR_BEEP()

Activates the beep feature of the terminal. The function produces an error beep, that is lower in pitch than a normal beep.

Prototype #include <aclconio.h> void ERR_BEEP();

Return Values The function returns before completion of the beep. No value is returned.

This function is implemented as a macro.

Dependencies error_tone(), normal_tone().

See Also beep(), NORM_BEEP()

Example The linked example code file demonstrates use of ERR_BEEP().

va_alist Argument prototype for display string(s).

Success:

0: Number of characters actually written to the display for the last string. This return value is the actual return value from the write() function. Failure: -1: An error occurred in the write() function.

CAUTION

The final argument must be a null. The behavior of the function is undefined if the parameters are not null-terminated strings or the trailing null is omitted.

FUNCTION CALLS f_dollar()

f_dollar()

Formats a null-terminated string as a dollar amount. Options include insertion of the dollar sign ($), specification of decimal places, and separator characters.

On input, *data is the null-terminated string to be formatted. On output, *data is the corresponding dollar formatted string.

Prototype #include <aclstr.h>

void f_dollar(char *data_ptr, int prec, int dol_flag, int dol_format);

Parameters

Return Values None

Dependencies Verix eVo SDK

Verix eVo ACT Library insert_char().

See Also sputf()

Example The linked example code file demonstrates use of f_dollar().

NOTE f_dollar() is not bound by an internally allocated buffer. The only string size

limitation is that the data buffer must be large enough to accommodate the input data with all format characters.

data_ptr Pointer to the I/O buffer. prec Number of decimal digits.

dol_flag $ format flag. Valid values are defined in ACLSTR.H as follows:

dol_format Radix and separator format. Valid values are defined in ACLSTR.H as follows:

If dol_format is not equal to a valid equate, the default of DOL_RDXPSEPN is used.

Value Define Explanation

0 DOLLAR_FMT_OFF Input string unchanged; no formatting. 1 DOLLAR_FMT Format without leading $.

2 DOLLAR_IN_FMT Format with leading $.

Value Define Radix Separator

0 DOL_RDXPSEPN period none 1 DOL_RDXNSEPN none none 2 DOL_RDXPSEPC period comma 4 DOL_RDXCSEPN comma none 6 DOL_RDXCSEPP comma period

FUNCTION CALLS fieldcnt()

fieldcnt()

Copies the nth counted field from a source buffer specified in buf. fieldcnt() starts the first counted field at the position specified by start and moves down to the field specified by count. The string is then copied to the destination buffer. Counted fields are defined by a count byte and a series of data bytes. The value of the count byte is the length of the data string plus the count byte. Counted fields can contain null characters.

Offset values begin at 0 for the first position in the source string. If the return value is 0 or -1, a null character is returned in the destination buffer.

Prototype #include <aclstr.h>

int fieldcnt(char *buf, int start, int count, char *dest);

Parameters

Return Values

Dependencies Verix eVo SDK

If the source buffer is not properly formatted, the result is unpredictable.

See Also fieldfix(), fieldvar(), fieldray()

Example The linked example code file demonstrates use of fieldcnt().

buf Pointer to source buffer. start Offset of counted fields. count Field number to copy. dest Destination buffer.

Success:

0: Actual number of characters copied.

Failure: -1: The field does not exist, a parameter was out of range, or a count byte was zero.

NOTE IA null character is appended to the destination buffer. Since the counted field can also contain null bytes, the first null byte is not necessarily the end of the data. Verify the return value by the actual number of characters in the field.

FUNCTION CALLS fieldfix()

fieldfix()

Copies a data string from a source buffer to a destination buffer starting at an offset specified by start up to a fixed length specified by size, or to end of the source buffer.

If the function reaches the end of the buffer before copying all the characters indicated by size, the function performs a partial copy and returns a value less than the specified size value.

The function returns the actual number of characters being copied or an error code (-1). If the return value is minus one or zero, a null character is returned to the destination buffer; otherwise, a null character is added at the end of the destination buffer.

Prototype #include <aclstr.h>

int fieldfix(char *buf, int start, int size, char *dest);

Parameters

Return Values

Dependencies Verix eVo SDK

See Also fieldfix(), fieldvar(), fieldcnt()

Example The linked example code file demonstrates use of fieldfix(). Also see the

EXFIELD.C example program.

buf Source buffer.

start Starting offset (0-based).

size Number of characters to copy (1-based). dest Destination buffer.

Success:

0: Number of characters in destination buffer; zero if no characters were copied.

Failure: -1: Start offset was beyond the data string length or the offset was negative.

NOTE

This function does not perform error checking. The destination buffer must be large enough to contain the field data to copy and a null character.

FUNCTION CALLS fieldray()

fieldray()

Copies a data string from a source buffer to a destination buffer. It starts at a fixed offset specified in start and copies up to a stop character specified in stop, or the end of the buffer. If the end of the buffer is reached before copying all the characters indicated by the delimiter, a partial copy is performed.

The function returns the actual number of characters being copied or an error code (-1). If the return value is -1 or zero, a null character is returned to the destination buffer. Otherwise, a null character is appended to the data in the destination buffer.

Prototype #include <aclstr.h>

int fieldray(char *buf, int start, char stop, char *dest);

Parameters

Return Values

Dependencies Verix eVo SDK

See Also fieldfix(), fieldvar(), fieldcnt()

Example The linked example code file demonstrates use of fieldray().

buf Source buffer.

start Starting offset (0-based).

stop Stop character at which copying terminates (this character is not copied to the destination buffer).

dest Destination buffer.

Success:

0: Number of characters being copied.

Failure: -1: Start offset was beyond or before the data string length.

NOTE

This function does not perform error checking. The destination buffer must be large enough to accommodate the data.

FUNCTION CALLS fieldvar()

fieldvar()

Copies nth variable data field separated by a field delimiter. The first variable data field starts at the beginning of the source buffer and ends at the first encountered delimiter. If the end of the buffer is reached before copying all the characters indicated by the delimiter, a partial copy is performed.

The function returns the actual number of characters copied or an error code (-1). If the return value is minus one or zero, a null character is returned in the

destination buffer. Otherwise, a null character is appended to the end of the destination buffer.

Prototype #include <aclstr.h>

int fieldvar(char *buf, int fldnum, unsigned char sep, char *dest);

Parameters

Return Values

Dependencies Verix eVo SDK

Verix eVo ACT Library fieldray()

See Also fieldfix(), fieldvar(), fieldcnt()

Example The linked example code file demonstrates use of fieldvar().

buf Buffer with message to scroll. fldnum Field number to copy (1-based). sep Field separator.

dest Destination buffer. inc Scroll increments.

valid_keys Valid key map (Refer Table 15 for valid keys)

Success:

0: Number of characters being copied; zero if no characters were copied. Failure: -1: The field does not exist.

NOTE

This function does not perform error checking. The destination buffer must be large enough to contain the field data to copy, plus one null character.

NOTE

When the parameter ending with a delimiter is passed to fieldvar() API, it assumes that there is another variable present and returns zero.

FUNCTION CALLS