144 lines
4.9 KiB
C
144 lines
4.9 KiB
C
#ifndef _TIME_HEADER_H
|
|
#define _TIME_HEADER_H
|
|
|
|
#include "compiler.h"
|
|
#include "lib_macros.h"
|
|
#include "time_tm.h"
|
|
#include "time_types.h"
|
|
#include "time_state.h"
|
|
#include "time_length.h"
|
|
#include "time_tzfile.h"
|
|
|
|
// public time zone database library functions
|
|
void tzset(void);
|
|
timezone_t tzalloc(char const *name);
|
|
void tzfree(timezone_t tz);
|
|
time_t time(time_t *tloc);
|
|
time_t mktime(struct tm *);
|
|
time_t mktime_z(const timezone_t tz, struct tm *);
|
|
struct tm* localtime(const time_t *const timep);
|
|
struct tm* localtime_r(const time_t *const timep, struct tm *tmp);
|
|
struct tm* localtime_rz(timezone_t tz, const time_t *const timep, struct tm *tmp);
|
|
struct tm* gmtime(const time_t *timep);
|
|
struct tm* gmtime_r(const time_t *timep, struct tm *tmp);
|
|
time_t timegm(struct tm *const tmp);
|
|
time_t timelocal(struct tm *const tmp);
|
|
time_t timelocal_z(const timezone_t tz, struct tm *const tmp);
|
|
double difftime(const time_t time1, const time_t time0);
|
|
struct tm* offtime(const time_t *const timep, long offset);
|
|
struct tm* offtime_r(const time_t *timep, long offset, struct tm *tmp);
|
|
time_t timeoff(struct tm *const tmp, long offset);
|
|
char* ctime(const time_t *const timep);
|
|
char* ctime_r(const time_t *const timep, char *buf);
|
|
char* ctime_rz(const timezone_t tz, const time_t *const timep, char *buf);
|
|
char* asctime(const struct tm *timeptr);
|
|
char* asctime_r(const struct tm *timeptr, char *buf);
|
|
size_t strftime(char * const s, size_t maxsize, const char *const format, const struct tm *const t);
|
|
size_t strftime_l(char *s, size_t maxsize, char const *format, const struct tm *const t, locale_t locale);
|
|
char* strptime(const char *buf, const char *fmt, struct tm *tm);
|
|
char* strptime_l(const char *buf, const char *fmt, struct tm *tm, locale_t locale);
|
|
time_t time2posix(time_t t);
|
|
time_t time2posix_z(timezone_t tz, time_t t);
|
|
time_t posix2time(time_t t);
|
|
time_t posix2time_z(timezone_t tz, time_t t);
|
|
|
|
int daylight_c(void);
|
|
long timezone_c(void);
|
|
long altzone_c(void);
|
|
char** tzname_c(void);
|
|
|
|
int getsystime(struct timeval *tv);
|
|
int setsystime(struct timeval *tv);
|
|
int gettimeofday(struct timeval *tv, const timezone_t tz);
|
|
int settimeofday(const struct timeval *tv, const timezone_t tz);
|
|
|
|
int gmtoffset(time_t locale_time);
|
|
void tzsetwall(void);
|
|
const char* tzgetlocation(void);
|
|
const char* tzgetname(const timezone_t tz, int isdst);
|
|
|
|
void stou(char *s);
|
|
void utos(char *s);
|
|
|
|
// Internal time zone database library functions
|
|
struct ttinfo;
|
|
|
|
int lock(void);
|
|
void unlock(void);
|
|
|
|
int tzload(char const *name, struct state *sp, bool doextend);
|
|
bool tzparse(const char *name, struct state *const sp, bool lastditch);
|
|
|
|
int zoneinit(struct state *sp, char const *name);
|
|
void settzname(void);
|
|
void tzsetlcl(char const *name);
|
|
void tzset_unlocked(void);
|
|
void init_ttinfo(struct ttinfo *s, int_fast32_t gmtoff, bool isdst, int abbrind);
|
|
void update_tzname(struct state const *sp, struct ttinfo const *ttisp);
|
|
|
|
void gmtcheck(void);
|
|
void gmtload(struct state *const sp);
|
|
struct tm* gmtsub(
|
|
struct state const *sp,
|
|
time_t const *timep,
|
|
int_fast32_t offset,
|
|
struct tm *tmp
|
|
);
|
|
struct tm *localtime_tzset(time_t const *timep, struct tm *tmp, bool setname);
|
|
|
|
struct tm* timesub(
|
|
const time_t *const timep,
|
|
const int_fast32_t offset,
|
|
const struct state *const sp,
|
|
struct tm *const tmp
|
|
);
|
|
|
|
time_t mktime_tzname(struct state *sp, struct tm *tmp, bool setname);
|
|
|
|
bool increment_overflow(int *const ip, int j);
|
|
bool increment_overflow_time(time_t *tp, int_fast32_t j);
|
|
struct tm * localsub(
|
|
struct state const *sp,
|
|
time_t const *timep,
|
|
int_fast32_t setname,
|
|
struct tm* const tmp
|
|
);
|
|
|
|
time_t time1(
|
|
struct tm *const tmp,
|
|
struct tm *(*funcp) (struct state const *,
|
|
time_t const *,
|
|
int_fast32_t, struct tm *),
|
|
struct state const *sp,
|
|
const int_fast32_t offset);
|
|
|
|
bool CreateTimer();
|
|
void DeleteTimer();
|
|
extern struct Device* TimerBase;
|
|
extern struct timerequest* TimeRequest;
|
|
|
|
// Stadard C library functions
|
|
void bcopy(const void *src, void *dest, size_t len); // <string.h>
|
|
void *memmove(void *dest, const void * src, size_t len); // <string.h>
|
|
size_t strlen(const char *string); // <string.h>
|
|
char *strcpy(char *dest, const char *src); // <string.h>
|
|
char *strcat(char *dest, const char *src); // <string.h>
|
|
int strcmp(const char *s1, const char * s2); // <string.h>
|
|
char *strchr(const char *s, int c); // <string.h>
|
|
int strncmp(const char *s1, const char *s2, size_t n); // <string.h>
|
|
char *getenv(const char * name); // <stdlib.h>
|
|
|
|
int isdigit(char c);
|
|
int isspace(char c);
|
|
int isalpha(char c);
|
|
int toupper(char c);
|
|
int strncasecmp(const char * _s1, const char * _s2, size_t n);
|
|
|
|
#if defined(__GNUC__) && (__GNUC__ < 3)
|
|
void *memcpy(void *dst, const void *src, unsigned long len);
|
|
#else
|
|
void *memcpy(void *dst, const void *src, size_t len);
|
|
#endif
|
|
|
|
#endif
|