2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
11 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
15 * $Source: /cvs/cvsroot/d2x/arch/dos/findfile.c,v $
18 * $Date: 2001-10-19 09:01:56 $
20 * Dos findfile functions
22 * $Log: not supported by cvs2svn $
23 * Revision 1.3 2001/01/31 14:04:44 bradleyb
24 * Fix compiler warnings
26 * Revision 1.2 2001/01/29 13:35:08 bradleyb
27 * Fixed build system, minor fixes
41 // Global Variables ----------------------------------------------------------
43 static int _FileFindFlag = 0;
44 static struct find_t _FileFindStruct;
50 int FileFindFirst(char *search_str, FILEFINDSTRUCT *ffstruct)
54 if (_FileFindFlag) return -1;
56 retval = _dos_findfirst(search_str, 0, &_FileFindStruct);
57 if (retval) return (int)retval;
59 ffstruct->size = _FileFindStruct.size;
60 strcpy(ffstruct->name, _FileFindStruct.name);
67 int FileFindNext(FILEFINDSTRUCT *ffstruct)
71 if (!_FileFindFlag) return -1;
73 retval = _dos_findnext(&_FileFindStruct);
74 if (retval) return (int)retval;
76 ffstruct->size = _FileFindStruct.size;
77 strcpy(ffstruct->name, _FileFindStruct.name);
83 int FileFindClose(void)
87 if (!_FileFindFlag) return -1;
89 if (retval) return (int)retval;
98 //returns 0 if no error
99 int GetFileDateTime(int filehandle, FILETIMESTRUCT *ftstruct)
101 return _dos_getftime(filehandle, &ftstruct->date, &ftstruct->time);
106 //returns 0 if no error
107 int SetFileDateTime(int filehandle, FILETIMESTRUCT *ftstruct)
109 return _dos_setftime(filehandle, ftstruct->date, ftstruct->time);