Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
912224f8
...
912224f8b9fd7638fd48b86670fffca693c2bf9f
authored
2011-12-08 19:23:03 +0200
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Rename mu_tm2time to mu_datetime_to_utc.
1 parent
7efa4777
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
12 additions
and
13 deletions
imap4d/util.c
include/mailutils/datetime.h
libmailutils/datetime/streamftime.c
libmailutils/datetime/unixtime.c
libmu_sieve/actions.c
libproto/imap/mbox.c
mh/mh_format.c
mh/sortm.c
imap4d/util.c
View file @
912224f
...
...
@@ -379,7 +379,7 @@ util_parse_internal_date (char *date, time_t *timep,
adjust_tm
(
&
tm
,
&
tz
,
flag
);
time
=
mu_
tm2time
(
&
tm
,
&
tz
);
time
=
mu_
datetime_to_utc
(
&
tm
,
&
tz
);
if
(
time
==
(
time_t
)
-
1
)
return
2
;
...
...
@@ -398,7 +398,7 @@ util_parse_822_date (const char *date, time_t *timep,
if
(
mu_parse822_date_time
(
&
p
,
date
+
strlen
(
date
),
&
tm
,
&
tz
)
==
0
)
{
adjust_tm
(
&
tm
,
&
tz
,
flag
);
*
timep
=
mu_
tm2time
(
&
tm
,
&
tz
);
*
timep
=
mu_
datetime_to_utc
(
&
tm
,
&
tz
);
return
0
;
}
return
1
;
...
...
@@ -414,7 +414,7 @@ util_parse_ctime_date (const char *date, time_t *timep,
if
(
mu_scan_datetime
(
date
,
MU_DATETIME_FROM
,
&
tm
,
&
tz
,
NULL
)
==
0
)
{
adjust_tm
(
&
tm
,
&
tz
,
flag
);
*
timep
=
mu_
tm2time
(
&
tm
,
&
tz
);
*
timep
=
mu_
datetime_to_utc
(
&
tm
,
&
tz
);
return
0
;
}
return
1
;
...
...
include/mailutils/datetime.h
View file @
912224f
...
...
@@ -59,7 +59,7 @@ struct mu_timezone
int
mu_parse_date
(
const
char
*
p
,
time_t
*
rettime
,
const
time_t
*
now
);
time_t
mu_utc_offset
(
void
);
time_t
mu_
tm2time
(
struct
tm
*
timeptr
,
struct
mu_timezone
*
tz
);
time_t
mu_
datetime_to_utc
(
struct
tm
*
timeptr
,
struct
mu_timezone
*
tz
);
size_t
mu_strftime
(
char
*
s
,
size_t
max
,
const
char
*
format
,
struct
tm
*
tm
);
int
mu_c_streamftime
(
mu_stream_t
str
,
const
char
*
fmt
,
struct
tm
*
tm
,
...
...
libmailutils/datetime/streamftime.c
View file @
912224f
...
...
@@ -298,7 +298,7 @@ mu_c_streamftime (mu_stream_t str, const char *fmt, struct tm *input_tm,
case
's'
:
/* The number of seconds since the Epoch */
rc
=
mu_stream_printf
(
str
,
"%lu"
,
(
unsigned
long
)
mu_
tm2time
(
&
tm
,
tz
));
(
unsigned
long
)
mu_
datetime_to_utc
(
&
tm
,
tz
));
break
;
case
'S'
:
...
...
libmailutils/datetime/unixtime.c
View file @
912224f
...
...
@@ -25,10 +25,9 @@
#define JD_OF_EPOCH 2440588
/* Convert struct tm into time_t, taking into account timezone offset. */
/* FIXME: Ignores DST */
/* Convert struct tm into UTC. */
time_t
mu_
tm2time
(
struct
tm
*
tm
,
struct
mu_timezone
*
tz
)
mu_
datetime_to_utc
(
struct
tm
*
tm
,
struct
mu_timezone
*
tz
)
{
int
jd
=
mu_datetime_julianday
(
tm
->
tm_year
+
1900
,
tm
->
tm_mon
+
1
,
tm
->
tm_mday
);
...
...
libmu_sieve/actions.c
View file @
912224f
...
...
@@ -202,7 +202,7 @@ mime_create_ds (mu_mime_t mime, mu_message_t orig)
mu_message_get_envelope
(
orig
,
&
env
);
if
(
mu_envelope_sget_date
(
env
,
&
p
)
==
0
&&
mu_scan_datetime
(
p
,
MU_DATETIME_FROM
,
&
tm
,
&
tz
,
NULL
)
==
0
)
t
=
mu_
tm2time
(
&
tm
,
&
tz
);
t
=
mu_
datetime_to_utc
(
&
tm
,
&
tz
);
else
/* Use local time instead */
t
=
time
(
NULL
);
...
...
libproto/imap/mbox.c
View file @
912224f
...
...
@@ -1530,7 +1530,7 @@ imap_envelope_date (mu_envelope_t envelope, char *buffer, size_t buflen,
if
(
mu_parse_imap_date_time
(
datep
,
&
tm
,
&
tz
)
!=
0
)
now
=
(
time_t
)
-
1
;
else
now
=
mu_
tm2time
(
&
tm
,
&
tz
);
now
=
mu_
datetime_to_utc
(
&
tm
,
&
tz
);
/* if the time was unparseable, or mktime() didn't like what we
parsed, use the calendar time. */
...
...
mh/mh_format.c
View file @
912224f
...
...
@@ -1458,7 +1458,7 @@ builtin_clock (struct mh_machine *mach)
if
(
_parse_date
(
mach
,
&
tm
,
&
tz
))
return
;
mach
->
arg_num
=
mu_
tm2time
(
&
tm
,
&
tz
);
mach
->
arg_num
=
mu_
datetime_to_utc
(
&
tm
,
&
tz
);
}
/* rclock date integer seconds prior to current time*/
...
...
@@ -1471,7 +1471,7 @@ builtin_rclock (struct mh_machine *mach)
if
(
_parse_date
(
mach
,
&
tm
,
&
tz
))
return
;
mach
->
arg_num
=
now
-
mu_
tm2time
(
&
tm
,
&
tz
);
mach
->
arg_num
=
now
-
mu_
datetime_to_utc
(
&
tm
,
&
tz
);
}
struct
...
...
mh/sortm.c
View file @
912224f
...
...
@@ -341,7 +341,7 @@ _parse_822_date (char *date, time_t * timep)
if
(
mu_parse822_date_time
(
&
p
,
date
+
strlen
(
date
),
&
tm
,
&
tz
)
==
0
)
{
*
timep
=
mu_
tm2time
(
&
tm
,
&
tz
);
*
timep
=
mu_
datetime_to_utc
(
&
tm
,
&
tz
);
return
0
;
}
return
1
;
...
...
Please
register
or
sign in
to post a comment