Exemplo n.º 1
0
void
cleanup(void)
{
  if (init)
    return;

  input_hide();
  rl_callback_handler_remove();
}
Exemplo n.º 2
0
Arquivo: client.c Projeto: jpmuga/bird
void
cleanup(void)
{
  if (input_initialized)
    {
      input_initialized = 0;
      input_hide();
      rl_callback_handler_remove();
    }
}
Exemplo n.º 3
0
void
input_notify(int prompt)
{
  if (prompt == prompt_active)
    return;

  if (prompt)
    input_reveal();
  else
    input_hide();
}
Exemplo n.º 4
0
Arquivo: client.c Projeto: jpmuga/bird
void
update_state(void)
{
  if (nstate == cstate)
    return;

  if (restricted)
    {
       submit_server_command("restrict");
       restricted = 0;
       return;
    }

  if (init_cmd)
    {
      /* First transition - client received hello from BIRD
	 and there is waiting initial command */
      submit_server_command(init_cmd);
      init_cmd = NULL;
      return;
    }

  if (!init_cmd && once)
    {
      /* Initial command is finished and we want to exit */
      cleanup();
      exit(0);
    }

  if (nstate == STATE_PROMPT)
    {
      if (input_initialized)
	input_reveal();
      else
	input_init();
    }

  if (nstate != STATE_PROMPT)
    input_hide();

  cstate = nstate;
}