FreeBASIC  0.91.0
dev_cons_open.c
Go to the documentation of this file.
1 /* file device */
2 
3 #include "fb.h"
4 
8  NULL,
9  NULL,
14  NULL,
15  NULL,
18 };
19 
20 int fb_DevConsOpen( FB_FILE *handle, const char *filename, size_t filename_len )
21 {
22  switch ( handle->mode )
23  {
24  case FB_FILE_MODE_INPUT:
27  break;
28 
29  default:
31  }
32 
33  FB_LOCK();
34 
35  handle->hooks = &hooks_dev_cons;
36 
37  if ( handle->access == FB_FILE_ACCESS_ANY)
38  handle->access = FB_FILE_ACCESS_WRITE;
39 
40  handle->opaque = (handle->mode == FB_FILE_MODE_INPUT? stdin : stdout);
41  handle->type = FB_FILE_TYPE_PIPE;
42 
43  FB_UNLOCK();
44 
45  return fb_ErrorSetNum( FB_RTERROR_OK );
46 }