Skip to content

Commit 4aef502

Browse files
committed
Add FSEventStreamSetDispatchQueue
1 parent b3f6d1a commit 4aef502

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

fsevent-sys/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ repository = "https://github.com/octplane/fsevent-rust/tree/master/fsevent-sys"
88
edition = "2018"
99

1010
[dependencies]
11+
dispatch2 = { version = "0.2.0", default-features = false, features = ["alloc"] }
1112
libc = "0.2.68"
1213

1314
[package.metadata.docs.rs]

fsevent-sys/src/fsevent.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use crate::core_foundation::{
55
CFAllocatorReleaseCallBack, CFAllocatorRetainCallBack, CFArrayRef, CFIndex, CFRunLoopRef,
66
CFStringRef, CFTimeInterval,
77
};
8+
use dispatch2::ffi::dispatch_queue_t;
89
use libc::dev_t;
910
use std::os::raw::{c_uint, c_void};
1011

@@ -74,7 +75,7 @@ pub struct FSEventStreamContext {
7475

7576
// https://developer.apple.com/documentation/coreservices/file_system_events
7677
#[link(name = "CoreServices", kind = "framework")]
77-
extern "C" {
78+
unsafe extern "C" {
7879
pub fn FSEventStreamCopyDescription(stream_ref: ConstFSEventStreamRef) -> CFStringRef;
7980
pub fn FSEventStreamCopyPathsBeingWatched(streamRef: ConstFSEventStreamRef) -> CFArrayRef;
8081
pub fn FSEventStreamCreate(
@@ -109,7 +110,7 @@ extern "C" {
109110
run_loop: CFRunLoopRef,
110111
run_loop_mode: CFStringRef,
111112
);
112-
// pub fn FSEventStreamSetDispatchQueue(streamRef: FSEventStreamRef, q: DispatchQueue);
113+
pub fn FSEventStreamSetDispatchQueue(stream_ref: FSEventStreamRef, q: dispatch_queue_t);
113114
pub fn FSEventStreamSetExclusionPaths(
114115
stream_ref: FSEventStreamRef,
115116
paths_to_exclude: CFArrayRef,

0 commit comments

Comments
 (0)