category-group: etc
layer: 0
header file(s): z_func.h
libraries: libz00.lib

synopsis.
This group contains 2 clusters of functions - one (the larger) relates to bits, bytes, and words. The other provides version and build number of the Z Directory instance in current use.

The first cluster is a "byte size" group of older, uncommon functions. Included is bit rotation. Here, a byte is represented by the type "u_char". Under these cyclic shift operations, all the bits that 'fell off' during the shift have moved to the opposite side of the byte.

Example: A shift of two bits to the left for the base-2 value 10011100 yields 01110010.

[C] functions (aka subroutines):

z_rotate_byte_left()
SIGNATURE: u_char rotate_byte_left (u_char c, count_t n)
SYNOPSIS:
like c-language builtin ">>", but rotates bits around to the left; a "cyclical" shift to the left. this does a shift 'n' times on the value found in 'c'
RETURNS: the inputted value, after the operation
 

z_rotate_byte_right()
SIGNATURE: u_char rotate_byte_right (u_char c, count_t n)
SYNOPSIS:
like c-language builtin ">>", but rotates bits around to the right; a "cyclical" shift to the left. this does a shift 'n' times on the value found in 'c'
RETURNS: the inputted value, after the operation
 

z_rotate_long_right()
SIGNATURE: long rotate_long_right (long x, count_t n)
SYNOPSIS: same as rotate_byte_right, for long integer type
 

numbits_in_char()
SIGNATURE: count_t numbits_in_char (VOID)
SYNOPSIS: compute the number of bits held by a "char" type
RETURNS: the number of bits (as type count_t)
 

numbits_in_uchar()
SIGNATURE: count_t numbits_in_uchar (VOID)
SYNOPSIS: compute the number of bits held by a "u_char" type
RETURNS: the number of bits (as type count_t)
 

numbits_in_int()
SIGNATURE: count_t numbits_in_int (VOID)
SYNOPSIS: compute the number of bits held by an "int" type
RETURNS: the number of bits (as type count_t)
 

numbits_in_uint()
SIGNATURE: count_t numbits_in_uint (VOID)
SYNOPSIS: compute the number of bits held by a "u_int" type
RETURNS: the number of bits (as type count_t)
 

numbits_in_long()
SIGNATURE: count_t numbits_in_long (VOID)
SYNOPSIS: compute the number of bits held by a "long [int]" type
RETURNS: the number of bits (as type count_t)
 

numbits_in_ulong()
SIGNATURE: count_t numbits_in_ulong (VOID)
SYNOPSIS: compute the number of bits held by a "u_long" type
RETURNS: the number of bits (as type count_t)
 

zd0_version()
SIGNATURE: int zd0_version (char *buf, size_t max_bufsiz, int *pi = NULL)
SYNOPSIS: returns the Z Directory library version in char array 'buf'
PARAMETERS

  • buf: the character buffer to recieve the version string
  • max_bufsiz: the [maximum] length of 'buf'. If this value is less than the length of the version string, the function will fail and 'pi' will be set to a non-zero value.
  • pi: [optional] error indicator variable. Its values can be these:
    0: success
    zErr_Object_Corrupted: library is not branded
    zErr_Param_NullPointer: 'buf' is NULL
    zErr_Param_TooSmall: 'buf' is too small
DESCRIPTION:
This function has public scope, but due to the inherit riskiness of using character arrays, its use is discouraged. There is an equivalent function in layer 1, z_version, which is preferred.
 

zd0_build()
SIGNATURE: int zd0_build (char *buf, size_t max_bufsiz, int *pi = NULL)
SYNOPSIS: returns the Z Directory library build number, in char array 'buf' (as a text string).
PARAMETERS

  • buf: the character buffer to recieve the version string
  • max_bufsiz: the [maximum] length of 'buf'. If this value is less than the length of the version string, the function will fail and 'pi' will be set to a non-zero value.
  • pi: [optional] error indicator variable. Its values can be these:
    0: success
    zErr_Object_Corrupted: library is not branded
    zErr_Param_NullPointer: 'buf' is NULL
    zErr_Param_TooSmall: 'buf' is too small
DESCRIPTION:
This function has public scope, but due to the inherit riskiness of using character arrays, its use is discouraged. There is an equivalent function in layer 1, z_build, which is preferred over this function.
 

history.

Mon 12/04/1995: created numbits_in_() series
Wed 11/19/1997: problems w. H-P c++ compiler; add start/end-of template
Thu 05/30/2002: new #define naming conventions ("zos_", "zcc_")