1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2025-11-22 17:00:47 +00:00

Private tz library

This commit is contained in:
llsth
2015-04-19 00:18:23 +02:00
parent f578f3ddb8
commit fe7455d27d
2 changed files with 83 additions and 3 deletions

View File

@ -10,7 +10,7 @@ BUGEMAIL= carsten.larsen@mail.com
all: zic lib
CC = m68k-amigaos-gcc
CFLAGS = -O2 -noixemul -DTZDIR=\"LOCALE:zoneinfo\" -DHAVE_ADJTIME=0 -DHAVE_DOS_FILE_NAMES -DHAVE_LINK=0 -DHAVE_SYMLINK=0 -DHAVE_SYS_STAT_H=0 -DHAVE_TZSET=0 -Wall #-Werror
CFLAGS = -O2 -noixemul -DTZDIR=\"LOCALE:zoneinfo\" -DHAVE_ADJTIME=0 -DHAVE_DOS_FILE_NAMES -DHAVE_LINK=0 -DHAVE_SYMLINK=0 -DHAVE_SYS_STAT_H=0 -DHAVE_TZSET=0 -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone -Dtime_tz=long -DTLOCALTIME_IMPLEMENTATION -Wall #-Werror
LDFLAGS =
LDLIBS = -lgcc -liberty -lm
@ -51,8 +51,8 @@ zdump: zdump.o localtime.o asctime.o
date: date.o localtime.o strftime.o asctime.o
${CC} ${CFLAGS} -o date date.o localtime.o strftime.o asctime.o $(LDFLAGS) -lsocket $(LDLIBS)
lib: localtime.o asctime.o difftime.o
${AR} rcs libtz.a localtime.o asctime.o difftime.o
lib: localtime.o asctime.o difftime.o strftime.o
${AR} rcs libtz.a localtime.o asctime.o difftime.o strftime.o
clean:
rm -f asctime.o date.o difftime.o ialloc.o localtime.o scheck.o strftime.o zdump.o zic.o zic zdump date libtz.a

80
include/tz.h Normal file
View File

@ -0,0 +1,80 @@
/* $NetBSD: time.h,v 1.40 2010/12/16 18:36:47 christos Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)time.h 8.3 (Berkeley) 1/21/94
*/
/**
* @file tz.h
* @brief
* Parts of this file was retrieved from:
* ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-release-6/src/include/time.h
*/
extern char *tzname[2];
struct tm {
int tm_sec; /* seconds after the minute [0-61] */
int tm_min; /* minutes after the hour [0-59] */
int tm_hour; /* hours since midnight [0-23] */
int tm_mday; /* day of the month [1-31] */
int tm_mon; /* months since January [0-11] */
int tm_year; /* years since 1900 */
int tm_wday; /* days since Sunday [0-6] */
int tm_yday; /* days since January 1 [0-365] */
int tm_isdst; /* Daylight Savings Time flag */
long tm_gmtoff; /* offset from UTC in seconds */
char *tm_zone; /* timezone abbreviation */
};
typedef long time_t;
typedef struct state *timezone_t;
void tz_tzset(void);
void tz_free(const timezone_t);
timezone_t tz_alloc(const char *);
time_t tz_time(time_t *);
time_t tz_mktime_z(const timezone_t, struct tm *);
time_t tz_mktime(struct tm *);
struct tm *tz_localtime_rz(const timezone_t, const time_t *, struct tm *);
struct tm *tz_localtime_r(const time_t *, struct tm *);
struct tm *tz_localtime(const time_t *);
struct tm *tz_gmtime_r(const time_t *, struct tm *);
struct tm *tz_gmtime(const time_t *);
char *tz_ctime_r(const time_t *, char *);
char *tz_ctime(const time_t *);
char *asctime(const struct tm *);
char *asctime_r(const struct tm *, char *);
double tz_difftime(time_t, time_t);