tmxscan.c revision 3f54fd611f536639ec30dd53c48e5ec1897cc7d9
c8012b9719c73f08418af7a0b4ba28fa1d200631Christian Maeder/***********************************************************************
c8012b9719c73f08418af7a0b4ba28fa1d200631Christian Maeder* This software is part of the ast package *
c8012b9719c73f08418af7a0b4ba28fa1d200631Christian Maeder* Copyright (c) 1985-2011 AT&T Intellectual Property *
c8012b9719c73f08418af7a0b4ba28fa1d200631Christian Maeder* and is licensed under the *
c8012b9719c73f08418af7a0b4ba28fa1d200631Christian Maeder* Eclipse Public License, Version 1.0 *
23d36f448c5a8c02972d7f5de8713738bd9327fbChristian Maeder* by AT&T Intellectual Property *
c8012b9719c73f08418af7a0b4ba28fa1d200631Christian Maeder* A copy of the License is available at *
c8012b9719c73f08418af7a0b4ba28fa1d200631Christian Maeder* http://www.eclipse.org/org/documents/epl-v10.html *
#pragma prototyped
#include <tmx.h>
#include <ctype.h>
int year;
int mon;
int week;
int weektype;
int yday;
int mday;
int wday;
int hour;
int min;
int sec;
int meridian;
int zone;
} Set_t;
#define CLEAR(s) (s.year=s.mon=s.week=s.weektype=s.yday=s.mday=s.wday=s.hour=s.min=s.sec=s.meridian=(-1),s.nsec=1000000000L,s.zone=TM_LOCALZONE)
#define INDEX(m,x) (((n)>=((x)-(m)))?((n)-=((x)-(m))):(n))
#define NUMBER(d,m,x) do \
goto next; \
static Time_t
Time_t t;
static Time_t
int hi;
int lo;
int pedantic;
Time_t x;
while (isspace(*s))
if (!(d = *format++))
format--;
format--;
more:
goto get_wday;
goto next;
goto get_mon;
goto next;
goto next;
if (*format)
d = *format++;
goto more;
if (pedantic)
while (isspace(*s))
goto next;
x = strtoul(s, &u, 0);
goto next;
if (n < TM_WINDOW)
goto again;
x = tmxdate(s, e, t);
goto next;
goto done;
goto again;
goto next;
goto next;
format = (const char*)p;
else if (isspace(d))
while (isspace(*s))
next:
if (*format)
p = (char*)format;
format = (const char*)p;
goto again;
done:
while (isspace(*s))
format++;
*f = (char*)format;
Time_t x;
static int initialized;
static char** datemask;
tmlocale();
if (!initialized)
off_t m;
if (p = newof(0, char*, n, m))
free(p);
datemask = p;
if (p = datemask)
*f = (char*)format;
if (format)
return tmxdate(s, e, t);