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.316 2003/12/18 22:39:35 marcus Exp $ + // $Id: master.pike.in,v 1.317 2003/12/18 23:00:35 marcus 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:243:   //! <r><c>dirname("/a")</c><c>"/"</c></r>   //! <r><c>dirname("/")</c><c>"/"</c></r>   //! <r><c>dirname("")</c><c>""</c></r>   //! </matrix>@}   //!   //! @seealso   //! @[basename()], @[explode_path()]   string dirname(string x)   {    if(x=="") return ""; + #ifdef __amigaos__ +  array(string) tmp=x/":"; +  array(string) tmp2=tmp[-1]/"/"; +  tmp[-1]=tmp2[..sizeof(tmp2)-2]*"/"; +  return tmp*":"; + #else    array(string) tmp=EXPLODE_PATH(x);    if(x[0]=='/' && sizeof(tmp)<3) return "/";    return tmp[..sizeof(tmp)-2]*"/"; -  + #endif   }      //! @appears basename   //! Returns the last segment of a path.   //!   //! @seealso   //! @[dirname()], @[explode_path()]   string basename(string x)   { -  + #ifdef __amigaos__ +  return ((x/":")[-1]/"/")[-1]; + #define BASENAME(X) ((((X)/":")[-1]/"/")[-1]) + #else    array(string) tmp=EXPLODE_PATH(x);    return tmp[-1]; - } +    #define BASENAME(X) (EXPLODE_PATH(X)[-1]) -  + #endif + }      #ifdef PIKE_AUTORELOAD      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() \