FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
file_reset.c
Go to the documentation of this file.
1
/* RESET function */
2
3
#include "
fb.h
"
4
5
/*:::::*/
6
FBCALL
void
fb_FileReset
(
void
)
7
{
8
int
i;
9
10
if
(
__fb_ctx
.
do_file_reset
==
FALSE
)
11
return
;
12
13
__fb_ctx
.
do_file_reset
=
FALSE
;
14
15
FB_LOCK
();
16
17
for
( i = 1; i <= (
FB_MAX_FILES
-
FB_RESERVED_FILES
); i++ )
18
{
19
FB_FILE
*
handle
=
FB_FILE_TO_HANDLE_VALID
( i );
20
if
( handle->
hooks
!=
NULL
)
21
{
22
DBG_ASSERT
(handle->
hooks
->
pfnClose
!=
NULL
);
23
handle->
hooks
->
pfnClose
( handle );
24
}
25
}
26
27
/* clear all file handles */
28
memset(
FB_FILE_TO_HANDLE_VALID
( 1 ),
29
0,
30
sizeof
(
FB_FILE
) * (
FB_MAX_FILES
-
FB_RESERVED_FILES
) );
31
32
FB_UNLOCK
();
33
}
rtlib
file_reset.c
Generated on Thu Jan 23 2014 19:40:11 for FreeBASIC by
1.8.4