ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvtperl.xs
(Generate patch)

Comparing rxvt-unicode/src/rxvtperl.xs (file contents):
Revision 1.248 by sf-exg, Sat May 8 06:16:21 2021 UTC vs.
Revision 1.256 by sf-exg, Wed Nov 24 18:17:20 2021 UTC

377/* but therse are not guaranteed anyway... */ 377/* but therse are not guaranteed anyway... */
378rxvt_perl_interp::~rxvt_perl_interp () 378rxvt_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}
528 THIS->perl.grabtime = 0; 529 THIS->perl.grabtime = 0;
529 } 530 }
530} 531}
531 532
532bool 533bool
533rxvt_perl_interp::invoke (rxvt_term *term, hook_type htype, ...) 534rxvt_perl_interp::invoke (rxvt_term *term, int htype, ...)
534{ 535{
535 if (!perl || !term->perl.self) 536 if (!perl || !term->perl.self)
536 return false; 537 return false;
537 538
538 localise_env set_environ (perl_environ); 539 localise_env set_environ (perl_environ);
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),
1142int 1145int
1143SET_CUSTOM (int rend, int new_value) 1146SET_CUSTOM (int rend, int new_value)
1144 CODE: 1147 CODE:
1145{ 1148{
1146 if (!IN_RANGE_EXC (new_value, 0, RS_customCount)) 1149 if (!IN_RANGE_EXC (new_value, 0, RS_customCount))
1147 croak ("custom value out of range, must be 0..%d", RS_customCount - 1); 1150 croak ("custom value out of range, must be 0..%lu", RS_customCount - 1);
1148 1151
1149 RETVAL = (rend & ~RS_customMask) 1152 RETVAL = (rend & ~RS_customMask)
1150 | ((new_value << RS_customShift) & RS_customMask); 1153 | ((new_value << RS_customShift) & RS_customMask);
1151} 1154}
1152 OUTPUT: 1155 OUTPUT:
1371 1374
1372SV * 1375SV *
1373rxvt_term::locale_encode (SV *str) 1376rxvt_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
1390SV * 1396SV *
1391rxvt_term::locale_decode (SV *octets) 1397rxvt_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
1565int 1574int
1566rxvt_term::view_start (int newval = 1) 1575rxvt_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
1578void 1586void
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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines