-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathISSUtils.h
73 lines (40 loc) · 2.09 KB
/
ISSUtils.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// vim: filetype=objc
#import <Foundation/Foundation.h>
#define ISSUArrayLength(array) (sizeof (array) / sizeof (*(array)))
@class ISSUMachPort;
typedef struct {
int signum;
dispatch_function_t handler;
} ISSUSignalHandlerTableEntry;
typedef void (*ISSUMachPortMessageCallBack) (ISSUMachPort *port, mach_msg_header_t *msg, void *info);
typedef void (*ISSUMachPortInvalidationCallBack) (ISSUMachPort *port, void *info);
@interface ISSUMachPort : NSObject
@property (readonly) mach_port_t machPort;
+ (instancetype) portForName: (NSString *) name;
- (instancetype) initWithMachPort: (mach_port_t) machPort;
- (BOOL) registerName: (NSString *) name;
- (void) setMessageCallBack: (ISSUMachPortMessageCallBack) callback andInfo: (void *) info;
- (void) setInvalidationCallBack: (ISSUMachPortInvalidationCallBack) callback andInfo: (void *) info;
- (BOOL) scheduleInRunLoop: (CFRunLoopRef) runLoop forMode: (CFStringRef) mode;
- (void) unschedule;
@end
@interface ISSUMachPortHolder : NSObject
+ (instancetype) holderWithPort: (ISSUMachPort *) port;
- (instancetype) init NS_UNAVAILABLE;
- (instancetype) initWithPort: (ISSUMachPort *) port;
- (ISSUMachPort *) get;
- (void) set: (ISSUMachPort *) port;
@end
NSArray *ISSUSetupSignalHandlers (ISSUSignalHandlerTableEntry signalHandlerTable[], int entryCount);
NSURL *ISSUGetAbsoluteFileURL (char *filePath);
NSString *ISSUGetPerProcessName (char *name, pid_t pid);
mach_port_t ISSUGetBootstrapPort (void);
mach_port_t ISSUCreateBootstrapSubset (mach_port_t requestorPort);
BOOL ISSUResetBootstrapPort (mach_port_t bootstrapPort);
BOOL ISSUGetAuditToken (mach_msg_header_t *msg, audit_token_t **auditToken);
mach_msg_descriptor_t *ISSUNextDescriptor (mach_msg_descriptor_t *current);
BOOL ISSUPortRightsSend (ISSUMachPort *port, mach_port_t rightsArray[], int rightsCount);
int ISSUPortRightsReceive (mach_msg_header_t *msg, mach_port_t rightsArray[], int maxRightsCount);
BOOL ISSUCommandSend (ISSUMachPort *port, int command);
BOOL ISSUCommandReceive (mach_msg_header_t *msg, int *command);
int autoreleasedMain (int argc, char * const argv[]);