6 This macro sets up the file access block and name block for VMS.
7 It also does the initial parsing of the input string (resolving
9 if any) and finds all files matching the input pattern.
10 The address of the first matching pattern is returned.
12 Written by Phillip C. Brisco 8/98.
17 vms_fab (int * argp
, char **argvp
[])
26 strcpy (fna_buffer
, *argvp
[optind
]);
27 length_of_fna_buffer
= NAM$C_MAXRSS
;
29 fab
.fab$b_bid
= FAB$C_BID
;
30 fab
.fab$b_bln
= FAB$C_BLN
;
31 fab
.fab$l_fop
= FAB$M_NAM
;
33 fab
.fab$l_fna
= (char *)&fna_buffer
;
34 fab
.fab$b_fns
= length_of_fna_buffer
;
36 nam
.nam$b_bid
= NAM$C_BID
;
37 nam
.nam$b_bln
= NAM$C_BLN
;
38 nam
.nam$l_esa
= (char *)&expanded_name
;
39 nam
.nam$b_ess
= NAM$C_MAXRSS
;
40 nam
.nam$l_rsa
= (char *)&result_name
;
41 nam
.nam$b_rss
= NAM$C_MAXRSS
;
43 fab_stat
= sys$
parse (&fab
);
44 fab_stat
= sys$
search (&fab
);
46 if (fab_stat
!= 65537)
48 fprintf (stderr
, "No Matches found.\n");
53 While we find matching patterns, continue searching for more.
55 while (fab_stat
== 65537)
58 Allocate memory for the filename
60 arr_ptr
[optout
] = alloca (max_file_path_size
+ 1);
62 strcpy (arr_ptr
[optout
], result_name
);
65 If we don't tack on a null character at the end of the
67 we can get partial data which is still there from the last
70 arr_ptr
[optout
][nam
.nam$b_dev
+
74 nam
.nam$b_ver
] = '\0';
76 fab_stat
= sys$
search (&fab
);
82 /* Return a pointer to the beginning of memory that has the expanded