/* 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>

#define s1 "This is a test"
char s2[] = "This is a test";
char *s3 = "This is a test";
char s4[100] = "This is a test";

int main(int argc, char *argv[])
{
    $DESCRIPTOR(d1, s1);
    printf("str = %s, len = %d\n", d1.dsc$a_pointer, d1.dsc$w_length);
    $DESCRIPTOR(d2, s2);
    printf("str = %s, len = %d\n", d2.dsc$a_pointer, d2.dsc$w_length);
    $DESCRIPTOR(d3, s3);
    printf("str = %s, len = %d\n", d3.dsc$a_pointer, d3.dsc$w_length);
    $DESCRIPTOR(d4, s4);
    printf("str = %s, len = %d\n", d4.dsc$a_pointer, d4.dsc$w_length);
    return 0;
}
