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-01-31 14:04:44 $
20 * Dos findfile functions
22 * $Log: not supported by cvs2svn $
23 * Revision 1.2 2001/01/29 13:35:08 bradleyb
24 * Fixed build system, minor fixes
38 // Global Variables ----------------------------------------------------------
40 static int _FileFindFlag = 0;
41 static struct find_t _FileFindStruct;
47 int FileFindFirst(char *search_str, FILEFINDSTRUCT *ffstruct)
51 if (_FileFindFlag) return -1;
53 retval = _dos_findfirst(search_str, 0, &_FileFindStruct);
54 if (retval) return (int)retval;
56 ffstruct->size = _FileFindStruct.size;
57 strcpy(ffstruct->name, _FileFindStruct.name);
64 int FileFindNext(FILEFINDSTRUCT *ffstruct)
68 if (!_FileFindFlag) return -1;
70 retval = _dos_findnext(&_FileFindStruct);
71 if (retval) return (int)retval;
73 ffstruct->size = _FileFindStruct.size;
74 strcpy(ffstruct->name, _FileFindStruct.name);
80 int FileFindClose(void)
84 if (!_FileFindFlag) return -1;
86 if (retval) return (int)retval;
95 //returns 0 if no error
96 int GetFileDateTime(int filehandle, FILETIMESTRUCT *ftstruct)
98 return _dos_getftime(filehandle, &ftstruct->date, &ftstruct->time);
103 //returns 0 if no error
104 int SetFileDateTime(int filehandle, FILETIMESTRUCT *ftstruct)
106 return _dos_setftime(filehandle, ftstruct->date, ftstruct->time);