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.641 2007/06/10 19:03:11 mast Exp $ + || $Id: builtin_functions.c,v 1.642 2007/11/18 19:04:24 nilsson 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:4536:    apply_low(Pike_sp[-args-1].u.object, fun + id_level, 1); \    stack_unlink(args); \    return; \    } \    } \    t = Pike_sp[-args].type == TYPE; \    pop_n_elems(args); \    push_int(t); \    }    + /*! @decl int undefinedp(mixed arg) +  *! +  *! Returns @expr{1@} if @[arg] is undefined, @expr{0@} (zero) otherwise. +  *! +  *! @seealso +  *! @[zero_type], @[destructedp], @[intp] +  */ + PMOD_EXPORT void f_undefinedp(INT32 args) + { +  if( args<1 ) +  SIMPLE_TOO_FEW_ARGS_ERROR("undefinedp", 1); +  f_zero_type(args); +  Pike_sp[-1].u.integer = ( Pike_sp[-1].u.integer == NUMBER_UNDEFINED); + }    -  + /*! @decl int destructedp(mixed arg) +  *! +  *! Returns @expr{1@} if @[arg] is a destructed object, @expr{0@} +  *! (zero) otherwise. +  *! +  *! @seealso +  *! @[zero_type], @[undefinedp], @[intp] +  */ + PMOD_EXPORT void f_destructedp(INT32 args) + { +  if( args<1 ) +  SIMPLE_TOO_FEW_ARGS_ERROR("destructedp", 1); +  f_zero_type(args); +  Pike_sp[-1].u.integer = ( Pike_sp[-1].u.integer == NUMBER_DESTRUCTED); + } +    /*! @decl int programp(mixed arg)    *!    *! Returns @expr{1@} if @[arg] is a program, @expr{0@} (zero) otherwise.    *!    *! @seealso    *! @[mappingp()], @[intp()], @[arrayp()], @[stringp()], @[objectp()],    *! @[multisetp()], @[floatp()], @[functionp()]    */   PMOD_EXPORT void f_programp(INT32 args)   {
pike.git/src/builtin_functions.c:9026:    ADD_EFUN("hash_value",f_hash_value,tFunc(tMix,tInt),OPT_TRY_OPTIMIZE);      /* function(string|array:int*)|function(mapping(1=mixed:mixed)|multiset(1=mixed):array(1))|function(object|program:string*) */    ADD_EFUN2("indices",f_indices,    tOr3(tFunc(tOr(tStr,tArray),tArr(tInt)),    tFunc(tOr(tMap(tSetvar(1,tMix),tMix),tSet(tSetvar(1,tMix))),    tArr(tVar(1))),    tFunc(tOr(tObj,tPrg(tObj)),tArr(tStr))),    OPT_TRY_OPTIMIZE,fix_indices_type,0);    +  ADD_EFUN("undefinedp", f_undefinedp, tFunc(tMix,tInt01), OPT_TRY_OPTIMIZE); +  ADD_EFUN("destructedp", f_destructedp, tFunc(tMix,tInt01), OPT_TRY_OPTIMIZE); +    /* function(mixed:int) */    ADD_EFUN("intp", f_intp,tFunc(tMix,tInt),OPT_TRY_OPTIMIZE);      /* function(mixed:int) */    ADD_EFUN("multisetp", f_multisetp,tFunc(tMix,tInt),OPT_TRY_OPTIMIZE);      /* function(string:string)|function(int:int) */    ADD_EFUN("lower_case",f_lower_case,    tOr(tFunc(tStr,tStr), tFunc(tInt,tInt)),OPT_TRY_OPTIMIZE);