2 Copyright (C) 2010 Proxmox Server Solutions GmbH
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU Affero General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Affero General Public License for more details.
14 You should have received a copy of the GNU Affero General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 Author: Dietmar Maurer <dietmar@proxmox.com>
24 #define FUSE_USE_VERSION 26
28 #include <qb/qbdefs.h>
29 #include <qb/qbutil.h>
30 #include <qb/qbloop.h>
32 typedef struct cfs_loop cfs_loop_t
;
34 typedef struct cfs_service cfs_service_t
;
36 typedef int (*cfs_service_initialize_fn_t
)(
37 cfs_service_t
*service
,
40 typedef gboolean (*cfs_service_finalize_fn_t
)(
41 cfs_service_t
*service
,
44 typedef gboolean (*cfs_service_dispatch_fn_t
)(
45 cfs_service_t
*service
,
48 typedef void (*cfs_service_timer_fn_t
)(
49 cfs_service_t
*service
,
53 cfs_service_initialize_fn_t cfs_service_initialize_fn
;
54 cfs_service_finalize_fn_t cfs_service_finalize_fn
;
55 cfs_service_dispatch_fn_t cfs_service_dispatch_fn
;
56 cfs_service_timer_fn_t cfs_service_timer_fn
;
57 } cfs_service_callbacks_t
;
59 cfs_service_t
*cfs_service_new(
60 cfs_service_callbacks_t
*callbacks
,
61 const char *log_domain
,
64 gpointer
cfs_service_get_context(
65 cfs_service_t
*service
);
67 gboolean
cfs_service_set_timer(
68 cfs_service_t
*service
,
71 void cfs_service_set_restartable(
72 cfs_service_t
*service
,
73 gboolean restartable
);
75 cfs_loop_t
*cfs_loop_new(struct fuse
*fuse
);
77 void cfs_loop_destroy(
80 gboolean
cfs_loop_add_service(
82 cfs_service_t
*service
,
83 enum qb_loop_priority priority
);
85 gboolean
cfs_loop_start_worker(
88 void cfs_loop_stop_worker(
92 #endif /* _PVE_LOOP_H_ */