Roxen.git / server / modules / misc / randomtext.pike

version» Context lines:

Roxen.git/server/modules/misc/randomtext.pike:48:   // has the directive trim-spaces, which indicates that leading and   // trailing spaces should be removed, and any internal sequences of   // whitespace should be converted into a single space. The "second-rule"   // rule has the directive "single-shot", meaning it should only select   // randomly once, but then produce the same result every time it is   // called.   //   // ... any yes, the code for this module is rather messy. It was a   // quick for fun.    - #include <module.h> +    inherit "module"; - inherit "roxenlib"; +     - string version = "$Id: randomtext.pike,v 1.3 2000/02/22 18:06:28 leif Exp $"; + string version = "$Id: randomtext.pike,v 1.4 2000/07/03 05:35:41 nilsson Exp $";    -  + #if __ROXEN_VERSION__ < 2.0 + #include <module.h> + array register_module() + { return ({ MODULE_PARSER, +  "Random Text Generator Module", +  ("This module provides a simple way of generating texts on a " +  "semi-random basis according to a set of rules. Apart from its " +  "amusement value, this can be useful for testing and educational " +  "purposes, such as generating small quiz pages or producing " +  "many different kinds of input to text processing tags."), +  0, +  1 }); + } + #else + constant module_type = MODULE_PARSER; + constant module_name = "Random Text Generator Module"; + constant module_doc = +  "This module provides a simple way of generating texts on a " +  "semi-random basis according to a set of rules. Apart from its " +  "amusement value, this can be useful for testing and educational " +  "purposes, such as generating small quiz pages or producing " +  "many different kinds of input for testing text processing tags."; + #endif +    mapping text_cache = ([ ]);      string recentfile = "(none)", recenterror = "(none)", recentdiag = "(none)";   int recentsteps, recenttagtime;      void create()   { defvar("searchpath", "NONE", "Rules File Search Path", TYPE_DIR,    "This is the location in the real file system where the random "    "text module will look for rule files.");   
Roxen.git/server/modules/misc/randomtext.pike:86:    );       defvar("maxeval", 20000, "Maximum Evaluation Steps", TYPE_MULTIPLE_INT,    "This value limits the number of evaluation steps that may be taken "    "while evaluating a rule file. The default value for this option is "    "20000.",    ({ 5000, 10000, 20000, 50000, 100000 })    );   }    - #if __ROXEN_VERSION__ < 2.0 - array register_module() - { return ({ MODULE_PARSER, -  "Random Text Generator Module", -  ("This module provides a simple way of generating texts on a " -  "semi-random basis according to a set of rules. Apart from its " -  "amusement value, this can be useful for testing and educational " -  "purposes, such as generating small quiz pages or producing " -  "many different kinds of input to text processing tags."), -  0, -  1 }); - } - #else - constant module_type = MODULE_PARSER; - constant module_name = "Random Text Generator Module"; - constant module_doc = -  "This module provides a simple way of generating texts on a " -  "semi-random basis according to a set of rules. Apart from its " -  "amusement value, this can be useful for testing and educational " -  "purposes, such as generating small quiz pages or producing " -  "many different kinds of input for testing text processing tags."; - #endif -  +    string status()   { return -  "<b>Most recent tagtime</b>:" + recenttagtime + "<br>" + -  "<b>Most recent file</b>:" + recentfile + "<br>" + -  "<b>Most recent error</b>:" + recenterror + "<br>" + -  "<b>Steps in recent run</b>:" + recentsteps + "<br>" + -  "<b>Debug diagnostics</b>:" + recentdiag + "<br>" + +  "<b>Most recent tagtime</b>:" + recenttagtime + "<br />" + +  "<b>Most recent file</b>:" + recentfile + "<br />" + +  "<b>Most recent error</b>:" + recenterror + "<br />" + +  "<b>Steps in recent run</b>:" + recentsteps + "<br />" + +  "<b>Debug diagnostics</b>:" + recentdiag + "<br />" +    "<b>Text cache for</b>: " + sprintf("%O", indices(text_cache));   }      void flush_cache()   { int period = 60*query("flushcache");    text_cache = ([ ]);    call_out(flush_cache, period < 5 ? 5 : period);   }      void start()