pike.git/
src/
cpp.cmod
Branch:
Tag:
Non-build tags
All tags
No tags
2018-08-01
2018-08-01 07:32:46 by Henrik Grubbström (Grubba) <grubba@grubba.org>
9c596720f9ec7f2a9632abd606e0924e5efcdd4b (
28
lines) (+
21
/-
7
)
[
Show
|
Annotate
]
Branch:
master
Cpp: Added handle_include() and read_include().
915:
apply_external(1, CE_RESOLV_FUN_NUM, 4); }
+
PIKEFUN string handle_include(string header_file, string current_file,
+
int(0..1) is_local_ref)
+
{
+
struct CPP_struct *this = THIS;
+
low_unsafe_apply_handler("handle_include",
+
this->handler, this->compat_handler, args);
+
}
+
+
PIKEFUN string read_include(string filename)
+
{
+
struct CPP_struct *this = THIS;
+
low_unsafe_apply_handler("read_include",
+
this->handler, this->compat_handler, args);
+
}
+
PIKEFUN string decode_charset(string data, string charset) { struct CPP_struct *this = THIS;
3869:
{ struct pike_string *new_file;
-
if (!safe_apply_
handler
(
"
handle_include
",
-
this->handler, this->compat
_
handler
,
-
3
, BIT_STRING
) ||
-
!
(
new_file=
Pike_sp[-1]
.u.string
) ) {
+
if (!safe_apply_
current
(
f_CPP_
handle_include_
fun_num
, 3) ||
+
(
TYPEOF(
Pike_sp[-1])
!= PIKE_T_STRING
)
)
{
cpp_handle_exception (this, "Couldn't find include file."); pop_n_elems(Pike_sp-save_sp); break; }
-
+
new_file = Pike_sp[-1].u.string;
ref_push_string(new_file);
-
if (!safe_apply_
handler
(
"
read_include
"
,
-
this->handler, this->compat_handler,
-
1
,
BIT_STRING|BIT_INT)) {
+
if (!safe_apply_
current
(
f_CPP_
read_include
_fun_num
,
1)
||
+
!((1<<TYPEOF(Pike_sp[
-
1]))
&
(
BIT_STRING|BIT_INT))
)
{
cpp_handle_exception (this, "Couldn't read include file."); pop_n_elems(Pike_sp-save_sp); break;