View of xos/usr/lib/libc/time.h


XOS | Parent Directory | View | Download

/* Copyright (C) 2008  Emmanuel Varoquaux
 
   This file is part of XOS.
 
   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.
 
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
 
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
#ifndef TIME_H
#define TIME_H
 
#include <time.h>
 
#include <limits.h>
 
struct dst_date_struct {
  int mon;                    /* mois (0-11) */
  int mweek;                  /* semaine du mois (1-5) */
  int wday;                   /* jour de la semaine (0-6) */
  long time;                  /* heure en secondes */
};
 
struct dst_struct {
  char name[TZNAME_MAX + 1];  /* nom du fuseau horaire pendant l'heure d'ete */
  long offset;                /* decalage en secondes */
  struct dst_date_struct start; /* date de debut de l'heure d'ete */
  struct dst_date_struct end; /* date de retour a l'heure d'hiver */
};
 
struct tz_struct {
  char name[TZNAME_MAX + 1];  /* nom du fuseau horaire */
  long offset;                /* decalage en secondes */
  const struct dst_struct *dst; /* heure d'ete */
};
 
extern const struct tz_struct *const __utc_tz;
extern const struct tz_struct *__current_tz;
 
typeof (tzset) __tzset;
 
void __tz_init();
 
struct tm *__make_tm(const time_t *timep, const struct tz_struct *tz, struct tm *result);
time_t __make_time(struct tm *tm, const struct tz_struct *tz);
 
#endif