PTMAP Data Macros

The following macros can be used to access point values. The first argument of each macro is a pointer to a PTM_DATA structure. The second argument specifies the element number.

BOOL_VAL(x,y)

Access a BOOLEAN value.

INT_1_VAL(x,y)

Access a 1 byte INTEGER value.

INT_2_VAL(x,y)

Access a 2 byte INTEGER value.

INT_4_VAL(x,y)

Access a 4 byte INTEGER value.

UINT_1_VAL(x,y)

Access a 1 byte UNSIGNED INTEGER value.

UINT_2_VAL(x,y)

Access a 2 byte UNSIGNED INTEGER value.

UINT_4_VAL(x,y)

Access a 4 byte UNSIGNED INTEGER value.

FLTPT_VAL(x,y)

Access a FLOATING POINT value.

BITSTR_PTR(x)

Access a BITSTRING value.

Macros are provided which may be used to access OCTET_STRING and CHAR_STRING data types. Each macro can be used to copy one element of the PTM_DATA structure to or from a memory location. The length of the element copied is determined from the PTM_DATA structure.

The following macros will copy an element of the PTM_DATA structure to a location in memory. In these macros, x is a pointer to memory, y is a pointer to a PTM_DATA structure, and z is the element in y which is to be copied.

GET_OCTSTR(x,y,z)

GET_CHRSTR(x,y,z)

The following macros will copy data from a location in memory to an element of the PTM_DATA structure. In these macros, x is a pointer to a PTM_DATA structure, y is the element in x to which data is to be copied, and z is a pointer to memory.

SET_OCTSTR(x,y,z)

SET_CHRSTR(x,y,z)

Macros are provided which may be used to access BITSTRING data types. One macro can be used to get the value of a single bit in BITSTRING data in a PTM_DATA structure and one macro can be used to set a single bit in BITSTRING data in a PTM_DATA structure.

The following macro will return the value of a bit in a BITSTRING. In this macro, x is a pointer to a PTM_DATA structure, and y is the number of the bit to be returned. The first bit in the bitstring is bit 0. This macro returns a value of 0 or 1.

GETBITVAL(x,y)

The following macro will set a single bit in a BITSTRING data structure. In this macro, x is a pointer to a PTM_DATA structure, y is the number of the bit to be set, and z is the value to set the bit. The first bit in the bitstring is bit 0.

SETBITVAL(x,y,z)

More information

Point Management API subroutines.