/* 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 <descrip.h>

int LOGICAL_LOOKUP();

int main()
{
   int i,n,l[1000];
   char s[1000][255];
   $DESCRIPTOR(tbldes,"LNM$PROCESS_TABLE");
   struct dsc$descriptor_s lnmdes;
   lnmdes.dsc$w_length = 255;
   lnmdes.dsc$a_pointer = (char *)s;
   LOGICAL_LOOKUP(&lnmdes,l,&n,&tbldes);
   for(i=0;i<n;i++) {
      s[i][l[i]] = '\0';
      printf("%s\n",s[i]);
   }
}
