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.469 2004/10/11 16:41:48 mast Exp $ + || $Id: builtin_functions.c,v 1.470 2004/12/08 15:16:34 mast Exp $   */      #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.469 2004/10/11 16:41:48 mast Exp $"); + RCSID("$Id: builtin_functions.c,v 1.470 2004/12/08 15:16:34 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:4251: Inside #if defined(HAVE_MKTIME)
  {    INT_TYPE sec, min, hour, mday, mon, year;    struct tm date;    int retval;       if (args<1)    SIMPLE_TOO_FEW_ARGS_ERROR("mktime", 1);       if(args == 1)    { -  MEMSET(&date, 0, sizeof(date)); -  +     push_text("sec");    push_text("min");    push_text("hour");    push_text("mday");    push_text("mon");    push_text("year");    push_text("isdst");    push_text("timezone");    f_aggregate(8);    f_rows(2);
pike.git/src/builtin_functions.c:4283: Inside #if defined(HAVE_MKTIME)
   MEMSET(&date, 0, sizeof(date));    date.tm_sec=sec;    date.tm_min=min;    date.tm_hour=hour;    date.tm_mday=mday;    date.tm_mon=mon;    date.tm_year=year;       if (args > 6) {    if (Pike_sp[6-args].type != T_INT) { -  PIKE_ERROR("mktime", "Bad argument 6 (expected int).\n", Pike_sp, args); +  PIKE_ERROR("mktime", "Bad argument 7 (expected int).\n", Pike_sp, args);    }    if (args > 7) {    if (Pike_sp[7-args].type != T_INT) { -  PIKE_ERROR("mktime", "Bad argument 7 (expected int).\n", +  PIKE_ERROR("mktime", "Bad argument 8 (expected int).\n",    Pike_sp, args);    }    }    }       if ((args > 6) && (Pike_sp[6-args].subtype == NUMBER_NUMBER))    {    date.tm_isdst = Pike_sp[6-args].u.integer;    } else {    date.tm_isdst = -1;    }      #ifdef HAVE_GMTIME    if ((args > 7) && (Pike_sp[7-args].subtype == NUMBER_NUMBER))    {    /* UTC-relative time. Use my_timegm(). */    retval = my_timegm(&date);    if (retval == -1) -  PIKE_ERROR("mktime", "Cannot convert.\n", Pike_sp, args); +  PIKE_ERROR("mktime", "Time conversion failed.\n", Pike_sp, args);    retval += Pike_sp[7-args].u.integer;    } else {   #endif /* HAVE_GMTIME */      #ifdef STRUCT_TM_HAS_GMTOFF    /* BSD-style */    date.tm_gmtoff = 0;   #else   #ifdef STRUCT_TM_HAS___TM_GMTOFF    /* Linux-style */
pike.git/src/builtin_functions.c:8052: Inside #if defined(HAVE_GMTIME)
  #ifdef HAVE_GMTIME      /* function(int:mapping(string:int)) */    ADD_EFUN("gmtime",f_gmtime,tFunc(tInt,tMap(tStr,tInt)),OPT_EXTERNAL_DEPEND);   #endif      #ifdef HAVE_MKTIME      /* function(int,int,int,int,int,int,int,void|int:int)|function(object|mapping:int) */    ADD_EFUN("mktime",f_mktime, -  tOr(tFunc(tInt tInt tInt tInt tInt tInt tInt tOr(tVoid,tInt),tInt), +  tOr(tFunc(tInt tInt tInt tInt tInt tInt +  tOr(tVoid,tInt) tOr(tVoid,tInt),tInt),    tFunc(tOr(tObj,tMapping),tInt)),OPT_TRY_OPTIMIZE);   #endif      /* function(:void) */    ADD_EFUN("_verify_internals",f__verify_internals,    tFunc(tNone,tVoid),OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND);      #ifdef PIKE_DEBUG      /* function(int:int) */