pike.git
/
src
/
builtin.cmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/builtin.cmod:76:
#else #define GET_GMTOFF(TM) 0 #define GET_ZONE(TM) ((char*)NULL) #define SET_GMTOFF(TM, VAL) (VAL) #define SET_ZONE(TM, VAL) (VAL) #endif #define strftime_zone strftime #define mktime_zone mktime #define strptime_zone strptime
-
#define asctime_zone asctime
+
#define localtime_zone(X,Y) localtime(X) #ifndef HAVE_EXTERNAL_TIMEZONE #undef timezone #endif #define MODIFY(X) do{ THIS->modified = 1;THIS->t.X; }while(0) #define FIX_THIS() do { \ if(THIS->modified){ \ THIS->unix_time = mktime_zone( &THIS->t ); \ THIS->modified = 0; \
pike.git/src/builtin.cmod:406:
/*! @decl string asctime() *! Return a string representing the time. Mostly useful for debug *! purposes, the exact format is very locale (see *! @[Gettext.setlocale]) and OS dependent. */ PIKEFUN string asctime() { FIX_THIS(); {
-
char *tval
=
asctime_zone( &THIS->t )
;
-
if( tval )
-
push_text
(
tval
)
;
-
else
+
int
maxsize
=
26
;
+
char
s[maxsize];
+
if(
!strftime(s,
maxsize,
"%c",
&THIS->t)
)
push_undefined();
-
+
else
+
push_text(s);
} } PIKEFUN string _sprintf( int flag, mapping options ) { int post_sum = 1; switch( flag ) { case 'O': push_static_text("System.TM(");