Previous | Contents | Index |
HP C++ (a separate compiler from HP C) provides both symbol mangling and symbol decoration. Some of the details of working with longer symbol names and the resulting symbol name mangling in mixed language environments are listed in the shareable image cookbook, and in the C++ documentation. Symbol name decoration permits the overloading of functions (by adding characters to the external symbol for the function to indicate the function return type and the argument data types involved), and mixed-language external references can and often do need to disable this decoration via the extern "C" declaration mechanism:
extern "C" { extern int ExternSymbol(void *); extern int OtherExternSymbol(void *); } |
Also see Section 14.7 for information on /ARCHITECTURE and /OPTIMIZE=TUNE.
See Section 10.15 for information on the C system and the lib$spawn call in CAPTIVE environments.
Constructs such as the order of incrementation or decrementation and the order of argument processing within an argument list are all implementation-defined. This means that C coding constructs such as:
i = i++; a[i] = i++; foo( i, i++, --i); |
are undefined and can have (adverse) implications when porting the C code to another C compiler or to another platform. In general, any combination of ++, --, =, +=, -=, *=, etc operators that will cause the same value to be modified multiple times (between what the ANSI/ISO C standard calls "sequence points") produce undefined and implementation-specific results.
Within C, the following are the "sequence points": the ";" at the end of a C statment, the ||, &&, ?:, and comma operators, and a call to a function. Note specifically that = is NOT a sequence point, and that the individual arguments contained within a function argument list can be processed from right to left, from left to right, or at any random whim.
HP C for OpenVMS VAX (formerly DEC C) and VAX C do differ in the related processing.
So you are looking for OpenVMS-specific definitions (include files)?
UCBDEF.H, PCBDEF.H and other OpenVMS-specific definitions---these are considered part of OpenVMS and not part of the C compiler kit---are available on all recent OpenVMS Alpha releases.
To reference the version-dependent symbol library sys$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.
And some general background: the STARLET definitions (and thus the sys$starlet_c.tlb library) contain the symbols and the definitions that are independent of the OpenVMS version. The LIB definitions (and thus sys$lib_c) contain symbols and definitions that can be dependent on the OpenVMS version. You won't need to rebuild your code after an OpenVMS upgrade if you have included definitions from STARLET. The same cannot be said for some of the definitions in LIB---you might need to rebuild your code. (The UCB structure can and has changed from release to release, for instance.)
Recent versions of C automatically search sys$starlet_c.tlb. Explicit specification of sys$lib_c.tlb is required.
Also see the Ask The Wizard website topics (2486), (3803), and (1661):
For additional information on the OpenVMS Ask The Wizard (ATW) area and for a pointer to the available ATW Wizard.zip archive, please see Section 3.9.
See Section 9.5 for information on the C off_t limitations, resolved
in OpenVMS V7.3-1 and later and in ECO kits available for specific
OpenVMS releases. The use of a longword for off_t restricts
applications using native C I/O to file sizes of two gigabytes or less,
or these applications must use native RMS or XQP calls for specific
operations.
10.23 Status of Programming Tools on OpenVMS VAX?
DECthreads 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 releases of these development packages for use on OpenVMS VAX. The run-time support for both DECthreads (CMA$RTL) and for C (DECC$CRTL) will continue to be maintained, and will continue to be available on OpenVMS VAX. The VAX C V3.2 compiler is the final VAX C compiler release for OpenVMS VAX, and the VAX C Run-Time Library (VAXCRTL) will also continue to be available.
New development and new features and product enhancements continue for
the OpenVMS Alpha and the OpenVMS IA-64 DECthreads and C compilers.
10.24 Choosing a Version Number for Application Code?
One of the common rules-of-thumb for choosing a version number for a new version of a layered product or an application, and its expected effects on client applications and users, follows:
For additional version-numbering materials and for information on assigning module generation numbers, please see the OpenVMS (POLYCENTER) Software Product Installation Utility---variously refered to by acronyms including PCSI and SPIA---reference manual available within the OpenVMS documentation set.
Of course, all of this is obviously subject to interpretation, particularly around the distinction between large and small changes and such. The scale of the application is also a factor, as larger and more complex applications will tend toward smaller increments and will tend to see the maintenance number incremented, while new releases of smaller applications will tend to see the minor version incremented somewhat more frequently.
The goal of all this is to provide a guide to relative scale of changes
and the associated effort involved in an upgrade for the user and/or
for the application programmer.
10.25 Selecting a Process Dump Directory?
You can customize the device and directory for the process dump by defining the logical names SYS$PROCDMP and SYS$PROTECTED_PROCDMP. The former is for non-privileged dumps, while the latter is the location where privileged image dumps are written, and preferably an area protected against untrusted access. For example:
$ define SYS$PROCDMP SYS$ERRORLOG: $ define /exec SYS$PROTECTED_PROCDMP SYS$ERRORLOG: |
The abouve presumes that the SYS$ERRORLOG logical name points to a valid location.
There 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?
If you are interested in accessing the native Intel Itanium assembler within the OpenVMS I64 GNV environment---and since the iasi64 assembler is a Unix program and GNV is a Unix environment for OpenVMS I64---you can simply copy iasi64.ext into your gnu:[bin] directory in place of "as.", and of "AS.EXE".
Alternately and probably also better, you can write an "as." script to invoke the iasi64.exe image from its particular prefered location on the local system.
A typical "as." script looks like this:
path/iasi64.exe $1 $2 $3 $4 $5 |
On a workstation, you will want to use the "Customize" menu of the session manager utility and select "Security". When the pop-up box appears, you can select the host node, username, and tranport that will allow you to launch an application that targets the workstation display.
If this does not provide you with access to the display, You need a checklist of sorts:
Shell | Command |
---|---|
csh | |
# setenv DISPLAY vms.domain:0.0 | |
sh and ksh | |
# $ DISPLAY=vms.domain:0.0 ; export DISPLAY | |
DCL | |
$ SET DISPLAY/CREATE/NODE=vms.domain -
/TRANSPORT=TCPIP/SERVER=server/SCREEN=screen |
To create a display from an OpenVMS host to a remote X Windows display, use one of the following DCL commands:
$ SET DISPLAY /CREATE /TRANSPORT=net_transport /NODE=remote_node $ SET DISPLAY /CREATE /TRANSPORT=LAT /NODE=remote_node $ SET DISPLAY /CREATE /TRANSPORT=DECnet /NODE=remote_node $ SET DISPLAY /CREATE /TRANSPORT=TCPIP /NODE=remote_node |
Note that LAT is typically used only for the VXT series X Windows terminals, but it can also be used from OpenVMS to OpenVMS systems on various OpenVMS releases, such as on OpenVMS Alpha V6.1 and later. For details on configuring the TCP/IP transport, see Section 11.14.
If you are interested in X Windows terminals and have an older
VAXstation system around, please see the EWS package on Freeware V5.0.
11.3 How can I get the information from SHOW DISPLAY into a symbol?
Use the undocumented SHOW DISPLAY/SYMBOL, and then reference the symbols DECW$DISPLAY_NODE, DECW$DISPLAY_SCREEN, DECW$DISPLAY_SERVER and/or DECW$DISPLAY_TRANSPORT.
An example of calling the underlying (and also undocumented) sys$qio programming interface for the WSDRIVER (WSAn:) is available at:
http://www.hp.com/go/openvms/freeware/ |
If you are working from a Decterm, you can use the AutoPrint feature. Choose the "Printer..." menu item from the "Options" menu, set the printing destination to the name of the file you want, and set "Auto Print Mode". You are now free to continue.
It should be noted that all of the characters and escape sequences are
captured, but if you display the resulting log file on a DECterm, then
you will see exactly what was originally displayed.
11.5 Why is DECwindows Motif not starting?
First check to see if there is a graphics device, usually a G* device. (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:
$ DEFINE/SYSTEM/EXEC DECW$IGNORE_WORKSTATION TRUE |
$ LICENSE LIST DW-MOTIF/FULL $ LICENSE LIST NET-APP-SUP*/FULL |
$ DECW$XSIZE_IN_PIXELS == xvalue $ DECW$YSIZE_IN_PIXELS == yvalue $ DEFINE/SYSTEM DECW$SERVER_REFRESH_RATE rate_in_Hz |
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 following control sequences, where [esc] is the ANSI escape code, value decimal 27, and "text label" is what you want to display:
To set the DECterm title, send the escape character, then the characters "]21;", then the text label string, and then an escape character followed by a backslash character.
To set the icon label, send the escape character, then the characters "]2L;", then the icon label string, and then an escape character followed by a backslash character.
To set both the DECterm title and icon to the full device name, you can use the following DCL commands:
$ esc[0,7] = 27 $ fulldevnam = F$Edit(F$GetDVI("TT","FULLDEVNAM"),"UPCASE,COLLAPSE") $ write sys$output esc+ "]21;" + fulldevnam + esc + "\" $ write sys$output esc+ "]2L;" + fulldevnam + esc + "\" |
You can also change the title and the icon using the Options-Window... menu.
Also see Section 12.1 and Section 8.11.
11.7 How do I customize DECwindows, including the login screen?
To customize various DECwindows Motif characteristics including the defaults used by the SET DISPLAY command, the DECwindows login screen background 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 FileView 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 |
This example template file is typically copied over to the filename SYS$COMMON:[SYSMGR]DECW$PRIVATE_APPS_SETUP.COM and then modified to meet site-specific requirements.
Additionally, various X tools such as xsetroot, bitmap and xrdb---some these can be useful in customizing the appearance of an application or of the DECwindows Motif display---are provided in the DECW$UTILS: area.
When using DECwindows V1.2-4 and later on OpenVMS Alpha, the default desktop is the Common Desktop Environment (CDE). You can select your preferred desktop (CDE or DECwindows Motif) when logging in, or you can change the default to the DECwindows Motif desktop using the DCL symbol decw$start_new_desktop in the DECwindows private application setup command procedure. See SYS$MANAGER:DECW$PRIVATE_APPS_SETUP.TEMPLATE for further details, and how to create DECW$PRIVATE_APPS_SETUP.COM.
Note that with DECwindows CDE, the root window is no longer visible by default. The root window is hidden behind the "backdrop" window of the current CDE workspace. To make the root window visible, use the CDE style manager selection "backdrop none", and use information such as that in the OpenVMS FAQ to set the root window.
To add a new backdrop to the DECwindows CDE environment, the backdrop must first be in or be converted into X11 pixmap format. (This conversion is often possible using tools such as xv.) Then (if necessary) create the default backdrop directory SYS$COMMON:[CDE$DEFAULTS.USER.BACKDROPS]. Place the X11 pixmap file containing the desired image into the backdrops directory, ensure that it has a filename extension of .PM. (The xv default filename extension for the X11 pixmap file is .XPM, while CDE expects only to see files with .PM.) Now invoke the CDE style manager and select a new backdrop. You will find your image will be placed at the end of the list of backdrops available.
If you require a message be included on the initial display---where the
start session display and the logo appears---you can use either of the
following approaches:
If you require a message on the initial
display where the start session and logo appears, you can use the
following approaches.
The simplest approach requires OpenVMS V7.3-2
or later, and the corresponding DECwindows V1.3-1 kit or later. You
will want to create a file named SYS$COMMON:[SYSMGR]DECW$GREET.TXT, and
this will be displayed in a popup---with an OK button---when the login
box is displayed. This is intended specifically for applications
requiring such a display.
The second approach involves copying the
file file:
SYS$SYSDEVICE:[VMS$COMMON.CDE$DEFAULTS.SYSTEM.CONFIG.C]XRESOURCES.DAT
to SYS$SYSDEVICE:[VMS$COMMON.CDE$DEFAULTS.USER.CONFIG.C]XRESOURCES.DAT,
and editing the copy. Specifically, look for the following:
Dtlogin*greeting.labelString: |
Welcome to %localhost% |
Dtlogin*greeting.labelString: Welcome to Heck \n\ This is a Trusted System owned by the Rulers of the planet Zark\n\ \n\ We Come In Peace\n\ \n If you want Privacy, you've come to the wrong place\n\ \n |
Dtlogin*greeting.labelString: |
Welcome to %localhost% |
Dtlogin*greeting.labelString: Unauthorized Access Permitted\n\ Press OK to Crash the System\n\ \n\ The Rulers of Zark are Such Kidders\n\ \n |
The login logo is stored as an XPM bitmap image in the text file SYS$SYSROOT:[SYSCOMMON.CDE$DEFAULTS.SYSTEM.APPCONFIG.ICONS.C]DECDTLOGO.P M, and it can be changed. Copy the file to SYS$SYSROOT:[SYSCOMMON.CDE$DEFAULTS.USER.APPCONFIG.ICONS.C]DECDTLOGO.PM, as DECwindows upgrades can replace the system version of this file.
On DECwindows V1.3-1 and later (and possibly on V1.3), both DECwindows CDE and DECwindows Motif displays use this logo file. On older releases, only the DECwindows CDE displays used this logo file, while the logo used for the Motif login display was hard-coded into the package and the only available override is the DECW$LOGINLOGO command procedure mechanism within the customized, site-specific DECW$PRIVATE_APPS_SETUP.COM file.
Previous | Next | Contents | Index |