FreeBASIC  0.91.0
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 
11  return;
12 
14 
15  FB_LOCK();
16 
17  for( i = 1; i <= (FB_MAX_FILES - FB_RESERVED_FILES); i++ )
18  {
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 }