OpenVMS header files and descrip.h
Posted: Sat Jul 20, 2019 12:22 pm
I copied the OpenVMS header files from DKA0:[SYS0.SYSCOMMON.DECC$LIB.REFERENCE.SYS$STARLET_C] which appears to work. However, I appear to be missing a file DESCRIP.H.
What did I misunderstand?
Added in 3 hours 32 minutes 4 seconds:
I noticed when I create a file test.c with an #include <descrip.h> on the VMS system, cc does not complain about a non-existing descrip.h. But I cannot find a descrip.h anywhere on the VMS file system.
When I write a C file in Visual Studio Code and include a fake descrip.h (which I created), the call to $DESCRIPTOR() works (but is marked as an error in the IDE). The C file then compiles on the VMS system and the system call works.
Specifically I did a
$DESCRIPTOR(tt, "SYS$OUTPUT");
unsigned short int channel;
sys$assign(&tt, &channel, 0, 0, 0);
char *s = "Hello from sys$qiow!\n";
int length=strlen(s);
sys$qiow(0, channel, IO$_WRITEVBLK, &iosb, 0, 0, s, length, 0, 0, 0, 0);
The "tt" in $DESCRIPTOR is marked by the IDE as an error since $DESCRIPTOR does not exist (since descrip.h does not exist). But it compiles and runs.
I am imagining that the parameter after the string (length) is indeed the length of the string to output. It appears to work. If I make the parameter bigger, the system call outputs lots of question marks after my string s.
Where is descrip.h supposed to be and why does cc on VMS find it even though dir [...] does not?
What did I misunderstand?
Added in 3 hours 32 minutes 4 seconds:
I noticed when I create a file test.c with an #include <descrip.h> on the VMS system, cc does not complain about a non-existing descrip.h. But I cannot find a descrip.h anywhere on the VMS file system.
When I write a C file in Visual Studio Code and include a fake descrip.h (which I created), the call to $DESCRIPTOR() works (but is marked as an error in the IDE). The C file then compiles on the VMS system and the system call works.
Specifically I did a
$DESCRIPTOR(tt, "SYS$OUTPUT");
unsigned short int channel;
sys$assign(&tt, &channel, 0, 0, 0);
char *s = "Hello from sys$qiow!\n";
int length=strlen(s);
sys$qiow(0, channel, IO$_WRITEVBLK, &iosb, 0, 0, s, length, 0, 0, 0, 0);
The "tt" in $DESCRIPTOR is marked by the IDE as an error since $DESCRIPTOR does not exist (since descrip.h does not exist). But it compiles and runs.
I am imagining that the parameter after the string (length) is indeed the length of the string to output. It appears to work. If I make the parameter bigger, the system call outputs lots of question marks after my string s.
Where is descrip.h supposed to be and why does cc on VMS find it even though dir [...] does not?