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.523 2003/12/18 21:22:23 marcus Exp $ + || $Id: builtin_functions.c,v 1.524 2004/01/11 01:16:08 nilsson Exp $   */      #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.523 2003/12/18 21:22:23 marcus Exp $"); + RCSID("$Id: builtin_functions.c,v 1.524 2004/01/11 01:16:08 nilsson Exp $");   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"   #include "constants.h"   #include "mapping.h"   #include "stralloc.h"
pike.git/src/builtin_functions.c:2131:   PMOD_EXPORT void f_throw(INT32 args)   {    if(args < 1)    SIMPLE_TOO_FEW_ARGS_ERROR("throw", 1);    assign_svalue(&throw_value,Pike_sp-args);    pop_n_elems(args);    throw_severity=0;    pike_throw();   }    - /*! @decl void exit(int returncode) + /*! @decl void exit(int returncode, void|stirng fmt, mixed ... extra)    *!    *! Exit the whole Pike program with the given @[returncode].    *!    *! Using @[exit()] with any other value than @expr{0@} (zero) indicates    *! that something went wrong during execution. See your system manuals    *! for more information about return codes.    *! -  +  *! The arguments after the @[returncode] will be used for a call to +  *! @[werror] to output a message on stderr. +  *!    *! @seealso    *! @[_exit()]    */   PMOD_EXPORT void f_exit(INT32 args)   {    static int in_exit=0;    ASSERT_SECURITY_ROOT("exit");       if(args < 1)    SIMPLE_TOO_FEW_ARGS_ERROR("exit", 1);       if(Pike_sp[-args].type != T_INT)    SIMPLE_BAD_ARG_ERROR("exit", 1, "int");       if(in_exit) Pike_error("exit already called!\n");    in_exit=1;    -  +  if(args>1) +  f_werror(args-1); +     assign_svalue(&throw_value, Pike_sp-args);    throw_severity=THROW_EXIT;    pike_throw();   }      /*! @decl void _exit(int returncode)    *!    *! This function does the same as @[exit], but doesn't bother to clean    *! up the Pike interpreter before exiting. This means that no destructors    *! will be called, caches will not be flushed, file locks might not be
pike.git/src/builtin_functions.c:8031:      /* function(mixed,mixed:int) */    ADD_EFUN("equal",f_equal,tFunc(tMix tMix,tInt),OPT_TRY_OPTIMIZE);       /* function(array(0=mixed),int|void,int|void:array(0)) */    ADD_FUNCTION2("everynth",f_everynth,    tFunc(tArr(tSetvar(0,tMix)) tOr(tInt,tVoid) tOr(tInt,tVoid),    tArr(tVar(0))), 0, OPT_TRY_OPTIMIZE);      /* function(int:void) */ -  ADD_EFUN("exit",f_exit,tFunc(tInt,tVoid),OPT_SIDE_EFFECT); +  ADD_EFUN("exit",f_exit,tFuncV(tInt tOr(tVoid,tStr),tOr(tVoid,tMix),tVoid), +  OPT_SIDE_EFFECT);      /* function(int:void) */    ADD_EFUN("_exit",f__exit,tFunc(tInt,tVoid),OPT_SIDE_EFFECT);      /* function(mixed:int) */    ADD_EFUN("floatp", f_floatp,tFunc(tMix,tInt),OPT_TRY_OPTIMIZE);      /* function(mixed:int) */    ADD_EFUN("functionp", f_functionp,tFunc(tMix,tInt),OPT_TRY_OPTIMIZE);