FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
error_getset.c
Go to the documentation of this file.
1
/* runtime error handling, set & get */
2
3
#include "
fb.h
"
4
5
FBCALL
int
fb_ErrorGetNum
(
void
)
6
{
7
FB_ERRORCTX
*
ctx
=
FB_TLSGETCTX
( ERROR );
8
return
ctx->
err_num
;
9
}
10
11
FBCALL
int
fb_ErrorSetNum
(
int
err_num )
12
{
13
FB_ERRORCTX
*
ctx
=
FB_TLSGETCTX
( ERROR );
14
ctx->
err_num
= err_num;
15
return
err_num;
16
}
17
18
FBCALL
int
fb_ErrorGetLineNum
(
void
)
19
{
20
FB_ERRORCTX
*
ctx
=
FB_TLSGETCTX
( ERROR );
21
return
ctx->
line_num
;
22
}
23
24
FBCALL
const
char
*
fb_ErrorGetModName
(
void
)
25
{
26
FB_ERRORCTX
*
ctx
=
FB_TLSGETCTX
( ERROR );
27
return
ctx->
mod_name
;
28
}
29
30
FBCALL
const
char
*
fb_ErrorSetModName
(
const
char
*mod_name )
31
{
32
FB_ERRORCTX
*
ctx
=
FB_TLSGETCTX
( ERROR );
33
const
char
*old_name = ctx->
mod_name
;
34
ctx->
mod_name
= mod_name;
35
return
old_name;
36
}
37
38
FBCALL
const
char
*
fb_ErrorGetFuncName
(
void
)
39
{
40
FB_ERRORCTX
*
ctx
=
FB_TLSGETCTX
( ERROR );
41
return
ctx->
fun_name
;
42
}
43
44
FBCALL
const
char
*
fb_ErrorSetFuncName
(
const
char
*fun_name )
45
{
46
FB_ERRORCTX
*
ctx
=
FB_TLSGETCTX
( ERROR );
47
const
char
*old_name = ctx->
fun_name
;
48
ctx->
fun_name
= fun_name;
49
return
old_name;
50
}
rtlib
error_getset.c
Generated on Thu Jan 23 2014 19:40:10 for FreeBASIC by
1.8.4