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.699 2010/03/30 11:54:56 peter Exp $ + || $Id: builtin_functions.c,v 1.700 2010/05/19 09:32:22 grubba Exp $   */      #include "global.h"   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"
pike.git/src/builtin_functions.c:334:    *! otherwise the result will be >= 0 and <= 0x7fffffff.    *!    *! @note    *! The hash algorithm was changed in Pike 7.5. If you want a hash    *! that is compatible with Pike 7.4 and earlier, use @[7.4::hash()].    *! The difference only affects wide strings.    *!    *! The hash algorithm was also changed in Pike 7.1. If you want a hash    *! that is compatible with Pike 7.0 and earlier, use @[7.0::hash()].    *! +  *! @note +  *! This hash function differs from the one provided by @[hash_value()], +  *! in that @[hash_value()] returns a process specific value. +  *!    *! @seealso    *! @[7.0::hash()], @[7.4::hash()], @[hash_value]    */   PMOD_EXPORT void f_hash(INT32 args)   {    size_t i = 0;    struct pike_string *s;       if(!args)    SIMPLE_TOO_FEW_ARGS_ERROR("hash",1);
pike.git/src/builtin_functions.c:390:   /*! @decl int hash_value (mixed value)    *!    *! Return a hash value for the argument. It's an integer in the    *! native integer range.    *!    *! The hash will be the same for the same value in the running    *! process only (the memory address is typically used as the basis    *! for the hash value).    *!    *! If the value is an object with an @[lfun::__hash], that function -  *! is called and its result is returned. +  *! is called and its result returned.    *!    *! @note -  *! This is the hashing method used by mappings. +  *! This is the hashing method used by mappings.    *!    *! @seealso -  *! @[hash] +  *! @[hash()], @[lfun::__hash()]    */   void f_hash_value(INT32 args)   {    unsigned INT32 h;       if(!args)    SIMPLE_TOO_FEW_ARGS_ERROR("hash_value",1);       h = hash_svalue (Pike_sp - args);    pop_n_elems (args);