mirror of
https://github.com/Karmaz95/Snake_Apple.git
synced 2026-06-02 17:41:35 +02:00
16 lines
551 B
Objective-C
16 lines
551 B
Objective-C
#import <Foundation/Foundation.h>
|
|
|
|
int main(int argc, char *argv[]) {
|
|
@autoreleasepool {
|
|
if (argc != 2) return 1;
|
|
|
|
CFMessagePortRef port = CFMessagePortCreateRemote(NULL, CFSTR("com.crimson.message_service"));
|
|
if (port) {
|
|
NSString *msg = [NSString stringWithUTF8String:argv[1]];
|
|
NSData *data = [msg dataUsingEncoding:NSUTF8StringEncoding];
|
|
CFMessagePortSendRequest(port, 0, (__bridge CFDataRef)data, 1, 1, NULL, NULL);
|
|
CFRelease(port);
|
|
}
|
|
}
|
|
return 0;
|
|
} |