pike.git / src / modules / Yp / yp.c

version» Context lines:

pike.git/src/modules/Yp/yp.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: yp.c,v 1.30 2004/02/03 10:13:27 nilsson Exp $ + || $Id: yp.c,v 1.31 2004/06/29 12:06:42 nilsson Exp $   */      #include "global.h"   #include "config.h"      #if defined(HAVE_RPCSVC_YPCLNT_H) && defined(HAVE_RPCSVC_YP_PROT_H)   #ifdef HAVE_SYS_TYPES_H   #include <sys/types.h>   #endif /* HAVE_SYS_TYPES_H */   #ifdef HAVE_RPC_TYPES_H
pike.git/src/modules/Yp/yp.c:30:   #include "object.h"   #include "constants.h"   #include "interpret.h"   #include "svalue.h"   #include "mapping.h"   #include "module_support.h"         #define sp Pike_sp    - RCSID("$Id: yp.c,v 1.30 2004/02/03 10:13:27 nilsson Exp $"); + RCSID("$Id: yp.c,v 1.31 2004/06/29 12:06:42 nilsson Exp $");      #ifdef HAVE_YPERR_STRING   #define YPERROR(e) do{ if(err) Pike_error("%s\n", yperr_string(e)); }while(0)   #else /* !HAVE_YPERR_STRING */   #define YPERROR(e) do{ if(e) Pike_error("YP error %d.\n", (e)); }while(0)   #endif /* HAVE_YPERR_STRING */      struct my_yp_domain   {    char *domain;
pike.git/src/modules/Yp/yp.c:82:      /*! @decl string server(string map)    *!    *! Returns the hostname of the server serving the map @[map]. @[map]    *! is the YP-map to search in. This must be the full map name.    *! eg @tt{passwd.byname@} instead of just @tt{passwd@}.    */   static void f_server(INT32 args)   {    int err; -  char *ret; +  char *ret, *map;    -  err = yp_master(this->domain, sp[-1].u.string->str, &ret); +  get_all_args("server", args, "%s", &map); +  err = yp_master(this->domain, map, &ret);       YPERROR( err );       pop_n_elems( args );    push_text( ret );   }      /*! @decl void create(string|void domain)    *! @decl void bind(string domain)    *!