Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!cmcl2!brl-adm!adm!EDSTROM%UNCAEDU.BITNET@wiscvm.wisc.EDU From: EDSTROM%UNCAEDU.BITNET@wiscvm.wisc.EDU Newsgroups: comp.lang.c Subject: VMS Descriptors Message-ID: <7960@brl-adm.ARPA> Date: Mon, 22-Jun-87 21:19:44 EDT Article-I.D.: brl-adm.7960 Posted: Mon Jun 22 21:19:44 1987 Date-Received: Tue, 23-Jun-87 07:29:42 EDT Sender: news@brl-adm.ARPA Lines: 38 Steve Summit in Message-ID: <1142@copper.TEK.COM> writes: >There are some header files or something that come with VAXC, >DEC's VMS C compiler, that make handling descriptors a bit >easier. This is correct about descriptors being easy to use. His version of the VMS "hello world" program might look like this: #include descrip #define IO$_WRITEVBLK 0x30 main() { assign_channel (&channel, "sys$output"); sys$qiow(0, channel, IO$_WRITEVBLK, 0, 0, 0, "Hello, world!\r", 14, 0, 0, 0, 0); } #define STR_DESC(A,B) struct dsc$descriptor_s A = {strlen(B),DSC$K_DTYPE_T,\ DSC$K_CLASS_S,B} assign_channel (chan, dev_name) short int *chan; char *dev_name; { STR_DESC(device, dev_name); sys$assign(&device, chan, 0, 0); } The common calling protocol on VMS is one of its best features. I suppose its unlikely that this could be built into the major languages. (Sigh.) There seems to be enough trouble defining the ANSI C specifications without trying to co-ordinate the ANSI boards for each of the other languages. It is nice not having to translate old or borrowed FORTRAN, BASIC or PASCAL routines to use in a new C program. Especially if you don't understand the language the original routine was written in.