=:The OpenVMS Frequently Asked Questions(FAQ)C

The OpenVMS Frequently Asked Questions(FAQ)



 r \ ^  
PreviousContentsIndex

?

10.22.2 Other common C++ issues



EHP C++ (a separate compiler from HP C) provides both symbol mangling Band symbol decoration. Some of the details of working with longer Fsymbol names and the resulting symbol name mangling in mixed language Henvironments are listed in the shareable image cookbook, and in the C++ Adocumentation. Symbol name decoration permits the overloading of Hfunctions (by adding characters to the external symbol for the function Ato indicate the function return type and the argument data types Hinvolved), and mixed-language external references can and often do need Dto disable this decoration via the extern "C" declaration mechanism:

 

"
      extern "C" 
        { )        extern int ExternSymbol(void *); .        extern int OtherExternSymbol(void *); 
        } 




aAlso see Section 14.7 for information on /ARCHITECTURE and /OPTIMIZE=TUNE.

iSee Section 10.15 for information on the C system and the lib$spawn call in CAPTIVE environments.

EConstructs such as the order of incrementation or decrementation and Athe order of argument processing within an argument list are all Dimplementation-defined. This means that C coding constructs such as:

 

"
    i = i++;     a[i] = i++;     foo( i, i++, --i); 




Eare undefined and can have (adverse) implications when porting the C Ccode to another C compiler or to another platform. In general, any Hcombination of ++, --, =, +=, -=, *=, etc operators that will cause the Fsame value to be modified multiple times (between what the ANSI/ISO C 8standard calls "sequence points") produce undefined and implementation-specific results.

FWithin C, the following are the "sequence points": the ";" at the end Dof a C statment, the ||, &&, ?:, and comma operators, and a Fcall to a function. Note specifically that = is NOT a sequence point, Gand that the individual arguments contained within a function argument Hlist can be processed from right to left, from left to right, or at any random whim.

AHP C for OpenVMS VAX (formerly DEC C) and VAX C do differ in the related processing.

DSo you are looking for OpenVMS-specific definitions (include files)?

FUCBDEF.H, PCBDEF.H and other OpenVMS-specific definitions---these are Dconsidered part of OpenVMS and not part of the C compiler kit---are /available on all recent OpenVMS Alpha releases.

2To reference the version-dependent symbol library Dsys$share:sys$lib_c.tlb, use a command similar to the following for compilation:

 

"
'$ CC sourcea+SYS$LIBRARY:SYS$LIB_C/LIB 




?You can also define DECC$TEXT_LIBRARY to reference the library.

=You will want to review the Programming Concepts manual, and -specifically take a quick look at Chapter 21.

CAnd some general background: the STARLET definitions (and thus the Hsys$starlet_c.tlb library) contain the symbols and the definitions that Fare independent of the OpenVMS version. The LIB definitions (and thus Hsys$lib_c) contain symbols and definitions that can be dependent on the FOpenVMS version. You won't need to rebuild your code after an OpenVMS Gupgrade if you have included definitions from STARLET. The same cannot Gbe said for some of the definitions in LIB---you might need to rebuild Byour code. (The UCB structure can and has changed from release to release, for instance.)

FRecent versions of C automatically search sys$starlet_c.tlb. Explicit +specification of sys$lib_c.tlb is required.

FAlso see the Ask The Wizard website topics (2486), (3803), and (1661):



HFor additional information on the OpenVMS Ask The Wizard (ATW) area and Bfor a pointer to the available ATW Wizard.zip archive, please see 0Section 3.9.

iSee Section 9.5 for information on the C off_t limitations, resolved Cin OpenVMS V7.3-1 and later and in ECO kits available for specific <OpenVMS releases. The use of a longword for off_t restricts Happlications using native C I/O to file sizes of two gigabytes or less, Dor these applications must use native RMS or XQP calls for specific operations.j

10.23 Status of Programming Tools on OpenVMS VAX?



HDECthreads V7.3 and the HP C compiler (also known as Compaq C and DEC C)@V6.4 are presently expected to be the last updates and the last Creleases of these development packages for use on OpenVMS VAX. The Erun-time support for both DECthreads (CMA$RTL) and for C (DECC$CRTL) will continue to beHmaintained, and will continue to be available on OpenVMS VAX. The VAX C GV3.2 compiler is the final VAX C compiler release for OpenVMS VAX, and Hthe VAX C Run-Time Library (VAXCRTL) will also continue to be available.

GNew development and new features and product enhancements continue for Cthe OpenVMS Alpha and the OpenVMS IA-64 DECthreads and C compilers.s

10.24 Choosing a Version Number for Application Code?



EOne of the common rules-of-thumb for choosing a version number for a Enew version of a layered product or an application, and its expected 2effects on client applications and users, follows:



BFor additional version-numbering materials and for information on <assigning module generation numbers, please see the OpenVMS G(POLYCENTER) Software Product Installation Utility---variously refered Dto by acronyms including PCSI and SPIA---reference manual available %within the OpenVMS documentation set.

?Of course, all of this is obviously subject to interpretation, Hparticularly around the distinction between large and small changes and Hsuch. The scale of the application is also a factor, as larger and more Gcomplex applications will tend toward smaller increments and will tend Ato see the maintenance number incremented, while new releases of Dsmaller applications will tend to see the minor version incremented somewhat more frequently.

HThe goal of all this is to provide a guide to relative scale of changes Eand the associated effort involved in an upgrade for the user and/or for the application programmer.e

10.25 Selecting a Process Dump Directory?



CYou can customize the device and directory for the process dump by Fdefining the logical names SYS$PROCDMP and SYS$PROTECTED_PROCDMP. The Eformer is for non-privileged dumps, while the latter is the location Awhere privileged image dumps are written, and preferably an area 0protected against untrusted access. For example:

 

"
#$ define SYS$PROCDMP SYS$ERRORLOG: 3$ define /exec SYS$PROTECTED_PROCDMP SYS$ERRORLOG: 




CThe abouve presumes that the SYS$ERRORLOG logical name points to a valid location.

EThere is presently no means to change the name of the generated dump ;file from IMAGENAME.DMP to something else. Accordingly, you@will want to use different target directories for this purpose, >particularly if there is more than one application or process "potentially writing process dumps.^

10.26 Access to Itanium Assembler?



FIf you are interested in accessing the native Intel Itanium assembler =within the OpenVMS I64 GNV environment---and since the iasi64G assembler is a Unix program and GNV is a Unix environment for OpenVMS G I64---you can simply copy iasi64.ext into your gnu:[bin] directory in 5 place of "as.", and of "AS.EXE".

GAlternately and probably also better, you can write an "as." Cscript to invoke the iasi64.exe image from its particular prefered location on the local system.

1A typical "as." script looks like this:

 

"
path/iasi64.exe $1 $2 $3 $4 $5 





>

Chapter 11
DECwindows


z

11.1 How do I let someone else display something on my workstation?



FOn a workstation, you will want to use the "Customize" menu Eof the session manager utility and select "Security". When Dthe pop-up box appears, you can select the host node, username, and Gtranport that will allow you to launch an application that targets the workstation display.

DIf this does not provide you with access to the display, You need a checklist of sorts:

m

11.2 How do I create a display on another workstation?



HTo create a display from an OpenVMS host to a remote X Windows display, &use one of the following DCL commands:

 

"
A$ SET DISPLAY /CREATE /TRANSPORT=net_transport /NODE=remote_node 7$ SET DISPLAY /CREATE /TRANSPORT=LAT /NODE=remote_node :$ SET DISPLAY /CREATE /TRANSPORT=DECnet /NODE=remote_node 9$ SET DISPLAY /CREATE /TRANSPORT=TCPIP /NODE=remote_node 




BNote that LAT is typically used only for the VXT series X Windows Fterminals, but it can also be used from OpenVMS to OpenVMS systems on Gvarious OpenVMS releases, such as on OpenVMS Alpha V6.1 and later. For ddetails on configuring the TCP/IP transport, see Section 11.14.

?If you are interested in X Windows terminals and have an older FVAXstation system around, please see the EWS package on Freeware V5.0.z

11.3 How can I get the information from SHOW DISPLAY into a symbol?



AUse the undocumented SHOW DISPLAY/SYMBOL, and then reference the Dsymbols DECW$DISPLAY_NODE, DECW$DISPLAY_SCREEN, DECW$DISPLAY_SERVER and/or DECW$DISPLAY_TRANSPORT.

EAn example of calling the underlying (and also undocumented) sys$qio &programming interface for the WSDRIVER(WSAn:) is available at:

 

"
1- http://www.hp.com/go/openvms/freeware/  


FLook in the Freeware V4.0 directory /srh_examples/DECUS_UNDOC_CLINIC/.d

11.4 How do I get a log of a DECterm session?



FIf you are working from a Decterm, you can use the AutoPrint feature. CChoose the "Printer..." menu item from the "Options" menu, set the Eprinting destination to the name of the file you want, and set "Auto *Print Mode". You are now free to continue.

GIt should be noted that all of the characters and escape sequences are Gcaptured, but if you display the resulting log file on a DECterm, then 3you will see exactly what was originally displayed.a

11.5 Why is DECwindows Motif not starting?



GFirst check to see if there is a graphics device, usually a G* device. H(eg: On a DEC 2000 model 300, use the command SHOW DEVICE GQ) If you do not find a graphics device:



)If there is a G* graphics device present:

g

11.6 How do I set the title on a DECterm window?



/If you are creating a new DECterm window, check

 

"
+$ HELP CREATE /TERMINAL /WINDOW_ATTRIBUTES 




?If you want to change the title of an existing window, use the Gfollowing control sequences, where [esc] is the ANSI escape Gcode, value decimal 27, and "text label" is what you want to display:

>To set the DECterm title, send the escape character, then the Echaracters "]21;", then the text label string, and then an 3escape character followed by a backslash character.

FTo set the icon label, send the escape character, then the characters A"]2L;", then the icon label string, and then an escape ,character followed by a backslash character.

HTo set both the DECterm title and icon to the full device name, you can use the following DCL commands:

 

"
$  esc[0,7] = 27 F$  fulldevnam = F$Edit(F$GetDVI("TT","FULLDEVNAM"),"UPCASE,COLLAPSE") 9$  write sys$output esc+ "]21;" + fulldevnam + esc + "\" 9$  write sys$output esc+ "]2L;" + fulldevnam + esc + "\" 




GYou can also change the title and the icon using the Options-Window... menu.

oAlso see Section 12.1 and Section 8.11.w

11.7 How do I customize DECwindows, including the login screen?



DTo customize various DECwindows Motif characteristics including the Fdefaults used by the SET DISPLAY command, the DECwindows login screen Gbackground logo used (the default is the DIGITAL, Compaq, or HP logo), various keymaps (also see Section 11.7.2 and Section 11.7.1), the BFileView defaults, session manager defaults, the DECwindows login >processing, DECwindows log file processing, and various other ,DECwindows attributes, see the example file:

 

"
/$ SYS$MANAGER:DECW$PRIVATE_APPS_SETUP.TEMPLATE 




DThis example template file is typically copied over to the filename DSYS$COMMON:[SYSMGR]DECW$PRIVATE_APPS_SETUP.COM and then modified to meet site-specific requirements.

GAdditionally, various X tools such as xsetroot, bitmap and xrdb---some Gthese can be useful in customizing the appearance of an application or Gof the DECwindows Motif display---are provided in the DECW$UTILS: area.

EWhen using DECwindows V1.2-4 and later on OpenVMS Alpha, the default Edesktop is the Common Desktop Environment (CDE). You can select your Hpreferred desktop (CDE or DECwindows Motif) when logging in, or you can Hchange the default to the DECwindows Motif desktop using the DCL symbol Cdecw$start_new_desktop in the DECwindows private application setup Hcommand procedure. See SYS$MANAGER:DECW$PRIVATE_APPS_SETUP.TEMPLATE for ?further details, and how to create DECW$PRIVATE_APPS_SETUP.COM.

GNote that with DECwindows CDE, the root window is no longer visible by Gdefault. The root window is hidden behind the "backdrop" window of the Dcurrent CDE workspace. To make the root window visible, use the CDE Estyle manager selection "backdrop none", and use information such as /that in the OpenVMS FAQ to set the root window.

FTo add a new backdrop to the DECwindows CDE environment, the backdrop ?must first be in or be converted into X11 pixmap format. (This 5conversion is often possible using tools such as xv.):Then (if necessary) create the default backdrop directory DSYS$COMMON:[CDE$DEFAULTS.USER.BACKDROPS]. Place the X11 pixmap file Gcontaining the desired image into the backdrops directory, ensure that Git has a filename extension of .PM. (The xv default filename extension Efor the X11 pixmap file is .XPM, while CDE expects only to see files Gwith .PM.) Now invoke the CDE style manager and select a new backdrop. BYou will find your image will be placed at the end of the list of backdrops available.

HIf you require a message be included on the initial display---where the Gstart session display and the logo appears---you can use either of the Bfollowing approaches:
If you require a message on the initial Bdisplay where the start session and logo appears, you can use the Hfollowing approaches.
The simplest approach requires OpenVMS V7.3-2 Dor later, and the corresponding DECwindows V1.3-1 kit or later. You Hwill want to create a file named SYS$COMMON:[SYSMGR]DECW$GREET.TXT, and Gthis will be displayed in a popup---with an OK button---when the login Abox is displayed. This is intended specifically for applications Grequiring such a display.
The second approach involves copying the file file: FSYS$SYSDEVICE:[VMS$COMMON.CDE$DEFAULTS.SYSTEM.CONFIG.C]XRESOURCES.DAT Hto SYS$SYSDEVICE:[VMS$COMMON.CDE$DEFAULTS.USER.CONFIG.C]XRESOURCES.DAT, ;and editing the copy. Specifically, look for the following:

 

"
Dtlogin*greeting.labelString: 


H
The line is normally commented out, and by default contains the string:

 

"
Welcome to %localhost% 


D
You can change this text to something akin to the following:

 

"
2Dtlogin*greeting.labelString:  Welcome to Heck \n\BThis is a Trusted System owned by the Rulers of the planet Zark\n\\n\We Come In Peace\n\\n 6If you want Privacy, you've come to the wrong place\n\\n 


K
The lines of text will be centered for you.
In most DECwindows H versions, you will be able to onbtain only about eight (8) lines of J text. Changes have been implemented in DECwindows V1.3 and later that 6 permit up to about twenty-five (25) lines of text.



AThe login logo is stored as an XPM bitmap image in the text file HSYS$SYSROOT:[SYSCOMMON.CDE$DEFAULTS.SYSTEM.APPCONFIG.ICONS.C]DECDTLOGO.PM,) and it can be changed. Copy the file to J SYS$SYSROOT:[SYSCOMMON.CDE$DEFAULTS.USER.APPCONFIG.ICONS.C]DECDTLOGO.PM, D as DECwindows upgrades can replace the system version of this file.

GOn DECwindows V1.3-1 and later (and possibly on V1.3), both DECwindows ?CDE and DECwindows Motif displays use this logo file. On older Freleases, only the DECwindows CDE displays used this logo file, while Bthe logo used for the Motif login display was hard-coded into the Fpackage and the only available override is the DECW$LOGINLOGO command 9procedure mechanism within the customized, site-specific !DECW$PRIVATE_APPS_SETUP.COM file.




 r Y \ ^  
PreviousNextContentsIndex