📄 util.h
字号:
/*** HTML::Tree** util.h**** Copyright (C) 2001 Paul J. Lucas**** This program is free software; you can redistribute it and/or modify** it under the terms of the GNU General Public License as published by** the Free Software Foundation; either version 2 of the License, or** (at your option) any later version.**** This program is distributed in the hope that it will be useful,** but WITHOUT ANY WARRANTY; without even the implied warranty of** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the** GNU General Public License for more details.**** You should have received a copy of the GNU General Public License** along with this program; if not, write to the Free Software** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*/#ifndef util_H#define util_H// Perl#define PERL_NO_GET_CONTEXTextern "C" {#include <EXTERN.h>#include <perl.h>}// Undefine some basic things that Perl really shouldn't be defining.#ifdef assert#undef assert#endif#ifdef bool#undef bool#endif#ifdef do_close#undef do_close#endif#ifdef do_open#undef do_open#endif#ifdef list#undef list#endif//// In Perl's sv.h, the SvIVx() macro is defined differently if the compiler is// gcc. However, at least for the POPi macro that uses it, this doesn't seem// to do the right thing.//#ifdef __GNUC__#define SvIVx_BROKEN_GCC#endif#if !defined(PERL_REVISION) || !defined(PERL_VERSION) || \ (PERL_REVISION <= 5 && PERL_VERSION < 6)//// Define "namespaced" symbols for Perl versions < 5.6 so we can always use// them.//#define PL_na na//// Older versions of Perl didn't accept "const" in the right place, so define// PERL_CONST to be nothing.//#define PERL_CONST /* nothing *///// Additionally, "const" must be cast away in some circumstances for it.//#define PERL_CONST_CAST(type) (type)#else//// Perl 5.6.0 can have these set to "normal."//#define PERL_CONST const#define PERL_CONST_CAST(type) /* nothing */#endif /* !defined(PERL_REVISION) ... *///// When compiling with a threaded Perl, dTHX must be declared prior to calling// any Perl API functions to decalre the thread context. The Perl functions// below are called in constructor mem-initializers so they need to be separate// functions since there's no other way to declare dTHX.//#ifndef dTHX#define dTHX#endifinline AV* pjl_newAV() { dTHX; return newAV(); }inline SV* pjl_newSVsv( SV *sv ) { dTHX; return newSVsv( sv ); }// Convenience functions.inline bool is_array_ref( SV const *sv ) { return SvROK( sv ) && SvTYPE( SvRV( sv ) ) == SVt_PVAV;}inline bool is_blessed_ref( SV const *sv ) { return SvROK( sv ) && SvTYPE( SvRV( sv ) ) == SVt_PVMG;}inline bool is_func_ref( SV const *sv ) { return SvROK( sv ) && SvTYPE( SvRV( sv ) ) == SVt_PVCV;}inline bool is_hash_ref( SV const *sv ) { return SvROK( sv ) && SvTYPE( SvRV( sv ) ) == SVt_PVHV;}#endif /* util_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -