mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
Add a separate header for time related fucntions.
This commit is contained in:
parent
0e960d940a
commit
0a043101cf
4 changed files with 80 additions and 41 deletions
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include "util.h"
|
||||
#include "i18n.h"
|
||||
#include "gettime.h"
|
||||
|
||||
static unsigned long timewarp;
|
||||
static enum { NORMAL = 0, FROZEN, FUTURE, PAST } timemode;
|
||||
|
@ -507,6 +508,23 @@ dump_isotime (const gnupg_isotime_t t)
|
|||
}
|
||||
|
||||
|
||||
/* Copy one ISO date to another, this is inline so that we can do a
|
||||
minimal sanity check. A null date (empty string) is allowed. */
|
||||
void
|
||||
gnupg_copy_time (gnupg_isotime_t d, const gnupg_isotime_t s)
|
||||
{
|
||||
if (*s)
|
||||
{
|
||||
if ((strlen (s) != 15 || s[8] != 'T'))
|
||||
BUG();
|
||||
memcpy (d, s, 15);
|
||||
d[15] = 0;
|
||||
}
|
||||
else
|
||||
*d = 0;
|
||||
}
|
||||
|
||||
|
||||
/* Add SECONDS to ATIME. SECONDS may not be negative and is limited
|
||||
to about the equivalent of 62 years which should be more then
|
||||
enough for our purposes. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue