Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2004, Roxen IS.   //   // The Roxen WebServer main program.   //   // Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.   // ABS and suicide systems contributed freely by Francesco Chemolli    - constant cvs_version="$Id: roxen.pike,v 1.994 2008/09/30 12:25:13 mast Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.995 2008/10/02 18:27:02 mast Exp $";      //! @appears roxen   //!   //! The Roxen WebServer main program.      // The argument cache. Used by the image cache.   ArgCache argcache;      // Some headerfiles   #define IN_ROXEN
Roxen.git/server/base_server/roxen.pike:83:   {    return Gmp.mpz(Crypto.MD5()->update( what )->digest(),256)    ->digits(32);   }      string query_configuration_dir()   {    return configuration_dir;   }    - string filename( program|object o ) + array(string|int) filename_2 (program|object o)   {    if( objectp( o ) )    o = object_program( o );    -  string fname = master()->program_name( o ); -  if( !fname ) -  fname = "Unknown Program"; -  return fname-(getcwd()+"/"); +  string fname = Program.defined (o); +  int line; +  if (fname) { +  array(string) p = fname / ":"; +  if (sizeof (p) > 1 && p[-1] != "" && sscanf (p[-1], "%d%*c", int l) == 1) { +  fname = p[..<1] * ":"; +  line = l;    } -  +  }    -  +  else if( !fname ) { +  fname = master()->program_name( o ); +  if (!fname) +  return ({0, 0}); +  } +  +  string cwd = getcwd() + "/"; +  if (has_prefix (fname, cwd)) +  fname = fname[sizeof (cwd)..]; +  +  return ({fname, line}); + } +  + string filename( program|object o ) + { +  [string fname, int line] = filename_2 (o); +  return fname || "(unknown program)"; + } +    protected int once_mode;      // Note that 2.5 is a nonexisting version. It's only used for the   // cache static optimization for tags such as <if> and <emit> inside   // <cache> since that optimization can give tricky incompatibilities   // with 2.4.   array(string) compat_levels = ({"2.1", "2.2", "2.4", "2.5",    "3.3", "3.4",    "4.0", "4.5", "5.0"});