]> 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  *
16  * Dos findfile functions
17  *
18  *
19  */
20
21 #ifdef HAVE_CONFIG_H
22 #include <conf.h>
23 #endif
24
25 #include <dos.h>
26 #include <string.h>
27
28 #include "findfile.h"
29
30
31 //      Global Variables        ----------------------------------------------------------
32
33 static int                              _FileFindFlag = 0;
34 static struct find_t _FileFindStruct;
35
36
37
38 //      Functions
39
40 int     FileFindFirst(char *search_str, FILEFINDSTRUCT *ffstruct)
41 {
42         unsigned retval;
43         
44         if (_FileFindFlag) return -1;
45         
46         retval = _dos_findfirst(search_str, 0, &_FileFindStruct);
47         if (retval) return (int)retval;
48         else {
49                 ffstruct->size = _FileFindStruct.size;
50                 strcpy(ffstruct->name, _FileFindStruct.name);
51                 _FileFindFlag = 1;
52                 return (int)retval;
53         }
54 }
55
56
57 int     FileFindNext(FILEFINDSTRUCT *ffstruct)
58 {
59         unsigned retval;
60
61         if (!_FileFindFlag) return -1;
62
63         retval = _dos_findnext(&_FileFindStruct);
64         if (retval) return (int)retval;
65         else {
66                 ffstruct->size = _FileFindStruct.size;
67                 strcpy(ffstruct->name, _FileFindStruct.name);
68                 return (int)retval;
69         }       
70 }
71  
72
73 int     FileFindClose(void)
74 {
75         unsigned retval = 0;
76
77         if (!_FileFindFlag) return -1;
78         
79         if (retval) return (int)retval;
80         else {
81                 _FileFindFlag = 0;
82                 return (int)retval;
83         }
84 }
85
86 /*
87
88 //returns 0 if no error
89 int GetFileDateTime(int filehandle, FILETIMESTRUCT *ftstruct)
90 {
91         return _dos_getftime(filehandle, &ftstruct->date, &ftstruct->time);
92
93 }
94
95
96 //returns 0 if no error
97 int SetFileDateTime(int filehandle, FILETIMESTRUCT *ftstruct)
98 {
99         return _dos_setftime(filehandle, ftstruct->date, ftstruct->time);
100 }
101
102 */