pike.git / src / modules / Yp / module.pmod.in

version» Context lines:

pike.git/src/modules/Yp/module.pmod.in:35:    //!    //! @note    //! If there is no YP server available for the domain, this    //! function call will block until there is one. If no server appears    //! in about ten minutes or so, an error will be returned. The timeout    //! is not configurable.    //!    void create(string map, string|void domain)    {    if (domain) { -  this_program::domain = Domain(domain); +  this::domain = Domain(domain);    } else { -  this_program::domain = Domain(); +  this::domain = Domain();    }    ypmap = map;    array err;    do {    // Force an error if the map does not exist.    err = catch{ -  this_program::domain->match(ypmap, "foo"); +  this::domain->match(ypmap, "foo");    return;    };    } while (ypmap = nicknames[ypmap]);    throw(err);    }       //! Search for the key @[key]. If there is no @[key] in the map, 0 (zero)    //! will be returned, otherwise the string matching the key will    //! be returned.    //!
pike.git/src/modules/Yp/module.pmod.in:72:    string `[](string key)    {    return(domain->match(ypmap, key));    }       //! Returns the whole map as a mapping.    mapping(string:string) all()    {    return(domain->all(ypmap));    } +     mapping(string:string) cast_to_mapping()    {    return(domain->all(ypmap));    }       //! Call a function for each entry in the map.    //!    //! For each entry in the map, call the function @[fun].    //!    //! The function will be called like
pike.git/src/modules/Yp/module.pmod.in:119:    {    return(indices(domain->all(ypmap)));    }       //! Return the values of the map.    array(string) _values()    {    return(values(domain->all(ypmap)));    }    -  mixed cast(string type) +  //! Convert the map to a mapping +  protected mapping cast(string type)    { -  switch(type) { -  case "mapping": -  return(cast_to_mapping()); -  default: -  error( "Cast to " + type + " not supported.\n" ); +  if( type=="mapping" ) +  return cast_to_mapping(); +  return UNDEFINED;    }   } - } +       #endif