diff --git a/lib/modules/ADT.pmod/Heap.pike b/lib/modules/ADT.pmod/Heap.pike index 9cd7087ad5c635d6f5a9e8c4bde7a5d056e4a731..d44ffb3be77daa8339232ae85cb340e104521fe8 100644 --- a/lib/modules/ADT.pmod/Heap.pike +++ b/lib/modules/ADT.pmod/Heap.pike @@ -6,8 +6,8 @@ #define SWAP(X,Y) do{ mixed tmp=values[X]; values[X]=values[Y]; values[Y]=tmp; }while(0) -static private array values=allocate(10); -static private int num_values; +protected private array values=allocate(10); +protected private int num_values; #ifdef DEBUG void verify_heap() @@ -21,7 +21,7 @@ void verify_heap() #define verify_heap() #endif -static void adjust_down(int elem) +protected void adjust_down(int elem) { while(1) { @@ -50,7 +50,7 @@ static void adjust_down(int elem) } } -static int adjust_up(int elem) +protected int adjust_up(int elem) { int parent=(elem-1)/2; diff --git a/lib/modules/ADT.pmod/Queue.pike b/lib/modules/ADT.pmod/Queue.pike index 27738e52aafaa7dbb51a148863619e4d09de6d13..864c00c02dc312fab82e8f23cff85623e5543bf4 100644 --- a/lib/modules/ADT.pmod/Queue.pike +++ b/lib/modules/ADT.pmod/Queue.pike @@ -1,4 +1,4 @@ -// $Id: Queue.pike,v 1.13 2005/05/25 12:20:38 mast Exp $ +// $Id: Queue.pike,v 1.14 2008/06/28 16:36:53 nilsson Exp $ //! A simple FIFO queue. @@ -10,19 +10,19 @@ int head; int tail; //! Creates a queue with the initial items @[args] in it. -static void create(mixed ...args) +protected void create(mixed ...args) { l = args + allocate(QUEUE_SIZE); head = sizeof(args); tail = 0; } -static int _sizeof() +protected int _sizeof() { return head - tail; } -static array _values() +protected array _values() { return l[tail..head-1]; } @@ -90,7 +90,7 @@ void flush() } //! It is possible to cast ADT.Queue to an array. -static mixed cast(string to) { +protected mixed cast(string to) { switch(to) { case "object": return this; case "array": return l[tail..head-1]; @@ -98,6 +98,6 @@ static mixed cast(string to) { error("Can not cast ADT.Queue to %s.\n", to); } -static string _sprintf(int t) { +protected string _sprintf(int t) { return t=='O' && l && sprintf("%O%O", this_program, cast("array")); } diff --git a/lib/modules/ADT.pmod/Relation.pmod/Binary.pike b/lib/modules/ADT.pmod/Relation.pmod/Binary.pike index 82a50da3cfd353aa77130d34c40d9ced856c93ea..e73864419538b22fcfd85552583a2eab6c5803de 100644 --- a/lib/modules/ADT.pmod/Relation.pmod/Binary.pike +++ b/lib/modules/ADT.pmod/Relation.pmod/Binary.pike @@ -1,4 +1,4 @@ -// $Id: Binary.pike,v 1.14 2005/01/14 09:59:58 nilsson Exp $ +// $Id: Binary.pike,v 1.15 2008/06/28 16:36:53 nilsson Exp $ // An abstract data type for binary relations. #pike __REAL_VERSION__ @@ -259,14 +259,14 @@ void create(void|mixed _id, void|mapping|object _initial) //! An iterator which makes all the left/right entities in the relation //! available as index/value pairs. -static class _get_iterator { +protected class _get_iterator { - static int(0..) ipos; - static int(0..) vpos; - static int(0..1) finished = 1; + protected int(0..) ipos; + protected int(0..) vpos; + protected int(0..1) finished = 1; - static array lefts; - static array rights; + protected array lefts; + protected array rights; void create() { first(); diff --git a/lib/modules/ADT.pmod/Struct.pike b/lib/modules/ADT.pmod/Struct.pike index 062cb25cbc179c6a1db144b39205a67702ec276e..17d34eebf5b424b9f73920d6df3386273984bcf1 100644 --- a/lib/modules/ADT.pmod/Struct.pike +++ b/lib/modules/ADT.pmod/Struct.pike @@ -1,7 +1,7 @@ // // Struct ADT // By Martin Nilsson -// $Id: Struct.pike,v 1.19 2008/05/02 23:06:58 nilsson Exp $ +// $Id: Struct.pike,v 1.20 2008/06/28 16:36:53 nilsson Exp $ // #pike __REAL_VERSION__ @@ -37,8 +37,8 @@ //! Item str = Chars(strlen); //! } -static local array(Item) items = ({}); -static local mapping(string:Item) names = ([]); +protected local array(Item) items = ({}); +protected local mapping(string:Item) names = ([]); constant is_struct = 1; constant is_item = 1; @@ -48,7 +48,7 @@ int id = ADT.get_item_id(); //! @param data //! Data to be decoded and populate the struct. Can //! either be a file object or a string. -optional static void create(void|string|object file) { +optional protected void create(void|string|object file) { foreach(::_indices(2), string index) { mixed val = ::`[](index, 2); if(objectp(val) && val->is_item) names[index]=val; @@ -88,36 +88,36 @@ string encode() { //! It is possible to assign a new value to a struct //! item by indexing it by name and assign a value. -static mixed `[](string id) { +protected mixed `[](string id) { if(names[id]) return names[id]->get(); return ::`[](id, 2); } this_program get() { return this; } -static mixed `[]=(string id, mixed value) { +protected mixed `[]=(string id, mixed value) { if(names[id]) names[id]->set(value); return id; } -static function `-> = `[]; -static function `->= = `[]=; +protected function `-> = `[]; +protected function `->= = `[]=; //! The indices of a struct is the name of the struct items. -static array(string) _indices() { +protected array(string) _indices() { array ret = indices(names); sort(values(names)->id, ret); return ret; } //! The values of a struct is the values of the struct items. -static array _values() { +protected array _values() { return items->get(); } //! The size of the struct object is the number of bytes //! allocated for the struct. -static int _sizeof() { +protected int _sizeof() { if(!sizeof(items)) return 0; return `+( @sizeof(items[*]) ); } @@ -126,7 +126,7 @@ static int _sizeof() { //! to running @[encode], or into an array. When casted into an //! array each array element is the encoded value of that struct //! item. -static mixed cast(string to) { +protected mixed cast(string to) { switch(to) { case "string": return encode(); case "array": return items->encode(); @@ -141,7 +141,7 @@ class Item { int id = ADT.get_item_id(); constant is_item=1; - static mixed value; + protected mixed value; int size; //! @ignore @@ -154,7 +154,7 @@ class Item { int _sizeof() { return size; } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%O)", this_program, value); } } @@ -166,10 +166,10 @@ class Item { class Byte { inherit Item; int size = 1; - static int(0..255) value; + protected int(0..255) value; //! The byte can be initialized with an optional value. - static void create(void|int(0..255) initial_value) { + protected void create(void|int(0..255) initial_value) { set(initial_value); } @@ -184,7 +184,7 @@ class Byte { return sprintf("%c", value); } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%d/%O)", this_program, value, (string)({value})); } @@ -194,10 +194,10 @@ class Byte { class SByte { inherit Item; int size = 1; - static int(-128..127) value; + protected int(-128..127) value; //! The byte can be initialized with an optional value. - static void create(void|int(-128..127) initial_value) { + protected void create(void|int(-128..127) initial_value) { set(initial_value); } @@ -212,7 +212,7 @@ class SByte { return sprintf("%1c", value); } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%d/%O)", this_program, value, (string)({value})); } @@ -224,10 +224,10 @@ class SByte { class Word { inherit Item; int size = 2; - static int(0..) value; + protected int(0..) value; //! The word can be initialized with an optional value. - static void create(void|int(0..65535) initial_value) { + protected void create(void|int(0..65535) initial_value) { set(initial_value); } @@ -240,7 +240,7 @@ class Word { void decode(object f) { sscanf(f->read(size), "%"+size+"c", value); } string encode() { return sprintf("%"+size+"c", value); } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%d)", this_program, value); } } @@ -250,10 +250,10 @@ class Word { class SWord { inherit Item; int size = 2; - static int value; + protected int value; //! The word can be initialized with an optional value. - static void create(void|int(-32768..32767) initial_value) { + protected void create(void|int(-32768..32767) initial_value) { set(initial_value); } @@ -266,7 +266,7 @@ class SWord { void decode(object f) { sscanf(f->read(size), "%+"+size+"c", value); } string encode() { return sprintf("%+"+size+"c", value); } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%d)", this_program, value); } } @@ -288,7 +288,7 @@ class Long { int size = 4; //! The longword can be initialized with an optional value. - static void create(void|int(0..) initial_value) { + protected void create(void|int(0..) initial_value) { set(initial_value); } } @@ -300,7 +300,7 @@ class SLong { int size = 4; //! The longword can be initialized with an optional value. - static void create(void|int initial_value) { + protected void create(void|int initial_value) { set(initial_value); } } @@ -313,7 +313,7 @@ class Gnol { int size = 4; //! The longword can be initialized with an optional value. - static void create(void|int(0..) initial_value) { + protected void create(void|int(0..) initial_value) { set(initial_value); } } @@ -322,8 +322,8 @@ class Gnol { //! A string of bytes. class Chars { inherit Item; - static Item dynsize; - static string value; + protected Item dynsize; + protected string value; //! @decl static void create(int|Item size, void|string value) //! @[size] is the number of bytes that are part of this struct @@ -331,7 +331,7 @@ class Chars { //! runtime. //! The initial value of the char string is @[value] or, //! if not provided, a string of zero bytes. - static void create(int|Item _size, void|string _value) { + protected void create(int|Item _size, void|string _value) { if(intp(_size)) size = _size; else @@ -362,16 +362,16 @@ class Chars { } string encode() { return value; } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%O)", this_program, value); } } class Varchars { inherit Chars; - static int min,max; + protected int min,max; - static void create(void|int _min, void|int _max, void|string _value) { + protected void create(void|int _min, void|int _max, void|string _value) { min = _min; max = _max; set(_value || " "*min); @@ -434,7 +434,7 @@ class uint64 { } } -static string _sprintf(int t) { +protected string _sprintf(int t) { if(t!='O') return UNDEFINED; string ret = sprintf("%O(\n", this_program); foreach(items, Item item) { diff --git a/lib/modules/ADT.pmod/Table.pmod b/lib/modules/ADT.pmod/Table.pmod index 461928baab00e388af91dd0eeef856978aa3312f..6267dba1f27242d5e8a07e4554b43139f87916ce 100644 --- a/lib/modules/ADT.pmod/Table.pmod +++ b/lib/modules/ADT.pmod/Table.pmod @@ -1,5 +1,5 @@ // Table.pmod by Fredrik Noring, 1998 -// $Id: Table.pmod,v 1.28 2004/09/25 02:51:20 nilsson Exp $ +// $Id: Table.pmod,v 1.29 2008/06/28 16:36:53 nilsson Exp $ #pike __REAL_VERSION__ #define TABLE_ERR(msg) error("(Table) "+msg+"\n") @@ -18,10 +18,10 @@ //! The table base-class. class table { - static private mapping fieldmap; - static private array table, fields, types; + protected private mapping fieldmap; + protected private array table, fields, types; - static private array|int remap(array|string|int cs, int|void forgive) + protected private array|int remap(array|string|int cs, int|void forgive) { array v = ({}); int ap = arrayp(cs); @@ -144,7 +144,7 @@ class table { return copy(v, fields+indices(table), types+table->all_types()); } - static private mixed op_col(function f, int|string c, mixed ... args) + protected private mixed op_col(function f, int|string c, mixed ... args) { c = remap(c); mixed x = table[0][c]; @@ -280,7 +280,7 @@ class table { return copy(t, fields, types); } - static private this_program _sort(int is_reversed, int|string ... cs) + protected private this_program _sort(int is_reversed, int|string ... cs) { if(!sizeof(cs)) return this; @@ -418,7 +418,7 @@ class table { } object Separated = class { - static private string _string(mixed x) { return (string)x; } + protected private string _string(mixed x) { return (string)x; } object decode(string s, void|mapping options) { diff --git a/lib/modules/ADT.pmod/Trie.pike b/lib/modules/ADT.pmod/Trie.pike index b1b0fa83c536f56afc56ae0534c33748be6a2d23..ebebec823330ad477cf2479495ae141237a4f293 100644 --- a/lib/modules/ADT.pmod/Trie.pike +++ b/lib/modules/ADT.pmod/Trie.pike @@ -1,7 +1,7 @@ #pike __REAL_VERSION__ /* - * $Id: Trie.pike,v 1.5 2008/01/04 20:48:40 nilsson Exp $ + * $Id: Trie.pike,v 1.6 2008/06/28 16:36:53 nilsson Exp $ * * An implementation of a trie. * @@ -14,16 +14,16 @@ mixed value = UNDEFINED; string|array(int) path = ({}); mapping(int:this_program) trie; -static array(int) index; +protected array(int) index; -static void create(string|array(int)|void key, int|void offset) +protected void create(string|array(int)|void key, int|void offset) { path = key || ({}); this_program::offset = offset || sizeof(path); path = path[..this_program::offset-1]; } -static void low_merge(int key, this_program o) +protected void low_merge(int key, this_program o) { if (!trie) { trie = ([ key : o ]); @@ -67,7 +67,7 @@ static void low_merge(int key, this_program o) trie[new->path[offset]] = new; } -static void merge_trie(mapping(int:this_program) other_trie) +protected void merge_trie(mapping(int:this_program) other_trie) { if (!other_trie) return; foreach(other_trie; int key; this_program o) { @@ -179,7 +179,7 @@ mixed lookup(string|array(int) key) return o->lookup(key); } -static void update_index() +protected void update_index() { if (!index) { index = sort(indices(trie)); @@ -224,7 +224,7 @@ string|array(int) next(string|array(int) base) return UNDEFINED; } -static string render_path() +protected string render_path() { if (arrayp(path)) { return sprintf("({%s})", @@ -235,7 +235,7 @@ static string render_path() return sprintf("%O", path); } -static string _sprintf(int c, mapping|void attrs) +protected string _sprintf(int c, mapping|void attrs) { if (c == 'O') { string res = sprintf("ADT.Trie(%s, ([", render_path()); diff --git a/lib/modules/ADT.pmod/module.pmod b/lib/modules/ADT.pmod/module.pmod index 03610244db37a381fb27caaefe5ad0b55da741f0..66d5f645ae1579f70b34a8d4acd055169cf13bed 100644 --- a/lib/modules/ADT.pmod/module.pmod +++ b/lib/modules/ADT.pmod/module.pmod @@ -10,7 +10,7 @@ inherit _ADT; constant List = __builtin.List; // Internal stuff for ADT.Struct -static int item_counter; +protected int item_counter; int get_item_id() { return item_counter++; } //! String buffer with the possibility to read and write data diff --git a/lib/modules/Arg.pmod b/lib/modules/Arg.pmod index f55d892f5cb93a32031e19bfa2e48015b750491b..350ae3592d72acec64489471816bf2b9fece8abc 100644 --- a/lib/modules/Arg.pmod +++ b/lib/modules/Arg.pmod @@ -1,7 +1,7 @@ // // Argument parser // By Martin Nilsson -// $Id: Arg.pmod,v 1.5 2008/05/03 17:14:50 nilsson Exp $ +// $Id: Arg.pmod,v 1.6 2008/06/28 16:36:52 nilsson Exp $ // #pike __REAL_VERSION__ @@ -14,7 +14,7 @@ class OptLibrary class Opt { constant is_opt = 1; - static Opt next; + protected Opt next; //! Should return 1 for set options or a string containing the //! value of the option. Returning 0 means the option was not set @@ -36,7 +36,7 @@ class OptLibrary return next->get_opts(); } - static this_program `|(mixed thing) + protected this_program `|(mixed thing) { if( !objectp(thing) || !thing->is_opt ) error("Can only or %O with another %O.\n", @@ -54,12 +54,12 @@ class OptLibrary //! This function will be called by @expr{_sprintf@}, which //! handles formatting of chaining between objects. - static string __sprintf() + protected string __sprintf() { return sprintf("%O()", this_program); } - static string _sprintf(int t) + protected string _sprintf(int t) { if( t!='O' ) return UNDEFINED; if( !next ) @@ -77,10 +77,10 @@ class OptLibrary class NoOpt { inherit Opt; - static string opt; - static int double; + protected string opt; + protected int double; - static void create(string _opt) + protected void create(string _opt) { if( sizeof(_opt)>2 && has_prefix(_opt, "--") ) double = 1; @@ -123,7 +123,7 @@ class OptLibrary return ({ opt }) + ::get_opts(); } - static string __sprintf() + protected string __sprintf() { return sprintf("Arg.NoOpt(%O)", opt); } @@ -137,9 +137,9 @@ class OptLibrary class Env { inherit Opt; - static string name; + protected string name; - static void create(string _name) + protected void create(string _name) { name = _name; } @@ -150,7 +150,7 @@ class OptLibrary return ::get_value(argv, env); } - static string __sprintf() + protected string __sprintf() { return sprintf("Arg.Env(%O)", name); } @@ -163,9 +163,9 @@ class OptLibrary class Default { inherit Opt; - static string value; + protected string value; - static void create(string _value) + protected void create(string _value) { value = _value; } @@ -175,7 +175,7 @@ class OptLibrary return value; } - static string __sprintf() + protected string __sprintf() { return sprintf("Arg.Default(%O)", value); } @@ -247,7 +247,7 @@ class OptLibrary return ::get_value(argv, env); } - static string __sprintf() + protected string __sprintf() { return sprintf("Arg.MaybeOpt(%O)", opt); } @@ -329,7 +329,7 @@ class OptLibrary return ::get_value(argv, env); } - static string __sprintf() + protected string __sprintf() { return sprintf("Arg.HasOpt(%O)", opt); } @@ -338,7 +338,7 @@ class OptLibrary } // -- OptLibrary object REST = class { - static string _sprintf(int t) + protected string _sprintf(int t) { return "Arg.REST"; } @@ -349,14 +349,14 @@ object REST = class { class LowOptions { - static inherit OptLibrary; + protected inherit OptLibrary; - static mapping(string:Opt) opts = ([]); - static mapping(string:int(1..1)|string) values = ([]); - static array(string) argv; - static string application; + protected mapping(string:Opt) opts = ([]); + protected mapping(string:int(1..1)|string) values = ([]); + protected array(string) argv; + protected string application; - static void create(array(string) _argv, void|mapping(string:string) env) + protected void create(array(string) _argv, void|mapping(string:string) env) { if(!env) env = getenv(); @@ -414,13 +414,13 @@ class LowOptions } - static int(0..1) unhandled_argument(array(string) argv, + protected int(0..1) unhandled_argument(array(string) argv, mapping(string:string) env) { return 0; } - static mixed cast(string to) + protected mixed cast(string to) { switch( to ) { @@ -439,16 +439,16 @@ class Options { inherit LowOptions; - static string|int `[](string id) + protected string|int `[](string id) { return values[id]; } - static string|int `->(string id) + protected string|int `->(string id) { return values[id]; } - static int(0..1)|string unhandled_argument(array(string) argv, + protected int(0..1)|string unhandled_argument(array(string) argv, mapping(string:string) env) { if( !sizeof(argv) || argv[0]!="--help" ) return 0; @@ -470,7 +470,7 @@ class Options write( "\n"+s ); } - static string index(string i) + protected string index(string i) { string s = ::`[](i, 2); if( !s ) return 0; diff --git a/lib/modules/Array.pmod b/lib/modules/Array.pmod index 9f0cc765509f8fca1682043c05898166725b4021..d2658557e4af7165af11cc0d49971152644f488d 100644 --- a/lib/modules/Array.pmod +++ b/lib/modules/Array.pmod @@ -626,7 +626,7 @@ int(-1..1) oid_sort_func(string a, string b) return oid_sort_func(a,b); } -static array(array(array)) low_greedy_diff(array(array) d1, array(array) d2) +protected array(array(array)) low_greedy_diff(array(array) d1, array(array) d2) { array r1, r2, x, y, yb, b, c; r1 = r2 = ({}); diff --git a/lib/modules/Audio.pmod/Codec.pmod b/lib/modules/Audio.pmod/Codec.pmod index 998447d384b85930d3e33d4d2aa8a489c37bee46..b21c16cc0fdd340f58faf6042427354a3f52ec3d 100644 --- a/lib/modules/Audio.pmod/Codec.pmod +++ b/lib/modules/Audio.pmod/Codec.pmod @@ -4,7 +4,7 @@ creator: Honza Petrous, hop@unibase.cz - $Id: Codec.pmod,v 1.10 2004/01/11 00:38:44 nilsson Exp $ + $Id: Codec.pmod,v 1.11 2008/06/28 16:36:53 nilsson Exp $ */ @@ -48,7 +48,7 @@ class decoder { //! //! @seealso //! @[_Ffmpeg.ffmpeg], @[_Ffmpeg.CODEC_ID_MP2] - static void create(string|void codecname, object|void _codec) { + protected void create(string|void codecname, object|void _codec) { if(stringp(codecname)) init(codecname); } @@ -116,9 +116,10 @@ class decoder { return codec && codec->get_codec_status(); } - static mixed _sprintf(int|void type) { + protected mixed _sprintf(int|void type) { return type=='O' && sprintf("Audio.Codec(/* %O */)", codec); } } #endif + diff --git a/lib/modules/Audio.pmod/Format.pmod/MP3.pike b/lib/modules/Audio.pmod/Format.pmod/MP3.pike index 258b049bb4caa181113461e9dec78239730484dd..e698f706982b7147840ca59bfedf0e42578c22f6 100644 --- a/lib/modules/Audio.pmod/Format.pmod/MP3.pike +++ b/lib/modules/Audio.pmod/Format.pmod/MP3.pike @@ -1,6 +1,6 @@ #pike __REAL_VERSION__ -// $Id: MP3.pike,v 1.3 2008/01/05 22:16:57 grubba Exp $ +// $Id: MP3.pike,v 1.4 2008/06/28 16:36:53 nilsson Exp $ // MP3 file parser/formatter // @@ -54,14 +54,14 @@ } } - static array(array(int)) bitrates_map = + protected array(array(int)) bitrates_map = ({ ({0,32,64,96,128,160,192,224,256,288,320,352,384,416,448}), ({0,32,48,56,64,80,96,112,128,160,192,224,256,320,384}), ({0,32,40,48,56,64,80,96,112,128,160,192,224,256,320}), }); - static array(string) channels_map = + protected array(string) channels_map = ({ "stereo", "joint", "dual", "single" }); string|int get_data(int maxlen) { @@ -229,3 +229,4 @@ return res; } + diff --git a/lib/modules/Cache.pmod/Storage.pmod/Gdbm.pike b/lib/modules/Cache.pmod/Storage.pmod/Gdbm.pike index ab4bc550896ee05b94f3267132717fd63e381695..fe10d32a7dcad1a46d73e059b741edfa9cd7c0e2 100644 --- a/lib/modules/Cache.pmod/Storage.pmod/Gdbm.pike +++ b/lib/modules/Cache.pmod/Storage.pmod/Gdbm.pike @@ -2,7 +2,7 @@ * A GBM-based storage manager. * by Francesco Chemolli <kinkie@roxen.com> * - * $Id: Gdbm.pike,v 1.11 2004/04/17 10:54:43 grubba Exp $ + * $Id: Gdbm.pike,v 1.12 2008/06/28 16:36:53 nilsson Exp $ * * This storage manager provides the means to save data to memory. * In this manager I'll add reference documentation as comments to @@ -54,7 +54,7 @@ class Data { sync(); } - static void create(string key, Gdbm.gdbm data_db, + protected void create(string key, Gdbm.gdbm data_db, Gdbm.gdbm metadata_db, string dumped_metadata) { mapping m=decode_value(dumped_metadata); _key=key; diff --git a/lib/modules/Cache.pmod/cache.pike b/lib/modules/Cache.pmod/cache.pike index 847cd41ed8638cd268835df8330419fed6c04b28..a9f7e529740b5cf7fb929182b42a5ea04accc6d4 100644 --- a/lib/modules/Cache.pmod/cache.pike +++ b/lib/modules/Cache.pmod/cache.pike @@ -2,7 +2,7 @@ * A generic cache front-end * by Francesco Chemolli <kinkie@roxen.com> * - * $Id: cache.pike,v 1.13 2006/03/17 15:09:56 grubba Exp $ + * $Id: cache.pike,v 1.14 2008/06/28 16:36:53 nilsson Exp $ * */ @@ -23,8 +23,8 @@ private int cleanup_cycle=DEFAULT_CLEANUP_CYCLE; -static object(Cache.Storage.Base) storage; -static object(Cache.Policy.Base) policy; +protected object(Cache.Storage.Base) storage; +protected object(Cache.Policy.Base) policy; // TODO: check that Storage Managers return the appropriate zero_type //! Looks in the cache for an element with the given key and, if available, @@ -146,9 +146,9 @@ private void do_cleanup(function expiry_function, object storage) { } #if constant(thread_create) -static Thread.Thread cleanup_thread; +protected Thread.Thread cleanup_thread; -static void destroy() +protected void destroy() { if (Thread.Thread t = cleanup_thread) { cleanup_thread = 0; diff --git a/lib/modules/Calendar.pmod/Austrian.pmod b/lib/modules/Calendar.pmod/Austrian.pmod index ec3cbb155e2bcdc1c55d878fe4db5e1d72e28935..6fe1cc84ddbd98b881d0fb1c2038b94365498442 100644 --- a/lib/modules/Calendar.pmod/Austrian.pmod +++ b/lib/modules/Calendar.pmod/Austrian.pmod @@ -8,7 +8,7 @@ inherit Calendar.ISO; -private static mixed __initstuff=lambda() +private protected mixed __initstuff=lambda() { default_rules=default_rules->set_language("austrian"); }(); diff --git a/lib/modules/Calendar.pmod/Badi.pmod b/lib/modules/Calendar.pmod/Badi.pmod index 2c8e7e2b2f2043a11e405fcffb46003eda56922a..ba1b66c0f7d12fc37444810b0842577cf856fe01 100644 --- a/lib/modules/Calendar.pmod/Badi.pmod +++ b/lib/modules/Calendar.pmod/Badi.pmod @@ -9,7 +9,7 @@ inherit Calendar.YMD:YMD; string calendar_name() { return "Badi"; } -private static mixed __initstuff=lambda() +private protected mixed __initstuff=lambda() { f_week_day_shortname_from_number="badi_week_day_shortname_from_number"; f_week_day_name_from_number="badi_week_day_name_from_number"; @@ -26,7 +26,7 @@ private static mixed __initstuff=lambda() "current_century":0, "past_century":0 ]); }(); -static int year_leap_year(int y) +protected int year_leap_year(int y) { // the beginning of the year is the day of the spring equinox // leap years are those where an extra day is needed to get up to the next @@ -39,7 +39,7 @@ static int year_leap_year(int y) } // [y,yjd] -static array year_from_julian_day(int jd) +protected array year_from_julian_day(int jd) { // in order to avoid coming up with a formula for leapyears in the bahai // calendar we add the necessary offsets to the data so we can use the take @@ -59,7 +59,7 @@ static array year_from_julian_day(int jd) }); } -static int julian_day_from_year(int y) +protected int julian_day_from_year(int y) { // FIXME: verify for leapyears (esp: 56 (1900) and 100, ...) // same as above @@ -68,14 +68,14 @@ static int julian_day_from_year(int y) return 1721426-286+y*365+y/4-y/100+y/400; } -static int compat_week_day(int n) +protected int compat_week_day(int n) { // this is specific to the gregorian calendar. // we just stick with the value as it is return n; } -static array(int) year_month_from_month(int y,int m) +protected array(int) year_month_from_month(int y,int m) { // [y,m,ndays,myd] @@ -92,7 +92,7 @@ static array(int) year_month_from_month(int y,int m) error("Month out of range.\n"); } -static array(int) month_from_yday(int y,int yd) +protected array(int) month_from_yday(int y,int yd) { // [month,day-of-month,ndays,month-year-day] if (yd<1) @@ -110,7 +110,7 @@ static array(int) month_from_yday(int y,int yd) error("yday out of range.\n"); } -static array(int) week_from_julian_day(int jd) +protected array(int) week_from_julian_day(int jd) { // [year,week,day-of-week,ndays,week-julian-day] @@ -143,7 +143,7 @@ static array(int) week_from_julian_day(int jd) return ({y,w,1+(1+yjd+yday)%7,7,wjd}); } -static array(int) week_from_week(int y,int w) +protected array(int) week_from_week(int y,int w) { // [year,week,1 (wd),ndays,week-julian-day] @@ -160,7 +160,7 @@ static array(int) week_from_week(int y,int w) } // identical to gregorian -static int year_remaining_days(int y,int yday) +protected int year_remaining_days(int y,int yday) { return 365+year_leap_year(y)-yday; } @@ -184,7 +184,7 @@ class cFraction return base; } - static void make_local() + protected void make_local() { ::make_local(); ls+=daystart_offset(); @@ -202,7 +202,7 @@ class cSecond return base; } - static void make_local() + protected void make_local() { ::make_local(); ls+=daystart_offset(); @@ -220,7 +220,7 @@ class cMinute return base; } - static void make_local() + protected void make_local() { ::make_local(); ls+=daystart_offset(); @@ -251,7 +251,7 @@ class cHour return base; } - static void make_local() + protected void make_local() { ::make_local(); ls+=daystart_offset(); @@ -324,7 +324,7 @@ class cWeek inherit YMD::cWeek; // identical to gregorian - static int weeks_to_week(int y2,int w2) + protected int weeks_to_week(int y2,int w2) { [int y3,int w3,int wd2,int nd2,int jd2]=week_from_week(y2,w2); werror("%t: %O, %O, %O, %O, %O\n", this, y2, w2, jd2, jd, (jd2-jd)/7); @@ -346,7 +346,7 @@ class cMonth { inherit YMD::cMonth; - static int months_to_month(int y2,int m2) + protected int months_to_month(int y2,int m2) { return (y2-y)*19+(m2-m); } @@ -482,7 +482,7 @@ class Vahid int v; // vahid int vjd; // julian day of the first day of the vahid - static void create(mixed ...args) + protected void create(mixed ...args) { if (!sizeof(args)) { diff --git a/lib/modules/Calendar.pmod/Coptic.pmod b/lib/modules/Calendar.pmod/Coptic.pmod index c6375afe1c0e6c1f9763365f2807e1dc29de56f3..67ad2f2f9df2bc61e690bb72edde1ad2483d5330 100644 --- a/lib/modules/Calendar.pmod/Coptic.pmod +++ b/lib/modules/Calendar.pmod/Coptic.pmod @@ -20,7 +20,7 @@ inherit Calendar.Gregorian:Gregorian; string calendar_name() { return "Coptic"; } -private static mixed __initstuff=lambda() +private protected mixed __initstuff=lambda() { f_week_day_shortname_from_number="gregorian_week_day_shortname_from_number"; f_week_day_name_from_number="gregorian_week_day_name_from_number"; @@ -33,10 +33,10 @@ private static mixed __initstuff=lambda() f_week_name_from_number="week_name_from_number"; }(); -static constant year_offset=-284; -static constant start=1720949; +protected constant year_offset=-284; +protected constant start=1720949; -static array year_from_julian_day(int jd) +protected array year_from_julian_day(int jd) { int d=jd-start; @@ -52,20 +52,20 @@ static array year_from_julian_day(int jd) }); } -static int julian_day_from_year(int y) +protected int julian_day_from_year(int y) { y-=year_offset; return start+y*365+y/4-y/100+y/400; } -static int year_leap_year(int y) +protected int year_leap_year(int y) { y-=year_offset; werror("%O\n",y); return (!(((y)%4) || (!((y)%100) && ((y)%400)))); } -static array(int) year_month_from_month(int y,int m) +protected array(int) year_month_from_month(int y,int m) { // [y,m,ndays,myd] @@ -75,7 +75,7 @@ static array(int) year_month_from_month(int y,int m) return ({y,m,m==13?year_leap_year(y)+5:30,1+30*(m-1)}); } -static array(int) month_from_yday(int y,int yd) +protected array(int) month_from_yday(int y,int yd) { // [month,day-of-month,ndays,month-year-day] int m=(yd-1)/30+1; diff --git a/lib/modules/Calendar.pmod/Discordian.pmod b/lib/modules/Calendar.pmod/Discordian.pmod index d82574bc4afd56a7476c26d9d5f0d2e300072181..8a0b4d8d2f2bf44129141ec8f1256e70c6b8b849 100644 --- a/lib/modules/Calendar.pmod/Discordian.pmod +++ b/lib/modules/Calendar.pmod/Discordian.pmod @@ -29,7 +29,7 @@ inherit Calendar.Gregorian:Gregorian; string calendar_name() { return "Discordian"; } -private static mixed __initstuff=lambda() +private protected mixed __initstuff=lambda() { // language setup f_week_day_shortname_from_number= @@ -43,29 +43,29 @@ private static mixed __initstuff=lambda() f_week_day_number_from_name="discordian_week_day_number_from_name"; }(); -static int compat_week_day(int n) +protected int compat_week_day(int n) { return n; // N/A } // almost as gregorian -static array year_from_julian_day(int jd) +protected array year_from_julian_day(int jd) { array a=::year_from_julian_day(jd); return ({a[0]+1166,a[1]}); } -static int julian_day_from_year(int y) +protected int julian_day_from_year(int y) { return ::julian_day_from_year(y-1166); } -static int year_leap_year(int y) +protected int year_leap_year(int y) { return ::year_leap_year(y-1166); } -static array(int) year_month_from_month(int y,int m) +protected array(int) year_month_from_month(int y,int m) { // [y,m,ndays,myd] @@ -81,7 +81,7 @@ static array(int) year_month_from_month(int y,int m) error("month out of range\n"); } -static array(int) month_from_yday(int y,int yd) +protected array(int) month_from_yday(int y,int yd) { // [month,day-of-month,ndays,month-year-day] int l=year_leap_year(y); @@ -92,7 +92,7 @@ static array(int) month_from_yday(int y,int yd) return ({m,yd-(m-1)*73,73,(m-1)*73+l+1}); } -static array(int) week_from_julian_day(int jd) +protected array(int) week_from_julian_day(int jd) { // [year,week,day-of-week,ndays,week-julian-day] @@ -114,7 +114,7 @@ static array(int) week_from_julian_day(int jd) return ({y,w,(yday-1)%5+1,5,yjd+(w-1)*5+l}); } -static array(int) week_from_week(int y,int w) +protected array(int) week_from_week(int y,int w) { // [year,week,1 (wd),ndays,week-julian-day] y+=(w-1)/73; @@ -126,7 +126,7 @@ static array(int) week_from_week(int y,int w) return week_from_julian_day(yjd+(w-1)*5+(l&&w>12)); } -static int year_remaining_days(int y,int yday) +protected int year_remaining_days(int y,int yday) { return 365+year_leap_year(y)-yday; } @@ -237,7 +237,7 @@ class cWeek { inherit Gregorian::cWeek; - static int weeks_to_week(int y2,int w2) + protected int weeks_to_week(int y2,int w2) { return (y2-y)*73+w2-w; } diff --git a/lib/modules/Calendar.pmod/Event.pmod b/lib/modules/Calendar.pmod/Event.pmod index 31e33c78dbcaf58140971d97d7f9d31a5741fe78..e01ba11e42b3f48c6fc91081349f14e9267969ca 100644 --- a/lib/modules/Calendar.pmod/Event.pmod +++ b/lib/modules/Calendar.pmod/Event.pmod @@ -1,15 +1,15 @@ #pike __REAL_VERSION__ -static constant M_YD=({0,0,31,59,90,120,151,181,212,243,273,304,334}); -static constant M_ED=({({0,31,59,90,120,151,181,212,243,273,304,334,365}), +protected constant M_YD=({0,0,31,59,90,120,151,181,212,243,273,304,334}); +protected constant M_ED=({({0,31,59,90,120,151,181,212,243,273,304,334,365}), ({0,31,60,91,121,152,182,213,244,274,305,335,366}), ({0,31,60,90,120,151,181,212,243,273,304,334,365}) }); -static constant M_NAME="---JanFebMarAprMayJunJulAugSepOctNovDec"/3; -static constant WD_NAME="---MonTueWedThuFriSatSun"/3; +protected constant M_NAME="---JanFebMarAprMayJunJulAugSepOctNovDec"/3; +protected constant WD_NAME="---MonTueWedThuFriSatSun"/3; -static function(mixed...:Calendar.TimeRanges.TimeRange) std_day= +protected function(mixed...:Calendar.TimeRanges.TimeRange) std_day= Calendar.Day; -static function(mixed...:Calendar.TimeRanges.TimeRange) std_second= +protected function(mixed...:Calendar.TimeRanges.TimeRange) std_second= Calendar.Second; // ---------------------------------------------------------------- @@ -322,7 +322,7 @@ class Namedays return indices(namedays(in)); } - static Calendar.TimeRanges.TimeRange _find(Calendar.TimeRanges.TimeRange t, + protected Calendar.TimeRanges.TimeRange _find(Calendar.TimeRanges.TimeRange t, int including, int direction) { int jd=(int)t->julian_day(); @@ -498,7 +498,7 @@ class SuperNamedays // simple Gregorian date events // ---------------------------------------------------------------- -static array gregorian_yjd(int jd) +protected array gregorian_yjd(int jd) { int d=jd-1721426; @@ -517,7 +517,7 @@ static array gregorian_yjd(int jd) }); } -static array gregorian_year(int y) +protected array gregorian_year(int y) { return ({ @@ -527,7 +527,7 @@ static array gregorian_year(int y) }); } -static array julian_yjd(int jd) +protected array julian_yjd(int jd) { int d=jd-1721058; @@ -544,7 +544,7 @@ static array julian_yjd(int jd) }); } -static array julian_year(int y) +protected array julian_year(int y) { return ({ @@ -871,7 +871,7 @@ class Easter if (_shift) shift=_shift; } - static int new_style(int y) + protected int new_style(int y) { int century=y/100; int solar=century-century/4; @@ -891,7 +891,7 @@ class Easter return full_moon+7-week_day; } - static int old_style(int y) + protected int old_style(int y) { #if 1 int new_moon=23-11*(y%19); @@ -918,7 +918,7 @@ class Easter return `+(yjd,z,58,leap); } - static array(int) my_year(int y) + protected array(int) my_year(int y) { if (y<shift) return julian_year(y); return gregorian_year(y); @@ -1093,7 +1093,7 @@ class SuperEvent array(Event) other_events=({}); - static void create(array(Event) _events, + protected void create(array(Event) _events, void|mapping(Event:multiset(string)) _flags, void|string _id) { @@ -1274,7 +1274,7 @@ class TZShift_Event } //! - static Calendar.TimeRanges.TimeRange + protected Calendar.TimeRanges.TimeRange scan_shift(Calendar.Rule.Timezone tz, Calendar.TimeRanges.TimeRange from, int direction,int including) @@ -1285,7 +1285,7 @@ class TZShift_Event } //! - static Calendar.TimeRanges.TimeRange + protected Calendar.TimeRanges.TimeRange scan_history(Calendar.Rule.Timezone tz, Calendar.TimeRanges.TimeRange from, int direction,int(0..1) including) @@ -1334,7 +1334,7 @@ class TZShift_Event } //! - static Calendar.TimeRanges.TimeRange + protected Calendar.TimeRanges.TimeRange scan_rule(Calendar.Rule.Timezone tz, Calendar.TimeRanges.TimeRange from, int direction,int including) diff --git a/lib/modules/Calendar.pmod/Gregorian.pmod b/lib/modules/Calendar.pmod/Gregorian.pmod index f3d1068daf84f91d2767a27ff63a2be0eda9a778..7dc1fbb314f23a3ec6f41a3537b79194a0834d7a 100644 --- a/lib/modules/Calendar.pmod/Gregorian.pmod +++ b/lib/modules/Calendar.pmod/Gregorian.pmod @@ -11,7 +11,7 @@ inherit Calendar.YMD:YMD; string calendar_name() { return "Gregorian"; } -private static mixed __initstuff=lambda() +private protected mixed __initstuff=lambda() { f_week_day_shortname_from_number="gregorian_week_day_shortname_from_number"; f_week_day_name_from_number="gregorian_week_day_name_from_number"; @@ -26,13 +26,13 @@ private static mixed __initstuff=lambda() f_year_number_from_name="year_number_from_name"; }(); -static int(0..1) year_leap_year(int y) +protected int(0..1) year_leap_year(int y) { return (!(((y)%4) || (!((y)%100) && ((y)%400)))); } // [y,yjd] -static array(int) year_from_julian_day(int jd) +protected array(int) year_from_julian_day(int jd) { int d=jd-1721426; @@ -48,18 +48,18 @@ static array(int) year_from_julian_day(int jd) }); } -static int julian_day_from_year(int y) +protected int julian_day_from_year(int y) { y--; return 1721426+y*365+y/4-y/100+y/400; } -static int compat_week_day(int n) +protected int compat_week_day(int n) { return n-1; } -static array(int) year_month_from_month(int y,int m) +protected array(int) year_month_from_month(int y,int m) { // [y,m,ndays,myd] @@ -85,7 +85,7 @@ static array(int) year_month_from_month(int y,int m) error("Month out of range.\n"); } -static array(int) month_from_yday(int y,int yd) +protected array(int) month_from_yday(int y,int yd) { // [month,day-of-month,ndays,month-year-day] if (yd >= 1) { @@ -110,7 +110,7 @@ static array(int) month_from_yday(int y,int yd) error("yday out of range.\n"); } -static array(int) week_from_julian_day(int jd) +protected array(int) week_from_julian_day(int jd) { // [year,week,day-of-week,ndays,week-julian-day] @@ -139,7 +139,7 @@ static array(int) week_from_julian_day(int jd) return ({y,w,1+(yjd+yday)%7,7,wjd}); } -static array(int) week_from_week(int y,int w) +protected array(int) week_from_week(int y,int w) { // [year,week,1 (wd),ndays,week-julian-day] @@ -153,7 +153,7 @@ static array(int) week_from_week(int y,int w) // fixme } -static int year_remaining_days(int y,int yday) +protected int year_remaining_days(int y,int yday) { return 365+year_leap_year(y)-yday; } @@ -237,7 +237,7 @@ class cMonth // a Gregorian Month can autopromote to a year - static int months_to_month(int y2,int m2) + protected int months_to_month(int y2,int m2) { return (y2-y)*12+(m2-m); } @@ -290,7 +290,7 @@ class cWeek return "error"; } - static int weeks_to_week(int y2,int w2) + protected int weeks_to_week(int y2,int w2) { [int y3,int w3,int wd2,int nd2,int jd2]=week_from_week(y2,w2); return (jd2-jd)/7; diff --git a/lib/modules/Calendar.pmod/ISO.pmod b/lib/modules/Calendar.pmod/ISO.pmod index eefa41a9641af3be388df35f8893a298c12323c2..8f95dd5838af071aa5e2b035b013c51fd7b4eedb 100644 --- a/lib/modules/Calendar.pmod/ISO.pmod +++ b/lib/modules/Calendar.pmod/ISO.pmod @@ -12,7 +12,7 @@ string calendar_name() { return "ISO"; } #define WEEK_MAJORITY 4 -private static mixed __initstuff=lambda() +private protected mixed __initstuff=lambda() { f_week_day_shortname_from_number="week_day_shortname_from_number"; f_week_day_name_from_number="week_day_name_from_number"; @@ -20,18 +20,18 @@ private static mixed __initstuff=lambda() f_week_day_number_from_name="week_day_number_from_name"; }(); -static int compat_week_day(int n) +protected int compat_week_day(int n) { return n%7; } -static string year_name_from_number(int y) +protected string year_name_from_number(int y) { if (y>0) return ""+y; else return (1-y)+" BC"; } -static array(int) week_from_julian_day(int jd) +protected array(int) week_from_julian_day(int jd) { // [week-year,week,day-of-week,ndays,week-julian-day] @@ -85,7 +85,7 @@ static array(int) week_from_julian_day(int jd) return ({y,w,1+(yjd+yday-1)%7,7,wjd}); } -static array(int) week_from_week(int y,int w) +protected array(int) week_from_week(int y,int w) { // [week-year,week,1 (wd),ndays,week-julian-day] diff --git a/lib/modules/Calendar.pmod/Islamic.pmod b/lib/modules/Calendar.pmod/Islamic.pmod index 96dc660af4932ca67c89852b3e2469c99f95d4c0..2ddbb79629dad94922ec3c862883f3439890fb4e 100644 --- a/lib/modules/Calendar.pmod/Islamic.pmod +++ b/lib/modules/Calendar.pmod/Islamic.pmod @@ -26,7 +26,7 @@ inherit Calendar.YMD:YMD; string calendar_name() { return "Islamic"; } -private static mixed __initstuff=lambda() +private protected mixed __initstuff=lambda() { f_week_day_shortname_from_number="islamic_week_day_shortname_from_number"; f_week_day_name_from_number="islamic_week_day_name_from_number"; @@ -63,7 +63,7 @@ array(int) year_from_julian_day(int jd) (y-1)*354 + (11*y+3)/30 + 1948440}); } -static array(int) year_month_from_month(int y,int m) +protected array(int) year_month_from_month(int y,int m) { // [y,m,ndays,myd] @@ -89,7 +89,7 @@ static array(int) year_month_from_month(int y,int m) error("Month out of range.\n"); } -static array(int) month_from_yday(int y,int yd) +protected array(int) month_from_yday(int y,int yd) { // [month,day-of-month,ndays,month-year-day] int l=year_leap_year(y); @@ -113,7 +113,7 @@ static array(int) month_from_yday(int y,int yd) error("yday out of range.\n"); } -static array(int) week_from_julian_day(int jd) +protected array(int) week_from_julian_day(int jd) { // [year,week,day-of-week,ndays,week-julian-day] @@ -129,7 +129,7 @@ static array(int) week_from_julian_day(int jd) return ({y,w,1+(yjd+yday)%7,7,wjd}); } -static array(int) week_from_week(int y,int w) +protected array(int) week_from_week(int y,int w) { // [year,week,1 (wd),ndays,week-julian-day] @@ -141,12 +141,12 @@ static array(int) week_from_week(int y,int w) return ({y,w,1,7,wjd+w*7}); } -static int compat_week_day(int n) +protected int compat_week_day(int n) { return n%7; } -static int year_remaining_days(int y,int yday) +protected int year_remaining_days(int y,int yday) { return 354+year_leap_year(y)-yday; } @@ -214,7 +214,7 @@ class cMonth { inherit YMD::cMonth; - static int months_to_month(int y2,int m2) + protected int months_to_month(int y2,int m2) { return (y2-y)*12+(m2-m); } @@ -224,7 +224,7 @@ class cWeek { inherit YMD::cWeek; - static int weeks_to_week(int y2,int w2) + protected int weeks_to_week(int y2,int w2) { [int y3,int w3,int wd2,int nd2,int jd2]=week_from_week(y2,w2); return (jd2-jd)/7; diff --git a/lib/modules/Calendar.pmod/Julian.pmod b/lib/modules/Calendar.pmod/Julian.pmod index 97dcefdb66ad5e43c7cac88af29e77b5829fc59f..868faa019d9d30d0fc29102f0e8a34a30cc3fcbc 100644 --- a/lib/modules/Calendar.pmod/Julian.pmod +++ b/lib/modules/Calendar.pmod/Julian.pmod @@ -16,13 +16,13 @@ inherit Calendar.Gregorian:Gregorian; string calendar_name() { return "Julian"; } -static int year_leap_year(int y) +protected int year_leap_year(int y) { return !((y)%4); } // [y,yjd] -static array year_from_julian_day(int jd) +protected array year_from_julian_day(int jd) { int d=jd-1721058; @@ -36,7 +36,7 @@ static array year_from_julian_day(int jd) }); } -static int julian_day_from_year(int y) +protected int julian_day_from_year(int y) { y--; return 1721424+y*365+y/4; diff --git a/lib/modules/Calendar.pmod/Language.pmod b/lib/modules/Calendar.pmod/Language.pmod index e0fcf0092f8ee13db12272557ac3dfc8eca24ecd..1bdfdb6170710b668f774fd83a299e37ecb04946 100644 --- a/lib/modules/Calendar.pmod/Language.pmod +++ b/lib/modules/Calendar.pmod/Language.pmod @@ -1,17 +1,17 @@ #pike __REAL_VERSION__ -static string flat(string s) +protected string flat(string s) { return replace(lower_case(s), "�������������������������������'- "/1, "aaaaaaeceeeeiiiidnoooooouuuuyty"/1+({""})*3); } -static class _language_base +protected class _language_base { inherit Calendar.Rule.Language; - static mapping events_translate=0; + protected mapping events_translate=0; string translate_event(string name) { @@ -20,7 +20,7 @@ static class _language_base } } -static string roman_number(int m) +protected string roman_number(int m) { if (m<0) return "["+m+"]"; if (m==0) return "O"; @@ -28,16 +28,16 @@ static string roman_number(int m) return String.int2roman(m); } -static class _ymd_base +protected class _ymd_base { inherit _language_base; - static mapping(int:string) month_n2s; - static mapping(int:string) month_n2ss; - static mapping(string:int) month_s2n; - static mapping(int:string) week_day_n2s; - static mapping(int:string) week_day_n2ss; - static mapping(string:int) week_day_s2n; + protected mapping(int:string) month_n2s; + protected mapping(int:string) month_n2ss; + protected mapping(string:int) month_s2n; + protected mapping(int:string) week_day_n2s; + protected mapping(int:string) week_day_n2ss; + protected mapping(string:int) week_day_s2n; string month_name_from_number(int n) { @@ -542,15 +542,15 @@ class cSWEDISH { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({"januari","februari","mars","april","maj","juni","juli","augusti", "september","oktober","november","december"}); - static private constant week_day_names= + protected private constant week_day_names= ({"m�ndag","tisdag","onsdag","torsdag", "fredag","l�rdag","s�ndag"}); - static mapping events_translate= + protected mapping events_translate= ([ "New Year's Day": "Ny�rsdagen", "Epiphany": "Trettondag jul", @@ -640,11 +640,11 @@ class cAUSTRIAN { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({"j�nner","feber","m�rz","april","mai","juni","juli","august", "september","oktober","november","dezember"}); - static private constant week_day_names= + protected private constant week_day_names= ({"montag","dienstag","mittwoch","donnerstag", "freitag","samstag","sonntag"}); @@ -663,11 +663,11 @@ class cWELSH { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({"ionawr","chwefror","mawrth","ebrill","mai","mehefin", "gorffenaf","awst","medi","hydref","tachwedd","rhagfyr"}); - static private constant week_day_names= + protected private constant week_day_names= ({"Llun","Mawrth","Mercher","Iau","Gwener","Sadwrn","Sul"}); string week_day_name_from_number(int n) @@ -696,16 +696,16 @@ class cSPANISH { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({"enero","febrero","marzo","abril","mayo","junio", "julio","agosto","setiembre","octubre","noviembre","diciembre"}); - static private constant week_day_names= + protected private constant week_day_names= ({"lunes","martes","mi�rcoles","jueves", "viernes","s�bado","domingo"}); // contains argentina for now - static mapping events_translate= + protected mapping events_translate= ([ "Epiphany":"D�a de Reyes", // Epifania "Malvinas Day":"D�a de las Malvinas", @@ -743,7 +743,7 @@ class cPORTUGESE { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "Janeiro", "Fevereiro", @@ -759,7 +759,7 @@ class cPORTUGESE "Dezembro", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "Segunda-feira", // -feira is removed for the short version "Ter�a-feira", // don't know how it's used @@ -771,7 +771,7 @@ class cPORTUGESE }); // contains argentina for now - static mapping events_translate= + protected mapping events_translate= ([ "New Year's Day":"Ano Novo", "Good Friday":"Sexta-Feira Santa", @@ -802,15 +802,15 @@ class cHUNGARIAN { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({"Janu�r","Febru�r","M�rcius","�prilis","M�jus","J�nius", "J�lius","August","September","October","November","December"}); - static private constant week_day_names= + protected private constant week_day_names= ({"H�tfo","Kedd","Szerda","Cs�t�rtk�k","P�ntek","Szombat","Vas�rnap"}); // contains argentina for now - static mapping events_translate= + protected mapping events_translate= ([ "New Year's Day":"�b �v �nnepe", "1848 Revolution Day":"Az 'Az 1848-as Forradalom Napja", @@ -839,11 +839,11 @@ class cLATIN { inherit _ymd_base; - static array(string) month_names= + protected array(string) month_names= ({"Ianuarius", "Februarius", "Martius", "Aprilis", "Maius", "Iunius", "Iulius", "Augustus", "September", "October", "November", "December" }); - static private constant week_day_names= + protected private constant week_day_names= ({"lunae","Martis","Mercurii","Jovis","Veneris","Saturni","solis"}); string week_day_name_from_number(int n) @@ -881,7 +881,7 @@ class cROMAN { inherit cLATIN; - static array(string) month_names= + protected array(string) month_names= ({"Ianuarius", "Februarius", "Martius", "Aprilis", "Maius", "Iunius", "Quintilis", // Iulius "Sextilis", // Augustus @@ -918,7 +918,7 @@ class cGREENLANDIC { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "januari", "februari", @@ -934,7 +934,7 @@ class cGREENLANDIC "decemberi", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "ataasinngorneq", "marlunngorneq", @@ -957,7 +957,7 @@ class cICELANDIC { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "Januar", "Februar", @@ -973,7 +973,7 @@ class cICELANDIC "Desember", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "Manudagur", "Tridjudagur", @@ -996,7 +996,7 @@ class cPERSIAN { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "zanwyh", // <zj><a+><n+><w+><yf><h+> "fwrwyh", // <f+><w+><r+><w+><yf><h+> @@ -1012,7 +1012,7 @@ class cPERSIAN "dsambr", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "dwsnbh", "shzsnbh", @@ -1035,7 +1035,7 @@ class cAFRIKAANS { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "Januarie", "Februarie", @@ -1051,7 +1051,7 @@ class cAFRIKAANS "Desember", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "Maandag", "Dinsdag", @@ -1074,7 +1074,7 @@ class cIRISH { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "Ean�ir", "Feabhra", @@ -1090,12 +1090,12 @@ class cIRISH "M� na Nollag", }); - static private constant short_month_names= + protected private constant short_month_names= ({ "Ean","Fea","M�r","Aib","Bea","Mei","I�i","L�n","MF�","DF�","Sam","Nol" }); - static private constant week_day_names= + protected private constant week_day_names= ({ "D� Luain", "D� M�irt", @@ -1106,7 +1106,7 @@ class cIRISH "D� Domhnaigh", }); - static private constant short_week_day_names= + protected private constant short_week_day_names= ({ "Lua","Mai","C�a","D�a","Aoi","Sat", "Dom", }); @@ -1123,7 +1123,7 @@ class cBASQUE { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "urtarrila", "otsaila", @@ -1139,7 +1139,7 @@ class cBASQUE "abendua", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "astelehena", "asteartea", @@ -1162,7 +1162,7 @@ class cNORWEGIAN { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "januar", "februar", @@ -1178,7 +1178,7 @@ class cNORWEGIAN "desember", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "mandag", "tirsdag", @@ -1203,7 +1203,7 @@ class cDUTCH { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "januari", "februari", @@ -1219,7 +1219,7 @@ class cDUTCH "december", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "maandag", "dinsdag", @@ -1242,7 +1242,7 @@ class cPOLISH { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "styczen", // <s><t><y><c><z><e><n'> "luty", @@ -1258,7 +1258,7 @@ class cPOLISH "grudzien", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "poniedzialek", // <p><o><n><i><e><d><z><i><a><l/><e><k> "wtorek", @@ -1276,7 +1276,7 @@ class cPOLISH_UNICODE { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "stycze\x0143", // <s><t><y><c><z><e><n'> "luty", @@ -1292,7 +1292,7 @@ class cPOLISH_UNICODE "grudzien", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "poniedzia\x0142""ek", // <p><o><n><i><e><d><z><i><a><l/><e><k> "wtorek", @@ -1315,7 +1315,7 @@ class cTURKISH { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "Ocak", "Subat", @@ -1331,7 +1331,7 @@ class cTURKISH "Aralik", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "Pazartesi", "Sali", // <S><a><l><i.> @@ -1351,7 +1351,7 @@ class cTURKISH_UNICODE { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "Ocak", "\015e""ubat", // S-cedilla @@ -1367,7 +1367,7 @@ class cTURKISH_UNICODE "Aral\x0131""k", // i-no-dot }); - static private constant week_day_names= + protected private constant week_day_names= ({ "Pazartesi", "Sal\x0131", // <S><a><l><i.> i without dot @@ -1391,7 +1391,7 @@ class cGERMAN { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "Januar", "Februar", @@ -1407,7 +1407,7 @@ class cGERMAN "Dezember", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "Montag", "Dienstag", @@ -1430,7 +1430,7 @@ class cLATVIAN { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "janvaris", // <j><a><n><v><a-><r><i><s> "februaris", @@ -1446,7 +1446,7 @@ class cLATVIAN "decembris", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "pirmdiena", "otrdiena", @@ -1466,7 +1466,7 @@ class cLATVIAN_UNICODE { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "janv\x0101""ris", // <j><a><n><v><a-><r><i><s> "februaris", @@ -1482,7 +1482,7 @@ class cLATVIAN_UNICODE "decembris", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "pirmdiena", "otrdiena", @@ -1505,7 +1505,7 @@ class cFINNISH { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "tammikuu", "helmikuu", @@ -1521,7 +1521,7 @@ class cFINNISH "joulukuu", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "maanantai", "tiistai", @@ -1544,7 +1544,7 @@ class cLITHUANIAN { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "sausio", "vasario", @@ -1560,7 +1560,7 @@ class cLITHUANIAN "gruodzio", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "Pirmadienis", "Antradienis", @@ -1578,7 +1578,7 @@ class cLITHUANIAN_UNICODE { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "sausio", "vasario", @@ -1594,7 +1594,7 @@ class cLITHUANIAN_UNICODE "gruodzio", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "Pirmadienis", "Antradienis", @@ -1617,7 +1617,7 @@ class cESTONIAN { inherit _ymd_base; - static constant month_names= + protected constant month_names= ({ "jaanuar", "veebruar", @@ -1633,7 +1633,7 @@ class cESTONIAN "detsember", }); - static constant week_day_names= + protected constant week_day_names= ({ "esmasp�ev", "teisip�ev", @@ -1653,7 +1653,7 @@ class cGALICIAN { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "Xaneiro", "Febreiro", @@ -1669,7 +1669,7 @@ class cGALICIAN "Decembro", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "Luns", "Martes", @@ -1688,7 +1688,7 @@ class cINDONESIAN { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "Januari", "Pebruari", @@ -1704,7 +1704,7 @@ class cINDONESIAN "Desember", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "Senin", "Selasa", @@ -1724,7 +1724,7 @@ class cFRENCH { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "janvier", "f�vrier", @@ -1740,7 +1740,7 @@ class cFRENCH "d�cembre", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "lundi", "mardi", @@ -1760,7 +1760,7 @@ class cITALIAN { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "gennaio", "febbraio", @@ -1776,7 +1776,7 @@ class cITALIAN "dicembre", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "lunedi", // swizz italian: "luned�" - should I care? "martedi", @@ -1796,7 +1796,7 @@ class cCATALAN { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "gener", "febrer", @@ -1812,7 +1812,7 @@ class cCATALAN "decembre", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "dilluns", "dimarts", @@ -1832,7 +1832,7 @@ class cSLOVENIAN { inherit _ymd_base; - static constant month_names= + protected constant month_names= ({ "januar", "februar", @@ -1848,7 +1848,7 @@ class cSLOVENIAN "december", }); - static constant week_day_names= + protected constant week_day_names= ({ "ponedeljek", "torek", @@ -1866,7 +1866,7 @@ class cSLOVENIAN_UNICODE { inherit cSLOVENIAN; - static constant week_day_names= + protected constant week_day_names= ({ "ponedeljek", "torek", @@ -1886,7 +1886,7 @@ class cFAROESE { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "januar", "februar", @@ -1902,7 +1902,7 @@ class cFAROESE "desember", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "manadagur", "t�sdagur", @@ -1922,7 +1922,7 @@ class cROMANIAN { inherit _ymd_base; - static constant month_names= + protected constant month_names= ({ "Ianuarie", "Februarie", @@ -1938,7 +1938,7 @@ class cROMANIAN "Decembrie", }); - static constant week_day_names= + protected constant week_day_names= ({ "Luni", "Marti", // <M><A><R><T,><I> @@ -1956,7 +1956,7 @@ class cROMANIAN_UNICODE { inherit cROMANIAN; - static constant week_day_names= + protected constant week_day_names= ({ "Luni", "Mar\x0163""i", // <M><A><R><T,><I> @@ -1976,7 +1976,7 @@ class cCROATIAN { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "Sijecanj", // <S><i><j><e><c<><a><n><j> "Veljaca", // <V><e><l><j><a><c<><a> @@ -1992,7 +1992,7 @@ class cCROATIAN "Prosinac", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "Ponedjeljak", "Utorak", @@ -2010,7 +2010,7 @@ class cCROATIAN_UNICODE { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "Sije\415anj", "Velja\415a", @@ -2026,7 +2026,7 @@ class cCROATIAN_UNICODE "Prosinac", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "Ponedjeljak", "Utorak", @@ -2046,7 +2046,7 @@ class cDANISH { inherit _ymd_base; - static private constant month_names= + protected private constant month_names= ({ "januar", "februar", @@ -2062,7 +2062,7 @@ class cDANISH "december", }); - static private constant week_day_names= + protected private constant week_day_names= ({ "mandag", "tirsdag", @@ -2073,7 +2073,7 @@ class cDANISH "s�ndag", }); - static mapping events_translate= + protected mapping events_translate= ([ "2nd day of Christmas" :"2. juledag", "Ascension" :"Kristi himmelfart", @@ -2107,7 +2107,7 @@ class cSERBIAN { inherit _ymd_base; - static constant month_names= + protected constant month_names= ({ "januar", "februar", @@ -2123,7 +2123,7 @@ class cSERBIAN "decembar", }); - static constant week_day_names= + protected constant week_day_names= ({ "ponedeljak", "utorak", @@ -2142,7 +2142,7 @@ class cSERBIAN_UNICODE { inherit cSERBIAN; - static constant week_day_names= + protected constant week_day_names= ({ "ponedeljak", "utorak", @@ -2160,7 +2160,7 @@ class cSERBIAN_UNICODE // find & compile language -static mapping _cache=([]); +protected mapping _cache=([]); Calendar.Rule.Language `[](string lang) { @@ -2181,3 +2181,4 @@ Calendar.Rule.Language `[](string lang) } + diff --git a/lib/modules/Calendar.pmod/Rule.pmod b/lib/modules/Calendar.pmod/Rule.pmod index 1f77814d2bac26afdfb39ae90984e28c7ae0a749..a8182fc4de9b7a9bc574c02204ee63783b7eff39 100644 --- a/lib/modules/Calendar.pmod/Rule.pmod +++ b/lib/modules/Calendar.pmod/Rule.pmod @@ -6,7 +6,7 @@ class Timezone constant is_timezone=1; // seconds to utc, not counting DST - static int offset_to_utc; + protected int offset_to_utc; // timezone name string name; @@ -16,7 +16,7 @@ class Timezone //! Offset to UTC, not counting DST. //! @param name //! The name of the time zone. - static void create(int offset, string _name) + protected void create(int offset, string _name) { offset_to_utc=offset; name=_name; diff --git a/lib/modules/Calendar.pmod/Stardate.pmod b/lib/modules/Calendar.pmod/Stardate.pmod index 6ffa3ff24bd0b411516ef2257e3c609e833dc243..5d303b2523cf9c9e035937ea2da229a50506ce62 100644 --- a/lib/modules/Calendar.pmod/Stardate.pmod +++ b/lib/modules/Calendar.pmod/Stardate.pmod @@ -2,10 +2,10 @@ //! This implements TNG stardates. -static constant TNGSTARPERJULIAN=1000.0/365.2425; -static constant TNGSTARPERSECOND=TNGSTARPERJULIAN/86400; -static constant TNG0JULIAN=2569518.5; -static constant TNG0UNIX=11139552000; +protected constant TNGSTARPERJULIAN=1000.0/365.2425; +protected constant TNGSTARPERSECOND=TNGSTARPERJULIAN/86400; +protected constant TNG0JULIAN=2569518.5; +protected constant TNG0UNIX=11139552000; string calendar_name() { return "Stardate"; } @@ -73,19 +73,19 @@ class cTick ::create(@args); } - static void create_unixtime(int unixtime,int seconds) + protected void create_unixtime(int unixtime,int seconds) { t=(unixtime-TNG0UNIX)*TNGSTARPERSECOND; len=seconds*TNGSTARPERSECOND; } - static void create_unixtime_default(int unixtime) + protected void create_unixtime_default(int unixtime) { t=(unixtime-TNG0UNIX)*TNGSTARPERSECOND; len=0.0; } - static void create_julian_day(int|float jd) + protected void create_julian_day(int|float jd) { t=(jd-TNG0JULIAN)*TNGSTARPERJULIAN; len=0.0; @@ -129,7 +129,7 @@ class cTick return ((int)(t/TNGSTARPERJULIAN))+TNG0JULIAN; } - static Calendar.TimeRange _add(int n,void|this_program step) + protected Calendar.TimeRange _add(int n,void|this_program step) { float x; if (!step) @@ -147,7 +147,7 @@ class cTick return this; } - static void convert_from(Calendar.TimeRange other) + protected void convert_from(Calendar.TimeRange other) { if (other->unix_time) create_unixtime_default(other->unix_time()); @@ -166,7 +166,7 @@ class cTick len=0.0; } - static Calendar.TimeRange _set_size(int n, Calendar.TimeRange x) + protected Calendar.TimeRange _set_size(int n, Calendar.TimeRange x) { if (!x->is_stardate) error("distance: Incompatible type %O\n",x); diff --git a/lib/modules/Calendar.pmod/Swedish.pmod b/lib/modules/Calendar.pmod/Swedish.pmod index 24993ad857be6e93152fca77f82ad77741bba6c4..7eec4a3d4f4cd05145551c0d94aa01fdddf1500a 100644 --- a/lib/modules/Calendar.pmod/Swedish.pmod +++ b/lib/modules/Calendar.pmod/Swedish.pmod @@ -6,7 +6,7 @@ inherit Calendar.ISO:ISO; -private static mixed __initstuff=lambda() +private protected mixed __initstuff=lambda() { default_rules=default_rules->set_language("SE_sv"); }(); diff --git a/lib/modules/Calendar.pmod/TZnames.pmod b/lib/modules/Calendar.pmod/TZnames.pmod index ca4690c96e91fff27b6aba462916ca72b6d1916e..63e7325263ce18949cd838e89c8a523d345c456f 100644 --- a/lib/modules/Calendar.pmod/TZnames.pmod +++ b/lib/modules/Calendar.pmod/TZnames.pmod @@ -27,7 +27,7 @@ //! To convert the position to a Geography.Position, simply //! feed it to the constructor. -static string raw_zone_tab=0; +protected string raw_zone_tab=0; string _zone_tab() { return raw_zone_tab || @@ -35,7 +35,7 @@ string _zone_tab() combine_path(__FILE__,"..","tzdata/zone.tab")) - "\r")); } -static array(array(string)) parsed_zone_tab=0; +protected array(array(string)) parsed_zone_tab=0; array(array(string)) zone_tab() { return parsed_zone_tab || @@ -59,7 +59,7 @@ array(array(string)) zone_tab() //! This reads the zone.tab file and returns name of all //! standard timezones, like "Europe/Belgrade". -static array(string) zone_names=0; +protected array(string) zone_names=0; array(string) zonenames() { return zone_names || (zone_names=column(zone_tab(),2)); @@ -1444,3 +1444,4 @@ mapping timezone_expert_tree= -7200:"Europe/Warsaw",]),]),]); + diff --git a/lib/modules/Calendar.pmod/Time.pmod b/lib/modules/Calendar.pmod/Time.pmod index 917df754f5b111ba4bd023fa23973081a5fba3a0..97bb0c5d73185d0b292eadb66076536c5a2cf30f 100644 --- a/lib/modules/Calendar.pmod/Time.pmod +++ b/lib/modules/Calendar.pmod/Time.pmod @@ -108,7 +108,7 @@ class TimeofDay ::create(@args); } - static int(0..1) create_backtry(mixed ...args) + protected int(0..1) create_backtry(mixed ...args) { if (sizeof(args)>1 && objectp(args[0])) { @@ -146,7 +146,7 @@ class TimeofDay ls=CALUNKNOWN; } - static void create_now(); + protected void create_now(); void create_julian_day(int|float jd) { @@ -168,7 +168,7 @@ class TimeofDay } // make local second - static void make_local() + protected void make_local() { if (!base) make_base(); @@ -296,7 +296,7 @@ class TimeofDay return ::range(to); } - static void convert_from(TimeRange other) + protected void convert_from(TimeRange other) { ::convert_from(other); if (other->is_timeofday) @@ -479,7 +479,7 @@ class TimeofDay return Second("timeofday",rules,ux+n,1)->autopromote(); } - static array(TimeRange) get_timeofday(string unit, + protected array(TimeRange) get_timeofday(string unit, int start,int step,program p, int ... range) { @@ -1118,7 +1118,7 @@ class cSuperTimeRange // wrapper methods to calculate units in a supertimerange - static array(TimeRange) get_units(string unit,int ... range) + protected array(TimeRange) get_units(string unit,int ... range) { int from=0,to=0x7fffffff,pos=0; array res=({}); @@ -1155,7 +1155,7 @@ class cSuperTimeRange return res; } - static int num_units(string unit) + protected int num_units(string unit) { int pos=0; TimeRange last=0; @@ -1172,7 +1172,7 @@ class cSuperTimeRange return pos; } - static TimeRange get_unit(string unit,int n) + protected TimeRange get_unit(string unit,int n) { array(TimeRange) res=get_units(unit,n,n); if (sizeof(res)==1) return res[0]; @@ -1271,25 +1271,25 @@ class cHour create_unixtime(unixtime,3600); } - static void create_now() + protected void create_now() { create_unixtime(time(),3600); } - static void create_unixtime(int _ux,int _len) + protected void create_unixtime(int _ux,int _len) { ::create_unixtime(_ux,_len); if (ls==CALUNKNOWN) make_local(); if (ls%3600) ux-=ls%3600,ls=CALUNKNOWN; } - static void create_julian_day(int|float jd) + protected void create_julian_day(int|float jd) { ::create_julian_day(jd); len=3600; } - static void convert_from(TimeRange other) + protected void convert_from(TimeRange other) { ::convert_from(other); len-=len%3600; @@ -1378,7 +1378,7 @@ class cMinute int __hash() { return ux/60; } - static void create_unixtime(int _ux,int _len) + protected void create_unixtime(int _ux,int _len) { ::create_unixtime(_ux,_len); if (ls==CALUNKNOWN) make_local(); @@ -1390,7 +1390,7 @@ class cMinute create_unixtime(unixtime,60); } - static void create_now() + protected void create_now() { create_unixtime(time()/60*60,60); } @@ -1403,7 +1403,7 @@ class cMinute return ::autopromote(); } - static void convert_from(TimeRange other) + protected void convert_from(TimeRange other) { ::convert_from(other); len-=len%60; @@ -1490,12 +1490,12 @@ class cSecond create_unixtime(unixtime,1); } - static void create_now() + protected void create_now() { create_unixtime(time(),1); } - static void create_julian_day(int|float jd) + protected void create_julian_day(int|float jd) { ::create_julian_day(jd); len=1; @@ -1730,7 +1730,7 @@ class cFraction return ::create_backtry(@args); } - static void create_now() + protected void create_now() { ux=time(); ns=(int)(inano*time(ux)); @@ -1742,7 +1742,7 @@ class cFraction int unix_time() { return ux; } float f_unix_time() { return ux+ns*(1.0/inano); } - static void create_unixtime(int|float unixtime, + protected void create_unixtime(int|float unixtime, void|int|float _len) { ux=(int)unixtime; @@ -1752,7 +1752,7 @@ class cFraction ls=CALUNKNOWN; } - static void create_unixtime_default(int|float unixtime) + protected void create_unixtime_default(int|float unixtime) { create_unixtime(unixtime); } @@ -1762,7 +1762,7 @@ class cFraction return 2440588+(ux+ns*(1.0/inano))*(1/86400.0)+0.5; } - static void create_julian_day(int|float jd) + protected void create_julian_day(int|float jd) { // 1970-01-01 is julian day 2440588 jd-=2440588; @@ -1842,7 +1842,7 @@ class cFraction return ::_add(n,step); } - static void convert_from(TimeRange other) + protected void convert_from(TimeRange other) { ::convert_from(other); if (other->is_timeofday_f) @@ -1853,7 +1853,7 @@ class cFraction } } - static TimeRange _set_size(int n,TimeRange t) + protected TimeRange _set_size(int n,TimeRange t) { if (t->is_timeofday_f) return Fraction("timeofday_f",rules,ux,ns, diff --git a/lib/modules/Calendar.pmod/TimeRanges.pmod b/lib/modules/Calendar.pmod/TimeRanges.pmod index 3f9c73a5b12c6c0baa37513ee31f00c3ca618000..a8306a40dad4ce372a4329b45255769fa0804677 100644 --- a/lib/modules/Calendar.pmod/TimeRanges.pmod +++ b/lib/modules/Calendar.pmod/TimeRanges.pmod @@ -1,6 +1,6 @@ //! module Calendar -// $Id: TimeRanges.pmod,v 1.34 2008/02/07 01:39:53 mast Exp $ +// $Id: TimeRanges.pmod,v 1.35 2008/06/28 16:36:54 nilsson Exp $ #pike __REAL_VERSION__ @@ -65,9 +65,9 @@ class TimeRange //! The size of the new object may be inexact; //! a Month object can't comprehend seconds, for instance. - static void create_unixtime(int unixtime,int len); - static void create_unixtime_default(int unixtime); - static void create_julian_day(int jd); + protected void create_unixtime(int unixtime,int len); + protected void create_unixtime_default(int unixtime); + protected void create_julian_day(int jd); void create(mixed ...args) { @@ -123,7 +123,7 @@ class TimeRange this_program,@args,0,0,0); } - static void convert_from(TimeRange other) + protected void convert_from(TimeRange other) { // inheriting class must take care of size if (other->unix_time) { @@ -147,7 +147,7 @@ class TimeRange //! A negative size is not permitted; a zero one are. // virtual - static TimeRange _set_size(int n,TimeRange x); + protected TimeRange _set_size(int n,TimeRange x); TimeRange set_size(function|TimeRange|int(0..0x7fffffff) a, void|function|TimeRange b) @@ -191,7 +191,7 @@ class TimeRange //! </pre> // virtual - static this_program _add(int n,this_program step); + protected this_program _add(int n,this_program step); this_program add(function|this_program|int a, void|function|this_program b) @@ -1164,7 +1164,7 @@ class cSuperTimeRange program NullTimeRange=cNullTimeRange; -static class cNullTimeRange +protected class cNullTimeRange { inherit TimeRange; @@ -1265,9 +1265,9 @@ cNullTimeRange nulltimerange=NullTimeRange(); // helper functions -static mapping(function:TimeRange) program2stuff=([]); +protected mapping(function:TimeRange) program2stuff=([]); -static TimeRange promote_program(function p) +protected TimeRange promote_program(function p) { TimeRange x; if ( (x=program2stuff[p]) ) return x; diff --git a/lib/modules/Calendar.pmod/Timezone.pmod b/lib/modules/Calendar.pmod/Timezone.pmod index df9cdbf8137be86ecb8861ba4e41898589ee4d52..7165888e3ec4853ff4345fb1910921992acb5375 100644 --- a/lib/modules/Calendar.pmod/Timezone.pmod +++ b/lib/modules/Calendar.pmod/Timezone.pmod @@ -71,7 +71,7 @@ Calendar.Rule.Timezone UTC=Calendar.Rule.Timezone(0,"UTC"); Calendar.Rule.Timezone locale=0; -static function(:Calendar.Rule.Timezone) _locale() +protected function(:Calendar.Rule.Timezone) _locale() { Calendar.Rule.Timezone tz; @@ -160,7 +160,7 @@ Calendar.Rule.Timezone tz_from_tzfile(string tzfile) // ---------------------------------------------------------------- // expert system to pick out the correct timezone -static Calendar.Rule.Timezone timezone_expert_rec(Calendar.Rule.Timezone try, +protected Calendar.Rule.Timezone timezone_expert_rec(Calendar.Rule.Timezone try, mapping|array|string tree, object cal) { @@ -187,7 +187,7 @@ static Calendar.Rule.Timezone timezone_expert_rec(Calendar.Rule.Timezone try, return `[](tree); } -static Calendar.Rule.Timezone timezone_select(Calendar.Rule.Timezone try, +protected Calendar.Rule.Timezone timezone_select(Calendar.Rule.Timezone try, array tree, object cal) { @@ -204,14 +204,14 @@ static Calendar.Rule.Timezone timezone_select(Calendar.Rule.Timezone try, return `[](tree[0]); } -static array timezone_collect(string|mapping|array tree) +protected array timezone_collect(string|mapping|array tree) { if (arrayp(tree)) return tree; else if (stringp(tree)) return ({tree}); else return `+(@map(values(tree-({"test"})),timezone_collect)); } -static object expert_cal, expert_tzn; +protected object expert_cal, expert_tzn; Calendar.Rule.Timezone expert(Calendar.Rule.Timezone try) { @@ -231,7 +231,7 @@ class localtime constant is_dst_timezone=1; #if constant(tzname) - static array(string) names=tzname(); + protected array(string) names=tzname(); #endif string name="local"; @@ -245,7 +245,7 @@ class localtime // Workaround for predef::localtime() on WIN32 and others // throwing errors for times before 1970. This interferes // with the timezone expert system. - static mapping(string:int) paranoia_localtime(int ux) + protected mapping(string:int) paranoia_localtime(int ux) { if (ux<-0x80000000 || ux>0x7fffffff) error("Time is out of range for Timezone.localtime()\n"); @@ -313,11 +313,11 @@ class Timezone_Encapsule constant is_timezone=1; constant is_dst_timezone=1; // ask me - static string extra_name; - static int extra_offset; + protected string extra_name; + protected int extra_offset; string name; - static void create(Calendar.Rule.Timezone enc,string name,int off) + protected void create(Calendar.Rule.Timezone enc,string name,int off) { what=enc; extra_name=name; @@ -345,7 +345,7 @@ class Timezone_Encapsule int raw_utc_offset() { return what->raw_utc_offset()+extra_offset; } } -static private Calendar.Rule.Timezone _make_new_timezone_i(string tz, +protected private Calendar.Rule.Timezone _make_new_timezone_i(string tz, int plusminus) { Calendar.Rule.Timezone z=`[](tz); @@ -371,7 +371,7 @@ Calendar.Rule.Timezone make_new_timezone(Calendar.Rule.Timezone z,int plusminus) return Timezone_Encapsule(z,s,-plusminus); } -static private constant _military_tz= +protected private constant _military_tz= ([ "Y":"UTC-12", "X":"UTC-11", "W":"UTC-10", "V":"UTC-9", "U":"UTC-8", "T":"UTC-7", "S":"UTC-6", "R":"UTC-5", "Q":"UTC-4", "P":"UTC-3", "O":"UTC-2", "N":"UTC-1", "Z":"UTC", "A":"UTC+1", "B":"UTC+2", @@ -379,7 +379,7 @@ static private constant _military_tz= "H":"UTC+8", "I":"UTC+9", "K":"UTC+10", "L":"UTC+11", "M":"UTC+12", "J":"locale" ]); -static object runtime_timezone_compiler=0; +protected object runtime_timezone_compiler=0; // internal, don't use this outside calendar module int decode_timeskew(string w) @@ -400,7 +400,7 @@ int decode_timeskew(string w) return neg*a*3600; // ignore litter } -static private Calendar.Rule.Timezone _magic_timezone(string tz) +protected private Calendar.Rule.Timezone _magic_timezone(string tz) { string z,w; @@ -1239,8 +1239,8 @@ class Runtime_timezone_compiler mapping zone_cache; mapping rule_cache; string all_rules; - static mapping(string:Zone) zones = ([]); - static mapping(string:Rule) rules = ([]); + protected mapping(string:Zone) zones = ([]); + protected mapping(string:Rule) rules = ([]); string get_all_rules() { @@ -1397,11 +1397,11 @@ class Runtime_timezone_compiler { constant is_timezone=1; constant is_dst_timezone=1; - static int offset_to_utc; + protected int offset_to_utc; string name; - static function(string:string) tzformat; - static array names; + protected function(string:string) tzformat; + protected array names; // ---------------------------------------------------------------- @@ -1409,7 +1409,7 @@ class Runtime_timezone_compiler // this is the needed gregorian rule: // ---------------------------------------------------------------- - static array gregorian_yjd(int jd) + protected array gregorian_yjd(int jd) { int d=jd-1721426; @@ -1428,7 +1428,7 @@ class Runtime_timezone_compiler }); } - static void create(int offset,string _name) + protected void create(int offset,string _name) { offset_to_utc=offset; name=_name; @@ -1446,7 +1446,7 @@ class Runtime_timezone_compiler // the Rule: // which julian day does dst start and end this year? - static array(array(string|int)) jd_year_periods(int jd); + protected array(array(string|int)) jd_year_periods(int jd); // is (midnight) this julian day dst? array tz_jd(int jd) diff --git a/lib/modules/Calendar.pmod/YMD.pike b/lib/modules/Calendar.pmod/YMD.pike index dfe0db4f7119c14dbcfb9308e755166293b1ee7b..64d16dedc421c35d188bbe66078ff25cc78b97d8 100644 --- a/lib/modules/Calendar.pmod/YMD.pike +++ b/lib/modules/Calendar.pmod/YMD.pike @@ -18,31 +18,31 @@ inherit Calendar.Time:Time; // virtual methods to tell how this calendar works // ---------------- -static array(int) year_from_julian_day(int jd); -static int julian_day_from_year(int year); -static int year_remaining_days(int y,int yday); +protected array(int) year_from_julian_day(int jd); +protected int julian_day_from_year(int year); +protected int year_remaining_days(int y,int yday); -static array(int) year_month_from_month(int y,int m); // [y,m,ndays,myd] -static array(int) month_from_yday(int y,int yday); // [m,day-of-month,ndays,myd] +protected array(int) year_month_from_month(int y,int m); // [y,m,ndays,myd] +protected array(int) month_from_yday(int y,int yday); // [m,day-of-month,ndays,myd] -static array(int) week_from_week(int y,int w); // [wy,w,wd,ndays,wjd] -static array(int) week_from_julian_day(int jd); // [wy,w,wd,ndays,wjd] +protected array(int) week_from_week(int y,int w); // [wy,w,wd,ndays,wjd] +protected array(int) week_from_julian_day(int jd); // [wy,w,wd,ndays,wjd] -static string f_month_name_from_number; -static string f_month_shortname_from_number; -static string f_month_number_from_name; -static string f_month_day_name_from_number; -static string f_week_name_from_number; -static string f_week_day_number_from_name; -static string f_week_day_shortname_from_number; -static string f_week_day_name_from_number; -static string f_year_name_from_number; -static string f_year_number_from_name; +protected string f_month_name_from_number; +protected string f_month_shortname_from_number; +protected string f_month_number_from_name; +protected string f_month_day_name_from_number; +protected string f_week_name_from_number; +protected string f_week_day_number_from_name; +protected string f_week_day_shortname_from_number; +protected string f_week_day_name_from_number; +protected string f_year_name_from_number; +protected string f_year_number_from_name; -static int(0..1) year_leap_year(int y); +protected int(0..1) year_leap_year(int y); -static int compat_week_day(int n); +protected int compat_week_day(int n); //------------------------------------------------------------------------ //! class YMD @@ -626,7 +626,7 @@ class YMD // --- size and move --- - static TimeRange _set_size(int n,TimeRange t) + protected TimeRange _set_size(int n,TimeRange t) { if (t->is_timeofday) return second()->set_size(n,t); @@ -661,7 +661,7 @@ class YMD object_program(t)); } - static TimeRange _add(int _n,TimeRange step) + protected TimeRange _add(int _n,TimeRange step) { if (step->is_ymd) return _move(_n,step); @@ -913,7 +913,7 @@ class YMD // --- functions to conform to Time.* - static TimeRange get_unit(string unit,int m) + protected TimeRange get_unit(string unit,int m) { if (!n) return day()[unit](); if (m<0) m+=::`[]("number_of_"+unit+"s")(); @@ -923,7 +923,7 @@ class YMD ::`[]("number_of_"+unit+"s")()-1); } - static array(TimeRange) get_timeofday(string unit, + protected array(TimeRange) get_timeofday(string unit, int start,int step,program p, int ... range) { @@ -1106,7 +1106,7 @@ class YMD } void create_julian_day(int|float jd); - static TimeRange _move(int n,YMD step); + protected TimeRange _move(int n,YMD step); TimeRange place(TimeRange what,void|int force); // not needed @@ -1280,7 +1280,7 @@ class cYear error("_move: Incompatible type %O\n",step); } - static void convert_from(TimeRange other) + protected void convert_from(TimeRange other) { #if 0 // The following is disabled since it leads to inconsistent @@ -1611,7 +1611,7 @@ class cMonth error("distance: Incompatible type %O\n",to); } - static void convert_from(TimeRange other) + protected void convert_from(TimeRange other) { ::convert_from(other); if (other->number_of_months) @@ -1702,7 +1702,7 @@ class cMonth // --- needs to be defined - static int months_to_month(int y,int m); + protected int months_to_month(int y,int m); } // ---------------------------------------------------------------- @@ -1934,7 +1934,7 @@ class cWeek error("distance: Incompatible type %O\n",to); } - static void convert_from(TimeRange other) + protected void convert_from(TimeRange other) { ::convert_from(other); if (other->number_of_weeks) @@ -2064,7 +2064,7 @@ class cWeek // --- needs to be defined - static int weeks_to_week(int y,int m); + protected int weeks_to_week(int y,int m); } // ---------------------------------------------------------------- @@ -2272,7 +2272,7 @@ class cDay ->autopromote(); } - static void convert_from(TimeRange other) + protected void convert_from(TimeRange other) { ::convert_from(other); if (other->number_of_days) @@ -2283,7 +2283,7 @@ class cDay // --- Day _move - static TimeRange _move(int x,YMD step) + protected TimeRange _move(int x,YMD step) { if (step->is_year) { TimeRange stepped = year()->add(x,step); @@ -2647,7 +2647,7 @@ class cSuperTimeRange // dwim time of day; needed to correct timezones // this API may change without further notice -static TimeRange dwim_tod(TimeRange origin,string whut,int h,int m,int s) +protected TimeRange dwim_tod(TimeRange origin,string whut,int h,int m,int s) { TimeRange tr; if (catch { @@ -2681,11 +2681,11 @@ static TimeRange dwim_tod(TimeRange origin,string whut,int h,int m,int s) return tr; } -static mapping abbr2zones; +protected mapping abbr2zones; // dwim timezone and call dwim time of day above // this API may change without further notice -static TimeRange dwim_zone(TimeRange origin,string zonename, +protected TimeRange dwim_zone(TimeRange origin,string zonename, string whut,int ...args) { if (zonename=="") return 0; @@ -2731,9 +2731,9 @@ static TimeRange dwim_zone(TimeRange origin,string zonename, return dwim_tod(origin->set_timezone(zone),whut,@args); } -static mapping(string:array) parse_format_cache=([]); +protected mapping(string:array) parse_format_cache=([]); -static mapping dwim_year=([ "past_lower":70, "past_upper":100, +protected mapping dwim_year=([ "past_lower":70, "past_upper":100, "current_century":2000, "past_century":1900 ]); TimeRange parse(string fmt,string arg,void|TimeRange context) @@ -3015,7 +3015,7 @@ Calendar.dwim_day("Sat Jun 2"); */ -static constant dwim_day_strings= +protected constant dwim_day_strings= ({ "%y-%M-%D (%*s) -W%W-%e (%e)", "%y-%M-%D", @@ -3224,3 +3224,4 @@ string format_day_iso_short(int|void unix_time) return Day("unix",unix_time||time())->format_iso_short(); } + diff --git a/lib/modules/Calendar.pmod/module.pmod b/lib/modules/Calendar.pmod/module.pmod index 9c6c880180bc502fd5e0b1da1e5bb68844dcaff2..4a61203307598f8a7a53d022ce5225b2df6d006f 100644 --- a/lib/modules/Calendar.pmod/module.pmod +++ b/lib/modules/Calendar.pmod/module.pmod @@ -1,11 +1,11 @@ #pike __REAL_VERSION__ -static private int stage=0; -static private int booted=0; -static private object defcal; -static private object iso_utc; -static private object default_rules; -static constant magic= // magic + indices(Calendar.ISO) without YMD +protected private int stage=0; +protected private int booted=0; +protected private object defcal; +protected private object iso_utc; +protected private object default_rules; +protected constant magic= // magic + indices(Calendar.ISO) without YMD (< "ISO_UTC","II", "default_rules", "_sprintf", "set_timezone", "language", "Day", "Year", "Week", @@ -26,7 +26,7 @@ array _indices() #include "localization.h" #if 1 -static mixed `[](string what) +protected mixed `[](string what) { if (!booted) { @@ -81,9 +81,10 @@ static mixed `[](string what) return defcal[what]; } -static mixed `-> (string what) +protected mixed `-> (string what) { // This becomes an alias. return `[] (what); } #endif + diff --git a/lib/modules/Calendar_I.pmod/ISO.pmod b/lib/modules/Calendar_I.pmod/ISO.pmod index acc5d70fc52dd5701e2d1b76dd085564adb266ec..270a2c2e9d5c95a2e17a07eb0156f3f4533e812f 100644 --- a/lib/modules/Calendar_I.pmod/ISO.pmod +++ b/lib/modules/Calendar_I.pmod/ISO.pmod @@ -151,7 +151,7 @@ class Day } } -static private class _Day +protected private class _Day { // FIXME: Kludge because the day object does not exist in // Minute and Second. This function will be shadowed in Hour. @@ -161,7 +161,7 @@ static private class _Day } } -static private class Name +protected private class Name { string iso_name() { @@ -245,3 +245,4 @@ class Second } } + diff --git a/lib/modules/Calendar_I.pmod/Stardate.pmod b/lib/modules/Calendar_I.pmod/Stardate.pmod index 2ea3d97bde5a603b1558598f55529093b8a389ec..59fa36997993c0144b7ea251b732aa288ff660c8 100644 --- a/lib/modules/Calendar_I.pmod/Stardate.pmod +++ b/lib/modules/Calendar_I.pmod/Stardate.pmod @@ -74,13 +74,13 @@ class TNGDate from_julian_day(jd); } - static void from_stardate(float f) + protected void from_stardate(float f) { tics=f; jd=f/TNGSTARPERJULIAN+2569518.5; } - static void from_julian_day(float f) + protected void from_julian_day(float f) { jd=f; tics=(f-2569518.5)*TNGSTARPERJULIAN; diff --git a/lib/modules/Crypto.pmod/DSA.pike b/lib/modules/Crypto.pmod/DSA.pike index 42d29e82631756d81fdce9de3253d9e05da02320..698aaed9741fd3689e35bcb42979a24700d6754a 100644 --- a/lib/modules/Crypto.pmod/DSA.pike +++ b/lib/modules/Crypto.pmod/DSA.pike @@ -6,12 +6,12 @@ #if constant(Gmp) && constant(Gmp.mpz) && constant(Crypto.Random) -static Gmp.mpz p; // Modulo -static Gmp.mpz q; // Group order -static Gmp.mpz g; // Generator +protected Gmp.mpz p; // Modulo +protected Gmp.mpz q; // Group order +protected Gmp.mpz g; // Generator -static Gmp.mpz y; // Public key -static Gmp.mpz x; // Private key +protected Gmp.mpz y; // Public key +protected Gmp.mpz x; // Private key function(int:string) random = .Random.random_string; @@ -64,12 +64,12 @@ Gmp.mpz hash(string msg) return [object(Gmp.mpz)](Gmp.mpz(.SHA1.hash(msg), 256) % q); } -static Gmp.mpz random_number(Gmp.mpz n) +protected Gmp.mpz random_number(Gmp.mpz n) { return [object(Gmp.mpz)](Gmp.mpz(random( (q->size() + 10 / 8)), 256) % n); } -static Gmp.mpz random_exponent() +protected Gmp.mpz random_exponent() { return [object(Gmp.mpz)](random_number([object(Gmp.mpz)](q - 1)) + 1); } @@ -152,7 +152,7 @@ int(0..1) verify_ssl(string msg, string s) #define SEED_LENGTH 20 -static string nist_hash(Gmp.mpz x) +protected string nist_hash(Gmp.mpz x) { string s = x->digits(256); return .SHA1.hash(s[sizeof(s) - SEED_LENGTH..]); @@ -213,7 +213,7 @@ array(Gmp.mpz) nist_primes(int l) } } -static Gmp.mpz find_generator(Gmp.mpz p, Gmp.mpz q) +protected Gmp.mpz find_generator(Gmp.mpz p, Gmp.mpz q) { Gmp.mpz e = [object(Gmp.mpz)]((p - 1) / q); Gmp.mpz g; @@ -279,3 +279,4 @@ string name() { return "DSA"; } #else constant this_program_does_not_exist=1; #endif + diff --git a/lib/modules/Crypto.pmod/HMAC.pike b/lib/modules/Crypto.pmod/HMAC.pike index e516da51bf4117ca0ac01908538300219c240d60..ed71f408e3790e46df7018876866113c842f1f9c 100644 --- a/lib/modules/Crypto.pmod/HMAC.pike +++ b/lib/modules/Crypto.pmod/HMAC.pike @@ -6,10 +6,10 @@ #if constant(Crypto.Hash) -static .Hash H; // hash object +protected .Hash H; // hash object // B is the size of one compression block, in octets. -static int B; +protected int B; //! @param h //! The hash object on which the HMAC object should base its @@ -82,3 +82,4 @@ class `() #else constant this_program_does_not_exist=1; #endif + diff --git a/lib/modules/Crypto.pmod/Koremutake.pmod b/lib/modules/Crypto.pmod/Koremutake.pmod index f1ce18193146173f8ca627f7f66b9a54b2335bf9..02781e12409db5ac2da8d59b038f3eb8a4c55291 100644 --- a/lib/modules/Crypto.pmod/Koremutake.pmod +++ b/lib/modules/Crypto.pmod/Koremutake.pmod @@ -1,4 +1,4 @@ -// $Id: Koremutake.pmod,v 1.3 2008/01/13 17:05:36 nilsson Exp $ +// $Id: Koremutake.pmod,v 1.4 2008/06/28 16:36:54 nilsson Exp $ #pike __REAL_VERSION__ #pragma strict_types @@ -15,7 +15,7 @@ //! pieces of information are a lot easier to remember than a sequence //! of digits. -static constant table = ({ +protected constant table = ({ "BA", "BE", "BI", "BO", "BU", "BY", "DA", "DE", "DI", "DO", "DU", "DY", "FA", "FE", "FI", "FO", "FU", "FY", "GA", "GE", "GI", "GO", "GU", "GY", @@ -80,7 +80,7 @@ class `() { int block_size() { return 1; } int key_size() { return 0; } - static int mode; + protected int mode; this_program set_encrypt_key(void|mixed key) { key; mode = 0; diff --git a/lib/modules/Crypto.pmod/PGP.pmod b/lib/modules/Crypto.pmod/PGP.pmod index ecbe7225479552231c8ccffda18c6de582f03e48..60d45f9ee0ca83c435b9308fc6b7c7777fe0018c 100644 --- a/lib/modules/Crypto.pmod/PGP.pmod +++ b/lib/modules/Crypto.pmod/PGP.pmod @@ -1,5 +1,5 @@ // -// $Id: PGP.pmod,v 1.13 2006/11/04 19:06:48 nilsson Exp $ +// $Id: PGP.pmod,v 1.14 2008/06/28 16:36:54 nilsson Exp $ //! PGP stuff. See RFC 2440. @@ -15,7 +15,7 @@ // @member int validity // @member object key // @endmapping -static mapping decode_public_key(string s) { +protected mapping decode_public_key(string s) { mapping r = ([]); string key; @@ -102,7 +102,7 @@ static mapping decode_public_key(string s) { // @member Gmp.mpz digest_r // @member Gmp.mpz digest_s // @endmapping -static mapping decode_signature(string s) { +protected mapping decode_signature(string s) { mapping r = ([]); int l5, l; @@ -123,7 +123,7 @@ static mapping decode_signature(string s) { return r; } -static mapping decode_compressed(string s) { +protected mapping decode_compressed(string s) { error("Can't decompress.\n"); int type = s[0]; s = s[1..]; @@ -143,7 +143,7 @@ static mapping decode_compressed(string s) { } } -static constant pgp_id = ([ +protected constant pgp_id = ([ 0b100001:"public_key_encrypted", 0b100010:"signature", 0b100011:"symmetric_key", @@ -163,7 +163,7 @@ static constant pgp_id = ([ 0b110001:"modification_detection", ]); -static mapping(string:function) pgp_decoder = ([ +protected mapping(string:function) pgp_decoder = ([ "public_key":decode_public_key, "public_subkey":decode_public_key, "signature":decode_signature, @@ -216,7 +216,7 @@ string encode(int type, string data) { return sprintf("%c%c%s", type, sizeof(data), data); } -static int(0..1) verify(Crypto.HashState hash, mapping sig, mapping key) { +protected int(0..1) verify(Crypto.HashState hash, mapping sig, mapping key) { if(!objectp(hash) || !mappingp(sig) || !mappingp(key) || !key->key) return 0; @@ -279,7 +279,7 @@ string sha_sign(string text, mixed key) { } -static int crc24(string data) { +protected int crc24(string data) { int crc = 0xb704ce; foreach(data; int pos; int char) { crc ^= char<<16; @@ -357,3 +357,4 @@ mapping(string:mixed) decode_radix64(string data) { #else constant this_program_does_not_exist=1; #endif + diff --git a/lib/modules/Crypto.pmod/Pipe.pike b/lib/modules/Crypto.pmod/Pipe.pike index fbda1abb2761a99a2f308b11bf9a2c72445460a3..a9f75c3c18b36fa7ee487aaf205f23046d77d50a 100644 --- a/lib/modules/Crypto.pmod/Pipe.pike +++ b/lib/modules/Crypto.pmod/Pipe.pike @@ -8,16 +8,16 @@ //! algorithm. E.g. triple DES can be emulated with //! @expr{Crypto.Pipe(Crypto.DES, Crypto.DES, Crypto.DES)@}. -static array(.CipherState) ciphers = ({}); -static int _block_size = 1; -static int(0..1) reversed; +protected array(.CipherState) ciphers = ({}); +protected int _block_size = 1; +protected int(0..1) reversed; -static int(0..1) is_crypto(object c) { +protected int(0..1) is_crypto(object c) { return c->block_size && c->key_size && c->set_encrypt_key && c->set_decrypt_key && c->crypt && 1; } -static void create(program|object|array(program|mixed) ... c) { +protected void create(program|object|array(program|mixed) ... c) { if(!sizeof(c)) error("Too few arguments.\n"); foreach(c, program|object|array cc) { if(objectp(cc)) { diff --git a/lib/modules/Crypto.pmod/RSA.pike b/lib/modules/Crypto.pmod/RSA.pike index 764aca28704f0bc13b427e67e371e29faf2f007f..4e06c333f2878e23b953d80a4706f39685331206 100644 --- a/lib/modules/Crypto.pmod/RSA.pike +++ b/lib/modules/Crypto.pmod/RSA.pike @@ -1,4 +1,4 @@ -/* $Id: RSA.pike,v 1.10 2008/05/09 02:20:24 nilsson Exp $ +/* $Id: RSA.pike,v 1.11 2008/06/28 16:36:54 nilsson Exp $ * * Follow the PKCS#1 standard for padding and encryption. */ @@ -8,15 +8,15 @@ #if constant(Gmp) && constant(Gmp.mpz) && constant(Crypto.Hash) -static Gmp.mpz n; /* modulo */ -static Gmp.mpz e; /* public exponent */ -static Gmp.mpz d; /* private exponent (if known) */ -static int size; +protected Gmp.mpz n; /* modulo */ +protected Gmp.mpz e; /* public exponent */ +protected Gmp.mpz d; /* private exponent (if known) */ +protected int size; /* Extra info associated with a private key. Not currently used. */ -static Gmp.mpz p; -static Gmp.mpz q; +protected Gmp.mpz p; +protected Gmp.mpz q; //! Returns the RSA modulo (n). Gmp.mpz get_n() @@ -340,7 +340,7 @@ this_program generate_key(int(128..) bits, function(int:string)|void r) * Block cipher compatibility. */ -static int encrypt_mode; // For block cipher compatible functions +protected int encrypt_mode; // For block cipher compatible functions //! Sets the public key to @[key] and the mode to encryption. //! @seealso @@ -379,3 +379,4 @@ string name() { #else constant this_program_does_not_exist=1; #endif + diff --git a/lib/modules/Crypto.pmod/Random.pmod b/lib/modules/Crypto.pmod/Random.pmod index cad85eb5c9a931f824c1613fbea7b7cf67684175..dd38ff80fa62cb92b08e974af1e022f0c854593d 100644 --- a/lib/modules/Crypto.pmod/Random.pmod +++ b/lib/modules/Crypto.pmod/Random.pmod @@ -1,6 +1,6 @@ #pike __REAL_VERSION__ #pragma strict_types -// $Id: Random.pmod,v 1.18 2008/01/09 16:05:31 grubba Exp $ +// $Id: Random.pmod,v 1.19 2008/06/28 16:36:54 nilsson Exp $ //! This module contains stuff to that tries to give you the //! best possible random generation. @@ -10,9 +10,9 @@ #if constant(Nettle.NT) class Source { - static Nettle.NT.CryptContext ctx; + protected Nettle.NT.CryptContext ctx; - static void create(int(0..1) no_block) { + protected void create(int(0..1) no_block) { ctx = Nettle.NT.CryptContext(0, 0, Nettle.NT.PROV_RSA_FULL, Nettle.NT.CRYPT_VERIFYCONTEXT ); no_block; // Fix warning. @@ -26,11 +26,11 @@ class Source { #else class Source { - static Stdio.File f; - static string data = ""; - static int factor = 2; // Assume 50% entropy + protected Stdio.File f; + protected string data = ""; + protected int factor = 2; // Assume 50% entropy - static void create(int(0..1) no_block) { + protected void create(int(0..1) no_block) { if(no_block) { if(file_stat("/dev/urandom")) f = Stdio.File("/dev/urandom"); @@ -56,7 +56,7 @@ class Source { return ret; } - static string get_data() { + protected string get_data() { Stdio.File f = Stdio.File(); Stdio.File child_pipe = f->pipe(); if(!child_pipe) error("Could not generate random data.\n"); @@ -98,16 +98,16 @@ class Source { #endif -static class RND { +protected class RND { inherit Nettle.Yarrow; - static int bytes_left = 32; + protected int bytes_left = 32; - static Source s; + protected Source s; - static int last_tick; - static function(void:int) ticker; + protected int last_tick; + protected function(void:int) ticker; - static void create(int(0..1) no_block) { + protected void create(int(0..1) no_block) { // Source 0: /dev/random or CryptGenRandom // Source 1: ticker // Source 2: external @@ -124,7 +124,7 @@ static class RND { #endif } - static Thread.Mutex lock = Thread.Mutex(); + protected Thread.Mutex lock = Thread.Mutex(); string random_string(int len) { object key = lock->lock(); @@ -152,23 +152,23 @@ static class RND { } } -static string rnd_bootstrap(int len) { +protected string rnd_bootstrap(int len) { rnd_obj = RND(1); rnd_func = rnd_obj->random_string; return rnd_func(len); } -static RND rnd_obj; -static function(int:string) rnd_func = rnd_bootstrap; +protected RND rnd_obj; +protected function(int:string) rnd_func = rnd_bootstrap; -static string rnd_block_bootstrap(int len) { +protected string rnd_block_bootstrap(int len) { rnd_block_obj = RND(0); rnd_block_func = rnd_block_obj->random_string; return rnd_block_func(len); } -static RND rnd_block_obj; -static function(int:string) rnd_block_func = rnd_block_bootstrap; +protected RND rnd_block_obj; +protected function(int:string) rnd_block_func = rnd_block_bootstrap; //! Returns a string of length @[len] with random content. The //! content is generated by a Yarrow random generator that is @@ -212,3 +212,4 @@ void add_entropy(string data, int entropy) { #else constant this_program_does_not_exist=1; #endif + diff --git a/lib/modules/Crypto.pmod/Substitution.pike b/lib/modules/Crypto.pmod/Substitution.pike index c1543cf6a66c90a29356aa156962d8083231c435..369bdecdae62e0271c01a6800c4d7c0feffff122 100644 --- a/lib/modules/Crypto.pmod/Substitution.pike +++ b/lib/modules/Crypto.pmod/Substitution.pike @@ -5,16 +5,16 @@ #pike __REAL_VERSION__ // #pragma strict_types -static mapping(string:string|array(string)) enc_key = ([]); -static mapping(string:string) dec_key = ([]); -static int(0..1) is_expandable; -static array(string) null_chars = ({}); -static int null_fq; +protected mapping(string:string|array(string)) enc_key = ([]); +protected mapping(string:string) dec_key = ([]); +protected int(0..1) is_expandable; +protected array(string) null_chars = ({}); +protected int null_fq; -static constant AZ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"/1; -static constant az = "abcdefghijklmnopqrstuvwxyz"/1; +protected constant AZ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"/1; +protected constant az = "abcdefghijklmnopqrstuvwxyz"/1; -static array(int) charify(array(string) x) { +protected array(int) charify(array(string) x) { return map(x, lambda(string y) { return y[0]; }); } @@ -82,7 +82,7 @@ this_program set_null_chars(int|float p, array(string) chars) { return this; } -static mapping(string:string) make_rot_map(int steps, array(string) alphabet) { +protected mapping(string:string) make_rot_map(int steps, array(string) alphabet) { mapping(string:string) key = ([]); foreach(alphabet; int pos; string char) key[char] = alphabet[ (pos+steps)%sizeof(alphabet) ]; @@ -104,7 +104,7 @@ this_program set_rot_key(void|int steps, void|array(string) alphabet) { return this; } -static string reduce_word(string|array(int) w, array(string) alpha) { +protected string reduce_word(string|array(int) w, array(string) alpha) { w = Array.uniq( (array(int))w ); multiset a = (multiset)charify(alpha); foreach(w;; int char) @@ -112,7 +112,7 @@ static string reduce_word(string|array(int) w, array(string) alpha) { return (string)w; } -static array(string) scramble_alpha(string pwd, array(string) alpha, int off) { +protected array(string) scramble_alpha(string pwd, array(string) alpha, int off) { array(string) out = pwd/1; alpha -= out; out += alpha; @@ -216,7 +216,7 @@ string name() { return "substitution"; } int block_size() { return 1; } int key_size() { return sizeof(enc_key); } -static int mode; +protected int mode; this_program set_encrypt_key(mapping(string:string|array(string)) key) { mode = 0; return set_key(key); diff --git a/lib/modules/Debug.pmod/Subject.pike b/lib/modules/Debug.pmod/Subject.pike index 74913acddeede19434911f31ab910bba5c36cd7c..2f0aff47c0846c9967ee1cf479e66611d88a7070 100644 --- a/lib/modules/Debug.pmod/Subject.pike +++ b/lib/modules/Debug.pmod/Subject.pike @@ -1,4 +1,4 @@ -// $Id: Subject.pike,v 1.8 2006/11/04 19:06:48 nilsson Exp $ +// $Id: Subject.pike,v 1.9 2008/06/28 16:36:54 nilsson Exp $ #pike __REAL_VERSION__ @@ -36,7 +36,7 @@ #define PROXY(X,Y) X(mixed ... args) { ENTER(X); return Y; } -static string id = ""; +protected string id = ""; void create(mixed ... args) { diff --git a/lib/modules/Debug.pmod/Wrapper.pike b/lib/modules/Debug.pmod/Wrapper.pike index 37fb9bef0637963209150da9131f7716b6f08272..618b11dd3f4d72ea8254d5574f262612c18a338e 100644 --- a/lib/modules/Debug.pmod/Wrapper.pike +++ b/lib/modules/Debug.pmod/Wrapper.pike @@ -13,8 +13,8 @@ //! !___Nettle.MD5_State() //! (2) Result: 0 -static object wrappee; -static object compile_handler; +protected object wrappee; +protected object compile_handler; //! void create(object x) { diff --git a/lib/modules/Filesystem.pmod/System.pike b/lib/modules/Filesystem.pmod/System.pike index ddfca4ced5c69cec010abbd4de8f2cefb7f6e044..1237937b3330942ca4a958915b69e8fb9fa01271 100644 --- a/lib/modules/Filesystem.pmod/System.pike +++ b/lib/modules/Filesystem.pmod/System.pike @@ -16,10 +16,10 @@ inherit Filesystem.Base; // pattern, since getcwd() is used to get the initial value of the // 'wd' variable unless a different path is specified. // -static Filesystem.Base parent; // parent filesystem +protected Filesystem.Base parent; // parent filesystem -static string root = ""; // Note: Can now include leading "/" -static string wd; // never trailing "/" +protected string root = ""; // Note: Can now include leading "/" +protected string wd; // never trailing "/" //! @decl void create(void|string directory, void|string root, void|int fast, void|Filesystem.Base parent) //! Instanciate a new object representing the filesystem. @@ -32,7 +32,7 @@ static string wd; // never trailing "/" //! Internal //! @param parent //! Internal -static void create(void|string directory, // default: cwd +protected void create(void|string directory, // default: cwd void|string _root, // internal: root void|int fast, // internal: fast mode (no check) void|Filesystem.Base _parent) @@ -88,7 +88,7 @@ static void create(void|string directory, // default: cwd wd = directory; } -static string _sprintf(int t) +protected string _sprintf(int t) { return t=='O' && sprintf("%O(/* root=%O, wd=%O */)", this_program, root, wd); } diff --git a/lib/modules/Filesystem.pmod/Tar.pmod b/lib/modules/Filesystem.pmod/Tar.pmod index 61fe3b8513a66f22f357ac9eee506904144486db..8ff08bb84b34e694834eb185dab1faf00f537ef1 100644 --- a/lib/modules/Filesystem.pmod/Tar.pmod +++ b/lib/modules/Filesystem.pmod/Tar.pmod @@ -1,5 +1,5 @@ /* - * $Id: Tar.pmod,v 1.29 2006/11/04 19:06:48 nilsson Exp $ + * $Id: Tar.pmod,v 1.30 2008/06/28 16:36:54 nilsson Exp $ */ #pike __REAL_VERSION__ @@ -27,9 +27,9 @@ class _Tar // filesystem { inherit Stdio.FakeFile; - static private int start, pos, len; + protected private int start, pos, len; - static string _sprintf(int t) + protected string _sprintf(int t) { return t=='O' && sprintf("Filesystem.Tar.ReadFile(%d, %d /* pos = %d */)", start, len, pos); @@ -362,3 +362,4 @@ class `() } } + diff --git a/lib/modules/Filesystem.pmod/module.pmod b/lib/modules/Filesystem.pmod/module.pmod index 7a6565b20dcae2876c0a75265a736dcc19962c7a..d91c6489b5f898d281936887f579230e66c2b2f5 100644 --- a/lib/modules/Filesystem.pmod/module.pmod +++ b/lib/modules/Filesystem.pmod/module.pmod @@ -303,7 +303,7 @@ class Traversion { if(sizeof(files)) set_current(); } - static void set_current() { + protected void set_current() { current = file_stat(path + files[pos]); if(!current) return; if(!current->isdir) return; diff --git a/lib/modules/GLU.pmod b/lib/modules/GLU.pmod index 966cf98fa2dc1ddbf5cdc796c13814f3415d2734..6f6b5abd043bf087d94360b262925762fe38d2db 100644 --- a/lib/modules/GLU.pmod +++ b/lib/modules/GLU.pmod @@ -1,5 +1,5 @@ /* - * $Id: GLU.pmod,v 1.15 2008/04/04 19:11:11 grubba Exp $ + * $Id: GLU.pmod,v 1.16 2008/06/28 16:36:53 nilsson Exp $ * * GL Utilities module. */ @@ -179,7 +179,7 @@ void gluPickMatrix(float x, float y, glMultMatrix( m ); } -static void transform_point(array(float) out, array(float)m, +protected void transform_point(array(float) out, array(float)m, array(float) in) { #define M(row,col) m[col*4+row] @@ -242,3 +242,4 @@ array(float) gluProject(float objx, float objy, #else /* constant(GL) */ constant this_program_does_not_exist=1; #endif + diff --git a/lib/modules/GLUE.pmod/Driver.pmod/GTK.pike b/lib/modules/GLUE.pmod/Driver.pmod/GTK.pike index 3a8c24a17fc2d12073c5b00ce18bedb47d88352a..b70a2be8bceb0ea4287915f212357e46b2b61163 100644 --- a/lib/modules/GLUE.pmod/Driver.pmod/GTK.pike +++ b/lib/modules/GLUE.pmod/Driver.pmod/GTK.pike @@ -1,5 +1,5 @@ // -// $Id: GTK.pike,v 1.5 2004/01/29 21:44:54 nilsson Exp $ +// $Id: GTK.pike,v 1.6 2008/06/28 16:36:54 nilsson Exp $ #pike __REAL_VERSION__ @@ -8,19 +8,19 @@ inherit .Interface; import GLUE.Events; -static GTK.GLArea area; -static GTK.Window window; -static int gl_flags; +protected GTK.GLArea area; +protected GTK.Window window; +protected int gl_flags; -static class MEvent +protected class MEvent { inherit Event; constant use_modifiers = 1; } -static function evt, configure_event; +protected function evt, configure_event; -static void create( function event, function config ) +protected void create( function event, function config ) { evt = event; configure_event = config; @@ -167,7 +167,7 @@ void swap_buffers() area->swap_buffers(); } -static void repeat( int r ) +protected void repeat( int r ) { #ifdef __NT__ // What? @@ -186,7 +186,7 @@ void init(void|string title, void|string icon) repeat(0); } -static function(void:void) restore_res; +protected function(void:void) restore_res; void exit() { repeat(1); if(restore_res) restore_res(); @@ -204,3 +204,4 @@ void show_cursor() { } #endif /* constant(GTK.GLArea) */ + diff --git a/lib/modules/GLUE.pmod/Driver.pmod/Interface.pike b/lib/modules/GLUE.pmod/Driver.pmod/Interface.pike index 453208aac5911ff816d9affd948d31b420717994..afef54f4450e21ad4334d83b8d8cdd7101d66e9a 100644 --- a/lib/modules/GLUE.pmod/Driver.pmod/Interface.pike +++ b/lib/modules/GLUE.pmod/Driver.pmod/Interface.pike @@ -1,11 +1,11 @@ // -// $Id: Interface.pike,v 1.2 2004/01/24 21:42:26 nilsson Exp $ +// $Id: Interface.pike,v 1.3 2008/06/28 16:36:54 nilsson Exp $ #pike __REAL_VERSION__ // Internal interface class for Drivers. -static void create( function event, function config ); +protected void create( function event, function config ); void set_resolution( int(0..) x, int(0..) y ); @@ -28,3 +28,4 @@ void init(void|string title, void|string icon); + diff --git a/lib/modules/GLUE.pmod/Driver.pmod/SDL.pike b/lib/modules/GLUE.pmod/Driver.pmod/SDL.pike index 5053deb564e59a4b13b220792e528d9080f55e09..cda8b85ac8c89d7e925b33ce2f601281e2b82e35 100644 --- a/lib/modules/GLUE.pmod/Driver.pmod/SDL.pike +++ b/lib/modules/GLUE.pmod/Driver.pmod/SDL.pike @@ -1,5 +1,5 @@ // -// $Id: SDL.pike,v 1.5 2004/04/21 08:55:49 nilsson Exp $ +// $Id: SDL.pike,v 1.6 2008/06/28 16:36:54 nilsson Exp $ #pike __REAL_VERSION__ @@ -8,21 +8,21 @@ inherit .Interface; import GLUE.Events; -static int bpp; -static SDL.Surface screen; +protected int bpp; +protected SDL.Surface screen; #if constant(SDL.Joystick) -static array(SDL.Joystick) sticks = ({}); +protected array(SDL.Joystick) sticks = ({}); #endif -static function key_evt, configure_event; -static int is_full; -static SDL.Event evt = SDL.Event(); -static mapping active = ([]); -static int nomove; +protected function key_evt, configure_event; +protected int is_full; +protected SDL.Event evt = SDL.Event(); +protected mapping active = ([]); +protected int nomove; -static mapping pressed = ([]); -static mapping(int:int) keymap = ([]); +protected mapping pressed = ([]); +protected mapping(int:int) keymap = ([]); -static void event_handler() +protected void event_handler() { #ifndef THREAD_EVENTS call_out( event_handler, 0.02 ); @@ -198,7 +198,7 @@ void low_handle_events() } } -static void create( function event, function config ) +protected void create( function event, function config ) { key_evt = event; configure_event = config; @@ -263,7 +263,7 @@ void init(void|string title, void|string icon) SDL.set_caption( title||"", icon||"" ); } -static int X_sym( SDL.Keysym sym ) +protected int X_sym( SDL.Keysym sym ) { int v = sym->scancode; #if 0 @@ -332,3 +332,4 @@ void hide_cursor() { } #endif /* constant(SDL.Surface) */ + diff --git a/lib/modules/GLUE.pmod/Events.pmod b/lib/modules/GLUE.pmod/Events.pmod index 8990ea622d9edaf3643fcfaff23b1ff345a35c50..d661e4811de7a92beed48700b0ab1155cc07d1db 100644 --- a/lib/modules/GLUE.pmod/Events.pmod +++ b/lib/modules/GLUE.pmod/Events.pmod @@ -1,5 +1,5 @@ // -// $Id: Events.pmod,v 1.3 2004/04/08 21:52:24 nilsson Exp $ +// $Id: Events.pmod,v 1.4 2008/06/28 16:36:54 nilsson Exp $ // #pike __REAL_VERSION__ @@ -17,7 +17,7 @@ constant KNOWN_MODIFIERS = _SHFT | _CTRL | _ALT; // @decl Event STATE(int X, int Y) // @decl array(Event) STATE(array(int|Event) X, int Y) // @decl Event STATE(Event X, int Y) -static array(Event)|Event STATE(array|Event|int X,int Y) +protected array(Event)|Event STATE(array|Event|int X,int Y) { if( intp( X ) ) return Event( X,1,0,Y ); if( arrayp( X ) ) return map( X, STATE, Y ); @@ -258,21 +258,21 @@ class Event repeat = 0; } - static int(0..1) `>( Event e ) + protected int(0..1) `>( Event e ) { if( !objectp( e ) ) return 0; return (e->press > press) && (e->key > key) || (e->modifiers > modifiers); } - static int(0..1) `==( Event|int e ) + protected int(0..1) `==( Event|int e ) { if( objectp( e ) ) return ((e->press == press) && (e->key == key) && (e->modifiers == modifiers) && (e->raw == raw)); } - static int __hash( ) + protected int __hash( ) { return hash( sprintf( "%d %d %d", press, key, modifiers ) ); } @@ -290,7 +290,7 @@ class Event data = lower_case(data); } - static string _sprintf( int t ) + protected string _sprintf( int t ) { if( t!='O' ) return 0; if( !key ) @@ -304,7 +304,7 @@ class Event } //! - static void create( int|void _key, int(0..1)|void _press, + protected void create( int|void _key, int(0..1)|void _press, string|void _data, int|void _modifiers, float|void pressure) { diff --git a/lib/modules/GLUE.pmod/module.pmod b/lib/modules/GLUE.pmod/module.pmod index af352bc6004f37c5f5253ad5b881610ee1c7f04e..6da6472c210ab9ac0c5ecef12705f7b662c30392 100644 --- a/lib/modules/GLUE.pmod/module.pmod +++ b/lib/modules/GLUE.pmod/module.pmod @@ -1,5 +1,5 @@ // -// $Id: module.pmod,v 1.14 2007/08/10 14:21:52 grubba Exp $ +// $Id: module.pmod,v 1.15 2008/06/28 16:36:54 nilsson Exp $ #pike __REAL_VERSION__ #if constant(GL) && constant(GL.glOrtho) @@ -11,13 +11,13 @@ import GL; // --- Driver related code -static .Driver.Interface driver; +protected .Driver.Interface driver; #if !constant(GL.GL_TEXTURE_RECTANGLE_NV) # define GL_TEXTURE_RECTANGLE_NV 0x864E #endif -static constant drivers = ({ "SDL", "GTK" }); +protected constant drivers = ({ "SDL", "GTK" }); //! Returns the name of the available drivers. //! @seealso @@ -29,10 +29,10 @@ array(string) get_drivers() { // --- Callback handling -static function(.Events.Event:void) event_callback; -static function(float,int(0..1),float:void) resize_callback; +protected function(.Events.Event:void) event_callback; +protected function(float,int(0..1),float:void) resize_callback; -static array reinit_callbacks = ({}); +protected array reinit_callbacks = ({}); //! Add a callback that will be called every time the resolution //! is about to change. @@ -51,7 +51,7 @@ void remove_reinit_callback( function(void:void) f ) { } // --- GL extension related code -static multiset(string) extensions; +protected multiset(string) extensions; //! Checks if the GL extension @[ext] is currently supported. int(0..1) has_extension( string ext ) @@ -65,19 +65,19 @@ int(0..1) has_extension( string ext ) // --- Drawing area related code -static int(0..1) fullscreen = 1; -static array(int) resolution = ({ 800, 600 }); -static float aspect = 4/3.0; -static int gl_flags = 0; -static int depth = 32; -static float global_z_rotation; -static int(0..1) mirrorx, mirrory; +protected int(0..1) fullscreen = 1; +protected array(int) resolution = ({ 800, 600 }); +protected float aspect = 4/3.0; +protected int gl_flags = 0; +protected int depth = 32; +protected float global_z_rotation; +protected int(0..1) mirrorx, mirrory; -static void pre_modeswitch() { +protected void pre_modeswitch() { reinit_callbacks(); } -static void modeswitch() +protected void modeswitch() { glEnable( GL_TEXTURE_2D ); glEnable( GL_BLEND ); @@ -189,7 +189,7 @@ void set_depth(int _depth) { set_mode(); } -static void set_mode() { +protected void set_mode() { // FIXME: Run pre_modeswitch here? call_out( lambda() { driver->set_mode( fullscreen, depth, @resolution, gl_flags ); @@ -371,7 +371,7 @@ void init(void|mapping(string:mixed) options) { light_ids = IDGenerator(0,glGet( GL_MAX_LIGHTS )-1); } -static void start_driver(string|array(string)| +protected void start_driver(string|array(string)| object(.Driver.Interface) driver_names, string title, string icon_title) { if (objectp(driver_names)) { @@ -426,12 +426,12 @@ void hide_cursor() { // --- ID generation -static class IDGenerator { - static int next; - static array(int) reuse = ({}); - static int max_id; +protected class IDGenerator { + protected int next; + protected array(int) reuse = ({}); + protected int max_id; - static void create(void|int start_id, void|int max) { + protected void create(void|int start_id, void|int max) { next = start_id; max_id = max; if (max>start_id) @@ -474,15 +474,15 @@ class TextureIDGenerator #define TextureIDGenerator IDGenerator #endif -static class ErrorIDGenerator +protected class ErrorIDGenerator { int get() { error("GLUE driver not initialized.\n"); } void free(int id) { error("GLUE driver not initialized.\n"); } } -static IDGenerator texture_ids = ErrorIDGenerator(); -static IDGenerator list_ids = ErrorIDGenerator(); -static IDGenerator light_ids = ErrorIDGenerator(); +protected IDGenerator texture_ids = ErrorIDGenerator(); +protected IDGenerator list_ids = ErrorIDGenerator(); +protected IDGenerator light_ids = ErrorIDGenerator(); //! Allocate a hardwareaccelerated lightsource from OpenGL. //! @returns @@ -505,7 +505,7 @@ void free_light(int l) { // --- GL PushPop -static int(0..) push_depth; +protected int(0..) push_depth; //! Returns the PushPop depth, i.e. the number of pushes awaiting //! corresponding pops. @@ -535,7 +535,7 @@ void PushPop( function f ) { // --- GL Lists #ifdef __NT__ -static multiset(List) all_lists = set_weak_flag( (<>), Pike.WEAK ); +protected multiset(List) all_lists = set_weak_flag( (<>), Pike.WEAK ); #endif //! A display list abstraction. Automatically allocates a display list @@ -543,7 +543,7 @@ static multiset(List) all_lists = set_weak_flag( (<>), Pike.WEAK ); //! @seealso //! @[DynList] class List { - static int id; + protected int id; //! When creating a new list, the list code can be compiled upon //! creation by supplying a function @[f] that performs the GL @@ -554,7 +554,7 @@ class List { //! List list = List() { //! // GL code //! }; - static void create( void|function f ) { + protected void create( void|function f ) { id = list_ids->get(); #ifdef __NT__ all_lists[this] = 1; @@ -563,7 +563,7 @@ class List { } //! Deletes this list and frees the list id from the id pool. - static void destroy() { + protected void destroy() { #ifdef __NT__ all_lists[this] = 0; #endif @@ -574,12 +574,12 @@ class List { //! Returns this lists' id. int get_id() { return id; } - static int __hash() { return id; } + protected int __hash() { return id; } //! @[List] objects can be sorted according to list id. //! @seealso //! @[get_id] - static int(0..1) `>(mixed x) { + protected int(0..1) `>(mixed x) { if(!objectp(x) || !x->get_id) return 1; return (int)id > (int)x->get_id(); } @@ -618,13 +618,13 @@ class List { GL.glCallList( id ); } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%O)", this_program, id); } } // Debug code -static int global_list_begin; +protected int global_list_begin; //! A displaylist that is generated on demand. //! @note @@ -704,15 +704,15 @@ int(0..1) only_dynlists() { // --- Textures -static int fast_mipmap; -static int texture_mem; -static multiset(BaseTexture) all_textures = set_weak_flag( (<>), Pike.WEAK ); +protected int fast_mipmap; +protected int texture_mem; +protected multiset(BaseTexture) all_textures = set_weak_flag( (<>), Pike.WEAK ); //! The texture base class. Using e.g. @[Texture] might be more //! convenient. class BaseTexture { - static int id; + protected int id; int t_width, t_height; //! Texture dimensions @@ -723,13 +723,13 @@ class BaseTexture { //! The texture type, e.g. @[GL.GL_TEXTURE_2D]. int texture_type = GL_TEXTURE_2D; - static int alpha, mode; - static int(0..1) is_mipmapped; + protected int alpha, mode; + protected int(0..1) is_mipmapped; string debug; //! A string to identify the texture. #ifdef __NT__ - static mapping(string:mixed) backingstore; + protected mapping(string:mixed) backingstore; #endif; //! Construct a new texture. Processes @[_alpha], @[_mode] and @@ -767,12 +767,12 @@ class BaseTexture { } //! Calls @[construct] with @[args]. - static void create(mixed ... args ) { + protected void create(mixed ... args ) { construct( @args ); } //! Properly deallocates the texture. - static void destroy() + protected void destroy() { all_textures[this] = 0; texture_ids->free(id); @@ -1090,10 +1090,10 @@ class BaseTexture { //! Returns the id of this texture. int get_id() { return id; } - static int __hash() { return id; } + protected int __hash() { return id; } //! Textures can be sorted according to texture id. - static int(0..1) `>(mixed x) { + protected int(0..1) `>(mixed x) { if(!objectp(x) || !x->get_id) return 1; return (int)id > (int)x->get_id(); } @@ -1141,7 +1141,7 @@ class BaseTexture { } #endif - static string _sprintf( int f ) { + protected string _sprintf( int f ) { if(f!='O') return 0; string ms; @@ -1487,7 +1487,7 @@ class Region( float x, float y, float w, float h ) { y += ys; } - static string _sprintf( int c ) { + protected string _sprintf( int c ) { return c=='O' && sprintf("%O( %f,%f - %f,%f )", this_program, x, y, w, h ); } @@ -1540,20 +1540,20 @@ class Font { // The width of a space character. Used for all nonprintables except // '\n'. - static float spacew; + protected float spacew; // The hight of a character in the font, in pixels, +1. 1 is added // to give some spacing between characters in the texture. - static int character_height; + protected int character_height; // The actual font. - static Image.Fonts.Font font; + protected Image.Fonts.Font font; // Scale factor for the character width. - static float scale_width; + protected float scale_width; // Scale factor for the horizontal character spacing. - static float scale_spacing; + protected float scale_spacing; //! void create( Image.Fonts.Font f, float|void _scale_width, @@ -1578,18 +1578,18 @@ class Font // // It's generated by get_character, which allocates a suitable slot // in a texture for the character. - static mapping(int:array(int|Region|BaseTexture)) letters = ([]); + protected mapping(int:array(int|Region|BaseTexture)) letters = ([]); // The slot in the texture to use. Initially set so large that a // new texture will be generated for the first character, to avoid // code duplication of the texture allocation below. - static int robin = 10000; + protected int robin = 10000; // The current texture. - static BaseTexture current_txt; + protected BaseTexture current_txt; // FIXME: Include all nonprintables here. - static constant nonprint = (multiset)enumerate( 33 ) + + protected constant nonprint = (multiset)enumerate( 33 ) + (multiset)enumerate( 33, 1, 0x80 ) + (< 0x7f, 0xad >); //! Returns the advance (in pixels), the texture and the texture @@ -1716,7 +1716,7 @@ class Font return ret[..1]; } - static array get_characters( string text, float h, float|Region roi, + protected array get_characters( string text, float h, float|Region roi, string|void align ) { map( (array)text, get_character ); @@ -1887,7 +1887,7 @@ void draw_line( float|int a, float|int b, float|int c, float|int d, glEnable( GL_TEXTURE_2D ); } -static void low_draw_box( int mode, +protected void low_draw_box( int mode, float x0, float y0, float x1, float y1, array(Image.Color.Color)|Image.Color.Color c, array|float a ) @@ -1975,15 +1975,15 @@ void draw_polygon( array(float) coords, Image.Color.Color c, float a ) //! A mesh of squares. class SquareMesh { - static int xsize; - static int ysize; - static int(0..1) light; - static int(0..1) need_recalc; - static function(float,float:Math.Matrix) corner_func; - static array(array(Math.Matrix)) vertices; - static array(array(Math.Matrix)) surface_normals; - static array(array(array(float))) vertex_normals; - static BaseTexture texture; + protected int xsize; + protected int ysize; + protected int(0..1) light; + protected int(0..1) need_recalc; + protected function(float,float:Math.Matrix) corner_func; + protected array(array(Math.Matrix)) vertices; + protected array(array(Math.Matrix)) surface_normals; + protected array(array(array(float))) vertex_normals; + protected BaseTexture texture; //! Recalculate the mesh. void recalculate() @@ -2025,7 +2025,7 @@ class SquareMesh // FIXME: Once the GL module accepts Math.Matrix objects we should // definately change this code to use them. - static array vertex_normal( int x, int y ) + protected array vertex_normal( int x, int y ) { return vertex_normals[x][y] || (vertex_normals[x][y] = @@ -2117,3 +2117,4 @@ mapping(string:mixed) debug_stuff() { #else constant this_program_does_not_exist=1; #endif + diff --git a/lib/modules/GTKSupport.pmod/pCtree.pike b/lib/modules/GTKSupport.pmod/pCtree.pike index 1dc4355c82f5dbc792158c55a7c11b92c68c48bd..14e6e9c0aa3dfdbf9b25b213b2087db1cbdcf785 100644 --- a/lib/modules/GTKSupport.pmod/pCtree.pike +++ b/lib/modules/GTKSupport.pmod/pCtree.pike @@ -4,9 +4,9 @@ inherit GTK.Ctree:ctree; class Node { - private static program Prog=object_program(this_object()); + private protected program Prog=object_program(this_object()); - private static GTK.CTreeNode node; + private protected GTK.CTreeNode node; void create(object _node) { @@ -321,45 +321,45 @@ Node node_nth(int i) return Node(ctree::node_nth(i)); } -static void collapse() {} /* (node); */ -static void collapse_recursive() {} /* (node); */ -static void collapse_to_depth() {} /* (node,depth); */ -static void expand() {} /* (node); */ -static void expand_recursive() {} /* (node); */ -static void expand_to_depth() {} /* (node,depth); */ -static void insert_node() {} /* (0,node,columns,is_leaf,expanded)); */ -static void is_ancestor() {} /* (node,what); */ -static void is_viewable() {} /* (node); */ -static void node_is_visable() {} /* (node); */ -static void last() {} /* (node)); */ -static void move() {} /* (node,parent,0); */ -static void node_get_cell_style() {} /* (node,cell); */ -static void node_get_row_style() {} /* (node); */ -static void node_set_row_style() {} /* (node,style); */ -static void node_get_cell_type() {} /* (node,cell); */ -static void set_background() {} /* (node,color); */ -static void node_set_foreground() {} /* (node, color); */ -static void node_set_cell_style() {} /* (node, style); */ -static void node_get_selectable() {} /* (node); */ -static void node_set_selectable() {} /* (node,yes); */ -static void node_moveto() {} /* (node,column,row_align||0.0,col_align||0.0); */ -static void node_get_text() {} /* (node,column); */ -static void node_set_text() {} /* (node,column,text); */ -static void columns() {} /* ())),get_text); */ -static void node_set_pixmap() {} /* (node,column,pixmap,mask); */ -static void node_set_pixtext() {} /* (node,column,text,spacing,pixmap,mask); */ -static void node_set_row_data() {} /* (node,z); */ -static void node_get_row_data() {} /* (node); */ -static void set_node_info() {} /* (node,text,spacing,pixmap_closed, */ -static void set_node_shift() {} /* (node,column,vertical,horizontal); */ -static void remove_node() {} /* (node); */ -static void select() {} /* (node); */ -static void select_recursive() {} /* (node); */ -static void sort_node() {} /* (node); */ -static void sort_recursive() {} /* (node); */ -static void toggle_expansion() {} /* (node); */ -static void toggle_expansion_recursive() {} /* (node); */ -static void unselect_expansion() {} /* (node); */ -static void unselect_expansion_recursive() {} /* (node); */ -static void find() {} /* (what->get_node(),node); */ -static void find_by_row_data() {} /* (what->get_node(),node)); */ +protected void collapse() {} /* (node); */ +protected void collapse_recursive() {} /* (node); */ +protected void collapse_to_depth() {} /* (node,depth); */ +protected void expand() {} /* (node); */ +protected void expand_recursive() {} /* (node); */ +protected void expand_to_depth() {} /* (node,depth); */ +protected void insert_node() {} /* (0,node,columns,is_leaf,expanded)); */ +protected void is_ancestor() {} /* (node,what); */ +protected void is_viewable() {} /* (node); */ +protected void node_is_visable() {} /* (node); */ +protected void last() {} /* (node)); */ +protected void move() {} /* (node,parent,0); */ +protected void node_get_cell_style() {} /* (node,cell); */ +protected void node_get_row_style() {} /* (node); */ +protected void node_set_row_style() {} /* (node,style); */ +protected void node_get_cell_type() {} /* (node,cell); */ +protected void set_background() {} /* (node,color); */ +protected void node_set_foreground() {} /* (node, color); */ +protected void node_set_cell_style() {} /* (node, style); */ +protected void node_get_selectable() {} /* (node); */ +protected void node_set_selectable() {} /* (node,yes); */ +protected void node_moveto() {} /* (node,column,row_align||0.0,col_align||0.0); */ +protected void node_get_text() {} /* (node,column); */ +protected void node_set_text() {} /* (node,column,text); */ +protected void columns() {} /* ())),get_text); */ +protected void node_set_pixmap() {} /* (node,column,pixmap,mask); */ +protected void node_set_pixtext() {} /* (node,column,text,spacing,pixmap,mask); */ +protected void node_set_row_data() {} /* (node,z); */ +protected void node_get_row_data() {} /* (node); */ +protected void set_node_info() {} /* (node,text,spacing,pixmap_closed, */ +protected void set_node_shift() {} /* (node,column,vertical,horizontal); */ +protected void remove_node() {} /* (node); */ +protected void select() {} /* (node); */ +protected void select_recursive() {} /* (node); */ +protected void sort_node() {} /* (node); */ +protected void sort_recursive() {} /* (node); */ +protected void toggle_expansion() {} /* (node); */ +protected void toggle_expansion_recursive() {} /* (node); */ +protected void unselect_expansion() {} /* (node); */ +protected void unselect_expansion_recursive() {} /* (node); */ +protected void find() {} /* (what->get_node(),node); */ +protected void find_by_row_data() {} /* (what->get_node(),node)); */ diff --git a/lib/modules/GTKSupport.pmod/pDrawingArea.pike b/lib/modules/GTKSupport.pmod/pDrawingArea.pike index db8a5509c189aaef81758c8474af65c0d20158d7..09e249cabefd408acf7590cc5033505f5a624791 100644 --- a/lib/modules/GTKSupport.pmod/pDrawingArea.pike +++ b/lib/modules/GTKSupport.pmod/pDrawingArea.pike @@ -11,8 +11,8 @@ //! @[GTK.DrawingArea] inherit GTK.DrawingArea; -static object backing_store, bgc; -static int _xsize, _ysize, is_realized; +protected object backing_store, bgc; +protected int _xsize, _ysize, is_realized; //! @ignore @@ -71,7 +71,7 @@ this_program size(int x, int y) // call_out(size,0.01, x,y); //} -static void rrefresh() +protected void rrefresh() { if(!is_realized) return; if(xsize() != _xsize || ysize() != _ysize) @@ -83,7 +83,7 @@ static void rrefresh() } } -static void refresh() +protected void refresh() { remove_call_out(rrefresh); call_out(rrefresh,0.01); diff --git a/lib/modules/Geography.pmod/Countries.pmod b/lib/modules/Geography.pmod/Countries.pmod index 37e4b50c1f12db9e58fc4062bcc7a93089eb8b80..f3ee31670a1827f98749ce27e36045815d85bb20 100644 --- a/lib/modules/Geography.pmod/Countries.pmod +++ b/lib/modules/Geography.pmod/Countries.pmod @@ -426,7 +426,7 @@ class Country //! <dt>COM <dd>Commercial //! </dl> -static private mapping _from_domain=0; +protected private mapping _from_domain=0; Country from_domain(string domain) { @@ -453,7 +453,7 @@ Country from_domain(string domain) //! The search is case-insensitive but //! regards whitespace and interpunctation. -static private mapping _from_name=0; +protected private mapping _from_name=0; Country from_name(string name) { @@ -496,7 +496,7 @@ Country from_name(string name) //! @note //! Some countries are considered to be on more than one continent. -static private mapping _cached_continents; +protected private mapping _cached_continents; mapping(string:array(Country)) continents() { diff --git a/lib/modules/Geography.pmod/Position.pike b/lib/modules/Geography.pmod/Position.pike index ef048c552bb27156643a7176ddcc3562e8e2c64d..ae4184f142f931d6a196f04ee17987b5f958572a 100644 --- a/lib/modules/Geography.pmod/Position.pike +++ b/lib/modules/Geography.pmod/Position.pike @@ -439,15 +439,15 @@ string GEOREF() { #define DEG2RAD(DEG) ((Math.pi/180.0)*(DEG)) #define RAD2DEG(RAD) ((RAD)*(180.0/Math.pi)) -static constant rt38_y0 = 1500000; -static constant rt38_lng0 = DEG2RAD(15.80827778); -static constant rt38_k0a = 6366742.5194; -static constant rt38_beta1 = 0.00083522527; -static constant rt38_beta2 = 0.000000756302; -static constant rt38_beta3 = 0.000000001193; -static constant rt38_delta1 = 0.000835225613; -static constant rt38_delta2 = 0.000000058706; -static constant rt38_delta3 = 0.000000000166; +protected constant rt38_y0 = 1500000; +protected constant rt38_lng0 = DEG2RAD(15.80827778); +protected constant rt38_k0a = 6366742.5194; +protected constant rt38_beta1 = 0.00083522527; +protected constant rt38_beta2 = 0.000000756302; +protected constant rt38_beta3 = 0.000000001193; +protected constant rt38_delta1 = 0.000835225613; +protected constant rt38_delta2 = 0.000000058706; +protected constant rt38_delta3 = 0.000000000166; //! array(float) RT38() diff --git a/lib/modules/Getopt.pmod b/lib/modules/Getopt.pmod index bed58c1400ab721276d7fae368c925577e1f7111..234596d3ce7e9c02de716d02820b4c0acf7a2ece 100644 --- a/lib/modules/Getopt.pmod +++ b/lib/modules/Getopt.pmod @@ -16,7 +16,7 @@ //! @tt{-t @i{argument@}@} or @tt{-t@i{argument@}@} or //! @tt{--test=@i{argument@}@}. -static void my_error(string err, int throw_errors) { +protected void my_error(string err, int throw_errors) { if(throw_errors) error(err); werror([string(0..255)]err); exit(1); diff --git a/lib/modules/Graphics.pmod/Graph.pmod/create_graph.pike b/lib/modules/Graphics.pmod/Graph.pmod/create_graph.pike index ca2a8a3c1f7756f4312ddc1f7b738465d9279ae7..6e55ef15173dbcc5a6ddfab0530db95f99a8882f 100755 --- a/lib/modules/Graphics.pmod/Graph.pmod/create_graph.pike +++ b/lib/modules/Graphics.pmod/Graph.pmod/create_graph.pike @@ -13,9 +13,9 @@ inherit .polyline; -static constant LITET = 1.0e-38; -static constant STORTLITET = 1.0e-30; -static constant STORT = 1.0e30; +protected constant LITET = 1.0e-38; +protected constant STORTLITET = 1.0e-30; +protected constant STORT = 1.0e30; object tileimage(object img, int xs, int ys) { diff --git a/lib/modules/Graphics.pmod/Graph.pmod/module.pmod b/lib/modules/Graphics.pmod/Graph.pmod/module.pmod index c404d6b6d140c7bac5308ccfa28304a0ae45c0af..8bc0fefc5c86c57bfce86ac3a504995aae30b799 100644 --- a/lib/modules/Graphics.pmod/Graph.pmod/module.pmod +++ b/lib/modules/Graphics.pmod/Graph.pmod/module.pmod @@ -2,7 +2,7 @@ #include "graph.h" -static inherit .create_pie; +protected inherit .create_pie; //! This function sets all unset elements in diagram_data to its //! default value as well as performing some simple sanity checks. @@ -157,3 +157,4 @@ Image.Image graph(mapping(string:mixed) diagram_data) check_mapping(diagram_data, "graph"); return create_graph(diagram_data)->image; } + diff --git a/lib/modules/Graphics.pmod/Graph.pmod/polyline.pike b/lib/modules/Graphics.pmod/Graph.pmod/polyline.pike index b691cc54c91d922350b4d8426d148ba8d86e92d4..b7de352cc4d8ee46fedb4cfa14bfec0df30b27c7 100644 --- a/lib/modules/Graphics.pmod/Graph.pmod/polyline.pike +++ b/lib/modules/Graphics.pmod/Graph.pmod/polyline.pike @@ -1,6 +1,6 @@ //! Graph sub-module providing draw functions. //! -//! $Id: polyline.pike,v 1.6 2003/11/22 15:00:54 grubba Exp $ +//! $Id: polyline.pike,v 1.7 2008/06/28 16:36:55 nilsson Exp $ #pike __REAL_VERSION__ @@ -25,7 +25,7 @@ constant PI = 3.1415926535897932384626433832795080; * /grubba (who got tired of BG being so slow) */ -static array(float) init_cap_sin_table() +protected array(float) init_cap_sin_table() { array(float) s_t = allocate(CAPSTEPS); @@ -35,9 +35,9 @@ static array(float) init_cap_sin_table() return s_t; } -static array(float) cap_sin_table = init_cap_sin_table(); +protected array(float) cap_sin_table = init_cap_sin_table(); -static array(float) init_cap_cos_table() +protected array(float) init_cap_cos_table() { array(float) c_t = allocate(CAPSTEPS); @@ -47,11 +47,11 @@ static array(float) init_cap_cos_table() return c_t; } -static array(float) cap_cos_table = init_cap_cos_table(); +protected array(float) cap_cos_table = init_cap_cos_table(); -static private array(float) xyreverse(array(float) a) +protected private array(float) xyreverse(array(float) a) { array(float) r = reverse(a); int n = sizeof(r)/2; diff --git a/lib/modules/Int.pmod b/lib/modules/Int.pmod index 179c8e00a42829b86191c313c13cccf6e95eea9c..8bf6d519871b3c4aca1de1fff02ffa5f9c1f1358 100644 --- a/lib/modules/Int.pmod +++ b/lib/modules/Int.pmod @@ -54,35 +54,35 @@ int(0..4294967295) swap_long(int(0..4294967295) i) { ((i&(255<<16))>>8) | ((i&(255<<24))>>24); } -static class Inf { +protected class Inf { - static constant neg = 0; - static int __hash() { return 17; } - static int(0..1) _equal(mixed arg) { + protected constant neg = 0; + protected int __hash() { return 17; } + protected int(0..1) _equal(mixed arg) { if(neg && arg==-Math.inf) return 1; if(!neg && arg==Math.inf) return 1; return arg==this; } - static int(0..1) _is_type(mixed type) { return (< "int", "object" >)[type]; } - static mixed _random() { return this; } - static mixed _sqrt() { return this; } + protected int(0..1) _is_type(mixed type) { return (< "int", "object" >)[type]; } + protected mixed _random() { return this; } + protected mixed _sqrt() { return this; } // % == nan // & == nan - static mixed `*(mixed ... args) { + protected mixed `*(mixed ... args) { int n = neg; foreach(args, mixed arg) if(arg<0) n = !n; if(n) return ninf; return inf; } - static mixed ``*(mixed ... args) { return `*(@args); } - static mixed `+(mixed ... args) { + protected mixed ``*(mixed ... args) { return `*(@args); } + protected mixed `+(mixed ... args) { foreach(args, mixed arg) if(arg==`-()) error("NaN\n"); return this; } - static mixed ``+(mixed ... args) { return ``+(@args); } - static mixed `-(mixed ... args) { + protected mixed ``+(mixed ... args) { return ``+(@args); } + protected mixed `-(mixed ... args) { if(!sizeof(args)) { if(neg) return inf; return ninf; @@ -91,35 +91,35 @@ static class Inf { if(arg==inf || arg==ninf) error("NaN\n"); return this; } - static mixed ``-(mixed arg) { + protected mixed ``-(mixed arg) { if(arg==inf || arg==ninf) error("NaN\n"); return this; } - static int(0..1) `<(mixed arg) { + protected int(0..1) `<(mixed arg) { if(arg==this) return 0; return neg; } - static int(0..1) `>(mixed arg) { + protected int(0..1) `>(mixed arg) { if(arg==this) return 0; return !neg; } - static mixed `~() { return `-(); } - static mixed `<<(mixed arg) { + protected mixed `~() { return `-(); } + protected mixed `<<(mixed arg) { if(arg<0) error("Got negative shift count.\n"); return this; } - static mixed ``<<(mixed arg) { + protected mixed ``<<(mixed arg) { if(arg<0) return ninf; return inf; } - static mixed `>>(mixed arg) { + protected mixed `>>(mixed arg) { if(arg<0) error("Got negative shift count.\n"); return this; } - static mixed ``>>(mixed arg) { + protected mixed ``>>(mixed arg) { return 0; } - static mixed cast(string to) { + protected mixed cast(string to) { switch(to) { case "string": return "inf"; @@ -129,7 +129,7 @@ static class Inf { error("Can not cast to %O.\n", to); } } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && (neg?"-":"")+"Int.inf"; } } @@ -139,7 +139,7 @@ class NInf { constant neg = 1; } -static Inf ninf = NInf(); +protected Inf ninf = NInf(); //! An infinite number. Inf inf = Inf(); diff --git a/lib/modules/Local.pmod b/lib/modules/Local.pmod index 17594d3c6f6a1d70d409609ee85b50af2670e9c3..9130ec2f1f2aa84c66e05a900fabcdda5a10a604 100644 --- a/lib/modules/Local.pmod +++ b/lib/modules/Local.pmod @@ -1,6 +1,6 @@ #pike __REAL_VERSION__ -// $Id: Local.pmod,v 1.10 2007/09/03 13:05:08 grubba Exp $ +// $Id: Local.pmod,v 1.11 2008/06/28 16:36:53 nilsson Exp $ //! @[Local] gives a local module namespace used for locally //! installed pike modules. Modules are searched for in @@ -18,9 +18,9 @@ inherit __joinnode; -static array(string) local_path; +protected array(string) local_path; -static void create() +protected void create() { ::create(({})); diff --git a/lib/modules/Locale.pmod/Charset.pmod/Tables.pmod/iso88591.pmod b/lib/modules/Locale.pmod/Charset.pmod/Tables.pmod/iso88591.pmod index c021be9d9e8c6fbe194b901c82e97e3007225428..949ca08147630d3e8b88412a00b68548e196274b 100644 --- a/lib/modules/Locale.pmod/Charset.pmod/Tables.pmod/iso88591.pmod +++ b/lib/modules/Locale.pmod/Charset.pmod/Tables.pmod/iso88591.pmod @@ -3,7 +3,7 @@ //! Codec for the ISO-8859-1 character encoding. class decoder { - static private string s = ""; + protected private string s = ""; this_program feed(string ss) { s += ss; @@ -24,10 +24,10 @@ class decoder { class encoder { - static string s = ""; - static string|void replacement; - static function(string:string)|void repcb; - static string low_convert(string s, string|void r, + protected string s = ""; + protected string|void replacement; + protected function(string:string)|void repcb; + protected string low_convert(string s, string|void r, function(string:string)|void rc) { int i = sizeof(s); @@ -62,10 +62,11 @@ class encoder { repcb = rc; } - static void create(string|void r, string|void rc) + protected void create(string|void r, string|void rc) { replacement = r; repcb = rc; } } + diff --git a/lib/modules/Locale.pmod/Charset.pmod/module.pmod b/lib/modules/Locale.pmod/Charset.pmod/module.pmod index 005b22c1352b8f46683025c3d42d30eb8e50bdb0..c597d33667f7b3da8b874c9857654a31f093a067 100644 --- a/lib/modules/Locale.pmod/Charset.pmod/module.pmod +++ b/lib/modules/Locale.pmod/Charset.pmod/module.pmod @@ -2,7 +2,7 @@ #pike __REAL_VERSION__ //! @ignore -static private inherit _Charset; +protected private inherit _Charset; //! @endignore //! The Charset module supports a wide variety of different character sets, and @@ -145,7 +145,7 @@ class Encoder } private class ASCIIDec { - static private string s = ""; + protected private string s = ""; this_program feed(string ss) { s += ss; @@ -166,7 +166,7 @@ private class ASCIIDec { private class UTF16dec { inherit ASCIIDec; - static int check_bom=1, le=0; + protected int check_bom=1, le=0; string drain() { string s = ::drain(); if(sizeof(s)&1) { @@ -190,12 +190,12 @@ private class UTF16dec { private class UTF16LEdec { inherit UTF16dec; - static void create() { le=1; } + protected void create() { le=1; } } private class ISO6937dec { - static Decoder decoder = rfc1345("iso6937"); - static string trailer = ""; + protected Decoder decoder = rfc1345("iso6937"); + protected string trailer = ""; string drain() { string res = trailer + decoder->drain(); @@ -342,10 +342,10 @@ Decoder decoder(string name) private class ASCIIEnc { - static string s = ""; - static string|void replacement; - static function(string:string)|void repcb; - static string low_convert(string s, string|void r, + protected string s = ""; + protected string|void replacement; + protected function(string:string)|void repcb; + protected string low_convert(string s, string|void r, function(string:string)|void rc) { int i = sizeof(s); @@ -380,7 +380,7 @@ private class ASCIIEnc { repcb = rc; } - static void create(string|void r, string|void rc) + protected void create(string|void r, string|void rc) { replacement = r; repcb = rc; @@ -389,7 +389,7 @@ private class ASCIIEnc private class UTF16enc { inherit ASCIIEnc; - static private string low_convert(string s, string|void r, + protected private string low_convert(string s, string|void r, function(string:string)|void rc) { int i = sizeof(s); @@ -427,8 +427,8 @@ private class UTF16LEenc { } private class ISO6937enc { - static Encoder encoder; - static void create(string|void replacement, + protected Encoder encoder; + protected void create(string|void replacement, function(string:string)|void repcb) { encoder = rfc1345("iso6937", 1, replacement, repcb); @@ -557,7 +557,7 @@ Encoder encoder(string name, string|void replacement, } -static constant MIBenum = ([ +protected constant MIBenum = ([ 3:"ANSI_X3.4-1968", 4:"ISO_8859-1:1987", 5:"ISO_8859-2:1987", @@ -819,7 +819,7 @@ Encoder encoder_from_mib(int mib, string|void replacement, return e; } -static string format_err_msg ( +protected string format_err_msg ( string intro, string err_str, int err_pos, string charset, string reason) { string pre_context = err_pos > 23 ? @@ -861,7 +861,7 @@ class DecodeError string charset; //! The decoding charset. - static void create (string err_str, int err_pos, string charset, + protected void create (string err_str, int err_pos, string charset, void|string reason, void|array bt) { this_program::err_str = err_str; @@ -895,7 +895,7 @@ class EncodeError string charset; //! The encoding charset. - static void create (string err_str, int err_pos, string charset, + protected void create (string err_str, int err_pos, string charset, void|string reason, void|array bt) { this_program::err_str = err_str; diff --git a/lib/modules/Locale.pmod/Language.pmod/nld.pmod b/lib/modules/Locale.pmod/Language.pmod/nld.pmod index dd96a5dbe0b9f0a1c33d6209f8a0400dee0194c9..b965ed10e8e33725dd6dca55cb68217c3177f93c 100644 --- a/lib/modules/Locale.pmod/Language.pmod/nld.pmod +++ b/lib/modules/Locale.pmod/Language.pmod/nld.pmod @@ -3,7 +3,7 @@ //! Dutch language locale by Stephen R. van den Berg -// $Id: nld.pmod,v 1.1 2002/10/01 10:57:57 nilsson Exp $ +// $Id: nld.pmod,v 1.2 2008/06/28 16:36:55 nilsson Exp $ inherit "abstract"; @@ -74,7 +74,7 @@ string date(int timestamp, string|void m) return snumber(num/(unit))+(name)+snumber(num%(unit)) -static string snumber(int num) +protected string snumber(int num) { if(num<0) return "min "+snumber(-num); diff --git a/lib/modules/Locale.pmod/module.pmod b/lib/modules/Locale.pmod/module.pmod index 4359b03520e576292f60a94ee47d969208101c4f..ebf48e8410d338d57f40f208a2212aa6ad2b6176 100644 --- a/lib/modules/Locale.pmod/module.pmod +++ b/lib/modules/Locale.pmod/module.pmod @@ -39,10 +39,10 @@ //#define LOCALE_DEBUG_ALL // project_name:project_path -static mapping(string:string) projects = ([]); +protected mapping(string:string) projects = ([]); // language:(project_name:project) -static mapping(string:mapping(string:object)) locales = ([]); -static string default_project; +protected mapping(string:mapping(string:object)) locales = ([]); +protected string default_project; void register_project(string name, string path, void|string path_base) //! Make a connection between a project name and where its @@ -77,11 +77,11 @@ void set_default_project_path(string path) default_project = path; } -static class LanguageListObject( array(string) languages ) +protected class LanguageListObject( array(string) languages ) { int timestamp = time(1); - static string _sprintf(int t) + protected string _sprintf(int t) { return t=='O' && sprintf("%O(timestamp: %d, %O)", this_program, timestamp, languages); @@ -143,13 +143,13 @@ array(string) list_languages(string project) class LocaleObject { // key:string - static mapping(string|int:string) bindings; + protected mapping(string|int:string) bindings; // key:function public mapping(string:function) functions; int timestamp = time(1); constant is_locale=1; - static void create(mapping(string|int:string) _bindings, + protected void create(mapping(string|int:string) _bindings, void|mapping(string:function) _functions) { bindings = _bindings; @@ -198,7 +198,7 @@ class LocaleObject return size; } - static string _sprintf(int t) + protected string _sprintf(int t) { return t=='O' && sprintf("%O(timestamp: %d, bindings: %d, functions: %d)", this_program, timestamp, sizeof(bindings), @@ -208,7 +208,7 @@ class LocaleObject // Used to delay lookup of the Charset module until run-time when dumped, // and thus resolve the circularity. -static object(Locale) locale = Locale; +protected object(Locale) locale = Locale; object get_object(string project, string lang) { @@ -463,10 +463,10 @@ mapping(string:int) cache_status() { //! This class simulates a multi-language "string". //! The actual language to use is determined as late as possible. -class DeferredLocale( static string project, - static function(:string) get_lang, - static string|int key, - static string fallback ) +class DeferredLocale( protected string project, + protected function(:string) get_lang, + protected string|int key, + protected string fallback ) { array get_identifier( ) //! Return the data nessesary to recreate this "string". @@ -474,27 +474,27 @@ class DeferredLocale( static string project, return ({ project, get_lang, key, fallback }); } - static int `<( mixed what ) + protected int `<( mixed what ) { return lookup() < what; } - static int `> ( mixed what ) + protected int `> ( mixed what ) { return lookup() > what; } - static int `==( mixed what ) + protected int `==( mixed what ) { return lookup() == what; } - static inline string lookup() + protected inline string lookup() { return translate(project, get_lang(), key, fallback); } - static string _sprintf(int c) + protected string _sprintf(int c) { switch(c) { @@ -505,47 +505,47 @@ class DeferredLocale( static string project, } } - static string `+(mixed ... args) + protected string `+(mixed ... args) { return predef::`+(lookup(), @args); } - static string ``+(mixed ... args) + protected string ``+(mixed ... args) { return predef::`+(@args, lookup()); } - static string `-(mixed ... args) + protected string `-(mixed ... args) { return predef::`-(lookup(), @args); } - static string ``-(mixed ... args) + protected string ``-(mixed ... args) { return predef::`-(@args, lookup()); } - static string `*(mixed ... args) + protected string `*(mixed ... args) { return predef::`*(lookup(), @args); } - static string ``*(mixed arg) + protected string ``*(mixed arg) { return predef::`*(arg, lookup()); } - static array(string) `/(mixed arg) + protected array(string) `/(mixed arg) { return predef::`/(lookup(), arg); } - static int _sizeof() + protected int _sizeof() { return sizeof(lookup()); } - static int|string `[](int a,int|void b) + protected int|string `[](int a,int|void b) { if (query_num_arg() < 2) { return lookup()[a]; @@ -553,24 +553,24 @@ class DeferredLocale( static string project, return lookup()[a..b]; } - static array(int) _indices() + protected array(int) _indices() { return indices(lookup()); } - static array(int) _values() + protected array(int) _values() { return values(lookup()); } - static mixed cast(string to) + protected mixed cast(string to) { if(to=="string") return lookup(); if(to=="mixed" || to=="object") return this; error( "Cannot cast DeferredLocale to "+to+".\n" ); } - static int _is_type(string type) { + protected int _is_type(string type) { return type=="string"; } } diff --git a/lib/modules/MIME.pmod/ext_to_media_type.pmod b/lib/modules/MIME.pmod/ext_to_media_type.pmod index 58e8695e138090ee2759b02e899458be0f3873e2..cd4f0a2f856b11483f2ad81e7ba0d943a370d2b4 100644 --- a/lib/modules/MIME.pmod/ext_to_media_type.pmod +++ b/lib/modules/MIME.pmod/ext_to_media_type.pmod @@ -1,8 +1,8 @@ -// $Id: ext_to_media_type.pmod,v 1.6 2003/12/03 10:22:52 nilsson Exp $ +// $Id: ext_to_media_type.pmod,v 1.7 2008/06/28 16:36:55 nilsson Exp $ #pike __REAL_VERSION__ -static constant small_ext2type = ([ +protected constant small_ext2type = ([ "html" : "text/html", "txt" : "text/plain", "css" : "text/css", @@ -12,7 +12,7 @@ static constant small_ext2type = ([ "png" : "image/png", ]); -static mapping ext2type = ([ +protected mapping ext2type = ([ // Last synchronized with IANA media types list: 2002-02-05 (except // applications) diff --git a/lib/modules/MIME.pmod/module.pmod b/lib/modules/MIME.pmod/module.pmod index 51b6ada13fc80d2a7dad5bc19e3952e8153b98ec..8e89c02832d72898a937fe0f1a3ae76ccf179760 100644 --- a/lib/modules/MIME.pmod/module.pmod +++ b/lib/modules/MIME.pmod/module.pmod @@ -3,7 +3,7 @@ // RFC1521 functionality for Pike // // Marcus Comstedt 1996-1999 -// $Id: module.pmod,v 1.19 2008/01/25 22:26:29 grubba Exp $ +// $Id: module.pmod,v 1.20 2008/06/28 16:36:55 nilsson Exp $ //! RFC1521, the @b{Multipurpose Internet Mail Extensions@} memo, defines a @@ -225,7 +225,7 @@ string encode_word( string|array(string) word, string encoding ) return "=?"+word[1]+"?"+encoding[0..0]+"?"+ enc +"?="; } -static string remap(array(string) item) +protected string remap(array(string) item) { if (sizeof(item)>1 && item[1]) return master()->resolv("Locale")["Charset"] @@ -234,7 +234,7 @@ static string remap(array(string) item) return item[0]; } -static array(string) reremap(string word, string|function(string:string) selector, +protected array(string) reremap(string word, string|function(string:string) selector, string|void replacement,function(string:string)|void repcb) { if(max(@values(word))<128) @@ -684,8 +684,8 @@ class Message { import Array; - static string encoded_data; - static string decoded_data; + protected string encoded_data; + protected string decoded_data; //! This mapping contains all the headers of the message. //! diff --git a/lib/modules/Mapping.pmod b/lib/modules/Mapping.pmod index 2d63dd241b41522f661daef0bf167d2a1af0c78e..e5e3a9ae18179619c8241e8eef6e57c2c8c78f30 100644 --- a/lib/modules/Mapping.pmod +++ b/lib/modules/Mapping.pmod @@ -9,14 +9,14 @@ constant Iterator = __builtin.mapping_iterator; //! A mapping look-alike that overrides (ie shadows) another @[parent] mapping. //! //! The class implements most of the usual mapping operations. -class ShadowedMapping(static mapping|ShadowedMapping parent) +class ShadowedMapping(protected mapping|ShadowedMapping parent) { - static mapping shadow = ([]); + protected mapping shadow = ([]); - static mapping joined; - static mapping parent_copy; + protected mapping joined; + protected mapping parent_copy; - static int(0..1) modify_parent; + protected int(0..1) modify_parent; //! @decl void create(mapping|ShadowedMapping parent, @ //! mapping|void shadow, int(0..1)|void modify_parent) @@ -31,14 +31,14 @@ class ShadowedMapping(static mapping|ShadowedMapping parent) //! already present in @[shadow] can be modified by later //! operations. - static void create(mapping|void shadow, int(0..1)|void modify_parent) + protected void create(mapping|void shadow, int(0..1)|void modify_parent) { if (shadow) this_program::shadow = shadow + ([]); this_program::modify_parent = modify_parent; } // Updates the cached joined mapping if needed. - static void update_joined() + protected void update_joined() { if (!joined || !equal(parent, parent_copy)) { joined = [mapping](parent + shadow); @@ -46,14 +46,14 @@ class ShadowedMapping(static mapping|ShadowedMapping parent) } } - static mixed `[](mixed ind) + protected mixed `[](mixed ind) { mixed res = shadow[ind]; if (!zero_type(res)) return res; return parent[ind]; } - static void `[]=(mixed ind, mixed val) + protected void `[]=(mixed ind, mixed val) { joined = 0; if (modify_parent && zero_type(shadow[ind])) { @@ -63,23 +63,23 @@ class ShadowedMapping(static mapping|ShadowedMapping parent) } } - static mixed `->(string ind) + protected mixed `->(string ind) { return `[](ind); } - static void `->=(string ind, mixed val) + protected void `->=(string ind, mixed val) { `[]=(ind, val); } - static int(0..1) _equal(mixed other) + protected int(0..1) _equal(mixed other) { update_joined(); return equal(other, joined); } - static mixed _m_delete(mixed ind) + protected mixed _m_delete(mixed ind) { mixed res = m_delete(shadow, ind); if (zero_type(res)) { @@ -91,79 +91,79 @@ class ShadowedMapping(static mapping|ShadowedMapping parent) return res; } - static array(mixed) _indices() + protected array(mixed) _indices() { update_joined(); return indices(joined); } - static array(mixed) _values() + protected array(mixed) _values() { update_joined(); return values(joined); } - static mixed `+(mixed ... args) + protected mixed `+(mixed ... args) { update_joined(); return predef::`+(joined, @args); } - static mixed ``+(mixed ... args) + protected mixed ``+(mixed ... args) { update_joined(); return predef::`+(@args, joined); } - static mixed `-(mixed ... args) + protected mixed `-(mixed ... args) { update_joined(); return predef::`-(joined, @args); } - static mixed ``-(mixed ... args) + protected mixed ``-(mixed ... args) { update_joined(); return predef::`-(@args, joined); } - static mixed `|(mixed ... args) + protected mixed `|(mixed ... args) { update_joined(); return predef::`|(joined, @args); } - static mixed ``|(mixed ... args) + protected mixed ``|(mixed ... args) { update_joined(); return predef::`|(@args, joined); } - static mixed `&(mixed ... args) + protected mixed `&(mixed ... args) { update_joined(); return predef::`&(joined, @args); } - static mixed ``&(mixed ... args) + protected mixed ``&(mixed ... args) { update_joined(); return predef::`&(@args, joined); } - static mixed `^(mixed ... args) + protected mixed `^(mixed ... args) { update_joined(); return predef::`^(joined, @args); } - static mixed ``^(mixed ... args) + protected mixed ``^(mixed ... args) { update_joined(); return predef::`^(@args, joined); } - static mixed cast(string type) + protected mixed cast(string type) { update_joined(); switch(type) { @@ -173,13 +173,13 @@ class ShadowedMapping(static mapping|ShadowedMapping parent) return joined + ([]); } - static mixed _search(mixed val) + protected mixed _search(mixed val) { update_joined(); return search(joined, val); } - static string _sprintf(int c) + protected string _sprintf(int c) { update_joined(); return sprintf(sprintf("%%%c", c), joined); diff --git a/lib/modules/Parser.pmod/C.pmod b/lib/modules/Parser.pmod/C.pmod index f7d9cd5f7ebdc15952d9de169a2fea539ea76830..7039ec56d5d26bfe13ec6e165015bdb8d2984fc4 100644 --- a/lib/modules/Parser.pmod/C.pmod +++ b/lib/modules/Parser.pmod/C.pmod @@ -4,7 +4,7 @@ // // #pike __REAL_VERSION__ // -// $Id: C.pmod,v 1.49 2007/01/19 14:44:51 bill Exp $ +// $Id: C.pmod,v 1.50 2008/06/28 16:36:55 nilsson Exp $ //! Splits the @[data] string into an array of tokens. An additional //! element with a newline will be added to the resulting array of @@ -344,7 +344,7 @@ array(Token) tokenize(array(string) s, void|string file) return ret; } -static constant global_groupings = ([ "{":"}", "(":")", "[":"]" ]); +protected constant global_groupings = ([ "{":"}", "(":")", "[":"]" ]); //! Fold sub blocks of an array of tokens into sub arrays, //! for grouping purposes. diff --git a/lib/modules/Parser.pmod/LR.pmod/GrammarParser.pmod b/lib/modules/Parser.pmod/LR.pmod/GrammarParser.pmod index d385857b780037ca3fb374cb441259eedf2ca026..0a759436d71d6255a14191ab7d3b1ee98b9cf836 100755 --- a/lib/modules/Parser.pmod/LR.pmod/GrammarParser.pmod +++ b/lib/modules/Parser.pmod/LR.pmod/GrammarParser.pmod @@ -3,7 +3,7 @@ #pike __REAL_VERSION__ /* - * $Id: GrammarParser.pmod,v 1.5 2003/08/22 14:25:57 nilsson Exp $ + * $Id: GrammarParser.pmod,v 1.6 2008/06/28 16:36:55 nilsson Exp $ * * Generates a parser from a textual specification. * @@ -46,13 +46,13 @@ import Parser.LR; -static private Parser _parser = Parser(); +protected private Parser _parser = Parser(); /* * Scanner */ -static private class Scan { +protected private class Scan { string str = ""; int pos; @@ -148,9 +148,9 @@ static private class Scan { } } -static private Scan scanner = Scan(); +protected private Scan scanner = Scan(); -static private array(string) nonterminals = ({ +protected private array(string) nonterminals = ({ "translation_unit", "directives", "directive", @@ -165,18 +165,18 @@ static private array(string) nonterminals = ({ "priority", }); -static private ADT.Stack id_stack = ADT.Stack(); +protected private ADT.Stack id_stack = ADT.Stack(); -static private mapping(string:int) nonterminal_lookup = ([]); +protected private mapping(string:int) nonterminal_lookup = ([]); -static private Parser g; +protected private Parser g; -static private object master; +protected private object master; //! Error code from the parsing. int lr_error; -static private int add_nonterminal(string id) +protected private int add_nonterminal(string id) { int nt = nonterminal_lookup[id]; @@ -187,7 +187,7 @@ static private int add_nonterminal(string id) return nt; } -static private void add_tokens(array(string) tokens) +protected private void add_tokens(array(string) tokens) { /* NOOP */ #if 0 @@ -197,7 +197,7 @@ static private void add_tokens(array(string) tokens) #endif /* 0 */ } -static private void set_left_tokens(string ignore, int pri_val, array(string) tokens) +protected private void set_left_tokens(string ignore, int pri_val, array(string) tokens) { foreach (tokens, string token) { g->set_associativity(token, -1); /* Left associative */ @@ -205,7 +205,7 @@ static private void set_left_tokens(string ignore, int pri_val, array(string) to } } -static private string internal_symbol_to_string(int|string symbol) +protected private string internal_symbol_to_string(int|string symbol) { if (intp(symbol)) return nonterminals[symbol]; @@ -213,7 +213,7 @@ static private string internal_symbol_to_string(int|string symbol) return "\"" + symbol + "\""; } -static private string symbol_to_string(int|string symbol) +protected private string symbol_to_string(int|string symbol) { if (intp(symbol)) { if (symbol < id_stack->ptr) @@ -225,7 +225,7 @@ static private string symbol_to_string(int|string symbol) return "\""+symbol+"\""; } -static private void add_rule(int nt, string colon, array(mixed) symbols, string action) +protected private void add_rule(int nt, string colon, array(mixed) symbols, string action) { if (action == ";") { action = 0; diff --git a/lib/modules/Parser.pmod/LR.pmod/module.pmod b/lib/modules/Parser.pmod/LR.pmod/module.pmod index fc7c17749ea8653bb91f193de996fd1688186487..02521d7ca6ae37d57bf5f8c62e764c92c0be99ad 100644 --- a/lib/modules/Parser.pmod/LR.pmod/module.pmod +++ b/lib/modules/Parser.pmod/LR.pmod/module.pmod @@ -1,5 +1,5 @@ /* - * $Id: module.pmod,v 1.16 2008/01/09 16:10:29 grubba Exp $ + * $Id: module.pmod,v 1.17 2008/06/28 16:36:55 nilsson Exp $ * * A BNF-grammar in Pike. * Compiles to a LALR(1) state-machine. @@ -139,7 +139,7 @@ class Rule //! the elements of the rule. The return value of the function will become //! the value of this non-terminal. The default rule is to return the first //! argument. - static void create(int nt, array(string|int) r, function|string|void a) + protected void create(int nt, array(string|int) r, function|string|void a) { mixed symbol; @@ -181,7 +181,7 @@ class ErrorHandler //! @endint optional int(-1..1) verbose = 1; - static constant severity_kind = ([ NOTICE:"Notice", + protected constant severity_kind = ([ NOTICE:"Notice", WARNING:"Warning", ERROR:"Error" ]); @@ -201,7 +201,7 @@ class ErrorHandler //! //! @seealso //! @[verbose] - static void create(int(-1..1)|void verbosity) + protected void create(int(-1..1)|void verbosity) { if (!zero_type(verbosity)) { verbose = verbosity; @@ -226,21 +226,21 @@ class Parser mapping(int : array(Rule)) grammar = ([]); /* Priority table for terminal symbols */ - static mapping(string : Priority) operator_priority = ([]); + protected mapping(string : Priority) operator_priority = ([]); - static multiset(int|string) nullable = (< >); + protected multiset(int|string) nullable = (< >); #if 0 - static mapping(mixed : multiset(Rule)) derives = ([]); + protected mapping(mixed : multiset(Rule)) derives = ([]); /* Maps from symbol to which rules may start with that symbol */ - static mapping(mixed : multiset(Rule)) begins = ([]); + protected mapping(mixed : multiset(Rule)) begins = ([]); #endif /* 0 */ /* Maps from symbol to the rules that use the symbol * (used for finding nullable symbols) */ - static mapping(int : multiset(Rule)) used_by = ([]); + protected mapping(int : multiset(Rule)) used_by = ([]); //! The initial LR0 state. Kernel start_state; @@ -249,7 +249,7 @@ class Parser int lr_error=0; /* Number of next rule (used only for conflict resolving) */ - static int next_rule_number = 1; + protected int next_rule_number = 1; //! LR0 states that are already known to the compiler. mapping(string:Kernel) known_states = ([]); @@ -274,7 +274,7 @@ class Parser //! //! An LR(0) item, a partially parsed rule. //! - static class Item + protected class Item { //! The rule Rule r; @@ -307,7 +307,7 @@ class Parser //! Equal to r->number + offset. int item_id; - static string _sprintf() + protected string _sprintf() { array(string) res = ({ symbol_to_string(r->nonterminal), ":\t" }); @@ -332,7 +332,7 @@ class Parser } //! Implements an LR(1) state - static class Kernel { + protected class Kernel { //! Used to check if a rule already has been added when doing closures. multiset(Rule) rules = (<>); @@ -502,14 +502,14 @@ class Parser } } - static string _sprintf() + protected string _sprintf() { return sprintf("%{%s\n%}", items); } } //! This is a queue, which keeps the elements even after they are retrieved. - static class StateQueue { + protected class StateQueue { //! Index of the head of the queue. int head; @@ -553,7 +553,7 @@ class Parser /* Several cast to string functions */ - static string builtin_symbol_to_string(int|string symbol) + protected string builtin_symbol_to_string(int|string symbol) { if (intp(symbol)) { return "nonterminal"+symbol; @@ -562,7 +562,7 @@ class Parser } } - static function(int|string : string) symbol_to_string = builtin_symbol_to_string; + protected function(int|string : string) symbol_to_string = builtin_symbol_to_string; //! Pretty-prints a rule to a string. //! @@ -601,7 +601,7 @@ class Parser } //! Pretty-prints the current grammar to a string. - static string _sprintf() + protected string _sprintf() { array(string) res = ({}); @@ -836,7 +836,7 @@ class Parser /* Here come the functions used by the compiler */ - static Kernel first_state() + protected Kernel first_state() { Kernel state = Kernel(); @@ -869,9 +869,9 @@ class Parser //! In the queue section are the states that remain to be compiled. StateQueue s_q; - static ADT.Stack item_stack; + protected ADT.Stack item_stack; - static void traverse_items(Item i, + protected void traverse_items(Item i, function(int:void) conflict_func) { int depth; @@ -915,12 +915,12 @@ class Parser } } - static void shift_conflict(int empty) + protected void shift_conflict(int empty) { empty; /* Ignored */ } - static void handle_shift_conflicts() + protected void handle_shift_conflicts() { item_stack = ADT.Stack(131072); @@ -947,12 +947,12 @@ class Parser } } - static void follow_conflict(int empty) + protected void follow_conflict(int empty) { empty; /* Ignored */ } - static void handle_follow_conflicts() + protected void handle_follow_conflicts() { item_stack = ADT.Stack(131072); @@ -979,7 +979,7 @@ class Parser } } - static int go_through(Kernel state, int item_id, + protected int go_through(Kernel state, int item_id, Item current_item) { Item i, master; @@ -1024,7 +1024,7 @@ class Parser } } - static int repair(Kernel state, multiset(int|string) conflicts) + protected int repair(Kernel state, multiset(int|string) conflicts) { multiset(int|string) conflict_set = (<>); diff --git a/lib/modules/Parser.pmod/Pike.pmod b/lib/modules/Parser.pmod/Pike.pmod index 6cc48dffb96cdef0b65cc5215f480758267b29f0..4beb427e348f001de0032a2ea73b7872d9bb6fbf 100644 --- a/lib/modules/Parser.pmod/Pike.pmod +++ b/lib/modules/Parser.pmod/Pike.pmod @@ -4,7 +4,7 @@ // // #pike __REAL_VERSION__ // -// $Id: Pike.pmod,v 1.40 2007/06/01 06:13:28 mbaehr Exp $ +// $Id: Pike.pmod,v 1.41 2008/06/28 16:36:55 nilsson Exp $ //! This module parses and tokenizes Pike source code. @@ -58,7 +58,7 @@ class UnterminatedStringError string err_str; //! The string that failed to be tokenized - static void create(string _err_str, void|array bt) + protected void create(string _err_str, void|array bt) { err_str = _err_str; ::create(sprintf("Unterminated string: %O\n", err_str), bt); diff --git a/lib/modules/Parser.pmod/RCS.pike b/lib/modules/Parser.pmod/RCS.pike index e657695d9d7a8d29dfae7f7bdf894509ea6edf2a..40b84162266d1ec7582983db7542ce96fe13fb6c 100644 --- a/lib/modules/Parser.pmod/RCS.pike +++ b/lib/modules/Parser.pmod/RCS.pike @@ -1,7 +1,7 @@ #pike __REAL_VERSION__ inherit Parser._RCS; -// $Id: RCS.pike,v 1.38 2008/01/13 17:03:43 nilsson Exp $ +// $Id: RCS.pike,v 1.39 2008/06/28 16:36:55 nilsson Exp $ //! A RCS file parser that eats a RCS *,v file and presents nice pike //! data structures of its contents. @@ -60,12 +60,12 @@ mapping(string:Revision) revisions; //! (rcsfile(5), of course, fails to state such irrelevant information). array(mapping) trunk = ({}); -static mapping parse_mapping(array data) +protected mapping parse_mapping(array data) { return (mapping)(data/2); } -static string parse_string(string data, string|void leader) +protected string parse_string(string data, string|void leader) { return replace( data, "@@", "@" ); } @@ -313,12 +313,12 @@ void parse_deltatext_sections(array raw, //! do_something(rev); class DeltatextIterator { - static int finished, this_no, o; - static array raw; - static string this_rev; + protected int finished, this_no, o; + protected array raw; + protected string this_rev; - static function(string, mixed ...:void) callback; - static array callback_args; + protected function(string, mixed ...:void) callback; + protected array callback_args; //! @param deltatext_section //! the deltatext section of the RCS file in its entirety @@ -329,7 +329,7 @@ class DeltatextIterator //! Optional extra trailing arguments to be sent to @[progress_callback] //! @seealso //! the @tt{rcsfile(5)@} manpage outlines the sections of an RCS file - static void create(array deltatext_section, + protected void create(array deltatext_section, void|function(string, mixed ...:void) progress_callback, void|array(mixed) progress_callback_args) { @@ -352,7 +352,7 @@ class DeltatextIterator //! Drops the leading whitespace before next revision's deltatext //! entry and sets this_rev to the revision number we're about to read. int n; - static int(0..1) read_next() + protected int(0..1) read_next() { o = parse_deltatext_section(raw,o); return !(finished = !o); @@ -416,7 +416,7 @@ class DeltatextIterator //! if the rcs file is truncated, this method writes a descriptive //! error to stderr and then returns 0 - some nicer error handling //! wouldn't hurt - static int parse_deltatext_section(array raw, int o) + protected int parse_deltatext_section(array raw, int o) { if( sizeof(raw)<=o || !symbol_is_revision( raw[o] ) ) return 0; @@ -602,7 +602,7 @@ string get_contents_for_revision( string|Revision rev ) return rev->text = new->get(); } -static string kwchars = Array.uniq(sort("Author" "Date" "Header" "Id" "Name" +protected string kwchars = Array.uniq(sort("Author" "Date" "Header" "Id" "Name" "Locker" /*"Log"*/ "RCSfile" "Revision" "Source" "State"/1)) * ""; diff --git a/lib/modules/Parser.pmod/SGML.pike b/lib/modules/Parser.pmod/SGML.pike index 7e9b996d758940e259ba23d9ccbf44ff5d34fcd9..54d04ad1a00a2e329bdde3fc5773d8b88f111200 100644 --- a/lib/modules/Parser.pmod/SGML.pike +++ b/lib/modules/Parser.pmod/SGML.pike @@ -1,5 +1,5 @@ // -// $Id: SGML.pike,v 1.2 2003/11/07 18:40:08 nilsson Exp $ +// $Id: SGML.pike,v 1.3 2008/06/28 16:36:55 nilsson Exp $ #pike __REAL_VERSION__ @@ -68,7 +68,7 @@ class SGML string file; array(SGMLatom) data=({}); - static string _sprintf(int t, mapping m) + protected string _sprintf(int t, mapping m) { if (t=='O') { @@ -89,13 +89,13 @@ class SGML } } - static array(array(SGMLatom|string)) res=({({})}); - static array(SGMLatom) tagstack=({}); - static array(object) errors; + protected array(array(SGMLatom|string)) res=({({})}); + protected array(SGMLatom) tagstack=({}); + protected array(object) errors; array(SGMLatom|string) data; - static private array(string) got_tag(object g) + protected private array(string) got_tag(object g) { string name=g->tag_name(); @@ -144,7 +144,7 @@ class SGML } - private static object p=.HTML(); + private protected object p=.HTML(); //! @decl void create() //! @decl void create(string filename) @@ -153,7 +153,7 @@ class SGML //! @note //! No, it doesn't read the file itself. See @[feed()]. - static int i; + protected int i; void create(void|string _file) { diff --git a/lib/modules/Parser.pmod/XML.pmod/DOM.pmod b/lib/modules/Parser.pmod/XML.pmod/DOM.pmod index 2077df285447afc7c6e8a6c77acd5c7443385c0d..0be1615297883d6eb79ce9ecfc6d27074c3d7235 100644 --- a/lib/modules/Parser.pmod/XML.pmod/DOM.pmod +++ b/lib/modules/Parser.pmod/XML.pmod/DOM.pmod @@ -17,9 +17,9 @@ class DOMException(int code) { constant is_generic_error = 1; constant is_dom_exception = 1; - static array backtrace = predef::backtrace()[..<2]; + protected array backtrace = predef::backtrace()[..<2]; - static constant symbolic = ([ + protected constant symbolic = ([ INDEX_SIZE_ERR: "INDEX_SIZE_ERR", DOMSTRING_SIZE_ERR: "DOMSTRING_SIZE_ERR", HIERARCHY_REQUEST_ERR: "HIERARCHY_REQUEST_ERR", @@ -32,7 +32,7 @@ class DOMException(int code) { INUSE_ATTRIBUTE_ERR: "INUSE_ATTRIBUTE_ERR", ]); - static constant human_readable = ([ + protected constant human_readable = ([ INDEX_SIZE_ERR: "index out of range", DOMSTRING_SIZE_ERR: "specified range of text does not fit into DOMString", HIERARCHY_REQUEST_ERR: "node inserted somewhere it doesn't belong", @@ -45,7 +45,7 @@ class DOMException(int code) { INUSE_ATTRIBUTE_ERR: "attempted to add an attribute that is already in use", ]); - static string|array `[] (int i) + protected string|array `[] (int i) { switch (i) { case 0: @@ -56,7 +56,7 @@ class DOMException(int code) { } } - static string _sprintf(int mode, mapping options) + protected string _sprintf(int mode, mapping options) { return mode == 'O' && sprintf("%O(%s)", this_program, (string)(symbolic[code]||code) ); @@ -87,14 +87,14 @@ class DOMImplementation class NodeList { - static array(Node) nodes; + protected array(Node) nodes; - static NodeList `+(NodeList nl) { + protected NodeList `+(NodeList nl) { return NodeList(values(this)+values(nl)); } - static Node `[](int index) { return item(index); } - static int _sizeof() { return get_length(); } - static array(Node) cast(string to) { + protected Node `[](int index) { return item(index); } + protected int _sizeof() { return get_length(); } + protected array(Node) cast(string to) { return to[..4] == "array" && values(this); } @@ -108,21 +108,21 @@ class NodeList return sizeof(nodes); } - static array(int) _indices() { return indices(nodes); } - static array(Node) _values() { return copy_value(nodes); } - static Array.Iterator _get_iterator() { return Array.Iterator(nodes); } + protected array(int) _indices() { return indices(nodes); } + protected array(Node) _values() { return copy_value(nodes); } + protected Array.Iterator _get_iterator() { return Array.Iterator(nodes); } - static void create(array(Node)|void elts) { nodes = elts || ({}); } + protected void create(array(Node)|void elts) { nodes = elts || ({}); } } class NamedNodeMap { - static Document owner_document; - static mapping(string:Node) map = ([]); + protected Document owner_document; + protected mapping(string:Node) map = ([]); - static int is_readonly() { return 0; } - static void bind(Node n) { } - static void unbind(Node n) { } + protected int is_readonly() { return 0; } + protected void bind(Node n) { } + protected void unbind(Node n) { } Node get_named_item(string name) { return map[name]; } @@ -154,13 +154,13 @@ class NamedNodeMap return old; } - static Node `[](int|string index) + protected Node `[](int|string index) { return stringp(index)? get_named_item(index) : item(index); } - static int _sizeof() { return get_length(); } - static mapping(string:Node) cast(string to) { + protected int _sizeof() { return get_length(); } + protected mapping(string:Node) cast(string to) { return to[..6] == "mapping" && copy_value(map); } @@ -174,11 +174,11 @@ class NamedNodeMap return sizeof(map); } - static array(string) _indices() { return indices(map); } - static array(Node) _values() { return values(map); } - static Mapping.Iterator _get_iterator() { return Mapping.Iterator(map); } + protected array(string) _indices() { return indices(map); } + protected array(Node) _values() { return values(map); } + protected Mapping.Iterator _get_iterator() { return Mapping.Iterator(map); } - static void create(Document owner) + protected void create(Document owner) { owner_document = owner; } @@ -200,7 +200,7 @@ class Node constant DOCUMENT_FRAGMENT_NODE = 11; constant NOTATION_NODE = 12; - static class NodeNodeList { + protected class NodeNodeList { inherit NodeList; protected int search(Node n) { return predef::search(nodes, n); } @@ -212,9 +212,9 @@ class Node } } - static Node parent_node; - static NodeNodeList child_nodes; - static Document owner_document; + protected Node parent_node; + protected NodeNodeList child_nodes; + protected Document owner_document; protected int is_readonly() { return parent_node && parent_node->is_readonly(); @@ -263,9 +263,9 @@ class Node NamedNodeMap get_attributes() { return 0; } Document get_owner_document() { return owner_document; } - static int child_is_allowed(Node child) { return 0; } + protected int child_is_allowed(Node child) { return 0; } - static int is_ancestor(Node node) + protected int is_ancestor(Node node) { Node loc = this; while(loc) { @@ -346,7 +346,7 @@ class Node throw(DOMException(DOMException.NOT_SUPPORTED_ERR)); } - static string _sprintf(int mode, mapping options) + protected string _sprintf(int mode, mapping options) { return mode == 'O' && sprintf("%O(%s)", this_program, get_node_name()); @@ -369,14 +369,14 @@ class DocumentFragment return new; } - static int child_is_allowed(Node child) + protected int child_is_allowed(Node child) { return (<ELEMENT_NODE,PROCESSING_INSTRUCTION_NODE, COMMENT_NODE,TEXT_NODE,CDATA_SECTION_NODE, ENTITY_REFERENCE_NODE>)[child->get_node_type()]; } - static void create(Document owner) + protected void create(Document owner) { owner_document = owner; } @@ -386,17 +386,17 @@ class Document { inherit Node; - static program ElementImpl = Element; - static program DocumentFragmentImpl = DocumentFragment; - static program TextImpl = Text; - static program CommentImpl = Comment; - static program CDATASectionImpl = CDATASection; - static program ProcessingInstructionImpl = ProcessingInstruction; - static program AttrImpl = Attr; - static program EntityReferenceImpl = EntityReference; - - static DOMImplementation implementation; - static string namespace_uri, qualified_name; + protected program ElementImpl = Element; + protected program DocumentFragmentImpl = DocumentFragment; + protected program TextImpl = Text; + protected program CommentImpl = Comment; + protected program CDATASectionImpl = CDATASection; + protected program ProcessingInstructionImpl = ProcessingInstruction; + protected program AttrImpl = Attr; + protected program EntityReferenceImpl = EntityReference; + + protected DOMImplementation implementation; + protected string namespace_uri, qualified_name; int get_node_type() { return DOCUMENT_NODE; } string get_node_name() { return "#document"; } @@ -464,7 +464,7 @@ class Document return get_document_element()->get_elements_by_tag_name(tagname); } - static int child_is_allowed(Node child) + protected int child_is_allowed(Node child) { if(child->get_node_type() == ELEMENT_NODE) return !get_document_element(); @@ -473,7 +473,7 @@ class Document DOCUMENT_TYPE_NODE>)[child->get_node_type()]; } - static void create(DOMImplementation i, string ns, string qn, + protected void create(DOMImplementation i, string ns, string qn, DocumentType|void doctype) { implementation = i; @@ -489,7 +489,7 @@ class CharacterData { inherit Node; - static string node_value; + protected string node_value; string get_node_value() { return node_value; } void set_node_value(string data) @@ -549,9 +549,9 @@ class Attr { inherit Node; - static string name; - static int specified = 1; - static Element bound_to; + protected string name; + protected int specified = 1; + protected Element bound_to; int get_node_type() { return ATTRIBUTE_NODE; } string get_node_name() { return get_name(); } @@ -592,13 +592,13 @@ class Attr bound_to = new_element; } - static int child_is_allowed(Node child) + protected int child_is_allowed(Node child) { return child->get_node_type() == TEXT_NODE || child->get_node_type() == ENTITY_REFERENCE_NODE; } - static void create(Document owner, string _name, string|void default_value) + protected void create(Document owner, string _name, string|void default_value) { owner_document = owner; name = _name; @@ -614,21 +614,21 @@ class Element { inherit Node : node; - static string tag_name; - static NamedNodeMap attributes; + protected string tag_name; + protected NamedNodeMap attributes; - static NamedNodeMap create_attributes() + protected NamedNodeMap create_attributes() { return class { inherit NamedNodeMap; - static int is_readonly() { return node::is_readonly(); } - static void bind(Node n) + protected int is_readonly() { return node::is_readonly(); } + protected void bind(Node n) { n->_bind(function_object(this_program)); } - static void unbind(Node n) { + protected void unbind(Node n) { n->_bind(0); } @@ -694,7 +694,7 @@ class Element return res; } - static void low_normalize(Node n) + protected void low_normalize(Node n) { while(n) { Node s = n->get_next_sibling(); @@ -723,14 +723,14 @@ class Element return new; } - static int child_is_allowed(Node child) + protected int child_is_allowed(Node child) { return (<ELEMENT_NODE,PROCESSING_INSTRUCTION_NODE, COMMENT_NODE,TEXT_NODE,CDATA_SECTION_NODE, ENTITY_REFERENCE_NODE>)[child->get_node_type()]; } - static void create(Document owner, string name) + protected void create(Document owner, string name) { owner_document = owner; tag_name = name; @@ -758,7 +758,7 @@ class Text return owner_document->create_text_node(get_data()); } - static void create(Document owner, string data) + protected void create(Document owner, string data) { owner_document = owner; set_data(data); @@ -776,7 +776,7 @@ class Comment return owner_document->create_comment(get_data()); } - static void create(Document owner, string data) + protected void create(Document owner, string data) { owner_document = owner; set_data(data); @@ -794,7 +794,7 @@ class CDATASection return owner_document->create_cdata_section(get_data()); } - static void create(Document owner, string data) + protected void create(Document owner, string data) { owner_document = owner; set_data(data); @@ -805,9 +805,9 @@ class DocumentType { inherit Node; - static string name, public_id, system_id; - static NamedNodeMap entities, notations; - static DOMImplementation implementation; + protected string name, public_id, system_id; + protected NamedNodeMap entities, notations; + protected DOMImplementation implementation; int get_node_type() { return DOCUMENT_TYPE_NODE; } string get_node_name() { return get_name(); } @@ -819,17 +819,17 @@ class DocumentType protected void _set_owner_document(Document d) { owner_document = d; } - static NamedNodeMap create_entities() + protected NamedNodeMap create_entities() { return entities = NamedNodeMap(owner_document); } - static NamedNodeMap create_notations() + protected NamedNodeMap create_notations() { return notations = NamedNodeMap(owner_document); } - static void create(DOMImplementation i, string qn, + protected void create(DOMImplementation i, string qn, string|void pubid, string|void sysid) { implementation = i; @@ -843,7 +843,7 @@ class Notation { inherit Node; - static string name, public_id, system_id; + protected string name, public_id, system_id; int get_node_type() { return NOTATION_NODE; } string get_node_name() { return name; } @@ -851,7 +851,7 @@ class Notation string get_system_id() { return system_id; } protected int is_readonly() { return 1; } - static void create(Document owner, string _name, string p_id, string s_id) + protected void create(Document owner, string _name, string p_id, string s_id) { owner_document = owner; name = _name; @@ -864,7 +864,7 @@ class Entity { inherit Node; - static string name, public_id, system_id, notation_name; + protected string name, public_id, system_id, notation_name; int get_node_type() { return ENTITY_NODE; } string get_node_name() { return name; } @@ -878,14 +878,14 @@ class Entity return to == "string" && ((array(string))get_child_nodes())*""; } - static int child_is_allowed(Node child) + protected int child_is_allowed(Node child) { return (<ELEMENT_NODE,PROCESSING_INSTRUCTION_NODE, COMMENT_NODE,TEXT_NODE,CDATA_SECTION_NODE, ENTITY_REFERENCE_NODE>)[child->get_node_type()]; } - static void create(Document owner, string _name, string p_id, string s_id, + protected void create(Document owner, string _name, string p_id, string s_id, string n_name, DocumentFragment|void value) { owner_document = owner; @@ -902,8 +902,8 @@ class EntityReference { inherit Node; - static string name; - static Entity entity; + protected string name; + protected Entity entity; int get_node_type() { return ENTITY_REFERENCE_NODE; } string get_node_name() { return name; } @@ -936,7 +936,7 @@ class EntityReference int has_child_nodes() { return entity && entity->has_child_nodes(); } - static void create(Document owner, string _name, Entity|void _entity) + protected void create(Document owner, string _name, Entity|void _entity) { owner_document = owner; name = _name; @@ -948,7 +948,7 @@ class ProcessingInstruction { inherit Node; - static string target, node_value; + protected string target, node_value; int get_node_type() { return PROCESSING_INSTRUCTION_NODE; } string get_node_name() { return get_target(); } @@ -967,7 +967,7 @@ class ProcessingInstruction return owner_document->create_processing_instruction(target, get_data()); } - static void create(Document owner, string _target, string data) + protected void create(Document owner, string _target, string data) { owner_document = owner; target = _target; @@ -979,19 +979,19 @@ class ProcessingInstruction class ParseException { - static string message, pubid, sysid; - static int loc; + protected string message, pubid, sysid; + protected int loc; constant is_generic_error = 1; - static array backtrace = predef::backtrace()[..<2]; + protected array backtrace = predef::backtrace()[..<2]; int get_location() { return loc; } string get_public_id() { return pubid; } string get_system_id() { return sysid; } string get_message() { return message; } - static string|array `[] (int i) + protected string|array `[] (int i) { switch (i) { case 0: @@ -1001,14 +1001,14 @@ class ParseException } } - static string _sprintf(int mode, mapping options) + protected string _sprintf(int mode, mapping options) { return mode == 'O' && sprintf("%O(%O /* %O char %d */)", this_program, message, sysid, loc); } - static void create(string _message, string|void _sysid, string|void _pubid, + protected void create(string _message, string|void _sysid, string|void _pubid, int|void _loc) { message = _message; @@ -1020,8 +1020,8 @@ class ParseException class InputSource { - static string sysid, pubid, encoding; - static Stdio.File file; + protected string sysid, pubid, encoding; + protected Stdio.File file; string get_public_id() { return pubid; } string get_system_id() { return sysid; } @@ -1039,7 +1039,7 @@ class InputSource { return data; } - static Stdio.File get_external_file(string sysid, string|void pubid) + protected Stdio.File get_external_file(string sysid, string|void pubid) { Stdio.File f = Stdio.File(); if(!f->open(sysid, "r")) @@ -1047,7 +1047,7 @@ class InputSource { return f; } - static void create(Stdio.File|string|void input) + protected void create(Stdio.File|string|void input) { if(input) if(stringp(input)) { @@ -1060,13 +1060,13 @@ class InputSource { class AbstractDOMParser { - static class ErrorHandler { + protected class ErrorHandler { void error(ParseException exception); void fatal_error(ParseException exception); void warning(ParseException exception); }; - static ErrorHandler error_handler = this; + protected ErrorHandler error_handler = this; void error(ParseException exception) { throw(exception); } void fatal_error(ParseException exception) { throw(exception); } @@ -1074,23 +1074,23 @@ class AbstractDOMParser void set_error_handler(ErrorHandler handler) { error_handler = handler; } - static Document document; - static Node current_node; - static array(Node) node_stack; + protected Document document; + protected Node current_node; + protected array(Node) node_stack; Document get_document() { return document; } - static DOMImplementation get_dom_implementation() + protected DOMImplementation get_dom_implementation() { return DOMImplementation(); } - static Document create_document(InputSource s) + protected Document create_document(InputSource s) { return get_dom_implementation()->create_document(0, 0, 0); } - static object|void parse_callback(string ty, string name, mapping attributes, + protected object|void parse_callback(string ty, string name, mapping attributes, array|string contents, mapping info, InputSource input) { @@ -1168,7 +1168,7 @@ class AbstractDOMParser } } - static void _parse(string data, function cb, InputSource input); + protected void _parse(string data, function cb, InputSource input); void parse(InputSource|string source) { @@ -1183,16 +1183,16 @@ class AbstractDOMParser class NonValidatingDOMParser { inherit AbstractDOMParser; - static inherit .Simple : xml; + protected inherit .Simple : xml; - static string autoconvert(string data, InputSource input) + protected string autoconvert(string data, InputSource input) { mixed err = catch{ return xml::autoconvert(data); }; throw(ParseException(err[0], input->get_system_id(), input->get_public_id(), 0)); } - static void _parse(string data, function cb, InputSource input) + protected void _parse(string data, function cb, InputSource input) { xml::parse(autoconvert(data, input), cb, input); } @@ -1201,9 +1201,9 @@ class NonValidatingDOMParser class DOMParser { inherit AbstractDOMParser; - static inherit Parser.XML.Validating : xml; + protected inherit Parser.XML.Validating : xml; - static string autoconvert(string data, InputSource input) + protected string autoconvert(string data, InputSource input) { mixed err = catch{ return xml::autoconvert(data); }; throw(ParseException(err[0]-"\n", input->get_system_id(), @@ -1219,7 +1219,7 @@ class DOMParser return (unparsed? is->get_data() : autoconvert(is->get_data(), is)); } - static void _parse(string data, function cb, InputSource input) + protected void _parse(string data, function cb, InputSource input) { xml::parse(autoconvert(data, input), cb, input); } diff --git a/lib/modules/Parser.pmod/XML.pmod/NSTree.pmod b/lib/modules/Parser.pmod/XML.pmod/NSTree.pmod index 5db42d949b65120ec6e8bf7794c45142e72600a1..b7e3fdec4f86e5e16ef2b402b783758c3eb8e3e0 100644 --- a/lib/modules/Parser.pmod/XML.pmod/NSTree.pmod +++ b/lib/modules/Parser.pmod/XML.pmod/NSTree.pmod @@ -13,9 +13,9 @@ class NSNode { // New stuff /* static */ string default_ns; - static mapping(string:string) nss; - static string element_ns; - static mapping(string:mapping(string:string)) ns_attrs = ([]); + protected mapping(string:string) nss; + protected string element_ns; + protected mapping(string:mapping(string:string)) ns_attrs = ([]); //! Returns the namespace in which the current element is defined in. string get_ns() { return element_ns; } @@ -74,7 +74,7 @@ class NSNode { res[sym]=nss[sym]; } - static string make_prefix(string ns) { + protected string make_prefix(string ns) { // FIXME: Cache? #if constant(Crypto.MD5) return String.string2hex(Crypto.MD5->hash(ns))[..10]; @@ -298,7 +298,7 @@ class NSNode { } } -static NSNode|int(0..0) parse_xml_callback(string type, string name, +protected NSNode|int(0..0) parse_xml_callback(string type, string name, mapping attr, string|array contents, mixed location, mixed ...extra) { diff --git a/lib/modules/Parser.pmod/XML.pmod/Tree.pmod b/lib/modules/Parser.pmod/XML.pmod/Tree.pmod index 0609127c58a72cd501863cdeb0f328b8e21974a3..bd65f2ad8cf75fa9af20eb77c7133781e5844b3b 100644 --- a/lib/modules/Parser.pmod/XML.pmod/Tree.pmod +++ b/lib/modules/Parser.pmod/XML.pmod/Tree.pmod @@ -1,7 +1,7 @@ #pike __REAL_VERSION__ /* - * $Id: Tree.pmod,v 1.71 2008/06/01 14:52:59 grubba Exp $ + * $Id: Tree.pmod,v 1.72 2008/06/28 16:36:55 nilsson Exp $ * */ @@ -309,7 +309,7 @@ class AbstractSimpleNode { //! @note //! The [] operator will select a node from all the nodes children, //! not just its element children. - static AbstractSimpleNode `[](int pos) + protected AbstractSimpleNode `[](int pos) { // Treat pos as index into array if ((pos < 0) || (pos > sizeof(mChildren) - 1)) @@ -528,7 +528,7 @@ class AbstractNode { AbstractNode get_parent() { return (mParent); } #if 0 - static void create() + protected void create() { error("Creating a plain AbstractNode.\n"); } @@ -796,24 +796,24 @@ class AbstractNode { } //! Node in XML tree -static class VirtualNode { +protected class VirtualNode { // Member variables for this node type - static int mNodeType; - static string mShortNamespace = ""; // Namespace prefix - static string mNamespace; // Resolved namespace - static string mTagName; - static mapping(string:string) mAttributes; // Resolved attributes - static mapping(string:string) mShortAttributes; // Shortened attributes - static array(Node) mAttrNodes; // created on demand - static string mText; - static int mDocOrder; + protected int mNodeType; + protected string mShortNamespace = ""; // Namespace prefix + protected string mNamespace; // Resolved namespace + protected string mTagName; + protected mapping(string:string) mAttributes; // Resolved attributes + protected mapping(string:string) mShortAttributes; // Shortened attributes + protected array(Node) mAttrNodes; // created on demand + protected string mText; + protected int mDocOrder; // Functions implemented via multiple inheritance. array(AbstractNode) get_children(); int walk_preorder(function(AbstractSimpleNode, mixed ...:int|void) callback, mixed ... args); - static VirtualNode low_clone() + protected VirtualNode low_clone() { return this_program(get_node_type(), get_full_name(), get_attributes(), get_text()); @@ -887,7 +887,7 @@ static class VirtualNode { } //! - static void create(int type, string name, mapping attr, string text) + protected void create(int type, string name, mapping attr, string text) { if (name) { if (has_value(name, ":") && sscanf (name, "%*[^/:]%*c") == 2) { @@ -1011,7 +1011,7 @@ static class VirtualNode { } // FIXME: Consider moving this to the corresponding base node classes? - static void low_render_xml(String.Buffer data, Node n, + protected void low_render_xml(String.Buffer data, Node n, function(string:string) textq, function(string:string) attrq, void|mapping(string:string) namespace_lookup) @@ -1134,7 +1134,7 @@ static class VirtualNode { // Create a new XML-header if there's none. // // Add an encoding attribute if there is none. - static string get_encoding() + protected string get_encoding() { Node xml_header; if (sizeof(get_children()) && @@ -1376,7 +1376,7 @@ class Node } // Override AbstractNode::`[] - static Node `[](string|int pos) + protected Node `[](string|int pos) { // If string indexing we find attributes which match the string if (stringp(pos)) { @@ -1490,10 +1490,10 @@ class XMLParser } } - static this_program node_factory(int type, string name, + protected this_program node_factory(int type, string name, mapping attr, string text); - static this_program|int(0..0) + protected this_program|int(0..0) parse_xml_callback(string type, string name, mapping attr, string|array contents, mixed location, mixed ...extra) @@ -1699,7 +1699,7 @@ Node parse_file(string path, int(0..1)|void parse_namespaces) return parse_input(data, 0, 0, 0, parse_namespaces); } -static class DTDElementHelper +protected class DTDElementHelper { array expression; array get_expression() @@ -1751,7 +1751,7 @@ class SimpleRootNode inherit SimpleNode; inherit XMLParser; - static mapping(string:SimpleElementNode) node_ids; + protected mapping(string:SimpleElementNode) node_ids; //! Find the element with the specified id. //! @@ -1788,12 +1788,12 @@ class SimpleRootNode return node_ids[id]; } - static SimpleNode low_clone() + protected SimpleNode low_clone() { return SimpleRootNode(); } - static SimpleNode node_factory(int type, string name, + protected SimpleNode node_factory(int type, string name, mapping attr, string|array text) { switch(type) { @@ -1811,7 +1811,7 @@ class SimpleRootNode } } - static void create(string|void data, + protected void create(string|void data, mapping|void predefined_entities, ParseFlags|void flags, string|void default_namespace) @@ -1826,11 +1826,11 @@ class SimpleRootNode class SimpleTextNode { inherit SimpleNode; - static SimpleNode low_clone() + protected SimpleNode low_clone() { return SimpleTextNode(get_text()); } - static void create(string text) + protected void create(string text) { ::create(XML_TEXT, "", 0, text); } @@ -1839,11 +1839,11 @@ class SimpleTextNode class SimpleCommentNode { inherit SimpleNode; - static SimpleNode low_clone() + protected SimpleNode low_clone() { return SimpleCommentNode(get_text()); } - static void create(string text) + protected void create(string text) { ::create(XML_COMMENT, "", 0, text); } @@ -1852,11 +1852,11 @@ class SimpleCommentNode class SimpleHeaderNode { inherit SimpleNode; - static SimpleNode low_clone() + protected SimpleNode low_clone() { return SimpleHeaderNode(get_attributes()); } - static void create(mapping(string:string) attrs) + protected void create(mapping(string:string) attrs) { ::create(XML_HEADER, "", attrs, ""); } @@ -1865,11 +1865,11 @@ class SimpleHeaderNode class SimplePINode { inherit SimpleNode; - static SimpleNode low_clone() + protected SimpleNode low_clone() { return SimplePINode(get_full_name(), get_attributes(), get_text()); } - static void create(string name, mapping(string:string) attrs, + protected void create(string name, mapping(string:string) attrs, string contents) { ::create(XML_PI, name, attrs, contents); @@ -1879,11 +1879,11 @@ class SimplePINode class SimpleDoctypeNode { inherit SimpleNode; - static SimpleNode low_clone() + protected SimpleNode low_clone() { return SimpleDoctypeNode(get_full_name(), get_attributes(), 0); } - static void create(string name, mapping(string:string) attrs, + protected void create(string name, mapping(string:string) attrs, array contents) { ::create(XML_DOCTYPE, name, attrs, ""); @@ -1896,11 +1896,11 @@ class SimpleDoctypeNode class SimpleDTDEntityNode { inherit SimpleNode; - static SimpleNode low_clone() + protected SimpleNode low_clone() { return SimpleDTDEntityNode(get_full_name(), get_attributes(), get_text()); } - static void create(string name, mapping(string:string) attrs, + protected void create(string name, mapping(string:string) attrs, string contents) { ::create(DTD_ENTITY, name, attrs, contents); @@ -1912,11 +1912,11 @@ class SimpleDTDElementNode inherit SimpleNode; inherit DTDElementHelper; - static SimpleNode low_clone() + protected SimpleNode low_clone() { return SimpleDTDElementNode(get_full_name(), get_expression()); } - static void create(string name, array expression) + protected void create(string name, array expression) { this_program::expression = expression; ::create(DTD_ELEMENT, name, 0, ""); @@ -1926,11 +1926,11 @@ class SimpleDTDElementNode class SimpleDTDAttlistNode { inherit SimpleNode; - static SimpleNode low_clone() + protected SimpleNode low_clone() { return SimpleDTDAttlistNode(get_full_name(), get_attributes(), get_text()); } - static void create(string name, mapping(string:string) attrs, + protected void create(string name, mapping(string:string) attrs, string contents) { ::create(DTD_ATTLIST, name, attrs, contents); @@ -1940,11 +1940,11 @@ class SimpleDTDAttlistNode class SimpleDTDNotationNode { inherit SimpleNode; - static SimpleNode low_clone() + protected SimpleNode low_clone() { return SimpleDTDNotationNode(get_full_name(), get_attributes(), get_text()); } - static void create(string name, mapping(string:string) attrs, + protected void create(string name, mapping(string:string) attrs, string contents) { ::create(DTD_NOTATION, name, attrs, contents); @@ -1954,11 +1954,11 @@ class SimpleDTDNotationNode class SimpleElementNode { inherit SimpleNode; - static SimpleNode low_clone() + protected SimpleNode low_clone() { return SimpleElementNode(get_full_name(), get_attributes()); } - static void create(string name, mapping(string:string) attrs) + protected void create(string name, mapping(string:string) attrs) { ::create(XML_ELEMENT, name, attrs, ""); } @@ -1972,7 +1972,7 @@ class RootNode inherit Node; inherit XMLParser; - static mapping(string:ElementNode) node_ids; + protected mapping(string:ElementNode) node_ids; //! Find the element with the specified id. //! @@ -2009,12 +2009,12 @@ class RootNode return node_ids[id]; } - static Node low_clone() + protected Node low_clone() { return RootNode(); } - static Node node_factory(int type, string name, + protected Node node_factory(int type, string name, mapping attr, string|array text) { switch(type) { @@ -2032,7 +2032,7 @@ class RootNode } } - static void create(string|void data, + protected void create(string|void data, mapping|void predefined_entities, ParseFlags|void flags) { @@ -2046,11 +2046,11 @@ class RootNode class TextNode { inherit Node; - static Node low_clone() + protected Node low_clone() { return TextNode(get_text()); } - static void create(string text) + protected void create(string text) { ::create(XML_TEXT, "", 0, text); } @@ -2059,11 +2059,11 @@ class TextNode class CommentNode { inherit Node; - static Node low_clone() + protected Node low_clone() { return CommentNode(get_text()); } - static void create(string text) + protected void create(string text) { ::create(XML_COMMENT, "", 0, text); } @@ -2072,11 +2072,11 @@ class CommentNode class HeaderNode { inherit Node; - static Node low_clone() + protected Node low_clone() { return HeaderNode(get_attributes()); } - static void create(mapping(string:string) attrs) + protected void create(mapping(string:string) attrs) { ::create(XML_HEADER, "", attrs, ""); } @@ -2085,11 +2085,11 @@ class HeaderNode class PINode { inherit Node; - static Node low_clone() + protected Node low_clone() { return PINode(get_full_name(), get_attributes(), get_text()); } - static void create(string name, mapping(string:string) attrs, + protected void create(string name, mapping(string:string) attrs, string contents) { ::create(XML_PI, name, attrs, contents); @@ -2099,11 +2099,11 @@ class PINode class DoctypeNode { inherit Node; - static Node low_clone() + protected Node low_clone() { return DoctypeNode(get_full_name(), get_attributes(), 0); } - static void create(string name, mapping(string:string) attrs, + protected void create(string name, mapping(string:string) attrs, array contents) { ::create(XML_DOCTYPE, name, attrs, ""); @@ -2116,11 +2116,11 @@ class DoctypeNode class DTDEntityNode { inherit Node; - static Node low_clone() + protected Node low_clone() { return DTDEntityNode(get_full_name(), get_attributes(), get_text()); } - static void create(string name, mapping(string:string) attrs, + protected void create(string name, mapping(string:string) attrs, string contents) { ::create(DTD_ENTITY, name, attrs, contents); @@ -2132,11 +2132,11 @@ class DTDElementNode inherit Node; inherit DTDElementHelper; - static Node low_clone() + protected Node low_clone() { return DTDElementNode(get_full_name(), get_expression()); } - static void create(string name, array expression) + protected void create(string name, array expression) { this_program::expression = expression; ::create(DTD_ELEMENT, name, 0, ""); @@ -2146,11 +2146,11 @@ class DTDElementNode class DTDAttlistNode { inherit Node; - static Node low_clone() + protected Node low_clone() { return DTDAttlistNode(get_full_name(), get_attributes(), get_text()); } - static void create(string name, mapping(string:string) attrs, + protected void create(string name, mapping(string:string) attrs, string contents) { ::create(DTD_ATTLIST, name, attrs, contents); @@ -2160,11 +2160,11 @@ class DTDAttlistNode class DTDNotationNode { inherit Node; - static Node low_clone() + protected Node low_clone() { return DTDNotationNode(get_full_name(), get_attributes(), get_text()); } - static void create(string name, mapping(string:string) attrs, + protected void create(string name, mapping(string:string) attrs, string contents) { ::create(DTD_NOTATION, name, attrs, contents); @@ -2174,11 +2174,11 @@ class DTDNotationNode class ElementNode { inherit Node; - static Node low_clone() + protected Node low_clone() { return ElementNode(get_full_name(), get_attributes()); } - static void create(string name, mapping(string:string) attrs) + protected void create(string name, mapping(string:string) attrs) { ::create(XML_ELEMENT, name, attrs, ""); } @@ -2187,11 +2187,11 @@ class ElementNode class AttributeNode { inherit Node; - static Node low_clone() + protected Node low_clone() { return AttributeNode(get_full_name(), get_text()); } - static void create(string name, string value) + protected void create(string name, string value) { ::create(XML_ATTR, name, 0, value); } diff --git a/lib/modules/Parser.pmod/XML.pmod/Validating.pike b/lib/modules/Parser.pmod/XML.pmod/Validating.pike index 3ee43e82eb655deb8497bab364fa0fe8cf72e5b5..bb86d9555665f5e1ddd031d39f82694a6865ee8a 100644 --- a/lib/modules/Parser.pmod/XML.pmod/Validating.pike +++ b/lib/modules/Parser.pmod/XML.pmod/Validating.pike @@ -5,7 +5,7 @@ //! //! cf http://wwww.w3.org/TR/REC-xml/ //! -//! $Id: Validating.pike,v 1.13 2006/11/04 19:06:49 nilsson Exp $ +//! $Id: Validating.pike,v 1.14 2008/06/28 16:36:55 nilsson Exp $ //! #pike __REAL_VERSION__ @@ -13,16 +13,16 @@ //! Extends the Simple XML parser. inherit .Simple; -static private mapping(string:array(function)) __element_content = ([]); -static private mapping(string:mapping(string:array)) __element_attrs = ([]); +protected private mapping(string:array(function)) __element_content = ([]); +protected private mapping(string:mapping(string:array)) __element_attrs = ([]); mapping(string:string) __entity_sysid = ([]); mapping(string:string) __entity_pubid = ([]); mapping(string:string) __entity_ndata = ([]); mapping(string:string) __notation_sysid = ([]); mapping(string:string) __notation_pubid = ([]); -static private multiset(string) __ids_used = (<>); -static private multiset(string) __idrefs_used = (<>); -static private multiset(string) __notations_used = (<>); +protected private multiset(string) __ids_used = (<>); +protected private multiset(string) __idrefs_used = (<>); +protected private multiset(string) __notations_used = (<>); //! Check if @[s] is a valid @tt{Name@}. int isname(string s) @@ -56,7 +56,7 @@ int isnmtokens(string s) search(map(nmtokens-({""}), isnmtoken), 0) < 0; } -static private int islegalattribute(string val, array spec) +protected private int islegalattribute(string val, array spec) { switch(spec[0][0]) { case "": @@ -79,7 +79,7 @@ static private int islegalattribute(string val, array spec) } //! XML Element node. -static class Element { +protected class Element { string name; array(function) content_matcher; @@ -168,8 +168,8 @@ static class Element { } } -static private array(object) __element_stack = ({}); -static private string __root_element_name; +protected private array(object) __element_stack = ({}); +protected private string __root_element_name; //! Get an external entity. //! @@ -208,17 +208,17 @@ string get_external_entity(string sysid, string|void pubid, int|void unparsed, return 0; } -static private array(function) accept_terminate(string x) +protected private array(function) accept_terminate(string x) { return !x && ({ accept_terminate }); } -static private array(function) accept_any(string x) +protected private array(function) accept_any(string x) { return ({ accept_any }); } -static private array(function) compile_language(string|array l, +protected private array(function) compile_language(string|array l, array(function) c) { if(stringp(l)) @@ -248,7 +248,7 @@ static private array(function) compile_language(string|array l, //! //! @seealso //! @[::parse()] -static private mixed validate(string kind, string name, mapping attributes, +protected private mixed validate(string kind, string name, mapping attributes, array|string contents, mapping(string:mixed) info, function(string,string,mapping,array|string, @@ -414,7 +414,7 @@ static private mixed validate(string kind, string name, mapping attributes, return callback(kind, name, attributes, contents, info, @extra); } -static private mixed cleanup_parse(function(string,string,mapping +protected private mixed cleanup_parse(function(string,string,mapping ,array|string, mapping(string:mixed), mixed ...:mixed) callback, @@ -457,3 +457,4 @@ array parse_dtd(string data, /* define_entity? */ + diff --git a/lib/modules/Parser.pmod/module.pmod b/lib/modules/Parser.pmod/module.pmod index 8b8bd6f59f159759d335fadc7bea051a4f674998..b327ba7bc9c8c78919f83e4c0b6457dac94aacf0 100644 --- a/lib/modules/Parser.pmod/module.pmod +++ b/lib/modules/Parser.pmod/module.pmod @@ -1,5 +1,5 @@ // -// $Id: module.pmod,v 1.24 2008/06/27 20:51:16 grubba Exp $ +// $Id: module.pmod,v 1.25 2008/06/28 16:36:55 nilsson Exp $ #pike __REAL_VERSION__ @@ -8,8 +8,8 @@ constant HTML = Parser._parser.HTML; constant _RCS = Parser._parser._RCS; -static int(0..0) return_zero() {return 0;} -static HTML xml_parser = +protected int(0..0) return_zero() {return 0;} +protected HTML xml_parser = lambda() { HTML p = HTML(); p->lazy_entity_end (1); @@ -346,7 +346,7 @@ string decode_numeric_xml_entity (string chref) //! @note //! Currently using XHTML 1.0 tables. -static HTML entityparser = +protected HTML entityparser = lambda () { HTML p=HTML(); p->add_entities (html_entities); @@ -365,7 +365,7 @@ static HTML entityparser = return p; }(); -static HTML entityparser_noerror = +protected HTML entityparser_noerror = lambda () { HTML p=entityparser->clone(); @@ -391,7 +391,7 @@ string parse_html_entities(string in,void|int noerror) return html_entity_parser(noerror)->finish(in)->read(); } -static mapping(int:string) rev_html_entities; +protected mapping(int:string) rev_html_entities; //! Encode characters to HTML entities, e.g. turning @expr{"<"@} into //! @expr{"<"@}. diff --git a/lib/modules/Pike.pmod/module.pmod b/lib/modules/Pike.pmod/module.pmod index 66a8001b5d46c7c6905932d04ec6651e81ba3eeb..4f0f0b184f08b8d7c157bad7449254e2cadc4cfb 100644 --- a/lib/modules/Pike.pmod/module.pmod +++ b/lib/modules/Pike.pmod/module.pmod @@ -3,7 +3,7 @@ // Pike core things that don't belong anywhere else. // -// $Id: module.pmod,v 1.18 2008/06/06 18:01:40 grubba Exp $ +// $Id: module.pmod,v 1.19 2008/06/28 16:36:56 nilsson Exp $ constant WEAK_INDICES = __builtin.PIKE_WEAK_INDICES; constant WEAK_VALUES = __builtin.PIKE_WEAK_VALUES; @@ -64,7 +64,7 @@ program Decoder = [program] master()->Decoder; program Codec = [program] master()->Codec; #if 0 -static constant TYPE = typeof(typeof([mixed]0)); +protected constant TYPE = typeof(typeof([mixed]0)); TYPE check_call(TYPE fun_type, TYPE ... arg_types) { @@ -95,3 +95,4 @@ TYPE check_call(TYPE fun_type, TYPE ... arg_types) return ret; } #endif /* 0 */ + diff --git a/lib/modules/Process.pmod b/lib/modules/Process.pmod index 7b8a5085005691ad5430bdd183a6b36d68289713..0f6ad2fcddfb31c1bb33e4d829e80f65802a5d07 100644 --- a/lib/modules/Process.pmod +++ b/lib/modules/Process.pmod @@ -12,8 +12,8 @@ constant TraceProcess = __builtin.TraceProcess; class Process { inherit create_process; - static function(Process:void) read_cb; - static function(Process:void) timeout_cb; + protected function(Process:void) read_cb; + protected function(Process:void) timeout_cb; //! @param args //! Either a command line array, as the command_args @@ -36,7 +36,7 @@ class Process //! @endmapping //! @seealso //! @[create_process], @[split_quoted_string] - static void create( string|array(string) args, void|mapping(string:mixed) m ) + protected void create( string|array(string) args, void|mapping(string:mixed) m ) { if( stringp( args ) ) { args = split_quoted_string( [string]args @@ -58,12 +58,12 @@ class Process } } - static void destroy() { + protected void destroy() { remove_call_out(watcher); remove_call_out(killer); } - static void watcher() { + protected void watcher() { // It was another sigchld, but not one from our process. if(::status()==0) call_out(watcher, 0.1); @@ -73,7 +73,7 @@ class Process } } - static void killer() { + protected void killer() { remove_call_out(watcher); #if constant(kill) ::kill(signum("SIGKILL")); @@ -97,7 +97,7 @@ string locate_binary(array(string) path, string name) return 0; } -static array(string) runpike; +protected array(string) runpike; //! Spawn a new pike process similar to the current. //! @@ -251,7 +251,7 @@ int exec(string file,string ... foo) } #endif -static array(string) search_path_entries=0; +protected array(string) search_path_entries=0; //! string search_path(string command) @@ -456,7 +456,7 @@ Stdio.FILE|string popen(string s, string|void mode) { return fpopen(s)->read(); } -static Stdio.FILE fpopen(string s, string|void mode) +protected Stdio.FILE fpopen(string s, string|void mode) { Stdio.FILE f = Stdio.FILE(); if (!f) error("Popen failed. (couldn't create file)\n"); @@ -621,3 +621,4 @@ class Spawn } #endif #endif + diff --git a/lib/modules/Protocols.pmod/Bittorrent.pmod/Bencoding.pmod b/lib/modules/Protocols.pmod/Bittorrent.pmod/Bencoding.pmod index 48053461c4adc988e9940880a4e095e7fa435787..5e9556429cf45f8c20152b9068af1f31b2a379c2 100644 --- a/lib/modules/Protocols.pmod/Bittorrent.pmod/Bencoding.pmod +++ b/lib/modules/Protocols.pmod/Bittorrent.pmod/Bencoding.pmod @@ -108,9 +108,9 @@ string encode(string|int|array|mapping data) } } -private static array(string) bits= +private protected array(string) bits= sprintf("%08b",Array.enumerate(256)[*]); -private static array(string) bobs= +private protected array(string) bobs= sprintf("%c",Array.enumerate(256)[*]); //! Convert an array of @expr{int(0..1)@} to a Bittorrent style @@ -140,5 +140,5 @@ array(int) string2arr(string s) return last2arrarr=w[i..]; } -static private string last2arrbits=0; -static private array(int) last2arrarr=0; +protected private string last2arrbits=0; +protected private array(int) last2arrarr=0; diff --git a/lib/modules/Protocols.pmod/Bittorrent.pmod/Peer.pike b/lib/modules/Protocols.pmod/Bittorrent.pmod/Peer.pike index 2c10b56c62bc6c7f68be92a2e929f104e0dfeb5a..13b9f71e97e3668d33e12ad5a5bec25c8e1653d8 100644 --- a/lib/modules/Protocols.pmod/Bittorrent.pmod/Peer.pike +++ b/lib/modules/Protocols.pmod/Bittorrent.pmod/Peer.pike @@ -114,7 +114,7 @@ void create(.Torrent _parent,mapping m) } } -private static inline void _status(string type,void|string|int data) +private protected inline void _status(string type,void|string|int data) { #ifdef BT_PEER_DEBUG werror("%O: %O(%O)\n",ip,type,data); @@ -318,7 +318,7 @@ void disconnect() } // initialize the connection -static void peer_connected() +protected void peer_connected() { fd->set_nonblocking(peer_read,0,peer_close); transmit("\23BitTorrent protocol%-8c%20s%20s", @@ -327,8 +327,8 @@ static void peer_connected() parent->my_peer_id); } -static private string sendbuf=""; -static private void transmit(string fmt,mixed ...args) +protected private string sendbuf=""; +protected private void transmit(string fmt,mixed ...args) { if (sizeof(args)) fmt=sprintf(fmt,@args); @@ -373,7 +373,7 @@ void send_message(message_id n,string fmt,mixed ...args) call_out(keepalive,KEEPALIVE_DELAY); } -static private void peer_write() +protected private void peer_write() { for (;;) { @@ -449,8 +449,8 @@ static private void peer_write() } } -static private string readbuf=""; -static private void peer_read(mixed dummy,string s) +protected private string readbuf=""; +protected private void peer_read(mixed dummy,string s) { remove_call_out(peer_read_timeout); call_out(peer_read_timeout,300); @@ -761,7 +761,7 @@ void peer_close() } } -static private void keepalive() +protected private void keepalive() { call_out(keepalive,KEEPALIVE_DELAY); #ifdef BT_PEER_DEBUG @@ -851,7 +851,7 @@ void cancel_requests(int real) array(array(int|string)) queued_pieces=({}); -static void queue_piece(int piece,int offset,int length) +protected void queue_piece(int piece,int offset,int length) { if (were_choking) { @@ -899,7 +899,7 @@ static void queue_piece(int piece,int offset,int length) fd->set_write_callback(peer_write); } -static void fill_queue() +protected void fill_queue() { if (!sizeof(queued_pieces) || queued_pieces[0][3]!=0) @@ -951,7 +951,7 @@ void choke() #endif } -static int last_strangle; +protected int last_strangle; void strangle() { @@ -1032,10 +1032,10 @@ void destroy() // ---------------------------------------------------------------- -static private int bandwidth_in_count=0; -static private int bandwidth_out_count=0; -static private int bandwidth_t0=time(1); -static private float bandwidth_t=time(bandwidth_t0); +protected private int bandwidth_in_count=0; +protected private int bandwidth_out_count=0; +protected private int bandwidth_t0=time(1); +protected private float bandwidth_t=time(bandwidth_t0); void bandwidth_o_meter() { @@ -1065,3 +1065,4 @@ void bandwidth_o_meter() constant this_program_does_not_exist=1; #endif /* constant(.Torrent) */ + diff --git a/lib/modules/Protocols.pmod/Bittorrent.pmod/PeerID.pmod b/lib/modules/Protocols.pmod/Bittorrent.pmod/PeerID.pmod index 5063b9392b824a096bc0d463cda169a0081d406b..c9667b3d910f924904ea0cf7507499c77aa723b5 100644 --- a/lib/modules/Protocols.pmod/Bittorrent.pmod/PeerID.pmod +++ b/lib/modules/Protocols.pmod/Bittorrent.pmod/PeerID.pmod @@ -118,7 +118,7 @@ string identify_peer(string peerid) return "unknown"; } -static string azureus_style(string peerid) +protected string azureus_style(string peerid) { if( peerid[0]!='-' || peerid[7]!='-' ) return 0; string id = peerid[1..2]; @@ -197,7 +197,7 @@ static string azureus_style(string peerid) return id + " " + ver; } -static string shadow_style(string peerid) +protected string shadow_style(string peerid) { if( peerid[4..6]!="---" ) return 0; string id = ([ @@ -214,7 +214,7 @@ static string shadow_style(string peerid) return id + " " + (array(string))shadow_int( ((array)peerid[1..3])[*] )*"."; } -static int shadow_int(int c) +protected int shadow_int(int c) { if( c>='0' && c<='9' ) return c-'0'; if( c>='A' && c<='Z' ) return c-'A'+10; @@ -224,7 +224,7 @@ static int shadow_int(int c) return -1; } -static string bram_style(string peerid) +protected string bram_style(string peerid) { int a,b,c; if( sscanf(peerid, "%*1s%d-%d-%d-", a,b,c)!=4 ) return 0; diff --git a/lib/modules/Protocols.pmod/Bittorrent.pmod/Port.pike b/lib/modules/Protocols.pmod/Bittorrent.pmod/Port.pike index f0143eb45edf9ba1c802462c4da79d0eb1bdba8c..960aaddda7caead54013e1e2680f4287539866ac 100644 --- a/lib/modules/Protocols.pmod/Bittorrent.pmod/Port.pike +++ b/lib/modules/Protocols.pmod/Bittorrent.pmod/Port.pike @@ -35,7 +35,7 @@ void create(.Torrent _parent) void destroy() { destruct(port); } -static void new_connection() +protected void new_connection() { Stdio.File fd=port->accept(); @@ -59,3 +59,4 @@ static void new_connection() constant this_program_does_not_exist=1; #endif /* constant(.Torrent) */ + diff --git a/lib/modules/Protocols.pmod/Bittorrent.pmod/Torrent.pike b/lib/modules/Protocols.pmod/Bittorrent.pmod/Torrent.pike index 69b241e195fab5526f15d4a533c307b4ba943ead..a1171d27f1ab4ccbc8262071a94c8050a6919851 100644 --- a/lib/modules/Protocols.pmod/Bittorrent.pmod/Torrent.pike +++ b/lib/modules/Protocols.pmod/Bittorrent.pmod/Torrent.pike @@ -62,7 +62,7 @@ import .Bencoding; -constant cvsid="$Id: Torrent.pike,v 1.35 2006/03/16 14:14:03 agehall Exp $"; +constant cvsid="$Id: Torrent.pike,v 1.36 2008/06/28 16:36:57 nilsson Exp $"; Protocols.HTTP.Session http=Protocols.HTTP.Session(); @@ -445,7 +445,7 @@ void open_port(void|int port) // helper functions -private static inline string generate_peer_id() +private protected inline string generate_peer_id() { array v=array_sscanf(cvsid,"%*s %*s %d.%d %d/%d/%d"); int day=Calendar.Day(@v[2..4])->julian_day()-2452991; @@ -710,7 +710,7 @@ void start_update_tracker(void|int interval) update_tracker_loop(); } -static void update_tracker_loop() +protected void update_tracker_loop() { call_out(update_tracker_loop,tracker_update_interval); if (!sizeof(peers)) @@ -1380,3 +1380,4 @@ void destroy() constant this_program_does_not_exist=1; #endif /* constant(Crypto.SHA1) */ + diff --git a/lib/modules/Protocols.pmod/Bittorrent.pmod/module.pmod b/lib/modules/Protocols.pmod/Bittorrent.pmod/module.pmod index 7a57b38b25473dcb857bfb4d46e6b6b3c68859ca..8c1ff0cc45453482450289dc713b5aa7d643f4c9 100644 --- a/lib/modules/Protocols.pmod/Bittorrent.pmod/module.pmod +++ b/lib/modules/Protocols.pmod/Bittorrent.pmod/module.pmod @@ -21,9 +21,10 @@ #pike __REAL_VERSION__ #if constant(.Torrent) -static private function dummy=.Torrent; +protected private function dummy=.Torrent; #else /* !constant(.Torrent) */ constant this_program_does_not_exist=1; #endif /* constant(.Torrent) */ + diff --git a/lib/modules/Protocols.pmod/DNS.pmod b/lib/modules/Protocols.pmod/DNS.pmod index c7a4bdd8e9d81c73c7ee248f5ea33a8d8d6d15bf..ff91f0c82c063abf09dcfb97a556365655931fb5 100644 --- a/lib/modules/Protocols.pmod/DNS.pmod +++ b/lib/modules/Protocols.pmod/DNS.pmod @@ -1,4 +1,4 @@ -// $Id: DNS.pmod,v 1.95 2008/03/10 13:41:11 grubba Exp $ +// $Id: DNS.pmod,v 1.96 2008/06/28 16:36:56 nilsson Exp $ // Not yet finished -- Fredrik Hubinette //! Domain Name System @@ -111,7 +111,7 @@ class protocol return sprintf("%c%s",sizeof(s),s); } - static private string mkname(string|array(string) labels, int pos, + protected private string mkname(string|array(string) labels, int pos, mapping(string:int) comp) { if(stringp(labels)) @@ -129,7 +129,7 @@ class protocol } } - static string make_raw_addr6(string addr6) + protected string make_raw_addr6(string addr6) { if(!addr6) return "\0"*16; if(has_value(addr6, "::")) { @@ -146,7 +146,7 @@ class protocol array_sscanf(addr6, "%x:%x:%x:%x:%x:%x:%x:%x")); } - static private string mkrdata(mapping entry, int pos, mapping(string:int) c) + protected private string mkrdata(mapping entry, int pos, mapping(string:int) c) { switch(entry->type) { case T_CNAME: @@ -206,7 +206,7 @@ class protocol } } - static private string encode_entries(array(mapping) entries, int pos, + protected private string encode_entries(array(mapping) entries, int pos, mapping(string:int) comp) { string res=""; @@ -495,7 +495,7 @@ class server inherit protocol; inherit Stdio.UDP : udp; - static void send_reply(mapping r, mapping q, mapping m) + protected void send_reply(mapping r, mapping q, mapping m) { // FIXME: Needs to handle truncation somehow. if(!r) @@ -536,7 +536,7 @@ class server //! @member array|void "ns" //! @member array|void "ar" //! @endmapping - static mapping reply_query(mapping query, mapping udp_data) + protected mapping reply_query(mapping query, mapping udp_data) { // Override this function. // @@ -546,18 +546,18 @@ class server return 0; } - static void handle_query(mapping q, mapping m) + protected void handle_query(mapping q, mapping m) { mapping r = reply_query(q, m); send_reply(r, q, m); } - static void handle_response(mapping r, mapping m) + protected void handle_response(mapping r, mapping m) { // This is a stub intended to simplify servers which allow recursion } - static private void rec_data(mapping m) + protected private void rec_data(mapping m) { mixed err; mapping q; @@ -636,15 +636,15 @@ class client #else /* !__NT__ */ - static private mapping(string:string) etc_hosts; + protected private mapping(string:string) etc_hosts; - static private int is_ip(string ip) + protected private int is_ip(string ip) { // FIXME: Doesn't work with IPv6 return (replace(ip, "0123456789."/1, allocate(11,"")) == ""); } - static private string read_etc_file(string fname) + protected private string read_etc_file(string fname) { array(string) paths; string res; @@ -670,7 +670,7 @@ class client return res; } - static private string match_etc_hosts(string host) + protected private string match_etc_hosts(string host) { if (!etc_hosts) { etc_hosts = ([ "localhost":"127.0.0.1" ]); @@ -884,7 +884,7 @@ class client return 0; } - static mapping low_gethostbyname(string s, int type) + protected mapping low_gethostbyname(string s, int type) { mapping m; if(sizeof(domains) && s[-1] != '.' && sizeof(s/".") < 3) { @@ -1187,7 +1187,7 @@ class async_client mapping requests=([]); - static private void remove(object(Request) r) + protected private void remove(object(Request) r) { if(!r) return; sscanf(r->req,"%2c",int id); @@ -1247,7 +1247,7 @@ class async_client next_client->do_query(domain, cl, type, callback, @args); } - static private void rec_data(mapping m) + protected private void rec_data(mapping m) { mixed err; if (err = catch { @@ -1264,7 +1264,7 @@ class async_client } } - static private void generic_get(string d, + protected private void generic_get(string d, mapping answer, int multi, int all, diff --git a/lib/modules/Protocols.pmod/DNS_SD.pmod b/lib/modules/Protocols.pmod/DNS_SD.pmod index e6f43e3abcb8e399461aefa2eb69c50bb0442c40..be5cc3f3c16dcff0a7a6e8b6fc988134f0bcc169 100644 --- a/lib/modules/Protocols.pmod/DNS_SD.pmod +++ b/lib/modules/Protocols.pmod/DNS_SD.pmod @@ -1,4 +1,4 @@ -// $Id: DNS_SD.pmod,v 1.1 2005/04/09 21:07:21 jonasw Exp $ +// $Id: DNS_SD.pmod,v 1.2 2008/06/28 16:36:56 nilsson Exp $ // Interface to DNS Service Discovery. Written by Jonas Walld�n. @@ -26,7 +26,7 @@ class Service { inherit _Protocols_DNS_SD.Service; - private static string clip_utf8_str(string s, int maxlen) + private protected string clip_utf8_str(string s, int maxlen) { // Clip before UTF-8 encoding to limit loop to a few iterations at most s = s[..maxlen - 1]; @@ -40,7 +40,7 @@ class Service { } - private static string get_flat_txt_record(void|string|array(string) txt) + private protected string get_flat_txt_record(void|string|array(string) txt) { string txt_flat; @@ -117,3 +117,4 @@ class Service { }; #endif + diff --git a/lib/modules/Protocols.pmod/HTTP.pmod/Query.pike b/lib/modules/Protocols.pmod/HTTP.pmod/Query.pike index 0c55b0034ae2e8367bcea1611e82dc4abebfb736..554641a2f9b1b91a3b0b2a6cd07d84665dd77768 100644 --- a/lib/modules/Protocols.pmod/HTTP.pmod/Query.pike +++ b/lib/modules/Protocols.pmod/HTTP.pmod/Query.pike @@ -1,6 +1,6 @@ #pike __REAL_VERSION__ -// $Id: Query.pike,v 1.92 2008/01/05 14:46:38 grubba Exp $ +// $Id: Query.pike,v 1.93 2008/06/28 16:36:57 nilsson Exp $ //! Open and execute an HTTP query. //! @@ -63,7 +63,7 @@ int(0..1) https = 0; object con; string request; -static string send_buffer; +protected string send_buffer; string buf="",headerbuf=""; int datapos, discarded_bytes; @@ -77,7 +77,7 @@ array extra_args; /****** internal stuff *********************************************/ -static int ponder_answer( int|void start_position ) +protected int ponder_answer( int|void start_position ) { // read until we have all headers @@ -155,7 +155,7 @@ static int ponder_answer( int|void start_position ) return 1; } -static void connect(string server,int port,int blocking) +protected void connect(string server,int port,int blocking) { #ifdef HTTP_QUERY_DEBUG werror("<- (connect %O:%d)\n",server,port); @@ -231,7 +231,7 @@ static void connect(string server,int port,int blocking) ponder_answer(); } -static void async_close() +protected void async_close() { con->set_blocking(); if (ponder_answer() <= 0) { @@ -239,7 +239,7 @@ static void async_close() } } -static void async_read(mixed dummy,string s) +protected void async_read(mixed dummy,string s) { #ifdef HTTP_QUERY_DEBUG werror("-> %d bytes of data\n",sizeof(s)); @@ -253,7 +253,7 @@ static void async_read(mixed dummy,string s) } } -static void async_write() +protected void async_write() { #ifdef HTTP_QUERY_DEBUG werror("<- %O\n", send_buffer); @@ -273,7 +273,7 @@ static void async_write() con->set_nonblocking(async_read,0,async_close); } -static void async_connected() +protected void async_connected() { con->set_nonblocking(async_read,async_write,async_close); #ifdef HTTP_QUERY_DEBUG @@ -282,7 +282,7 @@ static void async_connected() con->write(""); } -static void low_async_failed(int errno) +protected void low_async_failed(int errno) { #ifdef HTTP_QUERY_DEBUG werror("** calling failed cb %O", request_fail); @@ -293,12 +293,12 @@ static void low_async_failed(int errno) remove_call_out(async_timeout); } -static void async_failed() +protected void async_failed() { low_async_failed(con?con->errno():113); // EHOSTUNREACH/Linux-i386 } -static void async_timeout() +protected void async_timeout() { #ifdef HTTP_QUERY_DEBUG werror("** TIMEOUT\n"); @@ -433,16 +433,16 @@ string headers_encode(mapping(string:array(string)|string) h) //! mapping hostname_cache=([]); -static Protocols.DNS.async_client async_dns; -static int last_async_dns; -static mixed async_id; +protected Protocols.DNS.async_client async_dns; +protected int last_async_dns; +protected mixed async_id; #ifndef PROTOCOLS_HTTP_DNS_OBJECT_TIMEOUT #define PROTOCOLS_HTTP_DNS_OBJECT_TIMEOUT 60 #endif // Check if it's time to clean up the async dns object. -static void clean_async_dns() +protected void clean_async_dns() { #ifdef HTTP_QUERY_NOISE werror("clean_async_dns\n"); @@ -928,7 +928,7 @@ string data(int|void max_length) return buf[datapos..datapos+len]; } -static Locale.Charset.Decoder charset_decoder; +protected Locale.Charset.Decoder charset_decoder; //! Gives back data, but decoded according to the content-type //! character set. @@ -1139,7 +1139,7 @@ object datafile() return PseudoFile(con,buf[datapos..],(int)headers["content-length"]); } -static void destroy() +protected void destroy() { if (async_id) { remove_call_out(async_id); @@ -1212,7 +1212,7 @@ void timed_async_fetch(function(object, mixed ...:void) ok_callback, con->set_nonblocking(async_fetch_read,0, async_fetch_close); } -static string _sprintf(int t) +protected string _sprintf(int t) { return t=='O' && status && sprintf("%O(%d %s)", this_program, status, status_desc); diff --git a/lib/modules/Protocols.pmod/HTTP.pmod/Server.pmod/Port.pike b/lib/modules/Protocols.pmod/HTTP.pmod/Server.pmod/Port.pike index 0f2ee6864e76c0350c969a48f472b76bfadfb02d..d5d0159173e3199e137418d9ef270d54ef9dc92b 100644 --- a/lib/modules/Protocols.pmod/HTTP.pmod/Server.pmod/Port.pike +++ b/lib/modules/Protocols.pmod/HTTP.pmod/Server.pmod/Port.pike @@ -41,7 +41,7 @@ void destroy() { close(); } // the port accept callback -static void new_connection() +protected void new_connection() { while( Stdio.File fd=port->accept() ) { diff --git a/lib/modules/Protocols.pmod/HTTP.pmod/Server.pmod/Request.pike b/lib/modules/Protocols.pmod/HTTP.pmod/Server.pmod/Request.pike index ff6905db6075472bd59ffbcb186b046ef29e9d74..0cde059ebcc0fa5787f6e183f25e1611d217139b 100644 --- a/lib/modules/Protocols.pmod/HTTP.pmod/Server.pmod/Request.pike +++ b/lib/modules/Protocols.pmod/HTTP.pmod/Server.pmod/Request.pike @@ -38,7 +38,7 @@ void set_max_request_size(int size) max_request_size = size; } -static class Port { +protected class Port { Stdio.Port port; int portno; string|int(0..0) interface; @@ -143,7 +143,7 @@ constant singular_use_headers = ({ "cookie2", }); -static void flatten_headers() +protected void flatten_headers() { foreach( singular_headers, string x ) if( arrayp(request_headers[x]) ) @@ -159,7 +159,7 @@ static void flatten_headers() // are called. If parse_variables() deems the request to be finished // finalize() is called. If not parse_variables() has replaced the // read callback. -static void read_cb(mixed dummy,string s) +protected void read_cb(mixed dummy,string s) { if( !strlen( raw ) ) { @@ -188,14 +188,14 @@ static void read_cb(mixed dummy,string s) call_out(connection_timeout,connection_timeout_delay); } -static void connection_timeout() +protected void connection_timeout() { finish(0); } // Parses the request and populates request_type, protocol, // full_query, query and not_query. -static void parse_request() +protected void parse_request() { array v=request_raw/" "; switch (sizeof(v)) @@ -338,7 +338,7 @@ private void read_cb_chunked( mixed dummy, string data ) call_out(connection_timeout,connection_timeout_delay); } -static int parse_variables() +protected int parse_variables() { if (query!="") .http_decode_urlencoded_query(query,variables); @@ -378,7 +378,7 @@ static int parse_variables() return 0; // delay } -static void parse_post() +protected void parse_post() { if ( request_headers["content-type"] && has_prefix(request_headers["content-type"], "multipart/form-data") ) @@ -404,7 +404,7 @@ static void parse_post() } } -static void finalize() +protected void finalize() { my_fd->set_blocking(); flatten_headers(); @@ -420,7 +420,7 @@ static void finalize() // Adds incoming data to raw and buf. Once content-length or // max_request_size data has been received, finalize is called. -static void read_cb_post(mixed dummy,string s) +protected void read_cb_post(mixed dummy,string s) { raw += s; buf += s; @@ -439,7 +439,7 @@ static void read_cb_post(mixed dummy,string s) call_out(connection_timeout,connection_timeout_delay); } -static void close_cb() +protected void close_cb() { // closed by peer before request read if (my_fd) { my_fd->close(); destruct(my_fd); my_fd=0; } diff --git a/lib/modules/Protocols.pmod/HTTP.pmod/Server.pmod/SSLPort.pike b/lib/modules/Protocols.pmod/HTTP.pmod/Server.pmod/SSLPort.pike index 70f3524a5f8b637440842a8ec31b57b7f6a88a5f..c9bb514eded235798caa5f0a34cf5e672fedff70 100644 --- a/lib/modules/Protocols.pmod/HTTP.pmod/Server.pmod/SSLPort.pike +++ b/lib/modules/Protocols.pmod/HTTP.pmod/Server.pmod/SSLPort.pike @@ -62,7 +62,7 @@ void close() void destroy() { close(); } //! The port accept callback -static void new_connection() +protected void new_connection() { SSL.sslfile fd=port->accept(); Request r=request_program(); @@ -148,3 +148,4 @@ string _sprintf(int t) { } #endif + diff --git a/lib/modules/Protocols.pmod/HTTP.pmod/Session.pike b/lib/modules/Protocols.pmod/HTTP.pmod/Session.pike index 2d93ecb8fb5b672c50b75775ea0f806ce9f00012..f8881875acba07807a48754087072aaa841376b5 100644 --- a/lib/modules/Protocols.pmod/HTTP.pmod/Session.pike +++ b/lib/modules/Protocols.pmod/HTTP.pmod/Session.pike @@ -1,6 +1,6 @@ #pike __REAL_VERSION__ -// $Id: Session.pike,v 1.21 2007/11/25 19:17:52 srb Exp $ +// $Id: Session.pike,v 1.22 2008/06/28 16:36:57 nilsson Exp $ import Protocols.HTTP; @@ -207,10 +207,10 @@ class Request // ---------------- async - static function(mixed...:mixed) headers_callback; - static function(mixed...:mixed) data_callback; - static function(mixed...:mixed) fail_callback; - static array(mixed) extra_callback_arguments; + protected function(mixed...:mixed) headers_callback; + protected function(mixed...:mixed) data_callback; + protected function(mixed...:mixed) fail_callback; + protected array(mixed) extra_callback_arguments; //! Setup callbacks for async mode, //! @[headers] will be called when the request got connected, @@ -259,7 +259,7 @@ class Request return this; } - static void async_ok(object q) + protected void async_ok(object q) { check_for_cookies(); @@ -291,7 +291,7 @@ class Request extra_callback_arguments=0; // to allow garb } - static void async_fail(object q) + protected void async_fail(object q) { // clear callbacks for possible garbation of this Request object con->set_callbacks(0,0); @@ -303,7 +303,7 @@ class Request if (fc) fc(@eca); // note that we may be destructed here } - static void async_data() + protected void async_data() { // clear callbacks for possible garbation of this Request object con->set_callbacks(0,0); @@ -604,7 +604,7 @@ int connections_kept_n=0; int connections_inuse_n=0; mapping(string:int) connections_host_n=([]); -static class KeptConnection +protected class KeptConnection { string lookup; Query q; @@ -647,7 +647,7 @@ static class KeptConnection } } -static inline string connection_lookup(Standards.URI url) +protected inline string connection_lookup(Standards.URI url) { return url->scheme+"://"+url->host+":"+url->port; } @@ -695,7 +695,7 @@ Query give_me_connection(Standards.URI url) array(array) freed_connection_callbacks=({}); // ({lookup,callback,args}) -static inline void freed_connection(string lookup_freed) +protected inline void freed_connection(string lookup_freed) { if (connections_inuse_n>=maximum_total_connections) return; diff --git a/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod b/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod index 615ceecf9911ee4e3d2b20c5b4d1de21b412fc56..cf6102c7231d5113f68d694d96c599c905ebd050 100644 --- a/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod +++ b/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod @@ -149,7 +149,7 @@ constant DAV_STORAGE_FULL = 507; // RFC 2518 10.6: Insufficient Storage return con; } -static .Query do_udp_method(string method, Standards.URI url, +protected .Query do_udp_method(string method, Standards.URI url, void|mapping(string:int|string) query_variables, void|mapping(string:string|array(string)) request_headers, void|Protocols.HTTP.Query con, @@ -441,17 +441,17 @@ string http_encode_query(mapping(string:int|string) variables) } // RFC 1738, 2.2. URL Character Encoding Issues -static constant url_non_corresponding = enumerate(0x21) + +protected constant url_non_corresponding = enumerate(0x21) + enumerate(0x81,1,0x7f); -static constant url_unsafe = ({ '<', '>', '"', '#', '%', '{', '}', +protected constant url_unsafe = ({ '<', '>', '"', '#', '%', '{', '}', '|', '\\', '^', '~', '[', ']', '`' }); -static constant url_reserved = ({ ';', '/', '?', ':', '@', '=', '&' }); +protected constant url_reserved = ({ ';', '/', '?', ':', '@', '=', '&' }); // Encode these chars -static constant url_chars = url_non_corresponding + url_unsafe + +protected constant url_chars = url_non_corresponding + url_unsafe + url_reserved + ({ '+', '\'' }); -static constant url_from = sprintf("%c", url_chars[*]); -static constant url_to = sprintf("%%%02x", url_chars[*]); +protected constant url_from = sprintf("%c", url_chars[*]); +protected constant url_to = sprintf("%%%02x", url_chars[*]); //! This protects all odd - see @[http_encode_query()] - diff --git a/lib/modules/Protocols.pmod/Ident.pmod b/lib/modules/Protocols.pmod/Ident.pmod index 41aee58f441cabc1dcb4c696676cbf0d8f1afe7d..5f4486428d884fb4a97e801f0cd85edb34198fb9 100644 --- a/lib/modules/Protocols.pmod/Ident.pmod +++ b/lib/modules/Protocols.pmod/Ident.pmod @@ -1,5 +1,5 @@ // -// $Id: Ident.pmod,v 1.11 2003/03/08 23:01:58 nilsson Exp $ +// $Id: Ident.pmod,v 1.12 2008/06/28 16:36:56 nilsson Exp $ //! An implementation of the IDENT protocol, specified in RFC 931. @@ -20,7 +20,7 @@ class AsyncLookup string query; string read_buf = ""; - static void do_callback(array(string) reply) + protected void do_callback(array(string) reply) { #ifdef IDENT_DEBUG werror("Protocols.Ident: calling callback\n"); @@ -46,7 +46,7 @@ class AsyncLookup } } - static void write_cb() + protected void write_cb() { #ifdef IDENT_DEBUG werror("Protocols.Ident: sending query\n"); @@ -64,7 +64,7 @@ class AsyncLookup } } - static void read_cb(mixed ignored, string data) + protected void read_cb(mixed ignored, string data) { #ifdef IDENT_DEBUG werror("Protocols.Ident: reading data\n"); @@ -87,7 +87,7 @@ class AsyncLookup } } - static void close_cb() + protected void close_cb() { #ifdef IDENT_DEBUG werror("Protocols.Ident: Connection closed\n"); @@ -96,7 +96,7 @@ class AsyncLookup do_callback(({ "ERROR", "CONNECTION CLOSED" })); } - static void timeout() + protected void timeout() { #ifdef IDENT_DEBUG werror("Protocols.Ident: Timeout\n"); @@ -105,7 +105,7 @@ class AsyncLookup do_callback(({ "ERROR", "TIMEOUT" })); } - static void connected(int dummy) + protected void connected(int dummy) { #ifdef IDENT_DEBUG werror("Protocols.Ident: Connection OK, query:%O\n", query); diff --git a/lib/modules/Protocols.pmod/LDAP.pmod/client.pike b/lib/modules/Protocols.pmod/LDAP.pmod/client.pike index 26892b5268b65c00f7fc8ac840a52f645a319be4..59722490580ffae2bfd0dc1c24c3f62c3444ff45 100644 --- a/lib/modules/Protocols.pmod/LDAP.pmod/client.pike +++ b/lib/modules/Protocols.pmod/LDAP.pmod/client.pike @@ -2,7 +2,7 @@ // LDAP client protocol implementation for Pike. // -// $Id: client.pike,v 1.112 2008/06/20 16:24:18 srb Exp $ +// $Id: client.pike,v 1.113 2008/06/28 16:36:58 nilsson Exp $ // // Honza Petrous, hop@unibase.cz // @@ -117,7 +117,7 @@ import "."; } //! @ignore -static function(string:string) get_attr_decoder (string attr, +protected function(string:string) get_attr_decoder (string attr, DO_IF_DEBUG (void|int nowarn)) { if (mapping(string:mixed) attr_descr = get_attr_type_descr (attr)) { @@ -139,7 +139,7 @@ static function(string:string) get_attr_decoder (string attr, } //! @endignore -static function(string:string) get_attr_encoder (string attr) +protected function(string:string) get_attr_encoder (string attr) { if (mapping(string:mixed) attr_descr = get_attr_type_descr (attr)) { if (function(string:string) encoder = @@ -258,7 +258,7 @@ typedef mapping(string:ResultAttributeValue) ResultEntry; return res; } - static void decode_entry (ResultEntry ent) + protected void decode_entry (ResultEntry ent) { // Used in LDAPv3 only: Decode the dn and values as appropriate // according to the schema. Note that attributes with the @@ -1135,7 +1135,7 @@ void reset_options() } // add -static mapping(string:array(string)) simple_read (string object_name, +protected mapping(string:array(string)) simple_read (string object_name, object filter, array attrs) // Makes a base object search for object_name. The result is returned @@ -1172,7 +1172,7 @@ static mapping(string:array(string)) simple_read (string object_name, return res; } -static mapping(string:array(string)) root_dse; +protected mapping(string:array(string)) root_dse; array(string) get_root_dse_attr (string attr) //! Returns the value of an attribute in the root DSE (DSA-Specific @@ -1248,7 +1248,7 @@ array(string) get_root_dse_attr (string attr) return root_dse[attr]; } -static object make_control (string control_type, void|string value, +protected object make_control (string control_type, void|string value, void|int critical) { array(object) seq = ({Standards.ASN1.Types.asn1_octet_string (control_type), @@ -1257,7 +1257,7 @@ static object make_control (string control_type, void|string value, return Standards.ASN1.Types.asn1_sequence (seq); } -static multiset(string) supported_controls; +protected multiset(string) supported_controls; multiset(string) get_supported_controls() //! Returns a multiset containing the controls supported by the @@ -2032,7 +2032,7 @@ mapping(string:mixed) get_parsed_url() {return lauth;} // Schema handling. -static mapping(string:array(string)) query_subschema (string dn, +protected mapping(string:array(string)) query_subschema (string dn, array(string) attrs) // Queries the server for the specified attributes in the subschema // applicable for the specified object. The return value is on the @@ -2083,7 +2083,7 @@ static mapping(string:array(string)) query_subschema (string dn, return 0; } -static mapping(string:mixed) parse_schema_terms ( +protected mapping(string:mixed) parse_schema_terms ( string str, mapping(string:string|multiset|mapping) known_terms, string errmsg_prefix) @@ -2270,7 +2270,7 @@ static mapping(string:mixed) parse_schema_terms ( return res; } -static constant attr_type_term_syntax = ([ +protected constant attr_type_term_syntax = ([ "NAME": "qdescrs", "DESC": "qdstring", "OBSOLETE": "flag", @@ -2295,7 +2295,7 @@ static constant attr_type_term_syntax = ([ "": "qdstrings" ]); -static mapping(string:mapping(string:mixed)) attr_type_descrs; +protected mapping(string:mapping(string:mixed)) attr_type_descrs; mapping(string:mixed) get_attr_type_descr (string attr, void|int standard_attrs) //! Returns the attribute type description for the given attribute, @@ -2516,3 +2516,4 @@ int main (int argc, array(string) argv) #else constant this_program_does_not_exist=1; #endif + diff --git a/lib/modules/Protocols.pmod/LDAP.pmod/ldap_privates.pmod b/lib/modules/Protocols.pmod/LDAP.pmod/ldap_privates.pmod index b908adf397f07d6d2c6c720dc861ac511a2ad748..c284ce3e8a1f3f7c5a0c1888a2f272066c014890 100644 --- a/lib/modules/Protocols.pmod/LDAP.pmod/ldap_privates.pmod +++ b/lib/modules/Protocols.pmod/LDAP.pmod/ldap_privates.pmod @@ -2,7 +2,7 @@ // LDAP client protocol implementation for Pike. // -// $Id: ldap_privates.pmod,v 1.14 2008/05/01 10:40:49 nilsson Exp $ +// $Id: ldap_privates.pmod,v 1.15 2008/06/28 16:36:58 nilsson Exp $ // // Honza Petrous, hop@unibase.cz // @@ -87,7 +87,7 @@ class asn1_application_sequence tagx = tagid; } - static string _sprintf(mixed ... args) + protected string _sprintf(mixed ... args) { return sprintf("[%d]%s", tagx, ::_sprintf(@args)); } @@ -107,7 +107,7 @@ class asn1_application_octet_string tagx = tagid; } - static string _sprintf(mixed ... args) + protected string _sprintf(mixed ... args) { return sprintf("[%d]%s", tagx, ::_sprintf(@args)); } @@ -127,7 +127,7 @@ class asn1_context_boolean tagx = tagid; } - static string _sprintf(mixed ... args) + protected string _sprintf(mixed ... args) { return sprintf("[%d]%s", tagx, ::_sprintf(@args)); } @@ -147,7 +147,7 @@ class asn1_context_integer tagx = tagid; } - static string _sprintf(mixed ... args) + protected string _sprintf(mixed ... args) { return sprintf("[%d]%s", tagx, ::_sprintf(@args)); } @@ -167,7 +167,7 @@ class asn1_context_octet_string tagx = tagid; } - static string _sprintf(mixed ... args) + protected string _sprintf(mixed ... args) { return sprintf("[%d]%s", tagx, ::_sprintf(@args)); } @@ -187,7 +187,7 @@ class asn1_context_sequence tagx = tagid; } - static string _sprintf(mixed ... args) + protected string _sprintf(mixed ... args) { return sprintf("[%d]%s", tagx, ::_sprintf(@args)); } @@ -207,7 +207,7 @@ class asn1_context_set tagx = tagid; } - static string _sprintf(mixed ... args) + protected string _sprintf(mixed ... args) { return sprintf("[%d]%s", tagx, ::_sprintf(@args)); } @@ -334,7 +334,7 @@ object|mapping der_decode(object data, // Mapping from class to mapping from tag to program. // NOTE: Will probably change to the same layout as in // Standards.ASN1.Decode.universal_types. -static mapping(int(0..3):mapping(int:program|function)) ldap_type_proc = ([ +protected mapping(int(0..3):mapping(int:program|function)) ldap_type_proc = ([ 0:([ 1 : asn1_boolean, 2 : Standards.ASN1.Types.Integer, @@ -383,3 +383,4 @@ constant this_program_does_not_exist=1; // ------------- end of ASN.1 API hack ----------------------------- + diff --git a/lib/modules/Protocols.pmod/LDAP.pmod/module.pmod b/lib/modules/Protocols.pmod/LDAP.pmod/module.pmod index b19d458f1753a38071260a54e32f4156af9e3bae..b7cd18229f484c37f1f722d4668e61bbba28e994 100644 --- a/lib/modules/Protocols.pmod/LDAP.pmod/module.pmod +++ b/lib/modules/Protocols.pmod/LDAP.pmod/module.pmod @@ -1,6 +1,6 @@ #pike __REAL_VERSION__ -// $Id: module.pmod,v 1.31 2007/05/23 16:31:42 mast Exp $ +// $Id: module.pmod,v 1.32 2008/06/28 16:36:58 nilsson Exp $ #include "ldap_globals.h" @@ -1165,7 +1165,7 @@ constant GUID_NTDS_QUOTAS_CONTAINER = "6227f0af1fc2410d8e3bb10615bb5b0f"; // Misc stuff -static mapping(mixed:string) constant_val_lookup; +protected mapping(mixed:string) constant_val_lookup; string get_constant_name (mixed val) //! If @[val] matches any non-integer constant in this module, its @@ -1191,7 +1191,7 @@ string get_constant_name (mixed val) return constant_val_lookup[val]; } -static void create() +protected void create() // Fill in various calculated constants. { // syntax_encode_fns @@ -1248,7 +1248,7 @@ static void create() #endif } -static constant supported_extensions = (<"bindname">); +protected constant supported_extensions = (<"bindname">); //! Parses an LDAP URL and returns its fields in a mapping. //! @@ -1339,7 +1339,7 @@ class FilterError string error_message; array error_backtrace; string|array `[] (int i) {return i ? error_backtrace : error_message;} - static void create (string msg, mixed... args) + protected void create (string msg, mixed... args) { if (sizeof (args)) msg = sprintf (msg, @args); error_message = msg; @@ -1590,7 +1590,7 @@ object make_filter (string filter, void|int ldap_version) #undef EXCERPT } -static mapping(string:array(object)) cached_filters = ([]); +protected mapping(string:array(object)) cached_filters = ([]); object get_cached_filter (string filter, void|int ldap_version) //! Like @[make_filter] but saves the generated objects for reuse. @@ -1623,11 +1623,11 @@ constant connection_rebind_threshold = 4; constant connection_idle_garb_interval = 60; // Garb idle connections once every minute. -static mapping(string:array(object/*(client)*/)) idle_conns = ([]); -static Thread.Mutex idle_conns_mutex = Thread.Mutex(); -static mixed periodic_idle_conns_garb_call_out; +protected mapping(string:array(object/*(client)*/)) idle_conns = ([]); +protected Thread.Mutex idle_conns_mutex = Thread.Mutex(); +protected mixed periodic_idle_conns_garb_call_out; -static void periodic_idle_conns_garb() +protected void periodic_idle_conns_garb() { Thread.MutexKey lock = idle_conns_mutex->lock(); DWRITE ("Periodic connection garb. Got %d urls.\n", sizeof (idle_conns)); diff --git a/lib/modules/Protocols.pmod/LDAP.pmod/protocol.pike b/lib/modules/Protocols.pmod/LDAP.pmod/protocol.pike index 2c38f538fe8d7f8d9d9e67b1462ae5a373cf8aa5..1d6130d7c3fd3cd6c1f229cede5a72ae09995871 100644 --- a/lib/modules/Protocols.pmod/LDAP.pmod/protocol.pike +++ b/lib/modules/Protocols.pmod/LDAP.pmod/protocol.pike @@ -2,7 +2,7 @@ // LDAP client protocol implementation for Pike. // -// $Id: protocol.pike,v 1.20 2008/01/13 17:02:43 nilsson Exp $ +// $Id: protocol.pike,v 1.21 2008/06/28 16:36:58 nilsson Exp $ // // Honza Petrous, hop@unibase.cz // @@ -45,7 +45,7 @@ import Protocols.LDAP; object low_fd = Stdio.File(); // helper fd object ldapfd; // helper fd -static int last_io_time; // Timestamp when I/O on the fd was made last. +protected int last_io_time; // Timestamp when I/O on the fd was made last. int seterr(int errno, void|string errstr) { // Sets ldap_err* variables and returns errno @@ -87,7 +87,7 @@ string server_error_string() {return ldap_rem_errstr;} //! time. int get_last_io_time() {return last_io_time;} - static void read_answer() { + protected void read_answer() { // ---------------------- // Reads LDAP PDU (with defined msgid) from the server @@ -158,7 +158,7 @@ int get_last_io_time() {return last_io_time;} con_ok(this, @extra_args); } - static int is_whole_pdu() { + protected int is_whole_pdu() { // ---------------------- // Check if LDAP PDU is complete in 'readbuf' @@ -339,3 +339,4 @@ int get_last_io_time() {return last_io_time;} #else constant this_program_does_not_exist=1; #endif + diff --git a/lib/modules/Protocols.pmod/LMTP.pmod b/lib/modules/Protocols.pmod/LMTP.pmod index 8b15581d5b76ce489d25c0616a3e19ef42190e59..c25c8b547c959873f129dd1af347ce85e48eb641 100644 --- a/lib/modules/Protocols.pmod/LMTP.pmod +++ b/lib/modules/Protocols.pmod/LMTP.pmod @@ -1,5 +1,5 @@ // -// $Id: LMTP.pmod,v 1.11 2004/06/04 17:13:03 vida Exp $ +// $Id: LMTP.pmod,v 1.12 2008/06/28 16:36:56 nilsson Exp $ // #pike __REAL_VERSION__ @@ -63,10 +63,10 @@ class Connection { //! A LMTP server. It has been fairly well tested against Postfix client. //! Actually this module is only an extention to the @[SMTP] server. class Server { - static object fdport; + protected object fdport; Configuration config; - static void accept_callback() + protected void accept_callback() { object fd = fdport->accept(); if(!fd) diff --git a/lib/modules/Protocols.pmod/Line.pmod b/lib/modules/Protocols.pmod/Line.pmod index 4d480ab08ebe63104652072cfafcff2f78c71639..4ccd905fa8b15b431fbf734f5d9a2427657beb2b 100644 --- a/lib/modules/Protocols.pmod/Line.pmod +++ b/lib/modules/Protocols.pmod/Line.pmod @@ -1,5 +1,5 @@ /* - * $Id: Line.pmod,v 1.22 2003/04/07 17:12:02 nilsson Exp $ + * $Id: Line.pmod,v 1.23 2008/06/28 16:36:56 nilsson Exp $ * * Line-buffered protocol handling. * @@ -11,10 +11,10 @@ //! Simple nonblocking line-oriented I/O. class simple { - static object con; + protected object con; //! The sequence separating lines from eachother. "\r\n" by default. - static constant line_separator = "\r\n"; + protected constant line_separator = "\r\n"; //! If this variable has been set, multiple lines will be accumulated, //! until a line with a single @expr{"."@} (period) is received. @@ -46,15 +46,15 @@ class simple //! void handle_command(string line); - static int timeout; // Idle time before timeout. - static int timeout_time; // Time at which next timeout will occur. + protected int timeout; // Idle time before timeout. + protected int timeout_time; // Time at which next timeout will occur. //! Queue some data to send. //! //! @seealso //! @[handle_command()], @[handle_data()], @[disconnect()] //! - static void send(string s) + protected void send(string s) { send_q->put(s); con->set_write_callback(write_callback); @@ -69,7 +69,7 @@ class simple //! @seealso //! @[create()], @[touch_time()] //! - static void do_timeout() + protected void do_timeout() { if (con) { catch { @@ -85,7 +85,7 @@ class simple } } - static void _timeout_cb() + protected void _timeout_cb() { if (timeout > 0) { // Timeouts are enabled. @@ -114,8 +114,8 @@ class simple } } - static string multi_line_buffer = ""; - static void _handle_command(string line) + protected string multi_line_buffer = ""; + protected void _handle_command(string line) { if (handle_data) { if (line != ".") { @@ -132,7 +132,7 @@ class simple } } - static string read_buffer = ""; + protected string read_buffer = ""; //! Read a line from the input. //! @@ -146,7 +146,7 @@ class simple //! @seealso //! @[handle_command()], @[line_separator] //! - static string read_line() + protected string read_line() { // FIXME: Should probably keep track of where the search ended last time. int i = search(read_buffer, line_separator); @@ -168,7 +168,7 @@ class simple //! @seealso //! @[handle_data()], @[handle_command()], @[read_line()] //! - static void read_callback(mixed ignored, string data) + protected void read_callback(mixed ignored, string data) { touch_time(); @@ -191,8 +191,8 @@ class simple //! object(ADT.Queue) send_q = ADT.Queue(); - static string write_buffer = ""; - static void write_callback(mixed ignored) + protected string write_buffer = ""; + protected void write_callback(mixed ignored) { touch_time(); @@ -267,7 +267,7 @@ class simple //! The default action is to shut down the connection on this side //! as well. //! - static void close_callback() + protected void close_callback() { if (handle_data || sizeof(read_buffer) || sizeof(multi_line_buffer)) { werror("close_callback(): Unexpected close!\n"); @@ -382,7 +382,7 @@ class imap_style handle_line(line); } - static void read_callback(mixed ignored, string data) + protected void read_callback(mixed ignored, string data) { touch_time(); diff --git a/lib/modules/Protocols.pmod/LysKOM.pmod/Raw.pike b/lib/modules/Protocols.pmod/LysKOM.pmod/Raw.pike index 685d3295758411d314f444498ea26c0ed087f4c4..458d4bcf78646b6a6c018e1a77d85bc0f50b3044 100644 --- a/lib/modules/Protocols.pmod/LysKOM.pmod/Raw.pike +++ b/lib/modules/Protocols.pmod/LysKOM.pmod/Raw.pike @@ -48,7 +48,7 @@ int out_req; /*--- send/recv ------------------------ */ -static inline int conwrite(string what) +protected inline int conwrite(string what) { #ifdef LYSKOM_DEBUG werror("-> %O\n",what); diff --git a/lib/modules/Protocols.pmod/OBEX.pmod b/lib/modules/Protocols.pmod/OBEX.pmod index fd2fb68d40b534e0b279ea6224351981fa48a500..52303043805ea4eb7d3d849e18acb193fb8f016d 100644 --- a/lib/modules/Protocols.pmod/OBEX.pmod +++ b/lib/modules/Protocols.pmod/OBEX.pmod @@ -184,14 +184,14 @@ array(string) split_headers(string h, int chunklen) //! class Client { - static Stdio.Stream con; - static int connected = 0; + protected Stdio.Stream con; + protected int connected = 0; - static constant obex_version = 0x10; - static constant connect_flags = 0; - static constant default_max_pkt_length = 65535; + protected constant obex_version = 0x10; + protected constant connect_flags = 0; + protected constant default_max_pkt_length = 65535; - static int server_version, server_connect_flags, max_pkt_length = 255; + protected int server_version, server_connect_flags, max_pkt_length = 255; //! Perform a request/response exchange with the server. @@ -474,7 +474,7 @@ class Client #endif } - static void destroy() + protected void destroy() { if(connected) disconnect(); @@ -487,7 +487,7 @@ class Client //! A stream for writing requests and reading back responses. //! Typically this is some kind of serial port. //! - static void create(Stdio.Stream _con) + protected void create(Stdio.Stream _con) { con = _con; if(!connect()) diff --git a/lib/modules/Protocols.pmod/SMTP.pmod/module.pmod b/lib/modules/Protocols.pmod/SMTP.pmod/module.pmod index 569b53b20fa464b62297bdfc766a3116808406cd..8771ce3e19b5655f9c29927a516f33388c171ca1 100644 --- a/lib/modules/Protocols.pmod/SMTP.pmod/module.pmod +++ b/lib/modules/Protocols.pmod/SMTP.pmod/module.pmod @@ -1,5 +1,5 @@ // -// $Id: module.pmod,v 1.45 2008/02/21 14:01:00 agehall Exp $ +// $Id: module.pmod,v 1.46 2008/06/28 16:36:58 nilsson Exp $ // #pike __REAL_VERSION__ @@ -48,7 +48,7 @@ class Client { inherit Protocol; - static private int cmd(string c, string|void comment) + protected private int cmd(string c, string|void comment) { int r = command(c); switch(r) { @@ -155,7 +155,7 @@ class Client cmd("QUIT"); } - static string parse_addr(string addr) + protected string parse_addr(string addr) { array(string|int) tokens = replace(MIME.tokenize(addr), '@', "@"); @@ -265,7 +265,7 @@ class Configuration { //! The low-level class for the SMTP server class Connection { - static Configuration cfg; + protected Configuration cfg; // The commands this module supports mapping(string:function) commands = ([ @@ -284,25 +284,25 @@ class Connection { constant internal_error_name = ". Problem due to the internal error: "; // the fd of the socket - static Stdio.File fd = Stdio.File(); + protected Stdio.File fd = Stdio.File(); // the input buffer for read_cb - static string inputbuffer = ""; + protected string inputbuffer = ""; // the size of the old data string in read_cb - static int sizeofpreviousdata = 0; + protected int sizeofpreviousdata = 0; // the from address - static string mailfrom = ""; + protected string mailfrom = ""; // to the address(es) - static array(string) mailto = ({ }); + protected array(string) mailto = ({ }); // the ident we get from ehlo/helo - static string ident = ""; + protected string ident = ""; // these are obvious - static string remoteaddr, localaddr; - static int localport; + protected string remoteaddr, localaddr; + protected int localport; // my name - static string localhost = gethostname(); + protected string localhost = gethostname(); // the sequence of commands the client send - static array(string) sequence = ({ }); + protected array(string) sequence = ({ }); // the message id of the current mail private string|int messageid; @@ -312,7 +312,7 @@ class Connection { // the features this module support (fetched from Configuration - get_features() private array(string) features = ({ }); - static void handle_timeout(string cmd) + protected void handle_timeout(string cmd) { string errmsg = "421 Error: timeout exceeded after command " + cmd || "unknown command!" + "\r\n"; @@ -323,13 +323,13 @@ class Connection { // return true if the given return code from the call back function // is a success one or not - static int is_success(array|int check) + protected int is_success(array|int check) { return (getretcode(check)/100 == 2); } // get the return code from the callback function - static int getretcode(array|int check) + protected int getretcode(array|int check) { int smtpretcode; if(arrayp(check)) @@ -344,14 +344,14 @@ class Connection { // get optionnal error string from the callback function // 0 is no error string were returned - static int|string geterrorstring(array|int check) + protected int|string geterrorstring(array|int check) { if(arrayp(check) && stringp(check[1])) return check[1]; return 0; } - static void outcode(int code, void|string internal_error) + protected void outcode(int code, void|string internal_error) { string msg = (string) code + " "; if(internal_error) @@ -369,7 +369,7 @@ class Connection { //! By default the log function is @[werror]. function(string:mixed) logfunction = werror; - static void log(string fmt, mixed ... args) + protected void log(string fmt, mixed ... args) { string errmsg = Calendar.now()->format_time() + " Pike "+protocol+" server : "; @@ -383,7 +383,7 @@ class Connection { } // make the received header - static string received() + protected string received() { string remotehost = Protocols.DNS.client()->gethostbyaddr(remoteaddr)[0] @@ -612,7 +612,7 @@ class Connection { return message; } - static MIME.Message low_message(string content) + protected MIME.Message low_message(string content) { datamode = 0; MIME.Message message; @@ -694,7 +694,7 @@ class Connection { shutdown_fd(); } - static int launch_functions(string line) + protected int launch_functions(string line) { array(string) command = line / " "; // success @@ -726,7 +726,7 @@ class Connection { } } - static void read_cb(mixed id, string data) + protected void read_cb(mixed id, string data) { string pattern; int bufferposition; @@ -780,14 +780,14 @@ class Connection { } } - static void write_cb() + protected void write_cb() { fd->write("220 " + replace(replycodes[220], "<host>", localhost) + "\r\n"); fd->set_write_callback(0); } - static void shutdown_fd() + protected void shutdown_fd() { remove_call_out(handle_timeout); #if constant(thread_create) @@ -805,7 +805,7 @@ class Connection { #endif } - static void close_cb(int i_close_the_stream) + protected void close_cb(int i_close_the_stream) { if(!i_close_the_stream) { @@ -858,10 +858,10 @@ class Connection { //! So it is your job to provide mail storage and relay mails to other servers class Server { - static object fdport; + protected object fdport; Configuration config; - static void accept_callback() + protected void accept_callback() { object fd = fdport->accept(); if(!fd) diff --git a/lib/modules/Protocols.pmod/SNMP.pmod/protocol.pike b/lib/modules/Protocols.pmod/SNMP.pmod/protocol.pike index d070a491f97e140f98aae26adcc98a11ce91cd6d..aaaa9eca357a3370d50ada6fb0a51f31cb63c903 100644 --- a/lib/modules/Protocols.pmod/SNMP.pmod/protocol.pike +++ b/lib/modules/Protocols.pmod/SNMP.pmod/protocol.pike @@ -17,7 +17,7 @@ //! 2570 : v3 description //! -// $Id: protocol.pike,v 1.18 2008/05/01 10:41:11 nilsson Exp $ +// $Id: protocol.pike,v 1.19 2008/06/28 16:36:58 nilsson Exp $ #include "snmp_globals.h" @@ -116,7 +116,7 @@ object|mapping der_decode(object data, mapping types) } } -static mapping snmp_type_proc = +protected mapping snmp_type_proc = ([ 1 : Standards.ASN1.Types.asn1_boolean, 2 : Standards.ASN1.Types.asn1_integer, 3 : Standards.ASN1.Types.asn1_bit_string, diff --git a/lib/modules/Protocols.pmod/TELNET.pmod b/lib/modules/Protocols.pmod/TELNET.pmod index 1828afa3becb8e3e0809d532b57a6c337cd59112..f0cba71e77a56ea9ce9572f7bb53bca9881aa677 100644 --- a/lib/modules/Protocols.pmod/TELNET.pmod +++ b/lib/modules/Protocols.pmod/TELNET.pmod @@ -1,5 +1,5 @@ // -// $Id: TELNET.pmod,v 1.27 2008/01/13 17:02:43 nilsson Exp $ +// $Id: TELNET.pmod,v 1.28 2008/06/28 16:36:56 nilsson Exp $ // // The TELNET protocol as described by RFC 764 and others. // @@ -230,48 +230,48 @@ constant ENCTYPE_CNT= 3; class protocol { //! The connection. - static object fd; + protected object fd; //! Mapping containing extra callbacks. - static mapping cb; + protected mapping cb; //! Value to send to the callbacks. - static mixed id; + protected mixed id; //! Write callback. - static function(mixed|void:string) write_cb; + protected function(mixed|void:string) write_cb; //! Read callback. - static function(mixed,string:void) read_cb; + protected function(mixed,string:void) read_cb; //! Close callback. - static function(mixed|void:void) close_cb; + protected function(mixed|void:void) close_cb; // See RFC 1143 for the use and meaning of these. - static constant UNKNOWN = 0; - static constant YES = 1; - static constant NO = 2; - static constant WANT = 4; - static constant OPPOSITE = 8; + protected constant UNKNOWN = 0; + protected constant YES = 1; + protected constant NO = 2; + protected constant WANT = 4; + protected constant OPPOSITE = 8; //! Negotiation states of all WILL/WON'T options. //! See RFC 1143 for a description of the states. - static array(int) remote_options = allocate(256,NO); - static array(int) local_options = allocate(256,NO); + protected array(int) remote_options = allocate(256,NO); + protected array(int) local_options = allocate(256,NO); //! Data queued to be sent. - static string to_send = ""; + protected string to_send = ""; //! Indicates that connection should be closed - static int done; + protected int done; //! Tells if we have set the nonblocking write callback or not. - static int nonblocking_write; + protected int nonblocking_write; //! Turns on the write callback if apropriate. - static void enable_write() + protected void enable_write() { DWRITE("TELNET: enable_write()\n"); if (!nonblocking_write && (write_cb || sizeof(to_send) || done)) { @@ -285,7 +285,7 @@ class protocol } //! Turns off the write callback if apropriate. - static void disable_write() + protected void disable_write() { DWRITE("TELNET: disable_write()\n"); if (!write_cb && !sizeof(to_send) && !done && nonblocking_write) { @@ -325,7 +325,7 @@ class protocol //! Callback called when it is clear to send data over the connection. //! This function does the actual sending. - static void send_data() + protected void send_data() { DWRITE("TELNET: Entering send_data()\n"); if (!sizeof(to_send)) { @@ -493,9 +493,9 @@ class protocol //! Indicates whether we are in synch-mode or not. - static int synch = 0; + protected int synch = 0; - static mixed call_callback(mixed what, mixed ... args) + protected mixed call_callback(mixed what, mixed ... args) { if(mixed cb=cb[what]) { @@ -532,7 +532,7 @@ class protocol //! @param s //! The Out-Of-Band data received. //! - static void got_oob(mixed ignored, string s) + protected void got_oob(mixed ignored, string s) { #ifdef TELNET_DEBUG werror("TELNET: got_oob(\"%s\")\n",Array.map(values(s),lambda(int s) { @@ -554,7 +554,7 @@ class protocol //! //! Specifically provided for overloading //! - static void call_read_cb(string data) + protected void call_read_cb(string data) { DWRITE("TELNET: Fnurgel!\n"); if(read_cb && sizeof(data)) read_cb(id,data); @@ -568,7 +568,7 @@ class protocol //! @param s //! The received data. //! - static void got_data(mixed ignored, string line) + protected void got_data(mixed ignored, string line) { #ifdef TELNET_DEBUG werror("TELNET: got_data(\"%s\")\n",Array.map(values(line),lambda(int s) { @@ -854,9 +854,9 @@ class protocol class LineMode { inherit protocol; - static string line_buffer=""; + protected string line_buffer=""; - static void call_read_cb(string data) + protected void call_read_cb(string data) { if(read_cb) { @@ -902,7 +902,7 @@ class Readline ]); } - static void call_read_cb(string data) + protected void call_read_cb(string data) { if(read_cb) { @@ -948,15 +948,15 @@ class Readline } - static function(mixed,string:void) read_cb2; + protected function(mixed,string:void) read_cb2; - static void readline_callback(string data) + protected void readline_callback(string data) { read_cb2(id,data+"\n"); } - static string prompt=""; - static mixed call_callback(mixed what, mixed ... args) + protected string prompt=""; + protected mixed call_callback(mixed what, mixed ... args) { switch(what) { @@ -1067,3 +1067,4 @@ class Readline } } + diff --git a/lib/modules/Protocols.pmod/X.pmod/Extensions.pmod b/lib/modules/Protocols.pmod/X.pmod/Extensions.pmod index 742c7b6197585e4eafcc8604447fa988de658e2a..b1c9268faeb81a4b39d0788b7240e83ec520deef 100644 --- a/lib/modules/Protocols.pmod/X.pmod/Extensions.pmod +++ b/lib/modules/Protocols.pmod/X.pmod/Extensions.pmod @@ -1,6 +1,6 @@ /* Shaped windows. * - * $Id: Extensions.pmod,v 1.15 2004/01/11 00:46:12 nilsson Exp $ + * $Id: Extensions.pmod,v 1.16 2008/06/28 16:36:58 nilsson Exp $ /* * Protocols.X, a Pike interface to the X Window System @@ -26,7 +26,7 @@ //! an abstract class used to provide features for implimenting //! X11 extensions. Provides no useful functionality on its own. -static class extension +protected class extension { object dpy; int major, error, event; diff --git a/lib/modules/Protocols.pmod/XMLRPC.pmod/module.pmod b/lib/modules/Protocols.pmod/XMLRPC.pmod/module.pmod index f8107576ebf2abe7780bf30fb724301c1efd2fc3..8b2e31e5372d435dd275dd863f94ca0a87040858 100644 --- a/lib/modules/Protocols.pmod/XMLRPC.pmod/module.pmod +++ b/lib/modules/Protocols.pmod/XMLRPC.pmod/module.pmod @@ -136,7 +136,7 @@ string encode_response_fault(int fault_code, string fault_string) // Internal stuff below. -static constant common_dtd_fragment = #" +protected constant common_dtd_fragment = #" <!ELEMENT params (param*)> <!ELEMENT param (value)> @@ -159,14 +159,14 @@ static constant common_dtd_fragment = #" <!ELEMENT name (#PCDATA)> "; -static constant call_dtd = #" +protected constant call_dtd = #" <!DOCTYPE methodCall [ <!ELEMENT methodCall (methodName, params)> <!ELEMENT methodName (#PCDATA)> "+common_dtd_fragment+#"]> "; -static constant response_dtd = #" +protected constant response_dtd = #" <!DOCTYPE methodResponse [ <!ELEMENT methodResponse (params|fault)> <!ELEMENT fault (value)> @@ -176,9 +176,9 @@ static constant response_dtd = #" // One more fix because some people found the specs too easy and // decided that you can have <value>test</value> // (that is omitting string inside a value). -static class StringWrap(string s){}; +protected class StringWrap(string s){}; -static mixed decode(string xml_input, string dtd_input) +protected mixed decode(string xml_input, string dtd_input) { // We cannot insert 0 integers directly into the parse tree, so // we'll use magic_zero as a placeholder and destruct it afterwards. @@ -266,14 +266,14 @@ static mixed decode(string xml_input, string dtd_input) return tree[0]; } -static string xml_encode_string(string s) +protected string xml_encode_string(string s) { return replace(s, ({ "&", "<", ">", "\"", "\'", "\000" }), ({ "&", "<", ">", """, "'", "�" })); } -static string encode(int|float|string|mapping|array value) +protected string encode(int|float|string|mapping|array value) { string r = "<value>"; if(intp(value)) @@ -307,7 +307,7 @@ static string encode(int|float|string|mapping|array value) return r+"</value>\n"; } -static string encode_params(array params) +protected string encode_params(array params) { string r = "<params>\n"; foreach(params, mixed param) @@ -383,16 +383,16 @@ class Client(string|Standards.URI url) //!@} class AsyncClient { - static object request; - static function user_data_ok; - static string _url; + protected object request; + protected function user_data_ok; + protected string _url; void create(string|Standards.URI|Protocols.HTTP.Session.SessionURL url) { _url = url; } - static void _data_ok() + protected void _data_ok() { mixed result; if(request) { diff --git a/lib/modules/Remote.pmod/module.pmod b/lib/modules/Remote.pmod/module.pmod index 1efe8b78c88f56600f9f3452aecc01e7e4d5734c..203341e7a6ac1e0108b736c24970cec04357a94b 100644 --- a/lib/modules/Remote.pmod/module.pmod +++ b/lib/modules/Remote.pmod/module.pmod @@ -71,7 +71,7 @@ class Call { //! class Connection { #ifdef REMOTE_DEBUG - private static int _debug_conn_nr; + private protected int _debug_conn_nr; #undef DEBUGMSG #define DEBUGMSG(X) werror("<" + _debug_conn_nr + "> " + (X)) #endif @@ -81,11 +81,11 @@ class Connection { object ctx; array(function) close_callbacks = ({ }); - static string|int last_error; + protected string|int last_error; int nice; // don't throw from call_sync - static void enable_async() + protected void enable_async() { // This function is installed as a call out. This way async mode // is enabled only if and when a backend is started (provided diff --git a/lib/modules/SSL.pmod/Cipher.pmod b/lib/modules/SSL.pmod/Cipher.pmod index b4bd41f458bdb4945343d5890d6d652f41eac5a1..0eae73a4c8648df8918de6a9f043331cf26bf6a7 100644 --- a/lib/modules/SSL.pmod/Cipher.pmod +++ b/lib/modules/SSL.pmod/Cipher.pmod @@ -1,5 +1,5 @@ // -// $Id: Cipher.pmod,v 1.15 2005/05/26 12:07:02 mast Exp $ +// $Id: Cipher.pmod,v 1.16 2008/06/28 16:36:58 nilsson Exp $ #pike __REAL_VERSION__ @@ -56,12 +56,12 @@ class mac_none //! MAC using SHA. class MACsha { - static constant pad_1 = "6666666666666666666666666666666666666666"; - static constant pad_2 = ("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" + protected constant pad_1 = "6666666666666666666666666666666666666666"; + protected constant pad_2 = ("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"); - static Crypto.Hash algorithm = Crypto.SHA1; - static string secret; + protected Crypto.Hash algorithm = Crypto.SHA1; + protected string secret; //! string hash_raw(string data) @@ -101,7 +101,7 @@ class MACsha } //! - static void create (string|void s) + protected void create (string|void s) { secret = s || ""; } @@ -111,18 +111,18 @@ class MACsha class MACmd5 { inherit MACsha; - static constant pad_1 = "666666666666666666666666666666666666666666666666"; - static constant pad_2 = ("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" + protected constant pad_1 = "666666666666666666666666666666666666666666666666"; + protected constant pad_2 = ("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"); - static Crypto.Hash algorithm = Crypto.MD5; + protected Crypto.Hash algorithm = Crypto.MD5; } //! class MAChmac_sha { - static string secret; - static Crypto.HMAC hmac; + protected string secret; + protected Crypto.HMAC hmac; //! string hash(object packet, Gmp.mpz seq_num) { @@ -138,7 +138,7 @@ class MAChmac_sha { } //! - static void create(string|void s) { + protected void create(string|void s) { secret = s || ""; hmac=Crypto.HMAC(Crypto.SHA1); } @@ -149,14 +149,14 @@ class MAChmac_md5 { inherit MAChmac_sha; //! - static void create(string|void s) { + protected void create(string|void s) { secret = s || ""; hmac=Crypto.HMAC(Crypto.MD5); } } // Hashfn is either a Crypto.MD5 or Crypto.SHA -static string P_hash(Crypto.Hash hashfn, int hlen, string secret, +protected string P_hash(Crypto.Hash hashfn, int hlen, string secret, string seed, int len) { Crypto.HMAC hmac=Crypto.HMAC(hashfn); @@ -297,7 +297,7 @@ class DHParameters /* p = 2^1024 - 2^960 - 1 + 2^64 * floor( 2^894 Pi + 129093 ) */ - static Gmp.mpz orm96() { + protected Gmp.mpz orm96() { p = Gmp.mpz("FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1" "29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD" "EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245" @@ -311,7 +311,7 @@ class DHParameters return this; } - static void create(object ... args) { + protected void create(object ... args) { switch (sizeof(args)) { case 0: @@ -480,3 +480,4 @@ array lookup(int suite,int version) #else // constant(Crypto.Hash) constant this_program_does_not_exist = 1; #endif + diff --git a/lib/modules/SSL.pmod/connection.pike b/lib/modules/SSL.pmod/connection.pike index 33d497628dab077d78618f7356b0d65961dac5ed..db5a3da4e9ee935e282f6c7b8dcf1b2d508451ab 100644 --- a/lib/modules/SSL.pmod/connection.pike +++ b/lib/modules/SSL.pmod/connection.pike @@ -1,5 +1,5 @@ // -// $Id: connection.pike,v 1.41 2005/04/28 19:56:47 mast Exp $ +// $Id: connection.pike,v 1.42 2008/06/28 16:36:58 nilsson Exp $ #pike __REAL_VERSION__ //#pragma strict_types @@ -54,7 +54,7 @@ void create(int is_server, void|SSL.context ctx) } #if 0 -static void destroy() +protected void destroy() { werror("Connection destructed:\n%s\n", describe_backtrace(backtrace())); } @@ -71,7 +71,7 @@ void set_alert_callback(function(object,int|object,string:void) callback) //! Low-level receive handler. Returns a packet, an alert, or zero if //! more data is needed to get a complete packet. -static object recv_packet(string data) +protected object recv_packet(string data) { mixed res; @@ -413,3 +413,4 @@ string|int got_data(string|int s) } #endif + diff --git a/lib/modules/SSL.pmod/context.pike b/lib/modules/SSL.pmod/context.pike index ac52ec23f64c40b4e1e197b45b398e41b4eef430..a5b5f4eba4c84ba8d3a98a4845651c6756410709 100644 --- a/lib/modules/SSL.pmod/context.pike +++ b/lib/modules/SSL.pmod/context.pike @@ -1,5 +1,5 @@ // -// $Id: context.pike,v 1.36 2008/01/05 14:40:14 grubba Exp $ +// $Id: context.pike,v 1.37 2008/06/28 16:36:58 nilsson Exp $ #pike __REAL_VERSION__ #pragma strict_types @@ -68,7 +68,7 @@ array(string) get_authorities() return authorities; } -static array(string) authorities = ({}); +protected array(string) authorities = ({}); array(Tools.X509.TBSCertificate) authorities_cache = ({}); //! Sets the list of trusted certificate issuers. @@ -95,7 +95,7 @@ array(array(string)) get_trusted_issuers() return trusted_issuers; } -static array(array(string)) trusted_issuers = ({}); +protected array(array(string)) trusted_issuers = ({}); array(array(Tools.X509.TBSCertificate)) trusted_issuers_cache = ({}); //! Determines whether certificates presented by the peer are verified, or @@ -346,3 +346,4 @@ private void update_trusted_issuers() } #endif // constant(Gmp.mpz) && constant(Crypto.Hash) + diff --git a/lib/modules/SSL.pmod/session.pike b/lib/modules/SSL.pmod/session.pike index c74de9815edb42b5a42a8751b44bfed95723b8b6..16982daa30bfd3eb15cc7603fbb63da4de843ebf 100644 --- a/lib/modules/SSL.pmod/session.pike +++ b/lib/modules/SSL.pmod/session.pike @@ -1,5 +1,5 @@ // -// $Id: session.pike,v 1.36 2005/10/28 19:49:40 bill Exp $ +// $Id: session.pike,v 1.37 2008/06/28 16:36:58 nilsson Exp $ #pike __REAL_VERSION__ #pragma strict_types @@ -18,7 +18,7 @@ #if constant(SSL.Cipher.CipherSpec) import .Constants; -static constant Struct = ADT.struct; +protected constant Struct = ADT.struct; //! Identifies the session to the server string identity; @@ -75,7 +75,7 @@ void set_compression_method(int compr) compression_algorithm = compr; } -static string generate_key_block(string client_random, string server_random, +protected string generate_key_block(string client_random, string server_random, array(int) version) { int required = 2 * ( @@ -120,7 +120,7 @@ static string generate_key_block(string client_random, string server_random, } #ifdef SSL3_DEBUG -static void printKey(string name, string key) { +protected void printKey(string name, string key) { string res=""; res+=sprintf("%s: len:%d type:%d \t\t",name,sizeof(key),0); @@ -330,3 +330,4 @@ array(.state) new_client_states(string client_random, string server_random, } #endif // constant(SSL.Cipher.CipherSpec) + diff --git a/lib/modules/SSL.pmod/sslfile.pike b/lib/modules/SSL.pmod/sslfile.pike index 9ea92170822c401f35d51177f3a749169657dded..eaec6e048d2560486c2387bf6421d105f26cb80e 100644 --- a/lib/modules/SSL.pmod/sslfile.pike +++ b/lib/modules/SSL.pmod/sslfile.pike @@ -1,6 +1,6 @@ #pike __REAL_VERSION__ -/* $Id: sslfile.pike,v 1.109 2007/03/14 15:42:39 mast Exp $ +/* $Id: sslfile.pike,v 1.110 2008/06/28 16:36:58 nilsson Exp $ */ #if constant(SSL.Cipher.CipherAlgorithm) @@ -49,7 +49,7 @@ // #define SSL3_DEBUG_TRANSPORT #ifdef SSL3_DEBUG -static string stream_descr; +protected string stream_descr; #define SSL3_DEBUG_MSG(X...) \ werror ("[thr:" + this_thread()->id_number() + \ "," + (stream ? "" : "ex ") + stream_descr + "] " + X) @@ -64,7 +64,7 @@ static string stream_descr; #define SSL3_DEBUG_MORE_MSG(X...) 0 #endif -static Stdio.File stream; +protected Stdio.File stream; // The stream is closed by shutdown(), which is called directly or // indirectly from destroy() or close() but not from anywhere else. // @@ -74,47 +74,47 @@ static Stdio.File stream; // close_state >= NORMAL_CLOSE. The stream is closed by the callbacks // as soon the close packets are done, or if an error occurs. -static SSL.connection conn; +protected SSL.connection conn; // Always set when stream is. Destructed with destroy() at shutdown // since it contains cyclic references. Noone else gets to it, though. -static array(string) write_buffer; // Encrypted data to be written. -static String.Buffer read_buffer; // Decrypted data that has been read. +protected array(string) write_buffer; // Encrypted data to be written. +protected String.Buffer read_buffer; // Decrypted data that has been read. -static mixed callback_id; -static function(void|object,void|mixed:int) accept_callback; -static function(void|mixed,void|string:int) read_callback; -static function(void|mixed:int) write_callback; -static function(void|mixed:int) close_callback; +protected mixed callback_id; +protected function(void|object,void|mixed:int) accept_callback; +protected function(void|mixed,void|string:int) read_callback; +protected function(void|mixed:int) write_callback; +protected function(void|mixed:int) close_callback; -static Pike.Backend real_backend; +protected Pike.Backend real_backend; // The real backend for the stream. -static Pike.Backend local_backend; +protected Pike.Backend local_backend; // Internally all I/O is done using callbacks. When the real backend // can't be used, either because we aren't in callback mode (i.e. the // user hasn't registered any callbacks), or because we're to do a // blocking operation, this local one takes its place. It's // created on demand. -static int nonblocking_mode; +protected int nonblocking_mode; -static enum CloseState { +protected enum CloseState { STREAM_OPEN = 0, STREAM_UNINITIALIZED = 1, NORMAL_CLOSE = 2, // The caller has requested a normal close. CLEAN_CLOSE = 3, // The caller has requested a clean close. } -static CloseState close_state = STREAM_UNINITIALIZED; +protected CloseState close_state = STREAM_UNINITIALIZED; -static enum ClosePacketSendState { +protected enum ClosePacketSendState { CLOSE_PACKET_NOT_SCHEDULED = 0, CLOSE_PACKET_SCHEDULED, CLOSE_PACKET_QUEUED_OR_DONE, CLOSE_PACKET_MAYBE_IGNORED_WRITE_ERROR, CLOSE_PACKET_WRITE_ERROR, } -static ClosePacketSendState close_packet_send_state; +protected ClosePacketSendState close_packet_send_state; // State for the close packet we send. The trickiness here is that if // there's an error writing it, that error should sometimes be // ignored: @@ -128,14 +128,14 @@ static ClosePacketSendState close_packet_send_state; // Also, if there is an error we can't report it immediately since the // remote close packet might be sitting in the input buffer. -static int local_errno; +protected int local_errno; // If nonzero, override the errno on the stream with this. -static int cb_errno; +protected int cb_errno; // Stores the errno from failed I/O in a callback so that the next // visible I/O operation can report it properly. -static int got_extra_read_call_out; +protected int got_extra_read_call_out; // 1 when we have a call out to ssl_read_callback. We get this when we // need to call read_callback or close_callback but can't do that // right away from ssl_read_callback. See comments in that function @@ -147,12 +147,12 @@ static int got_extra_read_call_out; // to schedule an extra read call out; update_internal_state will then // do the actual call out installation if possible. -static int alert_cb_called; +protected int alert_cb_called; // Need to know if the alert callback has been called in // ssl_read_callback since it can't continue in that case. This is // only set temporarily while ssl_read_callback runs. -static constant epipe_errnos = (< +protected constant epipe_errnos = (< System.EPIPE, System.ECONNRESET, #if constant(System.WSAECONNRESET) @@ -215,7 +215,7 @@ static constant epipe_errnos = (< #define THREAD_T Thread.Thread #define THIS_THREAD() this_thread() -static void thread_error (string msg, THREAD_T other_thread) +protected void thread_error (string msg, THREAD_T other_thread) { #if 0 && constant (_locate_references) werror ("%s\n%O got %d refs", msg, this, _refs (this)); @@ -247,7 +247,7 @@ static void thread_error (string msg, THREAD_T other_thread) #define THREAD_T int #define THIS_THREAD() 1 -static void thread_error (string msg, THREAD_T other_thread) +protected void thread_error (string msg, THREAD_T other_thread) { error ("%s" "%s\n" @@ -267,7 +267,7 @@ static void thread_error (string msg, THREAD_T other_thread) #endif // !constant (Thread.thread_create) -static THREAD_T op_thread; +protected THREAD_T op_thread; #define CHECK_CB_MODE(CUR_THREAD) do { \ if (Pike.Backend backend = stream && stream->query_backend()) { \ @@ -441,7 +441,7 @@ static THREAD_T op_thread; } \ } while (0) -static void create (Stdio.File stream, SSL.context ctx, +protected void create (Stdio.File stream, SSL.context ctx, int|void is_client, int|void is_blocking) //! Create a connection over @[stream], which should be an open socket or //! pipe. @[ctx] is the SSL context. If @[is_client] is set then a @@ -605,7 +605,7 @@ int close (void|string how, void|int clean_close, void|int dont_throw) return 1; } -static void cleanup_on_error() +protected void cleanup_on_error() // Called when any error occurs on the stream. (Doesn't handle errno // reporting since it might involve either local_errno and/or // cb_errno.) @@ -691,7 +691,7 @@ Stdio.File shutdown() } LEAVE; } -static void destroy() +protected void destroy() //! Try to close down the connection properly since it's customary to //! close files just by dropping them. No guarantee can be made that //! the close packet gets sent successfully though, because we can't @@ -1281,7 +1281,7 @@ string _sprintf(int t) { } -static void update_internal_state (void|int assume_real_backend) +protected void update_internal_state (void|int assume_real_backend) // Update the internal callbacks according to the current state. Does // nothing if the local backend is active, unless assume_real_backend // is set, in which case we're installing callbacks for the real @@ -1377,7 +1377,7 @@ static void update_internal_state (void|int assume_real_backend) got_extra_read_call_out); } -static int queue_write() +protected int queue_write() // Return 0 if the connection is still alive, 1 if it was closed // politely, and -1 if it died unexpectedly (specifically, our side // has sent a fatal alert packet (not close notify) for some reason @@ -1412,7 +1412,7 @@ static int queue_write() return res; } -static int direct_write() +protected int direct_write() // Do a write directly (and maybe also read if there's internal // reading to be done). Something to write is assumed to exist (either // in write_buffer or in the packet queue). Returns zero on error (as @@ -1449,7 +1449,7 @@ static int direct_write() return 1; } -static int ssl_read_callback (int called_from_real_backend, string input) +protected int ssl_read_callback (int called_from_real_backend, string input) { SSL3_DEBUG_MSG ("ssl_read_callback (%O, %s): " "nonblocking mode=%d, callback mode=%d%s%s\n", @@ -1673,7 +1673,7 @@ static int ssl_read_callback (int called_from_real_backend, string input) return 0; } -static int ssl_write_callback (int called_from_real_backend) +protected int ssl_write_callback (int called_from_real_backend) { SSL3_DEBUG_MSG ("ssl_write_callback (%O): " "nonblocking mode=%d, callback mode=%d%s%s\n", @@ -1888,7 +1888,7 @@ static int ssl_write_callback (int called_from_real_backend) return ret; } -static int ssl_close_callback (int called_from_real_backend) +protected int ssl_close_callback (int called_from_real_backend) { SSL3_DEBUG_MSG ("ssl_close_callback (%O): " "nonblocking mode=%d, callback mode=%d%s%s\n", @@ -1971,3 +1971,4 @@ static int ssl_close_callback (int called_from_real_backend) #else // constant(SSL.Cipher.CipherAlgorithm) constant this_program_does_not_exist = 1; #endif + diff --git a/lib/modules/Sql.pmod/Sql.pike b/lib/modules/Sql.pmod/Sql.pike index 4cae863520f3791fe282ea6e35f4d43859121e53..0d0f2b58636067e399abc8236ef55a471ffe9c68 100644 --- a/lib/modules/Sql.pmod/Sql.pike +++ b/lib/modules/Sql.pmod/Sql.pike @@ -1,5 +1,5 @@ /* - * $Id: Sql.pike,v 1.91 2008/01/09 16:32:13 grubba Exp $ + * $Id: Sql.pike,v 1.92 2008/06/28 16:36:58 nilsson Exp $ * * Implements the generic parts of the SQL-interface * @@ -104,7 +104,7 @@ function(int:string) encode_datetime; function(string:int) decode_datetime; -static program find_dbm(string program_name) { +protected program find_dbm(string program_name) { program p; // we look in Sql.type and Sql.Provider.type.type for a valid sql class. p = Sql[program_name]; @@ -333,13 +333,13 @@ string get_charset() return master_sql->get_charset && master_sql->get_charset(); } -static string _sprintf(int type, mapping|void flags) +protected string _sprintf(int type, mapping|void flags) { if(type=='O' && master_sql && master_sql->_sprintf) return sprintf("Sql.%O", master_sql); } -static array(mapping(string:mixed)) res_obj_to_array(object res_obj) +protected array(mapping(string:mixed)) res_obj_to_array(object res_obj) { if (res_obj) { @@ -406,7 +406,7 @@ string|object compile_query(string q) } //! Handle sprintf-based quoted arguments -static array(string|mapping(string|int:mixed)) +protected array(string|mapping(string|int:mixed)) handle_extraargs(string query, array(mixed) extraargs) { array(mixed) args=allocate(sizeof(extraargs)); diff --git a/lib/modules/Sql.pmod/mysql.pike b/lib/modules/Sql.pmod/mysql.pike index d60f237bb41b2091eb8ab8d4c7e56c3a87fae61d..5bcd0ec6ce33afcac157ed9b3dacf9e5b3e4e4ba 100644 --- a/lib/modules/Sql.pmod/mysql.pike +++ b/lib/modules/Sql.pmod/mysql.pike @@ -1,5 +1,5 @@ /* - * $Id: mysql.pike,v 1.40 2008/01/09 14:26:07 mast Exp $ + * $Id: mysql.pike,v 1.41 2008/06/28 16:36:59 nilsson Exp $ * * Glue for the Mysql-module */ @@ -33,15 +33,15 @@ constant unicode_decode_mode_is_broken = 1; // Set to the above if the connection is requested to be in one of the // unicode modes. latin1 unicode encode mode is enabled by default; it // should be compatible with earlier pike versions. -static int utf8_mode; +protected int utf8_mode; // The charset, either "latin1" or "utf8", currently assigned to // character_set_client when unicode encode mode is enabled. Zero when // the connection charset has been set to something else than "latin1" // or "unicode". -static string send_charset; +protected string send_charset; -static void update_unicode_encode_mode_from_charset (string charset) +protected void update_unicode_encode_mode_from_charset (string charset) { switch (charset) { // Lowercase assumed. case "latin1": @@ -803,7 +803,7 @@ int(0..1) is_keyword( string name ) ])[ lower_case(name) ]; } -static void create(string|void host, string|void database, +protected void create(string|void host, string|void database, string|void user, string|void _password, mapping(string:string|int)|void options) { @@ -851,3 +851,4 @@ static void create(string|void host, string|void database, #else constant this_program_does_not_exist=1; #endif /* constant(Mysql.mysql) */ + diff --git a/lib/modules/Sql.pmod/postgres.pike b/lib/modules/Sql.pmod/postgres.pike index 3ad35e4999612ccf8a2b83dd0afec453e6ebf713..59356939c7caa02563a23edcf07dc66e42ffe5da 100644 --- a/lib/modules/Sql.pmod/postgres.pike +++ b/lib/modules/Sql.pmod/postgres.pike @@ -1,7 +1,7 @@ /* * This is part of the Postgres module for Pike. * - * $Id: postgres.pike,v 1.27 2008/01/09 14:26:07 mast Exp $ + * $Id: postgres.pike,v 1.28 2008/06/28 16:36:59 nilsson Exp $ * */ @@ -55,7 +55,7 @@ #define ERROR(X) throw (({X,backtrace()})) inherit Postgres.postgres: mo; -private static mixed callout; +private protected mixed callout; private string has_relexpires = "unknown"; //! @decl void select_db(string dbname) @@ -101,13 +101,13 @@ private string has_relexpires = "unknown"; //! Should you need to report a bug to the author, please submit along with //! the report the driver version number, as returned by this call. -private static string glob_to_regexp (string glob) { +private protected string glob_to_regexp (string glob) { if (!glob||!sizeof(glob)) return 0; return "^"+replace(glob,({"*","?","'","\\"}),({".*",".","\\'","\\\\"}))+"$"; } -static private int mkbool(string s) { +protected private int mkbool(string s) { if (s=="f") return 0; return 1; @@ -166,7 +166,7 @@ void create(void|string host, void|string database, void|string user, mo::create(real_host||"",real_db||"",user||"",pass||"",port); } -static void poll (int delay) +protected void poll (int delay) { callout=call_out(poll,delay,delay); big_query(""); @@ -392,3 +392,4 @@ int|object big_query(object|string q, mapping(string|int:mixed)|void bindings) #else constant this_program_does_not_exist=1; #endif /* constant(Postgres.postgres) */ + diff --git a/lib/modules/Sql.pmod/rsql.pike b/lib/modules/Sql.pmod/rsql.pike index 569a111e890e3c99a48d7bf4365cbb5a684a5c2a..6d421203af1c22a21ba20f4c8cc740675aa83a96 100644 --- a/lib/modules/Sql.pmod/rsql.pike +++ b/lib/modules/Sql.pmod/rsql.pike @@ -8,7 +8,7 @@ #if constant(thread_create) #define LOCK object key=mutex->lock() #define UNLOCK destruct(key) -static private object(Thread.Mutex) mutex = Thread.Mutex(); +protected private object(Thread.Mutex) mutex = Thread.Mutex(); #else #define LOCK #define UNLOCK @@ -16,13 +16,13 @@ static private object(Thread.Mutex) mutex = Thread.Mutex(); #define ERROR(X ...) predef::error(X) -static object(Stdio.File) sock; -static int seqno = 0; +protected object(Stdio.File) sock; +protected int seqno = 0; -static private string host, user, pw; -static private int port; +protected private string host, user, pw; +protected private int port; -static void low_reconnect() +protected void low_reconnect() { object losock = Stdio.File(); if(sock) @@ -54,7 +54,7 @@ static void low_reconnect() } } -static void low_connect(string the_host, int the_port, string the_user, +protected void low_connect(string the_host, int the_port, string the_user, string the_pw) { host = the_host; @@ -64,7 +64,7 @@ static void low_connect(string the_host, int the_port, string the_user, low_reconnect(); } -static mixed do_request(int cmd, mixed|void arg, int|void noreconnect) +protected mixed do_request(int cmd, mixed|void arg, int|void noreconnect) { LOCK; if(!sock) @@ -172,8 +172,8 @@ int|object big_query(object|string q, mapping(string|int:mixed)|void bindings) mixed qid = do_request('Q', q); return qid && class { - static function(int,mixed:mixed) do_request; - static mixed qid; + protected function(int,mixed:mixed) do_request; + protected mixed qid; void destroy() { diff --git a/lib/modules/Sql.pmod/sql_result.pike b/lib/modules/Sql.pmod/sql_result.pike index 14d71b4f660981a2dcbae09843c8009ba19be670..962cb305d414ac1a9c2ac273d53b2213df4890fb 100644 --- a/lib/modules/Sql.pmod/sql_result.pike +++ b/lib/modules/Sql.pmod/sql_result.pike @@ -1,5 +1,5 @@ /* - * $Id: sql_result.pike,v 1.17 2007/07/28 18:27:32 jhs Exp $ + * $Id: sql_result.pike,v 1.18 2008/06/28 16:36:59 nilsson Exp $ * * Implements the generic result module of the SQL-interface * @@ -22,9 +22,9 @@ int index; //! //! @param res //! Result to use as base. -static void create(mixed res); +protected void create(mixed res); -static string _sprintf(int type, mapping|void flags) +protected string _sprintf(int type, mapping|void flags) { int f = num_fields(); catch( int r = num_rows() ); @@ -70,8 +70,8 @@ int|array(string|int) fetch_row(); class _get_iterator { - static int|array(string|int) row = fetch_row(); - static int pos = 0; + protected int|array(string|int) row = fetch_row(); + protected int pos = 0; int index() { diff --git a/lib/modules/Sql.pmod/sql_util.pmod b/lib/modules/Sql.pmod/sql_util.pmod index 46c415cb052a9fb4e28ff74e6abb6ddd58c99aa5..e8b5625bfa143937cdf3b2e75c20f690d725a758 100644 --- a/lib/modules/Sql.pmod/sql_util.pmod +++ b/lib/modules/Sql.pmod/sql_util.pmod @@ -1,5 +1,5 @@ /* - * $Id: sql_util.pmod,v 1.20 2008/06/25 11:53:31 srb Exp $ + * $Id: sql_util.pmod,v 1.21 2008/06/28 16:36:59 nilsson Exp $ * * Some SQL utility functions. * They are kept here to avoid circular references. @@ -64,7 +64,7 @@ string emulate_bindings(string query, mapping(string|int:mixed)|void bindings, //! Result object wrapper performing utf8 decoding of all fields. class UnicodeWrapper ( // The wrapped result object. - static object master_result + protected object master_result ) { //! Returns the number of rows in the result. @@ -86,7 +86,7 @@ class UnicodeWrapper ( } //! Cached @[fetch_fields()] result. - static array(int|mapping(string:mixed)) field_info; + protected array(int|mapping(string:mixed)) field_info; //! Returns Information about the fields in the result. //! @@ -205,3 +205,4 @@ class MySQLBrokenUnicodeWrapper } #endif + diff --git a/lib/modules/Sql.pmod/tds.pike b/lib/modules/Sql.pmod/tds.pike index 176a6a32b32f0cdb09652e43725c22854529520b..6666ff8595f0be321b473d6a7b727b49079c1898 100644 --- a/lib/modules/Sql.pmod/tds.pike +++ b/lib/modules/Sql.pmod/tds.pike @@ -1,5 +1,5 @@ /* - * $Id: tds.pike,v 1.23 2007/04/13 11:48:17 grubba Exp $ + * $Id: tds.pike,v 1.24 2008/06/28 16:36:59 nilsson Exp $ * * A Pike implementation of the TDS protocol. * @@ -33,12 +33,12 @@ //! @seealso //! @[Sql.Sql()] -static int filter_noprint(int char) +protected int filter_noprint(int char) { return ((char == 32) || ((char != 0x7f) && (char & 0x60)))?char:'.'; } -static string hex_dump(string data) { +protected string hex_dump(string data) { array(string) lines = data/16.0; int off; foreach(lines; int i; string line) { @@ -55,7 +55,7 @@ static string hex_dump(string data) { #if (__REAL_MAJOR__ > 7) || ((__REAL_MAJOR__ == 7) && (__REAL_MINOR__ >= 6)) // Static blocks affect nested classes in Pike 7.4. // We don't want that... -static { +protected { #endif /* Pike 7.6 or later */ constant DEF_MAJOR = 8; constant DEF_MINOR = 0; @@ -186,13 +186,13 @@ static { predef::error(last_error = msg); } - static object utf16enc = Locale.Charset.encoder("UTF16LE"); - static string string_to_utf16(string s) + protected object utf16enc = Locale.Charset.encoder("UTF16LE"); + protected string string_to_utf16(string s) { return utf16enc->feed(s)->drain(); } - static object utf16dec = Locale.Charset.decoder("UTF16LE"); - static string utf16_to_string(string s) + protected object utf16dec = Locale.Charset.decoder("UTF16LE"); + protected string utf16_to_string(string s) { return utf16dec->feed(s)->drain(); } @@ -228,7 +228,7 @@ static { string inbuf = ""; int done; - static void fill_buf() + protected void fill_buf() { if (done) { TDS_WERROR("Filling buffer on finished packet!\n" @@ -265,7 +265,7 @@ static { inpos = 0; } - static void destroy() + protected void destroy() { // Return the connection to the idle state. while (!done) { @@ -335,7 +335,7 @@ static { } } - static void create() + protected void create() { if (busy) { tds_error("Creating InPacket on busy connection!\n"); @@ -353,7 +353,7 @@ static { array(string) strings = ({}); int flags; - static void create(int|void flags) + protected void create(int|void flags) { this_program::flags = flags; } @@ -490,7 +490,7 @@ static { return 0; } - static string crypt_pass(string password) + protected string crypt_pass(string password) { password = string_to_utf16(password); password ^= "\x5a"*sizeof(password); @@ -500,7 +500,7 @@ static { }); } - static InPacket send_login() + protected InPacket send_login() { password = password[..127]; @@ -594,7 +594,7 @@ static { return encrypt_answer(md4->digest() + "\0"*16, nonce); } - static void send_auth(string nonce) + protected void send_auth(string nonce) { int out_flag = 0x11; Packet p = Packet(); @@ -612,7 +612,7 @@ static { send_packet(p, 0x11); } - static void process_auth(InPacket inp) + protected void process_auth(InPacket inp) { int pdu_size = inp->get_smallint(); if (pdu_size < 32) tds_error("Bad pdu size: %d\n", pdu_size); @@ -628,7 +628,7 @@ static { send_auth(nonce); } - static void process_msg(InPacket inp, int token_type) + protected void process_msg(InPacket inp, int token_type) { TDS_WERROR("TDS_ERROR_TOKEN | TDS_INFO_TOKEN | TDS_EED_TOKEN\n"); int len = inp->get_smallint(); @@ -685,7 +685,7 @@ static { } } - static void process_env_chg(InPacket inp) + protected void process_env_chg(InPacket inp) { int size = inp->get_smallint(); int env_type = inp->get_byte(); @@ -894,7 +894,7 @@ static { return res; } - static array(mapping(string:mixed)) tds7_process_result(InPacket inp) + protected array(mapping(string:mixed)) tds7_process_result(InPacket inp) { int num_cols = inp->get_smallint(); if (num_cols == 0xffff) { @@ -909,7 +909,7 @@ static { return column_info; } - static void process_default_tokens(InPacket inp, int token_type) + protected void process_default_tokens(InPacket inp, int token_type) { if (token_type == TDS_DONE_TOKEN) return; switch(token_type) { @@ -1046,7 +1046,7 @@ static { } } - static string|int get_data(InPacket inp, + protected string|int get_data(InPacket inp, mapping(string:mixed) info, int col) { TDS_WERROR("get_data for column %d info:%O\n", col, info); @@ -1138,7 +1138,7 @@ static { } } - static string|int convert(string|int raw, mapping(string:mixed) info) + protected string|int convert(string|int raw, mapping(string:mixed) info) { if (!raw) { TDS_CONV_WERROR("%O ==> NULL\n", raw); @@ -1277,7 +1277,7 @@ static { } } - static array(string|int) process_row(InPacket inp, + protected array(string|int) process_row(InPacket inp, array(mapping(string:mixed)) col_info) { if (!col_info) return 0; @@ -1318,7 +1318,7 @@ static { } } - static void process_login_tokens(InPacket inp) + protected void process_login_tokens(InPacket inp) { int ok = 0; int token_type; @@ -1422,7 +1422,7 @@ static { destruct(); } - static void create(string server, int port, string database, + protected void create(string server, int port, string database, string username, string auth) { string domain; @@ -1493,7 +1493,7 @@ class compile_query // FIXME: } - static array(string) split_query_on_placeholders(string query) + protected array(string) split_query_on_placeholders(string query) { array(string) res = ({}); int i; @@ -1553,7 +1553,7 @@ class compile_query //! //! @seealso //! @[big_query()] - static void create(string query) + protected void create(string query) { TDS_WERROR("Compiling query: %O\n", query); splitted_query = split_query_on_placeholders(query); @@ -1575,11 +1575,11 @@ class compile_query //! A query result set. class big_query { - static int row_no; - static int eot; + protected int row_no; + protected int eot; - static Connection.InPacket result_packet; - static array(mapping(string:mixed)) column_info; + protected Connection.InPacket result_packet; + protected array(mapping(string:mixed)) column_info; //! Fetch the next row from the result set. //! @@ -1656,7 +1656,7 @@ class big_query //! //! @seealso //! @[compile_query()] - static void create(string|compile_query query) + protected void create(string|compile_query query) { if (stringp(query)) { query = compile_query(query); @@ -1676,7 +1676,7 @@ class big_query } } -static compile_query compiled_insert_id = +protected compile_query compiled_insert_id = compile_query("SELECT @@identity AS insert_id"); //! Fetch the identity of the last insert (if available). @@ -1734,7 +1734,7 @@ string error() //! //! @seealso //! @[Sql.Sql()] -static void create(string|void server, string|void database, +protected void create(string|void server, string|void database, string|void user, string|void password) { if (con) { diff --git a/lib/modules/Standards.pmod/ASN1.pmod/Decode.pmod b/lib/modules/Standards.pmod/ASN1.pmod/Decode.pmod index 41d221af9243d30dfe350aef5554e4fc65a31074..1c78c5c4c461b5c170a6ce3d3fdafb25d9d5a688 100644 --- a/lib/modules/Standards.pmod/ASN1.pmod/Decode.pmod +++ b/lib/modules/Standards.pmod/ASN1.pmod/Decode.pmod @@ -1,5 +1,5 @@ // -// $Id: Decode.pmod,v 1.23 2008/05/02 16:41:57 nilsson Exp $ +// $Id: Decode.pmod,v 1.24 2008/06/28 16:36:59 nilsson Exp $ // #pike __REAL_VERSION__ @@ -36,7 +36,7 @@ class Primitive raw = r; } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%d)", this_program, combined_tag); } @@ -77,7 +77,7 @@ class Constructed elements = e; } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%d)", this_program, combined_tag); } } @@ -221,3 +221,4 @@ constant constructed = Constructed; #else constant this_program_does_not_exist=1; #endif + diff --git a/lib/modules/Standards.pmod/ASN1.pmod/Types.pmod b/lib/modules/Standards.pmod/ASN1.pmod/Types.pmod index 962816f3181caa73d199376a5d527d7a855df1ca..b6a31d90bb0541f6f6cfccc677240804c1bcda73 100644 --- a/lib/modules/Standards.pmod/ASN1.pmod/Types.pmod +++ b/lib/modules/Standards.pmod/ASN1.pmod/Types.pmod @@ -1,5 +1,5 @@ // -// $Id: Types.pmod,v 1.44 2008/05/02 16:41:57 nilsson Exp $ +// $Id: Types.pmod,v 1.45 2008/06/28 16:37:00 nilsson Exp $ // //! Encodes various asn.1 objects according to the Distinguished @@ -206,7 +206,7 @@ class Compound return this; } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%s %O)", this_program, type_name, elements); } @@ -246,7 +246,7 @@ class String return this; } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%s, %O)", this_program, type_name, value); } @@ -292,7 +292,7 @@ class Boolean return this; } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%s)", this_program, (value?"TRUE":"FALSE")); } @@ -351,7 +351,7 @@ class Integer return this; } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%d %s)", this_program, value->size(), value->digits()); } @@ -433,7 +433,7 @@ class BitString return this; } - static string _sprintf(int t) { + protected string _sprintf(int t) { int size = sizeof(value)*8-unused; return t=='O' && sprintf("%O(%d %0"+size+"s)", this_program, size, ([object(Gmp.mpz)](Gmp.mpz(value, 256) >> unused)) @@ -537,7 +537,7 @@ class Identifier return this; } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%s)", this_program, (array(string))id*"."); } @@ -1252,7 +1252,7 @@ class MetaExplicit return valid_types || types; } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%s %d %O)", this_program, type_name, real_tag, contents); } @@ -1299,3 +1299,4 @@ constant asn1_bmp_string = BMPString; #else constant this_program_does_not_exist=1; #endif /* Gmp.mpz */ + diff --git a/lib/modules/Standards.pmod/EXIF.pmod b/lib/modules/Standards.pmod/EXIF.pmod index 573ae334e5be1db5ef0acd986bd996f6f0e7c7f4..263ced9c4543fee7c9797f59ef747268dc02a379 100644 --- a/lib/modules/Standards.pmod/EXIF.pmod +++ b/lib/modules/Standards.pmod/EXIF.pmod @@ -3,7 +3,7 @@ //! This module implements EXIF (Exchangeable image file format for //! Digital Still Cameras) 2.2 parsing. -// $Id: EXIF.pmod,v 1.28 2008/01/13 17:04:00 nilsson Exp $ +// $Id: EXIF.pmod,v 1.29 2008/06/28 16:36:59 nilsson Exp $ // Johan Sch�n <js@roxen.com>, July 2001. // Based on Exiftool by Robert F. Tobler <rft@cg.tuwien.ac.at>. // @@ -13,7 +13,7 @@ // http://www.dalibor.cz/minolta/ -static void add_field(mapping m, string field, +protected void add_field(mapping m, string field, mapping|array alts, array(int) from, int index) { @@ -50,7 +50,7 @@ string components_config(string data) } #define SIZETEST(X) if(sizeof(data)<(X)+1) return res -static mapping canon_multi0(array(int) data) +protected mapping canon_multi0(array(int) data) { mapping res=([]); @@ -180,7 +180,7 @@ static mapping canon_multi0(array(int) data) return res; } -static mapping canon_multi1(array(int) data) { +protected mapping canon_multi1(array(int) data) { mapping res = ([]); SIZETEST(1); @@ -188,7 +188,7 @@ static mapping canon_multi1(array(int) data) { return res; } -static mapping canon_multi3(array(int) data) +protected mapping canon_multi3(array(int) data) { mapping res=([]); @@ -247,7 +247,7 @@ static mapping canon_multi3(array(int) data) return res; } -static mapping canon_multi4(array(int) data) { +protected mapping canon_multi4(array(int) data) { mapping res = ([]); add_field(res, "CanonStichDirection", ({ "Left to right", "Right to left", "Bottom to top", "Top to bottom" }), @@ -255,7 +255,7 @@ static mapping canon_multi4(array(int) data) { return res; } -static mapping CANON_D30_MAKERNOTE = ([ +protected mapping CANON_D30_MAKERNOTE = ([ 0x0001: ({"MN_Multi0", "CUSTOM", canon_multi0 }), 0x0002: ({"MN_Multi1", "CUSTOM", canon_multi1 }), 0x0004: ({"MN_Multi3", "CUSTOM", canon_multi3 }), @@ -268,7 +268,7 @@ static mapping CANON_D30_MAKERNOTE = ([ // 0x000F: ({"MN_CustomFunctions", "CUSTOM", canon_custom }), ]); -static mapping NIKON_D_MAKERNOTE = ([ +protected mapping NIKON_D_MAKERNOTE = ([ 0x0001: ({ "MN_FirmwareVersion" }), 0x0002: ({ "MN_ISO" }), 0x0004: ({ "MN_Quality" }), @@ -303,7 +303,7 @@ static mapping NIKON_D_MAKERNOTE = ([ 0x0e01: ({ "MN_CaptureEditorData" }), ]); -static mapping|string nikon_D70_makernote(string data, mapping real_tags) { +protected mapping|string nikon_D70_makernote(string data, mapping real_tags) { object f = Stdio.FakeFile(data); if(f->read(10)!="Nikon\0\2\20\0\0") return data; string order = f->read(2); @@ -337,7 +337,7 @@ static mapping|string nikon_D70_makernote(string data, mapping real_tags) { return UNDEFINED; } -static mapping nikon_iso(array(int) data) { +protected mapping nikon_iso(array(int) data) { mapping res=([]); SIZETEST(1); @@ -346,7 +346,7 @@ static mapping nikon_iso(array(int) data) { } // NIKON 990, D1 (more?) -static mapping NIKON_990_MAKERNOTE = ([ +protected mapping NIKON_990_MAKERNOTE = ([ 0x0001: ({"MN_0x0001", }), 0x0002: ({"MN_ISOSetting", "CUSTOM", nikon_iso }), 0x0003: ({"MN_ColorMode", }), @@ -380,7 +380,7 @@ static mapping NIKON_990_MAKERNOTE = ([ 0x0010: ({"MN_DataDump", }), ]); -static mapping sanyo_specialmode(array(int) data) { +protected mapping sanyo_specialmode(array(int) data) { mapping res = ([]); add_field(res, "SanyoSpecialMode", @@ -400,7 +400,7 @@ static mapping sanyo_specialmode(array(int) data) { return res; } -static mapping sanyo_jpegquality(array(int) data) { +protected mapping sanyo_jpegquality(array(int) data) { mapping res=([]); int r = data[0]&0xff; @@ -414,7 +414,7 @@ static mapping sanyo_jpegquality(array(int) data) { return res; } -static mapping SANYO_MAKERNOTE = ([ +protected mapping SANYO_MAKERNOTE = ([ 0x00ff: ({"MN_StartOffset", }), 0x0100: ({"MN_JPEGThumbnail", }), 0x0200: ({"MN_SpecialMode", "CUSTOM", sanyo_specialmode }), @@ -468,7 +468,7 @@ static mapping SANYO_MAKERNOTE = ([ 0x0f00: ({"MN_DataDump", }), ]); -static mapping OLYMPUS_MAKERNOTE = ([ +protected mapping OLYMPUS_MAKERNOTE = ([ 0x0100: ({"MN_JPEGThumbnail" }), 0x0200: ({"MN_SpecialMode", "CUSTOM", sanyo_specialmode }), 0x0201: ({"MN_JPEGQuality", "MAP", @@ -484,7 +484,7 @@ static mapping OLYMPUS_MAKERNOTE = ([ ]); // Nikon E700/E800/E900/E900S/E910/E950 -static mapping NIKON_MAKERNOTE = ([ +protected mapping NIKON_MAKERNOTE = ([ 0x0002: ({"MN_0x0002", }), 0x0003: ({"MN_Quality", "MAP", ([ 1:"VGA Basic", @@ -520,7 +520,7 @@ static mapping NIKON_MAKERNOTE = ([ 0x0f00: ({"MN_0x0f00", }), ]); -static mapping CASIO_MAKERNOTE = ([ +protected mapping CASIO_MAKERNOTE = ([ 0x0001: ({"MN_RecordingMode", "MAP", ([ 1:"Single Shutter", 2:"Panorama", @@ -581,7 +581,7 @@ static mapping CASIO_MAKERNOTE = ([ 100:"High", ]) }), ]); -static mapping FUJIFILM_MAKERNOTE = ([ +protected mapping FUJIFILM_MAKERNOTE = ([ 0x0000: ({"MN_Version", }), 0x1000: ({"MN_Quality", }), 0x1001: ({"MN_Sharpness", "MAP", @@ -631,7 +631,7 @@ static mapping FUJIFILM_MAKERNOTE = ([ 0x1302: ({"MN_AEWarning", "MAP", ([ 0:"No", 1:"Yes" ]) }), ]); -static mapping GPS_TAGS = ([ +protected mapping GPS_TAGS = ([ 0x0000: ({"GPSVersionID"}), 0x0001: ({"GPSLatitudeRef"}), 0x0002: ({"GPSLatitude"}), @@ -661,7 +661,7 @@ static mapping GPS_TAGS = ([ 0x001A: ({"GPSDestDistance"}), ]); -static mapping TAG_INFO = ([ +protected mapping TAG_INFO = ([ 0x0001: ({"InteroperabilityIndex", }), 0x0002: ({"InteroperabilityVersion", }), 0x00fe: ({"NewSubFileType", }), @@ -894,7 +894,7 @@ static mapping TAG_INFO = ([ 0xa420: ({"ImageUniqueID", "ASCII" }), ]); -static mapping TAG_TYPE_INFO = +protected mapping TAG_TYPE_INFO = ([1: ({"BYTE", 1}), 2: ({"ASCII", 1}), 3: ({"SHORT", 2}), @@ -909,7 +909,7 @@ static mapping TAG_TYPE_INFO = 12: ({"DOUBLE", 8}), ]); -static int short_value(string str, string order) +protected int short_value(string str, string order) { if(order=="MM") return (str[0]<<8)|str[1]; @@ -917,7 +917,7 @@ static int short_value(string str, string order) return (str[1]<<8)|str[0]; } -static int long_value(string str, string order) +protected int long_value(string str, string order) { if(order=="MM") return (str[0]<<24)|(str[1]<<16)|(str[2]<<8)|str[3]; @@ -925,17 +925,17 @@ static int long_value(string str, string order) return (str[3]<<24)|(str[2]<<16)|(str[1]<<8)|str[0]; } -static void exif_seek(Stdio.File file, int offset, int exif_offset) +protected void exif_seek(Stdio.File file, int offset, int exif_offset) { file->seek(offset+exif_offset); } -static string format_bytes(string str) +protected string format_bytes(string str) { return str; } -static mapping parse_tag(Stdio.File file, mapping tags, mapping exif_info, +protected mapping parse_tag(Stdio.File file, mapping tags, mapping exif_info, int exif_offset, string order) { int tag_id=short_value(file->read(2), order); diff --git a/lib/modules/Standards.pmod/FIPS10_4.pmod b/lib/modules/Standards.pmod/FIPS10_4.pmod index c7bb0409d35d8e4c5d742931b35584000de4dcdc..b4145c5538d22a515551e3a10265e2b45ba6c456 100644 --- a/lib/modules/Standards.pmod/FIPS10_4.pmod +++ b/lib/modules/Standards.pmod/FIPS10_4.pmod @@ -18,14 +18,14 @@ // = american standard for countries and country division codes // Updated 2001-04-17 from ...bugger, lost url -// $Id: FIPS10_4.pmod,v 1.3 2005/02/16 16:47:37 grubba Exp $ +// $Id: FIPS10_4.pmod,v 1.4 2008/06/28 16:36:59 nilsson Exp $ #pike __REAL_VERSION__ -static mapping(string:string) _region_code_to_name=0; -static mapping(string:string) _region_name_to_code=0; +protected mapping(string:string) _region_code_to_name=0; +protected mapping(string:string) _region_name_to_code=0; -static void mkregionmappings() +protected void mkregionmappings() { array a=column(regions,0); array b=column(regions,1); @@ -33,10 +33,10 @@ static void mkregionmappings() _region_name_to_code=mkmapping(b,a); } -static mapping(string:array(string)) _division_code_to_line=0; -static mapping(string:array(string)) _division_name_to_line=0; +protected mapping(string:array(string)) _division_code_to_line=0; +protected mapping(string:array(string)) _division_name_to_line=0; -static void mkdivisionmappings() +protected void mkdivisionmappings() { array a=column(divisions,1); array b=column(divisions,2); @@ -44,9 +44,9 @@ static void mkdivisionmappings() _division_name_to_line=mkmapping(b,divisions); } -static mapping(string:array(array(string))) _region_to_divisions=0; +protected mapping(string:array(array(string))) _region_to_divisions=0; -static void mkregiondivisionmapping() +protected void mkregiondivisionmapping() { mapping res=([]); foreach (divisions,array(string) v) @@ -102,7 +102,7 @@ string division_name_to_code(string code) // guessing to multiple lines is better // -static mapping(string:array(array(string))) guess_to_lines=0; +protected mapping(string:array(array(string))) guess_to_lines=0; array(array(string)) division_guess_to_lines(string name) { @@ -156,7 +156,7 @@ array(string) region_to_division_codes(string region) // ---------------------------------------------------------------- -static array(array(string)) regions = ({ +protected array(array(string)) regions = ({ ({"AA","ARUBA"}), ({"AC","ANTIGUA AND BARBUDA"}), ({"AE","UNITED ARAB EMIRATES"}), @@ -408,7 +408,7 @@ static array(array(string)) regions = ({ ({"ZI","ZIMBABWE"}), }); -static array(array(string)) divisions = ({ +protected array(array(string)) divisions = ({ ({"AC","AC01","Barbuda","parish",}), ({"AC","AC03","Saint George","parish",}), ({"AC","AC04","Saint John","parish",}), @@ -4423,3 +4423,4 @@ static array(array(string)) divisions = ({ ({"ZI","ZI08","Masvingo","province",}), }); + diff --git a/lib/modules/Standards.pmod/ID3.pmod b/lib/modules/Standards.pmod/ID3.pmod index 683a522738ce61a348e600fbd07a9d3501be1089..3c29df25eccbcaf63a6768ca18e0ff677252de8c 100644 --- a/lib/modules/Standards.pmod/ID3.pmod +++ b/lib/modules/Standards.pmod/ID3.pmod @@ -1,6 +1,6 @@ // ID3.pmod // -// $Id: ID3.pmod,v 1.23 2008/01/13 17:04:09 nilsson Exp $ +// $Id: ID3.pmod,v 1.24 2008/06/28 16:36:59 nilsson Exp $ // #pike __REAL_VERSION__ @@ -33,8 +33,8 @@ //! limit capability. class Buffer(Stdio.File buffer) { - static string peek_data; - static int limit=-1; + protected string peek_data; + protected int limit=-1; //! Read @[bytes] bytes from the buffer. Throw an exception //! if @[bytes] is bigger than the number of bytes left in the @@ -143,7 +143,7 @@ class TagHeader { tag_size = synchsafe_to_int( bytes[3..] ); } - static void decode_flags( int byte ) { + protected void decode_flags( int byte ) { if(byte&0b1111) error( "Unknown flag set in tag header flag field. (%08b)\n", byte ); @@ -153,7 +153,7 @@ class TagHeader { flag_footer = TEST(byte,4); } - static int encode_flags() { + protected int encode_flags() { return flag_unsynchronisation<<7 + flag_extended_header<<6 + flag_experimental<<5 + flag_footer<<4; } @@ -195,19 +195,19 @@ class ExtendedHeader { if(buffer) decode(buffer); } - static void decode_flags(string bytes) { + protected void decode_flags(string bytes) { int flags = bytes[0]; flag_is_update = TEST(flags,6); flag_crc = TEST(flags,5); flag_restrictions = TEST(flags,4); } - static string encode_flags() { + protected string encode_flags() { return sprintf("%c", flag_is_update<<6 + flag_crc<<5 + flag_restrictions<<4); } - static string decode_restrictions(int data) { + protected string decode_restrictions(int data) { restr_size = (data & 0b11000000) >> 6; restr_encoding = TEST(data, 5); restr_field_size = (data & 0b00011000) >> 3; @@ -215,7 +215,7 @@ class ExtendedHeader { restr_img_size = data & 0b00000011; } - static string encode_restrictions() { + protected string encode_restrictions() { return sprintf("%c", restr_size<<6 + restr_encoding<<5 + restr_field_size<<3 + restr_img_enc<<2 + restr_img_size); @@ -504,7 +504,7 @@ class Frame { sprintf("%c%c", @encode_flags()) + block; } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%s)", this_program, id); } } @@ -669,7 +669,7 @@ class Frame_UFID { return system + "\0" + id; } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%O/%O)", this_program, system, id); } } @@ -677,7 +677,7 @@ class Frame_UFID { class Frame_TextPlain { inherit FrameData; - static array(string) texts; + protected array(string) texts; void decode(string data) { int encoding; @@ -721,7 +721,7 @@ class Frame_TextPlain { return sizeof(texts*""); } - static string _sprintf(int t) { + protected string _sprintf(int t) { if( t!='O' || !sizeof(texts)) return UNDEFINED; if(sizeof(texts)==1) return sprintf("%O(%O)", this_program, texts[0]); return sprintf("%O(%O)", this_program, texts); @@ -742,7 +742,7 @@ class Frame_TKEY { return 0; } - static void verify_keys() { + protected void verify_keys() { foreach(texts, string key) if(!verify_key(key)) error("Malformed key %O\n", key); @@ -836,7 +836,7 @@ class Frame_TRCK { return (track ? (string)track : "") + (tracks ? "/"+tracks : ""); } - static string _sprintf(int t) { + protected string _sprintf(int t) { if( t!='O' ) return UNDEFINED; if(tracks) return sprintf("%O(%O/%O)", this_program, track,tracks); return sprintf("%O(%O)", this_program, track); @@ -857,7 +857,7 @@ class Frame_TPOS { return low_encode(part, parts); } - static string _sprintf(int t) { + protected string _sprintf(int t) { if( t!='O' ) return UNDEFINED; if(parts) return sprintf("%O(%O/%O)", this_program, part,parts); return sprintf("%O(%O)", this_program, part); @@ -920,7 +920,7 @@ class Frame_TextInteger { return sizeof(encode()); } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%O)", this_program, value); } } @@ -947,7 +947,7 @@ class Frame_TXXX { return sprintf("%c", ret[0]) + ret[1..]*terminator[ret[0]]; } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%O:%O)", this_program,descr,value); } } @@ -965,7 +965,7 @@ class Frame_Link { return url; } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%O)", this_program,url); } } @@ -994,7 +994,7 @@ class Frame_WXXX { return sprintf("%c%s%s", ret[0], ret[1], url); } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%O:%O)", this_program,descr,url); } } @@ -1024,7 +1024,7 @@ class Frame_Dummy { return ""; } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%O)", this_program,data); } #endif @@ -1058,7 +1058,7 @@ class Frame_COMM { return sprintf("%c", ret[0]) + lang + ret[1..]*terminator[ret[0]]; } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%O,%O:%O)", this_program,lang,short,text); } } @@ -1085,7 +1085,7 @@ class Frame_APIC { return sprintf("%c%s\0%c%s%s", ret[0],mime,type,ret[1],img); } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%O,%O,%O)", this_program,mime,descr,type); } } @@ -1106,7 +1106,7 @@ class Frame_POPM { return sprintf("%s\0%c%s", email, rating, Gmp.mpz(count)->digits(256)); } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%O,%O,%O)", this_program,email,rating,count); } } @@ -1133,7 +1133,7 @@ class Frame_GEOB { // FIXME } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%O,%O,%O)", this_program,mime,filename,descr); } } @@ -1152,7 +1152,7 @@ class Frame_PRIV { return owner + "\0" + data; } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%O,%O)", this_program,owner,data); } } @@ -1169,7 +1169,7 @@ class Tagv1 { "sub_version": 0 ]); - static class Parser { + protected class Parser { inherit ADT.Struct; Item head = Chars(3); Item title = Chars(30); @@ -1229,8 +1229,8 @@ class Framev1 { } class FrameDatav1 { - static string frame_data; - static string id; + protected string frame_data; + protected string id; void create(string buffer, string name) { frame_data = buffer; @@ -1259,13 +1259,13 @@ class FrameDatav1 { //! @[Tagv2], @[Tagv1] class Tag { - static Tagv2|Tagv1 tag; + protected Tagv2|Tagv1 tag; //! The file object @[fd] is searched for version 2 tags, and if //! not found, version 1 tags. //! @throws //! If no tag was found in the file an error is thrown. - static void create(Stdio.File fd) { + protected void create(Stdio.File fd) { catch(tag = Tagv2(Buffer(fd))); if(tag) @@ -1279,8 +1279,8 @@ class Tag { //! The index operators are overloaded to index the encapsulated //! Tagv1 or Tagv2 object. - static mixed `[](string index) { return `->(index); } - static mixed `->(string index) { + protected mixed `[](string index) { return `->(index); } + protected mixed `->(string index) { if(index == "version") return ""+tag->header->major_version+"."+tag->header->minor_version+ @@ -1296,12 +1296,12 @@ class Tag { //! The version of the encapsulated tag in the form @expr{"%d.%d.%d"@}. //! Indices will return the indices of the tag object. - static array _indices() { + protected array _indices() { return indices(tag); } //! Values will return the values of the tag object. - static array _values() { + protected array _values() { return values(tag); } @@ -1366,7 +1366,7 @@ class Tag { return rv; } - static string _sprintf(int t, mapping args) { + protected string _sprintf(int t, mapping args) { return t=='O' && sprintf("Tag(%O)", tag); } diff --git a/lib/modules/Standards.pmod/IDNA.pmod b/lib/modules/Standards.pmod/IDNA.pmod index 9e93cf1094ba568b9ebd33936efc72ec69f28f32..29990d65637ef13ce3a4268471e9dabbaa753527 100644 --- a/lib/modules/Standards.pmod/IDNA.pmod +++ b/lib/modules/Standards.pmod/IDNA.pmod @@ -19,7 +19,7 @@ object Punycode = class { return ::decode(x*"-"); } - static void create() { ::create(36, 1, 26, 38, 700, 72, 128, '-', + protected void create() { ::create(36, 1, 26, 38, 700, 72, 128, '-', "abcdefghijklmnopqrstuvwxyz0123456789"); } }(); @@ -27,7 +27,7 @@ object Punycode = class { // stringprep tables... // Table B.2: Case folding for use with NFKC -static constant stringprep_casefold_src = +protected constant stringprep_casefold_src = // 1 to 1 "\x0041\x0042\x0043\x0044\x0045\x0046\x0047\x0048\x0049\x004A\x004B\x004C" "\x004D\x004E\x004F\x0050\x0051\x0052\x0053\x0054\x0055\x0056\x0057\x0058" @@ -158,7 +158,7 @@ static constant stringprep_casefold_src = // 1 to 4 "\x33C6"/1; -static constant stringprep_casefold_dest = +protected constant stringprep_casefold_dest = // 1 to 1 "\x0061\x0062\x0063\x0064\x0065\x0066\x0067\x0068\x0069\x006A\x006B\x006C" "\x006D\x006E\x006F\x0070\x0071\x0072\x0073\x0074\x0075\x0076\x0077\x0078" diff --git a/lib/modules/Standards.pmod/IIM.pmod b/lib/modules/Standards.pmod/IIM.pmod index d155edbfcd335b35237a972874843e13cc2ebcce..78e4a1b5784a157f7787b39cc12f76186b7f26ba 100644 --- a/lib/modules/Standards.pmod/IIM.pmod +++ b/lib/modules/Standards.pmod/IIM.pmod @@ -3,7 +3,7 @@ // // http://www.iptc.org/IIM/ // -// $Id: IIM.pmod,v 1.7 2007/03/01 14:49:53 grubba Exp $ +// $Id: IIM.pmod,v 1.8 2008/06/28 16:36:59 nilsson Exp $ // // Anders Johansson & Henrik Grubbstr�m @@ -113,13 +113,13 @@ mapping(int:multiset(int)) binary_fields = ([ 2: (<0>), ]); -static int short_value(string str) +protected int short_value(string str) { return (str[0]<<8)|str[1]; //return (str[1]<<8)|str[0]; } -static mapping(string:string|array(string)) decode_photoshop_data(string data) +protected mapping(string:string|array(string)) decode_photoshop_data(string data) { mapping(string:string|array(string)) res = ([]); @@ -369,3 +369,4 @@ mapping get_information(Stdio.File fd) return res; } + diff --git a/lib/modules/Standards.pmod/ISO639_2.pmod b/lib/modules/Standards.pmod/ISO639_2.pmod index f8a6d2acb8edb9802d67cb029bb1c03407644fe2..b84b92a05ac91c9706afb1e54229f71b315b41d4 100644 --- a/lib/modules/Standards.pmod/ISO639_2.pmod +++ b/lib/modules/Standards.pmod/ISO639_2.pmod @@ -5,7 +5,7 @@ #pike __REAL_VERSION__ // Mapping from ISO 639-2/T code to language name. -static constant languages = ([ +protected constant languages = ([ "aar":"Afar", "abk":"Abkhazian", "ace":"Achinese", @@ -490,7 +490,7 @@ static constant languages = ([ ]); // Mapping from ISO 639-2/B to ISO 639-2/T -static constant b_to_t = ([ +protected constant b_to_t = ([ "alb":"sqi", "arm":"hye", "baq":"eus", @@ -573,7 +573,7 @@ string convert_t_to_b(string code) { } // Mapping from ISO 639-1 code to ISO 639-2/T code. -static constant conversion = ([ +protected constant conversion = ([ "aa":"aar", "ab":"abk", "ae":"ave", diff --git a/lib/modules/Standards.pmod/URI.pike b/lib/modules/Standards.pmod/URI.pike index 1c5959615df766d5a921b9d72ae4cda113bd33f7..0bcc879ea6ccc7d95b4aab4701271f91df960ea0 100644 --- a/lib/modules/Standards.pmod/URI.pike +++ b/lib/modules/Standards.pmod/URI.pike @@ -4,7 +4,7 @@ //! absolute form, as defined in RFC 2396 and RFC 3986. // Implemented by Johan Sundstr�m and Johan Sch�n. -// $Id: URI.pike,v 1.27 2008/01/05 14:28:05 grubba Exp $ +// $Id: URI.pike,v 1.28 2008/06/28 16:36:59 nilsson Exp $ #pragma strict_types @@ -49,7 +49,7 @@ string raw_uri; // Parse authority component (according to RFC 1738, � 3.1) // Updated to RFC 3986 $ 3.2. -static void parse_authority() +protected void parse_authority() { // authority = [ userinfo "@" ] host [ ":" port ] if(sscanf(authority, "%[^@]@%s", string userinfo, authority) == 2) @@ -72,7 +72,7 @@ static void parse_authority() } // Inherit all properties except raw_uri and base_uri from the URI uri. :-) -static void inherit_properties(this_program uri) +protected void inherit_properties(this_program uri) { authority = uri->authority; scheme = uri->scheme; @@ -446,17 +446,17 @@ void add_query_variables(mapping(string:string) vars) { // HTTP stuff // RFC 1738, 2.2. URL Character Encoding Issues -static constant url_non_corresponding = enumerate(0x21) + +protected constant url_non_corresponding = enumerate(0x21) + enumerate(0x81,1,0x7f); -static constant url_unsafe = ({ '<', '>', '"', '#', '%', '{', '}', +protected constant url_unsafe = ({ '<', '>', '"', '#', '%', '{', '}', '|', '\\', '^', '~', '[', ']', '`' }); -static constant url_reserved = ({ ';', '/', '?', ':', '@', '=', '&' }); +protected constant url_reserved = ({ ';', '/', '?', ':', '@', '=', '&' }); // Encode these chars -static constant url_chars = url_non_corresponding + url_unsafe + +protected constant url_chars = url_non_corresponding + url_unsafe + url_reserved + ({ '+', '\'' }); -static constant url_from = sprintf("%c", url_chars[*]); -static constant url_to = sprintf("%%%02x", url_chars[*]); +protected constant url_from = sprintf("%c", url_chars[*]); +protected constant url_to = sprintf("%%%02x", url_chars[*]); string http_encode(string in) { @@ -542,3 +542,4 @@ string quote(string s) "%20", "%25", "%27", "%22"})); } + diff --git a/lib/modules/Standards.pmod/UUID.pmod b/lib/modules/Standards.pmod/UUID.pmod index 6f25b411ea71d620a7ae6467cd4143a2fa56b482..d5ee0f5df8e82f5968e35a9ad08c115a506c6894 100644 --- a/lib/modules/Standards.pmod/UUID.pmod +++ b/lib/modules/Standards.pmod/UUID.pmod @@ -11,7 +11,7 @@ //! identifier components //! -// $Id: UUID.pmod,v 1.16 2008/01/04 11:48:24 grubba Exp $ +// $Id: UUID.pmod,v 1.17 2008/06/28 16:36:59 nilsson Exp $ // // 2004-10-01 Henrik Grubbstr�m // 2004-10-04 Martin Nilsson @@ -242,7 +242,7 @@ class UUID { // Internal clock sequence class. Only works for variant 4, but all others are // reserved, so it shouldn't be a problem in practice. -static class ClkSeq +protected class ClkSeq { int clk_seq = random(1<<14); int last_time; @@ -276,7 +276,7 @@ static class ClkSeq } } -static ClkSeq clk_seq = ClkSeq(); +protected ClkSeq clk_seq = ClkSeq(); //! Returns the internal clock state. Can be used for persistent //! storage when an application is terminated. @@ -497,3 +497,4 @@ UUID make_x500(string name) { } #endif + diff --git a/lib/modules/Standards.pmod/XML.pmod/Wix.pmod b/lib/modules/Standards.pmod/XML.pmod/Wix.pmod index fa9ae4f0b924e572785687085c241c71f98f953a..46d7400106d0f0871827ef1f5e008f9e0acce216 100644 --- a/lib/modules/Standards.pmod/XML.pmod/Wix.pmod +++ b/lib/modules/Standards.pmod/XML.pmod/Wix.pmod @@ -1,6 +1,6 @@ #pike __REAL_VERSION__ -// $Id: Wix.pmod,v 1.26 2008/06/28 00:35:10 mast Exp $ +// $Id: Wix.pmod,v 1.27 2008/06/28 16:37:00 nilsson Exp $ // // 2004-11-01 Henrik Grubbstr�m @@ -27,7 +27,7 @@ class WixNode { inherit Parser.XML.Tree.SimpleElementNode; - static void create(string name, mapping(string:string) attrs, + protected void create(string name, mapping(string:string) attrs, string|void text) { ::create(wix_ns + name, attrs); @@ -44,7 +44,7 @@ class UninstallFile string id; string name; - static void create(string name, string id) + protected void create(string name, string id) { UninstallFile::name = name; UninstallFile::id = id; @@ -70,7 +70,7 @@ class RegistryEntry string value; string id; - static void create(string root, string key, string name, string value, + protected void create(string root, string key, string name, string value, string id) { RegistryEntry::root = root; @@ -101,7 +101,7 @@ class Merge string id; string language; - static void create(string source, string id, void|string language) + protected void create(string source, string id, void|string language) { Merge::source = source; Merge::id = id; @@ -134,7 +134,7 @@ class Directory mapping(string:RegistryEntry) other_entries = ([]); mapping(string:Directory|Merge) sub_dirs = ([]); - static void create(string name, string parent_guid, + protected void create(string name, string parent_guid, string|void id, string|void short_name) { guid = MK_UUID(name, parent_guid); @@ -199,7 +199,7 @@ class Directory string source; string id; - static void create(string name, string source, string id) + protected void create(string name, string source, string id) { File::name = name; File::source = source; @@ -239,7 +239,7 @@ class Directory string target; string arguments; - static void create(string name, string directory, string id, + protected void create(string name, string directory, string id, string|void target, string|void arguments, string|void working_dir, string|void show) { @@ -280,7 +280,7 @@ class Directory string name; mapping(string:mapping(string:string)) contents; - static void create(string name, string id, + protected void create(string name, string id, mapping(string:mapping(string:string)) contents) { IniFile::id = id; @@ -566,3 +566,4 @@ Parser.XML.Tree.SimpleRootNode get_xml_node() } #endif /* 0 */ + diff --git a/lib/modules/Stdio.pmod/FakeFile.pike b/lib/modules/Stdio.pmod/FakeFile.pike index 789f21bed64ecd917bf7ba4aa6d54a98e71554ef..1e68399058d304c172de1d8e6757bc5825b93721 100644 --- a/lib/modules/Stdio.pmod/FakeFile.pike +++ b/lib/modules/Stdio.pmod/FakeFile.pike @@ -1,4 +1,4 @@ -// $Id: FakeFile.pike,v 1.15 2004/12/28 13:43:07 agehall Exp $ +// $Id: FakeFile.pike,v 1.16 2008/06/28 16:37:00 nilsson Exp $ #pike __REAL_VERSION__ //! A string wrapper that pretends to be a @[Stdio.File] object. @@ -8,17 +8,17 @@ //! from a real @[Stdio.File] object. constant is_fake_file = 1; -static string data; -static int ptr; -static int(0..1) r; -static int(0..1) w; -static int mtime; +protected string data; +protected int ptr; +protected int(0..1) r; +protected int(0..1) w; +protected int mtime; -static function read_cb; -static function read_oob_cb; -static function write_cb; -static function write_oob_cb; -static function close_cb; +protected function read_cb; +protected function read_oob_cb; +protected function write_cb; +protected function write_oob_cb; +protected function close_cb; //! @seealso //! @[Stdio.File()->close()] @@ -58,7 +58,7 @@ void create(string _data, void|string type, int|void _ptr) { r = w = 1; } -static string make_type_str() { +protected string make_type_str() { string type = ""; if(r) type += "r"; if(w) type += "w"; @@ -93,7 +93,7 @@ String.SplitIterator line_iterator(int|void trim) { return String.SplitIterator( data, '\n' ); } -static mixed id; +protected mixed id; //! @seealso //! @[Stdio.File()->query_id()] diff --git a/lib/modules/Stdio.pmod/Readline.pike b/lib/modules/Stdio.pmod/Readline.pike index b06d716c942de21c4a04c8426814af12f6ae0300..0008ac4ea8a5f4ca2c340d6a611ac200fb37fc6b 100644 --- a/lib/modules/Stdio.pmod/Readline.pike +++ b/lib/modules/Stdio.pmod/Readline.pike @@ -1,4 +1,4 @@ -// $Id: Readline.pike,v 1.59 2006/11/04 19:06:50 nilsson Exp $ +// $Id: Readline.pike,v 1.60 2008/06/28 16:37:00 nilsson Exp $ #pike __REAL_VERSION__ //! @@ -6,10 +6,10 @@ //! Ought to have support for charset conversion. class OutputController { - static private .File outfd; - static private .Terminfo.Termcap term; - static private int xpos = 0, columns = 0; - static private mapping oldattrs = 0; + protected private .File outfd; + protected private .Terminfo.Termcap term; + protected private int xpos = 0, columns = 0; + protected private mapping oldattrs = 0; #define BLINK 1 #define BOLD 2 @@ -19,10 +19,10 @@ class OutputController #define STANDOUT 32 #define UNDERLINE 64 - static private int selected_attributes = 0, needed_attributes = 0; - static private int active_attributes = 0; + protected private int selected_attributes = 0, needed_attributes = 0; + protected private int active_attributes = 0; - static int low_attribute_mask(array(string) atts) + protected int low_attribute_mask(array(string) atts) { return `|(@rows(([ "blink":BLINK, @@ -35,7 +35,7 @@ class OutputController ]), atts)); } - static void low_set_attributes(int mask, int val, int|void temp) + protected void low_set_attributes(int mask, int val, int|void temp) { int remv = mask & selected_attributes & ~val; string s = ""; @@ -66,12 +66,12 @@ class OutputController needed_attributes |= add; } - static void low_disable_attributes() + protected void low_disable_attributes() { low_set_attributes(active_attributes, 0, 1); } - static void low_enable_attributes() + protected void low_enable_attributes() { int i, add = needed_attributes; string s = ""; @@ -125,7 +125,7 @@ class OutputController "OFILL":1,"OFDEL":0,"ONLRET":0,"ONOCR":0]));}; } - static void destroy() + protected void destroy() { disable(); } @@ -159,7 +159,7 @@ class OutputController return columns; } - static string escapify(string s, void|int hide) + protected string escapify(string s, void|int hide) { #if 1 s=replace(s, @@ -200,12 +200,12 @@ class OutputController } - static int width(string s) + protected int width(string s) { return sizeof(s); } - static int escapified_width(string s) + protected int escapified_width(string s) { return width(escapify(s)); } @@ -431,17 +431,17 @@ class OutputController //! Ought to have support for charset conversion. class InputController { - static private object infd, term; - static private int enabled = -1; - static private function(:int) close_callback = 0; - static private string prefix=""; - static private mapping(int:function|mapping(string:function)) bindings=([]); - static private function grab_binding = 0; - static private mapping oldattrs = 0; + protected private object infd, term; + protected private int enabled = -1; + protected private function(:int) close_callback = 0; + protected private string prefix=""; + protected private mapping(int:function|mapping(string:function)) bindings=([]); + protected private function grab_binding = 0; + protected private mapping oldattrs = 0; int dumb=0; - static void destroy() + protected void destroy() { catch{ infd->set_blocking(); }; if(dumb) @@ -451,7 +451,7 @@ class InputController "VEOL":0,"VLNEXT":0])&oldattrs); }; } - static private string process_input(string s) + protected private string process_input(string s) { int i; @@ -488,7 +488,7 @@ class InputController return ""; } - static private void read_cb(mixed _, string s) + protected private void read_cb(mixed _, string s) { if (!s || s=="") return; @@ -500,14 +500,14 @@ class InputController prefix = process_input(s); } - static private void close_cb() + protected private void close_cb() { if (close_callback && close_callback()) return; destruct(this); } - static private int set_enabled(int e) + protected private int set_enabled(int e) { if (e != enabled) { @@ -796,9 +796,9 @@ class InputController //! class DefaultEditKeys { - static private multiset word_break_chars = + protected private multiset word_break_chars = mkmultiset("\t \n\r/*?_-.[]~&;\!#$%^(){}<>\"'`"/""); - static object _readline; + protected object _readline; //! void self_insert_command(string str) @@ -890,7 +890,7 @@ class DefaultEditKeys _readline->insert(reverse(c), p-1); } - static array find_word_to_manipulate() + protected array find_word_to_manipulate() { int p = _readline->getcursorpos(); int ep; @@ -930,7 +930,7 @@ class DefaultEditKeys _readline->insert(lower_case(word), pos); } - static int forward_find_word() + protected int forward_find_word() { int p, n; string line = _readline->gettext(); @@ -942,7 +942,7 @@ class DefaultEditKeys return p; } - static int backward_find_word() + protected int backward_find_word() { int p = _readline->getcursorpos()-1; string line = _readline->gettext(); @@ -1043,7 +1043,7 @@ class DefaultEditKeys _readline->redisplay(1); } - static array(array(string|function)) default_bindings = ({ + protected array(array(string|function)) default_bindings = ({ ({ "^[[A", up_history }), ({ "^[[B", down_history }), ({ "^[[C", forward_char }), @@ -1120,7 +1120,7 @@ class DefaultEditKeys }); //! - static void set_default_bindings() + protected void set_default_bindings() { object ic = _readline->get_input_controller(); ic->nullbindings(); @@ -1150,9 +1150,9 @@ class DefaultEditKeys //! class History { - static private array(string) historylist; - static private mapping(int:string) historykeep=([]); - static private int minhistory, maxhistory, historynum; + protected private array(string) historylist; + protected private mapping(int:string) historykeep=([]); + protected private int minhistory, maxhistory, historynum; //! string encode() @@ -1224,19 +1224,19 @@ class History } -static private OutputController output_controller; -static private InputController input_controller; -static private string prompt=""; -static private array(string) prompt_attrs=0; -static private string text="", readtext; -static private function(string:void) newline_func; -static private int cursorpos = 0; -static private int mark = 0; +protected private OutputController output_controller; +protected private InputController input_controller; +protected private string prompt=""; +protected private array(string) prompt_attrs=0; +protected private string text="", readtext; +protected private function(string:void) newline_func; +protected private int cursorpos = 0; +protected private int mark = 0; /*static private */ History historyobj = 0; -static private int hide = 0; +protected private int hide = 0; -static private array(string) kill_ring=({}); -static private int kill_ring_size=30; +protected private array(string) kill_ring=({}); +protected private int kill_ring_size=30; //! get current output control object //! @returns @@ -1489,7 +1489,7 @@ void redisplay(int clear, int|void nobackup) setcursorpos(p); } -static private void initline() +protected private void initline() { text = ""; cursorpos = 0; @@ -1570,7 +1570,7 @@ void list_completions(array(string) c) c*"\n")); } -static private void read_newline(string s) +protected private void read_newline(string s) { input_controller->disable(); readtext = s; @@ -1681,7 +1681,7 @@ History get_history() return historyobj; } -static void destroy() +protected void destroy() { if(input_controller) destruct(input_controller); diff --git a/lib/modules/Stdio.pmod/Terminfo.pmod b/lib/modules/Stdio.pmod/Terminfo.pmod index 553efef4b5b4506e8d799ee6f4c2c08567b2be7d..20d3eef321a046dd2a572a928d54021ff62e5ed2 100644 --- a/lib/modules/Stdio.pmod/Terminfo.pmod +++ b/lib/modules/Stdio.pmod/Terminfo.pmod @@ -1,4 +1,4 @@ -// $Id: Terminfo.pmod,v 1.26 2008/01/04 11:33:18 grubba Exp $ +// $Id: Terminfo.pmod,v 1.27 2008/06/28 16:37:00 nilsson Exp $ #pike __REAL_VERSION__ @@ -14,19 +14,19 @@ MUTEX -static private array ctrlcharsfrom = +protected private array ctrlcharsfrom = map(indices(allocate(32)), lambda(int z) { return sprintf("^%c",z+64); })+ map(indices(allocate(32)), lambda(int z) { return sprintf("^%c",z+96); }); -static private array ctrlcharsto = +protected private array ctrlcharsto = map(indices(allocate(32)), lambda(int z) { return sprintf("%c",z); })+ map(indices(allocate(32)), lambda(int z) { return sprintf("%c",z); }); -static private class TermMachine { +protected private class TermMachine { mapping(string:string|int) map = ([]); @@ -151,7 +151,7 @@ class Termcap { //! array(string) aliases; - static Termcap parent; + protected Termcap parent; //! Put termcap string string tputs(string s) @@ -161,7 +161,7 @@ class Termcap { return s; } - private static multiset(string) load_cap(string en) + private protected multiset(string) load_cap(string en) { string br=":"; int i=search(en,":"); @@ -282,15 +282,15 @@ class Terminfo { //! array(string) aliases; - static private constant boolnames = + protected private constant boolnames = ({ "bw","am","xb","xs","xn","eo","gn","hc","km","hs","in","da","db","mi", "ms","os","es","xt","hz","ul","xo","nx","5i","HC","NR","NP","ND","cc", "ut","hl","YA","YB","YC","YD","YE","YF","YG" }); - static private constant numnames = + protected private constant numnames = ({ "co","it","li","lm","sg","pb","vt","ws","Nl","lh","lw","ma","MW","Co", "pa","NC","Ya","Yb","Yc","Yd","Ye","Yf","Yg","Yh","Yi","Yj","Yk","Yl", "Ym","Yn","BT","Yo","Yp" }); - static private constant strnames = + protected private constant strnames = ({ "bt","bl","cr","cs","ct","cl","ce","cd","ch","CC","cm","do","ho","vi", "le","CM","ve","nd","ll","up","vs","dc","dl","ds","hd","as","mb","md", "ti","dm","mh","im","mk","mp","mr","so","us","ec","ae","me","te","ed", @@ -332,12 +332,12 @@ class Terminfo { return s; } - static private string swab(string s) + protected private string swab(string s) { return predef::map(s/2, reverse)*""; } - static private int load_cap(.File f, int|void bug_compat) + protected private int load_cap(.File f, int|void bug_compat) { int magic, sname, nbool, nnum, nstr, sstr; @@ -412,11 +412,11 @@ class TermcapDB { MUTEX - static private inherit .File; + protected private inherit .File; - static private string buf=""; - static private mapping(string:int|Termcap) cache=([]); - static private int complete_index=0; + protected private string buf=""; + protected private mapping(string:int|Termcap) cache=([]); + protected private int complete_index=0; void create(string|void filename) { @@ -448,13 +448,13 @@ class TermcapDB { } } - static private void rewind(int|void pos) + protected private void rewind(int|void pos) { ::seek(pos); buf=""; } - static private int more_data() + protected private int more_data() { string q; q=::read(8192); @@ -463,14 +463,14 @@ class TermcapDB { return 1; } - static private array(string) get_names(string cap) + protected private array(string) get_names(string cap) { sscanf(cap, "%s:", cap); sscanf(cap, "%s,", cap); return cap/"|"; } - static private string read() + protected private string read() { int i, st; string res=""; @@ -528,7 +528,7 @@ class TermcapDB { return res; } - static private string readat(int pos) + protected private string readat(int pos) { rewind(pos); return read(); @@ -589,7 +589,7 @@ class TermcapDB { Termcap, this))); } - static private string read_next(string find) // quick search + protected private string read_next(string find) // quick search { for (;;) { @@ -667,9 +667,9 @@ class TerminfoDB { MUTEX - static private string dir; - static private mapping(string:Terminfo) cache = ([]); - static private int complete_index=0; + protected private string dir; + protected private mapping(string:Terminfo) cache = ([]); + protected private int complete_index=0; void create(string|void dirname) { @@ -753,9 +753,9 @@ class TerminfoDB { } } -static private Termcap defterm; -static private TermcapDB deftermcap; -static private TerminfoDB defterminfo; +protected private Termcap defterm; +protected private TermcapDB deftermcap; +protected private TerminfoDB defterminfo; TermcapDB defaultTermcapDB() { @@ -834,13 +834,13 @@ Termcap getTerm(string|void term) //! //! @seealso //! Stdio.Terminfo.getTerm -static Termcap getFallbackTerm(string term) +protected Termcap getFallbackTerm(string term) { return (term=="dumb"? Termcap("dumb:\\\n\t:am:co#80:do=^J:") : getTerm("dumb")); } -static int is_tty_cache; +protected int is_tty_cache; int is_tty() //! Returns 1 if @[Stdio.stdin] is connected to an interactive diff --git a/lib/modules/Stdio.pmod/module.pmod b/lib/modules/Stdio.pmod/module.pmod index 2cabbb98872fb9f956c7621b6b737ba6232f631d..dc69de91d54df89c050ab250b81a362cfdb73cb7 100644 --- a/lib/modules/Stdio.pmod/module.pmod +++ b/lib/modules/Stdio.pmod/module.pmod @@ -1,4 +1,4 @@ -// $Id: module.pmod,v 1.237 2008/04/28 15:46:13 grubba Exp $ +// $Id: module.pmod,v 1.238 2008/06/28 16:37:00 nilsson Exp $ #pike __REAL_VERSION__ inherit files; @@ -25,7 +25,7 @@ inherit files; #define register_close_file(id) #endif -static constant LineIterator = __builtin.file_line_iterator; +protected constant LineIterator = __builtin.file_line_iterator; //! The Stdio.Stream API. //! @@ -149,9 +149,9 @@ class File return ::errno(); } - static string|int debug_file; - static string debug_mode; - static int debug_bits; + protected string|int debug_file; + protected string debug_mode; + protected int debug_bits; optional void _setup_debug( string f, string m, int|void b ) { @@ -160,7 +160,7 @@ class File debug_bits = b; } - static string _sprintf( int type, mapping flags ) + protected string _sprintf( int type, mapping flags ) { if(type!='O') return 0; return sprintf("%O(%O, %O, %o /* fd=%d */)", @@ -380,9 +380,9 @@ class File } #endif - static private function(int, mixed ...:void) _async_cb; - static private array(mixed) _async_args; - static private void _async_check_cb(mixed|void ignored) + protected private function(int, mixed ...:void) _async_cb; + protected private array(mixed) _async_args; + protected private void _async_check_cb(mixed|void ignored) { // Copy the args to avoid races. function(int, mixed ...:void) cb = _async_cb; @@ -624,7 +624,7 @@ class File //! //! @seealso //! @[open()], @[connect()], @[Stdio.FILE], - static void create(int|string|void file,void|string mode,void|int bits) + protected void create(int|string|void file,void|string mode,void|int bits) { if (zero_type(file)) { _fd = Fd(); @@ -808,7 +808,7 @@ class File } // FIXME: No way to specify the maximum to read. - static int __stdio_read_callback() + protected int __stdio_read_callback() { BE_WERR("__stdio_read_callback()"); @@ -874,7 +874,7 @@ class File return 0; } - static int __stdio_close_callback() + protected int __stdio_close_callback() { BE_WERR ("__stdio_close_callback()"); #if 0 @@ -910,7 +910,7 @@ class File return 0; } - static int __stdio_write_callback() + protected int __stdio_write_callback() { BE_WERR("__stdio_write_callback()"); @@ -929,7 +929,7 @@ class File return 0; } - static int __stdio_read_oob_callback() + protected int __stdio_read_oob_callback() { BE_WERR ("__stdio_read_oob_callback()"); @@ -992,7 +992,7 @@ class File return 0; } - static int __stdio_write_oob_callback() + protected int __stdio_write_oob_callback() { BE_WERR ("__stdio_write_oob_callback()"); if (!___write_oob_callback) return 0; @@ -1203,7 +1203,7 @@ class File function(mixed|void:int) query_close_callback() { return ___close_callback; } - static void fix_internal_callbacks() + protected void fix_internal_callbacks() { BE_WERR("fix_internal_callbacks()\n"); ::set_read_callback ((___read_callback && __stdio_read_callback) || @@ -1361,7 +1361,7 @@ class File #endif } - static void destroy() + protected void destroy() { BE_WERR("destroy()"); // Avoid cyclic refs. @@ -1384,10 +1384,10 @@ class Port { inherit _port; - static int|string debug_port; - static string debug_ip; + protected int|string debug_port; + protected string debug_ip; - static string _sprintf( int f ) + protected string _sprintf( int f ) { return f=='O' && sprintf( "%O(%s:%O)", this_program, debug_ip||"", debug_port ); @@ -1409,7 +1409,7 @@ class Port //! //! @seealso //! @[bind] - static void create( string|int|void p, + protected void create( string|int|void p, void|mixed cb, string|void ip ) { @@ -1478,12 +1478,12 @@ class FILE private function(string:string) output_conversion, input_conversion; - static string _sprintf( int type, mapping flags ) + protected string _sprintf( int type, mapping flags ) { return ::_sprintf( type, flags ); } - inline private static final int low_get_data() + inline private protected final int low_get_data() { string s = file::read(BUFSIZE,1); if(s && strlen(s)) { @@ -1497,7 +1497,7 @@ class FILE } } - inline private static final int get_data() + inline private protected final int get_data() { if( bpos ) { @@ -1511,7 +1511,7 @@ class FILE // Return 0 at end of file, 1 otherwise. // At exit cached_lines contains at least one string, // and lp is set to zero. - inline private static final int get_lines() + inline private protected final int get_lines() { if( bpos ) { @@ -1529,7 +1529,7 @@ class FILE } // NB: Caller is responsible for clearing cached_lines and lp. - inline private static final string extract(int bytes, int|void skip) + inline private protected final string extract(int bytes, int|void skip) { string s; s=b[bpos..bpos+bytes-1]; @@ -1791,7 +1791,7 @@ class FILE //! //! @seealso //! @[line_iterator()] - static object _get_iterator() + protected object _get_iterator() { if( input_conversion ) return String.SplitIterator( "",'\n',1,read_function(8192)); @@ -1931,11 +1931,11 @@ FILE stdout=FILE("stdout"); FILE stdin=FILE("stdin"); #ifdef TRACK_OPEN_FILES -static mapping(string|int:array) open_files = ([]); -static mapping(string:int) registering_files = ([]); -static int next_open_file_id = 1; +protected mapping(string|int:array) open_files = ([]); +protected mapping(string:int) registering_files = ([]); +protected int next_open_file_id = 1; -static void register_open_file (string file, int id, array backtrace) +protected void register_open_file (string file, int id, array backtrace) { file = combine_path (getcwd(), file); if (!registering_files[file]) { @@ -1952,7 +1952,7 @@ static void register_open_file (string file, int id, array backtrace) else open_files[file] += ({id}); } -static void register_close_file (int id) +protected void register_close_file (int id) { if (open_files[id]) { string file = open_files[id][0]; @@ -2475,7 +2475,7 @@ int file_equal (string file_1, string file_2) return 1; } -static void call_cp_cb(int len, +protected void call_cp_cb(int len, function(int, mixed ...:void) cb, mixed ... args) { // FIXME: Check that the lengths are the same? @@ -2609,30 +2609,30 @@ int recursive_mv(string from, string to) #define READER_HALT 32 // FIXME: Support for timeouts? -static class nb_sendfile +protected class nb_sendfile { - static File from; - static int len; - static array(string) trailers; - static File to; - static Pike.Backend backend; - static function(int, mixed ...:void) callback; - static array(mixed) args; + protected File from; + protected int len; + protected array(string) trailers; + protected File to; + protected Pike.Backend backend; + protected function(int, mixed ...:void) callback; + protected array(mixed) args; // NOTE: Always modified from backend callbacks, so no need // for locking. - static array(string) to_write = ({}); - static int sent; + protected array(string) to_write = ({}); + protected int sent; - static int reader_awake; - static int writer_awake; + protected int reader_awake; + protected int writer_awake; - static int blocking_to; - static int blocking_from; + protected int blocking_to; + protected int blocking_from; /* Reader */ - static string _sprintf( int f ) + protected string _sprintf( int f ) { switch( f ) { @@ -2643,7 +2643,7 @@ static class nb_sendfile } } - static void reader_done() + protected void reader_done() { SF_WERR("Reader done."); @@ -2674,13 +2674,13 @@ static class nb_sendfile } } - static void close_cb(mixed ignored) + protected void close_cb(mixed ignored) { SF_WERR("Input EOF."); reader_done(); } - static void do_read() + protected void do_read() { SF_WERR("Blocking read."); if( sizeof( to_write ) > 2) @@ -2704,7 +2704,7 @@ static class nb_sendfile } } - static void read_cb(mixed ignored, string data) + protected void read_cb(mixed ignored, string data) { SF_WERR("Read callback."); if (len > 0) { @@ -2742,7 +2742,7 @@ static class nb_sendfile } } - static void start_reader() + protected void start_reader() { SF_WERR("Starting the reader."); if (!reader_awake) { @@ -2753,7 +2753,7 @@ static class nb_sendfile /* Writer */ - static void writer_done() + protected void writer_done() { SF_WERR("Writer done."); @@ -2783,7 +2783,7 @@ static class nb_sendfile } } - static int do_write() + protected int do_write() { SF_WERR("Blocking writer."); @@ -2817,7 +2817,7 @@ static class nb_sendfile } } - static void write_cb(mixed ignored) + protected void write_cb(mixed ignored) { SF_WERR("Write callback."); if (do_write()) { @@ -2849,7 +2849,7 @@ static class nb_sendfile } } - static void start_writer() + protected void start_writer() { SF_WERR("Starting the writer."); @@ -2861,7 +2861,7 @@ static class nb_sendfile } /* Blocking */ - static void do_blocking() + protected void do_blocking() { SF_WERR("Blocking I/O."); @@ -2889,7 +2889,7 @@ static class nb_sendfile /* Starter */ - static void create(array(string) hd, + protected void create(array(string) hd, File f, int off, int l, array(string) tr, File t, @@ -3059,8 +3059,8 @@ class UDP { inherit files.UDP; - private static array extra=0; - private static function(mapping,mixed...:void) callback=0; + private protected array extra=0; + private protected function(mapping,mixed...:void) callback=0; //! @decl UDP set_nonblocking() //! @decl UDP set_nonblocking(function(mapping(string:int|string), @ @@ -3112,7 +3112,7 @@ class UDP return this; } - private static void _read_callback() + private protected void _read_callback() { mapping i; if (i=read()) diff --git a/lib/modules/String.pmod/HTML.pmod b/lib/modules/String.pmod/HTML.pmod index d3a52216539a1217652d44770609fe48d3740a17..6169af2d09c421c575ae141983777519f494bd0c 100644 --- a/lib/modules/String.pmod/HTML.pmod +++ b/lib/modules/String.pmod/HTML.pmod @@ -1,4 +1,4 @@ -// $Id: HTML.pmod,v 1.6 2003/06/26 23:35:41 nilsson Exp $ +// $Id: HTML.pmod,v 1.7 2008/06/28 16:37:00 nilsson Exp $ #pike __REAL_VERSION__ @@ -136,7 +136,7 @@ array(array(string)) pad_rows( array(array(string)) rows, void|string padding ) //! simple_obox class OBox { - static { + protected { string frame_color; string cell_color = "#ffffff"; string width; diff --git a/lib/modules/String.pmod/module.pmod b/lib/modules/String.pmod/module.pmod index ea749497be77558b882352d42c2abd7ff3746627..b81a37e5f8cbbb7f7e1e6c15ab612a94fd488b55 100644 --- a/lib/modules/String.pmod/module.pmod +++ b/lib/modules/String.pmod/module.pmod @@ -98,7 +98,7 @@ string common_prefix(array(string) strs) // Do a fuzzy matching between two different strings and return a // "similarity index". The higher, the closer the strings match. -static int low_fuzzymatch(string str1, string str2) +protected int low_fuzzymatch(string str1, string str2) { string tmp1, tmp2; int offset, length; @@ -204,7 +204,7 @@ string int2roman(int m) return res; } -static constant prefix = ({ "bytes", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" }); +protected constant prefix = ({ "bytes", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" }); //! Returns the size as a memory size string with suffix, //! e.g. 43210 is converted into "42.2 kB". To be correct @@ -259,7 +259,7 @@ string expand_tabs(string s, int|void tab_width, } // the \n splitting is done in our caller for speed improvement -static string line_expand_tab(string line, int tab_width, +protected string line_expand_tab(string line, int tab_width, string space, string tab) { string ws, chunk, result = ""; diff --git a/lib/modules/Thread.pmod b/lib/modules/Thread.pmod index 8de9c0a2e79d6c19699171af95cc2918baf2c201..2ab72ac29bab2410b62c5f516489d728b1928a76 100644 --- a/lib/modules/Thread.pmod +++ b/lib/modules/Thread.pmod @@ -34,7 +34,7 @@ constant Thread=__builtin.thread_id; inherit Thread; // We don't want to create a thread of the module... -static void create(mixed ... args) +protected void create(mixed ... args) { } @@ -83,7 +83,7 @@ optional class Fifo { //! int size() { return num; } - static final mixed read_unlocked() + protected final mixed read_unlocked() { mixed tmp=buffer[ptr]; buffer[ptr++] = 0; // Throw away any references. @@ -134,7 +134,7 @@ optional class Fifo { return res; } - static final array read_all_unlocked() + protected final array read_all_unlocked() { array ret; @@ -199,7 +199,7 @@ optional class Fifo { return ret; } - static final void write_unlocked (mixed value) + protected final void write_unlocked (mixed value) { buffer[(ptr + num) % sizeof(buffer)] = value; if(write_tres) @@ -255,13 +255,13 @@ optional class Fifo { //! sets how many values can be written to the fifo without blocking. //! The default @[size] is 128. //! - static void create(int|void size) + protected void create(int|void size) { write_tres=0; buffer=allocate(read_tres=size || 128); } - static string _sprintf( int f ) + protected string _sprintf( int f ) { return f=='O' && sprintf( "%O(%d / %d)", this_program, size(), read_tres ); @@ -327,7 +327,7 @@ optional class Queue { return tmp; } - static final array read_all_unlocked() + protected final array read_all_unlocked() { array ret; @@ -409,7 +409,7 @@ optional class Queue { return items; } - static string _sprintf( int f ) + protected string _sprintf( int f ) { return f=='O' && sprintf( "%O(%d)", this_program, size() ); } @@ -419,9 +419,9 @@ optional class Queue { optional class Farm { - static Mutex mutex = Mutex(); - static Condition ft_cond = Condition(); - static Queue job_queue = Queue(); + protected Mutex mutex = Mutex(); + protected Condition ft_cond = Condition(); + protected Queue job_queue = Queue(); class Result { @@ -473,7 +473,7 @@ optional class Farm } - static string _sprintf( int f ) + protected string _sprintf( int f ) { switch( f ) { @@ -485,7 +485,7 @@ optional class Farm } } - static class Handler + protected class Handler { Mutex job_mutex = Mutex(); Condition cond = Condition(); @@ -495,7 +495,7 @@ optional class Farm float total_time; int handled, max_time; - static int ready; + protected int ready; void handler() { @@ -559,13 +559,13 @@ optional class Farm +"\n\n"); } - static void create() + protected void create() { thread = thread_create( handler ); } - static string _sprintf( int f ) + protected string _sprintf( int f ) { switch( f ) { @@ -578,11 +578,11 @@ optional class Farm } } - static array(Handler) threads = ({}); - static array(Handler) free_threads = ({}); - static int max_num_threads = 20; + protected array(Handler) threads = ({}); + protected array(Handler) free_threads = ({}); + protected int max_num_threads = 20; - static Handler aquire_thread() + protected Handler aquire_thread() { object lock = mutex->lock(); while( !sizeof(free_threads) ) @@ -601,13 +601,13 @@ optional class Farm } - static void dispatcher() + protected void dispatcher() { while( array q = [array]job_queue->read() ) aquire_thread()->run( q[1], q[0] ); } - static class ValueAdjuster( object r, object r2, int i, mapping v ) + protected class ValueAdjuster( object r, object r2, int i, mapping v ) { void go(mixed vn, int err) { @@ -690,12 +690,12 @@ optional class Farm return res; } - static string _sprintf( int f ) + protected string _sprintf( int f ) { return f=='O' && sprintf( "%O(/* %s */)", this_program, debug_status() ); } - static void create() + protected void create() { thread_create( dispatcher ); } @@ -708,13 +708,13 @@ optional class Farm /* Fallback implementation of Thread.Local */ optional class Local { - static mixed data; + protected mixed data; mixed get() {return data;} mixed set (mixed val) {return data = val;} } /* Fallback implementation of Thread.MutexKey */ -optional class MutexKey (static function(:void) dec_locks) +optional class MutexKey (protected function(:void) dec_locks) { int `!() { @@ -725,7 +725,7 @@ optional class MutexKey (static function(:void) dec_locks) return 1; } - static void destroy() + protected void destroy() { if (dec_locks) dec_locks(); } @@ -734,8 +734,8 @@ optional class MutexKey (static function(:void) dec_locks) /* Fallback implementation of Thread.Mutex */ optional class Mutex { - static int locks = 0; - static void dec_locks() {locks--;} + protected int locks = 0; + protected void dec_locks() {locks--;} MutexKey lock (int|void type) { @@ -847,13 +847,13 @@ optional class Fifo return num; } - static void create(int|void size) + protected void create(int|void size) { write_tres=0; buffer=allocate(read_tres=size || 128); } - static string _sprintf( int f ) + protected string _sprintf( int f ) { return f=='O' && sprintf( "%O(%d / %d)", this_program, size(), read_tres ); @@ -925,10 +925,11 @@ optional class Queue return w_ptr - r_ptr; } - static string _sprintf( int f ) + protected string _sprintf( int f ) { return f=='O' && sprintf( "%O(%d)", this_program, size() ); } } #endif /* !constant(thread_create) */ + diff --git a/lib/modules/Tools.pmod/AutoDoc.pmod/CExtractor.pmod b/lib/modules/Tools.pmod/AutoDoc.pmod/CExtractor.pmod index 6748625923afba70586b72c8c029513fbd6f70b4..338d46a881de43b267959e1477b9ca0709c47d1e 100644 --- a/lib/modules/Tools.pmod/AutoDoc.pmod/CExtractor.pmod +++ b/lib/modules/Tools.pmod/AutoDoc.pmod/CExtractor.pmod @@ -8,33 +8,33 @@ // #pragma strict_types -static inherit .PikeObjects; -static inherit .DocParser; +protected inherit .PikeObjects; +protected inherit .DocParser; #include "./debug.h" constant EOF = .PikeParser.EOF; -static string stripDocMarker(string s) { +protected string stripDocMarker(string s) { string res; if (sscanf(s, "%*[ \t]*!%s", res) == 2) return res; return ""; } -static void extractorErrorAt(SourcePosition sp, string message, mixed ... args) +protected void extractorErrorAt(SourcePosition sp, string message, mixed ... args) { message = sprintf(message, @args); werror("CExtractor error! %O %O\n", message, sp); throw (AutoDocError(sp, "CExtractor", message)); } -static private class Extractor { - static constant EOF = .PikeParser.EOF; - static string filename; - static array(.DocParser.Parse) tokens = ({}); +protected private class Extractor { + protected constant EOF = .PikeParser.EOF; + protected string filename; + protected array(.DocParser.Parse) tokens = ({}); - static void create(string s, string filename) { + protected void create(string s, string filename) { this_program::filename = filename; array(string) ctokens = Parser.C.split(s); @@ -69,7 +69,7 @@ static private class Extractor { // or ({"docgroup", DocGroup }) // or ({"namespace", NameSpace }) // or 0 if no objects to parse. - static array(string|Class|Module|NameSpace|DocGroup) + protected array(string|Class|Module|NameSpace|DocGroup) parseObject(Class|Module|NameSpace|AutoDoc parent, AutoDoc root) { Parse token = tokens[0]; diff --git a/lib/modules/Tools.pmod/AutoDoc.pmod/DocParser.pmod b/lib/modules/Tools.pmod/AutoDoc.pmod/DocParser.pmod index 261f7bbfe8499e36c9af1e8d7e38ce80c0df86fc..6d5ff33de0c302f429b800890631bc38692a0db5 100644 --- a/lib/modules/Tools.pmod/AutoDoc.pmod/DocParser.pmod +++ b/lib/modules/Tools.pmod/AutoDoc.pmod/DocParser.pmod @@ -108,7 +108,7 @@ mapping(string:array(string)) required_attributes = "param" : ({ "name" }), ]); -static constant standard = (< +protected constant standard = (< "note", "bugs", "example", "seealso", "deprecated", "fixme", "code" >); @@ -151,7 +151,7 @@ multiset(string) allowOnlyOne = "deprecated", >); -static int getKeywordType(string keyword) { +protected int getKeywordType(string keyword) { if (keywordtype[keyword]) return keywordtype[keyword]; if (sizeof(keyword) > 3 && keyword[0..2] == "end") @@ -159,7 +159,7 @@ static int getKeywordType(string keyword) { return ERRORKEYWORD; } -static int getTokenType(array(string) | string token) { +protected int getTokenType(array(string) | string token) { if (arrayp(token)) return getKeywordType(token[0]); if (!token) @@ -167,15 +167,15 @@ static int getTokenType(array(string) | string token) { return TEXTTOKEN; } -static int isSpaceChar(int char) { +protected int isSpaceChar(int char) { return (< '\t', '\n', ' ' >) [char]; } -static int isKeywordChar(int char) { +protected int isKeywordChar(int char) { return char >= 'a' && char <= 'z'; } -static array(string) extractKeyword(string line) { +protected array(string) extractKeyword(string line) { line += "\0"; int i = 0; while (i < sizeof(line) && isSpaceChar(line[i])) @@ -192,14 +192,14 @@ static array(string) extractKeyword(string line) { return ({ keyword, line[i .. sizeof(line) - 2] }); // skippa "\0" ... } -static int allSpaces(string s) { +protected int allSpaces(string s) { for (int i = sizeof(s) - 1; i >= 0; --i) if (s[i] != ' ' && s[i] != '\t') return 0; return 1; } -static private class Token ( +protected private class Token ( int type, string keyword, string arg, // the rest of the line, after the keyword @@ -212,7 +212,7 @@ static private class Token ( } } -static array(Token) split(string s, SourcePosition pos) { +protected array(Token) split(string s, SourcePosition pos) { s = s - "\r"; s = replace(s, "@\n", "@\r"); array(string) lines = s / "\n"; @@ -267,23 +267,23 @@ static array(Token) split(string s, SourcePosition pos) { return res; } -static class DocParserClass { +protected class DocParserClass { SourcePosition currentPosition = 0; - static void parseError(string s, mixed ... args) { + protected void parseError(string s, mixed ... args) { s = sprintf(s, @args); werror("DocParser error: %O\n", s); throw (AutoDocError(currentPosition, "DocParser", s)); } - static array(Token) tokenArr = 0; - static Token peekToken() { + protected array(Token) tokenArr = 0; + protected Token peekToken() { Token t = tokenArr[0]; currentPosition = t->position || currentPosition; return t; } - static Token readToken() { + protected Token readToken() { Token t = peekToken(); tokenArr = tokenArr[1..]; return t; @@ -310,7 +310,7 @@ static class DocParserClass { "value" : valueArgHandler, ]); - static string memberArgHandler(string keyword, string arg) { + protected string memberArgHandler(string keyword, string arg) { // werror("This is the @member arg handler "); .PikeParser parser = .PikeParser(arg, currentPosition); // werror("&&& %O\n", arg); @@ -326,7 +326,7 @@ static class DocParserClass { + xmltag("index", xmlquote(s)); } - static string elemArgHandler(string keyword, string arg) { + protected string elemArgHandler(string keyword, string arg) { // werror("This is the @elem arg handler\n"); .PikeParser parser = .PikeParser(arg, currentPosition); Type t = parser->parseOrType(); @@ -359,7 +359,7 @@ static class DocParserClass { parseError("@elem: expected identifier or literal"); } - static string indexArgHandler(string keyword, string arg) { + protected string indexArgHandler(string keyword, string arg) { // werror("indexArgHandler\n"); .PikeParser parser = .PikeParser(arg, currentPosition); string s = parser->parseLiteral(); @@ -369,7 +369,7 @@ static class DocParserClass { return xmltag("value", xmlquote(s)); } - static string deprArgHandler(string keyword, string arg) { + protected string deprArgHandler(string keyword, string arg) { .PikeParser parser = .PikeParser(arg, currentPosition); if (parser->peekToken() == EOF) return ""; @@ -385,11 +385,11 @@ static class DocParserClass { } } - static mapping(string : string) sectionArgHandler(string keyword, string arg) { + protected mapping(string : string) sectionArgHandler(string keyword, string arg) { return ([ "name" : arg ]); } - static string typeArgHandler(string keyword, string arg) { + protected string typeArgHandler(string keyword, string arg) { // werror("This is the @type arg handler "); .PikeParser parser = .PikeParser(arg, currentPosition); // werror("&&& %O\n", arg); @@ -401,7 +401,7 @@ static class DocParserClass { return t->xml(); } - static string valueArgHandler(string keyword, string arg) { + protected string valueArgHandler(string keyword, string arg) { // werror("This is the @value arg handler "); .PikeParser parser = .PikeParser(arg, currentPosition); // werror("&&& %O\n", arg); @@ -427,7 +427,7 @@ static class DocParserClass { parseError("@value: expected indentifier or literal constant, got %O", arg); } - static mapping(string : string) standardArgHandler(string keyword, string arg) + protected mapping(string : string) standardArgHandler(string keyword, string arg) { array(string) args = ({}); arg += "\0"; @@ -515,11 +515,11 @@ static class DocParserClass { return res; } - static string|mapping(string:string) getArgs(string keyword, string arg) { + protected string|mapping(string:string) getArgs(string keyword, string arg) { return (argHandlers[keyword] || standardArgHandler)(keyword, arg); } - static string xmlNode(string s) { /* now, @xml works like @i & @tt */ + protected string xmlNode(string s) { /* now, @xml works like @i & @tt */ s += "\0"; string res = ""; int i = 0; @@ -616,7 +616,7 @@ static class DocParserClass { // Read until the next delimiter token on the same level, or to // the end. - static string xmlText() { + protected string xmlText() { string res = ""; for (;;) { Token token = peekToken(); @@ -653,7 +653,7 @@ static class DocParserClass { } } - static string xmlContainerContents(string container) { + protected string xmlContainerContents(string container) { string res = ""; Token token = peekToken(); switch(token->type) { @@ -742,7 +742,7 @@ static class DocParserClass { } } - static void create(string | array(Token) s, + protected void create(string | array(Token) s, SourcePosition|void position) { if (arrayp(s)) { @@ -959,10 +959,10 @@ array(array(Token)) splitDocBlock(string block, SourcePosition position) { // actual doc lines in. class Parse { inherit DocParserClass; - static int state; - static MetaData mMetaData = 0; - static string mDoc = 0; - static string mContext = 0; + protected int state; + protected MetaData mMetaData = 0; + protected string mDoc = 0; + protected string mContext = 0; void create(string | array(Token) s, SourcePosition|void sp) { ::create(s, sp); state = 0; diff --git a/lib/modules/Tools.pmod/AutoDoc.pmod/PikeExtractor.pmod b/lib/modules/Tools.pmod/AutoDoc.pmod/PikeExtractor.pmod index 33061fc0f4012ddda1d9dd44d290634950590cd7..486f718153ca1f15843664e808bdd056862cc302 100644 --- a/lib/modules/Tools.pmod/AutoDoc.pmod/PikeExtractor.pmod +++ b/lib/modules/Tools.pmod/AutoDoc.pmod/PikeExtractor.pmod @@ -6,8 +6,8 @@ // #pragma strict_types -static inherit .PikeObjects; -static inherit .DocParser; +protected inherit .PikeObjects; +protected inherit .DocParser; #include "./debug.h" @@ -15,13 +15,13 @@ static inherit .DocParser; // DOC EXTRACTION //======================================================================== -static private class Extractor { - static constant WITH_NL = .PikeParser.WITH_NL; +protected private class Extractor { + protected constant WITH_NL = .PikeParser.WITH_NL; // static private string filename; - static private .PikeParser parser; + protected private .PikeParser parser; - static void create(string s, string filename) { + protected void create(string s, string filename) { parser = .PikeParser(0, filename); array(string) tokens; @@ -61,23 +61,23 @@ static private class Extractor { parser->setTokens(new_tokens, new_positions); } - static void extractorError(string message, mixed ... args) { + protected void extractorError(string message, mixed ... args) { message = sprintf(message, @args); error("PikeExtractor: %s (%O)\n", message, parser->currentPosition); } - static int isDocComment(string s) { + protected int isDocComment(string s) { return (sizeof(s) >= 3 && s[0..2] == DOC_COMMENT); } - static string stripDocMarker(string s) { + protected string stripDocMarker(string s) { if (isDocComment(s)) return s[3..]; throw("OOPS"); } // readAdjacentDocLines consumes the doc lines AND the "\n" after the last one - static Documentation readAdjacentDocLines() { + protected Documentation readAdjacentDocLines() { Documentation res = Documentation(); string s = parser->peekToken(); string text = ""; @@ -99,12 +99,12 @@ static private class Extractor { // check if the token is one that can not start a declaration // adjacent to the last one - static int isDelimiter(string token) { + protected int isDelimiter(string token) { return (< "\n", "}", "EOF" >) [token]; } // consumes the "\n" after the last constant too... - static array(array(EnumConstant)|int(0..1)) parseAdjacentEnumConstants() { + protected array(array(EnumConstant)|int(0..1)) parseAdjacentEnumConstants() { array(EnumConstant) result = ({ }); parser->skipNewlines(); int terminating_nl; @@ -127,7 +127,7 @@ static private class Extractor { // Returns nothing, instead adds the enumconstants as children to // the Enum parent - static void parseEnumBody(Enum parent) { + protected void parseEnumBody(Enum parent) { for (;;) { parser->skipNewlines(); Documentation doc = 0; @@ -183,7 +183,7 @@ static private class Extractor { } // parseAdjacentDecls consumes the "\n" that may follow the last decl - static array(array(PikeObject)|int(0..1)) parseAdjacentDecls(Class|Module c) + protected array(array(PikeObject)|int(0..1)) parseAdjacentDecls(Class|Module c) { array(PikeObject) res = ({ }); for (;;) { diff --git a/lib/modules/Tools.pmod/AutoDoc.pmod/PikeObjects.pmod b/lib/modules/Tools.pmod/AutoDoc.pmod/PikeObjects.pmod index b3ecbf36f0b20207c676e3699446aff1752914a7..976a304bba46c65eefb8214fdeda2c88ff557055 100644 --- a/lib/modules/Tools.pmod/AutoDoc.pmod/PikeObjects.pmod +++ b/lib/modules/Tools.pmod/AutoDoc.pmod/PikeObjects.pmod @@ -7,8 +7,8 @@ // #pragma strict_types #include "./debug.h" -static inherit "module.pmod"; -static inherit Parser.XML.Tree; +protected inherit "module.pmod"; +protected inherit Parser.XML.Tree; //======================================================================== @@ -269,13 +269,13 @@ class Documentation(string|void text, string|void xml, SourcePosition|void position) {} -static Documentation EmptyDoc = +protected Documentation EmptyDoc = Documentation("", "\n", SourcePosition(__FILE__, __LINE__, __LINE__)); class DocGroup { array(PikeObject) objects = ({ }); Documentation documentation = 0; - static void create(array(PikeObject) objs, Documentation doc) { + protected void create(array(PikeObject) objs, Documentation doc) { documentation = doc; objects = objs; } @@ -325,7 +325,7 @@ class PikeObject { Documentation squeezedInDoc; - static string standardTags() { + protected string standardTags() { string s = ""; if (position) s += position->xml(); @@ -338,7 +338,7 @@ class PikeObject { return standardStart() + standardEnd(); } - static mapping(string:string) standardAttributes() { + protected mapping(string:string) standardAttributes() { mapping(string:string) m = ([]); if (name) m->name = name; if (appears) m->appears = appears; @@ -346,10 +346,10 @@ class PikeObject { return m; } - static string standardStart() { return opentag(objtype, standardAttributes()); } - static string standardEnd() { return closetag(objtype); } + protected string standardStart() { return opentag(objtype, standardAttributes()); } + protected string standardEnd() { return closetag(objtype); } - static string printModifiers() { + protected string printModifiers() { return modifiers * " " + (sizeof(modifiers) ? " " : ""); } string print() { return printModifiers() + objtype; } @@ -465,7 +465,7 @@ class _Class_or_Module { return s + "\n}"; } - static string _sprintf(int c) + protected string _sprintf(int c) { switch(c) { case 's': return xml(); diff --git a/lib/modules/Tools.pmod/AutoDoc.pmod/PikeParser.pike b/lib/modules/Tools.pmod/AutoDoc.pmod/PikeParser.pike index 3ad707f5ff9ec4f74d627e6db5256fd65793eff3..cfc77ecdef2bb6244acf575d7648c0a523f579ec 100644 --- a/lib/modules/Tools.pmod/AutoDoc.pmod/PikeParser.pike +++ b/lib/modules/Tools.pmod/AutoDoc.pmod/PikeParser.pike @@ -6,30 +6,30 @@ #include "./debug.h" #define TOKEN_DEBUG 0 -static inherit .PikeObjects; -static inherit "module.pmod"; +protected inherit .PikeObjects; +protected inherit "module.pmod"; constant EOF = ""; -static mapping(string : string) quote = +protected mapping(string : string) quote = (["\n" : "\\n", "\\" : "\\\\" ]); -static string quoteString(string s) { +protected string quoteString(string s) { return "\"" + (quote[s] || s) + "\""; } -static mapping(string : string) matchTokens = +protected mapping(string : string) matchTokens = ([ "(":")", "{":"}", "[":"]", "({" : "})", "([" : "])", "(<":">)" ]); -static mapping(string : string) reverseMatchTokens = +protected mapping(string : string) reverseMatchTokens = mkmapping(values(matchTokens), indices(matchTokens)); -static multiset(string) modifiers = +protected multiset(string) modifiers = (< "nomask", "final", "static", "extern", "private", "local", "public", "protected", "inline", "optional", "variant" >); -static multiset(string) scopeModules = +protected multiset(string) scopeModules = (< "predef", "top", "lfun", "efun" >); void skip(multiset(string)|string tokens) { @@ -98,7 +98,7 @@ void skipNewlines() { SourcePosition currentPosition = 0; -static int parseError(string message, mixed ... args) { +protected int parseError(string message, mixed ... args) { message = sprintf(message, @args); // werror("parseError! \n"); // werror("%s\n", describe_backtrace(backtrace())); @@ -141,7 +141,7 @@ string peekToken(int | void with_newlines) { return tokens[at]; } -static int nReadDocComments = 0; +protected int nReadDocComments = 0; int getReadDocComments() { return nReadDocComments; } string readToken(int | void with_newlines) { @@ -813,7 +813,7 @@ void setTokens(array(string) t, array(int) p) { // create(string, filename, firstline) // create(array(Token)) -static void create(string|void s, +protected void create(string|void s, string|SourcePosition|void _filename, int|void line) { diff --git a/lib/modules/Tools.pmod/AutoDoc.pmod/ProcessXML.pmod b/lib/modules/Tools.pmod/AutoDoc.pmod/ProcessXML.pmod index dbd483cd6acccfdcdf7aa418e937e73723f8eee9..b4f6e31080e37747578145bcf6a401a020b33e3a 100644 --- a/lib/modules/Tools.pmod/AutoDoc.pmod/ProcessXML.pmod +++ b/lib/modules/Tools.pmod/AutoDoc.pmod/ProcessXML.pmod @@ -6,11 +6,11 @@ #include "./debug.h" -static inherit Parser.XML.Tree; -static inherit "module.pmod"; +protected inherit Parser.XML.Tree; +protected inherit "module.pmod"; #define DEB werror("###%s:%d\n", __FILE__, __LINE__); -static private void processError(string message, mixed ... args) { +protected private void processError(string message, mixed ... args) { throw ( ({ sprintf("ProcessXML: "+message+"\n", @args), backtrace() }) ); } @@ -112,7 +112,7 @@ static private void processError(string message, mixed ... args) { //======================================================================== // Wrap child in the proper modules and namespace. -static object makeWrapper(array(string) modules, object|void child) +protected object makeWrapper(array(string) modules, object|void child) { object m; if (child->objtype != "autodoc") { @@ -358,13 +358,13 @@ string moveImages(string docXMLFile, // BUILDING OF THE BIG TREE //======================================================================== -static int isAutoDoc(SimpleNode node) { return node->get_any_name() == "autodoc"; } -static int isNameSpace(SimpleNode node) { return node->get_any_name() == "namespace"; } -static int isClass(SimpleNode node) { return node->get_any_name() == "class"; } -static int isModule(SimpleNode node) { return node->get_any_name() == "module"; } -static int isDoc(SimpleNode node) { return node->get_any_name() == "doc"; } +protected int isAutoDoc(SimpleNode node) { return node->get_any_name() == "autodoc"; } +protected int isNameSpace(SimpleNode node) { return node->get_any_name() == "namespace"; } +protected int isClass(SimpleNode node) { return node->get_any_name() == "class"; } +protected int isModule(SimpleNode node) { return node->get_any_name() == "module"; } +protected int isDoc(SimpleNode node) { return node->get_any_name() == "doc"; } -static string getName(SimpleNode node) { return node->get_attributes()["name"]; } +protected string getName(SimpleNode node) { return node->get_attributes()["name"]; } //! Puts all children of @[source] into the tree @[dest], in their right //! place module-hierarchically. @@ -440,7 +440,7 @@ void mergeTrees(SimpleNode dest, SimpleNode source) { source->replace_children(children - ({ 0 })); } -static void reportError(string filename, mixed ... args) { +protected void reportError(string filename, mixed ... args) { werror("[%s]\t%s\n", filename, sprintf(@args)); } @@ -448,7 +448,7 @@ static void reportError(string filename, mixed ... args) { // HANDLING @appears directives //======================================================================== -static SimpleNode findNode(SimpleNode root, array(string) ref) { +protected SimpleNode findNode(SimpleNode root, array(string) ref) { SimpleNode n = root; // top:: is an anchor to the root of the current namespace. if (sizeof(ref) && ref[0] == "top::") @@ -476,15 +476,15 @@ static SimpleNode findNode(SimpleNode root, array(string) ref) { return n; } -static class ReOrganizeTask(SimpleNode n, SimpleNode parent) { +protected class ReOrganizeTask(SimpleNode n, SimpleNode parent) { array(string) belongsRef; string newName; } -static array(ReOrganizeTask) tasks; +protected array(ReOrganizeTask) tasks; // current is a <module>, <class> or <docgroup> node -static void recurseAppears(string namespace, +protected void recurseAppears(string namespace, SimpleNode current, SimpleNode parent) { mapping attr = current->get_attributes() || ([]); @@ -593,7 +593,7 @@ void handleAppears(SimpleNode root) { // "\"foo.pike\"" ==> ({ "\"foo.pike\"" }) // ".protocol" ==> ({ "", "protocol" }) // ".module.ANY" ==> ({ "", "ANY" }) -static array(string) splitRef(string ref) { +protected array(string) splitRef(string ref) { if ((sizeof(ref)>1) && (ref[0] == '"')) { if ((ref == "\".\"") || (ref == "\"module.pmod\"")) { // Some special cases for referring to the current module. @@ -658,7 +658,7 @@ static array(string) splitRef(string ref) { } } -static string mergeRef(array(string) ref) { +protected string mergeRef(array(string) ref) { string s = ""; if (sizeof(ref) && has_suffix(ref[0], "::")) { s = ref[0]; @@ -668,7 +668,7 @@ static string mergeRef(array(string) ref) { return s; } -static class Scope(string|void type, string|void name) { +protected class Scope(string|void type, string|void name) { multiset(string) idents = (<>); multiset(string) failures = (<>); @@ -679,7 +679,7 @@ static class Scope(string|void type, string|void name) { } } -static class ScopeStack { +protected class ScopeStack { mapping(string:array(Scope)) scopes = ([]); mapping(string:multiset(string)) namespace_extends = ([]); string namespace = "predef"; @@ -813,7 +813,7 @@ static class ScopeStack { } } -static void fixupRefs(ScopeStack scopes, SimpleNode node) { +protected void fixupRefs(ScopeStack scopes, SimpleNode node) { node->walk_preorder( lambda(SimpleNode n) { if (n->get_node_type() == XML_ELEMENT) { @@ -835,7 +835,7 @@ static void fixupRefs(ScopeStack scopes, SimpleNode node) { } // expects a <autodoc>, <namespace>, <module> or <class> node -static void resolveFun(ScopeStack scopes, SimpleNode node) { +protected void resolveFun(ScopeStack scopes, SimpleNode node) { if (node->get_any_name() == "namespace") { // Create the namespace. scopes->enter("namespace", node->get_attributes()["name"]); @@ -974,7 +974,7 @@ class NScope // @[tree] is a node of type autodoc, namespace, module, class, enum, // or docgroup. - static void create(SimpleNode tree, string|void path) + protected void create(SimpleNode tree, string|void path) { type = tree->get_any_name(); name = tree->get_attributes()->name; @@ -1085,7 +1085,7 @@ class NScope } } } - static string _sprintf(int c) + protected string _sprintf(int c) { return sprintf("NScope(type:%O, name:%O, symbols:%d, inherits:%d)", type, name, sizeof(symbols), sizeof(inherits||([]))); @@ -1131,11 +1131,11 @@ class NScopeStack array(NScope) stack = ({}); mapping(string:mapping(string:int(1..))) failures = ([]); - static void create(NScope scopes) + protected void create(NScope scopes) { this_program::scopes = scopes; } - static void destroy() + protected void destroy() { if (sizeof(failures)) { werror("Resolution failed for %d symbols. Logging to resolution.log\n", diff --git a/lib/modules/Tools.pmod/AutoDoc.pmod/module.pmod b/lib/modules/Tools.pmod/AutoDoc.pmod/module.pmod index 92b38b8c47aee92167bc46bb91ed40af7bf9bafa..bffbb0d7b963a700e1fa22de08505007a091a71e 100644 --- a/lib/modules/Tools.pmod/AutoDoc.pmod/module.pmod +++ b/lib/modules/Tools.pmod/AutoDoc.pmod/module.pmod @@ -5,16 +5,16 @@ #include "./debug.h" -static constant DOC_COMMENT = "//!"; +protected constant DOC_COMMENT = "//!"; -static int isDigit(int c) { return '0' <= c && c <= '9'; } +protected int isDigit(int c) { return '0' <= c && c <= '9'; } -static int isDocComment(string s) { +protected int isDocComment(string s) { return has_prefix(s, DOC_COMMENT); } //FIXME: should it return 0 for keywords ?? -static int isIdent(string s) { +protected int isIdent(string s) { if (!s || s == "") return 0; int first = s[0]; @@ -31,23 +31,23 @@ static int isIdent(string s) { return 1; } -static int(0..1) isFloat(string s) +protected int(0..1) isFloat(string s) { int n; sscanf(s, "%*[0-9].%*[0-9]%n", n); return sizeof(s) && n == sizeof(s); } -static string xmlquote(string s) { +protected string xmlquote(string s) { return replace(s, ({ "<", ">", "&" }), ({ "<", ">", "&" })); } -static string attributequote(string s) { +protected string attributequote(string s) { return replace(s, ({ "<", ">", "\"", "'", "&" }), ({ "<", ">", """, "'", "&" })); } -static string writeattributes(mapping(string:string) attrs) +protected string writeattributes(mapping(string:string) attrs) { string s = ""; foreach(sort(indices(attrs || ([]))), string attr) @@ -55,13 +55,13 @@ static string writeattributes(mapping(string:string) attrs) return s; } -static string opentag(string t, mapping(string:string)|void attributes) { +protected string opentag(string t, mapping(string:string)|void attributes) { return "<" + t + writeattributes(attributes) + ">"; } -static string closetag(string t) { return "</" + t + ">"; } +protected string closetag(string t) { return "</" + t + ">"; } -static string xmltag(string t, string|mapping(string:string)|void arg1, +protected string xmltag(string t, string|mapping(string:string)|void arg1, string|void arg2) { mapping attributes = mappingp(arg1) ? arg1 : 0; @@ -77,7 +77,7 @@ class SourcePosition { int firstline; int lastline; - static void create(string filename, int firstline, + protected void create(string filename, int firstline, int|void lastline) { if (!firstline) { @@ -121,7 +121,7 @@ class AutoDocError { SourcePosition position; string part; // which part of the autodoc system... string message; - static void create(SourcePosition _position, string _part, string _message) { + protected void create(SourcePosition _position, string _part, string _message) { position = _position; part = _part; message = _message; diff --git a/lib/modules/Tools.pmod/Hilfe.pmod b/lib/modules/Tools.pmod/Hilfe.pmod index cb7d79429885c62dbf0e27301713d234c542fd1c..8096bd888a85b0e0c098c79fc837f1e9d2832781 100644 --- a/lib/modules/Tools.pmod/Hilfe.pmod +++ b/lib/modules/Tools.pmod/Hilfe.pmod @@ -4,7 +4,7 @@ // Incremental Pike Evaluator // -constant cvs_version = ("$Id: Hilfe.pmod,v 1.155 2008/06/12 16:57:43 nilsson Exp $"); +constant cvs_version = ("$Id: Hilfe.pmod,v 1.156 2008/06/28 16:37:00 nilsson Exp $"); constant hilfe_todo = #"List of known Hilfe bugs/room for improvements: - Hilfe can not handle enums. @@ -709,7 +709,7 @@ private class SubSysLogger { constant stopdoc = "logging\n\tTurns off logging to file.\n"; int(0..1) running; - static class Logger { + protected class Logger { Stdio.File logfile; Evaluator e; @@ -770,13 +770,13 @@ private class SubSysPhish { "\tStart the Pike Hilfe Shell.\n"; constant stopdoc = "phish\n\tTurns off phish.\n"; - static int(0..1) running; - static int(0..1) in_expr; - static Evaluator e; + protected int(0..1) running; + protected int(0..1) in_expr; + protected Evaluator e; int(0..1) runningp() { return running; } - static int(0..1) do_cmd(string cmd) { + protected int(0..1) do_cmd(string cmd) { if(in_expr) { return 0; } @@ -949,10 +949,10 @@ string typeof_token(string|array token) //! Represents a Pike expression class Expression { - static array(string) tokens; - static mapping(int:int) positions; - static array(int) depths; - static multiset(int) sscanf_depths; + protected array(string) tokens; + protected mapping(int:int) positions; + protected array(int) depths; + protected multiset(int) sscanf_depths; //! @param t //! An array of Pike tokens. @@ -965,7 +965,7 @@ class Expression { tokens = t; } - static void generate_offsets(array t) + protected void generate_offsets(array t) { int pos = tokens && sizeof(tokens); int depth; @@ -1147,7 +1147,7 @@ class Expression { //! An Expression object can be cast to an array or a string. In //! both forms all tokens, including white spaces will be returned. - static mixed cast(string to) + protected mixed cast(string to) { switch(to) { @@ -1157,7 +1157,7 @@ class Expression { error("Can not cast to %O\n", to); } - static string _sprintf(int t) { + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%O)", this_program, tokens); } } @@ -1510,7 +1510,7 @@ class Evaluator { return 0; } - static array input_hooks = ({}); + protected array input_hooks = ({}); //! Adds a function to the input hook, making //! all user data be fed into the function. @@ -2134,7 +2134,7 @@ class Evaluator { private string hch_errors = ""; private string hch_warnings = ""; - static class HilfeCompileHandler { + protected class HilfeCompileHandler { int stack_level; void create(int _stack_level) { diff --git a/lib/modules/Tools.pmod/Install.pmod b/lib/modules/Tools.pmod/Install.pmod index 5d33a345fff8f2a16c06415a4910e36ac5a16a87..bb5bdb18d6daed98a17acc59f807e2856fac4105 100644 --- a/lib/modules/Tools.pmod/Install.pmod +++ b/lib/modules/Tools.pmod/Install.pmod @@ -206,7 +206,7 @@ class Readline signal(signum("SIGINT")); } - static private string low_edit(string data, string|void local_prompt, + protected private string low_edit(string data, string|void local_prompt, array(string)|void attrs) { string r = ::edit(data, local_prompt, (attrs || ({})) | ({ "bold" })); @@ -250,7 +250,7 @@ class Readline return s; } - static private string file_completion(string tab) + protected private string file_completion(string tab) { string text = gettext(); int pos = getcursorpos(); diff --git a/lib/modules/Tools.pmod/Legal.pmod/Copyright.pmod b/lib/modules/Tools.pmod/Legal.pmod/Copyright.pmod index 21878fb5c887ed08b17f77de04c8f4be0805bf1c..64dc8c981775797aef23945ee0d07ec307e18032 100644 --- a/lib/modules/Tools.pmod/Legal.pmod/Copyright.pmod +++ b/lib/modules/Tools.pmod/Legal.pmod/Copyright.pmod @@ -1,11 +1,11 @@ #pike __REAL_VERSION__ -// $Id: Copyright.pmod,v 1.11 2008/01/04 20:40:57 nilsson Exp $ +// $Id: Copyright.pmod,v 1.12 2008/06/28 16:37:01 nilsson Exp $ //! Contains functions and information to store and present //! copyright information about Pike and it's components. -static mapping(string:array(string)) copyrights = ([ +protected mapping(string:array(string)) copyrights = ([ "Pike": ({ diff --git a/lib/modules/Tools.pmod/Legal.pmod/License.pmod/GPL.pmod b/lib/modules/Tools.pmod/Legal.pmod/License.pmod/GPL.pmod index 1b4811dda4b93d6399661f0c9643dfbfb836842c..b3c1fc6c174d3defaa7d41c78404df10c52261d1 100644 --- a/lib/modules/Tools.pmod/Legal.pmod/License.pmod/GPL.pmod +++ b/lib/modules/Tools.pmod/Legal.pmod/License.pmod/GPL.pmod @@ -1,9 +1,9 @@ #pike __REAL_VERSION__ -// $Id: GPL.pmod,v 1.2 2002/05/31 22:24:42 nilsson Exp $ +// $Id: GPL.pmod,v 1.3 2008/06/28 16:37:01 nilsson Exp $ -static constant name = "GNU General Public License 2"; -static constant text = #string "gpl.txt"; +protected constant name = "GNU General Public License 2"; +protected constant text = #string "gpl.txt"; string get_name() { return name; diff --git a/lib/modules/Tools.pmod/Legal.pmod/License.pmod/LGPL.pmod b/lib/modules/Tools.pmod/Legal.pmod/License.pmod/LGPL.pmod index e1448634eff7c29352fbebf6a88e9d52cb60b72c..5f74f21df83c9084fb26ea93169a8b4d8f585d8f 100644 --- a/lib/modules/Tools.pmod/Legal.pmod/License.pmod/LGPL.pmod +++ b/lib/modules/Tools.pmod/Legal.pmod/License.pmod/LGPL.pmod @@ -1,8 +1,8 @@ #pike __REAL_VERSION__ -// $Id: LGPL.pmod,v 1.2 2002/05/31 22:24:42 nilsson Exp $ +// $Id: LGPL.pmod,v 1.3 2008/06/28 16:37:01 nilsson Exp $ inherit .GPL; -static constant name = "GNU Lesser General Public License 2.1"; -static constant text = #string "lgpl.txt"; +protected constant name = "GNU Lesser General Public License 2.1"; +protected constant text = #string "lgpl.txt"; diff --git a/lib/modules/Tools.pmod/Legal.pmod/License.pmod/MPL.pmod b/lib/modules/Tools.pmod/Legal.pmod/License.pmod/MPL.pmod index c47bf58cc43906988e08ccd18605721b75931289..0e7a5f1779abdcb501a16b04e7aecc6b6a0f877b 100644 --- a/lib/modules/Tools.pmod/Legal.pmod/License.pmod/MPL.pmod +++ b/lib/modules/Tools.pmod/Legal.pmod/License.pmod/MPL.pmod @@ -1,9 +1,9 @@ #pike __REAL_VERSION__ -// $Id: MPL.pmod,v 1.2 2002/05/31 22:24:42 nilsson Exp $ +// $Id: MPL.pmod,v 1.3 2008/06/28 16:37:02 nilsson Exp $ -static constant name = "Mozilla Public License 1.1"; -static constant text = #string "mpl.txt"; +protected constant name = "Mozilla Public License 1.1"; +protected constant text = #string "mpl.txt"; string get_name() { return name; diff --git a/lib/modules/Tools.pmod/Monger.pmod/MongerDeveloper.pike b/lib/modules/Tools.pmod/Monger.pmod/MongerDeveloper.pike index 4aec82434875441684cf633df7ef420429227b94..206f848aa8c4b0b6cea965d834c131376eef0798 100644 --- a/lib/modules/Tools.pmod/Monger.pmod/MongerDeveloper.pike +++ b/lib/modules/Tools.pmod/Monger.pmod/MongerDeveloper.pike @@ -1,6 +1,6 @@ // -*- Pike -*- -// $Id: MongerDeveloper.pike,v 1.7 2008/06/20 16:24:18 srb Exp $ +// $Id: MongerDeveloper.pike,v 1.8 2008/06/28 16:37:02 nilsson Exp $ #pike __REAL_VERSION__ @@ -454,7 +454,7 @@ class xmlrpc_handler } - static class _caller (string n){ + protected class _caller (string n){ mixed `()(mixed ... args) { diff --git a/lib/modules/Tools.pmod/Monger.pmod/MongerUser.pike b/lib/modules/Tools.pmod/Monger.pmod/MongerUser.pike index 0570533de4008a4cc9d832a3824c3d0f3b825486..91560ebb32cc81a5e1d3a81deae20a2190a71779 100644 --- a/lib/modules/Tools.pmod/Monger.pmod/MongerUser.pike +++ b/lib/modules/Tools.pmod/Monger.pmod/MongerUser.pike @@ -1,6 +1,6 @@ // -*- Pike -*- -// $Id: MongerUser.pike,v 1.7 2008/06/20 16:24:18 srb Exp $ +// $Id: MongerUser.pike,v 1.8 2008/06/28 16:37:02 nilsson Exp $ #pike __REAL_VERSION__ @@ -139,7 +139,7 @@ int main(int argc, array(string) argv) int(0..0) do_help() { write( -# "This is Monger, the manager for Fresh Pike. +#"This is Monger, the manager for Fresh Pike. Usage: pike -x monger [options] modulename @@ -503,7 +503,7 @@ class xmlrpc_handler } - static class _caller (string n){ + protected class _caller (string n){ mixed `()(mixed ... args) { diff --git a/lib/modules/Tools.pmod/Monger.pmod/module.pmod b/lib/modules/Tools.pmod/Monger.pmod/module.pmod index 0ad13aa6097b9b81c08f1eb240e25c708eb3aa9c..a446705b882bd171dbb7d397eacd31dca96a9bde 100644 --- a/lib/modules/Tools.pmod/Monger.pmod/module.pmod +++ b/lib/modules/Tools.pmod/Monger.pmod/module.pmod @@ -1,5 +1,5 @@ #pike __REAL_VERSION__ -static void create() +protected void create() { } diff --git a/lib/modules/Tools.pmod/PEM.pmod b/lib/modules/Tools.pmod/PEM.pmod index 54682a01ebfb1c7e5a078ebb833b666f51d6f711..b10d93d71ec79f7689c6a03e3782945e4eee3130 100644 --- a/lib/modules/Tools.pmod/PEM.pmod +++ b/lib/modules/Tools.pmod/PEM.pmod @@ -8,7 +8,7 @@ // Regexp used to decide if an encapsulated message includes headers // (conforming to rfc 934). -static Regexp.SimpleRegexp rfc822_start_re = Regexp( +protected Regexp.SimpleRegexp rfc822_start_re = Regexp( "^([-a-zA-Z][a-zA-Z0-9]*[ \t]*:|[ \t]*\n\n)"); @@ -17,7 +17,7 @@ static Regexp.SimpleRegexp rfc822_start_re = Regexp( // middle between ---foo --- is at least two characters long. Also // allow a trailing \r or other white space characters. -static Regexp.SimpleRegexp rfc934_eb_re = Regexp( +protected Regexp.SimpleRegexp rfc934_eb_re = Regexp( "^-*[ \r\t]*([^- \r\t]" // First non dash-or-space character ".*[^- \r\t])" // Last non dash-or-space character "[ \r\t]*-*[ \r\t]*$"); // Trailing space, dashes and space @@ -28,11 +28,11 @@ static Regexp.SimpleRegexp rfc934_eb_re = Regexp( // A string of at least two charecters, possibly surrounded by whitespace #define RE "[ \t]*([^ \t].*[^ \t])[ \t]*" -static Regexp.SimpleRegexp begin_pem_re = Regexp("^BEGIN" RE "$"); -static Regexp.SimpleRegexp end_pem_re = Regexp("^END" RE "$"); +protected Regexp.SimpleRegexp begin_pem_re = Regexp("^BEGIN" RE "$"); +protected Regexp.SimpleRegexp end_pem_re = Regexp("^END" RE "$"); // Strip dashes -static string extract_boundary(string s) +protected string extract_boundary(string s) { array(string) a = rfc934_eb_re->split(s); return a && a[0]; @@ -124,7 +124,7 @@ class RFC934 { //! array(EncapsulatedMsg) encapsulated; - static array(string) dash_split(string data) + protected array(string) dash_split(string data) { // Find suspected encapsulation boundaries array(string) parts = data / "\n-"; @@ -135,7 +135,7 @@ class RFC934 { return parts; } - static string dash_stuff(string msg) + protected string dash_stuff(string msg) { array(string) parts = dash_split(msg); @@ -252,7 +252,7 @@ class Msg //! //! @param s //! a string containing a PEM encoded message to be decoded. - static void create(string s) + protected void create(string s) { #ifdef PEM_DEBUG werror("Msg->create(%O)\n", s); @@ -297,7 +297,7 @@ class Msg } } - static string _sprintf(int t) + protected string _sprintf(int t) { return t=='O' && sprintf("%O(%O)", this_program, parts); } diff --git a/lib/modules/Tools.pmod/PV.pike b/lib/modules/Tools.pmod/PV.pike index a36e85abc7b9f70437998d62795472ffd9f7276a..4854947afe6131742802455e0f4878bb9690bb13 100644 --- a/lib/modules/Tools.pmod/PV.pike +++ b/lib/modules/Tools.pmod/PV.pike @@ -21,7 +21,7 @@ enum AlphaMode { #define STEP 30 -static { +protected { GDK.Pixmap pixmap; PVImage old_image; AlphaMode alpha_mode; diff --git a/lib/modules/Tools.pmod/Shoot.pmod/module.pmod b/lib/modules/Tools.pmod/Shoot.pmod/module.pmod index 062c6dcf366df31a08c397110d440eeeb02f7b60..c3dd453c59f42883124b3cd54149ada8ad0fac2e 100644 --- a/lib/modules/Tools.pmod/Shoot.pmod/module.pmod +++ b/lib/modules/Tools.pmod/Shoot.pmod/module.pmod @@ -9,12 +9,12 @@ import "."; -static int procfs=-1; -static Gmp.mpz dummy; // load the Gmp module +protected int procfs=-1; +protected Gmp.mpz dummy; // load the Gmp module // internal to find a pike binary -private static string locate_binary(array path, string name) +private protected string locate_binary(array path, string name) { string dir; object info; @@ -30,7 +30,7 @@ private static string locate_binary(array path, string name) // internal to find/make pike exec arguments -static array runpike= +protected array runpike= lambda() { array res=({master()->_pike_file_name}); diff --git a/lib/modules/Tools.pmod/Standalone.pmod/assemble_autodoc.pike b/lib/modules/Tools.pmod/Standalone.pmod/assemble_autodoc.pike index f113e9cc5de35aee53ee54ff4b0f1897b584090c..691fa1fef9fcf64e05610e446ea2baf5d053b8c4 100644 --- a/lib/modules/Tools.pmod/Standalone.pmod/assemble_autodoc.pike +++ b/lib/modules/Tools.pmod/Standalone.pmod/assemble_autodoc.pike @@ -1,4 +1,4 @@ -// $Id: assemble_autodoc.pike,v 1.34 2008/06/28 15:50:53 nilsson Exp $ +// $Id: assemble_autodoc.pike,v 1.35 2008/06/28 16:37:02 nilsson Exp $ #pike __REAL_VERSION__ @@ -25,7 +25,7 @@ class TocNode { string path; int(1..3) depth; - static void make_children() { + protected void make_children() { if(sizeof(mChildren)) return; foreach(toc, array ent) { string file = ent[1][sizeof(String.common_prefix( ({ path, ent[1] }) ))..]; @@ -131,9 +131,9 @@ class mvEntry { inherit Entry; constant type = "mv"; - static Node parent; + protected Node parent; - static void create(Node target, Node parent) + protected void create(Node target, Node parent) { ::create(target); mvEntry::parent = parent; @@ -153,9 +153,9 @@ class mvPeelEntry { inherit Entry; constant type = "mvPeel"; - static Node parent; + protected Node parent; - static void create(Node target, Node parent) + protected void create(Node target, Node parent) { ::create(target); mvPeelEntry::parent = parent; @@ -357,7 +357,7 @@ Node wrap(Node n, Node wrapper) { return wrapper; } -static void move_items_low(Node n, mapping jobs, void|Node wrapper) { +protected void move_items_low(Node n, mapping jobs, void|Node wrapper) { if(jobs[0]) { if(wrapper) jobs[0]( wrap(n, wrapper->clone()) ); @@ -459,7 +459,7 @@ int(0..1) main(int num, array(string) args) { int T = time(); if(has_value(args, "--version")) - exit(0, "$Id: assemble_autodoc.pike,v 1.34 2008/06/28 15:50:53 nilsson Exp $\n"); + exit(0, "$Id: assemble_autodoc.pike,v 1.35 2008/06/28 16:37:02 nilsson Exp $\n"); if(has_value(args, "--help")) exit(0, "pike -x assemble_autodoc <structure file> <autodoc file>\n"); diff --git a/lib/modules/Tools.pmod/Standalone.pmod/dump.pike b/lib/modules/Tools.pmod/Standalone.pmod/dump.pike index 5487bdf9470e64c01d3330ad701bfcef86e964e7..34ebc1dee0cef7778ebfbbe95471694fd8c73621 100644 --- a/lib/modules/Tools.pmod/Standalone.pmod/dump.pike +++ b/lib/modules/Tools.pmod/Standalone.pmod/dump.pike @@ -6,7 +6,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: dump.pike,v 1.9 2008/04/03 14:54:31 grubba Exp $ +|| $Id: dump.pike,v 1.10 2008/06/28 16:37:02 nilsson Exp $ */ constant description = "Dumps Pike files into object files."; @@ -105,7 +105,7 @@ class MyMaster logmsg_long (describe_backtrace (trace)); } - static void create() + protected void create() { object old_master = master(); ::create(); diff --git a/lib/modules/Tools.pmod/Standalone.pmod/join_autodoc.pike b/lib/modules/Tools.pmod/Standalone.pmod/join_autodoc.pike index 8e082ba31d45a822e1e3e46693c2aaaac0098685..795aabce0745ad57bccd9e6ff8457de58b9a80cc 100644 --- a/lib/modules/Tools.pmod/Standalone.pmod/join_autodoc.pike +++ b/lib/modules/Tools.pmod/Standalone.pmod/join_autodoc.pike @@ -1,5 +1,5 @@ /* - * $Id: join_autodoc.pike,v 1.18 2008/06/28 15:52:10 nilsson Exp $ + * $Id: join_autodoc.pike,v 1.19 2008/06/28 16:37:02 nilsson Exp $ * * AutoDoc mk II join script. * @@ -14,7 +14,7 @@ mapping sub_cache = ([]); int verbosity = 2; -static constant Node = Parser.XML.Tree.SimpleNode; +protected constant Node = Parser.XML.Tree.SimpleNode; int main(int n, array(string) args) { diff --git a/lib/modules/Tools.pmod/Standalone.pmod/pmar_install.pike b/lib/modules/Tools.pmod/Standalone.pmod/pmar_install.pike index 8d2aca24cf2c5f17228df5c23a45ce408811b959..1e4e17ff993ffb960ce8ddd27f008c1530cc8387 100644 --- a/lib/modules/Tools.pmod/Standalone.pmod/pmar_install.pike +++ b/lib/modules/Tools.pmod/Standalone.pmod/pmar_install.pike @@ -272,7 +272,7 @@ mapping get_package_metadata(string s, string fsroot) return metadata; } -static Filesystem.System getfs(string source, string cwd) { +protected Filesystem.System getfs(string source, string cwd) { return Filesystem.Tar(sprintf("%s.tar", "d"), 0, Stdio.FakeFile(source))->cd(cwd); } @@ -316,3 +316,4 @@ int untar(string source, string path, void|string cwd) { return c; } + diff --git a/lib/modules/Tools.pmod/Standalone.pmod/precompile.pike b/lib/modules/Tools.pmod/Standalone.pmod/precompile.pike index 86634411e9861d9d2055903f5bb74f182bebb37d..d035a3715d29f97e4734f52a3dc7e6abaa4de885 100644 --- a/lib/modules/Tools.pmod/Standalone.pmod/precompile.pike +++ b/lib/modules/Tools.pmod/Standalone.pmod/precompile.pike @@ -394,7 +394,7 @@ class PikeType PC.Token t; array(PikeType|string|int) args=({}); - static string fiddle(string name, array(string) tmp) + protected string fiddle(string name, array(string) tmp) { while(sizeof(tmp) > 7) { @@ -413,7 +413,7 @@ class PikeType } } - static array(PikeType) strip_zero_alt() + protected array(PikeType) strip_zero_alt() /* Assumes this is an '|' node. Returns args without any 'zero' * alternatives. */ { diff --git a/lib/modules/Tools.pmod/Standalone.pmod/rsqld.pike b/lib/modules/Tools.pmod/Standalone.pmod/rsqld.pike index 4a0fd7606e9bb19b67617096296ec74db7f2abf5..44ed2a4f4139ee78b7ca1be9e95aa657ccd741d9 100644 --- a/lib/modules/Tools.pmod/Standalone.pmod/rsqld.pike +++ b/lib/modules/Tools.pmod/Standalone.pmod/rsqld.pike @@ -1,5 +1,5 @@ #! /usr/bin/env pike -// $Id: rsqld.pike,v 1.11 2005/08/18 17:42:34 grubba Exp $ +// $Id: rsqld.pike,v 1.12 2008/06/28 16:37:02 nilsson Exp $ #pike __REAL_VERSION__ @@ -11,24 +11,24 @@ constant description = "Implements an rsql daemon."; class Connection { - static object clntsock; - static string got, to_write; - static function ecallback; - static array ecbextra; - static int expected; - static mapping(int:function) commandset = ([]); - static object sqlobj; - static mapping(string:object) queries = ([]); - static int qbase, qid; - static private mapping(string:string) users; - - static void timeout() + protected object clntsock; + protected string got, to_write; + protected function ecallback; + protected array ecbextra; + protected int expected; + protected mapping(int:function) commandset = ([]); + protected object sqlobj; + protected mapping(string:object) queries = ([]); + protected int qbase, qid; + protected private mapping(string:string) users; + + protected void timeout() { destruct(clntsock); destruct(this); } - static void expect(int n, function cb, mixed ... extra) + protected void expect(int n, function cb, mixed ... extra) { remove_call_out(timeout); call_out(timeout, 3600); @@ -37,14 +37,14 @@ class Connection ecbextra = extra; } - static void close_callback() + protected void close_callback() { remove_call_out(timeout); destruct(clntsock); destruct(this); } - static void read_callback(mixed id, string s) + protected void read_callback(mixed id, string s) { if(s) { got += s; @@ -56,7 +56,7 @@ class Connection } } - static void write_callback() + protected void write_callback() { if(sizeof(to_write)) { int n = clntsock->write(to_write); @@ -65,7 +65,7 @@ class Connection } } - static void write(string s) + protected void write(string s) { if(s && sizeof(s)) { to_write += s; @@ -73,7 +73,7 @@ class Connection } } - static void reply_cmd(int cmd, int seq, int err, mixed val) + protected void reply_cmd(int cmd, int seq, int err, mixed val) { string v; if(catch( v = (val? encode_value(val):"") )) { @@ -88,7 +88,7 @@ class Connection write(sprintf("%c<%c>%4c%4c%s", (err? '!':'.'), cmd, seq, sizeof(v), v)); } - static void got_cmd(string a, int cmd, int seq) + protected void got_cmd(string a, int cmd, int seq) { reply_cmd(cmd, seq, 1, catch { mixed arg = sizeof(a) && decode_value(a); @@ -103,7 +103,7 @@ class Connection expect_command(); } - static void got_cmdhead(string h) + protected void got_cmdhead(string h) { if(h[..1]!="?<" || h[3]!='>') { werror("SYNC ERROR, disconnecting client\n"); @@ -117,12 +117,12 @@ class Connection expect(alen, got_cmd, h[2], seq); } - static void expect_command() + protected void expect_command() { expect(12, got_cmdhead); } - static int cmd_login(array(string) userpw) + protected int cmd_login(array(string) userpw) { int authorized = 0; @@ -143,63 +143,63 @@ class Connection return authorized; } - static void cmd_selectdb(string url) + protected void cmd_selectdb(string url) { sqlobj = 0; sqlobj = Sql.Sql(url); } - static int|string cmd_error() + protected int|string cmd_error() { return sqlobj->error(); } - static void cmd_create(string db) + protected void cmd_create(string db) { sqlobj->create_db(db); } - static void cmd_drop(string db) + protected void cmd_drop(string db) { sqlobj->drop_db(db); } - static string cmd_srvinfo() + protected string cmd_srvinfo() { return sqlobj->server_info(); } - static string cmd_hostinfo() + protected string cmd_hostinfo() { return sqlobj->host_info(); } - static void cmd_shutdown() + protected void cmd_shutdown() { sqlobj->shutdown(); } - static void cmd_reload() + protected void cmd_reload() { sqlobj->reload(); } - static array(string) cmd_listdbs(string wild) + protected array(string) cmd_listdbs(string wild) { return sqlobj->list_dbs(wild); } - static array(string) cmd_listtables(string wild) + protected array(string) cmd_listtables(string wild) { return sqlobj->list_tables(wild); } - static array(mapping(string:mixed)) cmd_listflds(array(string) args) + protected array(mapping(string:mixed)) cmd_listflds(array(string) args) { return sqlobj->list_fields(@args); } - static private string make_id() + protected private string make_id() { if(!qid) { qid=1; @@ -208,7 +208,7 @@ class Connection return sprintf("%4c%4c", qbase, qid++); } - static string cmd_bigquery(string q) + protected string cmd_bigquery(string q) { object res = sqlobj->big_query(q); if(!res) @@ -218,63 +218,63 @@ class Connection return qid; } - static void cmd_zapquery(string qid) + protected void cmd_zapquery(string qid) { m_delete(queries, qid); } - static object get_query(string qid) + protected object get_query(string qid) { return queries[qid] || (error("Query ID has expired.\n"),0); } - static array(mapping(string:mixed)) cmd_query(array args) + protected array(mapping(string:mixed)) cmd_query(array args) { return sqlobj->query(@args); } - static int|array(string|int) cmd_fetchrow(string qid) + protected int|array(string|int) cmd_fetchrow(string qid) { return get_query(qid)->fetch_row(); } - static array(mapping(string:mixed)) cmd_fetchfields(string qid) + protected array(mapping(string:mixed)) cmd_fetchfields(string qid) { return get_query(qid)->fetch_fields(); } - static int cmd_numrows(string qid) + protected int cmd_numrows(string qid) { return get_query(qid)->num_rows(); } - static int cmd_numfields(string qid) + protected int cmd_numfields(string qid) { return get_query(qid)->num_fields(); } - static int cmd_eof(string qid) + protected int cmd_eof(string qid) { return get_query(qid)->eof(); } - static void cmd_seek(array(string|int) args) + protected void cmd_seek(array(string|int) args) { get_query(args[0])->seek(args[1]); } - static string cmd_quote(string s) + protected string cmd_quote(string s) { return sqlobj->quote(s); } - static void commandset_0() + protected void commandset_0() { commandset = ([ 'L': cmd_login ]); } - static void commandset_1() + protected void commandset_1() { commandset_0(); commandset |= ([ 'D': cmd_selectdb, 'E': cmd_error, @@ -287,7 +287,7 @@ class Connection 'S': cmd_seek, '@': cmd_query, 'q': cmd_quote]); } - static void client_ident(string s) + protected void client_ident(string s) { int ver; if(s[..3]=="RSQL" && sscanf(s[4..], "%4c", ver) && ver==RSQL_VERSION) { @@ -316,10 +316,10 @@ class Connection class Server { - static object servsock; - static private mapping(string:string) users; + protected object servsock; + protected private mapping(string:string) users; - static void accept_callback() + protected void accept_callback() { object s = servsock->accept(); if(s) diff --git a/lib/modules/Tools.pmod/Standalone.pmod/test_pike.pike b/lib/modules/Tools.pmod/Standalone.pmod/test_pike.pike index 6010ec6f007338a06cd97314239cc8d5c598199d..1c36d4c7ac4994caa4b307a54062e06d8b1479a1 100755 --- a/lib/modules/Tools.pmod/Standalone.pmod/test_pike.pike +++ b/lib/modules/Tools.pmod/Standalone.pmod/test_pike.pike @@ -1,7 +1,7 @@ #! /usr/bin/env pike #pike __REAL_VERSION__ -/* $Id: test_pike.pike,v 1.135 2008/06/16 16:15:41 nilsson Exp $ */ +/* $Id: test_pike.pike,v 1.136 2008/06/28 16:37:02 nilsson Exp $ */ constant description = "Executes tests according to testsuite files."; @@ -184,7 +184,7 @@ class Watchdog int verbose, timeout_phase; int start_time = time(); - static inherit Tools.Testsuite.WatchdogFilterStream; + protected inherit Tools.Testsuite.WatchdogFilterStream; string format_timestamp() { diff --git a/lib/modules/Tools.pmod/Testsuite.pmod b/lib/modules/Tools.pmod/Testsuite.pmod index 28739194e5aa6b778c3c14f05d780fb58be11e54..16783c11d7adee489974a099f5f58b4f7d205323 100644 --- a/lib/modules/Tools.pmod/Testsuite.pmod +++ b/lib/modules/Tools.pmod/Testsuite.pmod @@ -30,8 +30,8 @@ class WatchdogFilterStream // Filter out watchdog commands on the form "WD <cmd>\n", passing // everything else through. { - static array(string) wd_cmds = ({}); - static string cmd_buf; + protected array(string) wd_cmds = ({}); + protected string cmd_buf; string filter (string in) { diff --git a/lib/modules/Tools.pmod/sed.pmod b/lib/modules/Tools.pmod/sed.pmod index 684aa1dd12e385a1f25a0a267fdecda79b0294fd..5c32d1edc574c1fa7d1cecaf4d676cd1e2838aa6 100644 --- a/lib/modules/Tools.pmod/sed.pmod +++ b/lib/modules/Tools.pmod/sed.pmod @@ -31,7 +31,7 @@ //! //! where line is numeral, first 'line'==0 -static array sedreplace(string s,object re,string with, +protected array sedreplace(string s,object re,string with, array whatin,int first,int lastmod, multiset flags) { @@ -83,7 +83,7 @@ static array sedreplace(string s,object re,string with, return ({pr,s}); }; -static array scan_for_linenumber(string cmd, +protected array scan_for_linenumber(string cmd, array(string) in, int n) { diff --git a/lib/modules/Web.pmod/CGI.pmod/Request.pike b/lib/modules/Web.pmod/CGI.pmod/Request.pike index 619d170ddb158d1772669a3773eea419f7db6b4c..32828a8c1d8cd293ace2780dab2064e856077db1 100644 --- a/lib/modules/Web.pmod/CGI.pmod/Request.pike +++ b/lib/modules/Web.pmod/CGI.pmod/Request.pike @@ -6,7 +6,7 @@ #pike __REAL_VERSION__ -static constant http_decode_string = _Roxen.http_decode_string; +protected constant http_decode_string = _Roxen.http_decode_string; //! mapping(string:array(string)) variables = ([ ]); @@ -53,14 +53,14 @@ string prot; //! string method; -static void add_variable(string name, string value) { +protected void add_variable(string name, string value) { if(variables[name]) variables[name] += ({ value }); else variables[name] = ({ value }); } -static void decode_query() { +protected void decode_query() { if(!query) return; foreach(query / "&", string v) { string a, b; @@ -79,7 +79,7 @@ static void decode_query() { rest_query=replace(rest_query, "+", "\0"); /* IDIOTIC STUPID STANDARD */ } -static void decode_cookies(string data) +protected void decode_cookies(string data) { cookies = ([]); foreach(data/";", string c) @@ -98,7 +98,7 @@ static void decode_cookies(string data) } -static void decode_post() +protected void decode_post() { string a, b; if(!data) data=""; @@ -148,7 +148,7 @@ static void decode_post() //! creates the request object. To use, create a Request object while //! running in a CGI environment. Environment variables will be parsed //! and inserted in the appropriate fields of the resulting object. -static void create() +protected void create() { string contents; diff --git a/lib/modules/Web.pmod/Crawler.pmod b/lib/modules/Web.pmod/Crawler.pmod index aada56052baf9891eb4bd0f98e70639843eb4a46..e2b7d39eab673d4ab15c6f3a34c5f9aa9d183ee0 100644 --- a/lib/modules/Web.pmod/Crawler.pmod +++ b/lib/modules/Web.pmod/Crawler.pmod @@ -33,7 +33,7 @@ //! @enddl // Author: Johan Sch�n. -// $Id: Crawler.pmod,v 1.25 2008/01/13 17:03:29 nilsson Exp $ +// $Id: Crawler.pmod,v 1.26 2008/06/28 16:37:02 nilsson Exp $ #define CRAWLER_DEBUG #ifdef CRAWLER_DEBUG @@ -52,12 +52,12 @@ class Stats(int window_width, class FloatingAverage { // Cache - static private int amount; - static private int amount_last_calculated; + protected private int amount; + protected private int amount_last_calculated; - static private int num_slots; + protected private int num_slots; - static private array(int) amount_floating; + protected private array(int) amount_floating; void create(int _window_width, int _granularity) @@ -84,8 +84,8 @@ class Stats(int window_width, } - static private FloatingAverage bps_average = FloatingAverage(10,1); - static private mapping(string:FloatingAverage) host_bps_average; + protected private FloatingAverage bps_average = FloatingAverage(10,1); + protected private mapping(string:FloatingAverage) host_bps_average; int bits_per_second(string|void host) { @@ -100,8 +100,8 @@ class Stats(int window_width, return bps_average->get(); } - static private mapping(string:int) concurrent_fetchers_per_host = ([]); - static private int concurrent_fetchers_total = 0; + protected private mapping(string:int) concurrent_fetchers_per_host = ([]); + protected private int concurrent_fetchers_total = 0; int concurrent_fetchers(void|string host) { @@ -244,7 +244,7 @@ class RegexpRule { inherit Rule; - static private Regexp regexp; + protected private Regexp regexp; //! //! @param re @@ -323,7 +323,7 @@ class MySQLQueue }; } - static int done_uri( string|Standards.URI uri ) + protected int done_uri( string|Standards.URI uri ) { return sizeof(db->query("select done from "+ table+" where done=2 and uri=%s", @@ -331,7 +331,7 @@ class MySQLQueue } mapping hascache = ([]); - static int has_uri( string|Standards.URI uri ) + protected int has_uri( string|Standards.URI uri ) { uri = (string)uri; if( sizeof(hascache) > 100000 ) @@ -341,7 +341,7 @@ class MySQLQueue table+" where uri=%s",uri))); } - static void add_uri( Standards.URI uri ) + protected void add_uri( Standards.URI uri ) { if(check_link(uri, allow, deny) && !has_uri(uri)) { @@ -349,9 +349,9 @@ class MySQLQueue } } - static int empty_count; + protected int empty_count; - static array possible=({}); + protected array possible=({}); int p_c; int|Standards.URI get() { @@ -512,18 +512,18 @@ class ComplexQueue(Stats stats, Policy policy) werror("Queue: %O\n",stats); } - static private ADT.Heap host_heap=ADT.Heap(); - static private mapping(string:URIStack) hosts=([]); + protected private ADT.Heap host_heap=ADT.Heap(); + protected private mapping(string:URIStack) hosts=([]); // One per host - static private class URIStack + protected private class URIStack { inherit ADT.Stack; int last_mod; - static multiset(string) uris_md5=(<>); + protected multiset(string) uris_md5=(<>); int num_active; - static string do_md5(string in) + protected string do_md5(string in) { #if constant(Crypto.MD5) return Crypto.MD5->hash(in); diff --git a/lib/modules/Web.pmod/OWL.pike b/lib/modules/Web.pmod/OWL.pike index afb7b6a6a503ced1281ede3155cd2775857d3980..b6678aa9372b8266e26c5990ea3bd7dfba6dcfaf 100644 --- a/lib/modules/Web.pmod/OWL.pike +++ b/lib/modules/Web.pmod/OWL.pike @@ -1,4 +1,4 @@ -// $Id: OWL.pike,v 1.6 2004/03/09 14:12:30 nilsson Exp $ +// $Id: OWL.pike,v 1.7 2008/06/28 16:37:02 nilsson Exp $ #pike __REAL_VERSION__ #define Node Parser.XML.NSTree.NSNode @@ -52,7 +52,7 @@ void add_Thing(Resource c) add_statement(c, rdf_type, owl_Thing); } -static Resource _add_list(Resource ... list_members) +protected Resource _add_list(Resource ... list_members) { Resource list = rdf_nil; diff --git a/lib/modules/Web.pmod/RDF.pike b/lib/modules/Web.pmod/RDF.pike index 7a3bd59165cfa3034a7f4c1f2c01cc352c1a49e8..863538958644eb35174bd4df9dca7a8dc3a4d7f9 100644 --- a/lib/modules/Web.pmod/RDF.pike +++ b/lib/modules/Web.pmod/RDF.pike @@ -1,4 +1,4 @@ -// $Id: RDF.pike,v 1.46 2005/07/11 18:33:01 nilsson Exp $ +// $Id: RDF.pike,v 1.47 2008/06/28 16:37:02 nilsson Exp $ #pike __REAL_VERSION__ @@ -14,11 +14,11 @@ constant default_ns = ([ "http://www.w3.org/2001/XMLSchema#" : "xsd", ]); -static int(1..) node_counter = 1; -static mapping(string:Resource) uris = ([]); +protected int(1..) node_counter = 1; +protected mapping(string:Resource) uris = ([]); // Returns ({ namespace, object }) -static array(string) uri_parts(string uri) { +protected array(string) uri_parts(string uri) { string obj,ns; if(sscanf(uri, "%s#%s", ns,obj)==2) return ({ ns+"#", obj }); @@ -47,10 +47,10 @@ static array(string) uri_parts(string uri) { //! @seealso //! @[URIResource], @[LiteralResource] class Resource { - static int(1..) number; + protected int(1..) number; constant is_resource = 1; - static void create() { + protected void create() { number = node_counter++; } @@ -64,27 +64,27 @@ class Resource { return "RDF:_"+number; } - static string __sprintf(string c, int t) { + protected string __sprintf(string c, int t) { if(t=='t') return "RDF."+c; if(t=='O') return "RDF."+c+"(" + get_n_triple_name() + ")"; } string _sprintf(int t) { return __sprintf("Resource", t); } - static int __hash() { return number; } + protected int __hash() { return number; } } //! Resource identified by literal. class LiteralResource { inherit Resource; constant is_literal_resource = 1; - static string id; + protected string id; //! Used to contain rdf:datatype value. string datatype; //! The resource will be identified by @[literal]. - static void create(string literal) { + protected void create(string literal) { id = literal; ::create(); } @@ -121,13 +121,13 @@ class LiteralResource { class URIResource { inherit Resource; constant is_uri_resource = 1; - static string id; + protected string id; //! Creates an URI resource with the @[uri] as identifier. //! @throws //! Throws an error if another resource with the //! same URI already exists in the RDF domain. - static void create(string uri) { + protected void create(string uri) { if(uris[uri]) error("A resource with URI %s already exists in the RDF domain.\n", uri); uris[uri] = this; @@ -177,7 +177,7 @@ class RDFResource { inherit URIResource; //! The resource will be identified by the identifier @[rdf_id] - static void create(string rdf_id) { + protected void create(string rdf_id) { ::create(rdf_ns + rdf_id); } @@ -203,7 +203,7 @@ RDFResource rdf_first = RDFResource("first"); //! first resource. RDFResource rdf_rest = RDFResource("rest"); //! rest resource. RDFResource rdf_nil = RDFResource("nil"); //! nil resource. -static int(0..1) is_resource(mixed res) { +protected int(0..1) is_resource(mixed res) { if(!objectp(res)) return 0; return res->is_resource; } @@ -214,7 +214,7 @@ static int(0..1) is_resource(mixed res) { // // predicate : Relation( subject, object ) -static mapping(Resource:ADT.Relation.Binary) statements = ([]); +protected mapping(Resource:ADT.Relation.Binary) statements = ([]); //! Adds a statement to the RDF set. If any argument is a string, it //! will be converted into a @[LiteralResource]. If any argument is a @@ -709,12 +709,12 @@ string encode_n_triple_string(string in) { #define Node Parser.XML.NSTree.NSNode -static int dirty_namespaces = 1; -static mapping(string:string) namespaces = ([]); // url-prefix:name -static string common_ns = ""; // The most common namespace +protected int dirty_namespaces = 1; +protected mapping(string:string) namespaces = ([]); // url-prefix:name +protected string common_ns = ""; // The most common namespace // W3C must die! -static Node add_xml_children(Node p, string base) { +protected Node add_xml_children(Node p, string base) { mapping rdf_m = p->get_ns_attributes(rdf_ns); base = p->get_ns_attributes("xml")->base || base; if(rdf_m->about && rdf_m->ID) @@ -877,7 +877,7 @@ this_program parse_xml(string|Node in, void|string base) { return this; } -static void fix_namespaces() { +protected void fix_namespaces() { if(!dirty_namespaces) return; mapping(string:string) new = ([]); mapping(string:int) stat = ([]); @@ -910,7 +910,7 @@ static void fix_namespaces() { dirty_namespaces = 0; } -static class XML { +protected class XML { String.Buffer buf = String.Buffer(); mapping subjects = get_subject_map(); @@ -1097,19 +1097,19 @@ string get_xml(void|int no_optimize) { // //! Returns the number of statements in the RDF domain. -static int _sizeof() { +protected int _sizeof() { if(!sizeof(statements)) return 0; return `+( @sizeof(values(statements)[*]) ); } -static string _sprintf(int t) { +protected string _sprintf(int t) { return t=='O' && sprintf("%O(%d)", this_program, _sizeof()); } //! @decl Web.RDF `|(Web.RDF x) //! Modifies the current object to create a union of the current object //! and the object @[x]. -static this_program `|(mixed data) { +protected this_program `|(mixed data) { if(sprintf("%t", data)!="object" || !functionp(data->find_statements)) error("Can only OR an RDF object with another RDF object.\n"); diff --git a/lib/modules/Web.pmod/RSS.pmod b/lib/modules/Web.pmod/RSS.pmod index 269f8c38c0b6c9e1715d0b02afcb0fade4bb5dd1..cea1615eb5a8ec571c6d20f250bf99dff6a1bdb7 100644 --- a/lib/modules/Web.pmod/RSS.pmod +++ b/lib/modules/Web.pmod/RSS.pmod @@ -1,15 +1,15 @@ -// $Id: RSS.pmod,v 1.6 2003/12/15 22:28:53 nilsson Exp $ +// $Id: RSS.pmod,v 1.7 2008/06/28 16:37:02 nilsson Exp $ #pike __REAL_VERSION__ //! Represents a RSS (RDF Site Summary) file. -static constant ns = "http://purl.org/rss/1.0/"; +protected constant ns = "http://purl.org/rss/1.0/"; //! The base class for the RSS resources. -static class Thing { - static .RDF rdf; - static mapping /* (string:string|Standards.URI) */ attributes = ([]); +protected class Thing { + protected .RDF rdf; + protected mapping /* (string:string|Standards.URI) */ attributes = ([]); .RDF.Resource me; constant thing = ""; @@ -46,7 +46,7 @@ static class Thing { create2(a); } - static void create1(string about, mapping _attr) { + protected void create1(string about, mapping _attr) { me = rdf->make_resource(about); foreach(indices(attributes), string i) { string|Standards.URI v = _attr[i]; @@ -62,7 +62,7 @@ static class Thing { } } - static void create2(.RDF.Resource _me) { + protected void create2(.RDF.Resource _me) { me = _me; foreach(rdf->find_statements(me,0,0), array r) { .RDF.Resource pred = r[1]; @@ -85,7 +85,7 @@ static class Thing { //! Returns the @[RDF.Resource] that identifies this RSS resource. .RDF.Resource get_id() { return me; } - static string _sprintf(int t) { + protected string _sprintf(int t) { if(t!='O') return UNDEFINED; mapping x = ([]); foreach(attributes; string index; mixed value) @@ -98,7 +98,7 @@ static class Thing { class Image { inherit Thing; constant thing = "image"; - static mapping(string:string|Standards.URI) attributes = ([ + protected mapping(string:string|Standards.URI) attributes = ([ "title" : 0, "url" : 0, "link" : 0 @@ -113,7 +113,7 @@ class Image { class Item { inherit Thing; constant thing = "item"; - static mapping(string:string|Standards.URI) attributes = ([ + protected mapping(string:string|Standards.URI) attributes = ([ "title" : 0, "link" : 0, "description" : 0 @@ -128,7 +128,7 @@ class Item { class Textinput { inherit Thing; constant thing = "textinput"; - static mapping(string:string|Standards.URI) attributes = ([ + protected mapping(string:string|Standards.URI) attributes = ([ "title" : 0, "description" : 0, "name" : 0, @@ -144,8 +144,8 @@ class Textinput { //! Represents an RSS channel. class Channel { inherit Thing; - static constant thing = "channel"; - static mapping attributes = ([ + protected constant thing = "channel"; + protected mapping attributes = ([ "title" : 0, "link" : 0, "description" : 0, @@ -248,3 +248,4 @@ Index parse_xml(string|Parser.XML.Tree.Node n, void|string base) { return Index(rdf); } + diff --git a/lib/modules/Yabu.pmod/module.pmod b/lib/modules/Yabu.pmod/module.pmod index 9f08c6b963ea6ea2f0fb47a0c0becb0f9bf16f0f..5ec8242037491457edfec0c86dcfbdaa0046bc26 100644 --- a/lib/modules/Yabu.pmod/module.pmod +++ b/lib/modules/Yabu.pmod/module.pmod @@ -6,7 +6,7 @@ #pike __REAL_VERSION__ -constant cvs_id = "$Id: module.pmod,v 1.29 2007/03/06 13:05:45 mast Exp $"; +constant cvs_id = "$Id: module.pmod,v 1.30 2008/06/28 16:37:03 nilsson Exp $"; #define ERR(msg) error( "(Yabu) "+msg+"\n" ) #define IO_ERR(msg) error( "(Yabu) %s, %s (%d)\n",msg,strerror(errno()),errno() ) @@ -40,11 +40,11 @@ constant cvs_id = "$Id: module.pmod,v 1.29 2007/03/06 13:05:45 mast Exp $"; * * ProcessLock will throw an error if the lock could not be obtained. */ -static private class ProcessLock { - static private string lock_file; - static private int have_lock = 0; +protected private class ProcessLock { + protected private string lock_file; + protected private int have_lock = 0; - static private int get_locked_pid() + protected private int get_locked_pid() { return (int) (Stdio.read_file(lock_file)||"0"); } @@ -131,14 +131,14 @@ class YabuLog { * FileIO handles all basic file operations in Yabu. * */ -static private class FileIO { +protected private class FileIO { INHERIT_MUTEX - static private inherit Stdio.File:file; - static private string filename, filemode; + protected private inherit Stdio.File:file; + protected private string filename, filemode; - static private int mask = 0; + protected private int mask = 0; - static private void seek(int offset) + protected private void seek(int offset) { if(offset < 0 || file::seek(offset) == -1) ERR("seek failed"); @@ -207,26 +207,26 @@ static private class FileIO { */ class Chunk { INHERIT_MUTEX - static private inherit FileIO:file; + protected private inherit FileIO:file; - static private object parent; - static private int magic, compress, write; - static private string start_time, filename; + protected private object parent; + protected private int magic, compress, write; + protected private string start_time, filename; /* Point in file from which new chunks can be allocated. */ - static private int eof = 0; + protected private int eof = 0; - static private mapping frees = ([]), keys = ([]); + protected private mapping frees = ([]), keys = ([]); /* Escape special characters used for synchronizing * the contents of Yabu files. */ - static private string escape(string s) + protected private string escape(string s) { return replace(s, ({ "\n", "%" }), ({ "%n", "%p" })); } - static private string descape(string s) + protected private string descape(string s) { return replace(s, ({ "%n", "%p" }), ({ "\n", "%" })); } @@ -234,7 +234,7 @@ class Chunk { /* * Encode/decode Yabu numbers (8 digit hex numbers). */ - static private string encode_num(int x) + protected private string encode_num(int x) { string s = sprintf("%08x", x); if(sizeof(s) != 8) @@ -242,7 +242,7 @@ class Chunk { return s; } - static private int decode_num(string s, int offset) + protected private int decode_num(string s, int offset) { int x; if(sizeof(s) < offset+8) @@ -255,7 +255,7 @@ class Chunk { /* * Encode/decode Yabu keys. */ - static private string encode_key(int offset, int type) + protected private string encode_key(int offset, int type) { return encode_num(offset)+":"+encode_num(type); } @@ -267,7 +267,7 @@ class Chunk { /* This magic string of characters surrounds all chunk in order to * check if the same magic appears on both sides of the chunk contents. */ - static private string next_magic() + protected private string next_magic() { return start_time + encode_num(magic++); } @@ -275,14 +275,14 @@ class Chunk { /* The chunk block allocation policy. By using fixed chunk sizes, reuse * of empty chunks is encouraged. */ - static private int find_nearest_2x(int num) + protected private int find_nearest_2x(int num) { for(int b=4;b<30;b++) if((1<<b) >= num) return (1<<b); ERR("Chunk too large (max 1 gigabyte)"); } /* Generate the null chuck, which is the same as the empty chunk. */ - static private mapping null_chunk(int t) + protected private mapping null_chunk(int t) { string entry = ""; string magic = next_magic(); @@ -297,7 +297,7 @@ class Chunk { /* * Encode/decode chunks. */ - static private mapping encode_chunk(mixed x) + protected private mapping encode_chunk(mixed x) { string entry = encode_value(x); #if constant(Gz.inflate) @@ -316,7 +316,7 @@ class Chunk { return ([ "type":t, "entry":entry ]); } - static private mapping decode_chunk(string chunk) + protected private mapping decode_chunk(string chunk) { mapping m = ([]); @@ -351,7 +351,7 @@ class Chunk { } /* Allocate chunks by reuse or from to the end of the file. */ - static private int allocate_chunk(int type, mapping m) + protected private int allocate_chunk(int type, mapping m) { array f; if(f = frees[type]) { @@ -369,7 +369,7 @@ class Chunk { } /* Perform consistency check. Returns 0 for failure, otherwise success. */ - static private int consistency() + protected private int consistency() { multiset k = mkmultiset(indices(keys)); foreach(indices(frees), int type) @@ -557,8 +557,8 @@ class Chunk { * */ class Transaction { - static private int id; - static private object table, keep_ref; + protected private int id; + protected private object table, keep_ref; void sync() { @@ -639,14 +639,14 @@ class Transaction { */ class Table { INHERIT_MUTEX - static private object index, db, lock_file; + protected private object index, db, lock_file; - static private string mode, filename; - static private mapping handles, changes; - static private mapping t_start, t_changes, t_handles, t_deleted; - static private int sync_timeout, write, dirty, magic, id = 0x314159; + protected private string mode, filename; + protected private mapping handles, changes; + protected private mapping t_start, t_changes, t_handles, t_deleted; + protected private int sync_timeout, write, dirty, magic, id = 0x314159; - static private void modified() + protected private void modified() { dirty++; if(sync_timeout && dirty >= sync_timeout) @@ -728,12 +728,12 @@ class Table { UNLOCK(); } - static private int next_magic() + protected private int next_magic() { return magic++; } - static private mixed _set(string handle, mixed x, mapping handles) + protected private mixed _set(string handle, mixed x, mapping handles) { if(!write) ERR("Cannot set in read mode"); @@ -742,7 +742,7 @@ class Table { return x; } - static private mixed _get(string handle, mapping handles) + protected private mixed _get(string handle, mapping handles) { return handles[handle]?db->get(handles[handle])->entry:0; } @@ -1026,9 +1026,9 @@ class Table { * */ class _Table { - static object table; - static string handle; - static function table_destroyed; + protected object table; + protected string handle; + protected function table_destroyed; void sync() { @@ -1104,12 +1104,12 @@ class _Table { /* * Compile table statistics. */ - static private string st_keys(int size, mapping m) + protected private string st_keys(int size, mapping m) { return sprintf("%4d", size); } - static private string st_size(int size, mapping m) + protected private string st_size(int size, mapping m) { return sprintf("%7.3f Mb", (float)size/(1024.0*1024.0)); @@ -1121,7 +1121,7 @@ class _Table { return sprintf("%s %s", r, ([ 1:"Kb", 2:"Mb", 3:"Gb" ])[e]||"b "); } - static private string st_used(int used, mapping m) + protected private string st_used(int used, mapping m) { return sprintf("%3d %%", (int) (100.0*(float)used/(float)m->size)); } @@ -1164,10 +1164,10 @@ class _Table { class db { INHERIT_MUTEX - static string dir, mode; - static mapping tables = ([]), table_refs = ([]); - static int write, id; - static object lock_file; + protected string dir, mode; + protected mapping tables = ([]), table_refs = ([]); + protected int write, id; + protected object lock_file; void sync() { @@ -1178,7 +1178,7 @@ class db { UNLOCK(); } - static void _table_destroyed(string handle) + protected void _table_destroyed(string handle) { LOCK(); table_refs[handle]--; @@ -1231,7 +1231,7 @@ class db { } /* Remove maximum one level of directories and files. */ - static private void level2_rm(string f) + protected private void level2_rm(string f) { if(has_suffix(f, "/")) f = f[..sizeof(f)-2]; @@ -1252,7 +1252,7 @@ class db { UNLOCK(); } - static void mkdirhier(string from) + protected void mkdirhier(string from) { string a, b; array f; @@ -1331,10 +1331,10 @@ class db { class LookupTable { INHERIT_MUTEX - static private int minx; - static private object table; + protected private int minx; + protected private object table; - static private string h(string s) + protected private string h(string s) { return (string)(hash(s) & minx); } @@ -1395,7 +1395,7 @@ class LookupTable { */ class lookup { inherit db; - static private int minx; + protected private int minx; object table(string handle) { diff --git a/lib/modules/_Image.pmod/Dims.pmod b/lib/modules/_Image.pmod/Dims.pmod index 12d262a9049ae1f6ec7f96d3ad774994c5224dfe..a5fc4aee5ba15fe44f6be06d7419ffb58d23afc3 100644 --- a/lib/modules/_Image.pmod/Dims.pmod +++ b/lib/modules/_Image.pmod/Dims.pmod @@ -1,6 +1,6 @@ #pike __REAL_VERSION__ -// $Id: Dims.pmod,v 1.9 2006/09/13 16:05:43 tor Exp $ +// $Id: Dims.pmod,v 1.10 2008/06/28 16:37:03 nilsson Exp $ // // Imagedimensionreadermodule for Pike. // Created by Johan Sch�n, <js@roxen.com>. @@ -29,19 +29,19 @@ #define M_SOS 0xDA /* Start Of Scan (begins compressed data) */ #define M_COM 0xFE /* COMment */ -static int(0..255) read_1_byte(Stdio.File f) +protected int(0..255) read_1_byte(Stdio.File f) { return f->read(1)[0]; } -static int(0..65535) read_2_bytes(Stdio.File f) +protected int(0..65535) read_2_bytes(Stdio.File f) { int c; sscanf( f->read(2), "%2c", c ); return c; } -static int(0..65535) read_2_bytes_intel(Stdio.File f) +protected int(0..65535) read_2_bytes_intel(Stdio.File f) { int c; sscanf( f->read(2), "%-2c", c); @@ -57,7 +57,7 @@ static int(0..65535) read_2_bytes_intel(Stdio.File f) * file and then return a misleading error message... */ -static int first_marker(Stdio.File f) +protected int first_marker(Stdio.File f) { int c1, c2; @@ -76,7 +76,7 @@ static int first_marker(Stdio.File f) * not deal correctly with FF/00 sequences in the compressed image data... */ -static int next_marker(Stdio.File f) +protected int next_marker(Stdio.File f) { // Find 0xFF byte; count and skip any non-FFs. int c = read_1_byte(f); @@ -92,7 +92,7 @@ static int next_marker(Stdio.File f) } /* Skip over an unknown or uninteresting variable-length marker */ -static int skip_variable(Stdio.File f) +protected int skip_variable(Stdio.File f) { int length = read_2_bytes(f); if (length < 2) return 0; // Length includes itself, so must be at least 2. diff --git a/lib/modules/_Image.pmod/Fonts.pmod b/lib/modules/_Image.pmod/Fonts.pmod index 10387b88554cbf9d90ee6bcb2eeb844e31f3cd3b..c271cfe8facd28915f2dac4e1e81785e3192890d 100644 --- a/lib/modules/_Image.pmod/Fonts.pmod +++ b/lib/modules/_Image.pmod/Fonts.pmod @@ -24,9 +24,9 @@ class FTFont Thread.Mutex lock = Thread.Mutex(); Image.FreeType.Face face; - static int size; - static int xspacing; - static int line_height; + protected int size; + protected int xspacing; + protected int line_height; mapping(string:mixed) info() { @@ -52,7 +52,7 @@ class FTFont return line_height; } - static mixed do_write_char( int c ) + protected mixed do_write_char( int c ) { catch{ return face->write_char( c ); @@ -60,7 +60,7 @@ class FTFont return 0; } - static Image.Image write_row( string text ) + protected Image.Image write_row( string text ) { Image.Image res; int xp, ys; @@ -164,10 +164,10 @@ class TTFont { constant driver = "FreeType 1"; - static object real; - static int size; + protected object real; + protected int size; - static int translate_ttf_style( string style ) + protected int translate_ttf_style( string style ) { switch( lower_case( (style-"-")-" " ) ) { @@ -238,25 +238,25 @@ class TTFont #endif -class Font( static string file, - static int size ) +class Font( protected string file, + protected int size ) //! The abstract Font class. The @[file] is a valid font-file, @[size] //! is in pixels, but the size of the characters to be rendered, not //! the height of the finished image (the image is generally speaking //! bigger then the size of the characters). { object font; - static object codec; + protected object codec; - static int fake_bold; - static int fake_italic; + protected int fake_bold; + protected int fake_italic; string _sprintf(int t) { return t=='O' && sprintf("%O(%O, %d)", this_program, file, size); } - static void open_font( ) + protected void open_font( ) { switch( file ) { @@ -294,7 +294,7 @@ class Font( static string file, } } - static Image.Image post_process( Image.Image rr ) + protected Image.Image post_process( Image.Image rr ) { if( fake_bold > 0 ) { @@ -373,10 +373,10 @@ class Font( static string file, } } -static mapping fontlist = ([]); -static array font_dirs = ({}); +protected mapping fontlist = ([]); +protected array font_dirs = ({}); -static void rescan_fontlist() +protected void rescan_fontlist() { fontlist = ([]); foreach( font_dirs, string f ) diff --git a/lib/modules/_Image.pmod/module.pmod b/lib/modules/_Image.pmod/module.pmod index 6517c4eed93765367b5c221853c4571c81c97375..084dd8d775956c1eae24a0e68a498d2ed4d6299d 100644 --- a/lib/modules/_Image.pmod/module.pmod +++ b/lib/modules/_Image.pmod/module.pmod @@ -1,8 +1,8 @@ #pike __REAL_VERSION__ -// $Id: module.pmod,v 1.46 2008/01/04 11:51:38 grubba Exp $ +// $Id: module.pmod,v 1.47 2008/06/28 16:37:03 nilsson Exp $ -static constant fmts = ([ +protected constant fmts = ([ "image/x-pnm" : "PNM", "image/jpeg" : "JPEG", "image/x-gimp-image" : "XCF", diff --git a/lib/modules/_Image_DWG.pmod b/lib/modules/_Image_DWG.pmod index 48a3412e0ec805a72bcd9e99652ba2aa07f5c5c9..c14211c1812a544c15d91df4f9c0f0eae0dc31fa 100644 --- a/lib/modules/_Image_DWG.pmod +++ b/lib/modules/_Image_DWG.pmod @@ -1,5 +1,5 @@ // AutoCAD R13/R14/R2000 DWG file decoder -// $Id: _Image_DWG.pmod,v 1.4 2004/03/01 22:28:23 nilsson Exp $ +// $Id: _Image_DWG.pmod,v 1.5 2008/06/28 16:36:53 nilsson Exp $ #pike __REAL_VERSION__ @@ -9,9 +9,9 @@ //! equals to file version 12, 14 and 15). Implemented according to //! specifications from @url{http://www.opendwg.org/@}. -static constant start = "\x1F\x25\x6D\x07\xD4\x36\x28\x28\x9D\x57\xCA\x3F\x9D\x44\x10\x2B"; +protected constant start = "\x1F\x25\x6D\x07\xD4\x36\x28\x28\x9D\x57\xCA\x3F\x9D\x44\x10\x2B"; -static inline int read_RL(string data, int pos) { +protected inline int read_RL(string data, int pos) { int r; sscanf(data[pos..pos+3], "%-4c", r); return r; @@ -97,7 +97,7 @@ mapping __decode(string data) { "wmf" : wmfs ]); } -static Image.Image get_first_image( mapping data ) { +protected Image.Image get_first_image( mapping data ) { if( !sizeof(data->bmp) ) error("No bitmap previews available.\n"); foreach(data->bmp, string bmp) { diff --git a/lib/modules/_Image_PS.pmod b/lib/modules/_Image_PS.pmod index 7684409c978a11eb0115aebc1cb74d5dff4d3e03..8feae553ab6cf0e9ac25745ba16d1a358e2a1014 100644 --- a/lib/modules/_Image_PS.pmod +++ b/lib/modules/_Image_PS.pmod @@ -4,7 +4,7 @@ //! Codec for the Adobe page description language PostScript. //! Uses Ghostscript for decoding or built-in support. -static string find_in_path( string file ) +protected string find_in_path( string file ) { string path=getenv("PATH"); foreach(path ? path/":" : ({}) , path) diff --git a/lib/modules/_Image_XCF.pmod b/lib/modules/_Image_XCF.pmod index cf128d7ff583f04c7d74460aed28726982cea820..b1fdf8eb4c9ecb84a2f485919e7c4f763773c2cc 100644 --- a/lib/modules/_Image_XCF.pmod +++ b/lib/modules/_Image_XCF.pmod @@ -230,7 +230,7 @@ class GimpImage Channel selection; - static string read_point_bz1( string data, Path path ) + protected string read_point_bz1( string data, Path path ) { object p = PathPoint( ); int x, y; @@ -242,14 +242,14 @@ class GimpImage return data; } - static string read_point_bz2( string data, Path path ) + protected string read_point_bz2( string data, Path path ) { object p = PathPoint( ); sscanf(data, "%4c%4F%4F%s", p->type, p->x, p->y, data); return data; } - static string decode_one_path( string data, Path path ) + protected string decode_one_path( string data, Path path ) { int nlen, version, num_points; sscanf(data, "%4c", nlen ); @@ -615,7 +615,7 @@ object decode( string what,mapping|void opts ) #define UINT(X) sprintf("%4c", (X)) #define STRING(X) sprintf("%4c%s\0", sizeof(X)+1, (X)) -static string make_hiearchy(Image.Image img) { +protected string make_hiearchy(Image.Image img) { string data = ""; data += UINT(img->xsize()); data += UINT(img->ysize()); @@ -634,7 +634,7 @@ static string make_hiearchy(Image.Image img) { return data; } -static int make_mode(string mode) { +protected int make_mode(string mode) { switch(mode) { case "normal": return NORMAL_MODE; } @@ -642,7 +642,7 @@ static int make_mode(string mode) { return NORMAL_MODE; } -static string make_layer(Image.Image|Image.Layer img) { +protected string make_layer(Image.Image|Image.Layer img) { string data = ""; data += UINT(img->xsize()); data += UINT(img->ysize()); @@ -738,3 +738,4 @@ string encode(Image.Image img) { } #endif +