_BCDPTR - create a BCD pointer.

(Not in the ANSI standard)

Usage:

newptr = _bcdptr(oldptr,offset);

Where:

void *oldptr;
is a BCD pointer created by a previous call to "_bcdptr", or else a pointer to a word boundary.
int offset;
is a positive or negative offset in 6 bit characters from 'oldptr'.
void *newptr;
is another BCD pointer. This points to the BCD character that is the given offset (number of BCD characters) from the BCD character indicated by "oldptr".

Description:

"_bcdptr" creates a BCD pointer. This is a special type of "(void *)" pointer guaranteed to point to a BCD character. For example,

new = _bcdptr(old,-1)

returns a pointer to the BCD character immediately preceding the one indicated by "old". "old" can be a pointer to a word boundary, or to another BCD character.

BCD pointers can only be used in a limited set of operations: comparisons for equality/inequality and assignments. The BCD string indicated by a BCD pointer can be printed with the "%_s" placeholder of "printf" and related routines.

See Also:

expl c lib _bcdasc

expl c lib _ascbcd

expl c lib printf

Copyright © 1996, Thinkage Ltd.