/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
#include <stdio.h>
#include <ssdef.h>
#include <dvidef.h>
#include <descrip.h>
#include <starlet.h>

struct item
{
   short int buflen,code;
   long int bufadr,retlenadr;
};

int main(int argc,char *argv[])
{
   $DESCRIPTOR(term,"TT:");
   long int  width;
   struct item info[2] = { { sizeof(width), DVI$_DEVBUFSIZ, (long int)&width, 0},
                           { 0, 0, 0, 0 } };
   sys$getdviw(0,0,&term,info,0,0,0,0);
   printf("%d\n",width);
   return SS$_NORMAL;
}
