Roxen.git / server / etc / roxen_master.pike

version» Context lines:

Roxen.git/server/etc/roxen_master.pike:3:      mixed sql_query( string q, mixed ... e )   {    return connect_to_my_mysql( 0, "local" )->query( q, @e );   }      /*    * Roxen's customized master.    */    - constant cvs_version = "$Id: roxen_master.pike,v 1.156 2012/02/18 01:12:14 mast Exp $"; + constant cvs_version = "$Id$";      // Disable the precompiled file is out of date warning.   constant out_of_date_warning = 0;      #if !constant(PIKE_MODULE_RELOC)   #define relocate_module(x) (x)   #define unrelocate_module(x) (x)   #endif      protected string _sprintf (int flag)
Roxen.git/server/etc/roxen_master.pike:695:    has_set_on_load[ f ] = cb;   }      program low_findprog(string pname, string ext,    object|void handler, void|int mkobj)   {    program ret;    Stat s;    string fname=pname+ext;    -  object key; -  mixed err = catch { -  key=compilation_mutex->lock(2); -  }; -  if (err && -  // Ugly kludge to ignore the error we can get if we're being -  // called from within the compiler, which uses _disable_threads. -  !has_value (describe_error (err), -  "Cannot wait for mutexes when threads are disabled")) { -  werror( "low_findprog: Caught spurious error:\n" -  "%s\n", describe_backtrace(err) ); -  } -  +    #if constant(PIKE_MODULE_RELOC)    fname = unrelocate_module(fname);   #endif      #if 0    // No idea what this is supposed to accomplish, but the effect is    // that the ErrorContainer can be stored as handler in dirnodes and    // receive error messages long after the function that installed it    // have checked for error messages and forgotten about it. /mast    if( !handler ) handler = get_inhibit_compile_errors();
Roxen.git/server/etc/roxen_master.pike:845:    ret=load_module(relocate_module(fname));   #endif    }    program_names[ret] = fname;    if( !ret ) m_delete (load_time, fname);    return programs[fname] = ret;    }    return 0;   }    - program handle_inherit (string pname, string current_file, object|void handler) + program cast_to_program(string pname, string current_file, object|void handler)   { -  if (has_prefix (pname, "roxen-module://")) { -  pname = pname[sizeof ("roxen-module://")..]; -  if (object modinfo = roxenp()->find_module (pname)) -  if (program ret = cast_to_program (modinfo->filename, current_file, handler)) -  return ret; -  return 0; -  } -  if (has_prefix(pname, "roxen-path://")) { +  if (has_prefix(pname, "roxen-module://")) { +  pname = pname[sizeof("roxen-module://")..]; +  object modinfo = roxenp()->find_module(pname); +  if (!modinfo) return 0; +  pname = modinfo->filename; +  } else if (has_prefix(pname, "roxen-path://")) {    // Expand variables such as $SERVERDIR and $LOCALDIR if we have    // roxen_path() available.    pname = pname[sizeof("roxen-path://")..]; -  if (function roxen_path_fn = all_constants()["roxen_path"]) { +  function roxen_path_fn = all_constants()["roxen_path"]; +  if (!roxen_path_fn) return 0;    pname = roxen_path_fn(pname);    } -  +  +  return ::cast_to_program(pname, current_file, handler);   } -  return ::handle_inherit (pname, current_file, handler); - } +       void handle_error(array(mixed)|object trace)   {    werror ("Internal server error: ");    ::handle_error (trace);   }      void compile_warning(string file,int line,string err)   {    if (!line) {
Roxen.git/server/etc/roxen_master.pike:984:    if (rev_programs && (rev_programs[programs[name]] == name)) {    m_delete(rev_programs, programs[name]);    }    m_delete(programs, name);    }    string t = programs_reverse_lookup(p);    load_time[name] = t?load_time[t]:time(1);    programs[name] = p;   }    - #if 0 -  - class Describer - { -  inherit master::Describer; -  -  string describe_string (string m, int maxlen) -  { -  canclip++; -  if(sizeof(m) < 40) -  return sprintf("%O", m);; -  clipped++; -  return sprintf("%O+[%d]+%O",m[..15],sizeof(m)-(32),m[sizeof(m)-16..]); -  } -  -  string describe_array (array m, int maxlen) -  { -  if(!sizeof(m)) return "({})"; -  return "({" + describe_comma_list(m,maxlen-2) +"})"; -  } - } -  +    constant bt_max_string_len = 99999999; - int long_file_names; +       string describe_backtrace(mixed trace, void|int linewidth)   {    return predef::describe_backtrace(trace, 999999);   }    - #endif -  +    void create()   {    object o = this_object();    /* Copy variables from the original master */    foreach(indices(mm), string varname) {    catch(o[varname] = mm[varname]);    /* Ignore errors when copying functions */    }       init_security();