forked from overtake/telegram
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FFYDaemonController.h
executable file
·59 lines (48 loc) · 1.72 KB
/
FFYDaemonController.h
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
50
51
52
53
54
55
56
57
58
59
//
// FFYDaemonController.h
// mongodb.prefpane
//
// Based in DaemonController by Max Howell. Released under GNU GPL v3.
// Created by Ivan Valdes on 4/14/2010.
//
#import <Cocoa/Cocoa.h>
typedef void (^DaemonStarted)(NSNumber *);
typedef void (^DaemonStopped)();
typedef void (^DaemonIsStarting)();
typedef void (^DaemonIsStopping)();
typedef void (^DaemonFailedToStart)(NSString *);
typedef void (^DaemonFailedToStop)(NSString *);
@interface FFYDaemonController : NSObject {
NSArray *startArguments;
NSArray *stopArguments;
NSString *launchPath;
DaemonStarted daemonStartedCallback;
DaemonStopped daemonStoppedCallback;
DaemonIsStarting daemonIsStartingCallback;
DaemonIsStopping daemonIsStoppingCallback;
DaemonFailedToStart daemonFailedToStartCallback;
DaemonFailedToStop daemonFailedToStopCallback;
@private
NSString *binaryName;
NSTask *daemonTask;
NSTimer *pollTimer;
NSTimer *checkStartupStatusTimer;
pid_t pid;
CFFileDescriptorRef fdref;
}
@property (nonatomic, retain) NSArray *startArguments;
@property (nonatomic, retain) NSArray *stopArguments;
@property (nonatomic, retain) NSString *launchPath;
@property (readonly, getter = pid) NSNumber *pid;
@property (readonly, getter = running) BOOL isRunning;
@property (readwrite, copy) DaemonStarted daemonStartedCallback;
@property (readwrite, copy) DaemonStopped daemonStoppedCallback;
@property (readwrite, copy) DaemonIsStarting daemonIsStartingCallback;
@property (readwrite, copy) DaemonIsStopping daemonIsStoppingCallback;
@property (readwrite, copy) DaemonFailedToStart daemonFailedToStartCallback;
@property (readwrite, copy) DaemonFailedToStop daemonFailedToStopCallback;
- (void)start;
- (void)stop;
- (BOOL)running;
- (NSNumber *)pid;
@end