File: watchdir-common.h

package info (click to toggle)
transmission 3.00-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 33,160 kB
  • sloc: ansic: 81,055; objc: 18,449; cpp: 16,303; sh: 4,470; javascript: 4,281; makefile: 1,081; xml: 139
file content (49 lines) | stat: -rw-r--r-- 1,166 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * This file Copyright (C) 2015-2016 Mnemosyne LLC
 *
 * It may be used under the GNU GPL versions 2 or 3
 * or any future license endorsed by Mnemosyne LLC.
 *
 */

#pragma once

#ifndef __LIBTRANSMISSION_WATCHDIR_MODULE__
#error only the libtransmission watchdir module should #include this header.
#endif

struct tr_ptrArray;

typedef struct tr_watchdir_backend
{
    void (* free_func)(struct tr_watchdir_backend*);
}
tr_watchdir_backend;

#define BACKEND_DOWNCAST(b) ((tr_watchdir_backend*)(b))

/* ... */

tr_watchdir_backend* tr_watchdir_get_backend(tr_watchdir_t handle);

struct event_base* tr_watchdir_get_event_base(tr_watchdir_t handle);

/* ... */

void tr_watchdir_process(tr_watchdir_t handle, char const* name);

void tr_watchdir_scan(tr_watchdir_t handle, struct tr_ptrArray* dir_entries);

/* ... */

tr_watchdir_backend* tr_watchdir_generic_new(tr_watchdir_t handle);

#ifdef WITH_INOTIFY
tr_watchdir_backend* tr_watchdir_inotify_new(tr_watchdir_t handle);
#endif
#ifdef WITH_KQUEUE
tr_watchdir_backend* tr_watchdir_kqueue_new(tr_watchdir_t handle);
#endif
#ifdef _WIN32
tr_watchdir_backend* tr_watchdir_win32_new(tr_watchdir_t handle);
#endif