… | |
… | |
377 | /* but therse are not guaranteed anyway... */ |
377 | /* but therse are not guaranteed anyway... */ |
378 | rxvt_perl_interp::~rxvt_perl_interp () |
378 | rxvt_perl_interp::~rxvt_perl_interp () |
379 | { |
379 | { |
380 | if (perl) |
380 | if (perl) |
381 | { |
381 | { |
|
|
382 | localise_env set_environ (perl_environ); |
382 | perl_destruct (perl); |
383 | perl_destruct (perl); |
383 | perl_free (perl); |
384 | perl_free (perl); |
384 | PERL_SYS_TERM (); |
385 | PERL_SYS_TERM (); |
385 | } |
386 | } |
386 | } |
387 | } |
… | |
… | |
820 | } *civ, const_iv[] = { |
821 | } *civ, const_iv[] = { |
821 | # define const_iv(name) { # name, (IV)name } |
822 | # define const_iv(name) { # name, (IV)name } |
822 | const_iv (HOOK_INIT), |
823 | const_iv (HOOK_INIT), |
823 | const_iv (HOOK_DESTROY), |
824 | const_iv (HOOK_DESTROY), |
824 | const_iv (HOOK_ACTION), |
825 | const_iv (HOOK_ACTION), |
|
|
826 | const_iv (HOOK_OSC_SEQ), |
|
|
827 | const_iv (HOOK_OSC_SEQ_PERL), |
825 | |
828 | |
826 | const_iv (NUM_RESOURCES), |
829 | const_iv (NUM_RESOURCES), |
827 | const_iv (DEFAULT_RSTYLE), |
830 | const_iv (DEFAULT_RSTYLE), |
828 | const_iv (OVERLAY_RSTYLE), |
831 | const_iv (OVERLAY_RSTYLE), |
829 | const_iv (Color_Bits), |
832 | const_iv (Color_Bits), |
… | |
… | |
1371 | |
1374 | |
1372 | SV * |
1375 | SV * |
1373 | rxvt_term::locale_encode (SV *str) |
1376 | rxvt_term::locale_encode (SV *str) |
1374 | CODE: |
1377 | CODE: |
1375 | { |
1378 | { |
|
|
1379 | if (!SvOK (str)) |
|
|
1380 | XSRETURN_UNDEF; |
|
|
1381 | |
1376 | wchar_t *wstr = sv2wcs (str); |
1382 | wchar_t *wstr = sv2wcs (str); |
1377 | |
1383 | |
1378 | rxvt_push_locale (THIS->locale); |
1384 | rxvt_push_locale (THIS->locale); |
1379 | char *mbstr = rxvt_wcstombs (wstr); |
1385 | char *mbstr = rxvt_wcstombs (wstr); |
1380 | rxvt_pop_locale (); |
1386 | rxvt_pop_locale (); |
… | |
… | |
1389 | |
1395 | |
1390 | SV * |
1396 | SV * |
1391 | rxvt_term::locale_decode (SV *octets) |
1397 | rxvt_term::locale_decode (SV *octets) |
1392 | CODE: |
1398 | CODE: |
1393 | { |
1399 | { |
|
|
1400 | if (!SvOK (octets)) |
|
|
1401 | XSRETURN_UNDEF; |
|
|
1402 | |
1394 | STRLEN len; |
1403 | STRLEN len; |
1395 | char *data = SvPVbyte (octets, len); |
1404 | char *data = SvPVbyte (octets, len); |
1396 | |
1405 | |
1397 | rxvt_push_locale (THIS->locale); |
1406 | rxvt_push_locale (THIS->locale); |
1398 | wchar_t *wstr = rxvt_mbstowcs (data, len); |
1407 | wchar_t *wstr = rxvt_mbstowcs (data, len); |
… | |
… | |
1561 | THIS->rstyle = new_rstyle; |
1570 | THIS->rstyle = new_rstyle; |
1562 | OUTPUT: |
1571 | OUTPUT: |
1563 | RETVAL |
1572 | RETVAL |
1564 | |
1573 | |
1565 | int |
1574 | int |
1566 | rxvt_term::view_start (int newval = 1) |
1575 | rxvt_term::view_start (int newval = 0) |
1567 | PROTOTYPE: $;$ |
1576 | PROTOTYPE: $;$ |
1568 | CODE: |
1577 | CODE: |
1569 | { |
1578 | { |
1570 | RETVAL = THIS->view_start; |
1579 | RETVAL = THIS->view_start; |
1571 | |
1580 | if (items > 1) |
1572 | if (newval <= 0) |
|
|
1573 | THIS->scr_changeview (max (newval, THIS->top_row)); |
1581 | THIS->scr_changeview (newval); |
1574 | } |
1582 | } |
1575 | OUTPUT: |
1583 | OUTPUT: |
1576 | RETVAL |
1584 | RETVAL |
1577 | |
1585 | |
1578 | void |
1586 | void |
… | |
… | |
1788 | // find length |
1796 | // find length |
1789 | for (wchar_t *s = wstr; *s; s++) |
1797 | for (wchar_t *s = wstr; *s; s++) |
1790 | if (*s == NOCHAR) |
1798 | if (*s == NOCHAR) |
1791 | ; |
1799 | ; |
1792 | else if (IS_COMPOSE (*s)) |
1800 | else if (IS_COMPOSE (*s)) |
1793 | dlen += rxvt_composite.expand (*s, 0); |
1801 | dlen += rxvt_composite.expand (*s); |
1794 | else |
1802 | else |
1795 | dlen++; |
1803 | dlen++; |
1796 | |
1804 | |
1797 | wchar_t *rstr = rxvt_temp_buf<wchar_t> (dlen); |
1805 | wchar_t *rstr = rxvt_temp_buf<wchar_t> (dlen); |
1798 | |
1806 | |