FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
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
{
7
FB_INPUTCTX
*
ctx
;
8
FB_FILE
*
handle
=
NULL
;
9
10
FB_LOCK
();
11
12
handle =
FB_FILE_TO_HANDLE
(fnum);
13
if
( !
FB_HANDLE_USED
(handle) )
14
{
15
FB_UNLOCK
();
16
return
fb_ErrorSetNum
(
FB_RTERROR_ILLEGALFUNCTIONCALL
);
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
}
rtlib
file_input_file.c
Generated on Thu Jan 23 2014 19:40:11 for FreeBASIC by
1.8.4