Roxen.git
/
server
/
modules
/
examples
/
newstyle_fnord.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/modules/examples/newstyle_fnord.pike:1:
// This is a small sample module intended to show how a newstyle tag // is written. Note that this is only a very brief overview and that // the new parser is still under development and incompatible changes // might be done in the future. // See fnord.pike for more information of what this tag does. // This variable is shown in the configinterface as the version of the module.
-
string cvs_version = "$Id: newstyle_fnord.pike,v 1.
1
2000/
01
/
26
15
:
11
:
24
nilsson Exp $";
+
string cvs_version = "$Id: newstyle_fnord.pike,v 1.
2
2000/
02
/
17
13
:
05
:
15
nilsson Exp $";
// Tell Roxen that this module is threadsafe. int thread_safe=1; // Include and inherit code that is needed in every module. #include <module.h> inherit "module"; // Define the fnord tag class. It must begin with "Tag". class TagFnord { inherit RXML.Tag; // This constant tells the parser that the tag should be called "fnord". constant name = "fnord";
-
// This tag is only meaningful when used as a container.
-
constant flags = RXML.FLAG_CONTAINER;
-
+
// Declare the type of the attribute, which happens to be optional. // Since we declare it to be text, we really don't need this line to // get things to work. constant opt_arg_types = ([ "alt" : RXML.t_text ]); // This class is where all the action are. class Frame { inherit RXML.Frame; // When the parser starts to parse the tag it calls