FreeBASIC  0.91.0
dev_scrn.c
Go to the documentation of this file.
1 /* file device */
2 
3 #include "fb.h"
4 
5 void fb_DevScrnInit_Screen( void );
6 
10  NULL,
11  NULL,
16  NULL,
17  NULL,
20 };
21 
22 int fb_DevScrnOpen( FB_FILE *handle, const char *filename, size_t filename_len )
23 {
24  FB_LOCK();
25 
26  if (handle!=FB_HANDLE_SCREEN)
27  {
28  DEV_SCRN_INFO *info = (DEV_SCRN_INFO*) FB_HANDLE_SCREEN->opaque;
29  handle->hooks = &hooks_dev_scrn;
30  handle->opaque = info;
32 
33  }
34  else if( handle->hooks != &hooks_dev_scrn )
35  {
36  if( handle->hooks == NULL )
38  handle->hooks = &hooks_dev_scrn;
39  handle->type = FB_FILE_TYPE_CONSOLE;
40  }
41 
42  FB_UNLOCK();
43 
44  return fb_ErrorSetNum( FB_RTERROR_OK );
45 }
46 
47 void fb_DevScrnInit( void )
48 {
49  if ( FB_HANDLE_SCREEN->hooks == NULL )
50  {
51  FB_LOCK();
52 
53  memset(FB_HANDLE_SCREEN, 0, sizeof(*FB_HANDLE_SCREEN));
54 
59 
61 
62  FB_UNLOCK();
63  }
64  else if( FB_HANDLE_SCREEN->hooks != &hooks_dev_scrn )
65  {
67  }
68 }