pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:542:   //! a path again, use @[combine_path()].   //!   array(string) explode_path(string p)   {    array(string) r = EXPLODE_PATH(p);    if(r[0] == "" && sizeof(p))    r[0] = "/";    return r;   }    + #if !constant(dirname)   //! Returns all but the last segment of a path. Some example inputs and   //! outputs:   //!   //! @xml{<matrix>   //! <r><c><b>Expression</b></c><c><b>Value</b></c></r>   //! <r><c>dirname("/a/b")</c><c>"/a"</c></r>   //! <r><c>dirname("/a/")</c><c>"/a"</c></r>   //! <r><c>dirname("/a")</c><c>"/"</c></r>   //! <r><c>dirname("/")</c><c>"/"</c></r>   //! <r><c>dirname("")</c><c>""</c></r>
pike.git/lib/master.pike.in:563:   //!   //! @seealso   //! @[basename()], @[explode_path()]   string dirname(string x)   {    if(x=="") return "";    array(string) tmp = EXPLODE_PATH(x);    if (x[0] == '/' && sizeof(tmp) < 3) return "/";    return tmp[..<1]*"/";   } + #else /* dirname */ + constant dirname = predef::dirname; + #endif /* !dirname */    -  + #if !constant(basename)   //! Returns the last segment of a path.   //!   //! @seealso   //! @[dirname()], @[explode_path()]   string basename(string x)   {    array(string) tmp=EXPLODE_PATH(x);    return tmp[-1];   #define BASENAME(X) (EXPLODE_PATH(X)[-1])   } -  + #else /* basename */ + constant basename = predef::basename; + #define BASENAME(X) basename(X) + #endif /* !basename */      #ifdef PIKE_AUTORELOAD      int autoreload_on;   int newest;      #define AUTORELOAD_BEGIN() \    int ___newest=newest; \    newest=0   
pike.git/lib/master.pike.in:2282:   #endif    }    return UNDEFINED;   }      /* This array contains the names of the functions    * that a replacing master-object may want to override.    */   constant master_efuns = ({    "error", + #if !constant(basename)    "basename", -  + #endif + #if !constant(dirname)    "dirname", -  + #endif    "is_absolute_path",    "explode_path",       "compile_string",    "compile_file",    "add_include_path",    "remove_include_path",    "add_module_path",    "remove_module_path",    "add_program_path",