aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2014-04-18 08:13:07 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2014-04-18 08:13:07 +0000
commit125a300931300ed5ed24c27a7f4f3479d895b790 (patch)
tree86fa0b10e6df02e670a3ec5a9ad594212f50a901
parentc554190ffe6ade73009846ba6729bb79413c5346 (diff)
replaced 'struct stat' with GStatBuf.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3389 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog14
-rw-r--r--libsylph/mh.c6
-rw-r--r--libsylph/procheader.c2
-rw-r--r--libsylph/socket.c2
-rw-r--r--libsylph/utils.c8
-rw-r--r--libsylph/utils.h8
-rw-r--r--src/addrbook.c2
-rw-r--r--src/addrcache.c4
-rw-r--r--src/compose.c2
-rw-r--r--src/jpilot.c4
-rw-r--r--src/template.c2
11 files changed, 38 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 3ad2bc83..006fe0c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
2014-04-18
+ * libsylph/utils.[ch]
+ libsylph/mh.c
+ libsylph/procheader.c
+ libsylph/socket.c
+ src/addrcache.c
+ src/compose.c
+ src/template.c
+ src/addrbook.c
+ src/jpilot.c: replaced 'struct stat' passed to g_*stat() with
+ GStatBuf, which will be defined as struct _stat32 (win32) or
+ struct stat.
+
+2014-04-18
+
* configure.in: added -lgtkmacintegration check.
* src/compose.c
src/addressbook.c
diff --git a/libsylph/mh.c b/libsylph/mh.c
index e30c0078..c1f06797 100644
--- a/libsylph/mh.c
+++ b/libsylph/mh.c
@@ -937,7 +937,7 @@ static gint mh_remove_all_msg(Folder *folder, FolderItem *item)
static gboolean mh_is_msg_changed(Folder *folder, FolderItem *item,
MsgInfo *msginfo)
{
- struct stat s;
+ GStatBuf s;
gchar buf[16];
if (g_stat(utos_buf(buf, msginfo->msgnum), &s) < 0 ||
@@ -1460,7 +1460,7 @@ static gint mh_remove_folder(Folder *folder, FolderItem *item)
static time_t mh_get_mtime(FolderItem *item)
{
gchar *path;
- struct stat s;
+ GStatBuf s;
path = folder_item_get_path(item);
if (g_stat(path, &s) < 0) {
@@ -1676,7 +1676,7 @@ static void mh_scan_tree_recursive(FolderItem *item)
#else
DIR *dp;
struct dirent *d;
- struct stat s;
+ GStatBuf s;
#endif
const gchar *dir_name;
gchar *fs_path;
diff --git a/libsylph/procheader.c b/libsylph/procheader.c
index 96cca15c..6c942e70 100644
--- a/libsylph/procheader.c
+++ b/libsylph/procheader.c
@@ -519,7 +519,7 @@ void procheader_get_header_fields(FILE *fp, HeaderEntry hentry[])
MsgInfo *procheader_parse_file(const gchar *file, MsgFlags flags,
gboolean full)
{
- struct stat s;
+ GStatBuf s;
FILE *fp;
MsgInfo *msginfo;
diff --git a/libsylph/socket.c b/libsylph/socket.c
index 6da0b6f8..18ffbe48 100644
--- a/libsylph/socket.c
+++ b/libsylph/socket.c
@@ -792,7 +792,7 @@ static void resolver_init(void)
{
#ifdef G_OS_UNIX
static time_t resolv_conf_mtime = 0;
- struct stat s;
+ GStatBuf s;
if (g_stat("/etc/resolv.conf", &s) == 0 &&
s.st_mtime != resolv_conf_mtime) {
diff --git a/libsylph/utils.c b/libsylph/utils.c
index 2b4f9f3c..015406d5 100644
--- a/libsylph/utils.c
+++ b/libsylph/utils.c
@@ -2397,7 +2397,7 @@ const gchar *get_domain_name(void)
off_t get_file_size(const gchar *file)
{
- struct stat s;
+ GStatBuf s;
if (g_stat(file, &s) < 0) {
FILE_OP_ERROR(file, "stat");
@@ -2509,7 +2509,7 @@ gboolean file_exist(const gchar *file, gboolean allow_fifo)
return FALSE;
if (allow_fifo) {
- struct stat s;
+ GStatBuf s;
if (g_stat(file, &s) < 0) {
if (ENOENT != errno) FILE_OP_ERROR(file, "stat");
@@ -2717,7 +2717,7 @@ gint remove_expired_files(const gchar *dir, guint hours)
{
GDir *dp;
const gchar *dir_name;
- struct stat s;
+ GStatBuf s;
gchar *prev_dir;
guint file_no;
time_t mtime, now, expire_time;
@@ -2771,7 +2771,7 @@ gint remove_expired_files(const gchar *dir, guint hours)
static gint remove_dir_recursive_real(const gchar *dir)
{
- struct stat s;
+ GStatBuf s;
GDir *dp;
const gchar *dir_name;
gchar *prev_dir;
diff --git a/libsylph/utils.h b/libsylph/utils.h
index f93f4ce8..8fedd9d0 100644
--- a/libsylph/utils.h
+++ b/libsylph/utils.h
@@ -103,6 +103,14 @@ gint syl_link (const gchar *src,
typedef time_t stime_t;
#endif
+#if !GLIB_CHECK_VERSION(2, 26, 0)
+#if (defined (_MSC_VER) || defined (__MINGW32__)) && !defined(_WIN64)
+ typedef struct _stat32 GStatBuf;
+#else
+ typedef struct stat GStatBuf;
+#endif
+#endif
+
#ifndef BIG_ENDIAN_HOST
#if (G_BYTE_ORDER == G_BIG_ENDIAN)
#define BIG_ENDIAN_HOST 1
diff --git a/src/addrbook.c b/src/addrbook.c
index 95bf6ba5..bcc4cabc 100644
--- a/src/addrbook.c
+++ b/src/addrbook.c
@@ -1639,7 +1639,7 @@ GList *addrbook_get_bookfile_list( AddressBookFile *book ) {
gchar *adbookdir;
GDir *dir;
const gchar *dir_name;
- struct stat statbuf;
+ GStatBuf statbuf;
gchar buf[ WORK_BUFLEN ];
gchar numbuf[ WORK_BUFLEN ];
gint len, lenpre, lensuf, lennum;
diff --git a/src/addrcache.c b/src/addrcache.c
index eb8116c1..55c7212f 100644
--- a/src/addrcache.c
+++ b/src/addrcache.c
@@ -192,7 +192,7 @@ void addrcache_free( AddressCache *cache ) {
*/
gboolean addrcache_check_file( AddressCache *cache, gchar *path ) {
gboolean retVal;
- struct stat filestat;
+ GStatBuf filestat;
retVal = TRUE;
if( path ) {
if( 0 == g_stat( path, &filestat ) ) {
@@ -208,7 +208,7 @@ gboolean addrcache_check_file( AddressCache *cache, gchar *path ) {
*/
gboolean addrcache_mark_file( AddressCache *cache, gchar *path ) {
gboolean retVal = FALSE;
- struct stat filestat;
+ GStatBuf filestat;
if( path ) {
if( 0 == g_stat( path, &filestat ) ) {
cache->modifyTime = filestat.st_mtime;
diff --git a/src/compose.c b/src/compose.c
index 9c62e04d..f1aaa65d 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -7483,7 +7483,7 @@ static void compose_draft_cb(gpointer data, guint action, GtkWidget *widget)
C_UNLOCK();
compose_destroy(compose);
} else {
- struct stat s;
+ GStatBuf s;
gchar *path;
path = folder_item_fetch_msg(draft, msgnum);
diff --git a/src/jpilot.c b/src/jpilot.c
index c6e3f3ee..9df9916f 100644
--- a/src/jpilot.c
+++ b/src/jpilot.c
@@ -338,7 +338,7 @@ static gchar *jpilot_get_pc3_file( JPilotFile *pilotFile ) {
*/
static gboolean jpilot_mark_files( JPilotFile *pilotFile ) {
gboolean retVal = FALSE;
- struct stat filestat;
+ GStatBuf filestat;
gchar *pcFile;
/* Mark PDB file cache */
@@ -365,7 +365,7 @@ static gboolean jpilot_mark_files( JPilotFile *pilotFile ) {
*/
static gboolean jpilot_check_files( JPilotFile *pilotFile ) {
gboolean retVal = TRUE;
- struct stat filestat;
+ GStatBuf filestat;
gchar *pcFile;
/* Check main file */
diff --git a/src/template.c b/src/template.c
index 3e8781fd..f20750d1 100644
--- a/src/template.c
+++ b/src/template.c
@@ -126,7 +126,7 @@ GSList *template_read_config(void)
gchar *filename;
GDir *dir;
const gchar *dir_name;
- struct stat s;
+ GStatBuf s;
Template *tmpl;
guint tmplid;
GSList *tmpl_list = NULL;