core_foundation_sys/
propertylist.rs1use crate::base::{Boolean, CFAllocatorRef, CFIndex, CFOptionFlags, CFTypeRef};
11use crate::data::CFDataRef;
12use crate::error::CFErrorRef;
13use crate::stream::{CFReadStreamRef, CFWriteStreamRef};
14use crate::string::CFStringRef;
15
16pub type CFPropertyListRef = CFTypeRef;
17
18pub type CFPropertyListFormat = CFIndex;
19pub const kCFPropertyListOpenStepFormat: CFPropertyListFormat = 1;
20pub const kCFPropertyListXMLFormat_v1_0: CFPropertyListFormat = 100;
21pub const kCFPropertyListBinaryFormat_v1_0: CFPropertyListFormat = 200;
22
23pub type CFPropertyListMutabilityOptions = CFOptionFlags;
24pub const kCFPropertyListImmutable: CFPropertyListMutabilityOptions = 0;
25pub const kCFPropertyListMutableContainers: CFPropertyListMutabilityOptions = 1;
26pub const kCFPropertyListMutableContainersAndLeaves: CFPropertyListMutabilityOptions = 2;
27
28pub const kCFPropertyListReadCorruptError: CFIndex = 3840;
30pub const kCFPropertyListReadUnknownVersionError: CFIndex = 3841;
31pub const kCFPropertyListReadStreamError: CFIndex = 3842;
32pub const kCFPropertyListWriteStreamError: CFIndex = 3851;
33
34extern "C" {
35 pub fn CFPropertyListCreateWithData(
41 allocator: CFAllocatorRef,
42 data: CFDataRef,
43 options: CFPropertyListMutabilityOptions,
44 format: *mut CFPropertyListFormat,
45 error: *mut CFErrorRef,
46 ) -> CFPropertyListRef;
47 pub fn CFPropertyListCreateWithStream(
48 allocator: CFAllocatorRef,
49 stream: CFReadStreamRef,
50 streamLength: CFIndex,
51 options: CFOptionFlags,
52 format: *mut CFPropertyListFormat,
53 error: *mut CFErrorRef,
54 ) -> CFPropertyListRef;
55 pub fn CFPropertyListCreateDeepCopy(
56 allocator: CFAllocatorRef,
57 propertyList: CFPropertyListRef,
58 mutabilityOption: CFOptionFlags,
59 ) -> CFPropertyListRef;
60 pub fn CFPropertyListCreateFromXMLData(
61 allocator: CFAllocatorRef,
62 xmlData: CFDataRef,
63 mutabilityOption: CFOptionFlags,
64 errorString: *mut CFStringRef,
65 ) -> CFPropertyListRef; pub fn CFPropertyListCreateFromStream(
67 allocator: CFAllocatorRef,
68 stream: CFReadStreamRef,
69 streamLength: CFIndex,
70 mutabilityOption: CFOptionFlags,
71 format: *mut CFPropertyListFormat,
72 errorString: *mut CFStringRef,
73 ) -> CFPropertyListRef; pub fn CFPropertyListCreateData(
77 allocator: CFAllocatorRef,
78 propertyList: CFPropertyListRef,
79 format: CFPropertyListFormat,
80 options: CFOptionFlags,
81 error: *mut CFErrorRef,
82 ) -> CFDataRef;
83 pub fn CFPropertyListWrite(
84 propertyList: CFPropertyListRef,
85 stream: CFWriteStreamRef,
86 format: CFPropertyListFormat,
87 options: CFOptionFlags,
88 error: *mut CFErrorRef,
89 ) -> CFIndex;
90 pub fn CFPropertyListCreateXMLData(
91 allocator: CFAllocatorRef,
92 propertyList: CFPropertyListRef,
93 ) -> CFDataRef; pub fn CFPropertyListWriteToStream(
95 propertyList: CFPropertyListRef,
96 stream: CFWriteStreamRef,
97 format: CFPropertyListFormat,
98 errorString: *mut CFStringRef,
99 ) -> CFIndex;
100
101 pub fn CFPropertyListIsValid(plist: CFPropertyListRef, format: CFPropertyListFormat)
103 -> Boolean;
104}