]> icculus.org git repositories - btb/d2x.git/blob - arch/dos/findfile.c
use the orientation parameter of g3_draw_bitmap
[btb/d2x.git] / arch / dos / findfile.c
1 /*
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.
12 */
13
14 /*
15  * $Source: /cvs/cvsroot/d2x/arch/dos/findfile.c,v $
16  * $Revision: 1.3 $
17  * $Author: bradleyb $
18  * $Date: 2001-10-19 09:01:56 $
19  *
20  * Dos findfile functions
21  *
22  * $Log: not supported by cvs2svn $
23  * Revision 1.3  2001/01/31 14:04:44  bradleyb
24  * Fix compiler warnings
25  *
26  * Revision 1.2  2001/01/29 13:35:08  bradleyb
27  * Fixed build system, minor fixes
28  *
29  */
30
31 #ifdef HAVE_CONFIG_H
32 #include <conf.h>
33 #endif
34
35 #include <dos.h>
36 #include <string.h>
37
38 #include "findfile.h"
39
40
41 //      Global Variables        ----------------------------------------------------------
42
43 static int                              _FileFindFlag = 0;
44 static struct find_t _FileFindStruct;
45
46
47
48 //      Functions
49
50 int     FileFindFirst(char *search_str, FILEFINDSTRUCT *ffstruct)
51 {
52         unsigned retval;
53         
54         if (_FileFindFlag) return -1;
55         
56         retval = _dos_findfirst(search_str, 0, &_FileFindStruct);
57         if (retval) return (int)retval;
58         else {
59                 ffstruct->size = _FileFindStruct.size;
60                 strcpy(ffstruct->name, _FileFindStruct.name);
61                 _FileFindFlag = 1;
62                 return (int)retval;
63         }
64 }
65
66
67 int     FileFindNext(FILEFINDSTRUCT *ffstruct)
68 {
69         unsigned retval;
70
71         if (!_FileFindFlag) return -1;
72
73         retval = _dos_findnext(&_FileFindStruct);
74         if (retval) return (int)retval;
75         else {
76                 ffstruct->size = _FileFindStruct.size;
77                 strcpy(ffstruct->name, _FileFindStruct.name);
78                 return (int)retval;
79         }       
80 }
81  
82
83 int     FileFindClose(void)
84 {
85         unsigned retval = 0;
86
87         if (!_FileFindFlag) return -1;
88         
89         if (retval) return (int)retval;
90         else {
91                 _FileFindFlag = 0;
92                 return (int)retval;
93         }
94 }
95
96 /*
97
98 //returns 0 if no error
99 int GetFileDateTime(int filehandle, FILETIMESTRUCT *ftstruct)
100 {
101         return _dos_getftime(filehandle, &ftstruct->date, &ftstruct->time);
102
103 }
104
105
106 //returns 0 if no error
107 int SetFileDateTime(int filehandle, FILETIMESTRUCT *ftstruct)
108 {
109         return _dos_setftime(filehandle, ftstruct->date, ftstruct->time);
110 }
111
112 */