From: rankin@eql.caltech.edu (Pat Rankin)
Subject: Re: Trying to use SYS$ASSIGN...
Date: 1995/12/16 [thread overview]
Message-ID: <16DEC199517111336@eql.caltech.edu> (raw)
In-Reply-To: 4an4al$ho0@nntpd.lkg.dec.com
In article <4an4al$ho0@nntpd.lkg.dec.com>,\
hoffman@xdelta.enet.dec.com (Stephen Hoffman) writes...
[...]
>:static struct {int Size; char *Ptr;} Descr={9,"SYS$INPUT"};
[...]
> You will want to take a look at the C documentation around the
> declaration and use of the string descriptor structure.
[...]
> If you choose to use a string descriptor and are manually
> initializing it, you will want to use the descriptor class
> DSC$K_CLASS_S until you fully understand the declaration and
> use of the dynamic string descriptor class DSC$K_CLASS_D.
> And most common string descriptors use the text string data
> type: DSC$K_DTYPE_T. (These values, and the structure of
> various string descriptors are declared in descrip.h.)
The descriptor he is using is not the source of his problem,
because is it completely correct (as long as `int' and `char *' are
each 32 bits, and assuming that the length value fits within 16 bits,
so as not to overflow into the type & class fields). Probably 98%
of VAX/VMS assembler code--including within VMS itself--would have
constructed a similar descriptor without bothering with the type
and class.
System services do not even examine the type and class fields.
Even if they did, 0 is a valid value (indicating "unspecified", which
is treated as static for the class and arbitrary bytes for the type).
His descriptor did have zeroes in those two fields due to the bit
pattern of the length value 9.
Neither adding a trailing colon to "SYS$INPUT" nor changing
the case of "SYS$ASSIGN" makes any difference. Almost certainly the
original problem was due to his actual translation of "SYS$INPUT",
not to the code which was posted.
Pat Rankin, rankin@eql.caltech.edu
prev parent reply other threads:[~1995-12-16 5:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-12-10 5:00 Trying to use SYS$ASSIGN Carl J. Lambrecht
1995-12-13 5:00 ` Stephen Hoffman
1995-12-16 5:00 ` Pat Rankin [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox