home *** CD-ROM | disk | FTP | other *** search
- ;/*
- ;** filefind.asm
- ;** contains: filefind()
- ;*/
-
- include model.h
- include prologue.h
-
-
- pseg filefind
- ;/*
- ;** int
- ;** filefind(unsigned int attribute,char *pathname,FFFNBUF *buffer)
- ;**
- ;** ARGUMENT(s)
- ;** attribute - attribute used for searching
- ;** pathname - name of file(s) to search for
- ;** buffer - points to FFFNBUF structure
- ;**
- ;** DESCRIPTION
- ;** Finds the first filename that matches the specified file specification.
- ;** subsequent calls can be made with the pathname == NULL, in which case
- ;** the DOS find next matching file function will be called.
- ;**
- ;** RETURNS
- ;** 0 if successful else a DOS error code.
- ;**
- ;** AUTHOR
- ;** "" Thu 22-Dec-1988 13:52:02
- ;** Copyright (C)1988-1990 Greenleaf Software Inc. All Rights Reserved.
- ;**
- ;** MODIFICATIONS
- ;**
- ;*/
-
- cproc filefind
- if _LDATA
- push ds
- lds dx,parm4_ ;DS:DX points to buffer
- else
- mov dx,parm3_
- endif
- mov ah,1ah
- int 21h ;Set DTA
- if _LDATA
- lds dx,parm2_ ;DS:DX points to filename
- mov ax,ds
- or ax,dx ;is it 0?
- else
- mov dx,parm2_
- or dx,dx ;is it 0
- endif
- jnz dofirst
- mov ah,4fh
- jmp short ffcommon
- dofirst: mov cx,parm1_ ;CX = attribute
- mov ah,4eh
- ffcommon: int 21h ;Find first function
- if _LDATA
- pop ds ;Restore DS
- endif
- jc fndfiex
- xor ax,ax
- fndfiex:
-
- cproce
-
-
- endps
- end
-