Esempio n. 1
0
/*
 *   set the buffer 
 */
void CHtmlInputBuf::setbuf(textchar_t *buf, size_t bufsiz, size_t initlen)
{
    /* remember the buffer information */
    changebuf(buf, bufsiz);

    /* set up with the initial command */
    len_ = initlen;

    /* set up at the end of the current command */
    sel_start_ = len_;
    sel_end_ = len_;
    caret_ = len_;

    /* reset the history position */
    set_last_hist();

    /* caret starts off visible */
    caret_vis_ = TRUE;

    /* drop any undo we have */
    if (undo_buf_ != 0)
    {
        th_free(undo_buf_);
        undo_buf_ = 0;
    }
}
Esempio n. 2
0
/*
 *   Delete the resource table 
 */
void CHtmlResType::delete_res_table()
{
    if (ext_table_ != 0)
    {
        th_free(ext_table_);
        ext_table_ = 0;
        ext_table_cnt_ = ext_table_size_ = 0;
    }
}
Esempio n. 3
0
CHtmlInputBuf::~CHtmlInputBuf()
{
    size_t i;
    
    /* drop history items */
    for (i = 0 ; i < histcnt_ ; ++i)
        th_free(history_[i]);
    
    /* drop history buffer and the saved current line */
    if (history_ != 0)
        th_free(history_);
    if (saved_cur_line_ != 0)
        th_free(saved_cur_line_);

    /* delete the undo buffer if we have one */
    if (undo_buf_)
        th_free(undo_buf_);
}
Esempio n. 4
0
void trusts_freeall(void) {
  trustgroup *tg, *ntg;
  trusthost *th, *nth;

  for(tg=tglist;tg;tg=ntg) {
    ntg = tg->next;
    for(th=tg->hosts;th;th=nth) {
      nth = th->next;

      th_free(th);
    }

    tg_free(tg, 1);
  }

  tglist = NULL;
}