pike.git
/
src
/
builtin.cmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/builtin.cmod:1:
/* -*- c -*- || 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.cmod,v 1.
224
2008/
07
/
31
14
:
52
:
26
mast Exp $
+
|| $Id: builtin.cmod,v 1.
225
2008/
10
/
04
18
:
31
:
12
mast Exp $
*/ #include "global.h" #include "interpret.h" #include "svalue.h" #include "pike_macros.h" #include "object.h" #include "program.h" #include "array.h" #include "pike_error.h"
pike.git/src/builtin.cmod:934:
} /*! @decl program __empty_program(int|void line, string|void file) */ PIKEFUN program __empty_program(int|zero|void line, string|void file) efun; optflags OPT_EXTERNAL_DEPEND; { struct program *prog = low_allocate_program(); if (file) ext_store_program_line (prog, line, file);
+
#if 0
+
push_program (prog);
+
safe_pike_fprintf (stderr, "Creating empty program %O (%x)\n",
+
Pike_sp - 1, Pike_sp[-1].u.program);
+
Pike_sp--;
+
#endif
RETURN prog; } /*! @decl string function_name(function f) *! *! Return the name of the function @[f]. *! *! If @[f] is a global function defined in the runtime @expr{0@} *! (zero) will be returned. *!
pike.git/src/builtin.cmod:2866:
*! *! The number of microseconds since the epoch. Please note that *! pike has to have been compiled with bignum support for this *! variable to contain sensible values. */ PIKEFUN int `->( string x ) { extern struct timeval current_time; struct pike_string *usec;
-
struct pike_string *sec;
+
struct pike_string *sec
, *usec_full
;
MAKE_CONST_STRING( sec, "sec" ); MAKE_CONST_STRING( usec, "usec" );
-
+
MAKE_CONST_STRING (usec_full, "usec_full");
-
if( !x )
-
RETURN
0
;
+
if( !x )
{
+
push_undefined();
+
return
;
+
}
if( THIS->hard_update ) GETTIMEOFDAY( ¤t_time ); if( x == usec ) RETURN current_time.tv_usec; if( x == sec ) RETURN current_time.tv_sec;
-
+
if (x != usec_full) {
+
push_undefined();
+
return;
+
}
#ifdef AUTO_BIGNUM pop_stack(); push_int( current_time.tv_sec ); push_int( 1000000 ); f_multiply( 2 ); push_int( current_time.tv_usec ); f_add( 2 ); return; #else