Programming Guide



sm_soption

Sets a string variable

char *sm_soption(int option, char *newval);

option
Specifies the variable to set with one of these constants:

SO_EDITOR
Editor to use in JPL windows. Equivalent to SMEDITOR.

SO_LPRINT
The operating system command that is invoked through the local print key (LP). Equivalent to SMLPRINT. Set this option only for character-mode applications.

SO_PATH
Search path for libraries. Equivalent to SMPATH.

SO_LDBLIBNAME
An LDB library to open. Equivalent to SMLDBLIBNAME. Set this option in jmain.c or jxmain.c before the call to sm_ldb_init.

SO_LDBNAME
An LDB screen to open. Equivalent to SMLDBNAME.

SO_RBCONFIG
Specifies the middleware configuration file for a running application, required to enable a native client connection. Equivalent to SMRBCONFIG. Set newval to the full pathname of the middleware configuration file—for example, /usr/myapp/broker.bin.

SO_RBHOST
Provides the middleware API with the network addresses of the machines to which a workstation client can connect. Equivalent to SMRBHOST.

SO_RBPORT
Provides the middleware API with the port numbers associated with the machines (SMRBHOST) to which a workstation client can connect. Equivalent to SMRBPORT.

newval
The new value to assign to the option-specified variable.

Returns

Description

sm_soption lets you change at runtime various application-level variables that are typically defined in the application's environment, its initialization file, or setup files.

Example

char *default_lp;
default_lp = sm_soption(SO_LPRINT, "lp -dny %s");

See Also

sm_option