PEXStartOCs - Start Encoded Output Commands


Synopsis

   Status PEXStartOCs(
          Display *display,
          XID resource_id,
          PEXOCRequestType req_type,
          int float_format,
          int oc_count,
          int word_count
     )

Arguments

display
A pointer to a display structure returned by a successful XOpenDisplay call.

resource_id
The resource identifier of the renderer or structure.

req_type
The request type for the output command (PEXOCRender, PEXOCStore, PEXOCRenderSingle or PEXOCStoreSingle).

float_format
The floating-point format of the output command data (PEXIEEE_754_32, PEXDEC_F_Floating, PEXIEEE_754_64 or PEXDEC_D_Floating).

oc_count
The number of output commands to be sent.

word_count
The number of four-byte words of data for the total size of the output commands.

Returns

Zero is unsuccessful; non-zero otherwise.

Description

Invoke PEXStartOCs to lock the display.

You can invoke only PEXCopyBytesToOC or PEXGetOCAddr between pairs of PEXStartOCs and PEXFinishOCs functions. Do not invoke anything else that may lock the display; this results in a deadlock.

The first output command is guaranteed to start on a four-byte boundary. You can copy output command data into the transport buffer by calling PEXCopyBytesToOC. Output command data can be written directly by the application by calling PEXGetOCAddr to get a pointer to memory in the transport buffer.

You must invoke PEXFinishOCs after all the data has been specified.

The application is responsible for writing valid protocol and the correct number of words requested.

If the requested number of words is too large for the display connection (each server has a maximum request size), then this function returns unsuccessfully. If this occurs, and the number of output commands was greater than one, try specifying the data for a single output command at a time. If the size of a single output command is too large for the display connection, then this function returns unsuccessfully.

Errors

BadPEXFloatingPointFormat
The specified floating-point format is invalid or unsupported.

BadPEXOutputCommand
The output command contains an invalid value.

BadPEXRenderer
The specified renderer resource identifier is invalid.

BadPEXStructure
The specified structure resource identifier is invalid.

See Also

For a list of related topics and functions, see Sending Encoded Output Commands.