Roxen.git/
server/
base_server/
module.pike
Branch:
Tag:
Non-build tags
All tags
No tags
1999-12-07
1999-12-07 12:10:16 by Martin Nilsson <mani@lysator.liu.se>
12e79e57249c76aba2d95c574893e57f51e6a39c (
13
lines) (+
7
/-
6
)
[
Show
|
Annotate
]
Branch:
5.2
Rewrote get vaule function to use ifdef instead of comments
Rev: server/base_server/module.pike:1.59
1:
-
/* $Id: module.pike,v 1.
58
1999/
11
/
29
22
:
09
:
05
per
Exp $ */
+
/* $Id: module.pike,v 1.
59
1999/
12
/
07
12
:
10
:
16
nilsson
Exp $ */
#include <module.h> #include <request_trace.h>
638:
return m; }
-
mixed get_
commented_
value(string path,
int
start
)
+
mixed get_
value
_
from_file
(string path,
string
index, void|string pre
)
{ Stdio.File file=Stdio.File(); if(!file->open(path,"r")) return 0;
-
string in,comment;
-
in=file->read();
-
if(
sscanf
(
(in/"\n"
)
[start
..]
*
"
\n
"
,"%*s/*%s*/",comment
)
!=2)
return 0;
-
return compile_string(
"mixed f
(
){ return
"
+comment+
"
; }"
)()-
>f
();
+
if(
index[sizeof
(
index
)
-2
..
sizeof(index)-1
]
==
"
()
")
{
+
return compile_string((
pre||
"")
+file->read
()
)[index[..sizeof(index)
-
3]]
();
}
-
+
return compile_string((pre||"")+file->read())[index];
+
}