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.464 2003/10/19 16:56:00 mast Exp $ + || $Id: builtin_functions.c,v 1.465 2004/04/02 13:07:09 grubba Exp $   */      #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.464 2003/10/19 16:56:00 mast Exp $"); + RCSID("$Id: builtin_functions.c,v 1.465 2004/04/02 13:07:09 grubba 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:4118: Inside #if defined(HAVE_LOCALTIME)
      get_all_args("localtime", args, "%i", &tt);       t = tt;    tm = localtime(&t);    if (!tm) Pike_error ("localtime() on this system cannot handle "    "the timestamp %ld.\n", (long) t);    pop_n_elems(args);    encode_struct_tm(tm);    - #ifdef STRUCT_TM_HAS_GMTOFF +     push_string(make_shared_string("timezone")); -  + #ifdef STRUCT_TM_HAS_GMTOFF    push_int(-tm->tm_gmtoff); -  f_aggregate_mapping(20); - #else - #ifdef STRUCT_TM_HAS___TM_GMTOFF -  push_string(make_shared_string("timezone")); + #elif defined(STRUCT_TM_HAS___TM_GMTOFF)    push_int(-tm->__tm_gmtoff); -  f_aggregate_mapping(20); + #elif defined(HAVE_EXTERNAL_TIMEZONE) +  /* Assume dst is one hour. */ +  push_int(timezone - 3600*tm->tm_isdst);   #else - #ifdef HAVE_EXTERNAL_TIMEZONE -  push_string(make_shared_string("timezone")); -  push_int(timezone); -  f_aggregate_mapping(20); - #else -  f_aggregate_mapping(18); +  /* Assume dst is one hour. */ +  push_int(-3600*tm->tm_isdst);   #endif - #endif - #endif +  f_aggregate_mapping(20);   }   #endif      #ifdef HAVE_MKTIME   /*! @decl int mktime(mapping(string:int) tm)    *! @decl int mktime(int sec, int min, int hour, int mday, int mon, int year, @    *! int isdst, int tz)    *!    *! This function converts information about date and time into an integer    *! which contains the number of seconds since 00:00:00 UTC, Jan 1, 1970.