pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:7638:    }    if(tmp.u.refs)    {    assign_svalue(Pike_sp-1,&tmp);    }else{    pop_stack();    push_int(0);    }   }    - /*! @decl int _refs(string|array|mapping|multiset|function|object|program o) -  *! -  *! Return the number of references @[o] has. -  *! -  *! It is mainly meant for debugging the Pike runtime, but can also be -  *! used to control memory usage. -  *! -  *! @note -  *! Note that the number of references will always be at least one since -  *! the value is located on the stack when this function is executed. -  *! -  *! @seealso -  *! @[_next()], @[_prev()] -  */ - PMOD_EXPORT void f__refs(INT32 args) - { -  INT32 i; -  -  if(!args) -  SIMPLE_TOO_FEW_ARGS_ERROR("_refs", 1); -  -  if(!REFCOUNTED_TYPE(TYPEOF(Pike_sp[-args]))) -  SIMPLE_BAD_ARG_ERROR("refs", 1, -  "array|mapping|multiset|object|" -  "function|program|string"); -  -  i=Pike_sp[-args].u.refs[0]; -  pop_n_elems(args); -  push_int(i); - } -  +    /*! @decl type _typeof(mixed x)    *!    *! Return the runtime type of @[x].    *!    *! @seealso    *! @[typeof()]    */   PMOD_EXPORT void f__typeof(INT32 args)   {    struct pike_type *t;
pike.git/src/builtin_functions.c:9390:    ADD_EFUN("gethrvtime",f_gethrvtime,    tFunc(tOr(tInt,tVoid),tInt), OPT_EXTERNAL_DEPEND);    ADD_EFUN("gethrtime", f_gethrtime,    tFunc(tOr(tInt,tVoid),tInt), OPT_EXTERNAL_DEPEND);      #ifdef PROFILING    ADD_EFUN("get_profiling_info", f_get_prof_info,    tFunc(tPrg(tObj),tArray), OPT_EXTERNAL_DEPEND);   #endif /* PROFILING */    -  ADD_EFUN("_refs",f__refs,tFunc(tRef,tInt),OPT_EXTERNAL_DEPEND); +     ADD_EFUN("_typeof", f__typeof, tFunc(tSetvar(0, tMix), tType(tVar(0))), 0);       /* class __master    * Used to prototype the master object.    */    start_new_program();    ADD_PROTOTYPE("_main", tFunc(tArr(tStr) tArr(tStr),tVoid), 0);       ADD_PROTOTYPE("cast_to_object", tFunc(tStr tStr tOr(tVoid, tObj), tObj), 0);    ADD_PROTOTYPE("cast_to_program", tFunc(tStr tStr tOr(tVoid, tObj), tPrg(tObj)), 0);