FreeBASIC  0.91.0
io_getxy.c
Go to the documentation of this file.
1 #include "../fb.h"
2 #include "fb_private_console.h"
3 
4 FBCALL void fb_ConsoleGetXY( int *col, int *row )
5 {
6  int x, y;
7 
8  if (__fb_con.inited) {
9  BG_LOCK();
11 
12 #ifdef HOST_LINUX
13  if( fb_hTermQuery( SEQ_QUERY_CURSOR, &y, &x ) == FALSE )
14 #endif
15  {
16  x = __fb_con.cur_x;
17  y = __fb_con.cur_y;
18  }
19 
20  BG_UNLOCK();
21  } else {
22  x = 1;
23  y = 1;
24  }
25 
26  if (col)
27  *col = x;
28  if (row)
29  *row = y;
30 }