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.31 by root, Fri Jan 6 05:37:59 2006 UTC vs.
Revision 1.32 by root, Fri Jan 6 18:33:30 2006 UTC

465 465
466 case DT_LONG: 466 case DT_LONG:
467 XPUSHs (sv_2mortal (newSViv (va_arg (ap, long)))); 467 XPUSHs (sv_2mortal (newSViv (va_arg (ap, long))));
468 break; 468 break;
469 469
470 case DT_STRING: 470 case DT_STR:
471 XPUSHs (sv_2mortal (newSVpv (va_arg (ap, char *), 0))); 471 XPUSHs (sv_2mortal (newSVpv (va_arg (ap, char *), 0)));
472 break; 472 break;
473 473
474 case DT_STRING_LEN: 474 case DT_STR_LEN:
475 { 475 {
476 char *str = va_arg (ap, char *); 476 char *str = va_arg (ap, char *);
477 int len = va_arg (ap, int); 477 int len = va_arg (ap, int);
478 478
479 XPUSHs (sv_2mortal (newSVpvn (str, len))); 479 XPUSHs (sv_2mortal (newSVpvn (str, len)));
480 } 480 }
481 break; 481 break;
482
483 case DT_WCS_LEN:
484 {
485 wchar_t *wstr = va_arg (ap, wchar_t *);
486 int wlen = va_arg (ap, int);
487
488 XPUSHs (sv_2mortal (wcs2sv (wstr, wlen)));
489 }
482 490
483 case DT_XEVENT: 491 case DT_XEVENT:
484 { 492 {
485 XEvent *xe = va_arg (ap, XEvent *); 493 XEvent *xe = va_arg (ap, XEvent *);
486 HV *hv = newHV (); 494 HV *hv = newHV ();
530 538
531 XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv))); 539 XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv)));
532 } 540 }
533 break; 541 break;
534 542
535 case DT_USTRING_LEN:
536 {
537 unicode_t *ustr = va_arg (ap, unicode_t *);
538 int ulen = va_arg (ap, int);
539 wchar_t *wstr = new wchar_t [ulen];
540
541 for (int i = ulen; i--; )
542 wstr [i] = ustr [i];
543
544 XPUSHs (sv_2mortal (wcs2sv (wstr, ulen)));
545
546 delete [] wstr;
547 }
548
549 case DT_END: 543 case DT_END:
550 { 544 {
551 va_end (ap); 545 va_end (ap);
552 546
553 PUTBACK; 547 PUTBACK;
1061void 1055void
1062rxvt_term::scr_add_lines (SV *string) 1056rxvt_term::scr_add_lines (SV *string)
1063 CODE: 1057 CODE:
1064{ 1058{
1065 wchar_t *wstr = sv2wcs (string); 1059 wchar_t *wstr = sv2wcs (string);
1066 int wlen = wcslen (wstr);
1067 unicode_t *ustr = new unicode_t [wlen];
1068 int nlines = 0;
1069
1070 for (int i = wlen; i--; )
1071 {
1072 ustr [i] = wstr [i];
1073 nlines += ustr [i] == '\012';
1074 }
1075
1076 THIS->scr_add_lines (ustr, nlines, wlen); 1060 THIS->scr_add_lines (wstr, wcslen (wstr));
1077
1078 free (wstr); 1061 free (wstr);
1079 delete [] ustr;
1080} 1062}
1081 1063
1082void 1064void
1083rxvt_term::tt_write (SV *octets) 1065rxvt_term::tt_write (SV *octets)
1084 INIT: 1066 INIT:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines