;-*-macro-*- .title file_search - search for wild card file spec .ident /01/ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; file_search - parses and searches for file and ,optionally, fid ; ; ; ; usage logical = start_search (file_spec_str) ; ; where start_search sets up the original parse on the ; ; file_spec_str. It will return a true value if ; ; there are no errors, otherwise a false value ; ; that is also the RMS error code ; ; file_spec_str is a file specification string, which ; ; can contain wild cards. If this field is empty, ; ; unpredictable results may happen ; ; ; ; usage logical = file_search (file_spec_str) ; ; where file_search returns the various rms status ; ; codes, a true value (bit 0 set) indicates ; ; success ; ; file_spec_str is a file specification string, which ; ; contains the resulting string from the ; ; search, if the search was successful. ; ; The array is assumed to be 180 bytes long. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .psect file_data, lcl, noexe, noshr, con, pic, rel, wrt esasiz = 180 esablk: .blkb esasiz ; esa for wild card searches rsasiz = 180 ; the rsa is passed in, it is assumed ; to be 180 bytes long namblk: $nam esa = esablk, ess = esasiz, rss = rsasiz fabblk: $fab nam = namblk .psect filecode, con, exe, lcl, pic, rel, shr, nowrt .entry start_search, ^m movl 4(ap), r2 ; pull in the string spec movl r2, fabblk+fab$l_fna ; load in file name locc #0, #180, (r2) ; calculate its length subl3 r0, #180, fabblk+fab$b_fns ; load in the length $parse fab = fabblk ; parse it ret .entry file_search, ^m movl 4(ap), r2 movl r2, namblk+nam$l_rsa ; load in resultant file spec $search fab = fabblk ; search for the files blbc r0,30$ addb2 namblk+nam$b_rsl, r2 ; resultant file string length movb #0, (r2) ; put on an eos 30$: ret .end