Roxen.git
/
server
/
modules
/
examples
/
fnord.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/modules/examples/fnord.pike:1:
// This is a small sample module. It is intended to show a simple example // of a container. // This variable is shown in the configinterface as the version of the module.
-
string cvs_version = "$Id: fnord.pike,v 1.
6
1999
/
12
/
14
01
:
47
:
21
nilsson Exp $";
+
string cvs_version = "$Id: fnord.pike,v 1.
7
2000
/
02/
12
15
:
52
:
04
nilsson Exp $";
// Tell Roxen that this module is threadsafe. That is there is no // request specific data in global variables. int thread_safe=1; // Include and inherit code that is needed in every module. #include <module.h> inherit "module";
Roxen.git/server/modules/examples/fnord.pike:70:
RequestID id ) { if (id->prestate->fnord) return contents; if (arguments->alt) return arguments->alt; return ""; }
-
//
This
function
is
needed
in
_all_
modules. The first index in
the
-
//
resulting array is the type of the
module
,
the
second is
the
'short
name',
-
// the third is a documentation string, the next is reserved, and the last one
-
// indiceates wheter or not there can be more than one of this module
-
// active in any virtual server at any time
.
If it is 0, there can be more
-
// than one, othervise not. This is a 'one of a kind' module, only one
-
// copy of this module can be included in any virtual server at any time.
+
//
Some
constants
that
are
needed
to
register
the module
in
the
RXML
parser
.
-
array
register_
module
()
-
{
-
return ({
MODULE_PARSER
,
-
"Fnord!"
,
-
(
"Adds an extra container tag, <fnord> that's supposed to make "
+
constant
module
_
type
=
MODULE_PARSER
;
+
constant
module_name
=
"Fnord!"
;
+
constant
module_doc
=
"Adds an extra container tag, <fnord> that's supposed to make "
"things invisible unless the \"fnord\" prestate is present." "<p>This module is here as an example of how to write a "
-
"very simple RXML-parsing module.</p>"
),
-
0, 1
-
})
;
-
}
+
"very simple RXML-parsing module.</p>";
// Last, but not least, we want a documentation that can be integrated in the // online manual. The mapping tagdoc maps from container names to it's description. TAGDOCUMENTATION; #ifdef manual constant tagdoc=(["fnord":#"<desc cont>The fnord container tag hides its " "contents for the user, unless the fnord prestate is used.</desc>" "<attr name=alt value=string>An alternate text that should be written " "in place of the hidden text.</attr>"]); #endif