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

version» Context lines:

pike.git/src/modules/Yp/module.pmod.in:1: - /* -  * $Id: module.pmod.in,v 1.14 2001/04/26 14:13:09 grubba Exp $ -  * -  * YP (NIS) Functionality for Pike -  * -  * Per Hedbor & Henrik Grubbström 1996-1997 -  */ + // -*- Pike -*- + // + // YP (NIS) Functionality for Pike + // Per Hedbor & Henrik Grubbström 1996-1997 + //      #pike __REAL_VERSION__   inherit @module@;      #if constant(@module@.Domain)      // Usual nicknames   constant nicknames = ([    "passwd":"passwd.byname",    "group":"group.byname",
pike.git/src/modules/Yp/module.pmod.in:37:    //!    //! @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) { -  local::domain = Domain(domain); +  this_program::domain = Domain(domain);    } else { -  local::domain = Domain(); +  this_program::domain = Domain();    }    ypmap = map;    array err;    do {    // Force an error if the map does not exist.    err = catch{ -  local::domain->match(ypmap, "foo"); +  this_program::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:81:    {    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()]. +  //! For each entry in the map, call the function @[fun].    //!    //! The function will be called like -  //! @tt{void fun(string key, string value)@}. +  //! @expr{void fun(string key, string value)@}.    //!    void map(function(string,string:void) fun)    {    domain->map(ypmap, fun);    }       //! Return the server that provides this map.    string server()    {    return(domain->server(ypmap));
pike.git/src/modules/Yp/module.pmod.in:127:    {    return(values(domain->all(ypmap)));    }       mixed cast(string type)    {    switch(type) {    case "mapping":    return(cast_to_mapping());    default: -  throw(({ "Yp.YpDomain: Cast to " + type + " not supported.\n", -  backtrace() })); +  error( "Cast to " + type + " not supported.\n" );    }    }   }      #endif