Branch: Tag:

2019-01-17

2019-01-17 13:41:44 by Henrik Grubbström (Grubba) <grubba@grubba.org>

EFUNs: Implement {base,dir}name() in C.

This makes it possible to have a stricter type for basename()
and dirname().

Also adjusts the type for combine_path() et al.

549:    return r;   }    + #if !constant(dirname)   //! Returns all but the last segment of a path. Some example inputs and   //! outputs:   //!
570:    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
581:    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   
2289:    */   constant master_efuns = ({    "error", + #if !constant(basename)    "basename", -  + #endif + #if !constant(dirname)    "dirname", -  + #endif    "is_absolute_path",    "explode_path",