Revision 3386

View differences:

libsylph/utils.c
4315 4315
	return 0;
4316 4316
}
4317 4317

  
4318
time_t remote_tzoffset_sec(const gchar *zone)
4318
stime_t remote_tzoffset_sec(const gchar *zone)
4319 4319
{
4320 4320
	static gchar ustzstr[] = "PSTPDTMSTMDTCSTCDTESTEDT";
4321 4321
	gchar zone3[4];
......
4383 4383
	return remoteoffset;
4384 4384
}
4385 4385

  
4386
time_t tzoffset_sec(time_t *now)
4386
stime_t tzoffset_sec(stime_t *now)
4387 4387
{
4388
	time_t now_ = *now;
4388 4389
	struct tm gmt, *tmp, *lt;
4389 4390
	gint off;
4390 4391

  
4391
	tmp = gmtime(now);
4392
	tmp = gmtime(&now_);
4392 4393
	g_return_val_if_fail(tmp != NULL, -1);
4393 4394
	gmt = *tmp;
4394
	lt = localtime(now);
4395
	lt = localtime(&now_);
4395 4396
	g_return_val_if_fail(lt != NULL, -1);
4396 4397

  
4397 4398
	off = (lt->tm_hour - gmt.tm_hour) * 60 + lt->tm_min - gmt.tm_min;
......
4414 4415
}
4415 4416

  
4416 4417
/* calculate timezone offset (buf must not be less than 6 bytes) */
4417
gchar *tzoffset_buf(gchar *buf, time_t *now)
4418
gchar *tzoffset_buf(gchar *buf, stime_t *now)
4418 4419
{
4420
	time_t now_ = *now;
4419 4421
	struct tm gmt, *tmp, *lt;
4420 4422
	gint off;
4421 4423
	gchar sign = '+';
4422 4424

  
4423
	tmp = gmtime(now);
4425
	tmp = gmtime(&now_);
4424 4426
	g_return_val_if_fail(tmp != NULL, NULL);
4425 4427
	gmt = *tmp;
4426
	lt = localtime(now);
4428
	lt = localtime(&now_);
4427 4429
	g_return_val_if_fail(lt != NULL, NULL);
4428 4430

  
4429 4431
	off = (lt->tm_hour - gmt.tm_hour) * 60 + lt->tm_min - gmt.tm_min;
......
4450 4452
	return buf;
4451 4453
}
4452 4454

  
4453
gchar *tzoffset(time_t *now)
4455
gchar *tzoffset(stime_t *now)
4454 4456
{
4455 4457
	static gchar offset_string[6];
4456 4458

  
libsylph/utils.h
95 95
  #define HAVE_U32_TYPEDEF
96 96
#endif
97 97

  
98
#if defined(G_OS_WIN32) && !defined(_WIN64) && defined(HAVE_64BIT_TIME_T)
99
  /* for backward binary compatibility. Use only in struct definition and
100
     pointer arguments. */
101
  typedef gint32 stime_t;
102
#else
103
  typedef time_t stime_t;
104
#endif
105

  
98 106
#ifndef BIG_ENDIAN_HOST
99 107
  #if (G_BYTE_ORDER == G_BIG_ENDIAN)
100 108
    #define BIG_ENDIAN_HOST 1
......
514 522
				 gboolean	 async);
515 523

  
516 524
/* time functions */
517
time_t remote_tzoffset_sec	(const gchar	*zone);
518
time_t tzoffset_sec		(time_t		*now);
525
stime_t remote_tzoffset_sec	(const gchar	*zone);
526
stime_t tzoffset_sec		(stime_t	*now);
519 527
gchar *tzoffset_buf		(gchar		*buf,
520
				 time_t		*now);
521
gchar *tzoffset			(time_t		*now);
528
				 stime_t	*now);
529
gchar *tzoffset			(stime_t	*now);
522 530
void get_rfc822_date		(gchar		*buf,
523 531
				 gint		 len);
524 532

  
libsylph/procheader.c
873 873
	return -1;
874 874
}
875 875

  
876
time_t procheader_date_parse(gchar *dest, const gchar *src, gint len)
876
stime_t procheader_date_parse(gchar *dest, const gchar *src, gint len)
877 877
{
878 878
	static gchar monthstr[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
879 879
	gchar weekday[11];
......
951 951
	return timer;
952 952
}
953 953

  
954
void procheader_date_get_localtime(gchar *dest, gint len, const time_t timer)
954
void procheader_date_get_localtime(gchar *dest, gint len, const stime_t timer)
955 955
{
956
	time_t timer_ = timer;
956 957
	struct tm *lt;
957 958
	gchar *default_format = "%y/%m/%d(%a) %H:%M";
958 959
	gchar *buf;
959 960
	gchar tmp[BUFFSIZE];
960 961

  
961
	lt = localtime(&timer);
962
	lt = localtime(&timer_);
962 963
	if (!lt) {
963 964
		g_warning("can't get localtime of %ld\n", timer);
964 965
		dest[0] = '\0';
libsylph/procmsg.h
37 37

  
38 38
#include "folder.h"
39 39
#include "procmime.h"
40
#include "utils.h"
40 41

  
41 42
typedef enum
42 43
{
......
172 173
{
173 174
	guint  msgnum;
174 175
	gsize  size;
175
	time_t mtime;
176
	time_t date_t;
176
	stime_t mtime;
177
	stime_t date_t;
177 178

  
178 179
	MsgFlags flags;
179 180

  
libsylph/procheader.h
91 91
gchar *procheader_get_fromname		(const gchar	*str);
92 92
gchar *procheader_get_toname		(const gchar	*str);
93 93

  
94
time_t procheader_date_parse		(gchar		*dest,
94
stime_t procheader_date_parse		(gchar		*dest,
95 95
					 const gchar	*src,
96 96
					 gint		 len);
97 97
void procheader_date_get_localtime	(gchar		*dest,
98 98
					 gint		 len,
99
					 const time_t	 timer);
99
					 const stime_t	 timer);
100 100

  
101 101
#endif /* __PROCHEADER_H__ */
libsylph/folder.c
1634 1634
#endif
1635 1635
			path = attr->value;
1636 1636
		} else if (!strcmp(attr->name, "mtime"))
1637
			mtime = strtoull(attr->value, NULL, 10);
1637
			mtime = strtoll(attr->value, NULL, 10);
1638 1638
		else if (!strcmp(attr->name, "new"))
1639 1639
			new = atoi(attr->value);
1640 1640
		else if (!strcmp(attr->name, "unread"))
......
1945 1945
		}
1946 1946

  
1947 1947
		fprintf(fp,
1948
			" mtime=\"%llu\" new=\"%d\" unread=\"%d\" total=\"%d\"",
1949
			(guint64)item->mtime, item->new, item->unread, item->total);
1948
			" mtime=\"%lld\" new=\"%d\" unread=\"%d\" total=\"%d\"",
1949
			(gint64)item->mtime, item->new, item->unread, item->total);
1950 1950

  
1951 1951
		if (item->account)
1952 1952
			fprintf(fp, " account_id=\"%d\"",
libsylph/folder.h
20 20
#ifndef __FOLDER_H__
21 21
#define __FOLDER_H__
22 22

  
23
#ifdef HAVE_CONFIG_H
24
#  include "config.h"
25
#endif
26

  
23 27
#include <glib.h>
24 28
#include <time.h>
25 29

  
......
127 131
#include "prefs_account.h"
128 132
#include "session.h"
129 133
#include "procmsg.h"
134
#include "utils.h"
130 135

  
131 136
struct _Folder
132 137
{
......
272 277
	gchar *name; /* UTF-8 */
273 278
	gchar *path; /* UTF-8 */
274 279

  
275
	time_t mtime;
280
	stime_t mtime;
276 281

  
277 282
	gint new;
278 283
	gint unread;
libsylph/pop.h
29 29

  
30 30
#include "session.h"
31 31
#include "prefs_account.h"
32
#include "utils.h"
32 33

  
33 34
typedef struct _Pop3MsgInfo	Pop3MsgInfo;
34 35
typedef struct _Pop3Session	Pop3Session;
......
99 100
{
100 101
	gint size;
101 102
	gchar *uidl;
102
	time_t recv_time;
103
	stime_t recv_time;
103 104
	guint received : 1;
104 105
	guint deleted  : 1;
105 106
};
......
132 133
	gboolean new_msg_exist;
133 134
	gboolean uidl_is_valid;
134 135

  
135
	time_t current_time;
136
	stime_t current_time;
136 137

  
137 138
	Pop3ErrorValue error_val;
138 139
	gchar *error_msg;
libsylph/session.h
31 31

  
32 32
#include "socket.h"
33 33
#include "socks.h"
34
#include "utils.h"
34 35

  
35 36
#define SESSION_BUFFSIZE	8192
36 37

  
......
116 117

  
117 118
	SessionState state;
118 119

  
119
	time_t last_access_time;
120
	stime_t last_access_time;
120 121
	GTimeVal tv_prev;
121 122

  
122 123
	gint conn_id;
src/addrcache.h
28 28
#include <stdio.h>
29 29
#include <glib.h>
30 30
#include "addritem.h"
31
#include "utils.h"
31 32

  
32 33
/* Address cache */
33 34
typedef struct _AddressCache AddressCache;
......
36 37
	gint       nextID;
37 38
	gboolean   dataRead;
38 39
	gboolean   modified;
39
	time_t     modifyTime;
40
	stime_t    modifyTime;
40 41
	GHashTable *itemHash;
41 42
	GList      *tempList;
42 43
	ItemFolder *rootFolder;
src/jpilot.h
43 43

  
44 44
#include "addritem.h"
45 45
#include "addrcache.h"
46
#include "utils.h"
46 47

  
47 48
typedef struct _JPilotFile JPilotFile;
48 49

  
......
58 59
	gint                  retVal;
59 60
	gboolean              accessFlag;
60 61
	gboolean              havePC3;
61
	time_t                pc3ModifyTime;
62
	stime_t               pc3ModifyTime;
62 63
};
63 64

  
64 65
/* Limits */
autogen.sh
1 1
#!/bin/sh
2 2

  
3
aclocal -I ac \
3
ACLOCAL=aclocal-1.11
4
AUTOMAKE=automake-1.11
5

  
6
$ACLOCAL -I ac \
4 7
  && libtoolize --force --copy \
5 8
  && autoheader \
6
  && automake --add-missing --foreign --copy \
9
  && $AUTOMAKE --add-missing --foreign --copy \
7 10
  && autoconf \
8 11
  && ./configure $@
configure.in
6 6
dnl version number
7 7
MAJOR_VERSION=3
8 8
MINOR_VERSION=4
9
MICRO_VERSION=1
10
INTERFACE_AGE=1
11
BINARY_AGE=1
9
MICRO_VERSION=2
10
INTERFACE_AGE=2
11
BINARY_AGE=2
12 12
EXTRA_VERSION=
13
BUILD_REVISION=1157
13
BUILD_REVISION=1158
14 14
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
15 15

  
16 16
dnl define if this is a development release
......
21 21

  
22 22
dnl
23 23
AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
24
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
24
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
25 25
dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
26 26
dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
27 27
AC_SUBST(PACKAGE)
......
462 462
AC_CHECK_SIZEOF(unsigned short, 2)
463 463
AC_CHECK_SIZEOF(unsigned int, 4)
464 464
AC_CHECK_SIZEOF(unsigned long, 4)
465
AC_CHECK_SIZEOF(time_t)
466
AC_CHECK_SIZEOF(off_t)
465 467

  
468
if test "x$ac_cv_sizeof_time_t" = "x8"; then
469
	AC_DEFINE(HAVE_64BIT_TIME_T, 1, Define if time_t is 64-bit)
470
fi
471

  
466 472
dnl Checks for library functions.
467 473
AC_FUNC_ALLOCA
468 474
AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
ChangeLog
1
2014-04-18
2

  
3
	* libsylph/utils.[ch]
4
	  libsylph/procheader.c
5
	  libsylph/procmsg.h
6
	  libsylph/procheader.h
7
	  libsylph/folder.[ch]
8
	  libsylph/pop.h
9
	  libsylph/session.h
10
	  src/addrcache.h
11
	  src/jpilot.h
12
	  configure.in: wrapped time_t as stime_t. stime_t will be 32-bit
13
	  on win32 for backward compatibility.
14
	* configure.in: enable silent rules by default.
15
	* autogen.sh: use newer aclocal and automake.
16

  
1 17
2014-04-11
2 18

  
3 19
	* libsylph/folder.c:

Also available in: Unified diff