Rcpp Version 0.9.10
Date.cpp File Reference
#include <Rcpp/Date.h>
#include <Rcpp/Function.h>
#include <time.h>
#include "sys/types.h"
#include "string.h"
#include "limits.h"
#include <errno.h>
#include "stdlib.h"
#include "stdint.h"
#include "stdio.h"
#include "fcntl.h"
#include "float.h"
#include <unistd.h>
Include dependency graph for Date.cpp:

Go to the source code of this file.

Classes

struct  Rcpp::tzhead
struct  Rcpp::ttinfo
struct  Rcpp::lsinfo
struct  Rcpp::state
struct  Rcpp::rule

Namespaces

namespace  Rcpp
 

Rcpp API.


Defines

#define isleap(y)   ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
#define days_in_year(year)   (isleap(year) ? 366 : 365)
#define _NO_OLDNAMES
#define EOVERFLOW   79
#define TYPE_BIT(type)   (sizeof (type) * CHAR_BIT)
#define TYPE_SIGNED(type)   (((type) -1) < 0)
#define TYPE_INTEGRAL(type)   (((type) 0.5) != 0.5)
#define GRANDPARENTED   "Local time zone must be set--see zic manual page"
#define YEARSPERREPEAT   400
#define AVGSECSPERYEAR   31556952L
#define SECSPERREPEAT   ((int_fast64_t) YEARSPERREPEAT * (int_fast64_t) AVGSECSPERYEAR)
#define SECSPERREPEAT_BITS   34
#define is_digit(c)   ((unsigned)(c) - '0' <= 9)
#define INITIALIZE(x)   (x = 0)
#define TZFILE_H
#define TZDIR   "/usr/local/etc/zoneinfo"
#define TZDEFAULT   "localtime"
#define TZDEFRULES   "America/New_York"
#define TZ_MAGIC   "TZif"
#define TZ_MAX_TIMES   1200
#define TZ_MAX_TYPES   256
#define TZ_MAX_CHARS   50
#define TZ_MAX_LEAPS   50
#define SECSPERMIN   60
#define MINSPERHOUR   60
#define HOURSPERDAY   24
#define DAYSPERWEEK   7
#define DAYSPERNYEAR   365
#define DAYSPERLYEAR   366
#define SECSPERHOUR   (SECSPERMIN * MINSPERHOUR)
#define SECSPERDAY   ((long) SECSPERHOUR * HOURSPERDAY)
#define MONSPERYEAR   12
#define TM_SUNDAY   0
#define TM_MONDAY   1
#define TM_TUESDAY   2
#define TM_WEDNESDAY   3
#define TM_THURSDAY   4
#define TM_FRIDAY   5
#define TM_SATURDAY   6
#define TM_JANUARY   0
#define TM_FEBRUARY   1
#define TM_MARCH   2
#define TM_APRIL   3
#define TM_MAY   4
#define TM_JUNE   5
#define TM_JULY   6
#define TM_AUGUST   7
#define TM_SEPTEMBER   8
#define TM_OCTOBER   9
#define TM_NOVEMBER   10
#define TM_DECEMBER   11
#define TM_YEAR_BASE   baseYear
#define EPOCH_YEAR   1970
#define EPOCH_WDAY   TM_THURSDAY
#define isleap(y)   (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
#define isleap_sum(a, b)   isleap((a) % 400 + (b) % 400)
#define OPEN_MODE   O_RDONLY
#define TZDEFRULESTRING   ",M4.1.0,M10.5.0"
#define BIGGEST(a, b)   (((a) > (b)) ? (a) : (b))
#define MY_TZNAME_MAX   255
#define JULIAN_DAY   0
#define DAY_OF_YEAR   1
#define MONTH_NTH_DAY_OF_WEEK   2
#define gmtptr   (&gmtmem)

Functions

static struct tm * Rcpp::gmtime_ (const time_t *const timep)
Date Rcpp::operator+ (const Date &date, int offset)
int Rcpp::operator- (const Date &d1, const Date &d2)
bool Rcpp::operator< (const Date &d1, const Date &d2)
bool Rcpp::operator> (const Date &d1, const Date &d2)
bool Rcpp::operator== (const Date &d1, const Date &d2)
bool Rcpp::operator>= (const Date &d1, const Date &d2)
bool Rcpp::operator<= (const Date &d1, const Date &d2)
bool Rcpp::operator!= (const Date &d1, const Date &d2)
template<>
SEXP Rcpp::wrap (const Date &date)
static int Rcpp::tzparse (const char *name, struct state *sp, int lastditch)
static int Rcpp::typesequiv (const struct state *sp, int a, int b)
static const char * Rcpp::getsecs (const char *strp, long *secsp)
static const char * Rcpp::getnum (const char *strp, int *const nump, const int min, const int max)
static const char * Rcpp::getrule (const char *strp, struct rule *const rulep)
static time_t Rcpp::transtime (const time_t janfirst, const int year, const struct rule *const rulep, const long offset)
static struct tm * Rcpp::timesub (const time_t *const timep, const long offset, const struct state *const sp, struct tm *const tmp)
static int Rcpp::leaps_thru_end_of (const int y)
static int Rcpp::increment_overflow (int *number, int delta)
static long Rcpp::detzcode (const char *const codep)
static time_t Rcpp::detzcode64 (const char *const codep)
static int Rcpp::differ_by_repeat (const time_t t1, const time_t t0)
static const char * Rcpp::getzname (const char *strp)
static const char * Rcpp::getqzname (const char *strp, const int delim)
static const char * Rcpp::getoffset (const char *strp, long *const offsetp)
static int Rcpp::tzload (const char *name, struct state *const sp, const int doextend)
static void Rcpp::gmtload (struct state *const sp)
static struct tm * Rcpp::gmtsub (const time_t *const timep, const long offset, struct tm *const tmp)

Variables

static const char Rcpp::gmt [] = "GMT"
static const int Rcpp::mon_lengths [2][MONSPERYEAR]
static const int Rcpp::year_lengths [2]
static int Rcpp::gmt_is_set
static struct state Rcpp::gmtmem
static struct tm Rcpp::tm

Define Documentation

#define _NO_OLDNAMES

Definition at line 172 of file Date.cpp.

#define AVGSECSPERYEAR   31556952L

Definition at line 196 of file Date.cpp.

#define BIGGEST (   a,
  b 
)    (((a) > (b)) ? (a) : (b))

Definition at line 397 of file Date.cpp.

#define DAY_OF_YEAR   1

Definition at line 443 of file Date.cpp.

Referenced by Rcpp::getrule(), and Rcpp::transtime().

#define days_in_year (   year)    (isleap(year) ? 366 : 365)

Referenced by Rcpp::Date::mktime00().

#define DAYSPERLYEAR   366

Definition at line 326 of file Date.cpp.

Referenced by Rcpp::getrule(), and Rcpp::timesub().

#define DAYSPERNYEAR   365

Definition at line 325 of file Date.cpp.

Referenced by Rcpp::getrule(), and Rcpp::timesub().

#define DAYSPERWEEK   7

Definition at line 324 of file Date.cpp.

Referenced by Rcpp::getrule(), Rcpp::getsecs(), Rcpp::timesub(), and Rcpp::transtime().

#define EOVERFLOW   79

Definition at line 178 of file Date.cpp.

#define EPOCH_WDAY   TM_THURSDAY

Definition at line 355 of file Date.cpp.

Referenced by Rcpp::timesub().

#define EPOCH_YEAR   1970

Definition at line 354 of file Date.cpp.

Referenced by Rcpp::timesub(), and Rcpp::tzparse().

#define gmtptr   (&gmtmem)

Definition at line 460 of file Date.cpp.

Referenced by Rcpp::gmtsub().

#define GRANDPARENTED   "Local time zone must be set--see zic manual page"

Definition at line 194 of file Date.cpp.

#define HOURSPERDAY   24

Definition at line 323 of file Date.cpp.

Referenced by Rcpp::getsecs().

#define INITIALIZE (   x)    (x = 0)

Definition at line 200 of file Date.cpp.

Referenced by Rcpp::transtime(), and Rcpp::tzparse().

#define is_digit (   c)    ((unsigned)(c) - '0' <= 9)

Definition at line 199 of file Date.cpp.

Referenced by Rcpp::getnum(), Rcpp::getrule(), and Rcpp::getzname().

#define isleap (   y)    ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)

Definition at line 357 of file Date.cpp.

Referenced by Rcpp::Date::mktime00(), Rcpp::timesub(), Rcpp::transtime(), and Rcpp::tzparse().

#define isleap (   y)    (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))

Definition at line 357 of file Date.cpp.

#define isleap_sum (   a,
  b 
)    isleap((a) % 400 + (b) % 400)

Definition at line 371 of file Date.cpp.

#define JULIAN_DAY   0

Definition at line 442 of file Date.cpp.

Referenced by Rcpp::getrule(), and Rcpp::transtime().

#define MINSPERHOUR   60

Definition at line 322 of file Date.cpp.

Referenced by Rcpp::getsecs().

#define MONSPERYEAR   12

Definition at line 329 of file Date.cpp.

Referenced by Rcpp::getrule().

#define MONTH_NTH_DAY_OF_WEEK   2

Definition at line 444 of file Date.cpp.

Referenced by Rcpp::getrule(), and Rcpp::transtime().

#define MY_TZNAME_MAX   255

Definition at line 403 of file Date.cpp.

#define OPEN_MODE   O_RDONLY

Definition at line 381 of file Date.cpp.

Referenced by Rcpp::tzload().

#define SECSPERDAY   ((long) SECSPERHOUR * HOURSPERDAY)

Definition at line 328 of file Date.cpp.

Referenced by Rcpp::timesub(), Rcpp::transtime(), and Rcpp::tzparse().

#define SECSPERHOUR   (SECSPERMIN * MINSPERHOUR)

Definition at line 327 of file Date.cpp.

Referenced by Rcpp::getrule(), Rcpp::getsecs(), Rcpp::timesub(), and Rcpp::tzparse().

#define SECSPERMIN   60

Definition at line 321 of file Date.cpp.

Referenced by Rcpp::getsecs(), and Rcpp::timesub().

#define SECSPERREPEAT   ((int_fast64_t) YEARSPERREPEAT * (int_fast64_t) AVGSECSPERYEAR)

Definition at line 197 of file Date.cpp.

Referenced by Rcpp::differ_by_repeat().

#define SECSPERREPEAT_BITS   34

Definition at line 198 of file Date.cpp.

Referenced by Rcpp::differ_by_repeat().

#define TM_APRIL   3

Definition at line 342 of file Date.cpp.

#define TM_AUGUST   7

Definition at line 346 of file Date.cpp.

#define TM_DECEMBER   11

Definition at line 350 of file Date.cpp.

#define TM_FEBRUARY   1

Definition at line 340 of file Date.cpp.

#define TM_FRIDAY   5

Definition at line 336 of file Date.cpp.

#define TM_JANUARY   0

Definition at line 339 of file Date.cpp.

#define TM_JULY   6

Definition at line 345 of file Date.cpp.

#define TM_JUNE   5

Definition at line 344 of file Date.cpp.

#define TM_MARCH   2

Definition at line 341 of file Date.cpp.

#define TM_MAY   4

Definition at line 343 of file Date.cpp.

#define TM_MONDAY   1

Definition at line 332 of file Date.cpp.

#define TM_NOVEMBER   10

Definition at line 349 of file Date.cpp.

#define TM_OCTOBER   9

Definition at line 348 of file Date.cpp.

#define TM_SATURDAY   6

Definition at line 337 of file Date.cpp.

#define TM_SEPTEMBER   8

Definition at line 347 of file Date.cpp.

#define TM_SUNDAY   0

Definition at line 331 of file Date.cpp.

#define TM_THURSDAY   4

Definition at line 335 of file Date.cpp.

#define TM_TUESDAY   2

Definition at line 333 of file Date.cpp.

#define TM_WEDNESDAY   3

Definition at line 334 of file Date.cpp.

#define TM_YEAR_BASE   baseYear

Definition at line 352 of file Date.cpp.

#define TYPE_BIT (   type)    (sizeof (type) * CHAR_BIT)

Definition at line 191 of file Date.cpp.

Referenced by Rcpp::differ_by_repeat().

#define TYPE_INTEGRAL (   type)    (((type) 0.5) != 0.5)

Definition at line 193 of file Date.cpp.

Referenced by Rcpp::differ_by_repeat(), and Rcpp::tzload().

#define TYPE_SIGNED (   type)    (((type) -1) < 0)

Definition at line 192 of file Date.cpp.

Referenced by Rcpp::differ_by_repeat(), and Rcpp::tzload().

#define TZ_MAGIC   "TZif"

Definition at line 241 of file Date.cpp.

#define TZ_MAX_CHARS   50

Definition at line 313 of file Date.cpp.

Referenced by Rcpp::tzload().

#define TZ_MAX_LEAPS   50

Definition at line 318 of file Date.cpp.

Referenced by Rcpp::tzload().

#define TZ_MAX_TIMES   1200

Definition at line 296 of file Date.cpp.

Referenced by Rcpp::tzload(), and Rcpp::tzparse().

#define TZ_MAX_TYPES   256

Definition at line 301 of file Date.cpp.

Referenced by Rcpp::tzload().

#define TZDEFAULT   "localtime"

Definition at line 230 of file Date.cpp.

Referenced by Rcpp::tzload().

#define TZDEFRULES   "America/New_York"

Definition at line 234 of file Date.cpp.

Referenced by Rcpp::tzparse().

#define TZDEFRULESTRING   ",M4.1.0,M10.5.0"

Definition at line 394 of file Date.cpp.

Referenced by Rcpp::tzparse().

#define TZDIR   "/usr/local/etc/zoneinfo"

Definition at line 226 of file Date.cpp.

#define TZFILE_H

Definition at line 206 of file Date.cpp.

#define YEARSPERREPEAT   400

Definition at line 195 of file Date.cpp.

Referenced by Rcpp::tzload().

 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Defines