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.   */    - #include "global.h" + #include "module.h"   #include "config.h"      #if defined(HAVE_RPCSVC_YPCLNT_H) && defined(HAVE_RPCSVC_YP_PROT_H)   #ifdef HAVE_RPC_TYPES_H   #include <rpc/types.h>   #endif /* HAVE_RPC_TYPES_H */   #ifdef HAVE_RPC_RPC_H   #include <rpc/rpc.h>   #endif /* HAVE_RPC_RPC_H */   #ifdef HAVE_RPC_CLNT_H   #include <rpc/clnt.h>   #endif /* HAVE_RPC_CLNT_H */   #include <rpcsvc/yp_prot.h>   #include <rpcsvc/ypclnt.h>    - #include "stralloc.h" +    #include "pike_error.h"   #include "pike_macros.h" - #include "object.h" +    #include "constants.h"   #include "interpret.h" - #include "svalue.h" - #include "mapping.h" +    #include "module_support.h"         #define sp Pike_sp      #ifdef HAVE_YPERR_STRING   #ifdef YPERR_STRING_PROTOTYPE_MISSING   char *yperr_string(int incode);   #endif /* YPERR_STRING_PROTOTYPE_MISSING */   
pike.git/src/modules/Yp/yp.c:82:    *!    *! 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, *map;    -  get_all_args("server", args, "%s", &map); +  get_all_args(NULL, 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)
pike.git/src/modules/Yp/yp.c:113:    *! @[Yp.default_domain()]    */   static void f_create(INT32 args)   {    int err;    if(!args)    {    f_default_domain(0);    args = 1;    } -  check_all_args("create", args, BIT_STRING,0); +  check_all_args(NULL, args, BIT_STRING,0);       if(this->domain)    {    yp_unbind( this->domain );    free(this->domain);    }    this->domain = strdup( sp[-args].u.string->str );    err = yp_bind( this->domain );       YPERROR( err );
pike.git/src/modules/Yp/yp.c:140:    *! @[map] is the YP-map to search in. This must be the full map name,    *! you have to use @tt{passwd.byname@} instead of just @tt{passwd@}.    */   static void f_all(INT32 args)   {    int err, num=0;    char *retval, *retkey;    int retlen, retkeylen;    char *map;    struct mapping *res_map; -  check_all_args("all", args, BIT_STRING, 0); +  check_all_args(NULL, args, BIT_STRING, 0);       map = sp[-1].u.string->str;    res_map = allocate_mapping( (this->last_size?this->last_size+2:40) );       if(!(err = yp_first(this->domain, map, &retkey,&retkeylen, &retval,&retlen)))    do {    push_string(make_shared_binary_string(retkey, retkeylen));    push_string(make_shared_binary_string(retval, retlen));    mapping_insert( res_map, sp-2, sp-1 );    pop_stack(); pop_stack();
pike.git/src/modules/Yp/yp.c:187:    */   static void f_map(INT32 args)   {    int err;    char *retval, *retkey;    int retlen, retkeylen;    char *map;       struct svalue *f = &sp[-1];    -  check_all_args("map", args, BIT_STRING, BIT_FUNCTION|BIT_ARRAY, 0 ); +  check_all_args(NULL, args, BIT_STRING, BIT_FUNCTION|BIT_ARRAY, 0 );       map = sp[-2].u.string->str;       if(!(err = yp_first(this->domain,map, &retkey,&retkeylen, &retval, &retlen)))    do {    push_string(make_shared_binary_string(retkey, retkeylen));    push_string(make_shared_binary_string(retval, retlen));    apply_svalue( f, 2 );       err = yp_next(this->domain, map, retkey, retkeylen,
pike.git/src/modules/Yp/yp.c:220:    *! When the map is changed, this number will change as well.    *!    *! @[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_order(INT32 args)   {    int err;    YP_ORDER_TYPE ret;    -  check_all_args("order", args, BIT_STRING, 0); +  check_all_args(NULL, args, BIT_STRING, 0);       err = yp_order( this->domain, sp[-args].u.string->str, &ret);       YPERROR( err );       pop_n_elems( args );    push_int( (INT32) ret );   }      /*! @decl string match(string map, string key)
pike.git/src/modules/Yp/yp.c:247:    *!    *! @note    *! @[key] must match exactly, no pattern matching of any kind is done.    */   static void f_match(INT32 args)   {    int err;    char *retval;    int retlen;    -  check_all_args("match", args, BIT_STRING, BIT_STRING, 0); +  check_all_args(NULL, args, BIT_STRING, BIT_STRING, 0);       err = yp_match( this->domain, sp[-args].u.string->str,    sp[-args+1].u.string->str, sp[-args+1].u.string->len,    &retval, &retlen );       if(err == YPERR_KEY)    {    pop_n_elems( args );    push_undefined();    return;
pike.git/src/modules/Yp/yp.c:328:       end_class("Domain", 0);   }      PIKE_MODULE_EXIT   {      }   #else    - #include "module.h" +    PIKE_MODULE_INIT {}   PIKE_MODULE_EXIT {}      #endif