home *** CD-ROM | disk | FTP | other *** search
- #define LINT_ARGS
- #include <stdio.h>
- #include <stdlib.h>
- #include <ctype.h>
- #include <string.h>
- #include <dos.h>
- #include "masdos.h"
-
- static struct FILEINFO *Dta_save;
-
- find_first( filespec, attributes, dta )
- char *filespec;
- unsigned int attributes;
- char *dta;
- {
- union REGS regs;
- int ercode;
-
- D_IN("find_first");
- regs.x.ax = B_GETDTA;
- intdos( ®s, ®s );
- Dta_save = (struct FILEINFO *) regs.x.bx;
- regs.x.ax = B_SETDTA;
- regs.x.dx = dta;
- intdos( ®s, ®s );
- regs.x.ax = B_FINDFIRST;
- regs.x.dx = (int) filespec;
- regs.x.cx = attributes;
- ercode = intdos( ®s, ®s );
- regs.x.ax = B_SETDTA;
- regs.x.dx = (unsigned int) Dta_save;
- intdos( ®s, ®s );
- if( ercode == 0 )
- {
- D_PRT("find_first","no error");
- }
- D_OUT("find_first");
- return( ercode );
- }
-
- int find_next( dta )
- char *dta;
- {
- union REGS regs;
- int ercode;
-
- D_IN("find_next");
- regs.x.ax = B_GETDTA;
- intdos( ®s, ®s );
- Dta_save = (struct FILEINFO *) regs.x.bx;
- regs.x.ax = B_SETDTA;
- regs.x.dx = dta;
- intdos( ®s, ®s );
- regs.x.ax = B_FINDNEXT;
- ercode = intdos( ®s, ®s );
- regs.x.ax = B_SETDTA;
- regs.x.dx = (unsigned int) Dta_save;
- intdos( ®s, ®s );
- if( ercode == 0 )
- {
- D_PRT("find_next","no error");
- }
- D_OUT("find_next");
- return( ercode );
- }
-
- ffind_first( filespec, attributes )
- char *filespec;
- unsigned int attributes;
- {
- union REGS regs;
- int ercode;
-
- D_IN("find_first");
- regs.x.ax = B_FINDFIRST;
- regs.x.dx = (int) filespec;
- regs.x.cx = attributes;
- ercode = intdos( ®s, ®s );
- if( ercode == 0 )
- {
- D_PRT("find_first","no error");
- }
- D_OUT("find_first");
- return( ercode );
- }
-
- int ffind_next()
- {
- union REGS regs;
- int ercode;
-
- D_IN("find_next");
- regs.x.ax = B_FINDNEXT;
- ercode = intdos( ®s, ®s );
- if( ercode == 0 )
- {
- D_PRT("find_next","no error");
- }
- D_OUT("find_next");
- return( ercode );
- }
-
- void frstdta()
- {
- union REGS regs;
-
- regs.x.ax = B_SETDTA;
- regs.x.dx = (unsigned int) Dta_save;
- intdos( ®s, ®s );
- }
-
- void fchgdta( dta )
- char *dta;
- {
- union REGS regs;
-
- regs.x.ax = B_GETDTA;
- intdos( ®s, ®s );
- Dta_save = (struct FILEINFO *) regs.x.bx;
- regs.x.ax = B_SETDTA;
- regs.x.dx = dta;
- intdos( ®s, ®s );
- }
-