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