1 | /*----------------------------------------------------------------------* |
1 | /*----------------------------------------------------------------------* |
2 | * File: rxvtperl.xs |
2 | * File: rxvtperl.xs |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * |
4 | * |
5 | * All portions of code are copyright by their respective author/s. |
5 | * All portions of code are copyright by their respective author/s. |
6 | * Copyright (c) 2005-2008 Marc Lehmann <pcg@goof.com> |
6 | * Copyright (c) 2005-2008,2011 Marc Lehmann <schmorp@schmorp.de> |
7 | * |
7 | * |
8 | * This program is free software; you can redistribute it and/or modify |
8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by |
9 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation; either version 2 of the License, or |
10 | * the Free Software Foundation; either version 2 of the License, or |
11 | * (at your option) any later version. |
11 | * (at your option) any later version. |
… | |
… | |
302 | THIS->refresh_check (); |
302 | THIS->refresh_check (); |
303 | } |
303 | } |
304 | |
304 | |
305 | ///////////////////////////////////////////////////////////////////////////// |
305 | ///////////////////////////////////////////////////////////////////////////// |
306 | |
306 | |
307 | #define IOM_CLASS "urxvt" |
|
|
308 | #define IOM_WARN rxvt_warn |
|
|
309 | #include "iom_perl.h" |
307 | #include "iom_perl.h" |
310 | |
308 | |
311 | ///////////////////////////////////////////////////////////////////////////// |
309 | ///////////////////////////////////////////////////////////////////////////// |
312 | |
310 | |
313 | struct rxvt_perl_interp rxvt_perl; |
311 | struct rxvt_perl_interp rxvt_perl; |
… | |
… | |
343 | " unshift @INC, '" LIBDIR "';" |
341 | " unshift @INC, '" LIBDIR "';" |
344 | "}" |
342 | "}" |
345 | "" |
343 | "" |
346 | "use urxvt;" |
344 | "use urxvt;" |
347 | }; |
345 | }; |
348 | int argc = sizeof (args) / sizeof (args[0]); |
346 | int argc = ARRAY_LENGTH(args); |
349 | char **argv = args; |
347 | char **argv = args; |
350 | |
348 | |
351 | PERL_SYS_INIT3 (&argc, &argv, &environ); |
349 | PERL_SYS_INIT3 (&argc, &argv, &environ); |
352 | perl = perl_alloc (); |
350 | perl = perl_alloc (); |
353 | perl_construct (perl); |
351 | perl_construct (perl); |
… | |
… | |
770 | const_iv (XIMDontChange), |
768 | const_iv (XIMDontChange), |
771 | # endif |
769 | # endif |
772 | # endif |
770 | # endif |
773 | }; |
771 | }; |
774 | |
772 | |
775 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
773 | for (civ = const_iv + ARRAY_LENGTH(const_iv); civ-- > const_iv; ) |
776 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
774 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
777 | } |
775 | } |
778 | |
776 | |
779 | void |
777 | void |
780 | warn (const char *msg) |
778 | warn (const char *msg) |
… | |
… | |
1448 | # include "rsinc.h" |
1446 | # include "rsinc.h" |
1449 | # undef def |
1447 | # undef def |
1450 | # undef reserve |
1448 | # undef reserve |
1451 | }; |
1449 | }; |
1452 | |
1450 | |
1453 | rs = rslist + sizeof (rslist) / sizeof (rslist [0]); |
1451 | rs = rslist + ARRAY_LENGTH(rslist); |
1454 | |
1452 | |
1455 | if (*name) |
1453 | if (*name) |
1456 | { |
1454 | { |
1457 | do { |
1455 | do { |
1458 | if (rs-- == rslist) |
1456 | if (rs-- == rslist) |