Roxen.git / server / modules / examples / newstyle_fnord.pike

version» Context lines:

Roxen.git/server/modules/examples/newstyle_fnord.pike:1:   // This is a roxen module. Copyright © 2000, Roxen IS.      // 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. - constant cvs_version = "$Id: newstyle_fnord.pike,v 1.6 2000/07/17 12:23:56 nilsson Exp $"; + constant cvs_version = "$Id: newstyle_fnord.pike,v 1.7 2000/08/01 15:56:12 jhs Exp $";      // Tell Roxen that this module is threadsafe.   constant thread_safe=1;    - // Include and inherit code that is needed in every module. - #include <module.h> + // Inherit code that is needed in every module.   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";       // 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.    mapping(string:RXML.Type) opt_arg_types = ([ "alt" : RXML.t_text(RXML.PEnt) ]);   
Roxen.git/server/modules/examples/newstyle_fnord.pike:68:   constant module_type = MODULE_PARSER;   constant module_name = "Newstyle Fnord!";   constant module_doc = "Adds an extra container tag, &lt;fnord&gt; 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 newstyle 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.    + // Include this is if you use the TAGDOC system. + #include <module.h> +    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