FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
dev_err_open.c
Go to the documentation of this file.
1
/* file device */
2
3
#include "
fb.h
"
4
5
static
FB_FILE_HOOKS
hooks_dev_err
= {
6
fb_DevFileEof
,
7
fb_DevStdIoClose
,
8
NULL
,
9
NULL
,
10
fb_DevFileRead
,
11
fb_DevFileReadWstr
,
12
fb_DevFileWrite
,
13
fb_DevFileWriteWstr
,
14
NULL
,
15
NULL
,
16
fb_DevFileReadLine
,
17
fb_DevFileReadLineWstr
18
};
19
20
int
fb_DevErrOpen
(
FB_FILE
*
handle
,
const
char
*
filename
,
size_t
filename_len )
21
{
22
int
res =
fb_ErrorSetNum
(
FB_RTERROR_OK
);
23
24
FB_LOCK
();
25
26
handle->
hooks
= &
hooks_dev_err
;
27
28
if
( handle->
access
==
FB_FILE_ACCESS_ANY
)
29
handle->
access
=
FB_FILE_ACCESS_READWRITE
;
30
31
if
( res ==
FB_RTERROR_OK
) {
32
handle->
opaque
= stderr;
33
handle->
type
=
FB_FILE_TYPE_PIPE
;
34
}
35
36
FB_UNLOCK
();
37
38
return
res;
39
}
rtlib
dev_err_open.c
Generated on Thu Jan 23 2014 19:40:08 for FreeBASIC by
1.8.4