Branch: Tag:

2008-08-15

2008-08-15 12:33:55 by Martin Stjernholm <mast@lysator.liu.se>

Moving to pike 7.8 and dropping compatibility with earlier pikes.

Rev: server/arg_cache_plugins/replicate.pike:1.27
Rev: server/base_server/__default.pmod:1.2
Rev: server/base_server/cache.pike:1.90
Rev: server/base_server/config_userdb.pike:1.53
Rev: server/base_server/configuration.pike:1.653
Rev: server/base_server/emit_object.pike:1.7
Rev: server/base_server/fonts.pike:1.87
Rev: server/base_server/global_variables.pike:1.110
Rev: server/base_server/javamodule.pike:1.7
Rev: server/base_server/language.pike:1.43
Rev: server/base_server/module.pike:1.231
Rev: server/base_server/module_support.pike:1.135
Rev: server/base_server/prototypes.pike:1.219
Rev: server/base_server/roxen.pike:1.981
Rev: server/base_server/roxenlib.pike:1.224
Rev: server/base_server/roxenloader.pike:1.397
Rev: server/base_server/rxmlhelp.pike:1.65
Rev: server/base_server/smtprelay.pike:3.2
Rev: server/base_server/snmpagent.pike:1.24
Rev: server/bin/buildenv.pike:1.10
Rev: server/bin/create_testcert.pike:1.2
Rev: server/bin/functions:1.19
Rev: server/bin/garbagecollector.pike:1.23
Rev: server/bin/setup_nsr.pike:1.4
Rev: server/bin/sqlhelper.pike:1.4
Rev: server/config_interface/actions/change_version.pike:1.15
Rev: server/config_interface/actions/debug_info.pike:1.40
Rev: server/config_interface/actions/feature_list.pike:1.14
Rev: server/config_interface/actions/ftpstatus.pike:1.4
Rev: server/config_interface/actions/generate_rsa.pike:1.7
Rev: server/config_interface/actions/make_rsa_csr.pike:1.11
Rev: server/config_interface/actions/make_selfsigned_dsa.pike:1.11
Rev: server/config_interface/actions/make_selfsigned_rsa.pike:1.10
Rev: server/config_interface/actions/ssl_common.pike:1.8
Rev: server/config_interface/actions/tablist.pike:1.10
Rev: server/config_interface/actions/threads.pike:1.8
Rev: server/etc/env.d/java.pike:1.19
Rev: server/etc/include/variables.h:1.18
Rev: server/etc/modules/DBManager.pmod:1.76
Rev: server/etc/modules/ExtSQL.pmod:1.4
Rev: server/etc/modules/ExtScript.pmod:1.22
Rev: server/etc/modules/GText.pmod:1.20
Rev: server/etc/modules/HTML.pmod:1.8
Rev: server/etc/modules/JavaModule.pmod:1.25
Rev: server/etc/modules/LazyImage.pmod/CoordinateSystem.pike:1.4
Rev: server/etc/modules/LazyImage.pmod/Legend.pike:1.5
Rev: server/etc/modules/LazyImage.pmod/module.pmod:1.19
Rev: server/etc/modules/License.pmod:1.27
Rev: server/etc/modules/Map.pmod:1.7
Rev: server/etc/modules/PropertySet.pike:1.12
Rev: server/etc/modules/RXML.pmod/PEnt.pike:1.24
Rev: server/etc/modules/RXML.pmod/PXml.pike:1.65
Rev: server/etc/modules/RXML.pmod/module.pmod:1.367
Rev: server/etc/modules/Roxen.pmod:1.246
Rev: server/etc/modules/RoxenDebug.pmod:1.12
Rev: server/etc/modules/RoxenRPC.pmod/HTTP.pmod/Client.pike:1.10
Rev: server/etc/modules/RoxenRPC.pmod/HTTP.pmod/Server.pike:1.6
Rev: server/etc/modules/RoxenSSLFile.pike:1.27(DEAD)
Rev: server/etc/modules/SNMP.pmod:1.10
Rev: server/etc/modules/Servlet.pmod:1.31
Rev: server/etc/modules/SloppyDOM.pmod:1.16
Rev: server/etc/modules/StateHandler.pmod:1.13
Rev: server/etc/modules/VFS.pmod:1.7
Rev: server/etc/modules/Variable.pmod/Date.pike:1.9
Rev: server/etc/modules/Variable.pmod/Email.pike:1.15
Rev: server/etc/modules/Variable.pmod/Image.pike:1.5
Rev: server/etc/modules/Variable.pmod/Language.pike:1.2
Rev: server/etc/modules/Variable.pmod/MapLocation.pike:1.6
Rev: server/etc/modules/Variable.pmod/Mapping.pike:1.9
Rev: server/etc/modules/Variable.pmod/Upload.pike:1.5
Rev: server/etc/modules/Variable.pmod/module.pmod:1.108
Rev: server/etc/modules/_NewLDAP.pmod/client.pike:1.11(DEAD)
Rev: server/etc/modules/_NewLDAP.pmod/ldap_globals.h:1.1(DEAD)
Rev: server/etc/modules/_NewLDAP.pmod/ldap_privates.pmod:1.1(DEAD)
Rev: server/etc/modules/_NewLDAP.pmod/module.pmod:1.4(DEAD)
Rev: server/etc/modules/_NewLDAP.pmod/protocol.pike:1.1(DEAD)
Rev: server/etc/roxen_master.pike:1.150
Rev: server/etc/test/tests/ftp/ftp_test.pike:1.4
Rev: server/font_handlers/freetype.pike:1.30
Rev: server/font_handlers/imagedir.pike:1.15
Rev: server/font_handlers/imagetar.pike:1.10
Rev: server/font_handlers/ttf.pike:1.18
Rev: server/languages/catala.pike:1.11
Rev: server/languages/chinese.pike:1.2
Rev: server/languages/croatian.pike:1.11
Rev: server/languages/czech.pike:1.18
Rev: server/languages/dutch.pike:1.11
Rev: server/languages/finnish.pike:1.10
Rev: server/languages/french.pike:1.13
Rev: server/languages/german.pike:1.11
Rev: server/languages/hungarian.pike:1.7
Rev: server/languages/italian.pike:1.13
Rev: server/languages/japanese.pike:1.22
Rev: server/languages/maori.pike:1.9
Rev: server/languages/norwegian.pike:1.12
Rev: server/languages/polish.pike:1.8
Rev: server/languages/portuguese.pike:1.11
Rev: server/languages/russian.pike:1.10
Rev: server/languages/serbian.pike:1.10
Rev: server/languages/slovenian.pike:1.17
Rev: server/languages/spanish.pike:1.12
Rev: server/languages/swedish.pike:1.20
Rev: server/modules/configuration/config_tags.pike:1.197
Rev: server/modules/configuration/roxen_test.pike:1.68
Rev: server/modules/configuration/update.pike:1.40
Rev: server/modules/examples/userdb_ex.pike:1.8
Rev: server/modules/filesystems/filesystem.pike:1.157
Rev: server/modules/filesystems/incoming.pike:1.19
Rev: server/modules/filesystems/restrictedfs.pike:1.24
Rev: server/modules/filesystems/sqlfs.pike:1.9
Rev: server/modules/filesystems/userfs.pike:1.71
Rev: server/modules/filters/tableborder.pike:1.13
Rev: server/modules/filters/whitespace_remover.pike:1.4
Rev: server/modules/graphics/business.pike:1.152
Rev: server/modules/graphics/gxml.pike:1.38
Rev: server/modules/graphics/pimage.pike:1.31
Rev: server/modules/graphics/rimage/rimage.pike:1.23
Rev: server/modules/icecast/icecast.pike:1.12
Rev: server/modules/icecast/pl_common.pike:1.9
Rev: server/modules/js-support/javascript_support.pike:1.68
Rev: server/modules/ldap/ldaptag.pike:2.38
Rev: server/modules/ldap/userdb_ldap.pike:1.14
Rev: server/modules/logging/home_logger.pike:1.35
Rev: server/modules/misc/preferred_language.pike:1.32
Rev: server/modules/misc/randomtext.pike:1.10
Rev: server/modules/misc/wapadapter.pike:1.13
Rev: server/modules/misc/webdav.pike:1.38
Rev: server/modules/proxies/connect.pike:1.20
Rev: server/modules/proxies/proxy.pike:1.57
Rev: server/modules/proxies/wais.pike:1.28
Rev: server/modules/scripting/cgi.pike:2.65
Rev: server/modules/scripting/fastcgi.pike:2.13
Rev: server/modules/scripting/perl.pike:2.26
Rev: server/modules/scripting/php.pike:2.5
Rev: server/modules/scripting/piketag.pike:2.38
Rev: server/modules/scripting/servlet.pike:2.24
Rev: server/modules/scripting/webapp.pike:2.32
Rev: server/modules/security/auth_httpbasic.pike:1.12
Rev: server/modules/security/auth_httpcookie.pike:1.12
Rev: server/modules/security/htaccess.pike:1.106
Rev: server/modules/security/userdb_sql.pike:1.10
Rev: server/modules/security/userdb_system.pike:1.12
Rev: server/modules/tags/accessed.pike:1.57
Rev: server/modules/tags/email.pike:1.43
Rev: server/modules/tags/emit_exec.pike:1.4
Rev: server/modules/tags/emit_timerange.pike:1.29
Rev: server/modules/tags/insert_cached_href.pike:1.22
Rev: server/modules/tags/obox.pike:1.41
Rev: server/modules/tags/rxmltags.pike:1.553
Rev: server/modules/tags/wizz.pike:1.10
Rev: server/modules/tags/writefile.pike:1.20
Rev: server/modules/throttling/throttling_byaddress.pike:1.6
Rev: server/modules/throttling/throttling_bytime.pike:1.8
Rev: server/ntroxenloader.pike:1.9
Rev: server/protocols/ftp.pike:2.125
Rev: server/protocols/http.pike:1.561
Rev: server/protocols/prot_hilfe.pike:2.15
Rev: server/protocols/prot_snmp.pike:2.8
Rev: server/sbin/roxen-create-server:1.5
Rev: server/tools/ntroxen/startdll/cmdline.cpp:1.21

1: - // $Id: module.pmod,v 1.107 2008/05/09 18:22:47 mast Exp $ + // $Id: module.pmod,v 1.108 2008/08/15 12:33:54 mast Exp $      #include <module.h>   #include <roxen.h>
11:      // Increased for each variable, used to index the mappings below. The unique   // prefix is needed to avoid clobbering variables after server restart. - static int unique_vid; - static string unique_prefix = (string) getpid(); + protected int unique_vid; + protected string unique_prefix = (string) getpid();      // The theory is that most variables (or at least a sizable percentage   // of all variables) does not have these members. Thus this saves   // quite a respectable amount of memory, the cost is speed. But   // hopefully not all that great a percentage of speed. - static mapping(string:mixed) changed_values = ([]); - static mapping(string:function(object:void)) changed_callbacks = ([]); - static mapping(string:int) all_flags = ([]); - static mapping(string:string) all_warnings = ([]); - static mapping(string:function(RequestID,object:int)) + protected mapping(string:mixed) changed_values = ([]); + protected mapping(string:function(object:void)) changed_callbacks = ([]); + protected mapping(string:int) all_flags = ([]); + protected mapping(string:string) all_warnings = ([]); + protected mapping(string:function(RequestID,object:int))    invisibility_callbacks = set_weak_flag( ([]), 1 );      mapping(string:Variable) all_variables = set_weak_flag( ([]), 1 );
77:      class Diff   { -  static private array(string) diff; +  private array(string) diff;    -  static private +  private    array(string) print_row(array(string) diff_old, array(string) diff_new,    int line, int|void start, int|void end)    {
197:    string _id = unique_prefix + "_" + (string) unique_vid++;    // used for indexing the mappings.    -  static mixed _initial; // default value -  static string _path = sprintf("v%s",_id); // used for forms -  static LocaleString __name, __doc; +  protected mixed _initial; // default value +  protected string _path = sprintf("v%s",_id); // used for forms +  protected LocaleString __name, __doc;       string diff( int render )    //! Generate a html diff of the difference between the current
598:    return Roxen.html_encode_string( (string)v );    }    -  static string _sprintf( int i ) +  protected string _sprintf( int i )    {    if( i == 'O' )    return sprintf( "Variable.%s(%s)",type,(string)name());    }    -  static void create(mixed default_value, void|int flags, +  protected void create(mixed default_value, void|int flags,    void|LocaleString std_name, void|LocaleString std_doc)    //! Constructor.    //! Flags is a bitwise or of one or more of
657:   {    inherit Variable;    constant type = "Float"; -  static float|NoLimit _max = no_limit, _min = no_limit; -  static int _prec = 2; -  static int _may_be_empty = 0; -  static int(0..1) _is_empty = 0; +  protected float|NoLimit _max = no_limit, _min = no_limit; +  protected int _prec = 2; +  protected int _may_be_empty = 0; +  protected int(0..1) _is_empty = 0;    -  static string _format( float|NoLimit m ) +  protected string _format( float|NoLimit m )    {    if (m == no_limit)    return "n/a";
781:   {    inherit Variable;    constant type = "Int"; -  static int|NoLimit _max = no_limit, _min = no_limit; +  protected int|NoLimit _max = no_limit, _min = no_limit;    -  static int(0..1) _may_be_empty = 0; -  static int(0..1) _is_empty = 0; +  protected int(0..1) _may_be_empty = 0; +  protected int(0..1) _is_empty = 0;       void set_range(int|NoLimit minimum, int|NoLimit maximum )    //! Set the range of the variable.
947:    "</textarea>";    }    -  static void create(mixed default_value, void|int flags, +  protected void create(mixed default_value, void|int flags,    void|LocaleString std_name, void|LocaleString std_doc)    //! Constructor.    //! Flags is a bitwise or of one or more of
1107:   //! Base class for multiple-choice (one of many) variables.   {    inherit Variable; -  static array _list = ({}); -  static mapping _table = ([]); +  protected array _list = ({}); +  protected mapping _table = ([]);       string diff( int render )    {
1142:    return _table;    }    -  static string _name( mixed what ) +  protected string _name( mixed what )    //! Get the name used as value for an element gotten from the    //! get_choice_list() function.    {    return (string)what;    }    -  static string _title( mixed what ) +  protected string _title( mixed what )    //! Get the title used as description (shown to the user) for an    //! element gotten from the get_choice_list() function.    {
1186:    return res + "</select>";    }    -  static void create( mixed default_value, array|mapping choices, +  protected void create( mixed default_value, array|mapping choices,    void|int _flags, void|LocaleString std_name,    void|LocaleString std_doc )    //! Constructor.
1242:   {    inherit MultipleChoice;    constant type = "FloatChoice"; -  static int _prec = 3; +  protected int _prec = 3;       void set_precision( int prec )    //! Set the number of _decimals_ shown to the user.
1252:    _prec = prec;    }    -  static string _title( mixed what ) +  protected string _title( mixed what )    {    if( !_prec )    return sprintf( "%d", (int)what );
1280:    return roxenp()->fonts->available_fonts();    }    -  static void create(mixed default_value, void|int flags, +  protected void create(mixed default_value, void|int flags,    void|LocaleString std_name, void|LocaleString std_doc)    //! Constructor.    //! Flags is a bitwise or of one or more of
1343:    return ({ " none" }) + sort(DBManager.list( config() ));    }    -  static void create(string default_value, void|int flags, +  protected void create(string default_value, void|int flags,    void|LocaleString std_name, void|LocaleString std_doc)    {    ::create( default_value, ({}), flags, std_name, std_doc );
1355:    inherit StringChoice;    constant type = "AuthMethodChoice";    -  static Configuration config; +  protected Configuration config;       array get_choice_list( )    {    return ({ " all" }) + sort( config->auth_modules()->name );    }    -  static void create( string default_value, int flags, +  protected void create( string default_value, int flags,    string std_name, string std_doc,    Configuration c )    {
1376:    inherit StringChoice;    constant type = "UserDBChoice";    -  static Configuration config; +  protected Configuration config;       array get_choice_list( )    {    return ({ " all" }) + sort( config->user_databases()->name );    }    -  static void create( string default_value, int flags, +  protected void create( string default_value, int flags,    string std_name, string std_doc,    Configuration c )    {
1399:   {    inherit StringChoice;    constant type = "ProviderChoice"; -  static Configuration conf; -  static string provides; -  static string default_id; -  static string local_id = ""; -  static int isset; +  protected Configuration conf; +  protected string provides; +  protected string default_id; +  protected string local_id = ""; +  protected int isset;       int low_set(RoxenModule to)    {
1464:    return res;    }    -  static string _name(RoxenModule val) +  protected string _name(RoxenModule val)    {    return val?val->module_local_id():"";    }    -  static string _title(RoxenModule val) +  protected string _title(RoxenModule val)    {    return val?val->module_name:"";    }
1509:    //! The provider string to match modules against.    //! @param conf    //! The current configuration. -  static void create(string default_id, int flags, +  protected void create(string default_id, int flags,    string std_name, string std_doc,    string provides, Configuration conf)    {
1553:    return what;    }    -  static int _current_count = time()*100+(gethrtime()/10000); +  protected int _current_count = time()*100+(gethrtime()/10000);    int(0..1) set_from_form(RequestID id)    {    int rn, do_goto;
1769:    constant type="FloatList";    int width=20;    -  static int _prec = 3; +  protected int _prec = 3;       void set_precision( int prec )    //! Set the number of _decimals_ shown to the user.
1958:   // =================================================================   // Utility functions used in multiple variable classes above   // ================================================================= - static array(string) verify_port( string port ) + protected array(string) verify_port( string port )   {    if(!strlen(port))    return ({ 0, port });