mirror of
https://github.com/haiwen/seafile.git
synced 2025-01-08 11:57:44 +08:00
portable visual studio 2019 (#2378)
* portable visual studio 2019 * Need alignment and fix compile warning * Define related headers in common.h * del reference config.h * Add files generated by vala * Def reference config.h for windows * Support vs build Co-authored-by: sun <1184550842@qq.com>
This commit is contained in:
parent
88da64bced
commit
cb877e00d9
12
.gitignore
vendored
12
.gitignore
vendored
@ -61,13 +61,10 @@ debian/*.substvars
|
|||||||
lib/*.tmp
|
lib/*.tmp
|
||||||
lib/dir.c
|
lib/dir.c
|
||||||
lib/dirent.c
|
lib/dirent.c
|
||||||
lib/seafile-object.h
|
|
||||||
lib/task.c
|
|
||||||
lib/webaccess.c
|
lib/webaccess.c
|
||||||
lib/branch.c
|
lib/branch.c
|
||||||
lib/commit.c
|
lib/commit.c
|
||||||
lib/crypt.c
|
lib/crypt.c
|
||||||
lib/repo.c
|
|
||||||
lib/copy-task.c
|
lib/copy-task.c
|
||||||
app/seafile
|
app/seafile
|
||||||
app/seafserv-tool
|
app/seafserv-tool
|
||||||
@ -125,3 +122,12 @@ server/gc/seaf-migrate
|
|||||||
/test-driver
|
/test-driver
|
||||||
*.dmp
|
*.dmp
|
||||||
/symbols
|
/symbols
|
||||||
|
|
||||||
|
# visual studio
|
||||||
|
Debug
|
||||||
|
msi/custom/x64
|
||||||
|
msi/ext.wxi
|
||||||
|
msi/shell.wxs
|
||||||
|
seafile.vcxproj.user
|
||||||
|
x64
|
||||||
|
msi/custom/seafile_custom.vcxproj.user
|
||||||
|
@ -12,7 +12,9 @@
|
|||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#ifndef WIN32
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "block-backend.h"
|
#include "block-backend.h"
|
||||||
#include "obj-store.h"
|
#include "obj-store.h"
|
||||||
@ -190,6 +192,7 @@ block_backend_fs_block_exists (BlockBackend *bend,
|
|||||||
char block_path[SEAF_PATH_MAX];
|
char block_path[SEAF_PATH_MAX];
|
||||||
|
|
||||||
get_block_path (bend, block_sha1, block_path, store_id, version);
|
get_block_path (bend, block_sha1, block_path, store_id, version);
|
||||||
|
|
||||||
if (g_access (block_path, F_OK) == 0)
|
if (g_access (block_path, F_OK) == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
else
|
else
|
||||||
@ -336,7 +339,7 @@ block_backend_fs_copy (BlockBackend *bend,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
if (!CreateHardLink (dst_path, src_path, NULL)) {
|
if (!CreateHardLinkA (dst_path, src_path, NULL)) {
|
||||||
seaf_warning ("Failed to link %s to %s: %lu.\n",
|
seaf_warning ("Failed to link %s to %s: %lu.\n",
|
||||||
src_path, dst_path, GetLastError());
|
src_path, dst_path, GetLastError());
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -9,11 +9,13 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#ifndef WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <dirent.h>
|
||||||
|
#endif
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <dirent.h>
|
|
||||||
#include <glib/gstdio.h>
|
#include <glib/gstdio.h>
|
||||||
|
|
||||||
#include "block-backend.h"
|
#include "block-backend.h"
|
||||||
@ -98,7 +100,7 @@ void
|
|||||||
seaf_block_manager_block_handle_free (SeafBlockManager *mgr,
|
seaf_block_manager_block_handle_free (SeafBlockManager *mgr,
|
||||||
BlockHandle *handle)
|
BlockHandle *handle)
|
||||||
{
|
{
|
||||||
return mgr->backend->block_handle_free (mgr->backend, handle);
|
mgr->backend->block_handle_free (mgr->backend, handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -4,7 +4,9 @@
|
|||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
@ -7,7 +7,10 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <utime.h>
|
||||||
|
#endif
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdint.h> /* uint32_t */
|
#include <stdint.h> /* uint32_t */
|
||||||
#include <sys/types.h> /* size_t */
|
#include <sys/types.h> /* size_t */
|
||||||
@ -15,11 +18,25 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <utime.h>
|
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <glib/gstdio.h>
|
#include <glib/gstdio.h>
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#define strcasecmp _stricmp
|
||||||
|
#define strncasecmp _strnicmp
|
||||||
|
|
||||||
|
#if !defined S_ISDIR
|
||||||
|
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(S_ISREG) && defined(S_IFMT) && defined(S_IFREG)
|
||||||
|
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define F_OK 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#define EMPTY_SHA1 "0000000000000000000000000000000000000000"
|
#define EMPTY_SHA1 "0000000000000000000000000000000000000000"
|
||||||
|
|
||||||
#define CURRENT_ENC_VERSION 3
|
#define CURRENT_ENC_VERSION 3
|
||||||
@ -39,16 +56,4 @@
|
|||||||
|
|
||||||
#define SEAF_PATH_MAX 4096
|
#define SEAF_PATH_MAX 4096
|
||||||
|
|
||||||
#ifndef ccnet_warning
|
|
||||||
#define ccnet_warning(fmt, ...) g_warning("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef ccnet_error
|
|
||||||
#define ccnet_error(fmt, ...) g_error("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef ccnet_message
|
|
||||||
#define ccnet_message(fmt, ...) g_message("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -4,7 +4,9 @@
|
|||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#ifndef WIN32
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
@ -33,23 +35,53 @@ struct _SeafFSManagerPriv {
|
|||||||
GHashTable *bl_cache;
|
GHashTable *bl_cache;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
__pragma(pack(push, 1))
|
||||||
|
typedef struct SeafileOndisk {
|
||||||
|
guint32 type;
|
||||||
|
guint64 file_size;
|
||||||
|
unsigned char block_ids[0];
|
||||||
|
} SeafileOndisk;
|
||||||
|
__pragma(pack(pop))
|
||||||
|
#else
|
||||||
typedef struct SeafileOndisk {
|
typedef struct SeafileOndisk {
|
||||||
guint32 type;
|
guint32 type;
|
||||||
guint64 file_size;
|
guint64 file_size;
|
||||||
unsigned char block_ids[0];
|
unsigned char block_ids[0];
|
||||||
} __attribute__((__packed__)) SeafileOndisk;
|
} __attribute__((__packed__)) SeafileOndisk;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
__pragma(pack(push, 1))
|
||||||
|
typedef struct DirentOndisk {
|
||||||
|
guint32 mode;
|
||||||
|
char id[40];
|
||||||
|
guint32 name_len;
|
||||||
|
char name[0];
|
||||||
|
} DirentOndisk;
|
||||||
|
__pragma(pack(pop))
|
||||||
|
#else
|
||||||
typedef struct DirentOndisk {
|
typedef struct DirentOndisk {
|
||||||
guint32 mode;
|
guint32 mode;
|
||||||
char id[40];
|
char id[40];
|
||||||
guint32 name_len;
|
guint32 name_len;
|
||||||
char name[0];
|
char name[0];
|
||||||
} __attribute__((__packed__)) DirentOndisk;
|
} __attribute__((__packed__)) DirentOndisk;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
__pragma(pack(push, 1))
|
||||||
|
typedef struct SeafdirOndisk {
|
||||||
|
guint32 type;
|
||||||
|
char dirents[0];
|
||||||
|
} SeafdirOndisk;
|
||||||
|
__pragma(pack(pop))
|
||||||
|
#else
|
||||||
typedef struct SeafdirOndisk {
|
typedef struct SeafdirOndisk {
|
||||||
guint32 type;
|
guint32 type;
|
||||||
char dirents[0];
|
char dirents[0];
|
||||||
} __attribute__((__packed__)) SeafdirOndisk;
|
} __attribute__((__packed__)) SeafdirOndisk;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef SEAFILE_SERVER
|
#ifndef SEAFILE_SERVER
|
||||||
uint32_t
|
uint32_t
|
||||||
|
@ -3,7 +3,12 @@
|
|||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <sys/param.h>
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@ -15,10 +20,7 @@
|
|||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/param.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <dirent.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
@ -117,6 +119,8 @@ struct cache_time {
|
|||||||
* We save the fields in big-endian order to allow using the
|
* We save the fields in big-endian order to allow using the
|
||||||
* index file over NFS transparently.
|
* index file over NFS transparently.
|
||||||
*/
|
*/
|
||||||
|
#ifdef WIN32
|
||||||
|
__pragma(pack(push, 1))
|
||||||
struct ondisk_cache_entry {
|
struct ondisk_cache_entry {
|
||||||
struct cache_time ctime;
|
struct cache_time ctime;
|
||||||
struct cache_time mtime;
|
struct cache_time mtime;
|
||||||
@ -129,13 +133,31 @@ struct ondisk_cache_entry {
|
|||||||
unsigned char sha1[20];
|
unsigned char sha1[20];
|
||||||
unsigned short flags;
|
unsigned short flags;
|
||||||
char name[0]; /* more */
|
char name[0]; /* more */
|
||||||
} __attribute__ ((packed));
|
};
|
||||||
|
__pragma(pack(pop))
|
||||||
|
#else
|
||||||
|
struct ondisk_cache_entry {
|
||||||
|
struct cache_time ctime;
|
||||||
|
struct cache_time mtime;
|
||||||
|
unsigned int dev;
|
||||||
|
unsigned int ino;
|
||||||
|
unsigned int mode;
|
||||||
|
unsigned int uid;
|
||||||
|
unsigned int gid;
|
||||||
|
uint64_t size;
|
||||||
|
unsigned char sha1[20];
|
||||||
|
unsigned short flags;
|
||||||
|
char name[0]; /* more */
|
||||||
|
} __attribute__((__packed__));
|
||||||
|
#endif
|
||||||
|
|
||||||
struct cache_time64 {
|
struct cache_time64 {
|
||||||
guint64 sec;
|
guint64 sec;
|
||||||
guint64 nsec;
|
guint64 nsec;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
__pragma(pack(push, 1))
|
||||||
struct ondisk_cache_entry2 {
|
struct ondisk_cache_entry2 {
|
||||||
struct cache_time64 ctime;
|
struct cache_time64 ctime;
|
||||||
struct cache_time64 mtime;
|
struct cache_time64 mtime;
|
||||||
@ -148,13 +170,31 @@ struct ondisk_cache_entry2 {
|
|||||||
unsigned char sha1[20];
|
unsigned char sha1[20];
|
||||||
unsigned short flags;
|
unsigned short flags;
|
||||||
char name[0]; /* more */
|
char name[0]; /* more */
|
||||||
} __attribute__ ((packed));
|
};
|
||||||
|
__pragma(pack(pop))
|
||||||
|
#else
|
||||||
|
struct ondisk_cache_entry2 {
|
||||||
|
struct cache_time64 ctime;
|
||||||
|
struct cache_time64 mtime;
|
||||||
|
unsigned int dev;
|
||||||
|
unsigned int ino;
|
||||||
|
unsigned int mode;
|
||||||
|
unsigned int uid;
|
||||||
|
unsigned int gid;
|
||||||
|
uint64_t size;
|
||||||
|
unsigned char sha1[20];
|
||||||
|
unsigned short flags;
|
||||||
|
char name[0]; /* more */
|
||||||
|
} __attribute__((__packed__));
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This struct is used when CE_EXTENDED bit is 1
|
* This struct is used when CE_EXTENDED bit is 1
|
||||||
* The struct must match ondisk_cache_entry exactly from
|
* The struct must match ondisk_cache_entry exactly from
|
||||||
* ctime till flags
|
* ctime till flags
|
||||||
*/
|
*/
|
||||||
|
#ifdef WIN32
|
||||||
|
__pragma(pack(push, 1))
|
||||||
struct ondisk_cache_entry_extended {
|
struct ondisk_cache_entry_extended {
|
||||||
struct cache_time ctime;
|
struct cache_time ctime;
|
||||||
struct cache_time mtime;
|
struct cache_time mtime;
|
||||||
@ -168,14 +208,40 @@ struct ondisk_cache_entry_extended {
|
|||||||
unsigned short flags;
|
unsigned short flags;
|
||||||
unsigned short flags2;
|
unsigned short flags2;
|
||||||
char name[0]; /* more */
|
char name[0]; /* more */
|
||||||
} __attribute__ ((packed));
|
};
|
||||||
|
__pragma(pack(pop))
|
||||||
|
#else
|
||||||
|
struct ondisk_cache_entry_extended {
|
||||||
|
struct cache_time ctime;
|
||||||
|
struct cache_time mtime;
|
||||||
|
unsigned int dev;
|
||||||
|
unsigned int ino;
|
||||||
|
unsigned int mode;
|
||||||
|
unsigned int uid;
|
||||||
|
unsigned int gid;
|
||||||
|
uint64_t size;
|
||||||
|
unsigned char sha1[20];
|
||||||
|
unsigned short flags;
|
||||||
|
unsigned short flags2;
|
||||||
|
char name[0]; /* more */
|
||||||
|
} __attribute__((__packed__));
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CACHE_EXT_MODIFIER 1
|
#define CACHE_EXT_MODIFIER 1
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
__pragma(pack(push, 1))
|
||||||
struct cache_ext_hdr {
|
struct cache_ext_hdr {
|
||||||
unsigned int ext_name;
|
unsigned int ext_name;
|
||||||
unsigned int ext_size;
|
unsigned int ext_size;
|
||||||
} __attribute__ ((packed));
|
};
|
||||||
|
__pragma(pack(pop))
|
||||||
|
#else
|
||||||
|
struct cache_ext_hdr {
|
||||||
|
unsigned int ext_name;
|
||||||
|
unsigned int ext_size;
|
||||||
|
} __attribute__((__packed__));
|
||||||
|
#endif
|
||||||
|
|
||||||
struct cache_entry {
|
struct cache_entry {
|
||||||
struct cache_time64 ce_ctime;
|
struct cache_time64 ce_ctime;
|
||||||
|
@ -4,11 +4,19 @@
|
|||||||
#define SEAFILE_DOMAIN g_quark_from_string("seafile")
|
#define SEAFILE_DOMAIN g_quark_from_string("seafile")
|
||||||
|
|
||||||
#ifndef seaf_warning
|
#ifndef seaf_warning
|
||||||
|
#ifndef WIN32
|
||||||
#define seaf_warning(fmt, ...) g_warning("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
#define seaf_warning(fmt, ...) g_warning("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
||||||
|
#else
|
||||||
|
#define seaf_warning(...) g_warning(__VA_ARGS__)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef seaf_message
|
#ifndef seaf_message
|
||||||
|
#ifndef WIN32
|
||||||
#define seaf_message(fmt, ...) g_message("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
#define seaf_message(fmt, ...) g_message("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
||||||
|
#else
|
||||||
|
#define seaf_message(...) g_message(__VA_ARGS__)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -438,7 +438,7 @@ obj_backend_fs_copy (ObjBackend *bend,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
if (!CreateHardLink (dst_path, src_path, NULL)) {
|
if (!CreateHardLinkA (dst_path, src_path, NULL)) {
|
||||||
seaf_warning ("Failed to link %s to %s: %lu.\n",
|
seaf_warning ("Failed to link %s to %s: %lu.\n",
|
||||||
src_path, dst_path, GetLastError());
|
src_path, dst_path, GetLastError());
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -105,7 +105,7 @@ seaf_obj_store_delete_obj (struct SeafObjStore *obj_store,
|
|||||||
!obj_id || !is_object_id_valid(obj_id))
|
!obj_id || !is_object_id_valid(obj_id))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
return bend->delete (bend, repo_id, version, obj_id);
|
bend->delete (bend, repo_id, version, obj_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -5,7 +5,9 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#ifndef WIN32
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
#endif
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#include "seafile-session.h"
|
#include "seafile-session.h"
|
||||||
|
@ -2979,11 +2979,21 @@ out:
|
|||||||
|
|
||||||
#define MAX_OBJECT_PACK_SIZE (1 << 20) /* 1MB */
|
#define MAX_OBJECT_PACK_SIZE (1 << 20) /* 1MB */
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
__pragma(pack(push, 1))
|
||||||
|
typedef struct {
|
||||||
|
char obj_id[40];
|
||||||
|
guint32 obj_size;
|
||||||
|
guint8 object[0];
|
||||||
|
} ObjectHeader;
|
||||||
|
__pragma(pack(pop))
|
||||||
|
#else
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char obj_id[40];
|
char obj_id[40];
|
||||||
guint32 obj_size;
|
guint32 obj_size;
|
||||||
guint8 object[0];
|
guint8 object[0];
|
||||||
} __attribute__((__packed__)) ObjectHeader;
|
} __attribute__((__packed__)) ObjectHeader;
|
||||||
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
send_fs_objects (HttpTxTask *task, Connection *conn, GList **send_fs_list)
|
send_fs_objects (HttpTxTask *task, Connection *conn, GList **send_fs_list)
|
||||||
|
@ -7176,7 +7176,7 @@ GList *seaf_repo_load_ignore_files (const char *worktree)
|
|||||||
SeafStat st;
|
SeafStat st;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
char *full_path, *pattern;
|
char *full_path, *pattern;
|
||||||
char path[PATH_MAX];
|
char path[SEAF_PATH_MAX];
|
||||||
|
|
||||||
full_path = g_build_path (PATH_SEPERATOR, worktree,
|
full_path = g_build_path (PATH_SEPERATOR, worktree,
|
||||||
IGNORE_FILE, NULL);
|
IGNORE_FILE, NULL);
|
||||||
@ -7188,7 +7188,7 @@ GList *seaf_repo_load_ignore_files (const char *worktree)
|
|||||||
if (fp == NULL)
|
if (fp == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
while (fgets(path, PATH_MAX, fp) != NULL) {
|
while (fgets(path, SEAF_PATH_MAX, fp) != NULL) {
|
||||||
/* remove leading and trailing whitespace, including \n \r. */
|
/* remove leading and trailing whitespace, including \n \r. */
|
||||||
g_strstrip (path);
|
g_strstrip (path);
|
||||||
|
|
||||||
|
@ -5,9 +5,12 @@
|
|||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <wincrypt.h>
|
#include <wincrypt.h>
|
||||||
|
#include <shellapi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@ -286,7 +289,7 @@ char *b64encode(const char *input)
|
|||||||
{
|
{
|
||||||
char buf[32767] = {0};
|
char buf[32767] = {0};
|
||||||
DWORD retlen = 32767;
|
DWORD retlen = 32767;
|
||||||
CryptBinaryToString((BYTE*) input, strlen(input), CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF, buf, &retlen);
|
CryptBinaryToStringA((BYTE*) input, strlen(input), CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF, buf, &retlen);
|
||||||
return strdup(buf);
|
return strdup(buf);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -297,9 +300,9 @@ start_searpc_server ()
|
|||||||
register_rpc_service ();
|
register_rpc_service ();
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
DWORD bufCharCount = 32767;
|
char userNameBuf[32767];
|
||||||
char userNameBuf[bufCharCount];
|
DWORD bufCharCount = sizeof(userNameBuf);
|
||||||
if (GetUserName(userNameBuf, &bufCharCount) == 0) {
|
if (GetUserNameA(userNameBuf, &bufCharCount) == 0) {
|
||||||
seaf_warning ("Failed to get user name, GLE=%lu, required size is %lu\n",
|
seaf_warning ("Failed to get user name, GLE=%lu, required size is %lu\n",
|
||||||
GetLastError(), bufCharCount);
|
GetLastError(), bufCharCount);
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -3,8 +3,10 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#ifndef WIN32
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
@ -106,7 +106,7 @@ seaf_set_path_permission (const char *path, SeafPathPerm perm, gboolean recursiv
|
|||||||
ea.grfInheritance = (CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE);
|
ea.grfInheritance = (CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE);
|
||||||
ea.Trustee.TrusteeForm = TRUSTEE_IS_NAME;
|
ea.Trustee.TrusteeForm = TRUSTEE_IS_NAME;
|
||||||
ea.Trustee.TrusteeType = TRUSTEE_IS_USER;
|
ea.Trustee.TrusteeType = TRUSTEE_IS_USER;
|
||||||
ea.Trustee.ptstrName = "CURRENT_USER";
|
ea.Trustee.ptstrName = L"CURRENT_USER";
|
||||||
|
|
||||||
// Create a new ACL that merges the new ACE
|
// Create a new ACL that merges the new ACE
|
||||||
// into the existing DACL.
|
// into the existing DACL.
|
||||||
|
@ -8,7 +8,9 @@
|
|||||||
#include <event.h>
|
#include <event.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "seafile-session.h"
|
#include "seafile-session.h"
|
||||||
|
|
||||||
|
@ -7,9 +7,11 @@
|
|||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#include <sys/time.h>
|
#ifndef WIN32
|
||||||
#include <sys/types.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "job-mgr.h"
|
#include "job-mgr.h"
|
||||||
#include "seafile-session.h"
|
#include "seafile-session.h"
|
||||||
@ -262,7 +264,7 @@ start_watch_cmd_pipe (SeafWTMonitor *monitor, OVERLAPPED *ol_in)
|
|||||||
|
|
||||||
HANDLE hPipe = (HANDLE)monitor->cmd_pipe[0];
|
HANDLE hPipe = (HANDLE)monitor->cmd_pipe[0];
|
||||||
|
|
||||||
void *p = (void *)(&priv->cmd) + priv->cmd_bytes_read;
|
void *p = &priv->cmd + priv->cmd_bytes_read;
|
||||||
int to_read = sizeof(WatchCommand) - priv->cmd_bytes_read;
|
int to_read = sizeof(WatchCommand) - priv->cmd_bytes_read;
|
||||||
|
|
||||||
BOOL sts = ReadFile
|
BOOL sts = ReadFile
|
||||||
|
2
lib/db.c
2
lib/db.c
@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
#ifndef WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "db.h"
|
#include "db.h"
|
||||||
|
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
|
|
||||||
#include <config.h>
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#ifndef WIN32
|
||||||
|
#include <config.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -8,7 +8,9 @@
|
|||||||
#endif
|
#endif
|
||||||
#include "include.h"
|
#include "include.h"
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
2827
lib/repo.c
Normal file
2827
lib/repo.c
Normal file
File diff suppressed because it is too large
Load Diff
424
lib/seafile-object.h
Normal file
424
lib/seafile-object.h
Normal file
@ -0,0 +1,424 @@
|
|||||||
|
/* seafile-object.h generated by valac 0.46.5, the Vala compiler, do not modify */
|
||||||
|
|
||||||
|
#ifndef __SEAFILE_OBJECT_H__
|
||||||
|
#define __SEAFILE_OBJECT_H__
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include <glib.h>
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
#define SEAFILE_TYPE_REPO (seafile_repo_get_type ())
|
||||||
|
#define SEAFILE_REPO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAFILE_TYPE_REPO, SeafileRepo))
|
||||||
|
#define SEAFILE_REPO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEAFILE_TYPE_REPO, SeafileRepoClass))
|
||||||
|
#define SEAFILE_IS_REPO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAFILE_TYPE_REPO))
|
||||||
|
#define SEAFILE_IS_REPO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAFILE_TYPE_REPO))
|
||||||
|
#define SEAFILE_REPO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAFILE_TYPE_REPO, SeafileRepoClass))
|
||||||
|
|
||||||
|
typedef struct _SeafileRepo SeafileRepo;
|
||||||
|
typedef struct _SeafileRepoClass SeafileRepoClass;
|
||||||
|
typedef struct _SeafileRepoPrivate SeafileRepoPrivate;
|
||||||
|
|
||||||
|
#define SEAFILE_TYPE_SYNC_TASK (seafile_sync_task_get_type ())
|
||||||
|
#define SEAFILE_SYNC_TASK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAFILE_TYPE_SYNC_TASK, SeafileSyncTask))
|
||||||
|
#define SEAFILE_SYNC_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEAFILE_TYPE_SYNC_TASK, SeafileSyncTaskClass))
|
||||||
|
#define SEAFILE_IS_SYNC_TASK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAFILE_TYPE_SYNC_TASK))
|
||||||
|
#define SEAFILE_IS_SYNC_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAFILE_TYPE_SYNC_TASK))
|
||||||
|
#define SEAFILE_SYNC_TASK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAFILE_TYPE_SYNC_TASK, SeafileSyncTaskClass))
|
||||||
|
|
||||||
|
typedef struct _SeafileSyncTask SeafileSyncTask;
|
||||||
|
typedef struct _SeafileSyncTaskClass SeafileSyncTaskClass;
|
||||||
|
typedef struct _SeafileSyncTaskPrivate SeafileSyncTaskPrivate;
|
||||||
|
|
||||||
|
#define SEAFILE_TYPE_SESSION_INFO (seafile_session_info_get_type ())
|
||||||
|
#define SEAFILE_SESSION_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAFILE_TYPE_SESSION_INFO, SeafileSessionInfo))
|
||||||
|
#define SEAFILE_SESSION_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEAFILE_TYPE_SESSION_INFO, SeafileSessionInfoClass))
|
||||||
|
#define SEAFILE_IS_SESSION_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAFILE_TYPE_SESSION_INFO))
|
||||||
|
#define SEAFILE_IS_SESSION_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAFILE_TYPE_SESSION_INFO))
|
||||||
|
#define SEAFILE_SESSION_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAFILE_TYPE_SESSION_INFO, SeafileSessionInfoClass))
|
||||||
|
|
||||||
|
typedef struct _SeafileSessionInfo SeafileSessionInfo;
|
||||||
|
typedef struct _SeafileSessionInfoClass SeafileSessionInfoClass;
|
||||||
|
typedef struct _SeafileSessionInfoPrivate SeafileSessionInfoPrivate;
|
||||||
|
|
||||||
|
#define SEAFILE_TYPE_DIFF_ENTRY (seafile_diff_entry_get_type ())
|
||||||
|
#define SEAFILE_DIFF_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAFILE_TYPE_DIFF_ENTRY, SeafileDiffEntry))
|
||||||
|
#define SEAFILE_DIFF_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEAFILE_TYPE_DIFF_ENTRY, SeafileDiffEntryClass))
|
||||||
|
#define SEAFILE_IS_DIFF_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAFILE_TYPE_DIFF_ENTRY))
|
||||||
|
#define SEAFILE_IS_DIFF_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAFILE_TYPE_DIFF_ENTRY))
|
||||||
|
#define SEAFILE_DIFF_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAFILE_TYPE_DIFF_ENTRY, SeafileDiffEntryClass))
|
||||||
|
|
||||||
|
typedef struct _SeafileDiffEntry SeafileDiffEntry;
|
||||||
|
typedef struct _SeafileDiffEntryClass SeafileDiffEntryClass;
|
||||||
|
typedef struct _SeafileDiffEntryPrivate SeafileDiffEntryPrivate;
|
||||||
|
|
||||||
|
#define SEAFILE_TYPE_ENCRYPTION_INFO (seafile_encryption_info_get_type ())
|
||||||
|
#define SEAFILE_ENCRYPTION_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAFILE_TYPE_ENCRYPTION_INFO, SeafileEncryptionInfo))
|
||||||
|
#define SEAFILE_ENCRYPTION_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEAFILE_TYPE_ENCRYPTION_INFO, SeafileEncryptionInfoClass))
|
||||||
|
#define SEAFILE_IS_ENCRYPTION_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAFILE_TYPE_ENCRYPTION_INFO))
|
||||||
|
#define SEAFILE_IS_ENCRYPTION_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAFILE_TYPE_ENCRYPTION_INFO))
|
||||||
|
#define SEAFILE_ENCRYPTION_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAFILE_TYPE_ENCRYPTION_INFO, SeafileEncryptionInfoClass))
|
||||||
|
|
||||||
|
typedef struct _SeafileEncryptionInfo SeafileEncryptionInfo;
|
||||||
|
typedef struct _SeafileEncryptionInfoClass SeafileEncryptionInfoClass;
|
||||||
|
typedef struct _SeafileEncryptionInfoPrivate SeafileEncryptionInfoPrivate;
|
||||||
|
|
||||||
|
#define SEAFILE_TYPE_FILE_SYNC_ERROR (seafile_file_sync_error_get_type ())
|
||||||
|
#define SEAFILE_FILE_SYNC_ERROR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAFILE_TYPE_FILE_SYNC_ERROR, SeafileFileSyncError))
|
||||||
|
#define SEAFILE_FILE_SYNC_ERROR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEAFILE_TYPE_FILE_SYNC_ERROR, SeafileFileSyncErrorClass))
|
||||||
|
#define SEAFILE_IS_FILE_SYNC_ERROR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAFILE_TYPE_FILE_SYNC_ERROR))
|
||||||
|
#define SEAFILE_IS_FILE_SYNC_ERROR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAFILE_TYPE_FILE_SYNC_ERROR))
|
||||||
|
#define SEAFILE_FILE_SYNC_ERROR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAFILE_TYPE_FILE_SYNC_ERROR, SeafileFileSyncErrorClass))
|
||||||
|
|
||||||
|
typedef struct _SeafileFileSyncError SeafileFileSyncError;
|
||||||
|
typedef struct _SeafileFileSyncErrorClass SeafileFileSyncErrorClass;
|
||||||
|
typedef struct _SeafileFileSyncErrorPrivate SeafileFileSyncErrorPrivate;
|
||||||
|
|
||||||
|
#define SEAFILE_TYPE_TASK (seafile_task_get_type ())
|
||||||
|
#define SEAFILE_TASK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAFILE_TYPE_TASK, SeafileTask))
|
||||||
|
#define SEAFILE_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEAFILE_TYPE_TASK, SeafileTaskClass))
|
||||||
|
#define SEAFILE_IS_TASK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAFILE_TYPE_TASK))
|
||||||
|
#define SEAFILE_IS_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAFILE_TYPE_TASK))
|
||||||
|
#define SEAFILE_TASK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAFILE_TYPE_TASK, SeafileTaskClass))
|
||||||
|
|
||||||
|
typedef struct _SeafileTask SeafileTask;
|
||||||
|
typedef struct _SeafileTaskClass SeafileTaskClass;
|
||||||
|
typedef struct _SeafileTaskPrivate SeafileTaskPrivate;
|
||||||
|
|
||||||
|
#define SEAFILE_TYPE_CLONE_TASK (seafile_clone_task_get_type ())
|
||||||
|
#define SEAFILE_CLONE_TASK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAFILE_TYPE_CLONE_TASK, SeafileCloneTask))
|
||||||
|
#define SEAFILE_CLONE_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEAFILE_TYPE_CLONE_TASK, SeafileCloneTaskClass))
|
||||||
|
#define SEAFILE_IS_CLONE_TASK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAFILE_TYPE_CLONE_TASK))
|
||||||
|
#define SEAFILE_IS_CLONE_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAFILE_TYPE_CLONE_TASK))
|
||||||
|
#define SEAFILE_CLONE_TASK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAFILE_TYPE_CLONE_TASK, SeafileCloneTaskClass))
|
||||||
|
|
||||||
|
typedef struct _SeafileCloneTask SeafileCloneTask;
|
||||||
|
typedef struct _SeafileCloneTaskClass SeafileCloneTaskClass;
|
||||||
|
typedef struct _SeafileCloneTaskPrivate SeafileCloneTaskPrivate;
|
||||||
|
|
||||||
|
struct _SeafileRepo {
|
||||||
|
GObject parent_instance;
|
||||||
|
SeafileRepoPrivate * priv;
|
||||||
|
gchar _id[37];
|
||||||
|
gchar* _name;
|
||||||
|
gchar* _desc;
|
||||||
|
gchar* _worktree;
|
||||||
|
gchar* _relay_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _SeafileRepoClass {
|
||||||
|
GObjectClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _SeafileSyncTask {
|
||||||
|
GObject parent_instance;
|
||||||
|
SeafileSyncTaskPrivate * priv;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _SeafileSyncTaskClass {
|
||||||
|
GObjectClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _SeafileSessionInfo {
|
||||||
|
GObject parent_instance;
|
||||||
|
SeafileSessionInfoPrivate * priv;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _SeafileSessionInfoClass {
|
||||||
|
GObjectClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _SeafileDiffEntry {
|
||||||
|
GObject parent_instance;
|
||||||
|
SeafileDiffEntryPrivate * priv;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _SeafileDiffEntryClass {
|
||||||
|
GObjectClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _SeafileEncryptionInfo {
|
||||||
|
GObject parent_instance;
|
||||||
|
SeafileEncryptionInfoPrivate * priv;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _SeafileEncryptionInfoClass {
|
||||||
|
GObjectClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _SeafileFileSyncError {
|
||||||
|
GObject parent_instance;
|
||||||
|
SeafileFileSyncErrorPrivate * priv;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _SeafileFileSyncErrorClass {
|
||||||
|
GObjectClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _SeafileTask {
|
||||||
|
GObject parent_instance;
|
||||||
|
SeafileTaskPrivate * priv;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _SeafileTaskClass {
|
||||||
|
GObjectClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _SeafileCloneTask {
|
||||||
|
GObject parent_instance;
|
||||||
|
SeafileCloneTaskPrivate * priv;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _SeafileCloneTaskClass {
|
||||||
|
GObjectClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
|
GType seafile_repo_get_type (void) G_GNUC_CONST;
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SeafileRepo, g_object_unref)
|
||||||
|
SeafileRepo* seafile_repo_new (void);
|
||||||
|
SeafileRepo* seafile_repo_construct (GType object_type);
|
||||||
|
const gchar* seafile_repo_get_id (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_id (SeafileRepo* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_repo_get_name (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_name (SeafileRepo* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_repo_get_desc (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_desc (SeafileRepo* self,
|
||||||
|
const gchar* value);
|
||||||
|
gint seafile_repo_get_version (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_version (SeafileRepo* self,
|
||||||
|
gint value);
|
||||||
|
gint seafile_repo_get_last_modify (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_last_modify (SeafileRepo* self,
|
||||||
|
gint value);
|
||||||
|
gint64 seafile_repo_get_size (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_size (SeafileRepo* self,
|
||||||
|
gint64 value);
|
||||||
|
gint64 seafile_repo_get_file_count (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_file_count (SeafileRepo* self,
|
||||||
|
gint64 value);
|
||||||
|
const gchar* seafile_repo_get_head_cmmt_id (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_head_cmmt_id (SeafileRepo* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_repo_get_root (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_root (SeafileRepo* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_repo_get_repo_id (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_repo_id (SeafileRepo* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_repo_get_repo_name (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_repo_name (SeafileRepo* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_repo_get_repo_desc (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_repo_desc (SeafileRepo* self,
|
||||||
|
const gchar* value);
|
||||||
|
gint seafile_repo_get_last_modified (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_last_modified (SeafileRepo* self,
|
||||||
|
gint value);
|
||||||
|
gboolean seafile_repo_get_encrypted (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_encrypted (SeafileRepo* self,
|
||||||
|
gboolean value);
|
||||||
|
const gchar* seafile_repo_get_magic (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_magic (SeafileRepo* self,
|
||||||
|
const gchar* value);
|
||||||
|
gint seafile_repo_get_enc_version (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_enc_version (SeafileRepo* self,
|
||||||
|
gint value);
|
||||||
|
const gchar* seafile_repo_get_random_key (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_random_key (SeafileRepo* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_repo_get_salt (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_salt (SeafileRepo* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_repo_get_worktree (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_worktree (SeafileRepo* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_repo_get_relay_id (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_relay_id (SeafileRepo* self,
|
||||||
|
const gchar* value);
|
||||||
|
gint seafile_repo_get_last_sync_time (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_last_sync_time (SeafileRepo* self,
|
||||||
|
gint value);
|
||||||
|
gboolean seafile_repo_get_auto_sync (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_auto_sync (SeafileRepo* self,
|
||||||
|
gboolean value);
|
||||||
|
gboolean seafile_repo_get_worktree_invalid (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_worktree_invalid (SeafileRepo* self,
|
||||||
|
gboolean value);
|
||||||
|
gboolean seafile_repo_get_is_virtual (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_is_virtual (SeafileRepo* self,
|
||||||
|
gboolean value);
|
||||||
|
const gchar* seafile_repo_get_origin_repo_id (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_origin_repo_id (SeafileRepo* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_repo_get_origin_repo_name (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_origin_repo_name (SeafileRepo* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_repo_get_origin_path (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_origin_path (SeafileRepo* self,
|
||||||
|
const gchar* value);
|
||||||
|
gboolean seafile_repo_get_is_original_owner (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_is_original_owner (SeafileRepo* self,
|
||||||
|
gboolean value);
|
||||||
|
const gchar* seafile_repo_get_virtual_perm (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_virtual_perm (SeafileRepo* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_repo_get_store_id (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_store_id (SeafileRepo* self,
|
||||||
|
const gchar* value);
|
||||||
|
gboolean seafile_repo_get_is_corrupted (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_is_corrupted (SeafileRepo* self,
|
||||||
|
gboolean value);
|
||||||
|
gboolean seafile_repo_get_repaired (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_repaired (SeafileRepo* self,
|
||||||
|
gboolean value);
|
||||||
|
const gchar* seafile_repo_get_share_type (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_share_type (SeafileRepo* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_repo_get_permission (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_permission (SeafileRepo* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_repo_get_user (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_user (SeafileRepo* self,
|
||||||
|
const gchar* value);
|
||||||
|
gint seafile_repo_get_group_id (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_group_id (SeafileRepo* self,
|
||||||
|
gint value);
|
||||||
|
gboolean seafile_repo_get_is_shared (SeafileRepo* self);
|
||||||
|
void seafile_repo_set_is_shared (SeafileRepo* self,
|
||||||
|
gboolean value);
|
||||||
|
GType seafile_sync_task_get_type (void) G_GNUC_CONST;
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SeafileSyncTask, g_object_unref)
|
||||||
|
SeafileSyncTask* seafile_sync_task_new (void);
|
||||||
|
SeafileSyncTask* seafile_sync_task_construct (GType object_type);
|
||||||
|
gboolean seafile_sync_task_get_force_upload (SeafileSyncTask* self);
|
||||||
|
void seafile_sync_task_set_force_upload (SeafileSyncTask* self,
|
||||||
|
gboolean value);
|
||||||
|
const gchar* seafile_sync_task_get_repo_id (SeafileSyncTask* self);
|
||||||
|
void seafile_sync_task_set_repo_id (SeafileSyncTask* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_sync_task_get_state (SeafileSyncTask* self);
|
||||||
|
void seafile_sync_task_set_state (SeafileSyncTask* self,
|
||||||
|
const gchar* value);
|
||||||
|
gint seafile_sync_task_get_error (SeafileSyncTask* self);
|
||||||
|
void seafile_sync_task_set_error (SeafileSyncTask* self,
|
||||||
|
gint value);
|
||||||
|
GType seafile_session_info_get_type (void) G_GNUC_CONST;
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SeafileSessionInfo, g_object_unref)
|
||||||
|
SeafileSessionInfo* seafile_session_info_new (void);
|
||||||
|
SeafileSessionInfo* seafile_session_info_construct (GType object_type);
|
||||||
|
const gchar* seafile_session_info_get_datadir (SeafileSessionInfo* self);
|
||||||
|
void seafile_session_info_set_datadir (SeafileSessionInfo* self,
|
||||||
|
const gchar* value);
|
||||||
|
GType seafile_diff_entry_get_type (void) G_GNUC_CONST;
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SeafileDiffEntry, g_object_unref)
|
||||||
|
SeafileDiffEntry* seafile_diff_entry_new (void);
|
||||||
|
SeafileDiffEntry* seafile_diff_entry_construct (GType object_type);
|
||||||
|
const gchar* seafile_diff_entry_get_status (SeafileDiffEntry* self);
|
||||||
|
void seafile_diff_entry_set_status (SeafileDiffEntry* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_diff_entry_get_name (SeafileDiffEntry* self);
|
||||||
|
void seafile_diff_entry_set_name (SeafileDiffEntry* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_diff_entry_get_new_name (SeafileDiffEntry* self);
|
||||||
|
void seafile_diff_entry_set_new_name (SeafileDiffEntry* self,
|
||||||
|
const gchar* value);
|
||||||
|
GType seafile_encryption_info_get_type (void) G_GNUC_CONST;
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SeafileEncryptionInfo, g_object_unref)
|
||||||
|
SeafileEncryptionInfo* seafile_encryption_info_new (void);
|
||||||
|
SeafileEncryptionInfo* seafile_encryption_info_construct (GType object_type);
|
||||||
|
const gchar* seafile_encryption_info_get_repo_id (SeafileEncryptionInfo* self);
|
||||||
|
void seafile_encryption_info_set_repo_id (SeafileEncryptionInfo* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_encryption_info_get_passwd (SeafileEncryptionInfo* self);
|
||||||
|
void seafile_encryption_info_set_passwd (SeafileEncryptionInfo* self,
|
||||||
|
const gchar* value);
|
||||||
|
gint seafile_encryption_info_get_enc_version (SeafileEncryptionInfo* self);
|
||||||
|
void seafile_encryption_info_set_enc_version (SeafileEncryptionInfo* self,
|
||||||
|
gint value);
|
||||||
|
const gchar* seafile_encryption_info_get_magic (SeafileEncryptionInfo* self);
|
||||||
|
void seafile_encryption_info_set_magic (SeafileEncryptionInfo* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_encryption_info_get_random_key (SeafileEncryptionInfo* self);
|
||||||
|
void seafile_encryption_info_set_random_key (SeafileEncryptionInfo* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_encryption_info_get_salt (SeafileEncryptionInfo* self);
|
||||||
|
void seafile_encryption_info_set_salt (SeafileEncryptionInfo* self,
|
||||||
|
const gchar* value);
|
||||||
|
GType seafile_file_sync_error_get_type (void) G_GNUC_CONST;
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SeafileFileSyncError, g_object_unref)
|
||||||
|
SeafileFileSyncError* seafile_file_sync_error_new (void);
|
||||||
|
SeafileFileSyncError* seafile_file_sync_error_construct (GType object_type);
|
||||||
|
gint seafile_file_sync_error_get_id (SeafileFileSyncError* self);
|
||||||
|
void seafile_file_sync_error_set_id (SeafileFileSyncError* self,
|
||||||
|
gint value);
|
||||||
|
const gchar* seafile_file_sync_error_get_repo_id (SeafileFileSyncError* self);
|
||||||
|
void seafile_file_sync_error_set_repo_id (SeafileFileSyncError* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_file_sync_error_get_repo_name (SeafileFileSyncError* self);
|
||||||
|
void seafile_file_sync_error_set_repo_name (SeafileFileSyncError* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_file_sync_error_get_path (SeafileFileSyncError* self);
|
||||||
|
void seafile_file_sync_error_set_path (SeafileFileSyncError* self,
|
||||||
|
const gchar* value);
|
||||||
|
gint seafile_file_sync_error_get_err_id (SeafileFileSyncError* self);
|
||||||
|
void seafile_file_sync_error_set_err_id (SeafileFileSyncError* self,
|
||||||
|
gint value);
|
||||||
|
gint64 seafile_file_sync_error_get_timestamp (SeafileFileSyncError* self);
|
||||||
|
void seafile_file_sync_error_set_timestamp (SeafileFileSyncError* self,
|
||||||
|
gint64 value);
|
||||||
|
GType seafile_task_get_type (void) G_GNUC_CONST;
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SeafileTask, g_object_unref)
|
||||||
|
SeafileTask* seafile_task_new (void);
|
||||||
|
SeafileTask* seafile_task_construct (GType object_type);
|
||||||
|
const gchar* seafile_task_get_ttype (SeafileTask* self);
|
||||||
|
void seafile_task_set_ttype (SeafileTask* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_task_get_repo_id (SeafileTask* self);
|
||||||
|
void seafile_task_set_repo_id (SeafileTask* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_task_get_state (SeafileTask* self);
|
||||||
|
void seafile_task_set_state (SeafileTask* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_task_get_rt_state (SeafileTask* self);
|
||||||
|
void seafile_task_set_rt_state (SeafileTask* self,
|
||||||
|
const gchar* value);
|
||||||
|
gint64 seafile_task_get_block_total (SeafileTask* self);
|
||||||
|
void seafile_task_set_block_total (SeafileTask* self,
|
||||||
|
gint64 value);
|
||||||
|
gint64 seafile_task_get_block_done (SeafileTask* self);
|
||||||
|
void seafile_task_set_block_done (SeafileTask* self,
|
||||||
|
gint64 value);
|
||||||
|
gint seafile_task_get_fs_objects_total (SeafileTask* self);
|
||||||
|
void seafile_task_set_fs_objects_total (SeafileTask* self,
|
||||||
|
gint value);
|
||||||
|
gint seafile_task_get_fs_objects_done (SeafileTask* self);
|
||||||
|
void seafile_task_set_fs_objects_done (SeafileTask* self,
|
||||||
|
gint value);
|
||||||
|
gint seafile_task_get_rate (SeafileTask* self);
|
||||||
|
void seafile_task_set_rate (SeafileTask* self,
|
||||||
|
gint value);
|
||||||
|
GType seafile_clone_task_get_type (void) G_GNUC_CONST;
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SeafileCloneTask, g_object_unref)
|
||||||
|
SeafileCloneTask* seafile_clone_task_new (void);
|
||||||
|
SeafileCloneTask* seafile_clone_task_construct (GType object_type);
|
||||||
|
const gchar* seafile_clone_task_get_state (SeafileCloneTask* self);
|
||||||
|
void seafile_clone_task_set_state (SeafileCloneTask* self,
|
||||||
|
const gchar* value);
|
||||||
|
gint seafile_clone_task_get_error (SeafileCloneTask* self);
|
||||||
|
void seafile_clone_task_set_error (SeafileCloneTask* self,
|
||||||
|
gint value);
|
||||||
|
const gchar* seafile_clone_task_get_repo_id (SeafileCloneTask* self);
|
||||||
|
void seafile_clone_task_set_repo_id (SeafileCloneTask* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_clone_task_get_repo_name (SeafileCloneTask* self);
|
||||||
|
void seafile_clone_task_set_repo_name (SeafileCloneTask* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_clone_task_get_worktree (SeafileCloneTask* self);
|
||||||
|
void seafile_clone_task_set_worktree (SeafileCloneTask* self,
|
||||||
|
const gchar* value);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif
|
@ -1,8 +1,12 @@
|
|||||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
|
||||||
|
#if !defined(_MSC_VER)
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
#endif
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#if !defined(_MSC_VER)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
773
lib/task.c
Normal file
773
lib/task.c
Normal file
@ -0,0 +1,773 @@
|
|||||||
|
/* task.c generated by valac 0.46.5, the Vala compiler
|
||||||
|
* generated from task.vala, do not modify */
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <glib.h>
|
||||||
|
|
||||||
|
#define SEAFILE_TYPE_TASK (seafile_task_get_type ())
|
||||||
|
#define SEAFILE_TASK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAFILE_TYPE_TASK, SeafileTask))
|
||||||
|
#define SEAFILE_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEAFILE_TYPE_TASK, SeafileTaskClass))
|
||||||
|
#define SEAFILE_IS_TASK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAFILE_TYPE_TASK))
|
||||||
|
#define SEAFILE_IS_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAFILE_TYPE_TASK))
|
||||||
|
#define SEAFILE_TASK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAFILE_TYPE_TASK, SeafileTaskClass))
|
||||||
|
|
||||||
|
typedef struct _SeafileTask SeafileTask;
|
||||||
|
typedef struct _SeafileTaskClass SeafileTaskClass;
|
||||||
|
typedef struct _SeafileTaskPrivate SeafileTaskPrivate;
|
||||||
|
enum {
|
||||||
|
SEAFILE_TASK_0_PROPERTY,
|
||||||
|
SEAFILE_TASK_TTYPE_PROPERTY,
|
||||||
|
SEAFILE_TASK_REPO_ID_PROPERTY,
|
||||||
|
SEAFILE_TASK_STATE_PROPERTY,
|
||||||
|
SEAFILE_TASK_RT_STATE_PROPERTY,
|
||||||
|
SEAFILE_TASK_BLOCK_TOTAL_PROPERTY,
|
||||||
|
SEAFILE_TASK_BLOCK_DONE_PROPERTY,
|
||||||
|
SEAFILE_TASK_FS_OBJECTS_TOTAL_PROPERTY,
|
||||||
|
SEAFILE_TASK_FS_OBJECTS_DONE_PROPERTY,
|
||||||
|
SEAFILE_TASK_RATE_PROPERTY,
|
||||||
|
SEAFILE_TASK_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* seafile_task_properties[SEAFILE_TASK_NUM_PROPERTIES];
|
||||||
|
#define _g_free0(var) (var = (g_free (var), NULL))
|
||||||
|
|
||||||
|
#define SEAFILE_TYPE_CLONE_TASK (seafile_clone_task_get_type ())
|
||||||
|
#define SEAFILE_CLONE_TASK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAFILE_TYPE_CLONE_TASK, SeafileCloneTask))
|
||||||
|
#define SEAFILE_CLONE_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEAFILE_TYPE_CLONE_TASK, SeafileCloneTaskClass))
|
||||||
|
#define SEAFILE_IS_CLONE_TASK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAFILE_TYPE_CLONE_TASK))
|
||||||
|
#define SEAFILE_IS_CLONE_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAFILE_TYPE_CLONE_TASK))
|
||||||
|
#define SEAFILE_CLONE_TASK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAFILE_TYPE_CLONE_TASK, SeafileCloneTaskClass))
|
||||||
|
|
||||||
|
typedef struct _SeafileCloneTask SeafileCloneTask;
|
||||||
|
typedef struct _SeafileCloneTaskClass SeafileCloneTaskClass;
|
||||||
|
typedef struct _SeafileCloneTaskPrivate SeafileCloneTaskPrivate;
|
||||||
|
enum {
|
||||||
|
SEAFILE_CLONE_TASK_0_PROPERTY,
|
||||||
|
SEAFILE_CLONE_TASK_STATE_PROPERTY,
|
||||||
|
SEAFILE_CLONE_TASK_ERROR_PROPERTY,
|
||||||
|
SEAFILE_CLONE_TASK_REPO_ID_PROPERTY,
|
||||||
|
SEAFILE_CLONE_TASK_REPO_NAME_PROPERTY,
|
||||||
|
SEAFILE_CLONE_TASK_WORKTREE_PROPERTY,
|
||||||
|
SEAFILE_CLONE_TASK_NUM_PROPERTIES
|
||||||
|
};
|
||||||
|
static GParamSpec* seafile_clone_task_properties[SEAFILE_CLONE_TASK_NUM_PROPERTIES];
|
||||||
|
|
||||||
|
struct _SeafileTask {
|
||||||
|
GObject parent_instance;
|
||||||
|
SeafileTaskPrivate * priv;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _SeafileTaskClass {
|
||||||
|
GObjectClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _SeafileTaskPrivate {
|
||||||
|
gchar* _ttype;
|
||||||
|
gchar* _repo_id;
|
||||||
|
gchar* _state;
|
||||||
|
gchar* _rt_state;
|
||||||
|
gint64 _block_total;
|
||||||
|
gint64 _block_done;
|
||||||
|
gint _fs_objects_total;
|
||||||
|
gint _fs_objects_done;
|
||||||
|
gint _rate;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _SeafileCloneTask {
|
||||||
|
GObject parent_instance;
|
||||||
|
SeafileCloneTaskPrivate * priv;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _SeafileCloneTaskClass {
|
||||||
|
GObjectClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _SeafileCloneTaskPrivate {
|
||||||
|
gchar* _state;
|
||||||
|
gint _error;
|
||||||
|
gchar* _repo_id;
|
||||||
|
gchar* _repo_name;
|
||||||
|
gchar* _worktree;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gint SeafileTask_private_offset;
|
||||||
|
static gpointer seafile_task_parent_class = NULL;
|
||||||
|
static gint SeafileCloneTask_private_offset;
|
||||||
|
static gpointer seafile_clone_task_parent_class = NULL;
|
||||||
|
|
||||||
|
GType seafile_task_get_type (void) G_GNUC_CONST;
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SeafileTask, g_object_unref)
|
||||||
|
SeafileTask* seafile_task_new (void);
|
||||||
|
SeafileTask* seafile_task_construct (GType object_type);
|
||||||
|
const gchar* seafile_task_get_ttype (SeafileTask* self);
|
||||||
|
void seafile_task_set_ttype (SeafileTask* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_task_get_repo_id (SeafileTask* self);
|
||||||
|
void seafile_task_set_repo_id (SeafileTask* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_task_get_state (SeafileTask* self);
|
||||||
|
void seafile_task_set_state (SeafileTask* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_task_get_rt_state (SeafileTask* self);
|
||||||
|
void seafile_task_set_rt_state (SeafileTask* self,
|
||||||
|
const gchar* value);
|
||||||
|
gint64 seafile_task_get_block_total (SeafileTask* self);
|
||||||
|
void seafile_task_set_block_total (SeafileTask* self,
|
||||||
|
gint64 value);
|
||||||
|
gint64 seafile_task_get_block_done (SeafileTask* self);
|
||||||
|
void seafile_task_set_block_done (SeafileTask* self,
|
||||||
|
gint64 value);
|
||||||
|
gint seafile_task_get_fs_objects_total (SeafileTask* self);
|
||||||
|
void seafile_task_set_fs_objects_total (SeafileTask* self,
|
||||||
|
gint value);
|
||||||
|
gint seafile_task_get_fs_objects_done (SeafileTask* self);
|
||||||
|
void seafile_task_set_fs_objects_done (SeafileTask* self,
|
||||||
|
gint value);
|
||||||
|
gint seafile_task_get_rate (SeafileTask* self);
|
||||||
|
void seafile_task_set_rate (SeafileTask* self,
|
||||||
|
gint value);
|
||||||
|
static void seafile_task_finalize (GObject * obj);
|
||||||
|
static void _vala_seafile_task_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static void _vala_seafile_task_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
GType seafile_clone_task_get_type (void) G_GNUC_CONST;
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SeafileCloneTask, g_object_unref)
|
||||||
|
SeafileCloneTask* seafile_clone_task_new (void);
|
||||||
|
SeafileCloneTask* seafile_clone_task_construct (GType object_type);
|
||||||
|
const gchar* seafile_clone_task_get_state (SeafileCloneTask* self);
|
||||||
|
void seafile_clone_task_set_state (SeafileCloneTask* self,
|
||||||
|
const gchar* value);
|
||||||
|
gint seafile_clone_task_get_error (SeafileCloneTask* self);
|
||||||
|
void seafile_clone_task_set_error (SeafileCloneTask* self,
|
||||||
|
gint value);
|
||||||
|
const gchar* seafile_clone_task_get_repo_id (SeafileCloneTask* self);
|
||||||
|
void seafile_clone_task_set_repo_id (SeafileCloneTask* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_clone_task_get_repo_name (SeafileCloneTask* self);
|
||||||
|
void seafile_clone_task_set_repo_name (SeafileCloneTask* self,
|
||||||
|
const gchar* value);
|
||||||
|
const gchar* seafile_clone_task_get_worktree (SeafileCloneTask* self);
|
||||||
|
void seafile_clone_task_set_worktree (SeafileCloneTask* self,
|
||||||
|
const gchar* value);
|
||||||
|
static void seafile_clone_task_finalize (GObject * obj);
|
||||||
|
static void _vala_seafile_clone_task_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
static void _vala_seafile_clone_task_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec);
|
||||||
|
|
||||||
|
static inline gpointer
|
||||||
|
seafile_task_get_instance_private (SeafileTask* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, SeafileTask_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
SeafileTask*
|
||||||
|
seafile_task_construct (GType object_type)
|
||||||
|
{
|
||||||
|
SeafileTask * self = NULL;
|
||||||
|
self = (SeafileTask*) g_object_new (object_type, NULL);
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
SeafileTask*
|
||||||
|
seafile_task_new (void)
|
||||||
|
{
|
||||||
|
return seafile_task_construct (SEAFILE_TYPE_TASK);
|
||||||
|
}
|
||||||
|
|
||||||
|
const gchar*
|
||||||
|
seafile_task_get_ttype (SeafileTask* self)
|
||||||
|
{
|
||||||
|
const gchar* result;
|
||||||
|
const gchar* _tmp0_;
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
_tmp0_ = self->priv->_ttype;
|
||||||
|
result = _tmp0_;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
seafile_task_set_ttype (SeafileTask* self,
|
||||||
|
const gchar* value)
|
||||||
|
{
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
if (g_strcmp0 (value, seafile_task_get_ttype (self)) != 0) {
|
||||||
|
gchar* _tmp0_;
|
||||||
|
_tmp0_ = g_strdup (value);
|
||||||
|
_g_free0 (self->priv->_ttype);
|
||||||
|
self->priv->_ttype = _tmp0_;
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, seafile_task_properties[SEAFILE_TASK_TTYPE_PROPERTY]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const gchar*
|
||||||
|
seafile_task_get_repo_id (SeafileTask* self)
|
||||||
|
{
|
||||||
|
const gchar* result;
|
||||||
|
const gchar* _tmp0_;
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
_tmp0_ = self->priv->_repo_id;
|
||||||
|
result = _tmp0_;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
seafile_task_set_repo_id (SeafileTask* self,
|
||||||
|
const gchar* value)
|
||||||
|
{
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
if (g_strcmp0 (value, seafile_task_get_repo_id (self)) != 0) {
|
||||||
|
gchar* _tmp0_;
|
||||||
|
_tmp0_ = g_strdup (value);
|
||||||
|
_g_free0 (self->priv->_repo_id);
|
||||||
|
self->priv->_repo_id = _tmp0_;
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, seafile_task_properties[SEAFILE_TASK_REPO_ID_PROPERTY]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const gchar*
|
||||||
|
seafile_task_get_state (SeafileTask* self)
|
||||||
|
{
|
||||||
|
const gchar* result;
|
||||||
|
const gchar* _tmp0_;
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
_tmp0_ = self->priv->_state;
|
||||||
|
result = _tmp0_;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
seafile_task_set_state (SeafileTask* self,
|
||||||
|
const gchar* value)
|
||||||
|
{
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
if (g_strcmp0 (value, seafile_task_get_state (self)) != 0) {
|
||||||
|
gchar* _tmp0_;
|
||||||
|
_tmp0_ = g_strdup (value);
|
||||||
|
_g_free0 (self->priv->_state);
|
||||||
|
self->priv->_state = _tmp0_;
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, seafile_task_properties[SEAFILE_TASK_STATE_PROPERTY]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const gchar*
|
||||||
|
seafile_task_get_rt_state (SeafileTask* self)
|
||||||
|
{
|
||||||
|
const gchar* result;
|
||||||
|
const gchar* _tmp0_;
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
_tmp0_ = self->priv->_rt_state;
|
||||||
|
result = _tmp0_;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
seafile_task_set_rt_state (SeafileTask* self,
|
||||||
|
const gchar* value)
|
||||||
|
{
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
if (g_strcmp0 (value, seafile_task_get_rt_state (self)) != 0) {
|
||||||
|
gchar* _tmp0_;
|
||||||
|
_tmp0_ = g_strdup (value);
|
||||||
|
_g_free0 (self->priv->_rt_state);
|
||||||
|
self->priv->_rt_state = _tmp0_;
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, seafile_task_properties[SEAFILE_TASK_RT_STATE_PROPERTY]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gint64
|
||||||
|
seafile_task_get_block_total (SeafileTask* self)
|
||||||
|
{
|
||||||
|
gint64 result;
|
||||||
|
g_return_val_if_fail (self != NULL, 0LL);
|
||||||
|
result = self->priv->_block_total;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
seafile_task_set_block_total (SeafileTask* self,
|
||||||
|
gint64 value)
|
||||||
|
{
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
if (seafile_task_get_block_total (self) != value) {
|
||||||
|
self->priv->_block_total = value;
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, seafile_task_properties[SEAFILE_TASK_BLOCK_TOTAL_PROPERTY]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gint64
|
||||||
|
seafile_task_get_block_done (SeafileTask* self)
|
||||||
|
{
|
||||||
|
gint64 result;
|
||||||
|
g_return_val_if_fail (self != NULL, 0LL);
|
||||||
|
result = self->priv->_block_done;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
seafile_task_set_block_done (SeafileTask* self,
|
||||||
|
gint64 value)
|
||||||
|
{
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
if (seafile_task_get_block_done (self) != value) {
|
||||||
|
self->priv->_block_done = value;
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, seafile_task_properties[SEAFILE_TASK_BLOCK_DONE_PROPERTY]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gint
|
||||||
|
seafile_task_get_fs_objects_total (SeafileTask* self)
|
||||||
|
{
|
||||||
|
gint result;
|
||||||
|
g_return_val_if_fail (self != NULL, 0);
|
||||||
|
result = self->priv->_fs_objects_total;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
seafile_task_set_fs_objects_total (SeafileTask* self,
|
||||||
|
gint value)
|
||||||
|
{
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
if (seafile_task_get_fs_objects_total (self) != value) {
|
||||||
|
self->priv->_fs_objects_total = value;
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, seafile_task_properties[SEAFILE_TASK_FS_OBJECTS_TOTAL_PROPERTY]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gint
|
||||||
|
seafile_task_get_fs_objects_done (SeafileTask* self)
|
||||||
|
{
|
||||||
|
gint result;
|
||||||
|
g_return_val_if_fail (self != NULL, 0);
|
||||||
|
result = self->priv->_fs_objects_done;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
seafile_task_set_fs_objects_done (SeafileTask* self,
|
||||||
|
gint value)
|
||||||
|
{
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
if (seafile_task_get_fs_objects_done (self) != value) {
|
||||||
|
self->priv->_fs_objects_done = value;
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, seafile_task_properties[SEAFILE_TASK_FS_OBJECTS_DONE_PROPERTY]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gint
|
||||||
|
seafile_task_get_rate (SeafileTask* self)
|
||||||
|
{
|
||||||
|
gint result;
|
||||||
|
g_return_val_if_fail (self != NULL, 0);
|
||||||
|
result = self->priv->_rate;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
seafile_task_set_rate (SeafileTask* self,
|
||||||
|
gint value)
|
||||||
|
{
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
if (seafile_task_get_rate (self) != value) {
|
||||||
|
self->priv->_rate = value;
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, seafile_task_properties[SEAFILE_TASK_RATE_PROPERTY]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
seafile_task_class_init (SeafileTaskClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
seafile_task_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
g_type_class_adjust_private_offset (klass, &SeafileTask_private_offset);
|
||||||
|
G_OBJECT_CLASS (klass)->get_property = _vala_seafile_task_get_property;
|
||||||
|
G_OBJECT_CLASS (klass)->set_property = _vala_seafile_task_set_property;
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = seafile_task_finalize;
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), SEAFILE_TASK_TTYPE_PROPERTY, seafile_task_properties[SEAFILE_TASK_TTYPE_PROPERTY] = g_param_spec_string ("ttype", "ttype", "ttype", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), SEAFILE_TASK_REPO_ID_PROPERTY, seafile_task_properties[SEAFILE_TASK_REPO_ID_PROPERTY] = g_param_spec_string ("repo-id", "repo-id", "repo-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), SEAFILE_TASK_STATE_PROPERTY, seafile_task_properties[SEAFILE_TASK_STATE_PROPERTY] = g_param_spec_string ("state", "state", "state", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), SEAFILE_TASK_RT_STATE_PROPERTY, seafile_task_properties[SEAFILE_TASK_RT_STATE_PROPERTY] = g_param_spec_string ("rt-state", "rt-state", "rt-state", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), SEAFILE_TASK_BLOCK_TOTAL_PROPERTY, seafile_task_properties[SEAFILE_TASK_BLOCK_TOTAL_PROPERTY] = g_param_spec_int64 ("block-total", "block-total", "block-total", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), SEAFILE_TASK_BLOCK_DONE_PROPERTY, seafile_task_properties[SEAFILE_TASK_BLOCK_DONE_PROPERTY] = g_param_spec_int64 ("block-done", "block-done", "block-done", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), SEAFILE_TASK_FS_OBJECTS_TOTAL_PROPERTY, seafile_task_properties[SEAFILE_TASK_FS_OBJECTS_TOTAL_PROPERTY] = g_param_spec_int ("fs-objects-total", "fs-objects-total", "fs-objects-total", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), SEAFILE_TASK_FS_OBJECTS_DONE_PROPERTY, seafile_task_properties[SEAFILE_TASK_FS_OBJECTS_DONE_PROPERTY] = g_param_spec_int ("fs-objects-done", "fs-objects-done", "fs-objects-done", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), SEAFILE_TASK_RATE_PROPERTY, seafile_task_properties[SEAFILE_TASK_RATE_PROPERTY] = g_param_spec_int ("rate", "rate", "rate", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
seafile_task_instance_init (SeafileTask * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
self->priv = seafile_task_get_instance_private (self);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
seafile_task_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
SeafileTask * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, SEAFILE_TYPE_TASK, SeafileTask);
|
||||||
|
_g_free0 (self->priv->_ttype);
|
||||||
|
_g_free0 (self->priv->_repo_id);
|
||||||
|
_g_free0 (self->priv->_state);
|
||||||
|
_g_free0 (self->priv->_rt_state);
|
||||||
|
G_OBJECT_CLASS (seafile_task_parent_class)->finalize (obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
seafile_task_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize seafile_task_type_id__volatile = 0;
|
||||||
|
if (g_once_init_enter (&seafile_task_type_id__volatile)) {
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (SeafileTaskClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) seafile_task_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SeafileTask), 0, (GInstanceInitFunc) seafile_task_instance_init, NULL };
|
||||||
|
GType seafile_task_type_id;
|
||||||
|
seafile_task_type_id = g_type_register_static (G_TYPE_OBJECT, "SeafileTask", &g_define_type_info, 0);
|
||||||
|
SeafileTask_private_offset = g_type_add_instance_private (seafile_task_type_id, sizeof (SeafileTaskPrivate));
|
||||||
|
g_once_init_leave (&seafile_task_type_id__volatile, seafile_task_type_id);
|
||||||
|
}
|
||||||
|
return seafile_task_type_id__volatile;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_seafile_task_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
SeafileTask * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, SEAFILE_TYPE_TASK, SeafileTask);
|
||||||
|
switch (property_id) {
|
||||||
|
case SEAFILE_TASK_TTYPE_PROPERTY:
|
||||||
|
g_value_set_string (value, seafile_task_get_ttype (self));
|
||||||
|
break;
|
||||||
|
case SEAFILE_TASK_REPO_ID_PROPERTY:
|
||||||
|
g_value_set_string (value, seafile_task_get_repo_id (self));
|
||||||
|
break;
|
||||||
|
case SEAFILE_TASK_STATE_PROPERTY:
|
||||||
|
g_value_set_string (value, seafile_task_get_state (self));
|
||||||
|
break;
|
||||||
|
case SEAFILE_TASK_RT_STATE_PROPERTY:
|
||||||
|
g_value_set_string (value, seafile_task_get_rt_state (self));
|
||||||
|
break;
|
||||||
|
case SEAFILE_TASK_BLOCK_TOTAL_PROPERTY:
|
||||||
|
g_value_set_int64 (value, seafile_task_get_block_total (self));
|
||||||
|
break;
|
||||||
|
case SEAFILE_TASK_BLOCK_DONE_PROPERTY:
|
||||||
|
g_value_set_int64 (value, seafile_task_get_block_done (self));
|
||||||
|
break;
|
||||||
|
case SEAFILE_TASK_FS_OBJECTS_TOTAL_PROPERTY:
|
||||||
|
g_value_set_int (value, seafile_task_get_fs_objects_total (self));
|
||||||
|
break;
|
||||||
|
case SEAFILE_TASK_FS_OBJECTS_DONE_PROPERTY:
|
||||||
|
g_value_set_int (value, seafile_task_get_fs_objects_done (self));
|
||||||
|
break;
|
||||||
|
case SEAFILE_TASK_RATE_PROPERTY:
|
||||||
|
g_value_set_int (value, seafile_task_get_rate (self));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_seafile_task_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
SeafileTask * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, SEAFILE_TYPE_TASK, SeafileTask);
|
||||||
|
switch (property_id) {
|
||||||
|
case SEAFILE_TASK_TTYPE_PROPERTY:
|
||||||
|
seafile_task_set_ttype (self, g_value_get_string (value));
|
||||||
|
break;
|
||||||
|
case SEAFILE_TASK_REPO_ID_PROPERTY:
|
||||||
|
seafile_task_set_repo_id (self, g_value_get_string (value));
|
||||||
|
break;
|
||||||
|
case SEAFILE_TASK_STATE_PROPERTY:
|
||||||
|
seafile_task_set_state (self, g_value_get_string (value));
|
||||||
|
break;
|
||||||
|
case SEAFILE_TASK_RT_STATE_PROPERTY:
|
||||||
|
seafile_task_set_rt_state (self, g_value_get_string (value));
|
||||||
|
break;
|
||||||
|
case SEAFILE_TASK_BLOCK_TOTAL_PROPERTY:
|
||||||
|
seafile_task_set_block_total (self, g_value_get_int64 (value));
|
||||||
|
break;
|
||||||
|
case SEAFILE_TASK_BLOCK_DONE_PROPERTY:
|
||||||
|
seafile_task_set_block_done (self, g_value_get_int64 (value));
|
||||||
|
break;
|
||||||
|
case SEAFILE_TASK_FS_OBJECTS_TOTAL_PROPERTY:
|
||||||
|
seafile_task_set_fs_objects_total (self, g_value_get_int (value));
|
||||||
|
break;
|
||||||
|
case SEAFILE_TASK_FS_OBJECTS_DONE_PROPERTY:
|
||||||
|
seafile_task_set_fs_objects_done (self, g_value_get_int (value));
|
||||||
|
break;
|
||||||
|
case SEAFILE_TASK_RATE_PROPERTY:
|
||||||
|
seafile_task_set_rate (self, g_value_get_int (value));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline gpointer
|
||||||
|
seafile_clone_task_get_instance_private (SeafileCloneTask* self)
|
||||||
|
{
|
||||||
|
return G_STRUCT_MEMBER_P (self, SeafileCloneTask_private_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
SeafileCloneTask*
|
||||||
|
seafile_clone_task_construct (GType object_type)
|
||||||
|
{
|
||||||
|
SeafileCloneTask * self = NULL;
|
||||||
|
self = (SeafileCloneTask*) g_object_new (object_type, NULL);
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
SeafileCloneTask*
|
||||||
|
seafile_clone_task_new (void)
|
||||||
|
{
|
||||||
|
return seafile_clone_task_construct (SEAFILE_TYPE_CLONE_TASK);
|
||||||
|
}
|
||||||
|
|
||||||
|
const gchar*
|
||||||
|
seafile_clone_task_get_state (SeafileCloneTask* self)
|
||||||
|
{
|
||||||
|
const gchar* result;
|
||||||
|
const gchar* _tmp0_;
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
_tmp0_ = self->priv->_state;
|
||||||
|
result = _tmp0_;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
seafile_clone_task_set_state (SeafileCloneTask* self,
|
||||||
|
const gchar* value)
|
||||||
|
{
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
if (g_strcmp0 (value, seafile_clone_task_get_state (self)) != 0) {
|
||||||
|
gchar* _tmp0_;
|
||||||
|
_tmp0_ = g_strdup (value);
|
||||||
|
_g_free0 (self->priv->_state);
|
||||||
|
self->priv->_state = _tmp0_;
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, seafile_clone_task_properties[SEAFILE_CLONE_TASK_STATE_PROPERTY]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gint
|
||||||
|
seafile_clone_task_get_error (SeafileCloneTask* self)
|
||||||
|
{
|
||||||
|
gint result;
|
||||||
|
g_return_val_if_fail (self != NULL, 0);
|
||||||
|
result = self->priv->_error;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
seafile_clone_task_set_error (SeafileCloneTask* self,
|
||||||
|
gint value)
|
||||||
|
{
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
if (seafile_clone_task_get_error (self) != value) {
|
||||||
|
self->priv->_error = value;
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, seafile_clone_task_properties[SEAFILE_CLONE_TASK_ERROR_PROPERTY]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const gchar*
|
||||||
|
seafile_clone_task_get_repo_id (SeafileCloneTask* self)
|
||||||
|
{
|
||||||
|
const gchar* result;
|
||||||
|
const gchar* _tmp0_;
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
_tmp0_ = self->priv->_repo_id;
|
||||||
|
result = _tmp0_;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
seafile_clone_task_set_repo_id (SeafileCloneTask* self,
|
||||||
|
const gchar* value)
|
||||||
|
{
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
if (g_strcmp0 (value, seafile_clone_task_get_repo_id (self)) != 0) {
|
||||||
|
gchar* _tmp0_;
|
||||||
|
_tmp0_ = g_strdup (value);
|
||||||
|
_g_free0 (self->priv->_repo_id);
|
||||||
|
self->priv->_repo_id = _tmp0_;
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, seafile_clone_task_properties[SEAFILE_CLONE_TASK_REPO_ID_PROPERTY]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const gchar*
|
||||||
|
seafile_clone_task_get_repo_name (SeafileCloneTask* self)
|
||||||
|
{
|
||||||
|
const gchar* result;
|
||||||
|
const gchar* _tmp0_;
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
_tmp0_ = self->priv->_repo_name;
|
||||||
|
result = _tmp0_;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
seafile_clone_task_set_repo_name (SeafileCloneTask* self,
|
||||||
|
const gchar* value)
|
||||||
|
{
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
if (g_strcmp0 (value, seafile_clone_task_get_repo_name (self)) != 0) {
|
||||||
|
gchar* _tmp0_;
|
||||||
|
_tmp0_ = g_strdup (value);
|
||||||
|
_g_free0 (self->priv->_repo_name);
|
||||||
|
self->priv->_repo_name = _tmp0_;
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, seafile_clone_task_properties[SEAFILE_CLONE_TASK_REPO_NAME_PROPERTY]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const gchar*
|
||||||
|
seafile_clone_task_get_worktree (SeafileCloneTask* self)
|
||||||
|
{
|
||||||
|
const gchar* result;
|
||||||
|
const gchar* _tmp0_;
|
||||||
|
g_return_val_if_fail (self != NULL, NULL);
|
||||||
|
_tmp0_ = self->priv->_worktree;
|
||||||
|
result = _tmp0_;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
seafile_clone_task_set_worktree (SeafileCloneTask* self,
|
||||||
|
const gchar* value)
|
||||||
|
{
|
||||||
|
g_return_if_fail (self != NULL);
|
||||||
|
if (g_strcmp0 (value, seafile_clone_task_get_worktree (self)) != 0) {
|
||||||
|
gchar* _tmp0_;
|
||||||
|
_tmp0_ = g_strdup (value);
|
||||||
|
_g_free0 (self->priv->_worktree);
|
||||||
|
self->priv->_worktree = _tmp0_;
|
||||||
|
g_object_notify_by_pspec ((GObject *) self, seafile_clone_task_properties[SEAFILE_CLONE_TASK_WORKTREE_PROPERTY]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
seafile_clone_task_class_init (SeafileCloneTaskClass * klass,
|
||||||
|
gpointer klass_data)
|
||||||
|
{
|
||||||
|
seafile_clone_task_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
g_type_class_adjust_private_offset (klass, &SeafileCloneTask_private_offset);
|
||||||
|
G_OBJECT_CLASS (klass)->get_property = _vala_seafile_clone_task_get_property;
|
||||||
|
G_OBJECT_CLASS (klass)->set_property = _vala_seafile_clone_task_set_property;
|
||||||
|
G_OBJECT_CLASS (klass)->finalize = seafile_clone_task_finalize;
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), SEAFILE_CLONE_TASK_STATE_PROPERTY, seafile_clone_task_properties[SEAFILE_CLONE_TASK_STATE_PROPERTY] = g_param_spec_string ("state", "state", "state", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), SEAFILE_CLONE_TASK_ERROR_PROPERTY, seafile_clone_task_properties[SEAFILE_CLONE_TASK_ERROR_PROPERTY] = g_param_spec_int ("error", "error", "error", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), SEAFILE_CLONE_TASK_REPO_ID_PROPERTY, seafile_clone_task_properties[SEAFILE_CLONE_TASK_REPO_ID_PROPERTY] = g_param_spec_string ("repo-id", "repo-id", "repo-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), SEAFILE_CLONE_TASK_REPO_NAME_PROPERTY, seafile_clone_task_properties[SEAFILE_CLONE_TASK_REPO_NAME_PROPERTY] = g_param_spec_string ("repo-name", "repo-name", "repo-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), SEAFILE_CLONE_TASK_WORKTREE_PROPERTY, seafile_clone_task_properties[SEAFILE_CLONE_TASK_WORKTREE_PROPERTY] = g_param_spec_string ("worktree", "worktree", "worktree", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
seafile_clone_task_instance_init (SeafileCloneTask * self,
|
||||||
|
gpointer klass)
|
||||||
|
{
|
||||||
|
self->priv = seafile_clone_task_get_instance_private (self);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
seafile_clone_task_finalize (GObject * obj)
|
||||||
|
{
|
||||||
|
SeafileCloneTask * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (obj, SEAFILE_TYPE_CLONE_TASK, SeafileCloneTask);
|
||||||
|
_g_free0 (self->priv->_state);
|
||||||
|
_g_free0 (self->priv->_repo_id);
|
||||||
|
_g_free0 (self->priv->_repo_name);
|
||||||
|
_g_free0 (self->priv->_worktree);
|
||||||
|
G_OBJECT_CLASS (seafile_clone_task_parent_class)->finalize (obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
seafile_clone_task_get_type (void)
|
||||||
|
{
|
||||||
|
static volatile gsize seafile_clone_task_type_id__volatile = 0;
|
||||||
|
if (g_once_init_enter (&seafile_clone_task_type_id__volatile)) {
|
||||||
|
static const GTypeInfo g_define_type_info = { sizeof (SeafileCloneTaskClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) seafile_clone_task_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SeafileCloneTask), 0, (GInstanceInitFunc) seafile_clone_task_instance_init, NULL };
|
||||||
|
GType seafile_clone_task_type_id;
|
||||||
|
seafile_clone_task_type_id = g_type_register_static (G_TYPE_OBJECT, "SeafileCloneTask", &g_define_type_info, 0);
|
||||||
|
SeafileCloneTask_private_offset = g_type_add_instance_private (seafile_clone_task_type_id, sizeof (SeafileCloneTaskPrivate));
|
||||||
|
g_once_init_leave (&seafile_clone_task_type_id__volatile, seafile_clone_task_type_id);
|
||||||
|
}
|
||||||
|
return seafile_clone_task_type_id__volatile;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_seafile_clone_task_get_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
SeafileCloneTask * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, SEAFILE_TYPE_CLONE_TASK, SeafileCloneTask);
|
||||||
|
switch (property_id) {
|
||||||
|
case SEAFILE_CLONE_TASK_STATE_PROPERTY:
|
||||||
|
g_value_set_string (value, seafile_clone_task_get_state (self));
|
||||||
|
break;
|
||||||
|
case SEAFILE_CLONE_TASK_ERROR_PROPERTY:
|
||||||
|
g_value_set_int (value, seafile_clone_task_get_error (self));
|
||||||
|
break;
|
||||||
|
case SEAFILE_CLONE_TASK_REPO_ID_PROPERTY:
|
||||||
|
g_value_set_string (value, seafile_clone_task_get_repo_id (self));
|
||||||
|
break;
|
||||||
|
case SEAFILE_CLONE_TASK_REPO_NAME_PROPERTY:
|
||||||
|
g_value_set_string (value, seafile_clone_task_get_repo_name (self));
|
||||||
|
break;
|
||||||
|
case SEAFILE_CLONE_TASK_WORKTREE_PROPERTY:
|
||||||
|
g_value_set_string (value, seafile_clone_task_get_worktree (self));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_vala_seafile_clone_task_set_property (GObject * object,
|
||||||
|
guint property_id,
|
||||||
|
const GValue * value,
|
||||||
|
GParamSpec * pspec)
|
||||||
|
{
|
||||||
|
SeafileCloneTask * self;
|
||||||
|
self = G_TYPE_CHECK_INSTANCE_CAST (object, SEAFILE_TYPE_CLONE_TASK, SeafileCloneTask);
|
||||||
|
switch (property_id) {
|
||||||
|
case SEAFILE_CLONE_TASK_STATE_PROPERTY:
|
||||||
|
seafile_clone_task_set_state (self, g_value_get_string (value));
|
||||||
|
break;
|
||||||
|
case SEAFILE_CLONE_TASK_ERROR_PROPERTY:
|
||||||
|
seafile_clone_task_set_error (self, g_value_get_int (value));
|
||||||
|
break;
|
||||||
|
case SEAFILE_CLONE_TASK_REPO_ID_PROPERTY:
|
||||||
|
seafile_clone_task_set_repo_id (self, g_value_get_string (value));
|
||||||
|
break;
|
||||||
|
case SEAFILE_CLONE_TASK_REPO_NAME_PROPERTY:
|
||||||
|
seafile_clone_task_set_repo_name (self, g_value_get_string (value));
|
||||||
|
break;
|
||||||
|
case SEAFILE_CLONE_TASK_WORKTREE_PROPERTY:
|
||||||
|
seafile_clone_task_set_worktree (self, g_value_get_string (value));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
32
lib/utils.c
32
lib/utils.c
@ -1,7 +1,5 @@
|
|||||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
|
||||||
#include <config.h>
|
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@ -20,21 +18,25 @@
|
|||||||
#include <Rpc.h>
|
#include <Rpc.h>
|
||||||
#include <shlobj.h>
|
#include <shlobj.h>
|
||||||
#include <psapi.h>
|
#include <psapi.h>
|
||||||
|
#include <openssl/applink.c>
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
|
#include <config.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <uuid/uuid.h>
|
#include <uuid/uuid.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <dirent.h>
|
||||||
|
#endif
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <dirent.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
@ -46,7 +48,9 @@
|
|||||||
|
|
||||||
#include <jansson.h>
|
#include <jansson.h>
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
#include <utime.h>
|
#include <utime.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
|
|
||||||
@ -385,9 +389,9 @@ seaf_stat (const char *path, SeafStat *st)
|
|||||||
memset (st, 0, sizeof(SeafStat));
|
memset (st, 0, sizeof(SeafStat));
|
||||||
|
|
||||||
if (attrs.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
if (attrs.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||||
st->st_mode = (S_IFDIR | S_IRWXU);
|
st->st_mode = S_IFDIR;
|
||||||
else
|
else
|
||||||
st->st_mode = (S_IFREG | S_IRUSR | S_IWUSR);
|
st->st_mode = S_IFREG;
|
||||||
|
|
||||||
st->st_atime = file_time_to_unix_time (&attrs.ftLastAccessTime);
|
st->st_atime = file_time_to_unix_time (&attrs.ftLastAccessTime);
|
||||||
st->st_ctime = file_time_to_unix_time (&attrs.ftCreationTime);
|
st->st_ctime = file_time_to_unix_time (&attrs.ftCreationTime);
|
||||||
@ -428,9 +432,9 @@ seaf_stat_from_find_data (WIN32_FIND_DATAW *fdata, SeafStat *st)
|
|||||||
memset (st, 0, sizeof(SeafStat));
|
memset (st, 0, sizeof(SeafStat));
|
||||||
|
|
||||||
if (fdata->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
if (fdata->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||||
st->st_mode = (S_IFDIR | S_IRWXU);
|
st->st_mode = S_IFDIR;
|
||||||
else
|
else
|
||||||
st->st_mode = (S_IFREG | S_IRUSR | S_IWUSR);
|
st->st_mode = S_IFREG;
|
||||||
|
|
||||||
st->st_atime = file_time_to_unix_time (&fdata->ftLastAccessTime);
|
st->st_atime = file_time_to_unix_time (&fdata->ftLastAccessTime);
|
||||||
st->st_ctime = file_time_to_unix_time (&fdata->ftCreationTime);
|
st->st_ctime = file_time_to_unix_time (&fdata->ftCreationTime);
|
||||||
@ -1279,9 +1283,9 @@ char* gen_uuid ()
|
|||||||
UUID uuid;
|
UUID uuid;
|
||||||
|
|
||||||
UuidCreate(&uuid);
|
UuidCreate(&uuid);
|
||||||
UuidToString(&uuid, &str);
|
UuidToStringA(&uuid, &str);
|
||||||
memcpy(uuid_str, str, 37);
|
memcpy(uuid_str, str, 37);
|
||||||
RpcStringFree(&str);
|
RpcStringFreeA(&str);
|
||||||
return uuid_str;
|
return uuid_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1291,9 +1295,9 @@ void gen_uuid_inplace (char *buf)
|
|||||||
UUID uuid;
|
UUID uuid;
|
||||||
|
|
||||||
UuidCreate(&uuid);
|
UuidCreate(&uuid);
|
||||||
UuidToString(&uuid, &str);
|
UuidToStringA(&uuid, &str);
|
||||||
memcpy(buf, str, 37);
|
memcpy(buf, str, 37);
|
||||||
RpcStringFree(&str);
|
RpcStringFreeA(&str);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
@ -1303,7 +1307,7 @@ is_uuid_valid (const char *uuid_str)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
UUID uuid;
|
UUID uuid;
|
||||||
if (UuidFromString((unsigned char *)uuid_str, &uuid) != RPC_S_OK)
|
if (UuidFromStringA((unsigned char *)uuid_str, &uuid) != RPC_S_OK)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -1806,7 +1810,7 @@ get_process_handle (const char *process_name_in)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (EnumProcessModules(hProcess, &hMod, sizeof(hMod), &cbNeeded)) {
|
if (EnumProcessModules(hProcess, &hMod, sizeof(hMod), &cbNeeded)) {
|
||||||
GetModuleBaseName(hProcess, hMod, process_name,
|
GetModuleBaseNameA(hProcess, hMod, process_name,
|
||||||
sizeof(process_name)/sizeof(char));
|
sizeof(process_name)/sizeof(char));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1853,7 +1857,7 @@ int count_process (const char *process_name_in)
|
|||||||
|
|
||||||
if (EnumProcessModules(hProcess, hMods, sizeof(hMods), &cbNeeded)) {
|
if (EnumProcessModules(hProcess, hMods, sizeof(hMods), &cbNeeded)) {
|
||||||
for (j = 0; j < cbNeeded / sizeof(HMODULE); j++) {
|
for (j = 0; j < cbNeeded / sizeof(HMODULE); j++) {
|
||||||
if (GetModuleBaseName(hProcess, hMods[j], process_name,
|
if (GetModuleBaseNameA(hProcess, hMods[j], process_name,
|
||||||
sizeof(process_name))) {
|
sizeof(process_name))) {
|
||||||
if (strcasecmp(process_name, name) == 0)
|
if (strcasecmp(process_name, name) == 0)
|
||||||
count++;
|
count++;
|
||||||
|
20
lib/utils.h
20
lib/utils.h
@ -11,10 +11,12 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <unistd.h>
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
@ -39,6 +41,10 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <glib/gstdio.h>
|
#include <glib/gstdio.h>
|
||||||
|
|
||||||
|
#define mode_t int
|
||||||
|
|
||||||
|
#define ssize_t gssize
|
||||||
|
|
||||||
#ifndef WEXITSTATUS
|
#ifndef WEXITSTATUS
|
||||||
#define WEXITSTATUS(status) (((status) & 0xff00) >> 8)
|
#define WEXITSTATUS(status) (((status) & 0xff00) >> 8)
|
||||||
#endif
|
#endif
|
||||||
@ -142,15 +148,27 @@ should_ignore_on_checkout (const char *file_path, IgnoreReason *ignore_reason);
|
|||||||
|
|
||||||
/* for debug */
|
/* for debug */
|
||||||
#ifndef ccnet_warning
|
#ifndef ccnet_warning
|
||||||
|
#ifndef WIN32
|
||||||
#define ccnet_warning(fmt, ...) g_warning("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
#define ccnet_warning(fmt, ...) g_warning("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
||||||
|
#else
|
||||||
|
#define ccnet_warning(...) g_warning (__VA_ARGS__)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef ccnet_error
|
#ifndef ccnet_error
|
||||||
|
#ifndef WIN32
|
||||||
#define ccnet_error(fmt, ...) g_error("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
#define ccnet_error(fmt, ...) g_error("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
||||||
|
#else
|
||||||
|
#define ccnet_error(...) g_error(__VA_ARGS__)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef ccnet_message
|
#ifndef ccnet_message
|
||||||
|
#ifndef WIN32
|
||||||
#define ccnet_message(fmt, ...) g_message("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
#define ccnet_message(fmt, ...) g_message("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
||||||
|
#else
|
||||||
|
#define ccnet_message(...) g_message(__VA_ARGS__)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CCNET_DOMAIN g_quark_from_string("ccnet")
|
#define CCNET_DOMAIN g_quark_from_string("ccnet")
|
||||||
|
31
msi/custom/seafile_custom.sln
Normal file
31
msi/custom/seafile_custom.sln
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 16
|
||||||
|
VisualStudioVersion = 16.0.30611.23
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "seafile_custom", "..\seafile_custom.vcxproj", "{D0B1637D-AF0E-4724-B4E4-DCFF641EBB4B}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{D0B1637D-AF0E-4724-B4E4-DCFF641EBB4B}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{D0B1637D-AF0E-4724-B4E4-DCFF641EBB4B}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{D0B1637D-AF0E-4724-B4E4-DCFF641EBB4B}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{D0B1637D-AF0E-4724-B4E4-DCFF641EBB4B}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{D0B1637D-AF0E-4724-B4E4-DCFF641EBB4B}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{D0B1637D-AF0E-4724-B4E4-DCFF641EBB4B}.Release|x64.Build.0 = Release|x64
|
||||||
|
{D0B1637D-AF0E-4724-B4E4-DCFF641EBB4B}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{D0B1637D-AF0E-4724-B4E4-DCFF641EBB4B}.Release|x86.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {1F899345-72EA-47B3-B3B9-EB5CA31D6238}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
162
msi/custom/seafile_custom.vcxproj
Normal file
162
msi/custom/seafile_custom.vcxproj
Normal file
@ -0,0 +1,162 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="custom.c" />
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<VCProjectVersion>16.0</VCProjectVersion>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<ProjectGuid>{d0b1637d-af0e-4724-b4e4-dcff641ebb4b}</ProjectGuid>
|
||||||
|
<RootNamespace>seafilecustom</RootNamespace>
|
||||||
|
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="Shared">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<OutDir>$(ProjectDir)$(Platform)\$(Configuration)\</OutDir>
|
||||||
|
<TargetName>seafile_custom64</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;SEAFILECUSTOM_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableUAC>false</EnableUAC>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;SEAFILECUSTOM_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableUAC>false</EnableUAC>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;SEAFILECUSTOM_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableUAC>false</EnableUAC>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;SEAFILECUSTOM_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableUAC>false</EnableUAC>
|
||||||
|
<ModuleDefinitionFile>$(ProjectDir)custom.def</ModuleDefinitionFile>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
22
msi/custom/seafile_custom.vcxproj.filters
Normal file
22
msi/custom/seafile_custom.vcxproj.filters
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Source Files">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Header Files">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Resource Files">
|
||||||
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
|
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="custom.c">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
@ -78,13 +78,13 @@
|
|||||||
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]"
|
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]"
|
||||||
Name="shellext" Type="integer" Value="1" KeyPath='yes' />
|
Name="shellext" Type="integer" Value="1" KeyPath='yes' />
|
||||||
|
|
||||||
<File Id="seafile_ext.dll" Name="seafile_ext.dll" Source="custom\seafile_ext.dll" />
|
<!--<File Id="seafile_ext.dll" Name="seafile_ext.dll" Source="custom\seafile_ext.dll" />-->
|
||||||
<File Id="seafile_ext64.dll" Name="seafile_ext64.dll" Source="custom\seafile_ext64.dll" />
|
<File Id="seafile_ext64.dll" Name="seafile_ext64.dll" Source="custom\seafile_ext64.dll" />
|
||||||
</Component>
|
</Component>
|
||||||
</Directory>
|
</Directory>
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
<Directory Id='ProgramFilesFolder' Name='PFiles'>
|
<Directory Id='ProgramFiles64Folder' Name='PFiles'>
|
||||||
<Directory Id='INSTALLDIR' Name='!(loc.AppName)'>
|
<Directory Id='INSTALLDIR' Name='!(loc.AppName)'>
|
||||||
<Directory Id='bin_Dir' Name='bin'>
|
<Directory Id='bin_Dir' Name='bin'>
|
||||||
<Component Id='comp_custom' Guid="$(var.GuidOfCustomComponent)">
|
<Component Id='comp_custom' Guid="$(var.GuidOfCustomComponent)">
|
||||||
@ -143,10 +143,10 @@
|
|||||||
</DirectoryRef>
|
</DirectoryRef>
|
||||||
|
|
||||||
|
|
||||||
<Binary Id='seafile_custom_dll32' SourceFile='custom\seafile_custom32.dll' />
|
<!-- <Binary Id='seafile_custom_dll32' SourceFile='custom\seafile_custom32.dll' /> -->
|
||||||
<Binary Id='seafile_custom_dll64' SourceFile='custom\seafile_custom64.dll' />
|
<Binary Id='seafile_custom_dll64' SourceFile='custom\seafile_custom64.dll' />
|
||||||
|
|
||||||
<CustomAction Id="MoveExtDll" BinaryKey="seafile_custom_dll32" DllEntry="RemoveExtDll" Execute="immediate" />
|
<!-- <CustomAction Id="MoveExtDll" BinaryKey="seafile_custom_dll32" DllEntry="RemoveExtDll" Execute="immediate" /> -->
|
||||||
<CustomAction Id="MoveExtDll64" BinaryKey="seafile_custom_dll64" DllEntry="RemoveExtDll" Execute="immediate" />
|
<CustomAction Id="MoveExtDll64" BinaryKey="seafile_custom_dll64" DllEntry="RemoveExtDll" Execute="immediate" />
|
||||||
|
|
||||||
<CustomAction Id="RemoveSeafileUserData" FileKey="seafileapplet.exe" ExeCommand="--remove-user-data"
|
<CustomAction Id="RemoveSeafileUserData" FileKey="seafileapplet.exe" ExeCommand="--remove-user-data"
|
||||||
@ -156,9 +156,11 @@
|
|||||||
|
|
||||||
<InstallExecuteSequence>
|
<InstallExecuteSequence>
|
||||||
<!-- Move away seafile shell extension so we don't need to kill explorer during upgrade or uninstall. -->
|
<!-- Move away seafile shell extension so we don't need to kill explorer during upgrade or uninstall. -->
|
||||||
|
<!--
|
||||||
<Custom Action="MoveExtDll" Before="InstallValidate">
|
<Custom Action="MoveExtDll" Before="InstallValidate">
|
||||||
((REMOVE="ALL") OR UPGRADINGPRODUCTCODE OR WIX_UPGRADE_DETECTED) AND (NOT VersionNT64)
|
((REMOVE="ALL") OR UPGRADINGPRODUCTCODE OR WIX_UPGRADE_DETECTED) AND (NOT VersionNT64)
|
||||||
</Custom>
|
</Custom>
|
||||||
|
-->
|
||||||
<Custom Action="MoveExtDll64" Before="InstallValidate">
|
<Custom Action="MoveExtDll64" Before="InstallValidate">
|
||||||
((REMOVE="ALL") OR UPGRADINGPRODUCTCODE OR WIX_UPGRADE_DETECTED) AND VersionNT64
|
((REMOVE="ALL") OR UPGRADINGPRODUCTCODE OR WIX_UPGRADE_DETECTED) AND VersionNT64
|
||||||
</Custom>
|
</Custom>
|
||||||
|
499
scripts/build/build-msi-vs.py
Normal file
499
scripts/build/build-msi-vs.py
Normal file
@ -0,0 +1,499 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# coding: UTF-8
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
####################
|
||||||
|
### Requires Python 3+
|
||||||
|
####################
|
||||||
|
if sys.version_info[0] == 2:
|
||||||
|
print('Python 2 not be supported, require Python 3. Quit now.')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
import shutil
|
||||||
|
import time
|
||||||
|
import glob
|
||||||
|
import re
|
||||||
|
|
||||||
|
BUILDDIR = os.path.join(os.getcwd(), "..\\..\\..\\")
|
||||||
|
|
||||||
|
##################
|
||||||
|
### Configure
|
||||||
|
##################
|
||||||
|
# The seafile package project directory
|
||||||
|
# Directory where the signing certificate is located
|
||||||
|
CERTFILE = "C:/certs/seafile.pfx"
|
||||||
|
|
||||||
|
# Qt library directory
|
||||||
|
QT_DIR = "C:/Qt/Qt5.13.1/5.13.1/msvc2017_64/"
|
||||||
|
|
||||||
|
# Wix install directory
|
||||||
|
WIX_BIN = "C:/wix/bin"
|
||||||
|
|
||||||
|
# Openssl lib directory
|
||||||
|
OPENSSL_DIR = "C:/packagelib"
|
||||||
|
|
||||||
|
#####################
|
||||||
|
# Work path : seafile library and program tmp directory
|
||||||
|
# and wix build path
|
||||||
|
#####################
|
||||||
|
# Package directory
|
||||||
|
SLNOUTPUTDIR = os.path.join(BUILDDIR, "pack")
|
||||||
|
|
||||||
|
# Wix package directory
|
||||||
|
WIX_PACKAGE_DIR = "C:/pack"
|
||||||
|
|
||||||
|
####################
|
||||||
|
### Global variables
|
||||||
|
###################
|
||||||
|
RETRY_COUNT = 3
|
||||||
|
error_exit = False
|
||||||
|
version = ''
|
||||||
|
|
||||||
|
####################
|
||||||
|
### Common helper functions
|
||||||
|
###################
|
||||||
|
|
||||||
|
def highlight(content, is_error=False):
|
||||||
|
'''Add ANSI color to content to get it highlighted on terminal'''
|
||||||
|
dummy = is_error
|
||||||
|
return content
|
||||||
|
# if is_error:
|
||||||
|
# return '\x1b[1;31m%s\x1b[m' % content
|
||||||
|
# else:
|
||||||
|
# return '\x1b[1;32m%s\x1b[m' % content
|
||||||
|
|
||||||
|
def info(msg):
|
||||||
|
print(highlight('[INFO] ') + msg)
|
||||||
|
|
||||||
|
def error(msg=None, usage=None):
|
||||||
|
if msg:
|
||||||
|
print(highlight('[ERROR] ') + msg)
|
||||||
|
if usage:
|
||||||
|
print(usage)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
def find_in_path(prog):
|
||||||
|
'''Test whether prog exists in system path'''
|
||||||
|
dirs = os.environ['PATH'].split(';')
|
||||||
|
for d in dirs:
|
||||||
|
if d == '':
|
||||||
|
continue
|
||||||
|
path = os.path.join(d, prog)
|
||||||
|
if os.path.exists(path):
|
||||||
|
return path
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
|
def run(cmdline, cwd=None, env=None, suppress_stdout=False, suppress_stderr=False):
|
||||||
|
'''Specify a command line string'''
|
||||||
|
info('running %s, cwd=%s' % (cmdline, cwd if cwd else os.getcwd()))
|
||||||
|
with open(os.devnull, 'w') as devnull:
|
||||||
|
if suppress_stdout:
|
||||||
|
stdout = devnull
|
||||||
|
else:
|
||||||
|
stdout = sys.stdout
|
||||||
|
|
||||||
|
if suppress_stderr:
|
||||||
|
stderr = devnull
|
||||||
|
else:
|
||||||
|
stderr = sys.stderr
|
||||||
|
|
||||||
|
proc = subprocess.Popen(cmdline,
|
||||||
|
cwd=cwd,
|
||||||
|
stdout=stdout,
|
||||||
|
stderr=stderr,
|
||||||
|
env=env,
|
||||||
|
shell=True)
|
||||||
|
ret = proc.wait()
|
||||||
|
if ret != 0:
|
||||||
|
global error_exit
|
||||||
|
error_exit = True
|
||||||
|
return ret
|
||||||
|
|
||||||
|
def must_copy(src, dst):
|
||||||
|
'''Copy src to dst, exit on failure'''
|
||||||
|
try:
|
||||||
|
shutil.copy(src, dst)
|
||||||
|
except Exception as e:
|
||||||
|
error('failed to copy %s to %s: %s' % (src, dst, e))
|
||||||
|
|
||||||
|
def must_copytree(src, dst):
|
||||||
|
'''Copy dir src to dst, exit on failure'''
|
||||||
|
try:
|
||||||
|
shutil.copytree(src, dst)
|
||||||
|
except Exception as e:
|
||||||
|
error('failed to copy dir %s to %s: %s' % (src, dst, e))
|
||||||
|
|
||||||
|
def must_rmtree(path):
|
||||||
|
'''Recurse rm dir, exit on failure'''
|
||||||
|
try:
|
||||||
|
shutil.rmtree(path)
|
||||||
|
except Exception as e:
|
||||||
|
error('failed rm dir %s : %s' % (path, e))
|
||||||
|
|
||||||
|
def must_rename(src, dst):
|
||||||
|
'''Rename src to dst, exit on failure'''
|
||||||
|
try:
|
||||||
|
os.rename(src,dst)
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
error('failed to rename %s to %s: %s' % (src, dst, e))
|
||||||
|
|
||||||
|
def must_mkdir(path):
|
||||||
|
'''Creating directories recursively, exit on failure'''
|
||||||
|
if os.path.exists(path):
|
||||||
|
return
|
||||||
|
try:
|
||||||
|
os.makedirs(path)
|
||||||
|
except OSError as e:
|
||||||
|
error('failed to create directory %s:%s' % (path, e))
|
||||||
|
|
||||||
|
def dump_env():
|
||||||
|
print('Dumping environment variables:')
|
||||||
|
for k, v in os.environ.items():
|
||||||
|
print('%s: %s' % (k, v)
|
||||||
|
)
|
||||||
|
|
||||||
|
def do_sign(certfile, fn, desc=None):
|
||||||
|
info('signing file {} using cert "{}"'.format(fn, certfile))
|
||||||
|
|
||||||
|
if desc:
|
||||||
|
desc_flags = '-d "{}"'.format(desc)
|
||||||
|
else:
|
||||||
|
desc_flags = ''
|
||||||
|
|
||||||
|
signcmd = 'signtool.exe sign -fd sha256 -t http://timestamp.comodoca.com -f {} {} {}'.format(certfile, desc_flags, fn)
|
||||||
|
i = 0
|
||||||
|
while i < RETRY_COUNT:
|
||||||
|
time.sleep(30)
|
||||||
|
ret = run(signcmd, cwd=os.path.dirname(fn))
|
||||||
|
if ret == 0:
|
||||||
|
break
|
||||||
|
i = i + 1
|
||||||
|
if i == RETRY_COUNT:
|
||||||
|
error('Failed to sign file "{}"'.format(fn))
|
||||||
|
|
||||||
|
def initworkspace():
|
||||||
|
# Clear build file cache
|
||||||
|
if os.path.exists(SLNOUTPUTDIR) :
|
||||||
|
must_rmtree(SLNOUTPUTDIR)
|
||||||
|
|
||||||
|
# Create a package directory
|
||||||
|
must_mkdir(SLNOUTPUTDIR)
|
||||||
|
|
||||||
|
def check_project_version(version):
|
||||||
|
'''A valid version must be like 1.2.2, 1.3'''
|
||||||
|
if not re.match(r'^[0-9]+(\.[0-9]+)+$', version):
|
||||||
|
error('%s is not a valid version' % version, usage="vs-build.py 2.0.0")
|
||||||
|
|
||||||
|
def check_cmd_para():
|
||||||
|
args = sys.argv
|
||||||
|
if len(args) != 2:
|
||||||
|
error('The number of parameters is incorrect', usage="vs-build.py 2.0.0")
|
||||||
|
global version
|
||||||
|
version = args[1]
|
||||||
|
check_project_version(version)
|
||||||
|
|
||||||
|
|
||||||
|
class Project(object):
|
||||||
|
'''Base class for a project'''
|
||||||
|
# Probject name, i.e. libseaprc/seafile/seafile-gui
|
||||||
|
name = ''
|
||||||
|
|
||||||
|
# A list of shell commands to configure/build the project
|
||||||
|
build_commands = []
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.prefix = BUILDDIR
|
||||||
|
self.projdir = os.path.join(self.prefix, self.name)
|
||||||
|
self.outdir = os.path.join(self.projdir, 'x64', 'Release')
|
||||||
|
|
||||||
|
def before_build(self):
|
||||||
|
'''Hook method to do project-specific stuff before running build commands'''
|
||||||
|
pass
|
||||||
|
|
||||||
|
def build(self):
|
||||||
|
'''Build the source'''
|
||||||
|
self.before_build()
|
||||||
|
info('Building %s' % self.name)
|
||||||
|
# dump_env()
|
||||||
|
for cmd in self.build_commands:
|
||||||
|
if run(cmd, cwd=self.projdir) != 0:
|
||||||
|
error('error when running command:\n\t%s\n' % cmd)
|
||||||
|
self.after_build()
|
||||||
|
|
||||||
|
def after_build(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class Libsearpc(Project):
|
||||||
|
name = 'libsearpc'
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
Project.__init__(self)
|
||||||
|
self.build_commands = [
|
||||||
|
'devenv "%s/libsearpc.sln" /Rebuild "Release|x64"' %(self.projdir),
|
||||||
|
]
|
||||||
|
|
||||||
|
def after_build(self):
|
||||||
|
libsearpc_path = os.path.join(self.outdir, 'libsearpc.dll')
|
||||||
|
must_copy(libsearpc_path, SLNOUTPUTDIR)
|
||||||
|
|
||||||
|
|
||||||
|
class Seafile(Project):
|
||||||
|
name = 'seafile'
|
||||||
|
def __init__(self):
|
||||||
|
Project.__init__(self)
|
||||||
|
self.build_commands = [
|
||||||
|
'devenv %s/seafile.sln /Rebuild "Release|x64"' %(self.projdir),
|
||||||
|
'devenv %s/msi/custom/seafile_custom.sln /Rebuild "Release|x64"' %(self.projdir),
|
||||||
|
]
|
||||||
|
|
||||||
|
def before_build(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def after_build(self):
|
||||||
|
|
||||||
|
# Copy seafile dll file to SLNOUTPUTDIR
|
||||||
|
dlls = glob.glob(os.path.join(self.outdir, '*.dll'))
|
||||||
|
for dll in dlls:
|
||||||
|
must_copy(dll, SLNOUTPUTDIR)
|
||||||
|
|
||||||
|
# Copy seafile.exe file to SLNOUTPUTDIR
|
||||||
|
must_copy(os.path.join(self.outdir, 'seaf-daemon.exe'), SLNOUTPUTDIR)
|
||||||
|
|
||||||
|
# Generate breakpad symbol
|
||||||
|
dump_syms_path = os.path.join(BUILDDIR, 'breakpad', 'src', 'tools', 'windows', 'Release', 'dump_syms.exe')
|
||||||
|
pdb_path = os.path.join(self.outdir, 'seaf-daemon.pdb')
|
||||||
|
sym_path = os.path.join(self.outdir, 'seaf-daemon.sym')
|
||||||
|
|
||||||
|
cmd = '%s %s > %s' %(dump_syms_path, pdb_path, sym_path)
|
||||||
|
if run(cmd, BUILDDIR) != 0:
|
||||||
|
error('error when running command:\n\t%s\n' % cmd)
|
||||||
|
|
||||||
|
|
||||||
|
class SeafileGUI(Project):
|
||||||
|
name = 'seafile-client'
|
||||||
|
target_name = 'seafile-applet.exe'
|
||||||
|
def __init__(self):
|
||||||
|
Project.__init__(self)
|
||||||
|
self.build_commands = [
|
||||||
|
'devenv %s/seafile-client.sln /Rebuild "Release|x64"' %(self.projdir) ,
|
||||||
|
]
|
||||||
|
|
||||||
|
def before_build(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def after_build(self):
|
||||||
|
# Copy WinSparkle.dll to SLNOUTPUTDIR
|
||||||
|
must_copy(os.path.join(self.projdir, 'third_party', 'WinSparkle-0.5.3', 'x64', 'Release', 'WinSparkle.dll'), SLNOUTPUTDIR)
|
||||||
|
|
||||||
|
# Copy dll to SLNOUTPUTDIR
|
||||||
|
dlls = glob.glob(os.path.join(self.outdir, '*.dll'))
|
||||||
|
for dll in dlls:
|
||||||
|
if not os.path.exists(dll) :
|
||||||
|
must_copy(dll, SLNOUTPUTDIR)
|
||||||
|
|
||||||
|
# Copy openssl lib to package dir
|
||||||
|
# openssl_lib_path_list = glob.glob(os.path.join(OPENSSL_DIR, '*.dll'))
|
||||||
|
# for lib in openssl_lib_path_list :
|
||||||
|
# must_copy(lib, SLNOUTPUTDIR)
|
||||||
|
|
||||||
|
# Copy seafile-applet.exe to SLNOUTPUTDIR
|
||||||
|
must_copy(os.path.join(self.outdir, self.target_name), SLNOUTPUTDIR)
|
||||||
|
|
||||||
|
# Use windeloyqt.exe to copy qt resource file and lib
|
||||||
|
windeployqt_path = os.path.join(QT_DIR, 'bin', 'windeployqt.exe')
|
||||||
|
seafile_exe_path = os.path.join(SLNOUTPUTDIR, self.target_name)
|
||||||
|
cmd = "%s --no-compiler-runtime %s" % (windeployqt_path, seafile_exe_path)
|
||||||
|
if run(cmd, cwd = SLNOUTPUTDIR) != 0:
|
||||||
|
error('error when running command:\n\t%s\n' % cmd)
|
||||||
|
|
||||||
|
# Sign seafile exe
|
||||||
|
need_sign_exe = [
|
||||||
|
os.path.join(SLNOUTPUTDIR, self.target_name),
|
||||||
|
os.path.join(SLNOUTPUTDIR, 'seaf-daemon.exe')
|
||||||
|
]
|
||||||
|
|
||||||
|
for fn in need_sign_exe:
|
||||||
|
do_sign(CERTFILE, fn)
|
||||||
|
|
||||||
|
# Generate breakpad symbol
|
||||||
|
dump_syms_path = os.path.join(BUILDDIR, 'breakpad', 'src', 'tools', 'windows', 'Release', 'dump_syms.exe')
|
||||||
|
pdb_path = os.path.join(self.outdir, 'seafile-applet.pdb')
|
||||||
|
sym_path = os.path.join(self.outdir, 'seafile-applet.sym')
|
||||||
|
|
||||||
|
cmd = '%s %s > %s' %(dump_syms_path, pdb_path, sym_path)
|
||||||
|
if run(cmd, BUILDDIR) != 0:
|
||||||
|
error('error when running command:\n\t%s\n' % cmd)
|
||||||
|
|
||||||
|
|
||||||
|
class SeafileShellExt(Project):
|
||||||
|
name = 'seafile-shell-ext'
|
||||||
|
def __init__(self):
|
||||||
|
Project.__init__(self)
|
||||||
|
self.build_commands = [
|
||||||
|
'devenv %s/extensions/seafile_ext.sln /Rebuild "Release|x64"' %(self.projdir),
|
||||||
|
'devenv %s/shellext-fix/shellext-fix.sln /Rebuild "Release|x64"' %(self.projdir),
|
||||||
|
]
|
||||||
|
def before_build(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def after_build(self):
|
||||||
|
# Copy shellext-fix.exe to SLNOUTPUTDIR
|
||||||
|
shellext_fix_target = os.path.join(self.projdir, 'shellext-fix', 'x64\\Release', 'shellext-fix.exe')
|
||||||
|
must_copy(shellext_fix_target, SLNOUTPUTDIR)
|
||||||
|
|
||||||
|
# Sign seafileext-fix.exe
|
||||||
|
do_sign(CERTFILE, os.path.join(SLNOUTPUTDIR, 'shellext-fix.exe'))
|
||||||
|
|
||||||
|
|
||||||
|
def wix_build(language):
|
||||||
|
""" Use wix command to build windows msi install package"""
|
||||||
|
|
||||||
|
CULTURE = 'zh-cn'
|
||||||
|
LANG_FILE = 'zh_CN.wxl'
|
||||||
|
TARGET = 'seafile.msi'
|
||||||
|
|
||||||
|
if language == 'en':
|
||||||
|
CULTURE = 'en-us'
|
||||||
|
LANG_FILE = 'en_US.wxl'
|
||||||
|
TARGET = 'seafile-en.msi'
|
||||||
|
|
||||||
|
CC = '%s/candle.exe' %(WIX_BIN)
|
||||||
|
LD = '%s/light.exe' %(WIX_BIN)
|
||||||
|
|
||||||
|
CFLAGS = '-arch "x64" -nologo -ext WixUIExtension -ext WixUtilExtension'
|
||||||
|
LDFLAGS = '-nologo -spdb -ext WixUIExtension -ext WixUtilExtension' + \
|
||||||
|
' -loc %s -cultures:%s -sice:ICE80' % (LANG_FILE, CULTURE)
|
||||||
|
|
||||||
|
|
||||||
|
generator_fragment_cmd = "%s/Paraffin.exe -dir bin -g -alias bin \
|
||||||
|
-custom bin fragment.wxs" %(WIX_BIN)
|
||||||
|
if run(generator_fragment_cmd, cwd=WIX_PACKAGE_DIR) != 0:
|
||||||
|
error('error wherunning command:\n\t%s\n' % generator_fragment_cmd)
|
||||||
|
|
||||||
|
edit_fragment_wxs()
|
||||||
|
|
||||||
|
build_command = [
|
||||||
|
'%s %s WixUI_InstallDir_NoLicense.wxs -o WixUI_InstallDir_NoLicense.wixobj' % (CC, CFLAGS),
|
||||||
|
'%s %s MyInstallDirDlg.wxs -o MyInstallDirDlg.wixobj' % (CC, CFLAGS),
|
||||||
|
'%s %s fragment.wxs -o fragment.wixobj' % (CC, CFLAGS),
|
||||||
|
'%s %s shell.wxs -o shell.wixobj' % (CC, CFLAGS),
|
||||||
|
'%s %s seafile.wxs -o seafile.wixobj' % (CC, CFLAGS),
|
||||||
|
'%s %s WixUI_InstallDir_NoLicense.wixobj MyInstallDirDlg.wixobj fragment.wixobj shell.wixobj seafile.wixobj -o %s' %(LD, LDFLAGS, TARGET),
|
||||||
|
]
|
||||||
|
for cmd in build_command:
|
||||||
|
if run(cmd, cwd=WIX_PACKAGE_DIR) != 0:
|
||||||
|
error('error when running command:\n\t%s\n' % cmd)
|
||||||
|
|
||||||
|
# Digitally sign the msi package
|
||||||
|
msi_path = os.path.join(WIX_PACKAGE_DIR, TARGET)
|
||||||
|
signinstaller(msi_path, language)
|
||||||
|
|
||||||
|
|
||||||
|
def prepare_msi():
|
||||||
|
if os.path.exists(WIX_PACKAGE_DIR) :
|
||||||
|
must_rmtree(WIX_PACKAGE_DIR)
|
||||||
|
|
||||||
|
|
||||||
|
msi_dir = os.path.join(Seafile().projdir, 'msi')
|
||||||
|
|
||||||
|
# These files are in seafile-shell-ext because they're shared between seafile/seafile
|
||||||
|
ext_wxi = os.path.join(SeafileShellExt().projdir, 'msi', 'ext.wxi')
|
||||||
|
must_copy(ext_wxi, msi_dir)
|
||||||
|
shell_wxs = os.path.join(SeafileShellExt().projdir, 'msi', 'shell.wxs')
|
||||||
|
must_copy(shell_wxs, msi_dir)
|
||||||
|
|
||||||
|
# Copy msi to wix package directory
|
||||||
|
if not os.path.exists(WIX_PACKAGE_DIR):
|
||||||
|
must_copytree(msi_dir, WIX_PACKAGE_DIR)
|
||||||
|
|
||||||
|
|
||||||
|
wix_pack_bin = os.path.join(WIX_PACKAGE_DIR, 'bin')
|
||||||
|
if os.path.exists(wix_pack_bin) :
|
||||||
|
os.rmdir(wix_pack_bin)
|
||||||
|
|
||||||
|
# Copy vc runtimer merge module
|
||||||
|
must_copy(os.path.join(OPENSSL_DIR, 'Microsoft_VC142_CRT_x64.msm'), SLNOUTPUTDIR)
|
||||||
|
|
||||||
|
must_copytree(SLNOUTPUTDIR, wix_pack_bin)
|
||||||
|
|
||||||
|
# Copy seafile_ext64.dll to WIX_PACKAGE_DIR/custom
|
||||||
|
seafile_extension_target_path = os.path.join(SeafileShellExt().projdir, 'extensions', 'x64\\Release', 'seafile_ext64.dll')
|
||||||
|
seafile_extension_dst_path = os.path.join(WIX_PACKAGE_DIR, 'custom')
|
||||||
|
must_copy(seafile_extension_target_path, seafile_extension_dst_path)
|
||||||
|
|
||||||
|
# Copy seafile_custom64.dll to WIX_PACKAGE_DIR/custom
|
||||||
|
seafile_custom_target_path = os.path.join(Seafile().projdir, 'msi\\custom\\x64\\Release', 'seafile_custom64.dll')
|
||||||
|
must_copy(seafile_custom_target_path, seafile_extension_dst_path)
|
||||||
|
|
||||||
|
|
||||||
|
def edit_fragment_wxs():
|
||||||
|
'''In the main wxs file(seafile.wxs) we need to reference to the id of
|
||||||
|
seafile-applet.exe, which is listed in fragment.wxs. Since fragments.wxs is
|
||||||
|
auto generated, the id is sequentially generated, so we need to change the
|
||||||
|
id of seafile-applet.exe manually.
|
||||||
|
|
||||||
|
'''
|
||||||
|
file_path = os.path.join(WIX_PACKAGE_DIR, 'fragment.wxs')
|
||||||
|
new_lines = []
|
||||||
|
with open(file_path, 'r', encoding='utf-8') as fp:
|
||||||
|
for line in fp:
|
||||||
|
if 'seafile-applet.exe' in line:
|
||||||
|
# change the id of 'seafile-applet.exe' to 'seafileapplet.exe'
|
||||||
|
new_line = re.sub(r'file_bin_[\d]+', 'seafileapplet.exe', line)
|
||||||
|
new_lines.append(new_line)
|
||||||
|
else:
|
||||||
|
new_lines.append(line)
|
||||||
|
|
||||||
|
content = '\r\n'.join(new_lines)
|
||||||
|
with open(file_path, 'w', encoding='utf-8') as fp:
|
||||||
|
fp.write(content)
|
||||||
|
|
||||||
|
def signinstaller(msi_file_path, language):
|
||||||
|
global version
|
||||||
|
msi_name = ''
|
||||||
|
if language != 'cn':
|
||||||
|
msi_name = 'seafile-{}-{}.msi' .format(version, language)
|
||||||
|
else:
|
||||||
|
msi_name = 'seafile-{}.msi' .format(version)
|
||||||
|
do_sign(CERTFILE, msi_file_path, msi_name)
|
||||||
|
must_rename(msi_file_path, os.path.join(WIX_PACKAGE_DIR, msi_name))
|
||||||
|
|
||||||
|
|
||||||
|
def build_and_sign_msi():
|
||||||
|
prepare_msi()
|
||||||
|
|
||||||
|
# Build seafile msi english and chinese version
|
||||||
|
wix_build('en')
|
||||||
|
wix_build('cn')
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
check_cmd_para()
|
||||||
|
|
||||||
|
# Construct seafile build folder
|
||||||
|
initworkspace()
|
||||||
|
|
||||||
|
libsearpc = Libsearpc()
|
||||||
|
seafile = Seafile()
|
||||||
|
seafile_gui = SeafileGUI()
|
||||||
|
seafile_shell_ext = SeafileShellExt()
|
||||||
|
|
||||||
|
# Build Seadrive project
|
||||||
|
libsearpc.build()
|
||||||
|
seafile.build()
|
||||||
|
seafile_gui.build()
|
||||||
|
seafile_shell_ext.build()
|
||||||
|
|
||||||
|
# Build seafile msi installer use wix
|
||||||
|
build_and_sign_msi()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
|
31
seafile.sln
Normal file
31
seafile.sln
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 16
|
||||||
|
VisualStudioVersion = 16.0.29613.14
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "seafile", "seafile.vcxproj", "{D3B4BCBB-BF84-43DF-9753-A7A0A4288D13}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{D3B4BCBB-BF84-43DF-9753-A7A0A4288D13}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{D3B4BCBB-BF84-43DF-9753-A7A0A4288D13}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{D3B4BCBB-BF84-43DF-9753-A7A0A4288D13}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{D3B4BCBB-BF84-43DF-9753-A7A0A4288D13}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{D3B4BCBB-BF84-43DF-9753-A7A0A4288D13}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{D3B4BCBB-BF84-43DF-9753-A7A0A4288D13}.Release|x64.Build.0 = Release|x64
|
||||||
|
{D3B4BCBB-BF84-43DF-9753-A7A0A4288D13}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{D3B4BCBB-BF84-43DF-9753-A7A0A4288D13}.Release|x86.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {ACC9413E-DE77-4CF1-9C31-14978D440597}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
276
seafile.vcxproj
Normal file
276
seafile.vcxproj
Normal file
@ -0,0 +1,276 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<VCProjectVersion>16.0</VCProjectVersion>
|
||||||
|
<ProjectGuid>{D3B4BCBB-BF84-43DF-9753-A7A0A4288D13}</ProjectGuid>
|
||||||
|
<RootNamespace>seafile</RootNamespace>
|
||||||
|
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||||
|
<CharacterSet>NotSet</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<CharacterSet>NotSet</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||||
|
<CharacterSet>NotSet</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="Shared">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<TargetName>seaf-daemon</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<TargetName>seaf-daemon</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<TargetName>seaf-daemon</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<LinkIncremental>
|
||||||
|
</LinkIncremental>
|
||||||
|
<TargetName>seaf-daemon</TargetName>
|
||||||
|
<OutDir>$(ProjectDir)$(Platform)\$(Configuration)\</OutDir>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>
|
||||||
|
</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>WIN32;UNICODE;WIN32_LEAN_AND_MEAN;SEAFILE_CLIENT;PACKAGE_VERSION="7.0.9";%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>false</ConformanceMode>
|
||||||
|
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
<AdditionalIncludeDirectories>$(ProjectDir)..\libsearpc\lib;$(ProjectDir)common;$(ProjectDir)lib;$(ProjectDir)include;$(ProjectDir)daemon;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalLibraryDirectories>$(ProjectDir)..\libsearpc\$(IntDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>ws2_32.lib;Rpcrt4.lib;Psapi.lib;Crypt32.lib;libsearpc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level1</WarningLevel>
|
||||||
|
<SDLCheck>
|
||||||
|
</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>WIN32;UNICODE;WIN32_LEAN_AND_MEAN;SEAFILE_CLIENT;PACKAGE_VERSION="7.0.9";%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>false</ConformanceMode>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
<AdditionalIncludeDirectories>$(ProjectDir)..\libsearpc\lib;$(ProjectDir)common;$(ProjectDir)include;$(ProjectDir)daemon;$(ProjectDir)lib;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
|
||||||
|
<AdditionalLibraryDirectories>$(ProjectDir)..\libsearpc\$(IntDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>ws2_32.lib;Rpcrt4.lib;Psapi.lib;Crypt32.lib;libsearpc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<FunctionLevelLinking>
|
||||||
|
</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>false</IntrinsicFunctions>
|
||||||
|
<SDLCheck>
|
||||||
|
</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>WIN32;PACKAGE_VERSION="7.0.9";WIN32_LEAN_AND_MEAN;UNICODE;SEAFILE_CLIENT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>false</ConformanceMode>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
<AdditionalIncludeDirectories>$(ProjectDir)..\libsearpc\lib;$(ProjectDir);$(ProjectDir)daemon;$(ProjectDir)include;$(ProjectDir)lib;$(ProjectDir)common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<SupportJustMyCode>true</SupportJustMyCode>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>ws2_32.lib;Psapi.lib;Rpcrt4.lib;Crypt32.lib;libsearpc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<AdditionalLibraryDirectories>$(ProjectDir)..\libsearpc\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level1</WarningLevel>
|
||||||
|
<FunctionLevelLinking>
|
||||||
|
</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>false</IntrinsicFunctions>
|
||||||
|
<SDLCheck>
|
||||||
|
</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>WIN32;PACKAGE_VERSION="7.0.9";WIN32_LEAN_AND_MEAN;UNICODE;SEAFILE_CLIENT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>false</ConformanceMode>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
<AdditionalIncludeDirectories>$(ProjectDir)..\libsearpc\lib;$(ProjectDir);$(ProjectDir)common;$(ProjectDir)lib;$(ProjectDir)include;$(ProjectDir)daemon;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<EnableCOMDATFolding>
|
||||||
|
</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>
|
||||||
|
</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalLibraryDirectories>$(ProjectDir)..\libsearpc\$(IntDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>ws2_32.lib;Psapi.lib;Rpcrt4.lib;Crypt32.lib;libsearpc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<PerUserRedirection>false</PerUserRedirection>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="common\block-backend-fs.c" />
|
||||||
|
<ClCompile Include="common\block-backend.c" />
|
||||||
|
<ClCompile Include="common\block-mgr.c" />
|
||||||
|
<ClCompile Include="common\branch-mgr.c" />
|
||||||
|
<ClCompile Include="common\cdc\cdc.c" />
|
||||||
|
<ClCompile Include="common\cdc\rabin-checksum.c" />
|
||||||
|
<ClCompile Include="common\commit-mgr.c" />
|
||||||
|
<ClCompile Include="common\curl-init.c" />
|
||||||
|
<ClCompile Include="common\diff-simple.c" />
|
||||||
|
<ClCompile Include="common\fs-mgr.c" />
|
||||||
|
<ClCompile Include="common\index\cache-tree.c" />
|
||||||
|
<ClCompile Include="common\index\index.c" />
|
||||||
|
<ClCompile Include="common\log.c" />
|
||||||
|
<ClCompile Include="common\mq-mgr.c" />
|
||||||
|
<ClCompile Include="common\obj-backend-fs.c" />
|
||||||
|
<ClCompile Include="common\obj-store.c" />
|
||||||
|
<ClCompile Include="common\rpc-service.c" />
|
||||||
|
<ClCompile Include="common\seafile-crypt.c" />
|
||||||
|
<ClCompile Include="common\vc-common.c" />
|
||||||
|
<ClCompile Include="daemon\cevent.c" />
|
||||||
|
<ClCompile Include="daemon\change-set.c" />
|
||||||
|
<ClCompile Include="daemon\clone-mgr.c" />
|
||||||
|
<ClCompile Include="daemon\filelock-mgr.c" />
|
||||||
|
<ClCompile Include="daemon\http-tx-mgr.c" />
|
||||||
|
<ClCompile Include="daemon\job-mgr.c" />
|
||||||
|
<ClCompile Include="daemon\repo-mgr.c" />
|
||||||
|
<ClCompile Include="daemon\seaf-daemon.c" />
|
||||||
|
<ClCompile Include="daemon\seafile-config.c" />
|
||||||
|
<ClCompile Include="daemon\seafile-error.c" />
|
||||||
|
<ClCompile Include="daemon\seafile-session.c" />
|
||||||
|
<ClCompile Include="daemon\set-perm.c" />
|
||||||
|
<ClCompile Include="daemon\sync-mgr.c" />
|
||||||
|
<ClCompile Include="daemon\sync-status-tree.c" />
|
||||||
|
<ClCompile Include="daemon\timer.c" />
|
||||||
|
<ClCompile Include="daemon\vc-utils.c" />
|
||||||
|
<ClCompile Include="daemon\wt-monitor-structs.c" />
|
||||||
|
<ClCompile Include="daemon\wt-monitor-win32.c" />
|
||||||
|
<ClCompile Include="daemon\wt-monitor.c" />
|
||||||
|
<ClCompile Include="lib\db.c" />
|
||||||
|
<ClCompile Include="lib\net.c" />
|
||||||
|
<ClCompile Include="lib\repo.c" />
|
||||||
|
<ClCompile Include="lib\task.c" />
|
||||||
|
<ClCompile Include="lib\utils.c" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="common\block-backend.h" />
|
||||||
|
<ClInclude Include="common\block-mgr.h" />
|
||||||
|
<ClInclude Include="common\block.h" />
|
||||||
|
<ClInclude Include="common\branch-mgr.h" />
|
||||||
|
<ClInclude Include="common\cdc\cdc.h" />
|
||||||
|
<ClInclude Include="common\cdc\rabin-checksum.h" />
|
||||||
|
<ClInclude Include="common\commit-mgr.h" />
|
||||||
|
<ClInclude Include="common\common.h" />
|
||||||
|
<ClInclude Include="common\curl-init.h" />
|
||||||
|
<ClInclude Include="common\diff-simple.h" />
|
||||||
|
<ClInclude Include="common\fs-mgr.h" />
|
||||||
|
<ClInclude Include="common\index\cache-tree.h" />
|
||||||
|
<ClInclude Include="common\index\index.h" />
|
||||||
|
<ClInclude Include="common\log.h" />
|
||||||
|
<ClInclude Include="common\mq-mgr.h" />
|
||||||
|
<ClInclude Include="common\obj-backend.h" />
|
||||||
|
<ClInclude Include="common\obj-store.h" />
|
||||||
|
<ClInclude Include="common\seafile-crypt.h" />
|
||||||
|
<ClInclude Include="common\vc-common.h" />
|
||||||
|
<ClInclude Include="daemon\cevent.h" />
|
||||||
|
<ClInclude Include="daemon\change-set.h" />
|
||||||
|
<ClInclude Include="daemon\clone-mgr.h" />
|
||||||
|
<ClInclude Include="daemon\filelock-mgr.h" />
|
||||||
|
<ClInclude Include="daemon\http-tx-mgr.h" />
|
||||||
|
<ClInclude Include="daemon\job-mgr.h" />
|
||||||
|
<ClInclude Include="daemon\repo-mgr.h" />
|
||||||
|
<ClInclude Include="daemon\seafile-config.h" />
|
||||||
|
<ClInclude Include="daemon\seafile-error-impl.h" />
|
||||||
|
<ClInclude Include="daemon\seafile-session.h" />
|
||||||
|
<ClInclude Include="daemon\set-perm.h" />
|
||||||
|
<ClInclude Include="daemon\sync-mgr.h" />
|
||||||
|
<ClInclude Include="daemon\sync-status-tree.h" />
|
||||||
|
<ClInclude Include="daemon\timer.h" />
|
||||||
|
<ClInclude Include="daemon\vc-utils.h" />
|
||||||
|
<ClInclude Include="daemon\wt-monitor-structs.h" />
|
||||||
|
<ClInclude Include="daemon\wt-monitor.h" />
|
||||||
|
<ClInclude Include="include\seafile-error.h" />
|
||||||
|
<ClInclude Include="include\seafile-rpc.h" />
|
||||||
|
<ClInclude Include="include\seafile.h" />
|
||||||
|
<ClInclude Include="lib\db.h" />
|
||||||
|
<ClInclude Include="lib\include.h" />
|
||||||
|
<ClInclude Include="lib\net.h" />
|
||||||
|
<ClInclude Include="lib\seafile-object.h" />
|
||||||
|
<ClInclude Include="lib\searpc-marshal.h" />
|
||||||
|
<ClInclude Include="lib\searpc-signature.h" />
|
||||||
|
<ClInclude Include="lib\utils.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
Loading…
Reference in New Issue
Block a user