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.457 2003/03/28 14:23:23 marcus Exp $ + || $Id: builtin_functions.c,v 1.458 2003/04/14 15:04:41 mast Exp $   */      #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.457 2003/03/28 14:23:23 marcus Exp $"); + RCSID("$Id: builtin_functions.c,v 1.458 2003/04/14 15:04:41 mast 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:2054:    }   #endif       exit(Pike_sp[-args].u.integer);   }      /*! @decl int time();    *! @decl int time(int(1..1) one)    *! @decl float time(int(2..) t)    *! -  *! This function returns the number of seconds since 1 Jan 1970. +  *! This function returns the number of seconds since 00:00:00 UTC, Jan 1, 1970.    *!    *! The second syntax does not call the system call @tt{time()@} as often,    *! but is only updated in the backed (when Pike code isn't running).    *!    *! The third syntax can be used to measure time more preciely than one    *! second. It return how many seconds has passed since @[t]. The precision    *! of this function varies from system to system.    *!    *! @seealso    *! @[ctime()], @[localtime()], @[mktime()], @[gmtime()]
pike.git/src/builtin_functions.c:4009: Inside #if defined(HAVE_LOCALTIME) || defined(HAVE_GMTIME)
   push_string(make_shared_string("yday"));    push_int(tm->tm_yday);    push_string(make_shared_string("isdst"));    push_int(tm->tm_isdst);   }   #endif      #ifdef HAVE_GMTIME   /*! @decl mapping(string:int) gmtime(int timestamp)    *! -  *! Convert seconds since 1970 into components. +  *! Convert seconds since 00:00:00 UTC, Jan 1, 1970 into components.    *!    *! This function works like @[localtime()] but the result is    *! not adjusted for the local time zone.    *!    *! @seealso    *! @[localtime()], @[time()], @[ctime()], @[mktime()]    */   PMOD_EXPORT void f_gmtime(INT32 args)   {    struct tm *tm;
pike.git/src/builtin_functions.c:4041: Inside #if defined(HAVE_GMTIME)
      push_string(make_shared_string("timezone"));    push_int(0);    f_aggregate_mapping(20);   }   #endif      #ifdef HAVE_LOCALTIME   /*! @decl mapping(string:int) localtime(int timestamp)    *! -  *! Convert seconds since 1970 into components. +  *! Convert seconds since 00:00:00 UTC, Jan 1, 1970 into components.    *!    *! @returns    *! This function returns a mapping with the following components:    *! @mapping    *! @member int(0..60) "sec"    *! Seconds over the minute.    *! @member int(0..59) "min"    *! Minutes over the hour.    *! @member int(0..23) "hour"    *! Hour of the day.
pike.git/src/builtin_functions.c:4121:   #endif   }   #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 the beginning of 1970. +  *! which contains the number of seconds since 00:00:00 UTC, Jan 1, 1970.    *!    *! You can either call this function with a mapping containing the    *! following elements:    *! @mapping    *! @member int(0..60) "sec"    *! Seconds over the minute.    *! @member int(0..59) "min"    *! Minutes over the hour.    *! @member int(0..23) "hour"    *! Hour of the day.
pike.git/src/builtin_functions.c:4148: Inside #if defined(HAVE_MKTIME)
   *! @member int(0..1) "isdst"    *! Is daylight savings time.    *! @member int "timezone"    *! The timezone offset from UTC in seconds. If left out, the time    *! will be calculated in the local timezone.    *! @endmapping    *!    *! Or you can just send them all on one line as the second syntax suggests.    *!    *! @note -  *! On some operating systems (notably AIX), dates before Jan 1, 1970 -  *! 00:00:00 UTC are not supported. +  *! On some operating systems (notably AIX), dates before 00:00:00 +  *! UTC, Jan 1, 1970 are not supported.    *!    *! On most systems, the supported range of dates are Dec 13, 1901    *! 20:45:52 UTC through Jan 19, 2038 03:14:07 UTC (inclusive).    *!    *! @seealso    *! @[time()], @[ctime()], @[localtime()], @[gmtime()]    */   PMOD_EXPORT void f_mktime (INT32 args)   {    INT_TYPE sec, min, hour, mday, mon, year;