/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2010 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Research
*
* time conversion support
*/
#include <ast.h>
#include <tmx.h>
/*
* correct out of bounds fields in tm
*
* tm_isdst is not changed -- call tmxtm() to get that
*
* tm is the return value
*/
Tm_t*
{
register int n;
register int w;
Tm_t* p;
time_t t;
/*
* check for special case that adjusts tm_wday at the end
* this happens during
* nl_langinfo() => strftime() => tmfmt()
*/
if (w = !tm->tm_sec && !tm->tm_min && !tm->tm_mday && !tm->tm_year && !tm->tm_yday && !tm->tm_isdst)
{
}
/*
* adjust from shortest to longest units
*/
{
}
else if (n >= TMX_RESOLUTION)
{
}
{
}
else if (n > (59 + TM_MAXLEAP))
{
}
{
}
if (n > 59)
{
}
{
}
else if (n >= 24)
{
}
{
}
{
{
}
}
{
}
{
}
{
{
}
}
{
{
}
}
if (w)
{
p = tmmake(&t);
if (w = (w - p->tm_wday))
{
if (w < 0)
w += 7;
}
}
/*
* tm_isdst is adjusted by tmtime()
*/
return tm;
}