AmiTimeKeeper/locale.h

76 lines
2.9 KiB
C

/*-
* Copyright (c) 2020 Carsten Sonne Larsen <cs@innolan.net>
* All rights reserved.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
*
*/
#ifndef LOCALE_H_INCLUDED
#define LOCALE_H_INCLUDED
#include "compiler.h"
#include <libraries/locale.h>
#include <devices/timer.h>
#define LOCAL_TIME_NOW 0
#define TZD_SECONDS_AHEAD 1
#define TZD_MINUTES_AHEAD 2
#define TZD_TZ_LONG 3
#define TZD_TZ_SHORT 4
#define TZD_ISO8601_NO_COLON 5
#define TZD_ISO8601_COLON 6
#define TZD_ISO8601_SHORT 7
#define TZD_COMMON 8
#define TZD_ZONE_IN_PARENS 9
#define TZD_OFFSET_IN_PARENS 10
#define TZD_STD 11
#define TZD_DST 12
#define TIMEZONE_TEXT_LEN 32
#define DATETIME_TEXT_LEN 40
#define ASCIITEMPLATE "%s %s %ld %02ld:%02ld:%02ld %04ld"
#define RFC850TEMPLATE "%s, %02ld-%s-%02ld %02ld:%02ld:%02ld GMT"
#define RFC1123TEMPLATE "%s, %02ld %s %04ld %02ld:%02ld:%02ld GMT"
#define RFC2822TEMPLATE "%02ld. %s %04ld %02ld:%02ld:%02ld %s%02ld%02ld"
#define RFC3339TEMPLATEUTC "%04ld-%02ld-%02ld %02ld:%02ld:%02ld.%02ldZ"
#define RFC3339TEMPLATELOC "%04ld-%02ld-%02ld %02ld:%02ld:%02ld.%02ld%s%02ld:%02ld"
#define ISO8601TEMPLATEUTC "%04ld%02ld%02ldT%02ld%02ld%02ldZ"
#define ISO8601TEMPLATELOC "%04ld-%02ld-%02ldT%02ld:%02ld:%02ld%s%02ld:%02ld"
char *GetTimeText(ULONG);
void GetTimezoneText(char *, long);
void LogTransitionMap(void);
void Utc2ASCII(struct timeval *, char *, bool);
void Utc2DOS(struct timeval *, char *, bool);
void Utc2ARexxDate(struct timeval *, char *, bool);
void Utc2ARexxTime(struct timeval *, char *, bool);
void Utc2RFC850(struct timeval *, char *);
void Utc2RFC1123(struct timeval *, char *);
void Utc2RFC2822(struct timeval *, char *, bool);
void Utc2RFC3339(struct timeval *, char *, bool);
void Utc2ISO8601(struct timeval *, char *, bool);
#endif