--- rxvt-unicode/src/rxvtperl.h 2006/01/12 01:38:37 1.17 +++ rxvt-unicode/src/rxvtperl.h 2011/02/21 07:41:03 1.23 @@ -6,18 +6,23 @@ #define RXVTPERL_H_ #if ENABLE_PERL -# define SHOULD_INVOKE(htype) rxvt_perl.should_invoke [htype] -# define HOOK_INVOKE(args) rxvt_perl.invoke args -#include "rxvt.h" +#define SHOULD_INVOKE(htype) \ + ( (htype) == HOOK_INIT \ + || (htype) == HOOK_DESTROY \ + || (htype) == HOOK_REFRESH_BEGIN \ + || (htype) == HOOK_REFRESH_END \ + || perl.should_invoke [htype]) +#define HOOK_INVOKE(args) rxvt_perl.invoke args enum data_type { - DT_END, + DT_END, // no further arguments DT_INT, DT_LONG, - DT_STR, - DT_STR_LEN, - DT_WCS_LEN, + DT_STR, // 0-terminated string + DT_STR_LEN, // string + length + DT_WCS_LEN, // wchar_t* + length + DT_LCS_LEN, // long* + length DT_XEVENT, }; @@ -32,6 +37,7 @@ { void *self; unsigned long grabtime; + uint8_t should_invoke[HOOK_NUM]; }; struct rxvt_perl_interp @@ -40,9 +46,7 @@ ~rxvt_perl_interp (); - bool should_invoke[HOOK_NUM]; - - void init (); + void init (rxvt_term *term); bool invoke (rxvt_term *term, hook_type htype, ...); void line_update (rxvt_term *term); }; @@ -50,8 +54,10 @@ extern struct rxvt_perl_interp rxvt_perl; #else -# define SHOULD_INVOKE(htype) false -# define HOOK_INVOKE(args) false + +#define SHOULD_INVOKE(htype) false +#define HOOK_INVOKE(args) false + #endif #endif