Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Header files for definitions for utility routines and system services

 
SOLVED
Go to solution
Malleka Ramachandran
Frequent Advisor

Header files for definitions for utility routines and system services

On an OpenVMS Alpha 8.2, using HP C V7.1-015-48F8P compiler I am trying to compile a source module that calls the routine lbr$lookup_key and checks for the return status against the condition LBR$_KEYNOTFND.
Apparently the C header files do not contain this condition value. I searched the reference directory where the list of H files included in the .TLB is provided, and none of the header files contain this.
I am building this on 8.2 in preparation for our itanium port. Originally, this code was using several assembler modules to extract the defintions from $LBRDEF, $QUIDEF and $PRVDEF macros and the compiled module was linking against these.
Could someone tell me where to find these missing definitions from header files?

Thanks,
Malleka
10 REPLIES
Volker Halle
Honored Contributor
Solution

Re: Header files for definitions for utility routines and system services

Malleka,

LBR$_KEYNOTDEF is a global symbol defined in LBRSHR and will be resolved at link-time (tested on OpenVMS I64 V8.2).

Volker.
Volker Halle
Honored Contributor

Re: Header files for definitions for utility routines and system services

Malleka,

here is an old TIMA article (from OpenVMS V4.x days) describing this:

http://h18000.www1.hp.com/support/asktima/appl_tools/009181EA-5633A280-1C01E7.html

And what's wrong with using MACRO-32 assembler modules on OpenVMS Alpha V8.2 or even OpenVMS Itanium ???

Volker.
Arch_Muthiah
Honored Contributor

Re: Header files for definitions for utility routines and system services

Malleka,

yes, it has been defined as global.

I just went thru most of the *.MLB, and *.TLB, unbale to find LBR$_KEYNOTFND macro.

As Mr.Volker said it should be global variable, that is why it has been declared as
EXTERNAL LBR$_KEYNOTFND in the programs

You can declare this as a
external LBR$_KEYNOTFND.

Archunan
Regards
Archie
Arch_Muthiah
Honored Contributor

Re: Header files for definitions for utility routines and system services

Malleka,

See VMS help under condition_values_returned for this LBR$ routine...
$help lbr$ lbr$lookup_key


Note:
Malleka, Nice to know you do this kind of work, because I am also in the process of migrating my MACRO application to Itanium.


Archunan
Regards
Archie
Arch_Muthiah
Honored Contributor

Re: Header files for definitions for utility routines and system services

Volker,

Good info from your link.

Thanks
Archunan
Regards
Archie
Volker Halle
Honored Contributor

Re: Header files for definitions for utility routines and system services

Archunan,


$ help lbr$ lbr$lookup_key


This should be:

$ HELP LBR LBR$LOOKUP_KEY

The help topic is called: LBR_ROUTINES

Volker.
Arch_Muthiah
Honored Contributor

Re: Header files for definitions for utility routines and system services

Volker,

Any special reason why LBR$_ routine's return codes categorized as global symbol, are they being used frequently to keep it in Main mem?.

Archunan
Regards
Archie
Malleka Ramachandran
Frequent Advisor

Re: Header files for definitions for utility routines and system services

Thanks for all your responses which were quite prompt and useful.

Volker, I don' think there is anything wrong with using MACRO modules. It just happens to be a multi-platform application and the code may have to be maintained by someone who has not worked with OpenVMS.
It will be much easier if they had only C modules to look at.
Volker Halle
Honored Contributor

Re: Header files for definitions for utility routines and system services

Archunan,

in OpenVMS, data structure and constant definitions for public system APIs (system services, RTL routines etc.) are generally defined in either header (or include) files or - in case of constant declarations - as global symbols inside the shareable image files.

Structure definitions are typically defined with SDL (Structured Definition Language - see OpenVMS Freeware V5) and include or header files are generated by SDL for the various languages and put into .TLBs (e.g. FORSYSDEF.TLB, SYS$LIB_C.TLB etc.).

Constant definitions (e.g. for service return status codes) may also be defined as global constants within the shareable images files. These files will be put into IMAGELIB.OLB and the linker will resolve those definitions at link time.

The following command will list the names of all the global symbols from the global symbol table of LBRSHR.EXE (by convention, names for a facility generally start with the facility name, e.g. LBR):

$ pipe libr/lis sys$library:imagelib/names | sea sys$pipe lbr

Volker.
John Gillings
Honored Contributor

Re: Header files for definitions for utility routines and system services

Malleka,

>It just happens to be a multi-platform
>application and the code may have to be
>maintained by someone who has not worked
>with OpenVMS.
>It will be much easier if they had only
>C modules to look at.

I'm not sure I understand this. LBR$ routines are OpenVMS specific. Anyone working on that section of the code (must be #ifdef'ed for OpenVMS only?) will need to know some OpenVMS basics.

If you want C modules, it's a fairly trivial matter to transform $LBRDEF into a .h file. It's not much more than extracting the MACRO:

$ LIBRARY/EXTRACT=$LBRDEF/OUT=file SYS$SHARE:STARLET/MACRO

stripping off the top and bottom lines, then substituting "#define" for "$EQU". Someone may even be clever enough to figure out a way to do it directly with the C preprocessor.
A crucible of informative mistakes