示例#1
0
static int set_SCRSIZE(int rows){
	int real_rows,real_cols;

	SCR_SIZE = rows;
	real_rows = rows;
	if( get_winsize(0,&real_rows,&real_cols) == 0 )
		SCR_SIZE = real_rows;
	return SCR_SIZE;
}
示例#2
0
文件: graph.c 项目: matz/streem
static int
init_bar(struct bar_data* d)
{
  if (get_winsize(&d->row, &d->col))
    return STRM_NG;
  d->max = 1;
  d->offset = 0;
  d->dlen = d->col-6;
  d->llen = d->row-3;
  d->data = malloc((d->dlen)*sizeof(double));
  for (int i=0;i<d->dlen;i++) {
    d->data[i] = 0;
  }
  show_title(d);
  return STRM_OK;
}
示例#3
0
void		ft_jumprint(t_edit **lst)
{
	int				jump;
	int				i;
	struct winsize	ws;

	get_winsize(&ws);
	i = 0;
	jump = ((l_list(lst) + 3) / ws.ws_col) - ((ft_pcur(lst) + 3) / ws.ws_col);
	if (!((l_list(lst) + 3) % ws.ws_col) == 0)
	{
		while (i < jump)
		{
			ft_tputs("do");
			i++;
		}
	}
}