mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-02 07:57:29 +00:00
b77c1628f3
Signed-off-by: pierre <pierre.curto@gmail.com>
27 lines
610 B
Objective-C
27 lines
610 B
Objective-C
// SPDX-License-Identifier: Unlicense OR MIT
|
|
|
|
@import Dispatch;
|
|
@import Foundation;
|
|
|
|
#include "_cgo_export.h"
|
|
|
|
void gio_wakeupMainThread(void) {
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
gio_dispatchMainFuncs();
|
|
});
|
|
}
|
|
|
|
bool gio_isMainThread() {
|
|
return [NSThread isMainThread];
|
|
}
|
|
|
|
NSUInteger gio_nsstringLength(CFTypeRef cstr) {
|
|
NSString *str = (__bridge NSString *)cstr;
|
|
return [str length];
|
|
}
|
|
|
|
void gio_nsstringGetCharacters(CFTypeRef cstr, unichar *chars, NSUInteger loc, NSUInteger length) {
|
|
NSString *str = (__bridge NSString *)cstr;
|
|
[str getCharacters:chars range:NSMakeRange(loc, length)];
|
|
}
|