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

version» Context lines:

Roxen.git/server/modules/misc/randomtext.pike:53:   // called.   //   // ... any yes, this module was a quick hack for amusement and for   // use in some courses to help provide dummy contents for new sites,   // so don't use this as a model for how to write Roxen modules.      inherit "module";      #include <module.h>    - string version = "$Id: randomtext.pike,v 1.9 2008/06/24 10:51:29 jonasw Exp $"; + string version = "$Id: randomtext.pike,v 1.10 2008/08/15 12:33:55 mast Exp $";      constant module_type = MODULE_TAG;   constant module_name = "Random Text";   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.";   
Roxen.git/server/modules/misc/randomtext.pike:126:   {    int period = 60*query("flushcache");       call_out(flush_cache, period < 5 ? 5 : period);       searchpath = query("searchpath");    if (stringp(searchpath) && searchpath[-1] == '/')    searchpath = searchpath[0..sizeof(searchpath)-2];   }    - static int isalnum(string c) + protected int isalnum(string c)   {    if (!stringp(c) || sizeof(c) != 1)    return 0;    if (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c >= "0" && c <= "9")    return 1;    return 0;   }    - static int isidchar(string c) + protected int isidchar(string c)    { return isalnum(c) || c == "-" || c == "_";}    - static int isopchar(string c) + protected int isopchar(string c)    { return (< "+", "-", "*", "/", "%", "!", "=", "<", ">" >)[c];}      mixed evalexpr(string expr, mapping args)   //   // Evaluate a simple expression. Note: this function doesn't care   // about traditional operator precedence -- binary operators are   // always applied from right to left.   //   {    string left, op, right; mixed value, value2;