FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
gfx_lineinp.c
Go to the documentation of this file.
1
/* LINE INPUT function */
2
3
#include "
fb_gfx.h
"
4
5
static
const
char
*
pszDefaultQuestion
=
"? "
;
6
7
int
fb_GfxLineInput
8
(
9
FBSTRING
*text,
10
void
*dst,
11
ssize_t dst_len,
12
int
fillrem,
13
int
addquestion,
14
int
addnewline
15
)
16
{
17
FBSTRING
*tmp_result;
18
19
FB_LOCK
();
20
21
fb_PrintBufferEx
(
NULL
, 0,
FB_PRINT_FORCE_ADJUST
);
22
23
if
( text !=
NULL
)
24
{
25
if
( text->
data
!=
NULL
) {
26
fb_PrintString
( 0, text, 0 );
27
}
28
29
if
( addquestion !=
FB_FALSE
)
30
{
31
fb_PrintFixString
( 0,
pszDefaultQuestion
, 0 );
32
}
33
}
34
35
FB_UNLOCK
();
36
37
tmp_result =
fb_ConReadLine
(
TRUE
);
38
39
if
( addnewline ) {
40
fb_PrintVoid
( 0,
FB_PRINT_NEWLINE
);
41
}
42
43
if
( tmp_result!=
NULL
) {
44
fb_StrAssign
( dst, dst_len, tmp_result, -1, fillrem );
45
return
fb_ErrorSetNum
(
FB_RTERROR_OK
);
46
}
47
48
return
fb_ErrorSetNum
(
FB_RTERROR_OUTOFMEM
);
49
}
gfxlib2
gfx_lineinp.c
Generated on Thu Jan 23 2014 19:40:06 for FreeBASIC by
1.8.4