Logo Search packages:      
Sourcecode: iterm version File versions  Download package

VTCore* VTCore_new ( TerminalIO io,
int  num_cols,
int  num_rows,
int  num_history 
)

Constructor of VTCore object.

Parameters:
io reference to TerminalIO object which VTCore connect to
num_cols number of columns
num_rows number of rows
num_history number of saved rows, should be num_rows <

Definition at line 455 of file core.c.

References VTCore_new().

Referenced by VTCore_new().

{
  VTCore *core;

  if((core = malloc(sizeof(VTCore))) == NULL)
  {
    perror("VTCore_new");
    return NULL;
  }

  if((core->vt100 = VT100_new()) == NULL)
  {
    perror("VTCore_new");
    free(core);
    return NULL;
  }

  memset(&core->ps,0,sizeof(core->ps));
  core->remain = 0;
  core->exit_callback = NULL;
  if(num_history < num_rows)
      num_history = num_rows;
  core->screen = VTScreen_new(num_cols,num_rows,num_history);
  VTScreen_init(core->screen,core->vt100);
  VTCore_init(core,core->vt100);
  set_splash(core,SPLASH_MESSAGE,strlen(SPLASH_MESSAGE));
  core->cursor = ltr_cursor;
  
  core->host_io = io;

  return core;
}


Generated by  Doxygen 1.6.0   Back to index