pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.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: builtin_functions.c,v 1.454 2002/12/07 13:52:09 grubba Exp $ + || $Id: builtin_functions.c,v 1.455 2003/01/04 15:24:51 nilsson Exp $   */      #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.454 2002/12/07 13:52:09 grubba Exp $"); + RCSID("$Id: builtin_functions.c,v 1.455 2003/01/04 15:24:51 nilsson Exp $");   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"   #include "constants.h"   #include "mapping.h"   #include "stralloc.h"
pike.git/src/builtin_functions.c:73:    *! recursively, and if all their contents are the same and in the same    *! place, they are considered equal.    *!    *! @seealso    *! @[copy_value()]    */   PMOD_EXPORT void f_equal(INT32 args)   {    int i;    if(args != 2) -  PIKE_ERROR("equal", "Bad number of arguments.\n", Pike_sp, args); +  SIMPLE_TOO_FEW_ARGS_ERROR("equal", 2);       i=is_equal(Pike_sp-2,Pike_sp-1);    pop_n_elems(args);    push_int(i);   }      /*! @decl array aggregate(mixed ... elements)    *!    *! Construct an array with the arguments as indices.    *!
pike.git/src/builtin_functions.c:126:    *! This function is provided for backward compatibility reasons.    *!    *! @seealso    *! @[hash()]    */   void f_compat_hash( INT32 args )   {    struct pike_string *s = Pike_sp[-args].u.string;    unsigned int i;    if(!args) -  SIMPLE_TOO_FEW_ARGS_ERROR("hash",1); +  SIMPLE_TOO_FEW_ARGS_ERROR("hash_7_0",1);    if(Pike_sp[-args].type != T_STRING) -  SIMPLE_BAD_ARG_ERROR("hash", 1, "string"); +  SIMPLE_BAD_ARG_ERROR("hash_7_0", 1, "string");       if( s->size_shift )    {    f_hash( args );    return;    }       i = DO_NOT_WARN((unsigned int)hashstr( (unsigned char *)s->str,    MINIMUM(100,s->len)));    if(args > 1)    {    if(Pike_sp[1-args].type != T_INT) -  SIMPLE_BAD_ARG_ERROR("hash",2,"int"); +  SIMPLE_BAD_ARG_ERROR("hash_7_0",2,"int");       if(!Pike_sp[1-args].u.integer) -  PIKE_ERROR("hash", "Modulo by zero.\n", Pike_sp, args); +  PIKE_ERROR("hash_7_0", "Modulo by zero.\n", Pike_sp, args);       i%=(unsigned INT32)Pike_sp[1-args].u.integer;    }    pop_n_elems(args);    push_int( i );   }      /*! @decl int hash(string s)    *! @decl int hash(string s, int max)    *!