pike.git / src / modules / _Stdio / stat.c

version» Context lines:

pike.git/src/modules/_Stdio/stat.c:782:       else SIMPLE_BAD_ARG_ERROR ("`[]=", 1, "int(0..6)|string");       stack_swap();    pop_stack();   }      static void stat_indices(INT32 args);   static void stat_values(INT32 args);    + /*! @decl mapping(string:int)|array cast (string to); +  *! +  *! Convert the stat object to a mapping or array. +  */   static void stat_cast(INT32 args)   {    struct pike_string *type;       if (!args)    SIMPLE_TOO_FEW_ARGS_ERROR("Stat cast",1);    if (TYPEOF(sp[-args]) != T_STRING)    SIMPLE_BAD_ARG_ERROR("cast",1,"string");       type = Pike_sp[-args].u.string;
pike.git/src/modules/_Stdio/stat.c:1029:    tOr(tFunc(tOr(tStr,tInt06),tOr3(tStr,tInt,tFunction)),    tFunc(tInt tInt,tArr(tInt))),0);       ADD_FUNCTION ("`[]=", stat_index_set,    tOr(tFunc(tInt06 tSetvar(0,tInt),tVar(0)),    tFunc(tString tSetvar(1,tOr(tInt,tString)),tVar(1))), 0);    ADD_FUNCTION ("`->=", stat_index_set,    tOr(tFunc(tInt06 tSetvar(0,tInt),tVar(0)),    tFunc(tString tSetvar(1,tOr(tInt,tString)),tVar(1))), 0);    -  ADD_FUNCTION("cast",stat_cast,tFunc(tStr,tArray),ID_PROTECTED); +  ADD_FUNCTION("cast",stat_cast,tFunc(tStr,tOr(tMapping,tArray)),ID_PROTECTED);    ADD_FUNCTION("_sprintf",stat__sprintf,    tFunc(tInt tOr(tVoid,tMapping),tString),0);    ADD_FUNCTION("_indices",stat_indices,    tFunc(tNone,tArr(tOr(tString,tInt))),0);    ADD_FUNCTION("_values",stat_values,    tFunc(tNone,tArr(tOr(tString,tInt))),0);       set_init_callback (stat_init);       stat_program=end_program();