pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:1:   /* -*- c -*- -  * $Id: builtin.cmod,v 1.30 2002/11/27 09:41:24 grubba Exp $ +  * $Id: builtin.cmod,v 1.31 2003/01/29 15:55:24 mast Exp $    */      #include "global.h"   #include "interpret.h"   #include "svalue.h"   #include "opcodes.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"
pike.git/src/builtin.cmod:19:   #include "pike_memory.h"   #include "threads.h"   #include <math.h>   #include <ctype.h>   #include "module_support.h"   #include "cyclic.h"   #include "bignum.h"   #include "main.h"   #include "operators.h"   #include "builtin_functions.h" + #include "gc.h"         //! Extract a column from a two-dimensional array.   //!   //! This function is exactly equivalent to:   //! @code{map(@[data], lambda(mixed x,mixed y) { return x[y]; }, @[index])@}   //!   //! Except of course it is a lot shorter and faster.   //! That is, it indices every index in the array data on the value of   //! the argument index and returns an array with the results.
pike.git/src/builtin.cmod:97:   //!   //! The old level is returned.   //!   //! Trace level 1 or higher means that calls to Pike functions are   //! printed to stderr, level 2 or higher means calls to builtin functions   //! are printed, 3 means every opcode interpreted is printed, 4 means   //! arguments to these opcodes are printed as well.   //!   //! See the @tt{-t@} command-line option for more information.   //! - PIKEFUN int trace(int t) + PIKEFUN int trace(int level, void|string facility)    efun;    optflags OPT_SIDE_EFFECT;   { -  pop_n_elems(args); -  push_int(t_flag); -  t_flag=t; +  INT32 old_level; +  if (facility) { +  struct pike_string *gc_str; +  if (facility->type != T_STRING) +  SIMPLE_BAD_ARG_ERROR("trace", 2, "void|string"); +  MAKE_CONSTANT_SHARED_STRING(gc_str, "gc"); +  if (facility->u.string == gc_str) { +  free_string(gc_str); +  old_level = gc_trace; +  gc_trace = level;    } -  +  else { +  free_string(gc_str); +  bad_arg_error("trace", sp-args, args, 2, +  "trace facility identifier", sp-args+1, +  "Bad argument 2 to trace(). Unknown trace facility."); +  } +  } +  else { +  old_level = t_flag; +  t_flag = gc_trace = level; +  } +  RETURN old_level; + }      //! Convert the output from a previous call to @[time()] into a readable   //! string containing the current year, month, day and time.   //!   //! Like @[localtime], this function might throw an error if the   //! ctime(2) call failed on the system. It's platform dependent what   //! time ranges that function can handle, e.g. Windows doesn't handle   //! a negative @[timestamp].   //!   //! @seealso