pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1:   // -*- Pike -*-   //   // Master Control Program for Pike.   //   // 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: master.pike.in,v 1.330 2004/01/12 23:17:02 nilsson Exp $ + // $Id: master.pike.in,v 1.331 2004/01/12 23:37:07 nilsson Exp $      #pike __REAL_VERSION__      // Some programs destroys character pairs beginning with the currency   // symbol when running in chinese locale.   #if "ยค/" != "\244/"   #error "master.pike.in is corrupted."   #endif      // --- Some configurable parameters
pike.git/lib/master.pike.in:297:   int autoreload_on;   int newest;      #define AUTORELOAD_CHECK_FILE(X) \    if(autoreload_on) if(Stat s=master_file_stat(X)) if(s->mtime>newest) newest=[int]s->mtime;      #define AUTORELOAD_BEGIN() \    int ___newest=newest; \    newest=0    -  +    #define AUTORELOAD_FINISH(VAR, CACHE, FILE) \    if(autoreload_on) { \    mixed val = CACHE[FILE]; \    if(!zero_type (val) && val != no_value && newest <= load_time[FILE]) { \    VAR = val; \    } \    } \    load_time[FILE]=time(); \    if(___newest > newest) newest=___newest;   
pike.git/lib/master.pike.in:2754:    }   }         static object _charset_mod;      //! This function is called by cpp() when it wants to do   //! character code conversion.   string decode_charset(string data, string charset)   { -  // werror("decode_charset(%O, %O)\n", data, charset); -  +     if (!_charset_mod) {    object mod = [object]resolv("Locale");       _charset_mod = [object](mod && mod["Charset"]);    if (!_charset_mod)    compile_cb_error ("Cannot handle charset - no Locale.Charset module found.");    }    -  +     if (mixed err = catch {    object decoder = ([function(string:object)]_charset_mod->decoder)(charset);    return ([function(void:string)]([function(string:object)]decoder->    feed)(data)->drain)();    })    compile_cb_rethrow (err);   }       -  +    class Describer   {    int clipped=0;    int canclip=0;    mapping(mixed:int|string) ident = ([]);    int identcount = 0;       void identify_parts (mixed stuff)    {    // Use an array as stack here instead of recursing directly; we
pike.git/lib/master.pike.in:2805:    identify_stack += stuff;    }    else if (multisetp (stuff)) {    if (!ident[stuff]++)    identify_stack += indices([multiset]stuff);    }    else if (mappingp (stuff)) {    if (!ident[stuff]++)    identify_stack += indices([mapping]stuff) + values([mapping]stuff);    } -  +     }    }       string describe_string (string m, int maxlen)    {    canclip++;    if(sizeof(m) < maxlen)    {    string t = sprintf("%O", m); -  if (sizeof(t) < (maxlen + 2)) { +  if (sizeof(t) < (maxlen + 2))    return t; -  } +     t = 0;    }    clipped++;    if(maxlen>10) -  { +     return sprintf("%O+[%d]",m[..maxlen-5],sizeof(m)-(maxlen-5)); -  }else{ +     return "string["+sizeof(m)+"]";    } -  } +        string describe_array (array m, int maxlen)    {    if(!sizeof(m)) return "({})";    else {    if(maxlen<5)    {    clipped++;    return "array["+sizeof(m)+"]";    }