decc$from_vms

Converts OpenVMS file specifications to UNIX style file specifications.

Format

#include  <unixlib.h>

int decc$from_vms  (const char *vms_filespec, int
                   action_routine, int wild_flag);

Arguments

vms_filespec
The address of a null-terminated string containing a name in OpenVMS file specification format.
action_routine
The address of a routine that takes as its only argument a null- terminated string containing the translation of the given OpenVMS file name to a valid UNIX style file name.

If the action_routine returns a nonzero value (TRUE), file translation continues. If it returns a zero value (FALSE), no further file translation takes place.

wild_flag
Either 0 or 1, passed by value. If a 0 is specified, wildcards found in vms_filespec are not expanded. Otherwise, wildcards are expanded and each one is passed to action_ routine. Only expanded file names that correspond to existing UNIX style files are included.

Description

This routine converts the given OpenVMS file specification into the equivalent UNIX style file specification. It allows you to specify OpenVMS wildcards, which are translated into a list of corresponding existing files in UNIX style file specification format.

Return Value
The number of file names that result from the specified OpenVMS file specification. 

Example

    #include <unixlib.h>
    #include <stdio.h>
    
    int main(int argc, char *argv[])
            {
            int number_found;        /* number of files found */
            int print_name();        /* name printer          */
    
            printf( "Translating: %s\n", argv[1]);
            number_found = decc$from_vms( argv[1], print_name, 1);
            printf( "\n%d files found", number_found );
            }
    
    /* print the name on each line */
    print_name(char *name)
            {
            printf( "\n%s", name );
            /* will continue as long as success status is returned */
            return(1);
            }
    

    This example shows how to use the decc$from_vms routine in DEC C. It produces a simple form of the ls command that lists existing files that match an OpenVMS file specification supplied on the command line. The matching files are displayed in UNIX style file specification format.


Previous Page | Next Page | Table of Contents | Index