"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/mx/tty-mle.c" between
s-nail-14.9.21.tar.xz and s-nail-14.9.22.tar.xz

About: S-nail is a mail processing system intended to provide the functionality of the POSIX mailx command and offers extensions for line editing, IDNA, MIME, S/MIME, SMTP and POP3 (and IMAP). It is usable as a mail batch language.

tty-mle.c  (s-nail-14.9.21.tar.xz):tty-mle.c  (s-nail-14.9.22.tar.xz)
skipping to change at line 94 skipping to change at line 94
* us from the outside--to store anything we need, i.e., a "struct cell[]", and * us from the outside--to store anything we need, i.e., a "struct cell[]", and
* convert that on-the-fly back to the plain char* result once we are done. * convert that on-the-fly back to the plain char* result once we are done.
* To simplify our live, use savestr() buffers for all other needed memory */ * To simplify our live, use savestr() buffers for all other needed memory */
# ifdef mx_HAVE_KEY_BINDINGS # ifdef mx_HAVE_KEY_BINDINGS
/* We have a chicken-and-egg problem with `bind' and our termcap layer, /* We have a chicken-and-egg problem with `bind' and our termcap layer,
* because we may not initialize the latter automatically to allow users to * because we may not initialize the latter automatically to allow users to
* specify *termcap-disable*, and let it mean exactly that. * specify *termcap-disable*, and let it mean exactly that.
* On the other hand users can be expected to use `bind' in resources. * On the other hand users can be expected to use `bind' in resources.
* Therefore bindings which involve termcap/terminfo sequences, and which * Therefore bindings which involve termcap/terminfo sequences, and which
* are defined before n_PSO_STARTED signals usability of termcap/terminfo, * are defined before n_PSO_STARTED_CONFIG signals usability of
* will be (partially) delayed until tty_init() is called. * termcap/terminfo, will be (partially) delayed until tty_init() is called.
* And we preallocate space for the expansion of the resolved capability */ * And we preallocate space for the expansion of the resolved capability */
# define a_TTY_BIND_CAPNAME_MAX 15 # define a_TTY_BIND_CAPNAME_MAX 15
# define a_TTY_BIND_CAPEXP_ROUNDUP 16 # define a_TTY_BIND_CAPEXP_ROUNDUP 16
CTAV(IS_POW2(a_TTY_BIND_CAPEXP_ROUNDUP)); CTAV(IS_POW2(a_TTY_BIND_CAPEXP_ROUNDUP));
CTA(a_TTY_BIND_CAPEXP_ROUNDUP <= S8_MAX / 2, "Variable must fit in 6-bit"); CTA(a_TTY_BIND_CAPEXP_ROUNDUP <= S8_MAX / 2, "Variable must fit in 6-bit");
CTA(a_TTY_BIND_CAPEXP_ROUNDUP >= 8, "Variable too small"); CTA(a_TTY_BIND_CAPEXP_ROUNDUP >= 8, "Variable too small");
/* Bind lookup trees organized in (wchar_t indexed) hashmaps */ /* Bind lookup trees organized in (wchar_t indexed) hashmaps */
# define a_TTY_PRIME 0xBu # define a_TTY_PRIME 0xBu
skipping to change at line 3440 skipping to change at line 3440
su_mem_copy(tbcp->tbc_exp = &tbcp->tbc__buf[i], su_mem_copy(tbcp->tbc_exp = &tbcp->tbc__buf[i],
tbpcp->tbpc_exp.s, j = (tbcp->tbc_exp_len = tbpcp->tbpc_exp.l) +1); tbpcp->tbpc_exp.s, j = (tbcp->tbc_exp_len = tbpcp->tbpc_exp.l) +1);
i += j; i += j;
i = (i + tbpcp->tbpc_cnv_align_mask) & ~tbpcp->tbpc_cnv_align_mask; i = (i + tbpcp->tbpc_cnv_align_mask) & ~tbpcp->tbpc_cnv_align_mask;
su_mem_copy(tbcp->tbc_cnv = &tbcp->tbc__buf[i], su_mem_copy(tbcp->tbc_cnv = &tbcp->tbc__buf[i],
tbpcp->tbpc_cnv, (tbcp->tbc_cnv_len = tbpcp->tbpc_cnv_len)); tbpcp->tbpc_cnv, (tbcp->tbc_cnv_len = tbpcp->tbpc_cnv_len));
tbcp->tbc_flags = tbpcp->tbpc_flags; tbcp->tbc_flags = tbpcp->tbpc_flags;
} }
/* Directly resolve any termcap(5) symbol if we are already setup */ /* Directly resolve any termcap(5) symbol if we are already setup */
if((n_psonce & n_PSO_STARTED) && if((n_psonce & n_PSO_STARTED_CONFIG) &&
(tbcp->tbc_flags & (a_TTY_BIND_RESOLVE | a_TTY_BIND_DEFUNCT)) == (tbcp->tbc_flags & (a_TTY_BIND_RESOLVE | a_TTY_BIND_DEFUNCT)) ==
a_TTY_BIND_RESOLVE) a_TTY_BIND_RESOLVE)
a_tty_bind_resolve(tbcp); a_tty_bind_resolve(tbcp);
++a_tty.tg_bind_cnt; ++a_tty.tg_bind_cnt;
/* If this binding is usable invalidate the key input lookup trees */ /* If this binding is usable invalidate the key input lookup trees */
if(!(tbcp->tbc_flags & a_TTY_BIND_DEFUNCT)) if(!(tbcp->tbc_flags & a_TTY_BIND_DEFUNCT))
a_tty.tg_bind_isdirty = TRU1; a_tty.tg_bind_isdirty = TRU1;
rv = TRU1; rv = TRU1;
skipping to change at line 4252 skipping to change at line 4252
NYD_OU; NYD_OU;
} }
void void
mx_tty_destroy(boole xit_fastpath){ mx_tty_destroy(boole xit_fastpath){
NYD_IN; NYD_IN;
if(!(n_psonce & n_PSO_LINE_EDITOR_INIT)) if(!(n_psonce & n_PSO_LINE_EDITOR_INIT))
goto jleave; goto jleave;
/* Be aware of identical code for `exit' command! */
#ifdef mx_HAVE_TCAP
if((n_psonce & n_PSO_INTERACTIVE) && !(n_poption & n_PO_QUICKRUN_MASK))
mx_termcap_destroy();
#endif
/* Write the history file */ /* Write the history file */
# ifdef mx_HAVE_HISTORY # ifdef mx_HAVE_HISTORY
if(!xit_fastpath) if(!xit_fastpath)
a_tty_hist_save(); a_tty_hist_save();
# endif # endif
# if defined mx_HAVE_KEY_BINDINGS && defined mx_HAVE_DEBUG # if defined mx_HAVE_KEY_BINDINGS && defined mx_HAVE_DEBUG
if(!xit_fastpath) if(!xit_fastpath)
n_go_command(n_GO_INPUT_NONE, "unbind * *"); n_go_command(n_GO_INPUT_NONE, "unbind * *");
# endif # endif
 End of changes. 3 change blocks. 
9 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)