pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:2948:    int ret;       if (!args || TYPEOF(Pike_sp[-1]) != PIKE_T_TYPE)    SIMPLE_ARG_TYPE_ERROR("deprecated_typep", 1, "type");       ret = deprecated_typep(Pike_sp[-1].u.type);    pop_n_elems(args);    push_int(ret);   }    - /*! @decl type typeof_identifier(program p, string identifier) + /*! @decl type|zero typeof_identifier(program p, string identifier)    *!    *! Allows access to the static type of an identifier ("member") in a    *! program.    *!    *! @returns    *! The static type of @expr{p->identifier@}, or @expr{UNDEFINED@}    *! if it can not be determined, be it because @expr{identifier@} does not    *! exist in @expr{p@} or for other reasons.    */   PMOD_EXPORT void f_typeof_identifier(INT32 args)
pike.git/src/builtin_functions.c:3002:    t = parse_type( (char *)STR0(Pike_sp[-1].u.string) );    pop_stack();       push_string(type_to_string(t));    free_type(t);   }      /*! @module Pike    */    - /*! @decl type soft_cast(type to, type from) + /*! @decl type|zero soft_cast(type to, type from)    *!    *! Return the resulting type from a soft cast of @[from] to @[to].    */   static void f___soft_cast(INT32 args)   {    struct pike_type *res;    if (args < 2) Pike_error("Bad number of arguments to __soft_cast().\n");    if (TYPEOF(Pike_sp[-args]) != PIKE_T_TYPE) {    Pike_error("Bad argument 1 to __soft_cast() expected type.\n");    }
pike.git/src/builtin_functions.c:3026:    if (!(res = soft_cast(Pike_sp[-args].u.type,    Pike_sp[1-args].u.type, 0))) {    pop_n_elems(args);    push_undefined();    } else {    pop_n_elems(args);    push_type_value(res);    }   }    - /*! @decl type low_check_call(type fun_type, type arg_type) -  *! @decl type low_check_call(type fun_type, type arg_type, int flags) + /*! @decl type|zero low_check_call(type fun_type, type arg_type) +  *! @decl type|zero low_check_call(type fun_type, type arg_type, int flags)    *!    *! Check whether a function of type @[fun_type] may be called    *! with a first argument of type @[arg_type].    *!    *! @param flags    *! The following flags are currently defined:    *! @int    *! @value 1    *! Strict types. Fail if not all possible values in @[arg_type]    *! are valid as the first argument to @[fun_type].
pike.git/src/builtin_functions.c:3078:    if (!(res = low_new_check_call(Pike_sp[-args].u.type,    Pike_sp[1-args].u.type, flags, sval))) {    pop_n_elems(args);    push_undefined();    } else {    pop_n_elems(args);    push_type_value(res);    }   }    - /*! @decl type get_return_type(type fun_type) + /*! @decl type|zero get_return_type(type fun_type)    *!    *! Check what a function of the type @[fun_type] will    *! return if called with no arguments.    *!    *! @returns    *! Returns the type of the returned value on success    *!    *! Returns @tt{0@} (zero) on failure.    */   static void f___get_return_type(INT32 args)
pike.git/src/builtin_functions.c:3106:    }    if (!(res = new_get_return_type(Pike_sp[-1].u.type, 0))) {    pop_n_elems(args);    push_undefined();    } else {    pop_n_elems(args);    push_type_value(res);    }   }    - /*! @decl type get_first_arg_type(type fun_type) + /*! @decl type|zero get_first_arg_type(type fun_type)    *!    *! Check if a function of the type @[fun_type] may be called    *! with an argument, and return the type of that argument.    *!    *! @returns    *! Returns the expected type of the first argument to the function.    *!    *! Returns @tt{0@} (zero) if a function of the type @[fun_type]    *! may not be called with any argument, or if it is not callable.    */
pike.git/src/builtin_functions.c:3187:    *!    *! @seealso    *! @[add_constant()]    */   PMOD_EXPORT void f_all_constants(INT32 args)   {    pop_n_elems(args);    ref_push_mapping(get_builtin_constants());   }    - /*! @decl CompilerEnvironment.PikeCompiler get_active_compiler() + /*! @decl CompilerEnvironment.PikeCompiler|zero get_active_compiler()    *!    *! Returns the most recent of the currently active pike compilers,    *! or @[UNDEFINED] if none is active.    *!    *! @note    *! This function should only be used during a call of @[compile()].    *!    *! @seealso    *! @[get_active_error_handler()], @[compile()],    *! @[master()->get_compilation_handler()], @[CompilationHandler]
pike.git/src/builtin_functions.c:10117:    ADD_EFUN2("aggregate_mapping",f_aggregate_mapping,    tFuncV(tNone,tSetvar(0,tMix),tMap(tVar(0),tVar(0))),    OPT_TRY_OPTIMIZE, fix_aggregate_mapping_type, 0);       /* function(:mapping(string:mixed)) */    ADD_EFUN("all_constants",f_all_constants,    tFunc(tNone,tMap(tStr,tMix)),OPT_EXTERNAL_DEPEND);       /* function(:object) */    ADD_EFUN("get_active_compiler", f_get_active_compiler, -  tFunc(tNone, tObj), OPT_EXTERNAL_DEPEND); +  tFunc(tNone, tOr(tObj, tZero)), OPT_EXTERNAL_DEPEND);       /* function(int,void|0=mixed:array(0)) */    ADD_EFUN("allocate", f_allocate,    tFunc(tInt tOr(tVoid,tSetvar(0,tMix)),tArr(tVar(0))), 0);       /* function(mixed:int) */    ADD_EFUN("arrayp", f_arrayp,tFunc(tMix,tInt01),0);       ADD_EFUN("basename", f_basename, tFunc(tSetvar(0, tStr), tVar(0)), 0);   
pike.git/src/builtin_functions.c:10437:    tFunc(tStr8 tOr(tInt,tVoid),tInt01), OPT_TRY_OPTIMIZE);          ADD_EFUN("__parse_pike_type", f_parse_pike_type,    tFunc(tStr8,tStr8),OPT_TRY_OPTIMIZE);       ADD_EFUN("deprecated_typep", f_deprecated_typep,    tFunc(tType(tMix),tInt), OPT_TRY_OPTIMIZE);       ADD_EFUN("typeof_identifier", f_typeof_identifier, -  tFunc(tPrg(tObj) tStr, tType(tMix)), OPT_TRY_OPTIMIZE); +  tFunc(tPrg(tObj) tStr, tOr(tType(tMix), tZero)), OPT_TRY_OPTIMIZE);       ADD_EFUN("__soft_cast", f___soft_cast,    tFunc(tSetvar(0, tType(tMix)) tSetvar(1, tType(tMix)), -  tAnd(tVar(0), tVar(1))), +  tOr(tAnd(tVar(0), tVar(1)), tZero)),    OPT_TRY_OPTIMIZE);       ADD_EFUN("__low_check_call", f___low_check_call,    tFunc(tType(tCallable) tType(tMix) tOr(tInt,tVoid) tOr(tMix,tVoid), -  tType(tCallable)), +  tOr(tType(tCallable), tZero)),    OPT_TRY_OPTIMIZE);       /* FIXME: Could have a stricter type. */    ADD_EFUN("__get_return_type", f___get_return_type, -  tFunc(tType(tCallable), tType(tMix)), +  tFunc(tType(tCallable), tOr(tType(tMix), tZero)),    OPT_TRY_OPTIMIZE);       /* FIXME: Could have a stricter type. */    ADD_EFUN("__get_first_arg_type", f___get_first_arg_type, -  tFunc(tType(tCallable), tType(tMix)), +  tFunc(tType(tCallable), tOr(tType(tMix), tZero)),    OPT_TRY_OPTIMIZE);       ADD_EFUN("__get_type_attributes", f___get_type_attributes,    tFunc(tType(tMix), tArr(tString)),    OPT_TRY_OPTIMIZE);       /* function(int:mapping(string:int)) */    ADD_EFUN("localtime",f_localtime,    tFunc(tInt,tMap(tStr,tInt)),OPT_EXTERNAL_DEPEND);