/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "utc-offset.h"
#include "utc-mktime.h"
#include "imap-date.h"
#include <ctype.h>
static const char *month_names[] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
{
int offset;
/* +|-zone */
return 0;
}
{
int i;
return NULL;
/* "dd-mon-yyyy [hh:mi:ss +|-zone]"
dd is 1-2 digits and may be prefixed with space or zero. */
if (str[0] == ' ') {
/* " d-..." */
str++;
}
return NULL;
str += 2;
else {
str += 3;
}
/* month name */
for (i = 0; i < 12; i++) {
break;
}
}
return NULL;
str += 4;
/* yyyy */
return NULL;
str += 4;
return str;
}
{
return TRUE;
/* the date is outside valid range for time_t. it might still be
technically valid though, so try to handle this case.
with 64bit time_t the full 0..9999 year range is valid. */
/* too old. time_t can be signed or unsigned, handle
both cases. */
} else {
/* too high. return the highest allowed value.
we shouldn't get here with 64bit time_t,
but handle that anyway. */
#else
#endif
}
return FALSE;
}
{
return FALSE;
return TRUE;
}
int *timezone_offset_r)
{
return FALSE;
if (str[0] != ' ')
return FALSE;
str++;
/* hh: */
return FALSE;
str += 3;
/* mm: */
return FALSE;
str += 3;
/* ss */
return FALSE;
str += 3;
/* timezone */
return TRUE;
}
{
int year;
/* dd-mon- */
/* yyyy */
}
static const char *
{
char *buf;
/* @UNSAFE: but faster than t_strdup_printf() call.. */
/* hh:mi:ss */
/* timezone */
if (timezone_offset >= 0)
else {
}
return buf;
}
{
int timezone_offset;
}
{
}
{
char *buf;
}