[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference vaxaxp::vmsnotes

Title:VAX and Alpha VMS
Notice:This is a new VMSnotes, please read note 2.1
Moderator:VAXAXP::BERNARDO
Created:Wed Jan 22 1997
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:703
Total number of notes:3722

414.0. "DCL$AL_TAB_VEC for Alpha/VMS?" by CHR27::YEUNG (im2bz2p,ru?) Wed Apr 02 1997 21:16

On VAX/VMS, if you link with the shareable image DCLTABLES.EXE,
the DCL$AL_TAB_VEC symbol points to the base of the DCL table.
My customer uses this symbol to access the DCL table.

On Alpha/VMS, this symbol does not exist.  What should my customer
do instead in order to access the DCL table in an executable image?

Thanks

Tim
T.RTitleUserPersonal
Name
DateLines
414.1AUSS::GARSONDECcharity Program OfficeWed Apr 02 1997 22:059
    re .0
    
    It sounds as if your customer was relying on an undocumented feature
    (or else please indicate where this is documented).
    
    You are right. The symbol does not appear to be present on Alpha.
    
    What on earth is your customer doing!? Perhaps there is a supported way
    of achieving it.
414.2DCL$AL_TAB_VEC is unsupported; use supported mechanismsXDELTA::HOFFMANSteve, OpenVMS EngineeringThu Apr 03 1997 10:1624
    
    Under OpenVMS VAX, the customer is depending on an undocumented and
    unsupported procedure -- what the customer is doing here is using the
    standard DCL command tables for parsing commands within an image. The
    DCL$AL_TAB_VEC symbol is exported from the DCLTABLES image, and points
    to the base of the DCLTABLES DCL command table.  Under OpenVMS VAX,
    this can be passed into CLI$ parsing routines such as CLI$DCL_PARSE.
    Under OpenVMS Alpha, this symbol is not exported; it's not made
    visible to user LINKs.  (And I know of no plans to export this
    symbol from DCLTABLES.)

    I'd recommend moving to one of the documented mechanisms.

    If the customer insists on continuing with an unsupported approach,
    they will want to acquire the source listings CD-ROM, and they will
    want to become more familiar with linking against the system symbol
    tables (LINK/SYSEXE, on OpenVMS Alpha) and with the CTL$AG_CLITABLE
    symbol.  This is the address of the base of the currently-mapped
    symbol table, stored in the process control region.

    Support Resources:
	The Internals and Data Structures Manuals
	COMET; the URL is http://comet.alf.dec.com/
	VAXAXP::NOTES$ARCHIVE:ALPHANOTES_V1 note 2086.*
414.3CSC64::BLAYLOCKIf at first you doubt,doubt again.Thu Apr 03 1997 14:0747
RE: .2

>    I'd recommend moving to one of the documented mechanisms.

For the purpose stated, which ones are those?  How does one
validate a DCL command without actually executing it?

RE: .0

For the still undocumented/unsupported interface, the following
example is provided.  It is unhelpful if you have your own
private copy of DCLTABLES that you are using.

On VAX systems, link with SYS.STB /SELECTIVE.  On Alpha systems, use the
/SYSEXE qualifier.

$ CC /DECC /OBJ=DCL_EXAMPLE SYS$INPUT:
#include descrip
#include <stdio.h>

extern int CLI$DCL_PARSE() ;

main()

{

    int status;
    $DESCRIPTOR(command, "SHOW TIME");

#   pragma extern_model save
#   pragma extern_model strict_refdef
    extern void *CTL$AG_CLITABLE ;
#   pragma extern_model restore

    status = CLI$DCL_PARSE(&command, CTL$AG_CLITABLE);

    printf("Status from CLI$DCL_PARSE of %.*s is: %x\n",
                command.dsc$w_length, command.dsc$a_pointer, status);

}
$ IF F$GETSYI("ARCH_NAME").EQS."VAX"
$ THEN
$   LINK DCL_EXAMPLE + SYS$SYSTEM:SYS.STB/SELECTIVE
$ ELSE
$   LINK /SYSEXE DCL_EXAMPLE
$ ENDIF
$ RUN DCL_EXAMPLE
414.4Without Information, Suggesting Alternatives Is Difficult...XDELTA::HOFFMANSteve, OpenVMS EngineeringThu Apr 03 1997 14:129
:For the purpose stated, which ones are those?

   There's no purpose stated...

:How does one validate a DCL command without actually executing it?

   One cannot verify a command without actually executing it.

414.5AUSS::GARSONDECcharity Program OfficeThu Apr 03 1997 19:2024
    re .*
    
    Yes, my question about what the customer is doing was directed at the
    *purpose* of parsing against DCLTABLES which is obviously what is
    achieved by using DCL$AL_TAB_VEC.
    
    Incidentally, there is no guarantee that DCLTABLES in SYS$SHARE matches
    what is in process memory (as is provided by the example hack in this
    topic). My LOGIN.COM executes SET COMM commands.
    
    Since we are into dodgy hack territory ... one way that I have actually
    used to validate the syntax of a command but without executing the
    command (to avoid the side-effect of doing so at the expense of missing
    out on some additional checks that may be made by the command) is to
    ASSIGN a bogus logical name /USER for the image name and then execute
    the command. Strangely, I can't for the life of me remember why I
    wanted to do this. (-: Anyway, the only hack part is knowing what
    logical name to assign - which unfortunately can only definitively be
    obtained from the command tables. [I only wanted to test a single,
    known-in-advance verb with no relevant changes of image so it wasn't
    too bad for me.] Perhaps by SPAWNing the command into an environment in
    which image activation will fail e.g. insufficient quota, even the
    problem of having to know the logical name could be avoided.
             
414.6Will try using LIB$SPAWN insteadCHR27::YEUNGim2bz2p,ru?Fri Apr 04 1997 20:427
The customer's application has its own command table.  But it also
allows users to enter DCL commands (by preceeding them with a "$")
and it returns the results.  I think using LIB$SPAWN will work for them.

Thanks

Tim