|
|
|
|
|
|
|
|
|
|
constant cvs_version = "$Id: newstyle_fnord.pike,v 1.12 2001/09/03 18:05:11 nilsson Exp $"; |
|
|
constant thread_safe=1; |
|
|
inherit "module"; |
|
|
|
#include <module.h> |
|
|
|
#define LOCALE(X,Y) _DEF_LOCALE("mod_fnord",X,Y) |
|
|
|
|
class TagFnord { |
inherit RXML.Tag; |
|
|
constant name = "fnord"; |
|
|
|
|
mapping(string:RXML.Type) opt_arg_types = ([ "alt" : RXML.t_text(RXML.PEnt) ]); |
|
|
class Frame { |
inherit RXML.Frame; |
|
|
|
|
|
|
|
|
|
|
|
|
|
array do_enter(RequestID id) { |
if(id->prestate->fnord) |
do_iterate=0; |
else { |
if(args->alt) |
result=args->alt; |
do_iterate=-1; |
} |
return 0; |
} |
|
int do_iterate; |
} |
} |
|
|
|
|
constant module_type = MODULE_TAG; |
LocaleString module_name = LOCALE(3,"Newstyle Fnord!"); |
LocaleString module_doc = |
LOCALE(4,"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 newstyle RXML-parsing module.</p>"); |
|
|
|
|
|
#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 |
|
|