diff options
author | Niels De Graef <nielsdegraef@gmail.com> | 2022-07-06 21:44:30 +0200 |
---|---|---|
committer | Niels De Graef <nielsdegraef@gmail.com> | 2022-07-07 13:41:05 +0200 |
commit | 194df5463acef43f07ada8bfb05e20aeffb94a42 (patch) | |
tree | 7d283e7a4bf20137fb566e89c4409ecea9a16956 /egg | |
parent | 8927be67708f5b8fcb66e3d65b2de4b8fe77b236 (diff) | |
download | gcr-194df5463acef43f07ada8bfb05e20aeffb94a42.tar.gz |
egg: Drop usage of timegm in favor of GDateTime
Diffstat (limited to 'egg')
-rw-r--r-- | egg/egg-asn1x.c | 1 | ||||
-rw-r--r-- | egg/egg-timegm.c | 55 | ||||
-rw-r--r-- | egg/egg-timegm.h | 30 | ||||
-rw-r--r-- | egg/meson.build | 1 |
4 files changed, 0 insertions, 87 deletions
diff --git a/egg/egg-asn1x.c b/egg/egg-asn1x.c index b6522c9..47f2392 100644 --- a/egg/egg-asn1x.c +++ b/egg/egg-asn1x.c @@ -48,7 +48,6 @@ #include "egg-asn1x.h" #include "egg-asn1-defs.h" -#include "egg-timegm.h" #include <stdlib.h> #include <string.h> diff --git a/egg/egg-timegm.c b/egg/egg-timegm.c deleted file mode 100644 index 24faa4c..0000000 --- a/egg/egg-timegm.c +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright (C) 1999, 2001-2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - see <http://www.gnu.org/licenses/>. */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "egg-timegm.h" - -#ifndef HAVE_TIMEGM - -time_t -timegm(struct tm *t) -{ - time_t tl, tb; - struct tm *tg; - - tl = mktime (t); - if (tl == -1) - { - t->tm_hour--; - tl = mktime (t); - if (tl == -1) - return -1; - tl += 3600; - } - tg = gmtime (&tl); - tg->tm_isdst = 0; - tb = mktime (tg); - if (tb == -1) - { - tg->tm_hour--; - tb = mktime (tg); - if (tb == -1) - return -1; - tb += 3600; - } - return (tl - (tb - tl)); -} - -#endif diff --git a/egg/egg-timegm.h b/egg/egg-timegm.h deleted file mode 100644 index 02bec8f..0000000 --- a/egg/egg-timegm.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* Copyright (C) 1999, 2001-2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - see <http://www.gnu.org/licenses/>. */ - -#ifndef EGG_TIMEGM_H_ -#define EGG_TIMEGM_H_ - -#include <time.h> - -#ifndef HAVE_TIMEGM - -time_t timegm (struct tm *t); - -#endif - -#endif /* EGG_TIMEGM_H_ */ diff --git a/egg/meson.build b/egg/meson.build index 6888a5c..b577fd3 100644 --- a/egg/meson.build +++ b/egg/meson.build @@ -16,7 +16,6 @@ libegg_sources = [ 'egg-secure-memory.c', 'egg-symkey.c', 'egg-testing.c', - 'egg-timegm.c', ] libegg_deps = [ |