pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1:   /* -*- Pike -*-    * -  * $Id: master.pike.in,v 1.132 2000/09/26 18:58:56 hubbe Exp $ +  * $Id: master.pike.in,v 1.133 2000/09/26 22:19:00 hubbe Exp $    *    * Master-file for Pike.    *    * Based on master.pike 1.67.    */      // Some configurable parameters useful for debugging      #pike __VERSION__   #define PIKE_AUTORELOAD
pike.git/lib/master.pike.in:941:       compat_major=saved_compat_major;    compat_minor=saved_compat_minor;    if(err) throw(err);    return x;    }       mixed resolv_base(string identifier, string|void current_file)    {    array(mixed) tmp = ({}); +  string dir=current_file ? dirname(current_file) : "/";    foreach(pike_module_path, string path)    { -  string file=combine_path(path,identifier); +  string file=combine_path(dir ,path,identifier);    if(mixed ret=findmodule(file)) {    if ((objectp(ret)) &&    (ret->is_resolv_dirnode || ret->is_resolv_joinnode)) {    if (mixed new_ret = ret->_module_value) {    ret = new_ret;    }    tmp += ({ ret });    } else {    if (mixed new_ret = ret->_module_value) {    ret = new_ret;
pike.git/lib/master.pike.in:986:    mixed resolv(string identifier, string|void current_file)    {    if( no_resolv[ identifier ] )    return UNDEFINED;       mixed ret;    string id=identifier+":"+(current_file ? dirname(current_file) : "-");    if( !zero_type (ret = resolv_cache[id]) )    return ret == ZERO_TYPE ? UNDEFINED : resolv_cache[id];    array(string) tmp=identifier/"."; -  ret=resolv_base(tmp[0]); +  ret=resolv_base(tmp[0],current_file);    foreach(tmp[1..],string index) ret=ret[index];    resolv_cache[id] = zero_type (ret) ? ZERO_TYPE : ret;    return ret;    }       /* This function is called whenever an #include directive is encountered    * it receives the argument for #include and should return the file name    * of the file to include    */    string handle_include(string f,
pike.git/lib/master.pike.in:1959:   class Version   {    int major;    int minor;    void create(int maj, int min)    {    major=maj;    minor=min;    }    - #define CMP(X) (major - (X)->major) || (minor - (X)->minor) + #define CMP(X) ((major - (X)->major) || (minor - (X)->minor))       int `<(Version v) { return CMP(v) < 0; }    int `>(Version v) { return CMP(v) > 0; }    int `==(Version v) { return CMP(v)== 0; }    int _hash() { return major * 4711 + minor ; }       string _sprintf() { return sprintf("%d.%d",major,minor); }    mixed cast(string type)    {    switch(type)
pike.git/lib/master.pike.in:2042:    compat_handler_cache[v]=0;    return 0;    }       /* Same as available[0] */    if(ret=compat_handler_cache[available[0]])    return compat_handler_cache[v]=ret;   #endif       ret=CompatResolver(v); -  if( v < Version(0,6)) -  ret->pike_module_path+=({"."}); +  /* Add default paths */ +  ret->pike_module_path=pike_module_path; +  ret->pike_include_path=pike_include_path;    -  foreach(available, Version v) +  foreach(reverse(available), Version tmp)    {    string base;   #if "¤lib_prefix¤"[0]!='¤' -  base=combine_path("¤lib_prefix¤",sprintf("%s",v)); +  base=combine_path("¤lib_prefix¤",sprintf("%s",tmp));    ret->add_module_path(combine_path(base,"modules"));    ret->add_include_path(combine_path(base,"include"));   #endif      #if "¤share_prefix¤"[0]!='¤' -  base=combine_path("¤share_prefix¤",sprintf("%s",v)); +  base=combine_path("¤share_prefix¤",sprintf("%s",tmp));    ret->add_module_path(combine_path(base,"modules"));    ret->add_include_path(combine_path(base,"include"));   #endif    }    -  /* Add default paths */ -  map(pike_module_path,ret->add_module_path); -  map(pike_include_path,ret->add_include_path); +  if( v <= Version(0,6)) +  ret->pike_module_path+=({"."});       compat_handler_cache[v] = ret;      #ifndef RESOLVER_HACK    compat_handler_cache[available[0]] = ret; /* may be equal to 'v' */   #endif       return ret;   }      string _sprintf()   {    return "master()";   }