use core::cell::UnsafeCell;
use core::ffi::*;
use core::marker::{PhantomData, PhantomPinned};
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
use objc2_core_foundation::*;
use crate::*;
#[doc(alias = "SKIndexRef")]
#[repr(C)]
pub struct SKIndex {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
cf_type!(
unsafe impl SKIndex {}
);
#[cfg(feature = "objc2")]
cf_objc2_type!(
unsafe impl RefEncode<"__SKIndex"> for SKIndex {}
);
unsafe impl ConcreteType for SKIndex {
#[doc(alias = "SKIndexGetTypeID")]
#[inline]
fn type_id() -> CFTypeID {
extern "C-unwind" {
fn SKIndexGetTypeID() -> CFTypeID;
}
unsafe { SKIndexGetTypeID() }
}
}
#[doc(alias = "SKIndexDocumentIteratorRef")]
#[repr(C)]
pub struct SKIndexDocumentIterator {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
cf_type!(
unsafe impl SKIndexDocumentIterator {}
);
#[cfg(feature = "objc2")]
cf_objc2_type!(
unsafe impl RefEncode<"__SKIndexDocumentIterator"> for SKIndexDocumentIterator {}
);
unsafe impl ConcreteType for SKIndexDocumentIterator {
#[doc(alias = "SKIndexDocumentIteratorGetTypeID")]
#[inline]
fn type_id() -> CFTypeID {
extern "C-unwind" {
fn SKIndexDocumentIteratorGetTypeID() -> CFTypeID;
}
unsafe { SKIndexDocumentIteratorGetTypeID() }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct SKIndexType(pub c_uint);
impl SKIndexType {
#[doc(alias = "kSKIndexUnknown")]
pub const Unknown: Self = Self(0);
#[doc(alias = "kSKIndexInverted")]
pub const Inverted: Self = Self(1);
#[doc(alias = "kSKIndexVector")]
pub const Vector: Self = Self(2);
#[doc(alias = "kSKIndexInvertedVector")]
pub const InvertedVector: Self = Self(3);
}
#[cfg(feature = "objc2")]
unsafe impl Encode for SKIndexType {
const ENCODING: Encoding = c_uint::ENCODING;
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for SKIndexType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct SKDocumentIndexState(pub c_uint);
impl SKDocumentIndexState {
#[doc(alias = "kSKDocumentStateNotIndexed")]
pub const StateNotIndexed: Self = Self(0);
#[doc(alias = "kSKDocumentStateIndexed")]
pub const StateIndexed: Self = Self(1);
#[doc(alias = "kSKDocumentStateAddPending")]
pub const StateAddPending: Self = Self(2);
#[doc(alias = "kSKDocumentStateDeletePending")]
pub const StateDeletePending: Self = Self(3);
}
#[cfg(feature = "objc2")]
unsafe impl Encode for SKDocumentIndexState {
const ENCODING: Encoding = c_uint::ENCODING;
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for SKDocumentIndexState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
impl SKIndex {
#[doc(alias = "SKIndexCreateWithURL")]
#[inline]
pub unsafe fn with_url(
in_url: Option<&CFURL>,
in_index_name: Option<&CFString>,
in_index_type: SKIndexType,
in_analysis_properties: Option<&CFDictionary>,
) -> Option<CFRetained<SKIndex>> {
extern "C-unwind" {
fn SKIndexCreateWithURL(
in_url: Option<&CFURL>,
in_index_name: Option<&CFString>,
in_index_type: SKIndexType,
in_analysis_properties: Option<&CFDictionary>,
) -> Option<NonNull<SKIndex>>;
}
let ret = unsafe {
SKIndexCreateWithURL(in_url, in_index_name, in_index_type, in_analysis_properties)
};
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "SKIndexOpenWithURL")]
#[inline]
pub unsafe fn open_with_url(
in_url: Option<&CFURL>,
in_index_name: Option<&CFString>,
in_write_access: bool,
) -> Option<CFRetained<SKIndex>> {
extern "C-unwind" {
fn SKIndexOpenWithURL(
in_url: Option<&CFURL>,
in_index_name: Option<&CFString>,
in_write_access: Boolean,
) -> Option<NonNull<SKIndex>>;
}
let ret = unsafe { SKIndexOpenWithURL(in_url, in_index_name, in_write_access as _) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SKIndexCreateWithMutableData")]
#[inline]
pub unsafe fn with_mutable_data(
in_data: Option<&CFMutableData>,
in_index_name: Option<&CFString>,
in_index_type: SKIndexType,
in_analysis_properties: Option<&CFDictionary>,
) -> Option<CFRetained<SKIndex>> {
extern "C-unwind" {
fn SKIndexCreateWithMutableData(
in_data: Option<&CFMutableData>,
in_index_name: Option<&CFString>,
in_index_type: SKIndexType,
in_analysis_properties: Option<&CFDictionary>,
) -> Option<NonNull<SKIndex>>;
}
let ret = unsafe {
SKIndexCreateWithMutableData(
in_data,
in_index_name,
in_index_type,
in_analysis_properties,
)
};
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "SKIndexOpenWithData")]
#[inline]
pub unsafe fn open_with_data(
in_data: Option<&CFData>,
in_index_name: Option<&CFString>,
) -> Option<CFRetained<SKIndex>> {
extern "C-unwind" {
fn SKIndexOpenWithData(
in_data: Option<&CFData>,
in_index_name: Option<&CFString>,
) -> Option<NonNull<SKIndex>>;
}
let ret = unsafe { SKIndexOpenWithData(in_data, in_index_name) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SKIndexOpenWithMutableData")]
#[inline]
pub unsafe fn open_with_mutable_data(
in_data: Option<&CFMutableData>,
in_index_name: Option<&CFString>,
) -> Option<CFRetained<SKIndex>> {
extern "C-unwind" {
fn SKIndexOpenWithMutableData(
in_data: Option<&CFMutableData>,
in_index_name: Option<&CFString>,
) -> Option<NonNull<SKIndex>>;
}
let ret = unsafe { SKIndexOpenWithMutableData(in_data, in_index_name) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SKIndexFlush")]
#[inline]
pub unsafe fn flush(&self) -> bool {
extern "C-unwind" {
fn SKIndexFlush(in_index: &SKIndex) -> Boolean;
}
let ret = unsafe { SKIndexFlush(self) };
ret != 0
}
#[doc(alias = "SKIndexSetMaximumBytesBeforeFlush")]
#[inline]
pub unsafe fn set_maximum_bytes_before_flush(&self, in_bytes_for_update: CFIndex) {
extern "C-unwind" {
fn SKIndexSetMaximumBytesBeforeFlush(in_index: &SKIndex, in_bytes_for_update: CFIndex);
}
unsafe { SKIndexSetMaximumBytesBeforeFlush(self, in_bytes_for_update) }
}
#[doc(alias = "SKIndexGetMaximumBytesBeforeFlush")]
#[inline]
pub unsafe fn maximum_bytes_before_flush(&self) -> CFIndex {
extern "C-unwind" {
fn SKIndexGetMaximumBytesBeforeFlush(in_index: &SKIndex) -> CFIndex;
}
unsafe { SKIndexGetMaximumBytesBeforeFlush(self) }
}
#[doc(alias = "SKIndexCompact")]
#[inline]
pub unsafe fn compact(&self) -> bool {
extern "C-unwind" {
fn SKIndexCompact(in_index: &SKIndex) -> Boolean;
}
let ret = unsafe { SKIndexCompact(self) };
ret != 0
}
#[doc(alias = "SKIndexGetIndexType")]
#[inline]
pub unsafe fn index_type(&self) -> SKIndexType {
extern "C-unwind" {
fn SKIndexGetIndexType(in_index: &SKIndex) -> SKIndexType;
}
unsafe { SKIndexGetIndexType(self) }
}
#[doc(alias = "SKIndexGetAnalysisProperties")]
#[inline]
pub unsafe fn analysis_properties(&self) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn SKIndexGetAnalysisProperties(in_index: &SKIndex) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { SKIndexGetAnalysisProperties(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "SKIndexGetDocumentCount")]
#[inline]
pub unsafe fn document_count(&self) -> CFIndex {
extern "C-unwind" {
fn SKIndexGetDocumentCount(in_index: &SKIndex) -> CFIndex;
}
unsafe { SKIndexGetDocumentCount(self) }
}
#[doc(alias = "SKIndexClose")]
#[inline]
pub unsafe fn close(&self) {
extern "C-unwind" {
fn SKIndexClose(in_index: &SKIndex);
}
unsafe { SKIndexClose(self) }
}
}
pub type SKDocumentID = CFIndex;
impl SKIndex {
#[doc(alias = "SKIndexAddDocumentWithText")]
#[cfg(feature = "SKDocument")]
#[inline]
pub unsafe fn add_document_with_text(
&self,
in_document: Option<&SKDocument>,
in_document_text: Option<&CFString>,
in_can_replace: bool,
) -> bool {
extern "C-unwind" {
fn SKIndexAddDocumentWithText(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
in_document_text: Option<&CFString>,
in_can_replace: Boolean,
) -> Boolean;
}
let ret = unsafe {
SKIndexAddDocumentWithText(self, in_document, in_document_text, in_can_replace as _)
};
ret != 0
}
#[doc(alias = "SKIndexAddDocument")]
#[cfg(feature = "SKDocument")]
#[inline]
pub unsafe fn add_document(
&self,
in_document: Option<&SKDocument>,
in_mime_type_hint: Option<&CFString>,
in_can_replace: bool,
) -> bool {
extern "C-unwind" {
fn SKIndexAddDocument(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
in_mime_type_hint: Option<&CFString>,
in_can_replace: Boolean,
) -> Boolean;
}
let ret = unsafe {
SKIndexAddDocument(self, in_document, in_mime_type_hint, in_can_replace as _)
};
ret != 0
}
#[doc(alias = "SKIndexRemoveDocument")]
#[cfg(feature = "SKDocument")]
#[inline]
pub unsafe fn remove_document(&self, in_document: Option<&SKDocument>) -> bool {
extern "C-unwind" {
fn SKIndexRemoveDocument(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
) -> Boolean;
}
let ret = unsafe { SKIndexRemoveDocument(self, in_document) };
ret != 0
}
#[doc(alias = "SKIndexCopyDocumentProperties")]
#[cfg(feature = "SKDocument")]
#[inline]
pub unsafe fn document_properties(
&self,
in_document: Option<&SKDocument>,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn SKIndexCopyDocumentProperties(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { SKIndexCopyDocumentProperties(self, in_document) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "SKIndexSetDocumentProperties")]
#[cfg(feature = "SKDocument")]
#[inline]
pub unsafe fn set_document_properties(
&self,
in_document: Option<&SKDocument>,
in_properties: Option<&CFDictionary>,
) {
extern "C-unwind" {
fn SKIndexSetDocumentProperties(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
in_properties: Option<&CFDictionary>,
);
}
unsafe { SKIndexSetDocumentProperties(self, in_document, in_properties) }
}
#[doc(alias = "SKIndexGetDocumentState")]
#[cfg(feature = "SKDocument")]
#[inline]
pub unsafe fn document_state(&self, in_document: Option<&SKDocument>) -> SKDocumentIndexState {
extern "C-unwind" {
fn SKIndexGetDocumentState(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
) -> SKDocumentIndexState;
}
unsafe { SKIndexGetDocumentState(self, in_document) }
}
#[doc(alias = "SKIndexGetDocumentID")]
#[cfg(feature = "SKDocument")]
#[inline]
pub unsafe fn document_id(&self, in_document: Option<&SKDocument>) -> SKDocumentID {
extern "C-unwind" {
fn SKIndexGetDocumentID(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
) -> SKDocumentID;
}
unsafe { SKIndexGetDocumentID(self, in_document) }
}
#[doc(alias = "SKIndexCopyDocumentForDocumentID")]
#[cfg(feature = "SKDocument")]
#[inline]
pub unsafe fn document_for_document_id(
&self,
in_document_id: SKDocumentID,
) -> Option<CFRetained<SKDocument>> {
extern "C-unwind" {
fn SKIndexCopyDocumentForDocumentID(
in_index: &SKIndex,
in_document_id: SKDocumentID,
) -> Option<NonNull<SKDocument>>;
}
let ret = unsafe { SKIndexCopyDocumentForDocumentID(self, in_document_id) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "SKIndexRenameDocument")]
#[cfg(feature = "SKDocument")]
#[inline]
pub unsafe fn rename_document(
&self,
in_document: Option<&SKDocument>,
in_new_name: Option<&CFString>,
) -> bool {
extern "C-unwind" {
fn SKIndexRenameDocument(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
in_new_name: Option<&CFString>,
) -> Boolean;
}
let ret = unsafe { SKIndexRenameDocument(self, in_document, in_new_name) };
ret != 0
}
#[doc(alias = "SKIndexMoveDocument")]
#[cfg(feature = "SKDocument")]
#[inline]
pub unsafe fn move_document(
&self,
in_document: Option<&SKDocument>,
in_new_parent: Option<&SKDocument>,
) -> bool {
extern "C-unwind" {
fn SKIndexMoveDocument(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
in_new_parent: Option<&SKDocument>,
) -> Boolean;
}
let ret = unsafe { SKIndexMoveDocument(self, in_document, in_new_parent) };
ret != 0
}
}
impl SKIndexDocumentIterator {
#[doc(alias = "SKIndexDocumentIteratorCreate")]
#[cfg(feature = "SKDocument")]
#[inline]
pub unsafe fn new(
in_index: &SKIndex,
in_parent_document: Option<&SKDocument>,
) -> Option<CFRetained<SKIndexDocumentIterator>> {
extern "C-unwind" {
fn SKIndexDocumentIteratorCreate(
in_index: &SKIndex,
in_parent_document: Option<&SKDocument>,
) -> Option<NonNull<SKIndexDocumentIterator>>;
}
let ret = unsafe { SKIndexDocumentIteratorCreate(in_index, in_parent_document) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "SKIndexDocumentIteratorCopyNext")]
#[cfg(feature = "SKDocument")]
#[inline]
pub unsafe fn next(&self) -> Option<CFRetained<SKDocument>> {
extern "C-unwind" {
fn SKIndexDocumentIteratorCopyNext(
in_iterator: &SKIndexDocumentIterator,
) -> Option<NonNull<SKDocument>>;
}
let ret = unsafe { SKIndexDocumentIteratorCopyNext(self) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
}
impl SKIndex {
#[doc(alias = "SKIndexGetMaximumDocumentID")]
#[inline]
pub unsafe fn maximum_document_id(&self) -> SKDocumentID {
extern "C-unwind" {
fn SKIndexGetMaximumDocumentID(in_index: &SKIndex) -> SKDocumentID;
}
unsafe { SKIndexGetMaximumDocumentID(self) }
}
#[doc(alias = "SKIndexGetDocumentTermCount")]
#[inline]
pub unsafe fn document_term_count(&self, in_document_id: SKDocumentID) -> CFIndex {
extern "C-unwind" {
fn SKIndexGetDocumentTermCount(
in_index: &SKIndex,
in_document_id: SKDocumentID,
) -> CFIndex;
}
unsafe { SKIndexGetDocumentTermCount(self, in_document_id) }
}
#[doc(alias = "SKIndexCopyTermIDArrayForDocumentID")]
#[inline]
pub unsafe fn term_id_array_for_document_id(
&self,
in_document_id: SKDocumentID,
) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SKIndexCopyTermIDArrayForDocumentID(
in_index: &SKIndex,
in_document_id: SKDocumentID,
) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SKIndexCopyTermIDArrayForDocumentID(self, in_document_id) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "SKIndexGetDocumentTermFrequency")]
#[inline]
pub unsafe fn document_term_frequency(
&self,
in_document_id: SKDocumentID,
in_term_id: CFIndex,
) -> CFIndex {
extern "C-unwind" {
fn SKIndexGetDocumentTermFrequency(
in_index: &SKIndex,
in_document_id: SKDocumentID,
in_term_id: CFIndex,
) -> CFIndex;
}
unsafe { SKIndexGetDocumentTermFrequency(self, in_document_id, in_term_id) }
}
#[doc(alias = "SKIndexGetMaximumTermID")]
#[inline]
pub unsafe fn maximum_term_id(&self) -> CFIndex {
extern "C-unwind" {
fn SKIndexGetMaximumTermID(in_index: &SKIndex) -> CFIndex;
}
unsafe { SKIndexGetMaximumTermID(self) }
}
#[doc(alias = "SKIndexGetTermDocumentCount")]
#[inline]
pub unsafe fn term_document_count(&self, in_term_id: CFIndex) -> CFIndex {
extern "C-unwind" {
fn SKIndexGetTermDocumentCount(in_index: &SKIndex, in_term_id: CFIndex) -> CFIndex;
}
unsafe { SKIndexGetTermDocumentCount(self, in_term_id) }
}
#[doc(alias = "SKIndexCopyDocumentIDArrayForTermID")]
#[inline]
pub unsafe fn document_id_array_for_term_id(
&self,
in_term_id: CFIndex,
) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SKIndexCopyDocumentIDArrayForTermID(
in_index: &SKIndex,
in_term_id: CFIndex,
) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SKIndexCopyDocumentIDArrayForTermID(self, in_term_id) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "SKIndexCopyTermStringForTermID")]
#[inline]
pub unsafe fn term_string_for_term_id(
&self,
in_term_id: CFIndex,
) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn SKIndexCopyTermStringForTermID(
in_index: &SKIndex,
in_term_id: CFIndex,
) -> Option<NonNull<CFString>>;
}
let ret = unsafe { SKIndexCopyTermStringForTermID(self, in_term_id) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "SKIndexGetTermIDForTermString")]
#[inline]
pub unsafe fn term_id_for_term_string(&self, in_term_string: Option<&CFString>) -> CFIndex {
extern "C-unwind" {
fn SKIndexGetTermIDForTermString(
in_index: &SKIndex,
in_term_string: Option<&CFString>,
) -> CFIndex;
}
unsafe { SKIndexGetTermIDForTermString(self, in_term_string) }
}
}
extern "C-unwind" {
pub fn SKLoadDefaultExtractorPlugIns();
}
#[deprecated = "renamed to `SKIndex::with_url`"]
#[inline]
pub unsafe extern "C-unwind" fn SKIndexCreateWithURL(
in_url: Option<&CFURL>,
in_index_name: Option<&CFString>,
in_index_type: SKIndexType,
in_analysis_properties: Option<&CFDictionary>,
) -> Option<CFRetained<SKIndex>> {
extern "C-unwind" {
fn SKIndexCreateWithURL(
in_url: Option<&CFURL>,
in_index_name: Option<&CFString>,
in_index_type: SKIndexType,
in_analysis_properties: Option<&CFDictionary>,
) -> Option<NonNull<SKIndex>>;
}
let ret = unsafe {
SKIndexCreateWithURL(in_url, in_index_name, in_index_type, in_analysis_properties)
};
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `SKIndex::open_with_url`"]
#[inline]
pub unsafe extern "C-unwind" fn SKIndexOpenWithURL(
in_url: Option<&CFURL>,
in_index_name: Option<&CFString>,
in_write_access: bool,
) -> Option<CFRetained<SKIndex>> {
extern "C-unwind" {
fn SKIndexOpenWithURL(
in_url: Option<&CFURL>,
in_index_name: Option<&CFString>,
in_write_access: Boolean,
) -> Option<NonNull<SKIndex>>;
}
let ret = unsafe { SKIndexOpenWithURL(in_url, in_index_name, in_write_access as _) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SKIndex::with_mutable_data`"]
#[inline]
pub unsafe extern "C-unwind" fn SKIndexCreateWithMutableData(
in_data: Option<&CFMutableData>,
in_index_name: Option<&CFString>,
in_index_type: SKIndexType,
in_analysis_properties: Option<&CFDictionary>,
) -> Option<CFRetained<SKIndex>> {
extern "C-unwind" {
fn SKIndexCreateWithMutableData(
in_data: Option<&CFMutableData>,
in_index_name: Option<&CFString>,
in_index_type: SKIndexType,
in_analysis_properties: Option<&CFDictionary>,
) -> Option<NonNull<SKIndex>>;
}
let ret = unsafe {
SKIndexCreateWithMutableData(
in_data,
in_index_name,
in_index_type,
in_analysis_properties,
)
};
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `SKIndex::open_with_data`"]
#[inline]
pub unsafe extern "C-unwind" fn SKIndexOpenWithData(
in_data: Option<&CFData>,
in_index_name: Option<&CFString>,
) -> Option<CFRetained<SKIndex>> {
extern "C-unwind" {
fn SKIndexOpenWithData(
in_data: Option<&CFData>,
in_index_name: Option<&CFString>,
) -> Option<NonNull<SKIndex>>;
}
let ret = unsafe { SKIndexOpenWithData(in_data, in_index_name) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SKIndex::open_with_mutable_data`"]
#[inline]
pub unsafe extern "C-unwind" fn SKIndexOpenWithMutableData(
in_data: Option<&CFMutableData>,
in_index_name: Option<&CFString>,
) -> Option<CFRetained<SKIndex>> {
extern "C-unwind" {
fn SKIndexOpenWithMutableData(
in_data: Option<&CFMutableData>,
in_index_name: Option<&CFString>,
) -> Option<NonNull<SKIndex>>;
}
let ret = unsafe { SKIndexOpenWithMutableData(in_data, in_index_name) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `SKIndex::flush`"]
#[inline]
pub unsafe extern "C-unwind" fn SKIndexFlush(in_index: &SKIndex) -> bool {
extern "C-unwind" {
fn SKIndexFlush(in_index: &SKIndex) -> Boolean;
}
let ret = unsafe { SKIndexFlush(in_index) };
ret != 0
}
extern "C-unwind" {
#[deprecated = "renamed to `SKIndex::set_maximum_bytes_before_flush`"]
pub fn SKIndexSetMaximumBytesBeforeFlush(in_index: &SKIndex, in_bytes_for_update: CFIndex);
}
extern "C-unwind" {
#[deprecated = "renamed to `SKIndex::maximum_bytes_before_flush`"]
pub fn SKIndexGetMaximumBytesBeforeFlush(in_index: &SKIndex) -> CFIndex;
}
#[deprecated = "renamed to `SKIndex::compact`"]
#[inline]
pub unsafe extern "C-unwind" fn SKIndexCompact(in_index: &SKIndex) -> bool {
extern "C-unwind" {
fn SKIndexCompact(in_index: &SKIndex) -> Boolean;
}
let ret = unsafe { SKIndexCompact(in_index) };
ret != 0
}
extern "C-unwind" {
#[deprecated = "renamed to `SKIndex::index_type`"]
pub fn SKIndexGetIndexType(in_index: &SKIndex) -> SKIndexType;
}
#[deprecated = "renamed to `SKIndex::analysis_properties`"]
#[inline]
pub unsafe extern "C-unwind" fn SKIndexGetAnalysisProperties(
in_index: &SKIndex,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn SKIndexGetAnalysisProperties(in_index: &SKIndex) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { SKIndexGetAnalysisProperties(in_index) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
extern "C-unwind" {
#[deprecated = "renamed to `SKIndex::document_count`"]
pub fn SKIndexGetDocumentCount(in_index: &SKIndex) -> CFIndex;
}
extern "C-unwind" {
#[deprecated = "renamed to `SKIndex::close`"]
pub fn SKIndexClose(in_index: &SKIndex);
}
#[cfg(feature = "SKDocument")]
#[deprecated = "renamed to `SKIndex::add_document_with_text`"]
#[inline]
pub unsafe extern "C-unwind" fn SKIndexAddDocumentWithText(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
in_document_text: Option<&CFString>,
in_can_replace: bool,
) -> bool {
extern "C-unwind" {
fn SKIndexAddDocumentWithText(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
in_document_text: Option<&CFString>,
in_can_replace: Boolean,
) -> Boolean;
}
let ret = unsafe {
SKIndexAddDocumentWithText(in_index, in_document, in_document_text, in_can_replace as _)
};
ret != 0
}
#[cfg(feature = "SKDocument")]
#[deprecated = "renamed to `SKIndex::add_document`"]
#[inline]
pub unsafe extern "C-unwind" fn SKIndexAddDocument(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
in_mime_type_hint: Option<&CFString>,
in_can_replace: bool,
) -> bool {
extern "C-unwind" {
fn SKIndexAddDocument(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
in_mime_type_hint: Option<&CFString>,
in_can_replace: Boolean,
) -> Boolean;
}
let ret = unsafe {
SKIndexAddDocument(
in_index,
in_document,
in_mime_type_hint,
in_can_replace as _,
)
};
ret != 0
}
#[cfg(feature = "SKDocument")]
#[deprecated = "renamed to `SKIndex::remove_document`"]
#[inline]
pub unsafe extern "C-unwind" fn SKIndexRemoveDocument(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
) -> bool {
extern "C-unwind" {
fn SKIndexRemoveDocument(in_index: &SKIndex, in_document: Option<&SKDocument>) -> Boolean;
}
let ret = unsafe { SKIndexRemoveDocument(in_index, in_document) };
ret != 0
}
#[cfg(feature = "SKDocument")]
#[deprecated = "renamed to `SKIndex::document_properties`"]
#[inline]
pub unsafe extern "C-unwind" fn SKIndexCopyDocumentProperties(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn SKIndexCopyDocumentProperties(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { SKIndexCopyDocumentProperties(in_index, in_document) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
extern "C-unwind" {
#[cfg(feature = "SKDocument")]
#[deprecated = "renamed to `SKIndex::set_document_properties`"]
pub fn SKIndexSetDocumentProperties(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
in_properties: Option<&CFDictionary>,
);
}
extern "C-unwind" {
#[cfg(feature = "SKDocument")]
#[deprecated = "renamed to `SKIndex::document_state`"]
pub fn SKIndexGetDocumentState(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
) -> SKDocumentIndexState;
}
extern "C-unwind" {
#[cfg(feature = "SKDocument")]
#[deprecated = "renamed to `SKIndex::document_id`"]
pub fn SKIndexGetDocumentID(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
) -> SKDocumentID;
}
#[cfg(feature = "SKDocument")]
#[deprecated = "renamed to `SKIndex::document_for_document_id`"]
#[inline]
pub unsafe extern "C-unwind" fn SKIndexCopyDocumentForDocumentID(
in_index: &SKIndex,
in_document_id: SKDocumentID,
) -> Option<CFRetained<SKDocument>> {
extern "C-unwind" {
fn SKIndexCopyDocumentForDocumentID(
in_index: &SKIndex,
in_document_id: SKDocumentID,
) -> Option<NonNull<SKDocument>>;
}
let ret = unsafe { SKIndexCopyDocumentForDocumentID(in_index, in_document_id) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[cfg(feature = "SKDocument")]
#[deprecated = "renamed to `SKIndex::rename_document`"]
#[inline]
pub unsafe extern "C-unwind" fn SKIndexRenameDocument(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
in_new_name: Option<&CFString>,
) -> bool {
extern "C-unwind" {
fn SKIndexRenameDocument(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
in_new_name: Option<&CFString>,
) -> Boolean;
}
let ret = unsafe { SKIndexRenameDocument(in_index, in_document, in_new_name) };
ret != 0
}
#[cfg(feature = "SKDocument")]
#[deprecated = "renamed to `SKIndex::move_document`"]
#[inline]
pub unsafe extern "C-unwind" fn SKIndexMoveDocument(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
in_new_parent: Option<&SKDocument>,
) -> bool {
extern "C-unwind" {
fn SKIndexMoveDocument(
in_index: &SKIndex,
in_document: Option<&SKDocument>,
in_new_parent: Option<&SKDocument>,
) -> Boolean;
}
let ret = unsafe { SKIndexMoveDocument(in_index, in_document, in_new_parent) };
ret != 0
}
#[cfg(feature = "SKDocument")]
#[deprecated = "renamed to `SKIndexDocumentIterator::new`"]
#[inline]
pub unsafe extern "C-unwind" fn SKIndexDocumentIteratorCreate(
in_index: &SKIndex,
in_parent_document: Option<&SKDocument>,
) -> Option<CFRetained<SKIndexDocumentIterator>> {
extern "C-unwind" {
fn SKIndexDocumentIteratorCreate(
in_index: &SKIndex,
in_parent_document: Option<&SKDocument>,
) -> Option<NonNull<SKIndexDocumentIterator>>;
}
let ret = unsafe { SKIndexDocumentIteratorCreate(in_index, in_parent_document) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[cfg(feature = "SKDocument")]
#[deprecated = "renamed to `SKIndexDocumentIterator::next`"]
#[inline]
pub unsafe extern "C-unwind" fn SKIndexDocumentIteratorCopyNext(
in_iterator: &SKIndexDocumentIterator,
) -> Option<CFRetained<SKDocument>> {
extern "C-unwind" {
fn SKIndexDocumentIteratorCopyNext(
in_iterator: &SKIndexDocumentIterator,
) -> Option<NonNull<SKDocument>>;
}
let ret = unsafe { SKIndexDocumentIteratorCopyNext(in_iterator) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
extern "C-unwind" {
#[deprecated = "renamed to `SKIndex::maximum_document_id`"]
pub fn SKIndexGetMaximumDocumentID(in_index: &SKIndex) -> SKDocumentID;
}
extern "C-unwind" {
#[deprecated = "renamed to `SKIndex::document_term_count`"]
pub fn SKIndexGetDocumentTermCount(in_index: &SKIndex, in_document_id: SKDocumentID)
-> CFIndex;
}
#[deprecated = "renamed to `SKIndex::term_id_array_for_document_id`"]
#[inline]
pub unsafe extern "C-unwind" fn SKIndexCopyTermIDArrayForDocumentID(
in_index: &SKIndex,
in_document_id: SKDocumentID,
) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SKIndexCopyTermIDArrayForDocumentID(
in_index: &SKIndex,
in_document_id: SKDocumentID,
) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SKIndexCopyTermIDArrayForDocumentID(in_index, in_document_id) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
extern "C-unwind" {
#[deprecated = "renamed to `SKIndex::document_term_frequency`"]
pub fn SKIndexGetDocumentTermFrequency(
in_index: &SKIndex,
in_document_id: SKDocumentID,
in_term_id: CFIndex,
) -> CFIndex;
}
extern "C-unwind" {
#[deprecated = "renamed to `SKIndex::maximum_term_id`"]
pub fn SKIndexGetMaximumTermID(in_index: &SKIndex) -> CFIndex;
}
extern "C-unwind" {
#[deprecated = "renamed to `SKIndex::term_document_count`"]
pub fn SKIndexGetTermDocumentCount(in_index: &SKIndex, in_term_id: CFIndex) -> CFIndex;
}
#[deprecated = "renamed to `SKIndex::document_id_array_for_term_id`"]
#[inline]
pub unsafe extern "C-unwind" fn SKIndexCopyDocumentIDArrayForTermID(
in_index: &SKIndex,
in_term_id: CFIndex,
) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn SKIndexCopyDocumentIDArrayForTermID(
in_index: &SKIndex,
in_term_id: CFIndex,
) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { SKIndexCopyDocumentIDArrayForTermID(in_index, in_term_id) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `SKIndex::term_string_for_term_id`"]
#[inline]
pub unsafe extern "C-unwind" fn SKIndexCopyTermStringForTermID(
in_index: &SKIndex,
in_term_id: CFIndex,
) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn SKIndexCopyTermStringForTermID(
in_index: &SKIndex,
in_term_id: CFIndex,
) -> Option<NonNull<CFString>>;
}
let ret = unsafe { SKIndexCopyTermStringForTermID(in_index, in_term_id) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
extern "C-unwind" {
#[deprecated = "renamed to `SKIndex::term_id_for_term_string`"]
pub fn SKIndexGetTermIDForTermString(
in_index: &SKIndex,
in_term_string: Option<&CFString>,
) -> CFIndex;
}