Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ames!mailrus!utah-gr!uplherc!sp7040!obie!wsccs!terry From: terry@wsccs.UUCP (Every system needs one) Newsgroups: comp.lang.c Subject: Re: VMS C & records in files Summary: Not if you have a preprocessor Message-ID: <624@wsccs.UUCP> Date: 31 Aug 88 05:15:35 GMT References: <196@rna.UUCP> <6671@bloom-beacon.MIT.EDU> <1609@edison.GE.COM> <644@eplrx7.UUCP> Lines: 45 In article <644@eplrx7.UUCP>, ward@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 ... ... ... $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 |