              <<< VAXAXP::NOTES$:[NOTES$LIBRARY]VMSNOTES.NOTE;1 >>>
               -< VAX and Alpha VMS - Digital Internal Use Only >-
================================================================================
Note 900.4                    RUN vs foreign cmnd?                       4 of 18
CSC32::BLAYLOCK "If at first you doubt,doubt again." 47 lines  20-MAY-1996 15:21
--------------------------------------------------------------------------------

#include <stdio.h>

#include <descrip.h>

#include <lib$routines.h>
#include <starlet.h>
#include <clidef.h>
#include <cliverbdef.h>

extern int sys$cli() ;

main(int argc, char *argv[]) 
{

    int status, verb_type ;
    struct clidef1 cli_req = { 0 }  ;

    struct dsc$descriptor *descriptor ;

    cli_req.cli$b_rqtype = CLI$K_GETCMD ;

    status = sys$cli (&cli_req) ;

    descriptor = (struct dsc$descriptor *) &cli_req.cli$q_rqdesc ;

    printf("The value of status is: %08X\n", status ) ;
    printf("The descriptor returned is: %0.*s\n", 
                descriptor->dsc$w_length, descriptor->dsc$a_pointer ) ;
    printf("The image was started with a verb type of ") ;
    verb_type = cli_req.cli$b_rqstat ;
    switch( verb_type ) 
    {
        case CLI$K_VERB_RUN :
            printf("RUN");
            break; 
        case CLI$K_VERB_FORE :
            printf("FOREIGN");
            break; 
        case CLI$K_VERB_MCR :
            printf("MCR");
            break; 
        default:
            printf("Unknown: %d", verb_type) ;
    }
    printf("\n");
}
