FreeBASIC  0.91.0
file_input_file.c
Go to the documentation of this file.
1 /* input function */
2 
3 #include "fb.h"
4 
5 FBCALL int fb_FileInput( int fnum )
6 {
9 
10  FB_LOCK();
11 
12  handle = FB_FILE_TO_HANDLE(fnum);
13  if( !FB_HANDLE_USED(handle) )
14  {
15  FB_UNLOCK();
17  }
18 
19  ctx = FB_TLSGETCTX( INPUT );
20 
21  ctx->handle = handle;
22  ctx->status = 0;
23  fb_StrDelete( &ctx->str );
24  ctx->index = 0;
25 
26  FB_UNLOCK();
27 
28  return fb_ErrorSetNum( FB_RTERROR_OK );
29 }