VMS C & records in files

Every system needs one terry at wsccs.UUCP
Wed Aug 31 15:15:35 AEST 1988


In article <644 at eplrx7.UUCP>, ward at eplrx7.UUCP (Rick Ward) writes:
> On a related note, why couldn't Digital have made it easier to call system
> functions from C.  This difficulty alone makes C unusable on VMS, at least 
> in my opinion :(.  The problem is that you have to allocate and build 
> structures describing each variable you want to pass to a system routine.
> YUCK!

Not if your C has #include or #define... it does, doesn't it?

#include <descrip.h>

...
...
...

$DESCRIPTOR( foo, "whatever");

makes a descriptor foo.

As far as modding a descriptor struct, once built, the most common
problem is that you need a sizeof() op, and that's a preprocessor
thing and you can't pass it to your function to fill the descriptor
without being kludgy.  Observe:

#define filldesc( x, y) magicfilldesc( x, y, sizeof(y))

	filldesc( desc, "hello");


magicfilldesc( desc, object, size)	/* VMS enjoys long names*/
{
...
...
...
}

Admittedly, it makes for some verbose assembly, but what can you expect
from a converted optimising PL/1 compiler anyway?


| Terry Lambert           UUCP: ...{ decvax, ihnp4 } ...utah-cs!century!terry |
| @ Century Software        OR: ...utah-cs!uplherc!sp7040!obie!wsccs!terry    |
| SLC, Utah                                                                   |
|                   These opinions are not my companies, but if you find them |
|                   useful, send a $20.00 donation to Brisbane Australia...   |
|                   'I have an eight user poetic liscence' - me               |



More information about the Comp.lang.c mailing list