/* * Copyright 2002 Compaq Computer Corporation * * Compaq and the Compaq logo are trademarks of Compaq Information Technologies * Group, L.P. in the U.S. and other countries. * * Confidential computer software. Valid license from Compaq required for * possession, use or copying. Consistent with FAR 12.211 and 12.212, * Commercial Computer Software, Computer Software Documentation, and * Technical Data for Commercial Items are licensed to the U.S. Government * under vendor's standard commercial license. */ /* This file defines an interface to the DECW$SETSHODISSHR.EXE library which encapsulates access to the WSA device type. The WSA device is used to represent an X Windows display. The device does not correspond to a physical device but instead is a means of gathering together parameters needed to connect to an X Windows server. Operations on the WSA device type are supported by the SET DISPLAY and SHOW DISPLAY commands. To create or delete a Supervisor mode display requires CMEXEC. To create, delete or modify an Executive mode display requires SYSNAM. To modify either quota associated with a device requires SYSPRV. The named values associated with a display device are held in non-paged pool. It is inefficient to: (a) Make frequent changes to them (b) Have lots of named values (c) Use large amounts of data to hold names and values. This header file uses the "$" character in identifiers and therefore is not compatible with strict ANSI modes of compilation. Apart from the "open" and "delete" operations, the library does not check that the channel supplied is assigned to a WSA device. Using a channel for a different type of device has unpredictable effects. The "setmode" and "delete" operations do not act on a device atomically. Otherwise, the library is thread safe. 32 or 64-bit pointers and descriptors are supported. Pointers should be naturally aligned. Input descriptors are analyzed using LIB$ANALYZE_SDESC_64 which basically support all well formed descriptors. Output descriptors are set using LIB$SCOPY_R_DX which supports most formats. For classes other than VS or D the output will have been right filled with space characters (ASCII 32). */ #ifndef DECW$SETSHODIS_H #define DECW$SETSHODIS_H #include #include /* Set-up the environment to be independent of where it is included. */ #pragma environment save #pragma environment header_defaults #if __INITIAL_POINTER_SIZE /* All functions support 32 or 64 bit pointers as inputs */ #pragma pointer_size 64 #endif /* A user mode device exists until a client uses it with XOpenDisplay or it is explicitly deleted. A supervisor mode device exists until the process which created it terminates or it is explicitly deleted. An executive mode device exists until explicitly deleted. The device continues to exist until all users of it have closed the displays or channels opened on it. */ enum DECW$WS_ExecutionModes { DECW$WS_UserMode, DECW$WS_SupervisorMode, DECW$WS_ExecutiveMode}; /* Max length, for the transport, server & screen properties */ #define DECW$WS_MaxShortLength 18 /* Max length, for the nodename and individual named value properties */ #define DECW$WS_MaxLongLength 1024 /* Max length, for the name of a named value */ #define DECW$WS_MaxNameLength 31 #ifdef __cplusplus extern "C" { #endif /* Uses SYS$ASSIGN to open a channel to a workstation device identified by device name or logical name. Checks that the device is a WSA device. Return codes: SS$_NORMAL DECW$_DEVNOTWS as for SYS$ASSIGN */ int DECW$WS_OpenDevice (struct dsc$descriptor* descDeviceName, int* chan); /* Uses SYS$DASSGN to close the channel. Return codes: SS$_NORMAL as for SYS$DASSGN */ int DECW$WS_CloseDevice (int chan); /* Creates a new workstation device. On success "*chan" is set to a channel open on the device. Return codes: SS$_NORMAL as for SYS$ASSIGN */ int DECW$WS_CreateDevice (int* chan); /* Deletes a workstation device, given its channel. Does not close the channel, so deletion is not complete until channel is closed explicitly or by program exit. Checks that the channel identifies a WSA device. Return codes: SS$_NORMAL DECW$_DEVNOTWS SS$_NOSYSNAM (need SYSNAM to delete exec mode device) SS$_NOPRIV (need CMEXEC to delete supervisor mode device) */ int DECW$WS_DeleteDevice (int chan); /* Get the device name of an open device Return codes: SS$_NORMAL as for SYS$GETDVIW */ int DECW$WS_GetDeviceName (int chan, struct dsc$descriptor* desc); /* Set a basic property of the open device If the channel is not open on a WSA device results are undefined Return codes: SS$_NORMAL SS$_NOSYSNAM (need SYSNAM to modify exec mode device) SS$_BADPARAM (string too long) SS$_ACCVIO (no access to descriptor buffer) ?? (if non-paged pool is exhausted) */ int DECW$WS_SetNodeName (int chan, struct dsc$descriptor* descNodeName); int DECW$WS_SetTransport (int chan, struct dsc$descriptor* descTransport); int DECW$WS_SetServer (int chan, struct dsc$descriptor* descServer); int DECW$WS_SetScreen (int chan, struct dsc$descriptor* descScreen); /* Set the mode of the open device. This should be called exactly once per device. If not called before closing the channel opened by DECW$WS_CreateDevice the device will be deleted when the channel is closed. Return codes: SS$_NORMAL SS$_NOSYSNAM (need SYSNAM to set executive mode) SS$_NOPRIV (need CMEXEC to set supervisor mode) SS$_BADPARAM (invalid mode value) */ int DECW$WS_SetMode (int chan, enum DECW$WS_ExecutionModes mode); /* Set a named value on the open device. Replaces a named value if there is one with the same name. Return codes: SS$_NORMAL SS$_NOSYSNAM (need SYSNAM to modify exec mode device) SS$_BADPARAM (string too long) SS$_ACCVIO (no access to descriptor buffer) ?? (if non-paged pool is exhausted) */ int DECW$WS_SetValue (int chan, struct dsc$descriptor* descName, struct dsc$descriptor* szValue); /* Append to a named value on the open device. If the named value does not exist then sets it. If the named value exists then appends the value to the existing value. Return codes: SS$_NORMAL SS$_NOSYSNAM (need SYSNAM to modify exec mode device) SS$_BADPARAM (string too long) SS$_ACCVIO (no access to descriptor buffer) ?? (if non-paged pool is exhausted) */ int DECW$WS_AppendValue (int chan, struct dsc$descriptor* descName, struct dsc$descriptor* szValue); /* Deletes the named value if it exists Return codes: SS$_NORMAL SS$_NOSYSNAM (need SYSNAM to modify exec mode device) SS$_ACCVIO (no access to descriptor buffer) */ int DECW$WS_DeleteValue (int chan, struct dsc$descriptor* descName); /* Get a basic property of the open device. Return codes: SS$_NORMAL SS$_ACCVIO (no access to descriptor buffer) SS$_IVBUFLEN (output buffer not long enough) SS$_BADPARAM (DECW$WS_GetMode - device has a corrupted mode value) */ int DECW$WS_GetNodeName (int chan, struct dsc$descriptor* descNodeName); int DECW$WS_GetTransport (int chan, struct dsc$descriptor* descTransport); int DECW$WS_GetServer (int chan, struct dsc$descriptor* descServer); int DECW$WS_GetScreen (int chan, struct dsc$descriptor* descScreen); int DECW$WS_GetMode (int chan, enum DECW$WS_ExecutionModes* mode); /* Get all the basic properties of the open device atomically. Return codes: SS$_NORMAL SS$_ACCVIO (no access to descriptor buffer) SS$_IVBUFLEN (output buffer not long enough) SS$_BADPARAM (DECW$WS_GetMode - device has a corrupted mode value) */ int DECW$WS_GetAll ( int chan, struct dsc$descriptor* retNode, struct dsc$descriptor* retTransport, struct dsc$descriptor* retServer, struct dsc$descriptor* retScreen, enum DECW$WS_ExecutioneModes* retMode); /* Get the value associated with a named value. The value is a list separated by the given separator. Return values: SS$_NORMAL DECW$_NAMENOTFOUND as for LIB$SCOPY_R_DX SS$_INSFMEM */ int DECW$WS_GetValue ( int chan, struct dsc$descriptor* descName, unsigned char separator, struct dsc$descriptor* descValue); /* Set the allowed number of named values in the open device. Return codes: SS$_NORMAL SS$_NOPRIV (if do not have SYSPRIV) SS$_BADPARAM (value -ve or too large) */ int DECW$WS_SetNameCount (int chan, int quota); /* Set the space allowed for specifying the values of named values in the open device. Return codes: SS$_NORMAL SS$_NOPRIV (if do not have SYSPRIV) SS$_BADPARAM (value -ve or too large) */ int DECW$WS_SetDataSpace (int chan, int quota); /* Gets the quota of names allowed and the amount available. The available amount may be negative. Return codes: SS$_NORMAL SS$_ACCVIO (no access to write output) */ int DECW$WS_GetNameCount (int chan, int* retQuota, int* retAvailable); /* Gets the space allowed for data values and the amount available. The available amount may be negative. Return codes: SS$_NORMAL SS$_ACCVIO (no access to write output) */ int DECW$WS_GetDataSpace (int chan, int* retQuota, int* retAvailable); /* The structure we return is an opaque type (in fact a 64-bit pointer). It is declared this way so as to not depend on the pointer size setting of the user but to be naturally aligned. */ typedef uint64 DECW$WS_NamedValues; /* Gets the set of all names and values in an open device. This is a snapshot that can then be queried to get individual values. The queries on values do not reference the device again. Return codes: SS$_NORMAL SS$_INSFMEM */ int DECW$WS_GetAllNamedValues ( int chan, DECW$WS_NamedValues* retValues); /* Must be used to free the data returned by DECW$WS_GetAllNamedValues */ void DECW$WS_FreeNamedValues ( DECW$WS_NamedValues values); /* Returns the number of named values in the instance. */ int DECW$WS_CountNames ( DECW$WS_NamedValues values); /* Returns the entry in the instance with given index [0...] The returned value is the set of values for the name separated by the given separator. Return values SS$_NORMAL SS$_BADPARAM (index out of range) as for LIB$SCOPY_R_DX */ int DECW$WS_GetNamedValueByIndex ( DECW$WS_NamedValues values, int index, unsigned char separator, struct dsc$descriptor* retName, struct dsc$descriptor* retValue); /* Returns the entry in the instance with case-sensitive matching name The returned value is the set of values for the name separated by the given separator. Return values SS$_NORMAL DECW$_NAMENOTFOUND as for LIB$SCOPY_R_DX */ int DECW$WS_GetNamedValueByName ( DECW$WS_NamedValues values, struct dsc$descriptor* name, unsigned char separator, struct dsc$descriptor* retValue); /* Copies all data from one device to another except for the mode. If do not have SYSPRIV then does not set the dataspace or namequota. Return values SS$_NORMAL */ int DECW$WS_CopyDevice ( int originalChan, int copyChan); #ifdef __cplusplus } #endif /* Restore context as the last thing we do. */ #pragma environment restore #endif /* DECW$DISPLAY_DEVICE_H */