FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
sys_exepath.c
Go to the documentation of this file.
1
/* exepath$ */
2
3
#include "
fb.h
"
4
#ifdef HOST_WIN32
5
#include <windows.h>
6
#endif
7
8
FBCALL
FBSTRING
*
fb_ExePath
(
void
)
9
{
10
FBSTRING
*dst;
11
char
*
p
;
12
char
tmp[
MAX_PATH
+1];
13
ssize_t len;
14
15
p =
fb_hGetExePath
( tmp,
MAX_PATH
);
16
17
if
( p !=
NULL
)
18
{
19
/* alloc temp string */
20
len = strlen( tmp );
21
dst =
fb_hStrAllocTemp
(
NULL
, len );
22
if
( dst !=
NULL
)
23
{
24
fb_hStrCopy
( dst->
data
, tmp, len );
25
}
26
else
27
dst = &
__fb_ctx
.
null_desc
;
28
}
29
else
30
dst = &
__fb_ctx
.
null_desc
;
31
32
return
dst;
33
}
rtlib
sys_exepath.c
Generated on Thu Jan 23 2014 19:40:14 for FreeBASIC by
1.8.4