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

version» Context lines:

pike.git/src/modules/_Stdio/stat.c:784:       stack_swap();    pop_stack();   }      static void stat_indices(INT32 args);   static void stat_values(INT32 args);      static void stat_cast(INT32 args)   { -  struct pike_string *type = Pike_sp[-args].u.string; +  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;    pop_stack(); /* type have at least one more reference. */       if (type == literal_array_string)    {    push_int(0);    push_int(6);    stat_index(2);    }    else if (type == literal_mapping_string)    {
pike.git/src/modules/_Stdio/stat.c:1022:    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_PRIVATE); +  ADD_FUNCTION("cast",stat_cast,tFunc(tStr,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();