PEXStartOCs(3) — Subroutines
Name
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
displayA pointer to a display structure returned by a successful XOpenDisplay call.
resource_idThe resource identifier of the renderer or structure.
req_typeThe request type for the output command (PEXOCRender, PEXOCStore, PEXOCRenderSingle or PEXOCStoreSingle).
float_formatThe floating point format of the output command data (PEXIEEE_754_32, PEXDEC_F_Floating, PEXIEEE_754_64, PEXDEC_D_Floating).
oc_countThe number of output commands to be sent.
word_countThe number of four-byte words of data for the total size of the output commands.
Returns
Zero is unsuccessful, non-zero otherwise.
Description
This function locks the display. Only PEXCopyBytesToOC or PEXGetOCAddr may be called between pairs of PEXStartOCs and PEXFinishOCs. Do not call anything else that may lock the display as this will result in deadlock.
The first output command is guaranteed to start on a four-byte boundary. Output command data may be copied into the transport buffer by calling PEXCopyBytesToOC. Output command data may be written directly by the application by calling PEXGetOCAddr to get a pointer to memory in the transport buffer.
PEXFinishOCs must be called 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), the function will return unsuccessfully. If this occurs, and the number of output commands was greater than one, the application should 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, the function will return 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
PEXFinishOCs, PEXCopyBytesToOC, PEXGetOCAddr