FreeBASIC  0.91.0
hook_width.c
Go to the documentation of this file.
1 /* width entrypoint, default to console mode */
2 
3 #include "fb.h"
4 
5 /*:::::*/
6 FBCALL int fb_Width( int cols, int rows )
7 {
8  int cur;
9 
11 
12  FB_LOCK();
13 
15  cur = __fb_ctx.hooks.widthproc( cols, rows );
16  else
17  cur = fb_ConsoleWidth( cols, rows );
18 
19  if( cols>0 )
20  FB_HANDLE_SCREEN->width = cols;
21 
22  /* Reset VIEW PRINT */
23  if( (cols > 0) || (rows > 0) )
24  fb_ConsoleView( 0, 0 );
25 
26  FB_UNLOCK();
27 
28  return ((cols<1 && rows<1) ? cur : 0);
29 }