seafile/daemon/seafile-session.h

129 lines
3.7 KiB
C
Raw Normal View History

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"
#include "notif-mgr.h"
#include "http-tx-mgr.h"
#include "filelock-mgr.h"
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;
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;
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;
HttpTxManager *http_tx_mgr;
SeafFilelockManager *filelock_mgr;
SeafNotifManager *notif_mgr;
/* Set after all components are up and running. */
gboolean started;
gboolean sync_extra_temp_file;
gboolean enable_http_sync;
gboolean disable_verify_certificate;
2019-10-26 15:58:07 +08:00
gboolean disable_block_hash;
gboolean hide_windows_incompatible_path_notification;
2019-10-26 15:58:07 +08:00
gboolean ignore_symlinks;
gboolean use_http_proxy;
char *http_proxy_type;
char *http_proxy_addr;
int http_proxy_port;
char *http_proxy_username;
char *http_proxy_password;
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 */