2012-07-27 19:47:42 +08:00
|
|
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
|
|
|
|
#ifndef SEAFILE_SESSION_H
|
|
|
|
#define SEAFILE_SESSION_H
|
|
|
|
|
|
|
|
#include <glib-object.h>
|
2018-06-26 12:11:35 +08:00
|
|
|
#include "cevent.h"
|
|
|
|
#include "job-mgr.h"
|
2012-07-27 19:47:42 +08:00
|
|
|
|
|
|
|
#include "block-mgr.h"
|
|
|
|
#include "fs-mgr.h"
|
|
|
|
#include "commit-mgr.h"
|
|
|
|
#include "branch-mgr.h"
|
|
|
|
#include "repo-mgr.h"
|
|
|
|
#include "clone-mgr.h"
|
|
|
|
#include "db.h"
|
|
|
|
|
|
|
|
#include "sync-mgr.h"
|
|
|
|
#include "wt-monitor.h"
|
|
|
|
#include "mq-mgr.h"
|
2022-12-24 16:51:55 +08:00
|
|
|
#include "notif-mgr.h"
|
2014-08-22 17:56:25 +08:00
|
|
|
|
|
|
|
#include "http-tx-mgr.h"
|
2015-07-02 20:21:09 +08:00
|
|
|
#include "filelock-mgr.h"
|
2014-08-22 17:56:25 +08:00
|
|
|
|
2012-07-27 19:47:42 +08:00
|
|
|
|
|
|
|
#define SEAFILE_TYPE_SESSION (seafile_session_get_type ())
|
|
|
|
#define SEAFILE_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAFILE_TYPE_SESSION, SeafileSession))
|
|
|
|
#define SEAFILE_IS_SESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAFILE_TYPE_SESSION))
|
|
|
|
#define SEAFILE_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEAFILE_TYPE_SESSION, SeafileSessionClass))
|
|
|
|
#define SEAFILE_IS_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAFILE_TYPE_SESSION))
|
|
|
|
#define SEAFILE_SESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAFILE_TYPE_SESSION, SeafileSessionClass))
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SeafileSession SeafileSession;
|
|
|
|
typedef struct _SeafileSessionClass SeafileSessionClass;
|
|
|
|
|
2018-06-26 12:11:35 +08:00
|
|
|
struct event_base;
|
|
|
|
|
2012-07-27 19:47:42 +08:00
|
|
|
struct _SeafileSession {
|
|
|
|
GObject parent_instance;
|
|
|
|
|
2018-06-26 12:11:35 +08:00
|
|
|
struct event_base *ev_base;
|
2012-07-27 19:47:42 +08:00
|
|
|
|
2018-06-26 12:11:35 +08:00
|
|
|
char *client_id;
|
2016-09-21 18:18:00 +08:00
|
|
|
char *client_name;
|
|
|
|
|
2012-07-27 19:47:42 +08:00
|
|
|
char *seaf_dir;
|
|
|
|
char *tmp_file_dir;
|
|
|
|
char *worktree_dir; /* the default directory for
|
|
|
|
* storing worktrees */
|
2018-06-26 12:11:35 +08:00
|
|
|
char *ccnet_dir;
|
2012-07-27 19:47:42 +08:00
|
|
|
sqlite3 *config_db;
|
2015-12-29 17:03:53 +08:00
|
|
|
char *deleted_store;
|
2018-06-26 12:11:35 +08:00
|
|
|
char *rpc_socket_path;
|
2012-07-27 19:47:42 +08:00
|
|
|
|
2019-09-20 15:02:22 +08:00
|
|
|
uint32_t cdc_average_block_size;
|
2012-07-27 19:47:42 +08:00
|
|
|
SeafBlockManager *block_mgr;
|
|
|
|
SeafFSManager *fs_mgr;
|
|
|
|
SeafCommitManager *commit_mgr;
|
|
|
|
SeafBranchManager *branch_mgr;
|
|
|
|
SeafRepoManager *repo_mgr;
|
|
|
|
SeafCloneManager *clone_mgr;
|
|
|
|
SeafSyncManager *sync_mgr;
|
|
|
|
SeafWTMonitor *wt_monitor;
|
|
|
|
SeafMqManager *mq_mgr;
|
|
|
|
|
|
|
|
CEventManager *ev_mgr;
|
2018-06-26 12:11:35 +08:00
|
|
|
SeafJobManager *job_mgr;
|
2013-04-09 13:13:22 +08:00
|
|
|
|
2014-08-22 17:56:25 +08:00
|
|
|
HttpTxManager *http_tx_mgr;
|
|
|
|
|
2015-07-02 20:21:09 +08:00
|
|
|
SeafFilelockManager *filelock_mgr;
|
|
|
|
|
2022-12-24 16:51:55 +08:00
|
|
|
SeafNotifManager *notif_mgr;
|
|
|
|
|
2013-04-09 13:13:22 +08:00
|
|
|
/* Set after all components are up and running. */
|
|
|
|
gboolean started;
|
2014-09-17 16:05:16 +08:00
|
|
|
|
|
|
|
gboolean sync_extra_temp_file;
|
2014-11-04 17:44:32 +08:00
|
|
|
gboolean enable_http_sync;
|
|
|
|
gboolean disable_verify_certificate;
|
2015-02-13 15:17:58 +08:00
|
|
|
|
2019-10-26 15:58:07 +08:00
|
|
|
gboolean disable_block_hash;
|
2021-07-02 17:31:55 +08:00
|
|
|
|
|
|
|
gboolean hide_windows_incompatible_path_notification;
|
2019-10-26 15:58:07 +08:00
|
|
|
|
2024-12-21 11:56:27 +08:00
|
|
|
gboolean ignore_symlinks;
|
|
|
|
|
2015-02-13 15:17:58 +08:00
|
|
|
gboolean use_http_proxy;
|
|
|
|
char *http_proxy_type;
|
|
|
|
char *http_proxy_addr;
|
|
|
|
int http_proxy_port;
|
2015-02-14 11:43:48 +08:00
|
|
|
char *http_proxy_username;
|
|
|
|
char *http_proxy_password;
|
2022-10-21 14:10:31 +08:00
|
|
|
int delete_confirm_threshold;
|
2012-07-27 19:47:42 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _SeafileSessionClass
|
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
extern SeafileSession *seaf;
|
|
|
|
|
|
|
|
SeafileSession *
|
|
|
|
seafile_session_new(const char *seafile_dir,
|
|
|
|
const char *worktree_dir,
|
2018-06-26 12:11:35 +08:00
|
|
|
const char *config_dir);
|
2012-07-27 19:47:42 +08:00
|
|
|
void
|
|
|
|
seafile_session_prepare (SeafileSession *session);
|
|
|
|
|
|
|
|
void
|
|
|
|
seafile_session_start (SeafileSession *session);
|
|
|
|
|
|
|
|
char *
|
|
|
|
seafile_session_get_tmp_file_path (SeafileSession *session,
|
|
|
|
const char *basename,
|
|
|
|
char path[]);
|
|
|
|
#if 0
|
|
|
|
void
|
|
|
|
seafile_session_add_event (SeafileSession *session,
|
|
|
|
const char *type,
|
|
|
|
const char *first, ...);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* SEAFILE_H */
|