diff --git a/chipmunk.h b/chipmunk.h new file mode 100644 index 0000000..6e10776 --- /dev/null +++ b/chipmunk.h @@ -0,0 +1,71550 @@ + +typedef signed char __int8_t; + + + +typedef unsigned char __uint8_t; +typedef short __int16_t; +typedef unsigned short __uint16_t; +typedef int __int32_t; +typedef unsigned int __uint32_t; +typedef long long __int64_t; +typedef unsigned long long __uint64_t; + +typedef long __darwin_intptr_t; +typedef unsigned int __darwin_natural_t; +typedef int __darwin_ct_rune_t; + + + + + +typedef union { + char __mbstate8[128]; + long long _mbstateL; +} __mbstate_t; + +typedef __mbstate_t __darwin_mbstate_t; + + +typedef long int __darwin_ptrdiff_t; + + + + + + + +typedef long unsigned int __darwin_size_t; + + + + + +typedef __builtin_va_list __darwin_va_list; + + + + + +typedef int __darwin_wchar_t; + + + + +typedef __darwin_wchar_t __darwin_rune_t; + + +typedef int __darwin_wint_t; + + + + +typedef unsigned long __darwin_clock_t; +typedef __uint32_t __darwin_socklen_t; +typedef long __darwin_ssize_t; +typedef long __darwin_time_t; +typedef __int64_t __darwin_blkcnt_t; +typedef __int32_t __darwin_blksize_t; +typedef __int32_t __darwin_dev_t; +typedef unsigned int __darwin_fsblkcnt_t; +typedef unsigned int __darwin_fsfilcnt_t; +typedef __uint32_t __darwin_gid_t; +typedef __uint32_t __darwin_id_t; +typedef __uint64_t __darwin_ino64_t; + +typedef __darwin_ino64_t __darwin_ino_t; + + + +typedef __darwin_natural_t __darwin_mach_port_name_t; +typedef __darwin_mach_port_name_t __darwin_mach_port_t; +typedef __uint16_t __darwin_mode_t; +typedef __int64_t __darwin_off_t; +typedef __int32_t __darwin_pid_t; +typedef __uint32_t __darwin_sigset_t; +typedef __int32_t __darwin_suseconds_t; +typedef __uint32_t __darwin_uid_t; +typedef __uint32_t __darwin_useconds_t; +typedef unsigned char __darwin_uuid_t[16]; +typedef char __darwin_uuid_string_t[37]; + + +struct __darwin_pthread_handler_rec { + void (*__routine)(void *); + void *__arg; + struct __darwin_pthread_handler_rec *__next; +}; + +struct _opaque_pthread_attr_t { + long __sig; + char __opaque[56]; +}; + +struct _opaque_pthread_cond_t { + long __sig; + char __opaque[40]; +}; + +struct _opaque_pthread_condattr_t { + long __sig; + char __opaque[8]; +}; + +struct _opaque_pthread_mutex_t { + long __sig; + char __opaque[56]; +}; + +struct _opaque_pthread_mutexattr_t { + long __sig; + char __opaque[8]; +}; + +struct _opaque_pthread_once_t { + long __sig; + char __opaque[8]; +}; + +struct _opaque_pthread_rwlock_t { + long __sig; + char __opaque[192]; +}; + +struct _opaque_pthread_rwlockattr_t { + long __sig; + char __opaque[16]; +}; + +struct _opaque_pthread_t { + long __sig; + struct __darwin_pthread_handler_rec *__cleanup_stack; + char __opaque[8176]; +}; + +typedef struct _opaque_pthread_attr_t __darwin_pthread_attr_t; +typedef struct _opaque_pthread_cond_t __darwin_pthread_cond_t; +typedef struct _opaque_pthread_condattr_t __darwin_pthread_condattr_t; +typedef unsigned long __darwin_pthread_key_t; +typedef struct _opaque_pthread_mutex_t __darwin_pthread_mutex_t; +typedef struct _opaque_pthread_mutexattr_t __darwin_pthread_mutexattr_t; +typedef struct _opaque_pthread_once_t __darwin_pthread_once_t; +typedef struct _opaque_pthread_rwlock_t __darwin_pthread_rwlock_t; +typedef struct _opaque_pthread_rwlockattr_t __darwin_pthread_rwlockattr_t; +typedef struct _opaque_pthread_t *__darwin_pthread_t; +typedef int __darwin_nl_item; +typedef int __darwin_wctrans_t; + +typedef __uint32_t __darwin_wctype_t; + +typedef enum { + P_ALL, + P_PID, + P_PGID +} idtype_t; + + + + + + +typedef __darwin_pid_t pid_t; +typedef __darwin_id_t id_t; + + + + + + + + +typedef int sig_atomic_t; +struct __darwin_i386_thread_state +{ + unsigned int __eax; + unsigned int __ebx; + unsigned int __ecx; + unsigned int __edx; + unsigned int __edi; + unsigned int __esi; + unsigned int __ebp; + unsigned int __esp; + unsigned int __ss; + unsigned int __eflags; + unsigned int __eip; + unsigned int __cs; + unsigned int __ds; + unsigned int __es; + unsigned int __fs; + unsigned int __gs; +}; +struct __darwin_fp_control +{ + unsigned short __invalid :1, + __denorm :1, + __zdiv :1, + __ovrfl :1, + __undfl :1, + __precis :1, + :2, + __pc :2, + + + + + + __rc :2, + + + + + + + :1, + :3; +}; +typedef struct __darwin_fp_control __darwin_fp_control_t; +struct __darwin_fp_status +{ + unsigned short __invalid :1, + __denorm :1, + __zdiv :1, + __ovrfl :1, + __undfl :1, + __precis :1, + __stkflt :1, + __errsumm :1, + __c0 :1, + __c1 :1, + __c2 :1, + __tos :3, + __c3 :1, + __busy :1; +}; +typedef struct __darwin_fp_status __darwin_fp_status_t; +struct __darwin_mmst_reg +{ + char __mmst_reg[10]; + char __mmst_rsrv[6]; +}; +struct __darwin_xmm_reg +{ + char __xmm_reg[16]; +}; +struct __darwin_i386_float_state +{ + int __fpu_reserved[2]; + struct __darwin_fp_control __fpu_fcw; + struct __darwin_fp_status __fpu_fsw; + __uint8_t __fpu_ftw; + __uint8_t __fpu_rsrv1; + __uint16_t __fpu_fop; + __uint32_t __fpu_ip; + __uint16_t __fpu_cs; + __uint16_t __fpu_rsrv2; + __uint32_t __fpu_dp; + __uint16_t __fpu_ds; + __uint16_t __fpu_rsrv3; + __uint32_t __fpu_mxcsr; + __uint32_t __fpu_mxcsrmask; + struct __darwin_mmst_reg __fpu_stmm0; + struct __darwin_mmst_reg __fpu_stmm1; + struct __darwin_mmst_reg __fpu_stmm2; + struct __darwin_mmst_reg __fpu_stmm3; + struct __darwin_mmst_reg __fpu_stmm4; + struct __darwin_mmst_reg __fpu_stmm5; + struct __darwin_mmst_reg __fpu_stmm6; + struct __darwin_mmst_reg __fpu_stmm7; + struct __darwin_xmm_reg __fpu_xmm0; + struct __darwin_xmm_reg __fpu_xmm1; + struct __darwin_xmm_reg __fpu_xmm2; + struct __darwin_xmm_reg __fpu_xmm3; + struct __darwin_xmm_reg __fpu_xmm4; + struct __darwin_xmm_reg __fpu_xmm5; + struct __darwin_xmm_reg __fpu_xmm6; + struct __darwin_xmm_reg __fpu_xmm7; + char __fpu_rsrv4[14*16]; + int __fpu_reserved1; +}; + + +struct __darwin_i386_avx_state +{ + int __fpu_reserved[2]; + struct __darwin_fp_control __fpu_fcw; + struct __darwin_fp_status __fpu_fsw; + __uint8_t __fpu_ftw; + __uint8_t __fpu_rsrv1; + __uint16_t __fpu_fop; + __uint32_t __fpu_ip; + __uint16_t __fpu_cs; + __uint16_t __fpu_rsrv2; + __uint32_t __fpu_dp; + __uint16_t __fpu_ds; + __uint16_t __fpu_rsrv3; + __uint32_t __fpu_mxcsr; + __uint32_t __fpu_mxcsrmask; + struct __darwin_mmst_reg __fpu_stmm0; + struct __darwin_mmst_reg __fpu_stmm1; + struct __darwin_mmst_reg __fpu_stmm2; + struct __darwin_mmst_reg __fpu_stmm3; + struct __darwin_mmst_reg __fpu_stmm4; + struct __darwin_mmst_reg __fpu_stmm5; + struct __darwin_mmst_reg __fpu_stmm6; + struct __darwin_mmst_reg __fpu_stmm7; + struct __darwin_xmm_reg __fpu_xmm0; + struct __darwin_xmm_reg __fpu_xmm1; + struct __darwin_xmm_reg __fpu_xmm2; + struct __darwin_xmm_reg __fpu_xmm3; + struct __darwin_xmm_reg __fpu_xmm4; + struct __darwin_xmm_reg __fpu_xmm5; + struct __darwin_xmm_reg __fpu_xmm6; + struct __darwin_xmm_reg __fpu_xmm7; + char __fpu_rsrv4[14*16]; + int __fpu_reserved1; + char __avx_reserved1[64]; + struct __darwin_xmm_reg __fpu_ymmh0; + struct __darwin_xmm_reg __fpu_ymmh1; + struct __darwin_xmm_reg __fpu_ymmh2; + struct __darwin_xmm_reg __fpu_ymmh3; + struct __darwin_xmm_reg __fpu_ymmh4; + struct __darwin_xmm_reg __fpu_ymmh5; + struct __darwin_xmm_reg __fpu_ymmh6; + struct __darwin_xmm_reg __fpu_ymmh7; +}; +struct __darwin_i386_exception_state +{ + __uint16_t __trapno; + __uint16_t __cpu; + __uint32_t __err; + __uint32_t __faultvaddr; +}; +struct __darwin_x86_debug_state32 +{ + unsigned int __dr0; + unsigned int __dr1; + unsigned int __dr2; + unsigned int __dr3; + unsigned int __dr4; + unsigned int __dr5; + unsigned int __dr6; + unsigned int __dr7; +}; +struct __darwin_x86_thread_state64 +{ + __uint64_t __rax; + __uint64_t __rbx; + __uint64_t __rcx; + __uint64_t __rdx; + __uint64_t __rdi; + __uint64_t __rsi; + __uint64_t __rbp; + __uint64_t __rsp; + __uint64_t __r8; + __uint64_t __r9; + __uint64_t __r10; + __uint64_t __r11; + __uint64_t __r12; + __uint64_t __r13; + __uint64_t __r14; + __uint64_t __r15; + __uint64_t __rip; + __uint64_t __rflags; + __uint64_t __cs; + __uint64_t __fs; + __uint64_t __gs; +}; +struct __darwin_x86_float_state64 +{ + int __fpu_reserved[2]; + struct __darwin_fp_control __fpu_fcw; + struct __darwin_fp_status __fpu_fsw; + __uint8_t __fpu_ftw; + __uint8_t __fpu_rsrv1; + __uint16_t __fpu_fop; + + + __uint32_t __fpu_ip; + __uint16_t __fpu_cs; + + __uint16_t __fpu_rsrv2; + + + __uint32_t __fpu_dp; + __uint16_t __fpu_ds; + + __uint16_t __fpu_rsrv3; + __uint32_t __fpu_mxcsr; + __uint32_t __fpu_mxcsrmask; + struct __darwin_mmst_reg __fpu_stmm0; + struct __darwin_mmst_reg __fpu_stmm1; + struct __darwin_mmst_reg __fpu_stmm2; + struct __darwin_mmst_reg __fpu_stmm3; + struct __darwin_mmst_reg __fpu_stmm4; + struct __darwin_mmst_reg __fpu_stmm5; + struct __darwin_mmst_reg __fpu_stmm6; + struct __darwin_mmst_reg __fpu_stmm7; + struct __darwin_xmm_reg __fpu_xmm0; + struct __darwin_xmm_reg __fpu_xmm1; + struct __darwin_xmm_reg __fpu_xmm2; + struct __darwin_xmm_reg __fpu_xmm3; + struct __darwin_xmm_reg __fpu_xmm4; + struct __darwin_xmm_reg __fpu_xmm5; + struct __darwin_xmm_reg __fpu_xmm6; + struct __darwin_xmm_reg __fpu_xmm7; + struct __darwin_xmm_reg __fpu_xmm8; + struct __darwin_xmm_reg __fpu_xmm9; + struct __darwin_xmm_reg __fpu_xmm10; + struct __darwin_xmm_reg __fpu_xmm11; + struct __darwin_xmm_reg __fpu_xmm12; + struct __darwin_xmm_reg __fpu_xmm13; + struct __darwin_xmm_reg __fpu_xmm14; + struct __darwin_xmm_reg __fpu_xmm15; + char __fpu_rsrv4[6*16]; + int __fpu_reserved1; +}; + + +struct __darwin_x86_avx_state64 +{ + int __fpu_reserved[2]; + struct __darwin_fp_control __fpu_fcw; + struct __darwin_fp_status __fpu_fsw; + __uint8_t __fpu_ftw; + __uint8_t __fpu_rsrv1; + __uint16_t __fpu_fop; + + + __uint32_t __fpu_ip; + __uint16_t __fpu_cs; + + __uint16_t __fpu_rsrv2; + + + __uint32_t __fpu_dp; + __uint16_t __fpu_ds; + + __uint16_t __fpu_rsrv3; + __uint32_t __fpu_mxcsr; + __uint32_t __fpu_mxcsrmask; + struct __darwin_mmst_reg __fpu_stmm0; + struct __darwin_mmst_reg __fpu_stmm1; + struct __darwin_mmst_reg __fpu_stmm2; + struct __darwin_mmst_reg __fpu_stmm3; + struct __darwin_mmst_reg __fpu_stmm4; + struct __darwin_mmst_reg __fpu_stmm5; + struct __darwin_mmst_reg __fpu_stmm6; + struct __darwin_mmst_reg __fpu_stmm7; + struct __darwin_xmm_reg __fpu_xmm0; + struct __darwin_xmm_reg __fpu_xmm1; + struct __darwin_xmm_reg __fpu_xmm2; + struct __darwin_xmm_reg __fpu_xmm3; + struct __darwin_xmm_reg __fpu_xmm4; + struct __darwin_xmm_reg __fpu_xmm5; + struct __darwin_xmm_reg __fpu_xmm6; + struct __darwin_xmm_reg __fpu_xmm7; + struct __darwin_xmm_reg __fpu_xmm8; + struct __darwin_xmm_reg __fpu_xmm9; + struct __darwin_xmm_reg __fpu_xmm10; + struct __darwin_xmm_reg __fpu_xmm11; + struct __darwin_xmm_reg __fpu_xmm12; + struct __darwin_xmm_reg __fpu_xmm13; + struct __darwin_xmm_reg __fpu_xmm14; + struct __darwin_xmm_reg __fpu_xmm15; + char __fpu_rsrv4[6*16]; + int __fpu_reserved1; + char __avx_reserved1[64]; + struct __darwin_xmm_reg __fpu_ymmh0; + struct __darwin_xmm_reg __fpu_ymmh1; + struct __darwin_xmm_reg __fpu_ymmh2; + struct __darwin_xmm_reg __fpu_ymmh3; + struct __darwin_xmm_reg __fpu_ymmh4; + struct __darwin_xmm_reg __fpu_ymmh5; + struct __darwin_xmm_reg __fpu_ymmh6; + struct __darwin_xmm_reg __fpu_ymmh7; + struct __darwin_xmm_reg __fpu_ymmh8; + struct __darwin_xmm_reg __fpu_ymmh9; + struct __darwin_xmm_reg __fpu_ymmh10; + struct __darwin_xmm_reg __fpu_ymmh11; + struct __darwin_xmm_reg __fpu_ymmh12; + struct __darwin_xmm_reg __fpu_ymmh13; + struct __darwin_xmm_reg __fpu_ymmh14; + struct __darwin_xmm_reg __fpu_ymmh15; +}; +struct __darwin_x86_exception_state64 +{ + __uint16_t __trapno; + __uint16_t __cpu; + __uint32_t __err; + __uint64_t __faultvaddr; +}; +struct __darwin_x86_debug_state64 +{ + __uint64_t __dr0; + __uint64_t __dr1; + __uint64_t __dr2; + __uint64_t __dr3; + __uint64_t __dr4; + __uint64_t __dr5; + __uint64_t __dr6; + __uint64_t __dr7; +}; + + + + +struct __darwin_mcontext32 +{ + struct __darwin_i386_exception_state __es; + struct __darwin_i386_thread_state __ss; + struct __darwin_i386_float_state __fs; +}; + + +struct __darwin_mcontext_avx32 +{ + struct __darwin_i386_exception_state __es; + struct __darwin_i386_thread_state __ss; + struct __darwin_i386_avx_state __fs; +}; +struct __darwin_mcontext64 +{ + struct __darwin_x86_exception_state64 __es; + struct __darwin_x86_thread_state64 __ss; + struct __darwin_x86_float_state64 __fs; +}; + + +struct __darwin_mcontext_avx64 +{ + struct __darwin_x86_exception_state64 __es; + struct __darwin_x86_thread_state64 __ss; + struct __darwin_x86_avx_state64 __fs; +}; +typedef struct __darwin_mcontext64 *mcontext_t; + +typedef __darwin_pthread_attr_t pthread_attr_t; + +struct __darwin_sigaltstack +{ + void *ss_sp; + __darwin_size_t ss_size; + int ss_flags; +}; +typedef struct __darwin_sigaltstack stack_t; +struct __darwin_ucontext +{ + int uc_onstack; + __darwin_sigset_t uc_sigmask; + struct __darwin_sigaltstack uc_stack; + struct __darwin_ucontext *uc_link; + __darwin_size_t uc_mcsize; + struct __darwin_mcontext64 *uc_mcontext; + + + +}; + + +typedef struct __darwin_ucontext ucontext_t; + + +typedef __darwin_sigset_t sigset_t; +typedef __darwin_size_t size_t; +typedef __darwin_uid_t uid_t; + +union sigval { + + int sival_int; + void *sival_ptr; +}; + + + + + +struct sigevent { + int sigev_notify; + int sigev_signo; + union sigval sigev_value; + void (*sigev_notify_function)(union sigval); + pthread_attr_t *sigev_notify_attributes; +}; + + +typedef struct __siginfo { + int si_signo; + int si_errno; + int si_code; + pid_t si_pid; + uid_t si_uid; + int si_status; + void *si_addr; + union sigval si_value; + long si_band; + unsigned long __pad[7]; +} siginfo_t; +union __sigaction_u { + void (*__sa_handler)(int); + void (*__sa_sigaction)(int, struct __siginfo *, + void *); +}; + + +struct __sigaction { + union __sigaction_u __sigaction_u; + void (*sa_tramp)(void *, int, int, siginfo_t *, void *); + sigset_t sa_mask; + int sa_flags; +}; + + + + +struct sigaction { + union __sigaction_u __sigaction_u; + sigset_t sa_mask; + int sa_flags; +}; +typedef void (*sig_t)(int); +struct sigvec { + void (*sv_handler)(int); + int sv_mask; + int sv_flags; +}; +struct sigstack { + char *ss_sp; + int ss_onstack; +}; +void (*signal(int, void (*)(int)))(int); +typedef signed char int8_t; +typedef short int16_t; +typedef int int32_t; +typedef long long int64_t; + +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +typedef unsigned long long uint64_t; + + +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +typedef int64_t int_least64_t; +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +typedef uint64_t uint_least64_t; + + + +typedef int8_t int_fast8_t; +typedef int16_t int_fast16_t; +typedef int32_t int_fast32_t; +typedef int64_t int_fast64_t; +typedef uint8_t uint_fast8_t; +typedef uint16_t uint_fast16_t; +typedef uint32_t uint_fast32_t; +typedef uint64_t uint_fast64_t; + + + + + + +typedef __darwin_intptr_t intptr_t; +typedef unsigned long uintptr_t; + + + +typedef long int intmax_t; +typedef long unsigned int uintmax_t; + + + + + + + +struct timeval +{ + __darwin_time_t tv_sec; + __darwin_suseconds_t tv_usec; +}; + + + + + + + + +typedef __uint64_t rlim_t; +struct rusage { + struct timeval ru_utime; + struct timeval ru_stime; + long ru_maxrss; + + long ru_ixrss; + long ru_idrss; + long ru_isrss; + long ru_minflt; + long ru_majflt; + long ru_nswap; + long ru_inblock; + long ru_oublock; + long ru_msgsnd; + long ru_msgrcv; + long ru_nsignals; + long ru_nvcsw; + long ru_nivcsw; + + +}; +typedef void *rusage_info_t; + +struct rusage_info_v0 { + uint8_t ri_uuid[16]; + uint64_t ri_user_time; + uint64_t ri_system_time; + uint64_t ri_pkg_idle_wkups; + uint64_t ri_interrupt_wkups; + uint64_t ri_pageins; + uint64_t ri_wired_size; + uint64_t ri_resident_size; + uint64_t ri_phys_footprint; + uint64_t ri_proc_start_abstime; + uint64_t ri_proc_exit_abstime; +}; + +struct rusage_info_v1 { + uint8_t ri_uuid[16]; + uint64_t ri_user_time; + uint64_t ri_system_time; + uint64_t ri_pkg_idle_wkups; + uint64_t ri_interrupt_wkups; + uint64_t ri_pageins; + uint64_t ri_wired_size; + uint64_t ri_resident_size; + uint64_t ri_phys_footprint; + uint64_t ri_proc_start_abstime; + uint64_t ri_proc_exit_abstime; + uint64_t ri_child_user_time; + uint64_t ri_child_system_time; + uint64_t ri_child_pkg_idle_wkups; + uint64_t ri_child_interrupt_wkups; + uint64_t ri_child_pageins; + uint64_t ri_child_elapsed_abstime; +}; + +struct rusage_info_v2 { + uint8_t ri_uuid[16]; + uint64_t ri_user_time; + uint64_t ri_system_time; + uint64_t ri_pkg_idle_wkups; + uint64_t ri_interrupt_wkups; + uint64_t ri_pageins; + uint64_t ri_wired_size; + uint64_t ri_resident_size; + uint64_t ri_phys_footprint; + uint64_t ri_proc_start_abstime; + uint64_t ri_proc_exit_abstime; + uint64_t ri_child_user_time; + uint64_t ri_child_system_time; + uint64_t ri_child_pkg_idle_wkups; + uint64_t ri_child_interrupt_wkups; + uint64_t ri_child_pageins; + uint64_t ri_child_elapsed_abstime; + uint64_t ri_diskio_bytesread; + uint64_t ri_diskio_byteswritten; +}; + +struct rusage_info_v3 { + uint8_t ri_uuid[16]; + uint64_t ri_user_time; + uint64_t ri_system_time; + uint64_t ri_pkg_idle_wkups; + uint64_t ri_interrupt_wkups; + uint64_t ri_pageins; + uint64_t ri_wired_size; + uint64_t ri_resident_size; + uint64_t ri_phys_footprint; + uint64_t ri_proc_start_abstime; + uint64_t ri_proc_exit_abstime; + uint64_t ri_child_user_time; + uint64_t ri_child_system_time; + uint64_t ri_child_pkg_idle_wkups; + uint64_t ri_child_interrupt_wkups; + uint64_t ri_child_pageins; + uint64_t ri_child_elapsed_abstime; + uint64_t ri_diskio_bytesread; + uint64_t ri_diskio_byteswritten; + uint64_t ri_cpu_time_qos_default; + uint64_t ri_cpu_time_qos_maintenance; + uint64_t ri_cpu_time_qos_background; + uint64_t ri_cpu_time_qos_utility; + uint64_t ri_cpu_time_qos_legacy; + uint64_t ri_cpu_time_qos_user_initiated; + uint64_t ri_cpu_time_qos_user_interactive; + uint64_t ri_billed_system_time; + uint64_t ri_serviced_system_time; +}; + +typedef struct rusage_info_v3 rusage_info_current; +struct rlimit { + rlim_t rlim_cur; + rlim_t rlim_max; +}; +struct proc_rlimit_control_wakeupmon { + uint32_t wm_flags; + int32_t wm_rate; +}; +int getpriority(int, id_t); + +int getiopolicy_np(int, int) __attribute__((availability(macosx,introduced=10.5))); + +int getrlimit(int, struct rlimit *) __asm("_" "getrlimit" ); +int getrusage(int, struct rusage *); +int setpriority(int, id_t, int); + +int setiopolicy_np(int, int, int) __attribute__((availability(macosx,introduced=10.5))); + +int setrlimit(int, const struct rlimit *) __asm("_" "setrlimit" ); +static inline +__uint16_t +_OSSwapInt16( + __uint16_t _data +) +{ + return ((__uint16_t)((_data << 8) | (_data >> 8))); +} + +static inline +__uint32_t +_OSSwapInt32( + __uint32_t _data +) +{ + + return __builtin_bswap32(_data); + + + + +} + + +static inline +__uint64_t +_OSSwapInt64( + __uint64_t _data +) +{ + return __builtin_bswap64(_data); +} + + + + + + + +union wait { + int w_status; + + + + struct { + + unsigned int w_Termsig:7, + w_Coredump:1, + w_Retcode:8, + w_Filler:16; + + + + + + + + } w_T; + + + + + + struct { + + unsigned int w_Stopval:8, + w_Stopsig:8, + w_Filler:16; + + + + + + + } w_S; +}; +pid_t wait(int *) __asm("_" "wait" ); +pid_t waitpid(pid_t, int *, int) __asm("_" "waitpid" ); + +int waitid(idtype_t, id_t, siginfo_t *, int) __asm("_" "waitid" ); + + +pid_t wait3(int *, int, struct rusage *); +pid_t wait4(pid_t, int *, int, struct rusage *); + +void *alloca(size_t); + + + + + + + + +typedef __darwin_ct_rune_t ct_rune_t; +typedef __darwin_rune_t rune_t; + + +typedef __darwin_wchar_t wchar_t; + +typedef struct { + int quot; + int rem; +} div_t; + +typedef struct { + long quot; + long rem; +} ldiv_t; + + +typedef struct { + long long quot; + long long rem; +} lldiv_t; + + + +extern int __mb_cur_max; +void abort(void) __attribute__((noreturn)); +int abs(int) __attribute__((const)); +int atexit(void (* _Nonnull)(void)); +double atof(const char *); +int atoi(const char *); +long atol(const char *); + +long long + atoll(const char *); + +void *bsearch(const void *__key, const void *__base, size_t __nel, + size_t __width, int (* _Nonnull __compar)(const void *, const void *)); +void *calloc(size_t __count, size_t __size) __attribute__((__warn_unused_result__)); +div_t div(int, int) __attribute__((const)); +void exit(int) __attribute__((noreturn)); +void free(void *); +char *getenv(const char *); +long labs(long) __attribute__((const)); +ldiv_t ldiv(long, long) __attribute__((const)); + +long long + llabs(long long); +lldiv_t lldiv(long long, long long); + +void *malloc(size_t __size) __attribute__((__warn_unused_result__)); +int mblen(const char *__s, size_t __n); +size_t mbstowcs(wchar_t * restrict , const char * restrict, size_t); +int mbtowc(wchar_t * restrict, const char * restrict, size_t); +int posix_memalign(void **__memptr, size_t __alignment, size_t __size) __attribute__((availability(macosx,introduced=10.6))); +void qsort(void *__base, size_t __nel, size_t __width, + int (* _Nonnull __compar)(const void *, const void *)); +int rand(void) __attribute__((__availability__(swift, unavailable, message="Use arc4random instead."))); +void *realloc(void *__ptr, size_t __size) __attribute__((__warn_unused_result__)); +void srand(unsigned) __attribute__((__availability__(swift, unavailable, message="Use arc4random instead."))); +double strtod(const char *, char **) __asm("_" "strtod" ); +float strtof(const char *, char **) __asm("_" "strtof" ); +long strtol(const char *__str, char **__endptr, int __base); +long double + strtold(const char *, char **); + +long long + strtoll(const char *__str, char **__endptr, int __base); + +unsigned long + strtoul(const char *__str, char **__endptr, int __base); + +unsigned long long + strtoull(const char *__str, char **__endptr, int __base); +__attribute__((__availability__(swift, unavailable, message="Use posix_spawn APIs or NSTask instead."))) +__attribute__((availability(macosx,introduced=10.0))) +__attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))) +int system(const char *) __asm("_" "system" ); + + + +size_t wcstombs(char * restrict, const wchar_t * restrict, size_t); +int wctomb(char *, wchar_t); + + +void _Exit(int) __attribute__((noreturn)); +long a64l(const char *); +double drand48(void); +char *ecvt(double, int, int *restrict, int *restrict); +double erand48(unsigned short[3]); +char *fcvt(double, int, int *restrict, int *restrict); +char *gcvt(double, int, char *); +int getsubopt(char **, char * const *, char **); +int grantpt(int); + +char *initstate(unsigned, char *, size_t); + + + +long jrand48(unsigned short[3]) __attribute__((__availability__(swift, unavailable, message="Use arc4random instead."))); +char *l64a(long); +void lcong48(unsigned short[7]); +long lrand48(void) __attribute__((__availability__(swift, unavailable, message="Use arc4random instead."))); +char *mktemp(char *); +int mkstemp(char *); +long mrand48(void) __attribute__((__availability__(swift, unavailable, message="Use arc4random instead."))); +long nrand48(unsigned short[3]) __attribute__((__availability__(swift, unavailable, message="Use arc4random instead."))); +int posix_openpt(int); +char *ptsname(int); +int putenv(char *) __asm("_" "putenv" ); +long random(void) __attribute__((__availability__(swift, unavailable, message="Use arc4random instead."))); +int rand_r(unsigned *) __attribute__((__availability__(swift, unavailable, message="Use arc4random instead."))); + +char *realpath(const char * restrict, char * restrict) __asm("_" "realpath" "$DARWIN_EXTSN"); + + + +unsigned short + *seed48(unsigned short[3]); +int setenv(const char * __name, const char * __value, int __overwrite) __asm("_" "setenv" ); + +void setkey(const char *) __asm("_" "setkey" ); + + + +char *setstate(const char *); +void srand48(long); + +void srandom(unsigned); + + + +int unlockpt(int); + +int unsetenv(const char *) __asm("_" "unsetenv" ); + + + + + + + +typedef unsigned char u_int8_t; +typedef unsigned short u_int16_t; +typedef unsigned int u_int32_t; +typedef unsigned long long u_int64_t; + + +typedef int64_t register_t; +typedef u_int64_t user_addr_t; +typedef u_int64_t user_size_t; +typedef int64_t user_ssize_t; +typedef int64_t user_long_t; +typedef u_int64_t user_ulong_t; +typedef int64_t user_time_t; +typedef int64_t user_off_t; + + + + + + + +typedef u_int64_t syscall_arg_t; + +typedef __darwin_dev_t dev_t; +typedef __darwin_mode_t mode_t; + + +uint32_t arc4random(void); +void arc4random_addrandom(unsigned char * , int ) + __attribute__((availability(macosx,introduced=10.0))) __attribute__((availability(macosx,deprecated=10.12,message="use arc4random_stir"))) + __attribute__((availability(ios,introduced=2.0))) __attribute__((availability(ios,deprecated=10.0,message="use arc4random_stir"))) + __attribute__((availability(tvos,introduced=2.0))) __attribute__((availability(tvos,deprecated=10.0,message="use arc4random_stir"))) + __attribute__((availability(watchos,introduced=1.0))) __attribute__((availability(watchos,deprecated=3.0,message="use arc4random_stir"))); +void arc4random_buf(void * __buf, size_t __nbytes) __attribute__((availability(macosx,introduced=10.7))); +void arc4random_stir(void); +uint32_t + arc4random_uniform(uint32_t __upper_bound) __attribute__((availability(macosx,introduced=10.7))); + +int atexit_b(void (^ _Nonnull)(void)) __attribute__((availability(macosx,introduced=10.6))); +void *bsearch_b(const void *__key, const void *__base, size_t __nel, + size_t __width, int (^ _Nonnull __compar)(const void *, const void *)) __attribute__((availability(macosx,introduced=10.6))); + + + +char *cgetcap(char *, const char *, int); +int cgetclose(void); +int cgetent(char **, char **, const char *); +int cgetfirst(char **, char **); +int cgetmatch(const char *, const char *); +int cgetnext(char **, char **); +int cgetnum(char *, const char *, long *); +int cgetset(const char *); +int cgetstr(char *, const char *, char **); +int cgetustr(char *, const char *, char **); + +int daemon(int, int) __asm("_" "daemon" "$1050") __attribute__((availability(macosx,introduced=10.0,deprecated=10.5,message="Use posix_spawn APIs instead."))) __attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))); +char *devname(dev_t, mode_t); +char *devname_r(dev_t, mode_t, char *buf, int len); +char *getbsize(int *, long *); +int getloadavg(double [], int); +const char + *getprogname(void); + +int heapsort(void *__base, size_t __nel, size_t __width, + int (* _Nonnull __compar)(const void *, const void *)); + +int heapsort_b(void *__base, size_t __nel, size_t __width, + int (^ _Nonnull __compar)(const void *, const void *)) __attribute__((availability(macosx,introduced=10.6))); + +int mergesort(void *__base, size_t __nel, size_t __width, + int (* _Nonnull __compar)(const void *, const void *)); + +int mergesort_b(void *__base, size_t __nel, size_t __width, + int (^ _Nonnull __compar)(const void *, const void *)) __attribute__((availability(macosx,introduced=10.6))); + +void psort(void *__base, size_t __nel, size_t __width, + int (* _Nonnull __compar)(const void *, const void *)) __attribute__((availability(macosx,introduced=10.6))); + +void psort_b(void *__base, size_t __nel, size_t __width, + int (^ _Nonnull __compar)(const void *, const void *)) __attribute__((availability(macosx,introduced=10.6))); + +void psort_r(void *__base, size_t __nel, size_t __width, void *, + int (* _Nonnull __compar)(void *, const void *, const void *)) __attribute__((availability(macosx,introduced=10.6))); + +void qsort_b(void *__base, size_t __nel, size_t __width, + int (^ _Nonnull __compar)(const void *, const void *)) __attribute__((availability(macosx,introduced=10.6))); + +void qsort_r(void *__base, size_t __nel, size_t __width, void *, + int (* _Nonnull __compar)(void *, const void *, const void *)); +int radixsort(const unsigned char **__base, int __nel, const unsigned char *__table, + unsigned __endbyte); +void setprogname(const char *); +int sradixsort(const unsigned char **__base, int __nel, const unsigned char *__table, + unsigned __endbyte); +void sranddev(void); +void srandomdev(void); +void *reallocf(void *__ptr, size_t __size); + +long long + strtoq(const char *__str, char **__endptr, int __base); +unsigned long long + strtouq(const char *__str, char **__endptr, int __base); + +extern char *suboptarg; +void *valloc(size_t); + typedef float float_t; + typedef double double_t; +extern int __math_errhandling(void); +extern int __fpclassifyf(float); +extern int __fpclassifyd(double); +extern int __fpclassifyl(long double); +inline __attribute__ ((__always_inline__)) int __inline_isfinitef(float); +inline __attribute__ ((__always_inline__)) int __inline_isfinited(double); +inline __attribute__ ((__always_inline__)) int __inline_isfinitel(long double); +inline __attribute__ ((__always_inline__)) int __inline_isinff(float); +inline __attribute__ ((__always_inline__)) int __inline_isinfd(double); +inline __attribute__ ((__always_inline__)) int __inline_isinfl(long double); +inline __attribute__ ((__always_inline__)) int __inline_isnanf(float); +inline __attribute__ ((__always_inline__)) int __inline_isnand(double); +inline __attribute__ ((__always_inline__)) int __inline_isnanl(long double); +inline __attribute__ ((__always_inline__)) int __inline_isnormalf(float); +inline __attribute__ ((__always_inline__)) int __inline_isnormald(double); +inline __attribute__ ((__always_inline__)) int __inline_isnormall(long double); +inline __attribute__ ((__always_inline__)) int __inline_signbitf(float); +inline __attribute__ ((__always_inline__)) int __inline_signbitd(double); +inline __attribute__ ((__always_inline__)) int __inline_signbitl(long double); + +inline __attribute__ ((__always_inline__)) int __inline_isfinitef(float __x) { + return __x == __x && __builtin_fabsf(__x) != __builtin_inff(); +} +inline __attribute__ ((__always_inline__)) int __inline_isfinited(double __x) { + return __x == __x && __builtin_fabs(__x) != __builtin_inf(); +} +inline __attribute__ ((__always_inline__)) int __inline_isfinitel(long double __x) { + return __x == __x && __builtin_fabsl(__x) != __builtin_infl(); +} +inline __attribute__ ((__always_inline__)) int __inline_isinff(float __x) { + return __builtin_fabsf(__x) == __builtin_inff(); +} +inline __attribute__ ((__always_inline__)) int __inline_isinfd(double __x) { + return __builtin_fabs(__x) == __builtin_inf(); +} +inline __attribute__ ((__always_inline__)) int __inline_isinfl(long double __x) { + return __builtin_fabsl(__x) == __builtin_infl(); +} +inline __attribute__ ((__always_inline__)) int __inline_isnanf(float __x) { + return __x != __x; +} +inline __attribute__ ((__always_inline__)) int __inline_isnand(double __x) { + return __x != __x; +} +inline __attribute__ ((__always_inline__)) int __inline_isnanl(long double __x) { + return __x != __x; +} +inline __attribute__ ((__always_inline__)) int __inline_signbitf(float __x) { + union { float __f; unsigned int __u; } __u; + __u.__f = __x; + return (int)(__u.__u >> 31); +} +inline __attribute__ ((__always_inline__)) int __inline_signbitd(double __x) { + union { double __f; unsigned long long __u; } __u; + __u.__f = __x; + return (int)(__u.__u >> 63); +} + +inline __attribute__ ((__always_inline__)) int __inline_signbitl(long double __x) { + union { + long double __ld; + struct{ unsigned long long __m; unsigned short __sexp; } __p; + } __u; + __u.__ld = __x; + return (int)(__u.__p.__sexp >> 15); +} + + + + + + + +inline __attribute__ ((__always_inline__)) int __inline_isnormalf(float __x) { + return __inline_isfinitef(__x) && __builtin_fabsf(__x) >= 1.17549435e-38F; +} +inline __attribute__ ((__always_inline__)) int __inline_isnormald(double __x) { + return __inline_isfinited(__x) && __builtin_fabs(__x) >= 2.2250738585072014e-308; +} +inline __attribute__ ((__always_inline__)) int __inline_isnormall(long double __x) { + return __inline_isfinitel(__x) && __builtin_fabsl(__x) >= 3.36210314311209350626e-4932L; +} +extern float acosf(float); +extern double acos(double); +extern long double acosl(long double); + +extern float asinf(float); +extern double asin(double); +extern long double asinl(long double); + +extern float atanf(float); +extern double atan(double); +extern long double atanl(long double); + +extern float atan2f(float, float); +extern double atan2(double, double); +extern long double atan2l(long double, long double); + +extern float cosf(float); +extern double cos(double); +extern long double cosl(long double); + +extern float sinf(float); +extern double sin(double); +extern long double sinl(long double); + +extern float tanf(float); +extern double tan(double); +extern long double tanl(long double); + +extern float acoshf(float); +extern double acosh(double); +extern long double acoshl(long double); + +extern float asinhf(float); +extern double asinh(double); +extern long double asinhl(long double); + +extern float atanhf(float); +extern double atanh(double); +extern long double atanhl(long double); + +extern float coshf(float); +extern double cosh(double); +extern long double coshl(long double); + +extern float sinhf(float); +extern double sinh(double); +extern long double sinhl(long double); + +extern float tanhf(float); +extern double tanh(double); +extern long double tanhl(long double); + +extern float expf(float); +extern double exp(double); +extern long double expl(long double); + +extern float exp2f(float); +extern double exp2(double); +extern long double exp2l(long double); + +extern float expm1f(float); +extern double expm1(double); +extern long double expm1l(long double); + +extern float logf(float); +extern double log(double); +extern long double logl(long double); + +extern float log10f(float); +extern double log10(double); +extern long double log10l(long double); + +extern float log2f(float); +extern double log2(double); +extern long double log2l(long double); + +extern float log1pf(float); +extern double log1p(double); +extern long double log1pl(long double); + +extern float logbf(float); +extern double logb(double); +extern long double logbl(long double); + +extern float modff(float, float *); +extern double modf(double, double *); +extern long double modfl(long double, long double *); + +extern float ldexpf(float, int); +extern double ldexp(double, int); +extern long double ldexpl(long double, int); + +extern float frexpf(float, int *); +extern double frexp(double, int *); +extern long double frexpl(long double, int *); + +extern int ilogbf(float); +extern int ilogb(double); +extern int ilogbl(long double); + +extern float scalbnf(float, int); +extern double scalbn(double, int); +extern long double scalbnl(long double, int); + +extern float scalblnf(float, long int); +extern double scalbln(double, long int); +extern long double scalblnl(long double, long int); + +extern float fabsf(float); +extern double fabs(double); +extern long double fabsl(long double); + +extern float cbrtf(float); +extern double cbrt(double); +extern long double cbrtl(long double); + +extern float hypotf(float, float); +extern double hypot(double, double); +extern long double hypotl(long double, long double); + +extern float powf(float, float); +extern double pow(double, double); +extern long double powl(long double, long double); + +extern float sqrtf(float); +extern double sqrt(double); +extern long double sqrtl(long double); + +extern float erff(float); +extern double erf(double); +extern long double erfl(long double); + +extern float erfcf(float); +extern double erfc(double); +extern long double erfcl(long double); + + + + +extern float lgammaf(float); +extern double lgamma(double); +extern long double lgammal(long double); + +extern float tgammaf(float); +extern double tgamma(double); +extern long double tgammal(long double); + +extern float ceilf(float); +extern double ceil(double); +extern long double ceill(long double); + +extern float floorf(float); +extern double floor(double); +extern long double floorl(long double); + +extern float nearbyintf(float); +extern double nearbyint(double); +extern long double nearbyintl(long double); + +extern float rintf(float); +extern double rint(double); +extern long double rintl(long double); + +extern long int lrintf(float); +extern long int lrint(double); +extern long int lrintl(long double); + +extern float roundf(float); +extern double round(double); +extern long double roundl(long double); + +extern long int lroundf(float); +extern long int lround(double); +extern long int lroundl(long double); + + + + +extern long long int llrintf(float); +extern long long int llrint(double); +extern long long int llrintl(long double); + +extern long long int llroundf(float); +extern long long int llround(double); +extern long long int llroundl(long double); + + +extern float truncf(float); +extern double trunc(double); +extern long double truncl(long double); + +extern float fmodf(float, float); +extern double fmod(double, double); +extern long double fmodl(long double, long double); + +extern float remainderf(float, float); +extern double remainder(double, double); +extern long double remainderl(long double, long double); + +extern float remquof(float, float, int *); +extern double remquo(double, double, int *); +extern long double remquol(long double, long double, int *); + +extern float copysignf(float, float); +extern double copysign(double, double); +extern long double copysignl(long double, long double); + +extern float nanf(const char *); +extern double nan(const char *); +extern long double nanl(const char *); + +extern float nextafterf(float, float); +extern double nextafter(double, double); +extern long double nextafterl(long double, long double); + +extern double nexttoward(double, long double); +extern float nexttowardf(float, long double); +extern long double nexttowardl(long double, long double); + +extern float fdimf(float, float); +extern double fdim(double, double); +extern long double fdiml(long double, long double); + +extern float fmaxf(float, float); +extern double fmax(double, double); +extern long double fmaxl(long double, long double); + +extern float fminf(float, float); +extern double fmin(double, double); +extern long double fminl(long double, long double); + +extern float fmaf(float, float, float); +extern double fma(double, double, double); +extern long double fmal(long double, long double, long double); +extern float __inff(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); +extern double __inf(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); +extern long double __infl(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); + +extern float __nan(void) __attribute__((availability(macosx,introduced=10.0))); +extern float __exp10f(float) __attribute__((availability(macosx,introduced=10.9))); +extern double __exp10(double) __attribute__((availability(macosx,introduced=10.9))); + + + + + +inline __attribute__ ((__always_inline__)) void __sincosf(float __x, float *__sinp, float *__cosp); +inline __attribute__ ((__always_inline__)) void __sincos(double __x, double *__sinp, double *__cosp); +extern float __cospif(float) __attribute__((availability(macosx,introduced=10.9))); +extern double __cospi(double) __attribute__((availability(macosx,introduced=10.9))); +extern float __sinpif(float) __attribute__((availability(macosx,introduced=10.9))); +extern double __sinpi(double) __attribute__((availability(macosx,introduced=10.9))); +extern float __tanpif(float) __attribute__((availability(macosx,introduced=10.9))); +extern double __tanpi(double) __attribute__((availability(macosx,introduced=10.9))); +inline __attribute__ ((__always_inline__)) void __sincospif(float __x, float *__sinp, float *__cosp); +inline __attribute__ ((__always_inline__)) void __sincospi(double __x, double *__sinp, double *__cosp); + + + + + + +struct __float2 { float __sinval; float __cosval; }; +struct __double2 { double __sinval; double __cosval; }; + +extern struct __float2 __sincosf_stret(float); +extern struct __double2 __sincos_stret(double); +extern struct __float2 __sincospif_stret(float); +extern struct __double2 __sincospi_stret(double); + +inline __attribute__ ((__always_inline__)) void __sincosf(float __x, float *__sinp, float *__cosp) { + const struct __float2 __stret = __sincosf_stret(__x); + *__sinp = __stret.__sinval; *__cosp = __stret.__cosval; +} + +inline __attribute__ ((__always_inline__)) void __sincos(double __x, double *__sinp, double *__cosp) { + const struct __double2 __stret = __sincos_stret(__x); + *__sinp = __stret.__sinval; *__cosp = __stret.__cosval; +} + +inline __attribute__ ((__always_inline__)) void __sincospif(float __x, float *__sinp, float *__cosp) { + const struct __float2 __stret = __sincospif_stret(__x); + *__sinp = __stret.__sinval; *__cosp = __stret.__cosval; +} + +inline __attribute__ ((__always_inline__)) void __sincospi(double __x, double *__sinp, double *__cosp) { + const struct __double2 __stret = __sincospi_stret(__x); + *__sinp = __stret.__sinval; *__cosp = __stret.__cosval; +} + + + + + + + +extern double j0(double) __attribute__((availability(macosx,introduced=10.0))); +extern double j1(double) __attribute__((availability(macosx,introduced=10.0))); +extern double jn(int, double) __attribute__((availability(macosx,introduced=10.0))); +extern double y0(double) __attribute__((availability(macosx,introduced=10.0))); +extern double y1(double) __attribute__((availability(macosx,introduced=10.0))); +extern double yn(int, double) __attribute__((availability(macosx,introduced=10.0))); +extern double scalb(double, double); +extern int signgam; +extern long int rinttol(double) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); + +extern long int roundtol(double) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); + +extern double drem(double, double) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); + +extern int finite(double) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); + +extern double gamma(double) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); + +extern double significand(double) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); + + +struct exception { + int type; + char *name; + double arg1; + double arg2; + double retval; +}; + +extern int matherr(struct exception *) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); + void cpMessage(const char *condition, const char *file, int line, int isError, int isHardError, const char *message, ...); + + + +typedef unsigned char u_char; +typedef unsigned short u_short; +typedef unsigned int u_int; + +typedef unsigned long u_long; + + +typedef unsigned short ushort; +typedef unsigned int uint; + + +typedef u_int64_t u_quad_t; +typedef int64_t quad_t; +typedef quad_t * qaddr_t; + +typedef char * caddr_t; +typedef int32_t daddr_t; + + + +typedef u_int32_t fixpt_t; + + +typedef __darwin_blkcnt_t blkcnt_t; +typedef __darwin_blksize_t blksize_t; +typedef __darwin_gid_t gid_t; +typedef __uint32_t in_addr_t; +typedef __uint16_t in_port_t; +typedef __darwin_ino_t ino_t; + + +typedef __darwin_ino64_t ino64_t; + + +typedef __int32_t key_t; + +typedef __uint16_t nlink_t; + + +typedef __darwin_off_t off_t; + +typedef int32_t segsz_t; +typedef int32_t swblk_t; +typedef __darwin_clock_t clock_t; + +typedef __darwin_ssize_t ssize_t; +typedef __darwin_time_t time_t; + +typedef __darwin_useconds_t useconds_t; +typedef __darwin_suseconds_t suseconds_t; + + +typedef __darwin_size_t rsize_t; +typedef int errno_t; + + + + + + + + +typedef struct fd_set { + __int32_t fds_bits[((((1024) % ((sizeof(__int32_t) * 8))) == 0) ? ((1024) / ((sizeof(__int32_t) * 8))) : (((1024) / ((sizeof(__int32_t) * 8))) + 1))]; +} fd_set; + + + +static __inline int +__darwin_fd_isset(int _n, const struct fd_set *_p) +{ + return (_p->fds_bits[(unsigned long)_n/(sizeof(__int32_t) * 8)] & ((__int32_t)(((unsigned long)1)<<((unsigned long)_n % (sizeof(__int32_t) * 8))))); +} + + + + +typedef __int32_t fd_mask; + + + + + + + + + + +typedef __darwin_pthread_cond_t pthread_cond_t; +typedef __darwin_pthread_condattr_t pthread_condattr_t; +typedef __darwin_pthread_mutex_t pthread_mutex_t; +typedef __darwin_pthread_mutexattr_t pthread_mutexattr_t; +typedef __darwin_pthread_once_t pthread_once_t; +typedef __darwin_pthread_rwlock_t pthread_rwlock_t; +typedef __darwin_pthread_rwlockattr_t pthread_rwlockattr_t; +typedef __darwin_pthread_t pthread_t; + + + +typedef __darwin_pthread_key_t pthread_key_t; + + + + +typedef __darwin_fsblkcnt_t fsblkcnt_t; +typedef __darwin_fsfilcnt_t fsfilcnt_t; +typedef __builtin_va_list va_list; +typedef __builtin_va_list __gnuc_va_list; +void __assert_rtn(const char *, const char *, int, const char *) __attribute__((noreturn)); +typedef __darwin_wint_t wint_t; +typedef struct { + __darwin_rune_t __min; + __darwin_rune_t __max; + __darwin_rune_t __map; + __uint32_t *__types; +} _RuneEntry; + +typedef struct { + int __nranges; + _RuneEntry *__ranges; +} _RuneRange; + +typedef struct { + char __name[14]; + __uint32_t __mask; +} _RuneCharClass; + +typedef struct { + char __magic[8]; + char __encoding[32]; + + __darwin_rune_t (*__sgetrune)(const char *, __darwin_size_t, char const **); + int (*__sputrune)(__darwin_rune_t, char *, __darwin_size_t, char **); + __darwin_rune_t __invalid_rune; + + __uint32_t __runetype[(1 <<8 )]; + __darwin_rune_t __maplower[(1 <<8 )]; + __darwin_rune_t __mapupper[(1 <<8 )]; + + + + + + + _RuneRange __runetype_ext; + _RuneRange __maplower_ext; + _RuneRange __mapupper_ext; + + void *__variable; + int __variable_len; + + + + + int __ncharclasses; + _RuneCharClass *__charclasses; +} _RuneLocale; + + + + +extern _RuneLocale _DefaultRuneLocale; +extern _RuneLocale *_CurrentRuneLocale; +unsigned long ___runetype(__darwin_ct_rune_t); +__darwin_ct_rune_t ___tolower(__darwin_ct_rune_t); +__darwin_ct_rune_t ___toupper(__darwin_ct_rune_t); + + +inline int +isascii(int _c) +{ + return ((_c & ~0x7F) == 0); +} +int __maskrune(__darwin_ct_rune_t, unsigned long); + + + +inline int +__istype(__darwin_ct_rune_t _c, unsigned long _f) +{ + + + + return (isascii(_c) ? !!(_DefaultRuneLocale.__runetype[_c] & _f) + : !!__maskrune(_c, _f)); + +} + +inline __darwin_ct_rune_t +__isctype(__darwin_ct_rune_t _c, unsigned long _f) +{ + + + + return (_c < 0 || _c >= (1 <<8 )) ? 0 : + !!(_DefaultRuneLocale.__runetype[_c] & _f); + +} +__darwin_ct_rune_t __toupper(__darwin_ct_rune_t); +__darwin_ct_rune_t __tolower(__darwin_ct_rune_t); + + + +inline int +__wcwidth(__darwin_ct_rune_t _c) +{ + unsigned int _x; + + if (_c == 0) + return (0); + _x = (unsigned int)__maskrune(_c, 0xe0000000L|0x00040000L); + if ((_x & 0xe0000000L) != 0) + return ((_x & 0xe0000000L) >> 30); + return ((_x & 0x00040000L) != 0 ? 1 : -1); +} + + + + + + +inline int +isalnum(int _c) +{ + return (__istype(_c, 0x00000100L|0x00000400L)); +} + +inline int +isalpha(int _c) +{ + return (__istype(_c, 0x00000100L)); +} + +inline int +isblank(int _c) +{ + return (__istype(_c, 0x00020000L)); +} + +inline int +iscntrl(int _c) +{ + return (__istype(_c, 0x00000200L)); +} + + +inline int +isdigit(int _c) +{ + return (__isctype(_c, 0x00000400L)); +} + +inline int +isgraph(int _c) +{ + return (__istype(_c, 0x00000800L)); +} + +inline int +islower(int _c) +{ + return (__istype(_c, 0x00001000L)); +} + +inline int +isprint(int _c) +{ + return (__istype(_c, 0x00040000L)); +} + +inline int +ispunct(int _c) +{ + return (__istype(_c, 0x00002000L)); +} + +inline int +isspace(int _c) +{ + return (__istype(_c, 0x00004000L)); +} + +inline int +isupper(int _c) +{ + return (__istype(_c, 0x00008000L)); +} + + +inline int +isxdigit(int _c) +{ + return (__isctype(_c, 0x00010000L)); +} + +inline int +toascii(int _c) +{ + return (_c & 0x7F); +} + +inline int +tolower(int _c) +{ + return (__tolower(_c)); +} + +inline int +toupper(int _c) +{ + return (__toupper(_c)); +} + + +inline int +digittoint(int _c) +{ + return (__maskrune(_c, 0x0F)); +} + +inline int +ishexnumber(int _c) +{ + return (__istype(_c, 0x00010000L)); +} + +inline int +isideogram(int _c) +{ + return (__istype(_c, 0x00080000L)); +} + +inline int +isnumber(int _c) +{ + return (__istype(_c, 0x00000400L)); +} + +inline int +isphonogram(int _c) +{ + return (__istype(_c, 0x00200000L)); +} + +inline int +isrune(int _c) +{ + return (__istype(_c, 0xFFFFFFF0L)); +} + +inline int +isspecial(int _c) +{ + return (__istype(_c, 0x00100000L)); +} +extern int * __error(void); + + + + + + +struct lconv { + char *decimal_point; + char *thousands_sep; + char *grouping; + char *int_curr_symbol; + char *currency_symbol; + char *mon_decimal_point; + char *mon_thousands_sep; + char *mon_grouping; + char *positive_sign; + char *negative_sign; + char int_frac_digits; + char frac_digits; + char p_cs_precedes; + char p_sep_by_space; + char n_cs_precedes; + char n_sep_by_space; + char p_sign_posn; + char n_sign_posn; + char int_p_cs_precedes; + char int_n_cs_precedes; + char int_p_sep_by_space; + char int_n_sep_by_space; + char int_p_sign_posn; + char int_n_sign_posn; +}; + + + + +struct lconv *localeconv(void); +char *setlocale(int, const char *); + +typedef int jmp_buf[((9 * 2) + 3 + 16)]; +typedef int sigjmp_buf[((9 * 2) + 3 + 16) + 1]; +extern int setjmp(jmp_buf); +extern void longjmp(jmp_buf, int) __attribute__((noreturn)); + + +int _setjmp(jmp_buf); +void _longjmp(jmp_buf, int) __attribute__((noreturn)); +int sigsetjmp(sigjmp_buf, int); +void siglongjmp(sigjmp_buf, int) __attribute__((noreturn)); + + + +void longjmperror(void); +extern const char *const sys_signame[32]; +extern const char *const sys_siglist[32]; + + + +int raise(int); + + + + +void (* _Nullable bsd_signal(int, void (* _Nullable)(int)))(int); +int kill(pid_t, int) __asm("_" "kill" ); +int killpg(pid_t, int) __asm("_" "killpg" ); +int pthread_kill(pthread_t, int); +int pthread_sigmask(int, const sigset_t *, sigset_t *) __asm("_" "pthread_sigmask" ); +int sigaction(int, const struct sigaction * restrict, + struct sigaction * restrict); +int sigaddset(sigset_t *, int); +int sigaltstack(const stack_t * restrict, stack_t * restrict) __asm("_" "sigaltstack" ) __attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))); +int sigdelset(sigset_t *, int); +int sigemptyset(sigset_t *); +int sigfillset(sigset_t *); +int sighold(int); +int sigignore(int); +int siginterrupt(int, int); +int sigismember(const sigset_t *, int); +int sigpause(int) __asm("_" "sigpause" ); +int sigpending(sigset_t *); +int sigprocmask(int, const sigset_t * restrict, sigset_t * restrict); +int sigrelse(int); +void (* _Nullable sigset(int, void (* _Nullable)(int)))(int); +int sigsuspend(const sigset_t *) __asm("_" "sigsuspend" ); +int sigwait(const sigset_t * restrict, int * restrict) __asm("_" "sigwait" ); + +void psignal(unsigned int, const char *); +int sigblock(int); +int sigsetmask(int); +int sigvec(int, struct sigvec *, struct sigvec *); + + + + + + +inline __attribute__ ((__always_inline__)) int +__sigbits(int __signo) +{ + return __signo > 32 ? 0 : (1 << (__signo - 1)); +} +typedef long int ptrdiff_t; +typedef long double max_align_t; +typedef __darwin_va_list va_list; + + + +int renameat(int, const char *, int, const char *) __attribute__((availability(macosx,introduced=10.10))); + + + + + + +int renamex_np(const char *, const char *, unsigned int) __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +int renameatx_np(int, const char *, int, const char *, unsigned int) __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); + +typedef __darwin_off_t fpos_t; +struct __sbuf { + unsigned char *_base; + int _size; +}; + + +struct __sFILEX; +typedef struct __sFILE { + unsigned char *_p; + int _r; + int _w; + short _flags; + short _file; + struct __sbuf _bf; + int _lbfsize; + + + void *_cookie; + int (* _Nullable _close)(void *); + int (* _Nullable _read) (void *, char *, int); + fpos_t (* _Nullable _seek) (void *, fpos_t, int); + int (* _Nullable _write)(void *, const char *, int); + + + struct __sbuf _ub; + struct __sFILEX *_extra; + int _ur; + + + unsigned char _ubuf[3]; + unsigned char _nbuf[1]; + + + struct __sbuf _lb; + + + int _blksize; + fpos_t _offset; +} FILE; + + +extern FILE *__stdinp; +extern FILE *__stdoutp; +extern FILE *__stderrp; +void clearerr(FILE *); +int fclose(FILE *); +int feof(FILE *); +int ferror(FILE *); +int fflush(FILE *); +int fgetc(FILE *); +int fgetpos(FILE * restrict, fpos_t *); +char *fgets(char * restrict, int, FILE *); + + + +FILE *fopen(const char * restrict __filename, const char * restrict __mode) __asm("_" "fopen" ); + +int fprintf(FILE * restrict, const char * restrict, ...) __attribute__((__format__ (__printf__, 2, 3))); +int fputc(int, FILE *); +int fputs(const char * restrict, FILE * restrict) __asm("_" "fputs" ); +size_t fread(void * restrict __ptr, size_t __size, size_t __nitems, FILE * restrict __stream); +FILE *freopen(const char * restrict, const char * restrict, + FILE * restrict) __asm("_" "freopen" ); +int fscanf(FILE * restrict, const char * restrict, ...) __attribute__((__format__ (__scanf__, 2, 3))); +int fseek(FILE *, long, int); +int fsetpos(FILE *, const fpos_t *); +long ftell(FILE *); +size_t fwrite(const void * restrict __ptr, size_t __size, size_t __nitems, FILE * restrict __stream) __asm("_" "fwrite" ); +int getc(FILE *); +int getchar(void); +char *gets(char *); +void perror(const char *); +int printf(const char * restrict, ...) __attribute__((__format__ (__printf__, 1, 2))); +int putc(int, FILE *); +int putchar(int); +int puts(const char *); +int remove(const char *); +int rename (const char *__old, const char *__new); +void rewind(FILE *); +int scanf(const char * restrict, ...) __attribute__((__format__ (__scanf__, 1, 2))); +void setbuf(FILE * restrict, char * restrict); +int setvbuf(FILE * restrict, char * restrict, int, size_t); +int sprintf(char * restrict, const char * restrict, ...) __attribute__((__format__ (__printf__, 2, 3))) __attribute__((__availability__(swift, unavailable, message="Use snprintf instead."))); +int sscanf(const char * restrict, const char * restrict, ...) __attribute__((__format__ (__scanf__, 2, 3))); +FILE *tmpfile(void); + +__attribute__((__availability__(swift, unavailable, message="Use mkstemp(3) instead."))) + +__attribute__((deprecated("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead."))) + +char *tmpnam(char *); +int ungetc(int, FILE *); +int vfprintf(FILE * restrict, const char * restrict, va_list) __attribute__((__format__ (__printf__, 2, 0))); +int vprintf(const char * restrict, va_list) __attribute__((__format__ (__printf__, 1, 0))); +int vsprintf(char * restrict, const char * restrict, va_list) __attribute__((__format__ (__printf__, 2, 0))) __attribute__((__availability__(swift, unavailable, message="Use vsnprintf instead."))); +char *ctermid(char *); + + + + + +FILE *fdopen(int, const char *) __asm("_" "fdopen" ); + +int fileno(FILE *); +int pclose(FILE *) __attribute__((__availability__(swift, unavailable, message="Use posix_spawn APIs or NSTask instead."))); + + + +FILE *popen(const char *, const char *) __asm("_" "popen" ) __attribute__((__availability__(swift, unavailable, message="Use posix_spawn APIs or NSTask instead."))); +int __srget(FILE *); +int __svfscanf(FILE *, const char *, va_list) __attribute__((__format__ (__scanf__, 2, 0))); +int __swbuf(int, FILE *); +inline __attribute__ ((__always_inline__)) int __sputc(int _c, FILE *_p) { + if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n')) + return (*_p->_p++ = _c); + else + return (__swbuf(_c, _p)); +} +void flockfile(FILE *); +int ftrylockfile(FILE *); +void funlockfile(FILE *); +int getc_unlocked(FILE *); +int getchar_unlocked(void); +int putc_unlocked(int, FILE *); +int putchar_unlocked(int); + + + +int getw(FILE *); +int putw(int, FILE *); + + +__attribute__((__availability__(swift, unavailable, message="Use mkstemp(3) instead."))) + +__attribute__((deprecated("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tempnam(3), it is highly recommended that you use mkstemp(3) instead."))) + +char *tempnam(const char *__dir, const char *__prefix) __asm("_" "tempnam" ); +int fseeko(FILE * __stream, off_t __offset, int __whence); +off_t ftello(FILE * __stream); + + + + + +int snprintf(char * restrict __str, size_t __size, const char * restrict __format, ...) __attribute__((__format__ (__printf__, 3, 4))); +int vfscanf(FILE * restrict __stream, const char * restrict __format, va_list) __attribute__((__format__ (__scanf__, 2, 0))); +int vscanf(const char * restrict __format, va_list) __attribute__((__format__ (__scanf__, 1, 0))); +int vsnprintf(char * restrict __str, size_t __size, const char * restrict __format, va_list) __attribute__((__format__ (__printf__, 3, 0))); +int vsscanf(const char * restrict __str, const char * restrict __format, va_list) __attribute__((__format__ (__scanf__, 2, 0))); +int dprintf(int, const char * restrict, ...) __attribute__((__format__ (__printf__, 2, 3))) __attribute__((availability(macosx,introduced=10.7))); +int vdprintf(int, const char * restrict, va_list) __attribute__((__format__ (__printf__, 2, 0))) __attribute__((availability(macosx,introduced=10.7))); +ssize_t getdelim(char ** restrict __linep, size_t * restrict __linecapp, int __delimiter, FILE * restrict __stream) __attribute__((availability(macosx,introduced=10.7))); +ssize_t getline(char ** restrict __linep, size_t * restrict __linecapp, FILE * restrict __stream) __attribute__((availability(macosx,introduced=10.7))); +extern const int sys_nerr; +extern const char *const sys_errlist[]; + +int asprintf(char ** restrict, const char * restrict, ...) __attribute__((__format__ (__printf__, 2, 3))); +char *ctermid_r(char *); +char *fgetln(FILE *, size_t *); +const char *fmtcheck(const char *, const char *); +int fpurge(FILE *); +void setbuffer(FILE *, char *, int); +int setlinebuf(FILE *); +int vasprintf(char ** restrict, const char * restrict, va_list) __attribute__((__format__ (__printf__, 2, 0))); +FILE *zopen(const char *, const char *, int); + + + + + +FILE *funopen(const void *, + int (* _Nullable)(void *, char *, int), + int (* _Nullable)(void *, const char *, int), + fpos_t (* _Nullable)(void *, fpos_t, int), + int (* _Nullable)(void *)); +extern int __sprintf_chk (char * restrict, int, size_t, + const char * restrict, ...); +extern int __snprintf_chk (char * restrict, size_t, int, size_t, + const char * restrict, ...); + + + + + + + +extern int __vsprintf_chk (char * restrict, int, size_t, + const char * restrict, va_list); + + + + + + + +extern int __vsnprintf_chk (char * restrict, size_t, int, size_t, + const char * restrict, va_list); + +void *memchr(const void *__s, int __c, size_t __n); +int memcmp(const void *__s1, const void *__s2, size_t __n); +void *memcpy(void *__dst, const void *__src, size_t __n); +void *memmove(void *__dst, const void *__src, size_t __len); +void *memset(void *__b, int __c, size_t __len); +char *strcat(char *__s1, const char *__s2); +char *strchr(const char *__s, int __c); +int strcmp(const char *__s1, const char *__s2); +int strcoll(const char *__s1, const char *__s2); +char *strcpy(char *__dst, const char *__src); +size_t strcspn(const char *__s, const char *__charset); +char *strerror(int __errnum) __asm("_" "strerror" ); +size_t strlen(const char *__s); +char *strncat(char *__s1, const char *__s2, size_t __n); +int strncmp(const char *__s1, const char *__s2, size_t __n); +char *strncpy(char *__dst, const char *__src, size_t __n); +char *strpbrk(const char *__s, const char *__charset); +char *strrchr(const char *__s, int __c); +size_t strspn(const char *__s, const char *__charset); +char *strstr(const char *__big, const char *__little); +char *strtok(char *__str, const char *__sep); +size_t strxfrm(char *__s1, const char *__s2, size_t __n); +char *strtok_r(char *__str, const char *__sep, char **__lasts); +int strerror_r(int __errnum, char *__strerrbuf, size_t __buflen); +char *strdup(const char *__s1); +void *memccpy(void *__dst, const void *__src, int __c, size_t __n); +char *stpcpy(char *__dst, const char *__src); +char *stpncpy(char *__dst, const char *__src, size_t __n) __attribute__((availability(macosx,introduced=10.7))); +char *strndup(const char *__s1, size_t __n) __attribute__((availability(macosx,introduced=10.7))); +size_t strnlen(const char *__s1, size_t __n) __attribute__((availability(macosx,introduced=10.7))); +char *strsignal(int __sig); +errno_t memset_s(void *__s, rsize_t __smax, int __c, rsize_t __n) __attribute__((availability(macosx,introduced=10.9))); +void *memmem(const void *__big, size_t __big_len, const void *__little, size_t __little_len) __attribute__((availability(macosx,introduced=10.7))); +void memset_pattern4(void *__b, const void *__pattern4, size_t __len) __attribute__((availability(macosx,introduced=10.5))); +void memset_pattern8(void *__b, const void *__pattern8, size_t __len) __attribute__((availability(macosx,introduced=10.5))); +void memset_pattern16(void *__b, const void *__pattern16, size_t __len) __attribute__((availability(macosx,introduced=10.5))); + +char *strcasestr(const char *__big, const char *__little); +char *strnstr(const char *__big, const char *__little, size_t __len); +size_t strlcat(char *__dst, const char *__source, size_t __size); +size_t strlcpy(char *__dst, const char *__source, size_t __size); +void strmode(int __mode, char *__bp); +char *strsep(char **__stringp, const char *__delim); + + +void swab(const void * restrict, void * restrict, ssize_t); + + +__attribute__((availability(macosx,introduced=10.12.1))) __attribute__((availability(ios,introduced=10.1))) +__attribute__((availability(tvos,introduced=10.0.1))) __attribute__((availability(watchos,introduced=3.1))) + +int timingsafe_bcmp(const void *__b1, const void *__b2, size_t __len); + + + + + + + + +int bcmp(const void *, const void *, size_t) ; +void bcopy(const void *, void *, size_t) ; +void bzero(void *, size_t) ; +char *index(const char *, int) ; +char *rindex(const char *, int) ; + + +int ffs(int); +int strcasecmp(const char *, const char *); +int strncasecmp(const char *, const char *, size_t); + + + + + +int ffsl(long) __attribute__((availability(macosx,introduced=10.5))); +int ffsll(long long) __attribute__((availability(macosx,introduced=10.9))); +int fls(int) __attribute__((availability(macosx,introduced=10.5))); +int flsl(long) __attribute__((availability(macosx,introduced=10.5))); +int flsll(long long) __attribute__((availability(macosx,introduced=10.9))); + + + +struct timespec +{ + __darwin_time_t tv_sec; + long tv_nsec; +}; + +struct tm { + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; + int tm_yday; + int tm_isdst; + long tm_gmtoff; + char *tm_zone; +}; +extern char *tzname[]; + + +extern int getdate_err; + +extern long timezone __asm("_" "timezone" ); + +extern int daylight; + + +char *asctime(const struct tm *); +clock_t clock(void) __asm("_" "clock" ); +char *ctime(const time_t *); +double difftime(time_t, time_t); +struct tm *getdate(const char *); +struct tm *gmtime(const time_t *); +struct tm *localtime(const time_t *); +time_t mktime(struct tm *) __asm("_" "mktime" ); +size_t strftime(char * restrict, size_t, const char * restrict, const struct tm * restrict) __asm("_" "strftime" ); +char *strptime(const char * restrict, const char * restrict, struct tm * restrict) __asm("_" "strptime" ); +time_t time(time_t *); + + +void tzset(void); + + + +char *asctime_r(const struct tm * restrict, char * restrict); +char *ctime_r(const time_t *, char *); +struct tm *gmtime_r(const time_t * restrict, struct tm * restrict); +struct tm *localtime_r(const time_t * restrict, struct tm * restrict); + + +time_t posix2time(time_t); + + + +void tzsetwall(void); +time_t time2posix(time_t); +time_t timelocal(struct tm * const); +time_t timegm(struct tm * const); + + + +int nanosleep(const struct timespec *__rqtp, struct timespec *__rmtp) __asm("_" "nanosleep" ); +typedef enum { +_CLOCK_REALTIME __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) = 0, + +_CLOCK_MONOTONIC __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) = 6, + + +_CLOCK_MONOTONIC_RAW __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) = 4, + +_CLOCK_MONOTONIC_RAW_APPROX __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) = 5, + +_CLOCK_UPTIME_RAW __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) = 8, + +_CLOCK_UPTIME_RAW_APPROX __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) = 9, + + +_CLOCK_PROCESS_CPUTIME_ID __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) = 12, + +_CLOCK_THREAD_CPUTIME_ID __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) = 16 + +} clockid_t; + +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) +int clock_getres(clockid_t __clock_id, struct timespec *__res); + +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) +int clock_gettime(clockid_t __clock_id, struct timespec *__tp); + + +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) +__uint64_t clock_gettime_nsec_np(clockid_t __clock_id); + + +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,unavailable))) +__attribute__((availability(tvos,unavailable))) __attribute__((availability(watchos,unavailable))) +int clock_settime(clockid_t __clock_id, const struct timespec *__tp); + + + + + + + + + +__attribute__((availability(macosx,introduced=10.4))) +extern intmax_t +imaxabs(intmax_t j); + + +typedef struct { + intmax_t quot; + intmax_t rem; +} imaxdiv_t; + +__attribute__((availability(macosx,introduced=10.4))) +extern imaxdiv_t +imaxdiv(intmax_t __numer, intmax_t __denom); + + +__attribute__((availability(macosx,introduced=10.4))) +extern intmax_t +strtoimax(const char * restrict __nptr, + char ** restrict __endptr, + int __base); + +__attribute__((availability(macosx,introduced=10.4))) +extern uintmax_t +strtoumax(const char * restrict __nptr, + char ** restrict __endptr, + int __base); + + +__attribute__((availability(macosx,introduced=10.4))) +extern intmax_t +wcstoimax(const wchar_t * restrict __nptr, + wchar_t ** restrict __endptr, + int __base); + +__attribute__((availability(macosx,introduced=10.4))) +extern uintmax_t +wcstoumax(const wchar_t * restrict __nptr, + wchar_t ** restrict __endptr, + int __base); + + + + + + + + +extern void *_Block_copy(const void *aBlock) + __attribute__((availability(macosx,introduced=10.6))); + + +extern void _Block_release(const void *aBlock) + __attribute__((availability(macosx,introduced=10.6))); + + + +extern void _Block_object_assign(void *, const void *, const int) + __attribute__((availability(macosx,introduced=10.6))); + + +extern void _Block_object_dispose(const void *, const int) + __attribute__((availability(macosx,introduced=10.6))); + + +extern void * _NSConcreteGlobalBlock[32] + __attribute__((availability(macosx,introduced=10.6))); +extern void * _NSConcreteStackBlock[32] + __attribute__((availability(macosx,introduced=10.6))); + + + + +typedef unsigned char UInt8; +typedef signed char SInt8; +typedef unsigned short UInt16; +typedef signed short SInt16; + + +typedef unsigned int UInt32; +typedef signed int SInt32; +struct wide { + UInt32 lo; + SInt32 hi; +}; +typedef struct wide wide; +struct UnsignedWide { + UInt32 lo; + UInt32 hi; +}; +typedef struct UnsignedWide UnsignedWide; + typedef signed long long SInt64; + typedef unsigned long long UInt64; +typedef SInt32 Fixed; +typedef Fixed * FixedPtr; +typedef SInt32 Fract; +typedef Fract * FractPtr; +typedef UInt32 UnsignedFixed; +typedef UnsignedFixed * UnsignedFixedPtr; +typedef short ShortFixed; +typedef ShortFixed * ShortFixedPtr; +typedef float Float32; +typedef double Float64; +struct Float80 { + SInt16 exp; + UInt16 man[4]; +}; +typedef struct Float80 Float80; + +struct Float96 { + SInt16 exp[2]; + UInt16 man[4]; +}; +typedef struct Float96 Float96; +struct Float32Point { + Float32 x; + Float32 y; +}; +typedef struct Float32Point Float32Point; +typedef char * Ptr; +typedef Ptr * Handle; +typedef long Size; +typedef SInt16 OSErr; +typedef SInt32 OSStatus; +typedef void * LogicalAddress; +typedef const void * ConstLogicalAddress; +typedef void * PhysicalAddress; +typedef UInt8 * BytePtr; +typedef unsigned long ByteCount; +typedef unsigned long ByteOffset; +typedef SInt32 Duration; +typedef UnsignedWide AbsoluteTime; +typedef UInt32 OptionBits; +typedef unsigned long ItemCount; +typedef UInt32 PBVersion; +typedef SInt16 ScriptCode; +typedef SInt16 LangCode; +typedef SInt16 RegionCode; +typedef UInt32 FourCharCode; +typedef FourCharCode OSType; +typedef FourCharCode ResType; +typedef OSType * OSTypePtr; +typedef ResType * ResTypePtr; +typedef unsigned char Boolean; +typedef long ( * ProcPtr)(); +typedef void ( * Register68kProcPtr)(); + + + + +typedef ProcPtr UniversalProcPtr; + + +typedef ProcPtr * ProcHandle; +typedef UniversalProcPtr * UniversalProcHandle; +typedef void * PRefCon; + +typedef void * URefCon; +typedef void * SRefCon; +enum { + noErr = 0 +}; + +enum { + kNilOptions = 0 +}; + + +enum { + kVariableLengthArray + + + __attribute__((deprecated)) + + + = 1 +}; + +enum { + kUnknownType = 0x3F3F3F3F +}; +typedef UInt32 UnicodeScalarValue; +typedef UInt32 UTF32Char; +typedef UInt16 UniChar; +typedef UInt16 UTF16Char; +typedef UInt8 UTF8Char; +typedef UniChar * UniCharPtr; +typedef unsigned long UniCharCount; +typedef UniCharCount * UniCharCountPtr; +typedef unsigned char Str255[256]; +typedef unsigned char Str63[64]; +typedef unsigned char Str32[33]; +typedef unsigned char Str31[32]; +typedef unsigned char Str27[28]; +typedef unsigned char Str15[16]; +typedef unsigned char Str32Field[34]; +typedef Str63 StrFileName; +typedef unsigned char * StringPtr; +typedef StringPtr * StringHandle; +typedef const unsigned char * ConstStringPtr; +typedef const unsigned char * ConstStr255Param; +typedef const unsigned char * ConstStr63Param; +typedef const unsigned char * ConstStr32Param; +typedef const unsigned char * ConstStr31Param; +typedef const unsigned char * ConstStr27Param; +typedef const unsigned char * ConstStr15Param; +typedef ConstStr63Param ConstStrFileNameParam; +struct ProcessSerialNumber { + UInt32 highLongOfPSN; + UInt32 lowLongOfPSN; +}; +typedef struct ProcessSerialNumber ProcessSerialNumber; +typedef ProcessSerialNumber * ProcessSerialNumberPtr; +struct Point { + short v; + short h; +}; +typedef struct Point Point; +typedef Point * PointPtr; +struct Rect { + short top; + short left; + short bottom; + short right; +}; +typedef struct Rect Rect; +typedef Rect * RectPtr; +struct FixedPoint { + Fixed x; + Fixed y; +}; +typedef struct FixedPoint FixedPoint; +struct FixedRect { + Fixed left; + Fixed top; + Fixed right; + Fixed bottom; +}; +typedef struct FixedRect FixedRect; + +typedef short CharParameter; +enum { + normal = 0, + bold = 1, + italic = 2, + underline = 4, + outline = 8, + shadow = 0x10, + condense = 0x20, + extend = 0x40 +}; + +typedef unsigned char Style; +typedef short StyleParameter; +typedef Style StyleField; +typedef SInt32 TimeValue; +typedef SInt32 TimeScale; +typedef wide CompTimeValue; +typedef SInt64 TimeValue64; +typedef struct TimeBaseRecord* TimeBase; +struct TimeRecord { + CompTimeValue value; + TimeScale scale; + TimeBase base; +}; +typedef struct TimeRecord TimeRecord; +struct NumVersion { + + UInt8 nonRelRev; + UInt8 stage; + UInt8 minorAndBugRev; + UInt8 majorRev; +}; +typedef struct NumVersion NumVersion; + + +enum { + + developStage = 0x20, + alphaStage = 0x40, + betaStage = 0x60, + finalStage = 0x80 +}; + +union NumVersionVariant { + + NumVersion parts; + UInt32 whole; +}; +typedef union NumVersionVariant NumVersionVariant; +typedef NumVersionVariant * NumVersionVariantPtr; +typedef NumVersionVariantPtr * NumVersionVariantHandle; +struct VersRec { + + NumVersion numericVersion; + short countryCode; + Str255 shortVersion; + Str255 reserved; +}; +typedef struct VersRec VersRec; +typedef VersRec * VersRecPtr; +typedef VersRecPtr * VersRecHndl; + + + + + +typedef UInt8 Byte; +typedef SInt8 SignedByte; +typedef wide * WidePtr; +typedef UnsignedWide * UnsignedWidePtr; +typedef Float80 extended80; +typedef Float96 extended96; +typedef SInt8 VHSelect; +extern void +Debugger(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DebugStr(ConstStr255Param debuggerMsg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +SysBreak(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +SysBreakStr(ConstStr255Param debuggerMsg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +SysBreakFunc(ConstStr255Param debuggerMsg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern double kCFCoreFoundationVersionNumber; +typedef unsigned long CFTypeID; +typedef unsigned long CFOptionFlags; +typedef unsigned long CFHashCode; +typedef signed long CFIndex; + + + +typedef const __attribute__((objc_bridge(id))) void * CFTypeRef; + +typedef const struct __attribute__((objc_bridge(NSString))) __CFString * CFStringRef; +typedef struct __attribute__((objc_bridge_mutable(NSMutableString))) __CFString * CFMutableStringRef; + + + + + + +typedef __attribute__((objc_bridge(id))) CFTypeRef CFPropertyListRef; + + +typedef CFIndex CFComparisonResult; enum { + kCFCompareLessThan = -1L, + kCFCompareEqualTo = 0, + kCFCompareGreaterThan = 1 +}; + + +typedef CFComparisonResult (*CFComparatorFunction)(const void *val1, const void *val2, void *context); + + +static const CFIndex kCFNotFound = -1; + + + +typedef struct { + CFIndex location; + CFIndex length; +} CFRange; + + +static __inline__ __attribute__((always_inline)) CFRange CFRangeMake(CFIndex loc, CFIndex len) { + CFRange range; + range.location = loc; + range.length = len; + return range; +} + + + + + +extern +CFRange __CFRangeMake(CFIndex loc, CFIndex len); + + + + +typedef const struct __attribute__((objc_bridge(NSNull))) __CFNull * CFNullRef; + +extern +CFTypeID CFNullGetTypeID(void); + +extern +const CFNullRef kCFNull; +typedef const struct __attribute__((objc_bridge(id))) __CFAllocator * CFAllocatorRef; + + +extern +const CFAllocatorRef kCFAllocatorDefault; + + +extern +const CFAllocatorRef kCFAllocatorSystemDefault; + + + + + + + +extern +const CFAllocatorRef kCFAllocatorMalloc; + + + + + +extern +const CFAllocatorRef kCFAllocatorMallocZone; + + + + + +extern +const CFAllocatorRef kCFAllocatorNull; + + + + + +extern +const CFAllocatorRef kCFAllocatorUseContext; + +typedef const void * (*CFAllocatorRetainCallBack)(const void *info); +typedef void (*CFAllocatorReleaseCallBack)(const void *info); +typedef CFStringRef (*CFAllocatorCopyDescriptionCallBack)(const void *info); +typedef void * (*CFAllocatorAllocateCallBack)(CFIndex allocSize, CFOptionFlags hint, void *info); +typedef void * (*CFAllocatorReallocateCallBack)(void *ptr, CFIndex newsize, CFOptionFlags hint, void *info); +typedef void (*CFAllocatorDeallocateCallBack)(void *ptr, void *info); +typedef CFIndex (*CFAllocatorPreferredSizeCallBack)(CFIndex size, CFOptionFlags hint, void *info); +typedef struct { + CFIndex version; + void * info; + CFAllocatorRetainCallBack retain; + CFAllocatorReleaseCallBack release; + CFAllocatorCopyDescriptionCallBack copyDescription; + CFAllocatorAllocateCallBack allocate; + CFAllocatorReallocateCallBack reallocate; + CFAllocatorDeallocateCallBack deallocate; + CFAllocatorPreferredSizeCallBack preferredSize; +} CFAllocatorContext; + +extern +CFTypeID CFAllocatorGetTypeID(void); +extern +void CFAllocatorSetDefault(CFAllocatorRef allocator); + +extern +CFAllocatorRef CFAllocatorGetDefault(void); + +extern +CFAllocatorRef CFAllocatorCreate(CFAllocatorRef allocator, CFAllocatorContext *context); + +extern +void *CFAllocatorAllocate(CFAllocatorRef allocator, CFIndex size, CFOptionFlags hint); + +extern +void *CFAllocatorReallocate(CFAllocatorRef allocator, void *ptr, CFIndex newsize, CFOptionFlags hint); + +extern +void CFAllocatorDeallocate(CFAllocatorRef allocator, void *ptr); + +extern +CFIndex CFAllocatorGetPreferredSizeForSize(CFAllocatorRef allocator, CFIndex size, CFOptionFlags hint); + +extern +void CFAllocatorGetContext(CFAllocatorRef allocator, CFAllocatorContext *context); + + + + + + +extern +CFTypeID CFGetTypeID(CFTypeRef cf); + +extern +CFStringRef CFCopyTypeIDDescription(CFTypeID type_id); + +extern +CFTypeRef CFRetain(CFTypeRef cf); + +extern +void CFRelease(CFTypeRef cf); + + + +extern +CFTypeRef CFAutorelease(CFTypeRef __attribute__((cf_consumed)) arg) __attribute__((availability(macosx,introduced=10_9))); + +extern +CFIndex CFGetRetainCount(CFTypeRef cf); + + +extern +Boolean CFEqual(CFTypeRef cf1, CFTypeRef cf2); + +extern +CFHashCode CFHash(CFTypeRef cf); + +extern +CFStringRef CFCopyDescription(CFTypeRef cf); + +extern +CFAllocatorRef CFGetAllocator(CFTypeRef cf); + + + + +extern +CFTypeRef CFMakeCollectable(CFTypeRef cf) ; +typedef const void * (*CFArrayRetainCallBack)(CFAllocatorRef allocator, const void *value); +typedef void (*CFArrayReleaseCallBack)(CFAllocatorRef allocator, const void *value); +typedef CFStringRef (*CFArrayCopyDescriptionCallBack)(const void *value); +typedef Boolean (*CFArrayEqualCallBack)(const void *value1, const void *value2); +typedef struct { + CFIndex version; + CFArrayRetainCallBack retain; + CFArrayReleaseCallBack release; + CFArrayCopyDescriptionCallBack copyDescription; + CFArrayEqualCallBack equal; +} CFArrayCallBacks; + + + + + + +extern +const CFArrayCallBacks kCFTypeArrayCallBacks; +typedef void (*CFArrayApplierFunction)(const void *value, void *context); + + + + + +typedef const struct __attribute__((objc_bridge(NSArray))) __CFArray * CFArrayRef; + + + + + +typedef struct __attribute__((objc_bridge_mutable(NSMutableArray))) __CFArray * CFMutableArrayRef; + + + + + +extern +CFTypeID CFArrayGetTypeID(void); +extern +CFArrayRef CFArrayCreate(CFAllocatorRef allocator, const void **values, CFIndex numValues, const CFArrayCallBacks *callBacks); +extern +CFArrayRef CFArrayCreateCopy(CFAllocatorRef allocator, CFArrayRef theArray); +extern +CFMutableArrayRef CFArrayCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFArrayCallBacks *callBacks); +extern +CFMutableArrayRef CFArrayCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFArrayRef theArray); +extern +CFIndex CFArrayGetCount(CFArrayRef theArray); +extern +CFIndex CFArrayGetCountOfValue(CFArrayRef theArray, CFRange range, const void *value); +extern +Boolean CFArrayContainsValue(CFArrayRef theArray, CFRange range, const void *value); +extern +const void *CFArrayGetValueAtIndex(CFArrayRef theArray, CFIndex idx); +extern +void CFArrayGetValues(CFArrayRef theArray, CFRange range, const void **values); +extern +void CFArrayApplyFunction(CFArrayRef theArray, CFRange range, CFArrayApplierFunction __attribute__((noescape)) applier, void *context); +extern +CFIndex CFArrayGetFirstIndexOfValue(CFArrayRef theArray, CFRange range, const void *value); +extern +CFIndex CFArrayGetLastIndexOfValue(CFArrayRef theArray, CFRange range, const void *value); +extern +CFIndex CFArrayBSearchValues(CFArrayRef theArray, CFRange range, const void *value, CFComparatorFunction comparator, void *context); +extern +void CFArrayAppendValue(CFMutableArrayRef theArray, const void *value); +extern +void CFArrayInsertValueAtIndex(CFMutableArrayRef theArray, CFIndex idx, const void *value); +extern +void CFArraySetValueAtIndex(CFMutableArrayRef theArray, CFIndex idx, const void *value); +extern +void CFArrayRemoveValueAtIndex(CFMutableArrayRef theArray, CFIndex idx); +extern +void CFArrayRemoveAllValues(CFMutableArrayRef theArray); +extern +void CFArrayReplaceValues(CFMutableArrayRef theArray, CFRange range, const void **newValues, CFIndex newCount); +extern +void CFArrayExchangeValuesAtIndices(CFMutableArrayRef theArray, CFIndex idx1, CFIndex idx2); +extern +void CFArraySortValues(CFMutableArrayRef theArray, CFRange range, CFComparatorFunction comparator, void *context); +extern +void CFArrayAppendArray(CFMutableArrayRef theArray, CFArrayRef otherArray, CFRange otherRange); +typedef const void * (*CFBagRetainCallBack)(CFAllocatorRef allocator, const void *value); +typedef void (*CFBagReleaseCallBack)(CFAllocatorRef allocator, const void *value); +typedef CFStringRef (*CFBagCopyDescriptionCallBack)(const void *value); +typedef Boolean (*CFBagEqualCallBack)(const void *value1, const void *value2); +typedef CFHashCode (*CFBagHashCallBack)(const void *value); +typedef struct { + CFIndex version; + CFBagRetainCallBack retain; + CFBagReleaseCallBack release; + CFBagCopyDescriptionCallBack copyDescription; + CFBagEqualCallBack equal; + CFBagHashCallBack hash; +} CFBagCallBacks; + +extern +const CFBagCallBacks kCFTypeBagCallBacks; +extern +const CFBagCallBacks kCFCopyStringBagCallBacks; + +typedef void (*CFBagApplierFunction)(const void *value, void *context); + +typedef const struct __attribute__((objc_bridge(id))) __CFBag * CFBagRef; +typedef struct __attribute__((objc_bridge_mutable(id))) __CFBag * CFMutableBagRef; + +extern +CFTypeID CFBagGetTypeID(void); + +extern +CFBagRef CFBagCreate(CFAllocatorRef allocator, const void **values, CFIndex numValues, const CFBagCallBacks *callBacks); + +extern +CFBagRef CFBagCreateCopy(CFAllocatorRef allocator, CFBagRef theBag); + +extern +CFMutableBagRef CFBagCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFBagCallBacks *callBacks); + +extern +CFMutableBagRef CFBagCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFBagRef theBag); + +extern +CFIndex CFBagGetCount(CFBagRef theBag); + +extern +CFIndex CFBagGetCountOfValue(CFBagRef theBag, const void *value); + +extern +Boolean CFBagContainsValue(CFBagRef theBag, const void *value); + +extern +const void *CFBagGetValue(CFBagRef theBag, const void *value); + +extern +Boolean CFBagGetValueIfPresent(CFBagRef theBag, const void *candidate, const void **value); + +extern +void CFBagGetValues(CFBagRef theBag, const void **values); + +extern +void CFBagApplyFunction(CFBagRef theBag, CFBagApplierFunction __attribute__((noescape)) applier, void *context); + +extern +void CFBagAddValue(CFMutableBagRef theBag, const void *value); + +extern +void CFBagReplaceValue(CFMutableBagRef theBag, const void *value); + +extern +void CFBagSetValue(CFMutableBagRef theBag, const void *value); + +extern +void CFBagRemoveValue(CFMutableBagRef theBag, const void *value); + +extern +void CFBagRemoveAllValues(CFMutableBagRef theBag); +typedef struct { + CFIndex version; + void * info; + const void *(*retain)(const void *info); + void (*release)(const void *info); + CFStringRef (*copyDescription)(const void *info); +} CFBinaryHeapCompareContext; +typedef struct { + CFIndex version; + const void *(*retain)(CFAllocatorRef allocator, const void *ptr); + void (*release)(CFAllocatorRef allocator, const void *ptr); + CFStringRef (*copyDescription)(const void *ptr); + CFComparisonResult (*compare)(const void *ptr1, const void *ptr2, void *context); +} CFBinaryHeapCallBacks; + + + + + + + +extern const CFBinaryHeapCallBacks kCFStringBinaryHeapCallBacks; +typedef void (*CFBinaryHeapApplierFunction)(const void *val, void *context); + + + + + +typedef struct __attribute__((objc_bridge_mutable(id))) __CFBinaryHeap * CFBinaryHeapRef; + + + + + +extern CFTypeID CFBinaryHeapGetTypeID(void); +extern CFBinaryHeapRef CFBinaryHeapCreate(CFAllocatorRef allocator, CFIndex capacity, const CFBinaryHeapCallBacks *callBacks, const CFBinaryHeapCompareContext *compareContext); +extern CFBinaryHeapRef CFBinaryHeapCreateCopy(CFAllocatorRef allocator, CFIndex capacity, CFBinaryHeapRef heap); +extern CFIndex CFBinaryHeapGetCount(CFBinaryHeapRef heap); +extern CFIndex CFBinaryHeapGetCountOfValue(CFBinaryHeapRef heap, const void *value); +extern Boolean CFBinaryHeapContainsValue(CFBinaryHeapRef heap, const void *value); +extern const void * CFBinaryHeapGetMinimum(CFBinaryHeapRef heap); +extern Boolean CFBinaryHeapGetMinimumIfPresent(CFBinaryHeapRef heap, const void **value); +extern void CFBinaryHeapGetValues(CFBinaryHeapRef heap, const void **values); +extern void CFBinaryHeapApplyFunction(CFBinaryHeapRef heap, CFBinaryHeapApplierFunction __attribute__((noescape)) applier, void *context); +extern void CFBinaryHeapAddValue(CFBinaryHeapRef heap, const void *value); + + + + + + + +extern void CFBinaryHeapRemoveMinimumValue(CFBinaryHeapRef heap); +extern void CFBinaryHeapRemoveAllValues(CFBinaryHeapRef heap); +typedef UInt32 CFBit; + +typedef const struct __attribute__((objc_bridge(id))) __CFBitVector * CFBitVectorRef; +typedef struct __attribute__((objc_bridge_mutable(id))) __CFBitVector * CFMutableBitVectorRef; + +extern CFTypeID CFBitVectorGetTypeID(void); + +extern CFBitVectorRef CFBitVectorCreate(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex numBits); +extern CFBitVectorRef CFBitVectorCreateCopy(CFAllocatorRef allocator, CFBitVectorRef bv); +extern CFMutableBitVectorRef CFBitVectorCreateMutable(CFAllocatorRef allocator, CFIndex capacity); +extern CFMutableBitVectorRef CFBitVectorCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFBitVectorRef bv); + +extern CFIndex CFBitVectorGetCount(CFBitVectorRef bv); +extern CFIndex CFBitVectorGetCountOfBit(CFBitVectorRef bv, CFRange range, CFBit value); +extern Boolean CFBitVectorContainsBit(CFBitVectorRef bv, CFRange range, CFBit value); +extern CFBit CFBitVectorGetBitAtIndex(CFBitVectorRef bv, CFIndex idx); +extern void CFBitVectorGetBits(CFBitVectorRef bv, CFRange range, UInt8 *bytes); +extern CFIndex CFBitVectorGetFirstIndexOfBit(CFBitVectorRef bv, CFRange range, CFBit value); +extern CFIndex CFBitVectorGetLastIndexOfBit(CFBitVectorRef bv, CFRange range, CFBit value); + +extern void CFBitVectorSetCount(CFMutableBitVectorRef bv, CFIndex count); +extern void CFBitVectorFlipBitAtIndex(CFMutableBitVectorRef bv, CFIndex idx); +extern void CFBitVectorFlipBits(CFMutableBitVectorRef bv, CFRange range); +extern void CFBitVectorSetBitAtIndex(CFMutableBitVectorRef bv, CFIndex idx, CFBit value); +extern void CFBitVectorSetBits(CFMutableBitVectorRef bv, CFRange range, CFBit value); +extern void CFBitVectorSetAllBits(CFMutableBitVectorRef bv, CFBit value); + + + +static inline +uint16_t +OSReadSwapInt16( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint16_t result; + + result = *(volatile uint16_t *)((uintptr_t)base + byteOffset); + return _OSSwapInt16(result); +} + +static inline +uint32_t +OSReadSwapInt32( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint32_t result; + + result = *(volatile uint32_t *)((uintptr_t)base + byteOffset); + return _OSSwapInt32(result); +} + +static inline +uint64_t +OSReadSwapInt64( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint64_t result; + + result = *(volatile uint64_t *)((uintptr_t)base + byteOffset); + return _OSSwapInt64(result); +} + + + +static inline +void +OSWriteSwapInt16( + volatile void * base, + uintptr_t byteOffset, + uint16_t data +) +{ + *(volatile uint16_t *)((uintptr_t)base + byteOffset) = _OSSwapInt16(data); +} + +static inline +void +OSWriteSwapInt32( + volatile void * base, + uintptr_t byteOffset, + uint32_t data +) +{ + *(volatile uint32_t *)((uintptr_t)base + byteOffset) = _OSSwapInt32(data); +} + +static inline +void +OSWriteSwapInt64( + volatile void * base, + uintptr_t byteOffset, + uint64_t data +) +{ + *(volatile uint64_t *)((uintptr_t)base + byteOffset) = _OSSwapInt64(data); +} +enum { + OSUnknownByteOrder, + OSLittleEndian, + OSBigEndian +}; + +static inline +int32_t +OSHostByteOrder(void) { + + return OSLittleEndian; + + + + + +} +static inline +uint16_t +_OSReadInt16( + const volatile void * base, + uintptr_t byteOffset +) +{ + return *(volatile uint16_t *)((uintptr_t)base + byteOffset); +} + +static inline +uint32_t +_OSReadInt32( + const volatile void * base, + uintptr_t byteOffset +) +{ + return *(volatile uint32_t *)((uintptr_t)base + byteOffset); +} + +static inline +uint64_t +_OSReadInt64( + const volatile void * base, + uintptr_t byteOffset +) +{ + return *(volatile uint64_t *)((uintptr_t)base + byteOffset); +} + + + +static inline +void +_OSWriteInt16( + volatile void * base, + uintptr_t byteOffset, + uint16_t data +) +{ + *(volatile uint16_t *)((uintptr_t)base + byteOffset) = data; +} + +static inline +void +_OSWriteInt32( + volatile void * base, + uintptr_t byteOffset, + uint32_t data +) +{ + *(volatile uint32_t *)((uintptr_t)base + byteOffset) = data; +} + +static inline +void +_OSWriteInt64( + volatile void * base, + uintptr_t byteOffset, + uint64_t data +) +{ + *(volatile uint64_t *)((uintptr_t)base + byteOffset) = data; +} + + + + + +enum __CFByteOrder { + CFByteOrderUnknown, + CFByteOrderLittleEndian, + CFByteOrderBigEndian +}; +typedef CFIndex CFByteOrder; + +static __inline__ __attribute__((always_inline)) CFByteOrder CFByteOrderGetCurrent(void) { + + int32_t byteOrder = OSHostByteOrder(); + switch (byteOrder) { + case OSLittleEndian: return CFByteOrderLittleEndian; + case OSBigEndian: return CFByteOrderBigEndian; + default: break; + } + return CFByteOrderUnknown; +} + +static __inline__ __attribute__((always_inline)) uint16_t CFSwapInt16(uint16_t arg) { + + return ((__uint16_t)(__builtin_constant_p(arg) ? ((__uint16_t)((((__uint16_t)(arg) & 0xff00) >> 8) | (((__uint16_t)(arg) & 0x00ff) << 8))) : _OSSwapInt16(arg))); + + + + + +} + +static __inline__ __attribute__((always_inline)) uint32_t CFSwapInt32(uint32_t arg) { + + return (__builtin_constant_p(arg) ? ((__uint32_t)((((__uint32_t)(arg) & 0xff000000) >> 24) | (((__uint32_t)(arg) & 0x00ff0000) >> 8) | (((__uint32_t)(arg) & 0x0000ff00) << 8) | (((__uint32_t)(arg) & 0x000000ff) << 24))) : _OSSwapInt32(arg)); + + + + + +} + +static __inline__ __attribute__((always_inline)) uint64_t CFSwapInt64(uint64_t arg) { + + return (__builtin_constant_p(arg) ? ((__uint64_t)((((__uint64_t)(arg) & 0xff00000000000000ULL) >> 56) | (((__uint64_t)(arg) & 0x00ff000000000000ULL) >> 40) | (((__uint64_t)(arg) & 0x0000ff0000000000ULL) >> 24) | (((__uint64_t)(arg) & 0x000000ff00000000ULL) >> 8) | (((__uint64_t)(arg) & 0x00000000ff000000ULL) << 8) | (((__uint64_t)(arg) & 0x0000000000ff0000ULL) << 24) | (((__uint64_t)(arg) & 0x000000000000ff00ULL) << 40) | (((__uint64_t)(arg) & 0x00000000000000ffULL) << 56))) : _OSSwapInt64(arg)); +} + +static __inline__ __attribute__((always_inline)) uint16_t CFSwapInt16BigToHost(uint16_t arg) { + + return ((__uint16_t)(__builtin_constant_p(arg) ? ((__uint16_t)((((__uint16_t)(arg) & 0xff00) >> 8) | (((__uint16_t)(arg) & 0x00ff) << 8))) : _OSSwapInt16(arg))); + + + + + +} + +static __inline__ __attribute__((always_inline)) uint32_t CFSwapInt32BigToHost(uint32_t arg) { + + return (__builtin_constant_p(arg) ? ((__uint32_t)((((__uint32_t)(arg) & 0xff000000) >> 24) | (((__uint32_t)(arg) & 0x00ff0000) >> 8) | (((__uint32_t)(arg) & 0x0000ff00) << 8) | (((__uint32_t)(arg) & 0x000000ff) << 24))) : _OSSwapInt32(arg)); + + + + + +} + +static __inline__ __attribute__((always_inline)) uint64_t CFSwapInt64BigToHost(uint64_t arg) { + + return (__builtin_constant_p(arg) ? ((__uint64_t)((((__uint64_t)(arg) & 0xff00000000000000ULL) >> 56) | (((__uint64_t)(arg) & 0x00ff000000000000ULL) >> 40) | (((__uint64_t)(arg) & 0x0000ff0000000000ULL) >> 24) | (((__uint64_t)(arg) & 0x000000ff00000000ULL) >> 8) | (((__uint64_t)(arg) & 0x00000000ff000000ULL) << 8) | (((__uint64_t)(arg) & 0x0000000000ff0000ULL) << 24) | (((__uint64_t)(arg) & 0x000000000000ff00ULL) << 40) | (((__uint64_t)(arg) & 0x00000000000000ffULL) << 56))) : _OSSwapInt64(arg)); + + + + + +} + +static __inline__ __attribute__((always_inline)) uint16_t CFSwapInt16HostToBig(uint16_t arg) { + + return ((__uint16_t)(__builtin_constant_p(arg) ? ((__uint16_t)((((__uint16_t)(arg) & 0xff00) >> 8) | (((__uint16_t)(arg) & 0x00ff) << 8))) : _OSSwapInt16(arg))); + + + + + +} + +static __inline__ __attribute__((always_inline)) uint32_t CFSwapInt32HostToBig(uint32_t arg) { + + return (__builtin_constant_p(arg) ? ((__uint32_t)((((__uint32_t)(arg) & 0xff000000) >> 24) | (((__uint32_t)(arg) & 0x00ff0000) >> 8) | (((__uint32_t)(arg) & 0x0000ff00) << 8) | (((__uint32_t)(arg) & 0x000000ff) << 24))) : _OSSwapInt32(arg)); + + + + + +} + +static __inline__ __attribute__((always_inline)) uint64_t CFSwapInt64HostToBig(uint64_t arg) { + + return (__builtin_constant_p(arg) ? ((__uint64_t)((((__uint64_t)(arg) & 0xff00000000000000ULL) >> 56) | (((__uint64_t)(arg) & 0x00ff000000000000ULL) >> 40) | (((__uint64_t)(arg) & 0x0000ff0000000000ULL) >> 24) | (((__uint64_t)(arg) & 0x000000ff00000000ULL) >> 8) | (((__uint64_t)(arg) & 0x00000000ff000000ULL) << 8) | (((__uint64_t)(arg) & 0x0000000000ff0000ULL) << 24) | (((__uint64_t)(arg) & 0x000000000000ff00ULL) << 40) | (((__uint64_t)(arg) & 0x00000000000000ffULL) << 56))) : _OSSwapInt64(arg)); + + + + + +} + +static __inline__ __attribute__((always_inline)) uint16_t CFSwapInt16LittleToHost(uint16_t arg) { + + return ((uint16_t)(arg)); + + + + + +} + +static __inline__ __attribute__((always_inline)) uint32_t CFSwapInt32LittleToHost(uint32_t arg) { + + return ((uint32_t)(arg)); + + + + + +} + +static __inline__ __attribute__((always_inline)) uint64_t CFSwapInt64LittleToHost(uint64_t arg) { + + return ((uint64_t)(arg)); + + + + + +} + +static __inline__ __attribute__((always_inline)) uint16_t CFSwapInt16HostToLittle(uint16_t arg) { + + return ((uint16_t)(arg)); + + + + + +} + +static __inline__ __attribute__((always_inline)) uint32_t CFSwapInt32HostToLittle(uint32_t arg) { + + return ((uint32_t)(arg)); + + + + + +} + +static __inline__ __attribute__((always_inline)) uint64_t CFSwapInt64HostToLittle(uint64_t arg) { + + return ((uint64_t)(arg)); + + + + + +} + +typedef struct {uint32_t v;} CFSwappedFloat32; +typedef struct {uint64_t v;} CFSwappedFloat64; + +static __inline__ __attribute__((always_inline)) CFSwappedFloat32 CFConvertFloat32HostToSwapped(Float32 arg) { + union CFSwap { + Float32 v; + CFSwappedFloat32 sv; + } result; + result.v = arg; + + result.sv.v = CFSwapInt32(result.sv.v); + + return result.sv; +} + +static __inline__ __attribute__((always_inline)) Float32 CFConvertFloat32SwappedToHost(CFSwappedFloat32 arg) { + union CFSwap { + Float32 v; + CFSwappedFloat32 sv; + } result; + result.sv = arg; + + result.sv.v = CFSwapInt32(result.sv.v); + + return result.v; +} + +static __inline__ __attribute__((always_inline)) CFSwappedFloat64 CFConvertFloat64HostToSwapped(Float64 arg) { + union CFSwap { + Float64 v; + CFSwappedFloat64 sv; + } result; + result.v = arg; + + result.sv.v = CFSwapInt64(result.sv.v); + + return result.sv; +} + +static __inline__ __attribute__((always_inline)) Float64 CFConvertFloat64SwappedToHost(CFSwappedFloat64 arg) { + union CFSwap { + Float64 v; + CFSwappedFloat64 sv; + } result; + result.sv = arg; + + result.sv.v = CFSwapInt64(result.sv.v); + + return result.v; +} + +static __inline__ __attribute__((always_inline)) CFSwappedFloat32 CFConvertFloatHostToSwapped(float arg) { + union CFSwap { + float v; + CFSwappedFloat32 sv; + } result; + result.v = arg; + + result.sv.v = CFSwapInt32(result.sv.v); + + return result.sv; +} + +static __inline__ __attribute__((always_inline)) float CFConvertFloatSwappedToHost(CFSwappedFloat32 arg) { + union CFSwap { + float v; + CFSwappedFloat32 sv; + } result; + result.sv = arg; + + result.sv.v = CFSwapInt32(result.sv.v); + + return result.v; +} + +static __inline__ __attribute__((always_inline)) CFSwappedFloat64 CFConvertDoubleHostToSwapped(double arg) { + union CFSwap { + double v; + CFSwappedFloat64 sv; + } result; + result.v = arg; + + result.sv.v = CFSwapInt64(result.sv.v); + + return result.sv; +} + +static __inline__ __attribute__((always_inline)) double CFConvertDoubleSwappedToHost(CFSwappedFloat64 arg) { + union CFSwap { + double v; + CFSwappedFloat64 sv; + } result; + result.sv = arg; + + result.sv.v = CFSwapInt64(result.sv.v); + + return result.v; +} + + + + + + + + +typedef const void * (*CFDictionaryRetainCallBack)(CFAllocatorRef allocator, const void *value); +typedef void (*CFDictionaryReleaseCallBack)(CFAllocatorRef allocator, const void *value); +typedef CFStringRef (*CFDictionaryCopyDescriptionCallBack)(const void *value); +typedef Boolean (*CFDictionaryEqualCallBack)(const void *value1, const void *value2); +typedef CFHashCode (*CFDictionaryHashCallBack)(const void *value); +typedef struct { + CFIndex version; + CFDictionaryRetainCallBack retain; + CFDictionaryReleaseCallBack release; + CFDictionaryCopyDescriptionCallBack copyDescription; + CFDictionaryEqualCallBack equal; + CFDictionaryHashCallBack hash; +} CFDictionaryKeyCallBacks; + + + + + + + +extern +const CFDictionaryKeyCallBacks kCFTypeDictionaryKeyCallBacks; +extern +const CFDictionaryKeyCallBacks kCFCopyStringDictionaryKeyCallBacks; +typedef struct { + CFIndex version; + CFDictionaryRetainCallBack retain; + CFDictionaryReleaseCallBack release; + CFDictionaryCopyDescriptionCallBack copyDescription; + CFDictionaryEqualCallBack equal; +} CFDictionaryValueCallBacks; + + + + + + + +extern +const CFDictionaryValueCallBacks kCFTypeDictionaryValueCallBacks; +typedef void (*CFDictionaryApplierFunction)(const void *key, const void *value, void *context); + + + + + +typedef const struct __attribute__((objc_bridge(NSDictionary))) __CFDictionary * CFDictionaryRef; + + + + + +typedef struct __attribute__((objc_bridge_mutable(NSMutableDictionary))) __CFDictionary * CFMutableDictionaryRef; + + + + + +extern +CFTypeID CFDictionaryGetTypeID(void); +extern +CFDictionaryRef CFDictionaryCreate(CFAllocatorRef allocator, const void **keys, const void **values, CFIndex numValues, const CFDictionaryKeyCallBacks *keyCallBacks, const CFDictionaryValueCallBacks *valueCallBacks); +extern +CFDictionaryRef CFDictionaryCreateCopy(CFAllocatorRef allocator, CFDictionaryRef theDict); +extern +CFMutableDictionaryRef CFDictionaryCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFDictionaryKeyCallBacks *keyCallBacks, const CFDictionaryValueCallBacks *valueCallBacks); +extern +CFMutableDictionaryRef CFDictionaryCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFDictionaryRef theDict); +extern +CFIndex CFDictionaryGetCount(CFDictionaryRef theDict); +extern +CFIndex CFDictionaryGetCountOfKey(CFDictionaryRef theDict, const void *key); +extern +CFIndex CFDictionaryGetCountOfValue(CFDictionaryRef theDict, const void *value); +extern +Boolean CFDictionaryContainsKey(CFDictionaryRef theDict, const void *key); +extern +Boolean CFDictionaryContainsValue(CFDictionaryRef theDict, const void *value); +extern +const void *CFDictionaryGetValue(CFDictionaryRef theDict, const void *key); +extern +Boolean CFDictionaryGetValueIfPresent(CFDictionaryRef theDict, const void *key, const void **value); +extern +void CFDictionaryGetKeysAndValues(CFDictionaryRef theDict, const void **keys, const void **values); +extern +void CFDictionaryApplyFunction(CFDictionaryRef theDict, CFDictionaryApplierFunction __attribute__((noescape)) applier, void *context); +extern +void CFDictionaryAddValue(CFMutableDictionaryRef theDict, const void *key, const void *value); +extern +void CFDictionarySetValue(CFMutableDictionaryRef theDict, const void *key, const void *value); +extern +void CFDictionaryReplaceValue(CFMutableDictionaryRef theDict, const void *key, const void *value); +extern +void CFDictionaryRemoveValue(CFMutableDictionaryRef theDict, const void *key); +extern +void CFDictionaryRemoveAllValues(CFMutableDictionaryRef theDict); +typedef CFStringRef CFNotificationName __attribute__((swift_wrapper(struct))); + +typedef struct __attribute__((objc_bridge_mutable(id))) __CFNotificationCenter * CFNotificationCenterRef; + +typedef void (*CFNotificationCallback)(CFNotificationCenterRef center, void *observer, CFNotificationName name, const void *object, CFDictionaryRef userInfo); + +typedef CFIndex CFNotificationSuspensionBehavior; enum { + CFNotificationSuspensionBehaviorDrop = 1, + + CFNotificationSuspensionBehaviorCoalesce = 2, + + CFNotificationSuspensionBehaviorHold = 3, + + CFNotificationSuspensionBehaviorDeliverImmediately = 4 + +}; + +extern CFTypeID CFNotificationCenterGetTypeID(void); + +extern CFNotificationCenterRef CFNotificationCenterGetLocalCenter(void); + + +extern CFNotificationCenterRef CFNotificationCenterGetDistributedCenter(void); + + +extern CFNotificationCenterRef CFNotificationCenterGetDarwinNotifyCenter(void); +extern void CFNotificationCenterAddObserver(CFNotificationCenterRef center, const void *observer, CFNotificationCallback callBack, CFStringRef name, const void *object, CFNotificationSuspensionBehavior suspensionBehavior); + +extern void CFNotificationCenterRemoveObserver(CFNotificationCenterRef center, const void *observer, CFNotificationName name, const void *object); +extern void CFNotificationCenterRemoveEveryObserver(CFNotificationCenterRef center, const void *observer); + +extern void CFNotificationCenterPostNotification(CFNotificationCenterRef center, CFNotificationName name, const void *object, CFDictionaryRef userInfo, Boolean deliverImmediately); + +enum { + kCFNotificationDeliverImmediately = (1UL << 0), + kCFNotificationPostToAllSessions = (1UL << 1) +}; + +extern void CFNotificationCenterPostNotificationWithOptions(CFNotificationCenterRef center, CFNotificationName name, const void *object, CFDictionaryRef userInfo, CFOptionFlags options); + + + + +typedef CFStringRef CFLocaleIdentifier __attribute__((swift_wrapper(struct))); +typedef CFStringRef CFLocaleKey __attribute__((swift_wrapper(enum))); + +typedef const struct __attribute__((objc_bridge(NSLocale))) __CFLocale *CFLocaleRef; + +extern +CFTypeID CFLocaleGetTypeID(void); + +extern +CFLocaleRef CFLocaleGetSystem(void); + + +extern +CFLocaleRef CFLocaleCopyCurrent(void); +extern +CFArrayRef CFLocaleCopyAvailableLocaleIdentifiers(void); + + + +extern +CFArrayRef CFLocaleCopyISOLanguageCodes(void); + + + + +extern +CFArrayRef CFLocaleCopyISOCountryCodes(void); + + + + +extern +CFArrayRef CFLocaleCopyISOCurrencyCodes(void); + + + + +extern +CFArrayRef CFLocaleCopyCommonISOCurrencyCodes(void) __attribute__((availability(macosx,introduced=10_5))); + + + +extern +CFArrayRef CFLocaleCopyPreferredLanguages(void) __attribute__((availability(macosx,introduced=10_5))); + + +extern +CFLocaleIdentifier CFLocaleCreateCanonicalLanguageIdentifierFromString(CFAllocatorRef allocator, CFStringRef localeIdentifier); + + + +extern +CFLocaleIdentifier CFLocaleCreateCanonicalLocaleIdentifierFromString(CFAllocatorRef allocator, CFStringRef localeIdentifier); + + + +extern +CFLocaleIdentifier CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(CFAllocatorRef allocator, LangCode lcode, RegionCode rcode); + + +extern +CFLocaleIdentifier CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode(CFAllocatorRef allocator, uint32_t lcid) __attribute__((availability(macosx,introduced=10_6))); + + +extern +uint32_t CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier(CFLocaleIdentifier localeIdentifier) __attribute__((availability(macosx,introduced=10_6))); + + +typedef CFIndex CFLocaleLanguageDirection; enum { + kCFLocaleLanguageDirectionUnknown = 0, + kCFLocaleLanguageDirectionLeftToRight = 1, + kCFLocaleLanguageDirectionRightToLeft = 2, + kCFLocaleLanguageDirectionTopToBottom = 3, + kCFLocaleLanguageDirectionBottomToTop = 4 +}; + +extern +CFLocaleLanguageDirection CFLocaleGetLanguageCharacterDirection(CFStringRef isoLangCode) __attribute__((availability(macosx,introduced=10_6))); + +extern +CFLocaleLanguageDirection CFLocaleGetLanguageLineDirection(CFStringRef isoLangCode) __attribute__((availability(macosx,introduced=10_6))); + +extern +CFDictionaryRef CFLocaleCreateComponentsFromLocaleIdentifier(CFAllocatorRef allocator, CFLocaleIdentifier localeID); +extern +CFLocaleIdentifier CFLocaleCreateLocaleIdentifierFromComponents(CFAllocatorRef allocator, CFDictionaryRef dictionary); + + + + + + +extern +CFLocaleRef CFLocaleCreate(CFAllocatorRef allocator, CFLocaleIdentifier localeIdentifier); + + +extern +CFLocaleRef CFLocaleCreateCopy(CFAllocatorRef allocator, CFLocaleRef locale); + + + + +extern +CFLocaleIdentifier CFLocaleGetIdentifier(CFLocaleRef locale); + + + +extern +CFTypeRef CFLocaleGetValue(CFLocaleRef locale, CFLocaleKey key); + + + +extern +CFStringRef CFLocaleCopyDisplayNameForPropertyValue(CFLocaleRef displayLocale, CFLocaleKey key, CFStringRef value); + + + + + +extern const CFNotificationName kCFLocaleCurrentLocaleDidChangeNotification __attribute__((availability(macosx,introduced=10_5))); + + + +extern const CFLocaleKey kCFLocaleIdentifier; +extern const CFLocaleKey kCFLocaleLanguageCode; +extern const CFLocaleKey kCFLocaleCountryCode; +extern const CFLocaleKey kCFLocaleScriptCode; +extern const CFLocaleKey kCFLocaleVariantCode; + +extern const CFLocaleKey kCFLocaleExemplarCharacterSet; +extern const CFLocaleKey kCFLocaleCalendarIdentifier; +extern const CFLocaleKey kCFLocaleCalendar; +extern const CFLocaleKey kCFLocaleCollationIdentifier; +extern const CFLocaleKey kCFLocaleUsesMetricSystem; +extern const CFLocaleKey kCFLocaleMeasurementSystem; +extern const CFLocaleKey kCFLocaleDecimalSeparator; +extern const CFLocaleKey kCFLocaleGroupingSeparator; +extern const CFLocaleKey kCFLocaleCurrencySymbol; +extern const CFLocaleKey kCFLocaleCurrencyCode; +extern const CFLocaleKey kCFLocaleCollatorIdentifier __attribute__((availability(macosx,introduced=10_6))); +extern const CFLocaleKey kCFLocaleQuotationBeginDelimiterKey __attribute__((availability(macosx,introduced=10_6))); +extern const CFLocaleKey kCFLocaleQuotationEndDelimiterKey __attribute__((availability(macosx,introduced=10_6))); +extern const CFLocaleKey kCFLocaleAlternateQuotationBeginDelimiterKey __attribute__((availability(macosx,introduced=10_6))); +extern const CFLocaleKey kCFLocaleAlternateQuotationEndDelimiterKey __attribute__((availability(macosx,introduced=10_6))); + + +typedef CFStringRef CFCalendarIdentifier __attribute__((swift_wrapper(enum))); + +extern const CFCalendarIdentifier kCFGregorianCalendar; +extern const CFCalendarIdentifier kCFBuddhistCalendar; +extern const CFCalendarIdentifier kCFChineseCalendar; +extern const CFCalendarIdentifier kCFHebrewCalendar; +extern const CFCalendarIdentifier kCFIslamicCalendar; +extern const CFCalendarIdentifier kCFIslamicCivilCalendar; +extern const CFCalendarIdentifier kCFJapaneseCalendar; +extern const CFCalendarIdentifier kCFRepublicOfChinaCalendar __attribute__((availability(macosx,introduced=10_6))); +extern const CFCalendarIdentifier kCFPersianCalendar __attribute__((availability(macosx,introduced=10_6))); +extern const CFCalendarIdentifier kCFIndianCalendar __attribute__((availability(macosx,introduced=10_6))); +extern const CFCalendarIdentifier kCFISO8601Calendar __attribute__((availability(macosx,introduced=10_6))); +extern const CFCalendarIdentifier kCFIslamicTabularCalendar __attribute__((availability(macosx,introduced=10_10))); +extern const CFCalendarIdentifier kCFIslamicUmmAlQuraCalendar __attribute__((availability(macosx,introduced=10_10))); +typedef double CFTimeInterval; +typedef CFTimeInterval CFAbsoluteTime; + + + +extern +CFAbsoluteTime CFAbsoluteTimeGetCurrent(void); + +extern +const CFTimeInterval kCFAbsoluteTimeIntervalSince1970; +extern +const CFTimeInterval kCFAbsoluteTimeIntervalSince1904; + +typedef const struct __attribute__((objc_bridge(NSDate))) __CFDate * CFDateRef; + +extern +CFTypeID CFDateGetTypeID(void); + +extern +CFDateRef CFDateCreate(CFAllocatorRef allocator, CFAbsoluteTime at); + +extern +CFAbsoluteTime CFDateGetAbsoluteTime(CFDateRef theDate); + +extern +CFTimeInterval CFDateGetTimeIntervalSinceDate(CFDateRef theDate, CFDateRef otherDate); + +extern +CFComparisonResult CFDateCompare(CFDateRef theDate, CFDateRef otherDate, void *context); + + + +typedef const struct __attribute__((objc_bridge(NSTimeZone))) __CFTimeZone * CFTimeZoneRef; +typedef struct { + SInt32 year; + SInt8 month; + SInt8 day; + SInt8 hour; + SInt8 minute; + double second; +} CFGregorianDate __attribute__((availability(macosx,introduced=10_4,deprecated=10_10,message="" "Use CFCalendar or NSCalendar API instead"))); + +typedef struct { + SInt32 years; + SInt32 months; + SInt32 days; + SInt32 hours; + SInt32 minutes; + double seconds; +} CFGregorianUnits __attribute__((availability(macosx,introduced=10_4,deprecated=10_10,message="" "Use CFCalendar or NSCalendar API instead"))); + +typedef CFOptionFlags CFGregorianUnitFlags; enum { + kCFGregorianUnitsYears __attribute__((availability(macosx,introduced=10_4,deprecated=10_10,message="" "Use CFCalendar or NSCalendar API instead"))) = (1UL << 0), + kCFGregorianUnitsMonths __attribute__((availability(macosx,introduced=10_4,deprecated=10_10,message="" "Use CFCalendar or NSCalendar API instead"))) = (1UL << 1), + kCFGregorianUnitsDays __attribute__((availability(macosx,introduced=10_4,deprecated=10_10,message="" "Use CFCalendar or NSCalendar API instead"))) = (1UL << 2), + kCFGregorianUnitsHours __attribute__((availability(macosx,introduced=10_4,deprecated=10_10,message="" "Use CFCalendar or NSCalendar API instead"))) = (1UL << 3), + kCFGregorianUnitsMinutes __attribute__((availability(macosx,introduced=10_4,deprecated=10_10,message="" "Use CFCalendar or NSCalendar API instead"))) = (1UL << 4), + kCFGregorianUnitsSeconds __attribute__((availability(macosx,introduced=10_4,deprecated=10_10,message="" "Use CFCalendar or NSCalendar API instead"))) = (1UL << 5), + kCFGregorianAllUnits __attribute__((availability(macosx,introduced=10_4,deprecated=10_10,message="" "Use CFCalendar or NSCalendar API instead"))) = 0x00FFFFFF +}; + +extern +Boolean CFGregorianDateIsValid(CFGregorianDate gdate, CFOptionFlags unitFlags) __attribute__((availability(macosx,introduced=10_4,deprecated=10_10,message="" "Use CFCalendar or NSCalendar API instead"))); + +extern +CFAbsoluteTime CFGregorianDateGetAbsoluteTime(CFGregorianDate gdate, CFTimeZoneRef tz) __attribute__((availability(macosx,introduced=10_4,deprecated=10_10,message="" "Use CFCalendar or NSCalendar API instead"))); + +extern +CFGregorianDate CFAbsoluteTimeGetGregorianDate(CFAbsoluteTime at, CFTimeZoneRef tz) __attribute__((availability(macosx,introduced=10_4,deprecated=10_10,message="" "Use CFCalendar or NSCalendar API instead"))); + +extern +CFAbsoluteTime CFAbsoluteTimeAddGregorianUnits(CFAbsoluteTime at, CFTimeZoneRef tz, CFGregorianUnits units) __attribute__((availability(macosx,introduced=10_4,deprecated=10_10,message="" "Use CFCalendar or NSCalendar API instead"))); + +extern +CFGregorianUnits CFAbsoluteTimeGetDifferenceAsGregorianUnits(CFAbsoluteTime at1, CFAbsoluteTime at2, CFTimeZoneRef tz, CFOptionFlags unitFlags) __attribute__((availability(macosx,introduced=10_4,deprecated=10_10,message="" "Use CFCalendar or NSCalendar API instead"))); + +extern +SInt32 CFAbsoluteTimeGetDayOfWeek(CFAbsoluteTime at, CFTimeZoneRef tz) __attribute__((availability(macosx,introduced=10_4,deprecated=10_10,message="" "Use CFCalendar or NSCalendar API instead"))); + +extern +SInt32 CFAbsoluteTimeGetDayOfYear(CFAbsoluteTime at, CFTimeZoneRef tz) __attribute__((availability(macosx,introduced=10_4,deprecated=10_10,message="" "Use CFCalendar or NSCalendar API instead"))); + +extern +SInt32 CFAbsoluteTimeGetWeekOfYear(CFAbsoluteTime at, CFTimeZoneRef tz) __attribute__((availability(macosx,introduced=10_4,deprecated=10_10,message="" "Use CFCalendar or NSCalendar API instead"))); +typedef const struct __attribute__((objc_bridge(NSData))) __CFData * CFDataRef; +typedef struct __attribute__((objc_bridge_mutable(NSMutableData))) __CFData * CFMutableDataRef; + +extern +CFTypeID CFDataGetTypeID(void); + +extern +CFDataRef CFDataCreate(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex length); + +extern +CFDataRef CFDataCreateWithBytesNoCopy(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex length, CFAllocatorRef bytesDeallocator); + + +extern +CFDataRef CFDataCreateCopy(CFAllocatorRef allocator, CFDataRef theData); + +extern +CFMutableDataRef CFDataCreateMutable(CFAllocatorRef allocator, CFIndex capacity); + +extern +CFMutableDataRef CFDataCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFDataRef theData); + +extern +CFIndex CFDataGetLength(CFDataRef theData); + +extern +const UInt8 *CFDataGetBytePtr(CFDataRef theData); + +extern +UInt8 *CFDataGetMutableBytePtr(CFMutableDataRef theData); + +extern +void CFDataGetBytes(CFDataRef theData, CFRange range, UInt8 *buffer); + +extern +void CFDataSetLength(CFMutableDataRef theData, CFIndex length); + +extern +void CFDataIncreaseLength(CFMutableDataRef theData, CFIndex extraLength); + +extern +void CFDataAppendBytes(CFMutableDataRef theData, const UInt8 *bytes, CFIndex length); + +extern +void CFDataReplaceBytes(CFMutableDataRef theData, CFRange range, const UInt8 *newBytes, CFIndex newLength); + +extern +void CFDataDeleteBytes(CFMutableDataRef theData, CFRange range); + +typedef CFOptionFlags CFDataSearchFlags; enum { + kCFDataSearchBackwards = 1UL << 0, + kCFDataSearchAnchored = 1UL << 1 +} __attribute__((availability(macosx,introduced=10_6))); + +extern +CFRange CFDataFind(CFDataRef theData, CFDataRef dataToFind, CFRange searchRange, CFDataSearchFlags compareOptions) __attribute__((availability(macosx,introduced=10_6))); + + +typedef const struct __attribute__((objc_bridge(NSCharacterSet))) __CFCharacterSet * CFCharacterSetRef; + + + + + +typedef struct __attribute__((objc_bridge_mutable(NSMutableCharacterSet))) __CFCharacterSet * CFMutableCharacterSetRef; + + + + + + +typedef CFIndex CFCharacterSetPredefinedSet; enum { + kCFCharacterSetControl = 1, + kCFCharacterSetWhitespace, + kCFCharacterSetWhitespaceAndNewline, + kCFCharacterSetDecimalDigit, + kCFCharacterSetLetter, + kCFCharacterSetLowercaseLetter, + kCFCharacterSetUppercaseLetter, + kCFCharacterSetNonBase, + kCFCharacterSetDecomposable, + kCFCharacterSetAlphaNumeric, + kCFCharacterSetPunctuation, + kCFCharacterSetCapitalizedLetter = 13, + kCFCharacterSetSymbol = 14, + kCFCharacterSetNewline __attribute__((availability(macosx,introduced=10_5))) = 15, + kCFCharacterSetIllegal = 12 +}; + + + + + +extern +CFTypeID CFCharacterSetGetTypeID(void); +extern +CFCharacterSetRef CFCharacterSetGetPredefined(CFCharacterSetPredefinedSet theSetIdentifier); +extern +CFCharacterSetRef CFCharacterSetCreateWithCharactersInRange(CFAllocatorRef alloc, CFRange theRange); +extern +CFCharacterSetRef CFCharacterSetCreateWithCharactersInString(CFAllocatorRef alloc, CFStringRef theString); +extern +CFCharacterSetRef CFCharacterSetCreateWithBitmapRepresentation(CFAllocatorRef alloc, CFDataRef theData); +extern CFCharacterSetRef CFCharacterSetCreateInvertedSet(CFAllocatorRef alloc, CFCharacterSetRef theSet); +extern Boolean CFCharacterSetIsSupersetOfSet(CFCharacterSetRef theSet, CFCharacterSetRef theOtherset); +extern Boolean CFCharacterSetHasMemberInPlane(CFCharacterSetRef theSet, CFIndex thePlane); +extern +CFMutableCharacterSetRef CFCharacterSetCreateMutable(CFAllocatorRef alloc); +extern +CFCharacterSetRef CFCharacterSetCreateCopy(CFAllocatorRef alloc, CFCharacterSetRef theSet); +extern +CFMutableCharacterSetRef CFCharacterSetCreateMutableCopy(CFAllocatorRef alloc, CFCharacterSetRef theSet); +extern +Boolean CFCharacterSetIsCharacterMember(CFCharacterSetRef theSet, UniChar theChar); +extern Boolean CFCharacterSetIsLongCharacterMember(CFCharacterSetRef theSet, UTF32Char theChar); +extern +CFDataRef CFCharacterSetCreateBitmapRepresentation(CFAllocatorRef alloc, CFCharacterSetRef theSet); +extern +void CFCharacterSetAddCharactersInRange(CFMutableCharacterSetRef theSet, CFRange theRange); +extern +void CFCharacterSetRemoveCharactersInRange(CFMutableCharacterSetRef theSet, CFRange theRange); +extern +void CFCharacterSetAddCharactersInString(CFMutableCharacterSetRef theSet, CFStringRef theString); +extern +void CFCharacterSetRemoveCharactersInString(CFMutableCharacterSetRef theSet, CFStringRef theString); +extern +void CFCharacterSetUnion(CFMutableCharacterSetRef theSet, CFCharacterSetRef theOtherSet); +extern +void CFCharacterSetIntersect(CFMutableCharacterSetRef theSet, CFCharacterSetRef theOtherSet); +extern +void CFCharacterSetInvert(CFMutableCharacterSetRef theSet); +typedef UInt32 CFStringEncoding; + + + + + +typedef CFStringEncoding CFStringBuiltInEncodings; enum { + kCFStringEncodingMacRoman = 0, + kCFStringEncodingWindowsLatin1 = 0x0500, + kCFStringEncodingISOLatin1 = 0x0201, + kCFStringEncodingNextStepLatin = 0x0B01, + kCFStringEncodingASCII = 0x0600, + kCFStringEncodingUnicode = 0x0100, + kCFStringEncodingUTF8 = 0x08000100, + kCFStringEncodingNonLossyASCII = 0x0BFF, + + kCFStringEncodingUTF16 = 0x0100, + kCFStringEncodingUTF16BE = 0x10000100, + kCFStringEncodingUTF16LE = 0x14000100, + + kCFStringEncodingUTF32 = 0x0c000100, + kCFStringEncodingUTF32BE = 0x18000100, + kCFStringEncodingUTF32LE = 0x1c000100 +}; + + + +extern +CFTypeID CFStringGetTypeID(void); +extern +CFStringRef CFStringCreateWithPascalString(CFAllocatorRef alloc, ConstStr255Param pStr, CFStringEncoding encoding); + +extern +CFStringRef CFStringCreateWithCString(CFAllocatorRef alloc, const char *cStr, CFStringEncoding encoding); + + + +extern +CFStringRef CFStringCreateWithBytes(CFAllocatorRef alloc, const UInt8 *bytes, CFIndex numBytes, CFStringEncoding encoding, Boolean isExternalRepresentation); + +extern +CFStringRef CFStringCreateWithCharacters(CFAllocatorRef alloc, const UniChar *chars, CFIndex numChars); +extern +CFStringRef CFStringCreateWithPascalStringNoCopy(CFAllocatorRef alloc, ConstStr255Param pStr, CFStringEncoding encoding, CFAllocatorRef contentsDeallocator); + +extern +CFStringRef CFStringCreateWithCStringNoCopy(CFAllocatorRef alloc, const char *cStr, CFStringEncoding encoding, CFAllocatorRef contentsDeallocator); + + + +extern +CFStringRef CFStringCreateWithBytesNoCopy(CFAllocatorRef alloc, const UInt8 *bytes, CFIndex numBytes, CFStringEncoding encoding, Boolean isExternalRepresentation, CFAllocatorRef contentsDeallocator); + +extern +CFStringRef CFStringCreateWithCharactersNoCopy(CFAllocatorRef alloc, const UniChar *chars, CFIndex numChars, CFAllocatorRef contentsDeallocator); + + + +extern +CFStringRef CFStringCreateWithSubstring(CFAllocatorRef alloc, CFStringRef str, CFRange range); + +extern +CFStringRef CFStringCreateCopy(CFAllocatorRef alloc, CFStringRef theString); + + + +extern +CFStringRef CFStringCreateWithFormat(CFAllocatorRef alloc, CFDictionaryRef formatOptions, CFStringRef format, ...) __attribute__((format(CFString, 3, 4))); + +extern +CFStringRef CFStringCreateWithFormatAndArguments(CFAllocatorRef alloc, CFDictionaryRef formatOptions, CFStringRef format, va_list arguments) __attribute__((format(CFString, 3, 0))); + + + +extern +CFMutableStringRef CFStringCreateMutable(CFAllocatorRef alloc, CFIndex maxLength); + +extern +CFMutableStringRef CFStringCreateMutableCopy(CFAllocatorRef alloc, CFIndex maxLength, CFStringRef theString); + + + + + + + +extern +CFMutableStringRef CFStringCreateMutableWithExternalCharactersNoCopy(CFAllocatorRef alloc, UniChar *chars, CFIndex numChars, CFIndex capacity, CFAllocatorRef externalCharactersAllocator); + + + + + +extern +CFIndex CFStringGetLength(CFStringRef theString); + + + + + + +extern +UniChar CFStringGetCharacterAtIndex(CFStringRef theString, CFIndex idx); + +extern +void CFStringGetCharacters(CFStringRef theString, CFRange range, UniChar *buffer); +extern +Boolean CFStringGetPascalString(CFStringRef theString, StringPtr buffer, CFIndex bufferSize, CFStringEncoding encoding); + +extern +Boolean CFStringGetCString(CFStringRef theString, char *buffer, CFIndex bufferSize, CFStringEncoding encoding); + + + + + + +extern +ConstStringPtr CFStringGetPascalStringPtr(CFStringRef theString, CFStringEncoding encoding); + +extern +const char *CFStringGetCStringPtr(CFStringRef theString, CFStringEncoding encoding); + +extern +const UniChar *CFStringGetCharactersPtr(CFStringRef theString); +extern +CFIndex CFStringGetBytes(CFStringRef theString, CFRange range, CFStringEncoding encoding, UInt8 lossByte, Boolean isExternalRepresentation, UInt8 *buffer, CFIndex maxBufLen, CFIndex *usedBufLen); + + + + + + + +extern +CFStringRef CFStringCreateFromExternalRepresentation(CFAllocatorRef alloc, CFDataRef data, CFStringEncoding encoding); + +extern +CFDataRef CFStringCreateExternalRepresentation(CFAllocatorRef alloc, CFStringRef theString, CFStringEncoding encoding, UInt8 lossByte); + + + +extern +CFStringEncoding CFStringGetSmallestEncoding(CFStringRef theString); + +extern +CFStringEncoding CFStringGetFastestEncoding(CFStringRef theString); + + + +extern +CFStringEncoding CFStringGetSystemEncoding(void); + +extern +CFIndex CFStringGetMaximumSizeForEncoding(CFIndex length, CFStringEncoding encoding); + + + + + + +extern +Boolean CFStringGetFileSystemRepresentation(CFStringRef string, char *buffer, CFIndex maxBufLen); + + + +extern +CFIndex CFStringGetMaximumSizeOfFileSystemRepresentation(CFStringRef string); + + + +extern +CFStringRef CFStringCreateWithFileSystemRepresentation(CFAllocatorRef alloc, const char *buffer); + + + + + + +typedef CFOptionFlags CFStringCompareFlags; enum { + kCFCompareCaseInsensitive = 1, + kCFCompareBackwards = 4, + kCFCompareAnchored = 8, + kCFCompareNonliteral = 16, + kCFCompareLocalized = 32, + kCFCompareNumerically = 64, + kCFCompareDiacriticInsensitive __attribute__((availability(macosx,introduced=10_5))) = 128, + kCFCompareWidthInsensitive __attribute__((availability(macosx,introduced=10_5))) = 256, + kCFCompareForcedOrdering __attribute__((availability(macosx,introduced=10_5))) = 512 +}; + + + + + + + +extern +CFComparisonResult CFStringCompareWithOptionsAndLocale(CFStringRef theString1, CFStringRef theString2, CFRange rangeToCompare, CFStringCompareFlags compareOptions, CFLocaleRef locale) __attribute__((availability(macosx,introduced=10_5))); + + + +extern +CFComparisonResult CFStringCompareWithOptions(CFStringRef theString1, CFStringRef theString2, CFRange rangeToCompare, CFStringCompareFlags compareOptions); + + + + + +extern +CFComparisonResult CFStringCompare(CFStringRef theString1, CFStringRef theString2, CFStringCompareFlags compareOptions); + + + + + + + +extern +Boolean CFStringFindWithOptionsAndLocale(CFStringRef theString, CFStringRef stringToFind, CFRange rangeToSearch, CFStringCompareFlags searchOptions, CFLocaleRef locale, CFRange *result) __attribute__((availability(macosx,introduced=10_5))); + + + +extern +Boolean CFStringFindWithOptions(CFStringRef theString, CFStringRef stringToFind, CFRange rangeToSearch, CFStringCompareFlags searchOptions, CFRange *result); +extern +CFArrayRef CFStringCreateArrayWithFindResults(CFAllocatorRef alloc, CFStringRef theString, CFStringRef stringToFind, CFRange rangeToSearch, CFStringCompareFlags compareOptions); + + + +extern +CFRange CFStringFind(CFStringRef theString, CFStringRef stringToFind, CFStringCompareFlags compareOptions); + +extern +Boolean CFStringHasPrefix(CFStringRef theString, CFStringRef prefix); + +extern +Boolean CFStringHasSuffix(CFStringRef theString, CFStringRef suffix); +extern CFRange CFStringGetRangeOfComposedCharactersAtIndex(CFStringRef theString, CFIndex theIndex); +extern Boolean CFStringFindCharacterFromSet(CFStringRef theString, CFCharacterSetRef theSet, CFRange rangeToSearch, CFStringCompareFlags searchOptions, CFRange *result); +extern +void CFStringGetLineBounds(CFStringRef theString, CFRange range, CFIndex *lineBeginIndex, CFIndex *lineEndIndex, CFIndex *contentsEndIndex); + + + +extern +void CFStringGetParagraphBounds(CFStringRef string, CFRange range, CFIndex *parBeginIndex, CFIndex *parEndIndex, CFIndex *contentsEndIndex) __attribute__((availability(macosx,introduced=10_5))); +extern +CFIndex CFStringGetHyphenationLocationBeforeIndex(CFStringRef string, CFIndex location, CFRange limitRange, CFOptionFlags options, CFLocaleRef locale, UTF32Char *character) __attribute__((availability(macosx,introduced=10_7))); + +extern +Boolean CFStringIsHyphenationAvailableForLocale(CFLocaleRef locale) __attribute__((availability(macosx,introduced=10_7))); + + + +extern +CFStringRef CFStringCreateByCombiningStrings(CFAllocatorRef alloc, CFArrayRef theArray, CFStringRef separatorString); + +extern +CFArrayRef CFStringCreateArrayBySeparatingStrings(CFAllocatorRef alloc, CFStringRef theString, CFStringRef separatorString); + + + + +extern +SInt32 CFStringGetIntValue(CFStringRef str); + +extern +double CFStringGetDoubleValue(CFStringRef str); +extern +void CFStringAppend(CFMutableStringRef theString, CFStringRef appendedString); + +extern +void CFStringAppendCharacters(CFMutableStringRef theString, const UniChar *chars, CFIndex numChars); + +extern +void CFStringAppendPascalString(CFMutableStringRef theString, ConstStr255Param pStr, CFStringEncoding encoding); + +extern +void CFStringAppendCString(CFMutableStringRef theString, const char *cStr, CFStringEncoding encoding); + +extern +void CFStringAppendFormat(CFMutableStringRef theString, CFDictionaryRef formatOptions, CFStringRef format, ...) __attribute__((format(CFString, 3, 4))); + +extern +void CFStringAppendFormatAndArguments(CFMutableStringRef theString, CFDictionaryRef formatOptions, CFStringRef format, va_list arguments) __attribute__((format(CFString, 3, 0))); + +extern +void CFStringInsert(CFMutableStringRef str, CFIndex idx, CFStringRef insertedStr); + +extern +void CFStringDelete(CFMutableStringRef theString, CFRange range); + +extern +void CFStringReplace(CFMutableStringRef theString, CFRange range, CFStringRef replacement); + +extern +void CFStringReplaceAll(CFMutableStringRef theString, CFStringRef replacement); +extern +CFIndex CFStringFindAndReplace(CFMutableStringRef theString, CFStringRef stringToFind, CFStringRef replacementString, CFRange rangeToSearch, CFStringCompareFlags compareOptions); +extern +void CFStringSetExternalCharactersNoCopy(CFMutableStringRef theString, UniChar *chars, CFIndex length, CFIndex capacity); +extern +void CFStringPad(CFMutableStringRef theString, CFStringRef padString, CFIndex length, CFIndex indexIntoPad); + +extern +void CFStringTrim(CFMutableStringRef theString, CFStringRef trimString); + +extern +void CFStringTrimWhitespace(CFMutableStringRef theString); + +extern +void CFStringLowercase(CFMutableStringRef theString, CFLocaleRef locale); + +extern +void CFStringUppercase(CFMutableStringRef theString, CFLocaleRef locale); + +extern +void CFStringCapitalize(CFMutableStringRef theString, CFLocaleRef locale); + + + + + + + +typedef CFIndex CFStringNormalizationForm; enum { + kCFStringNormalizationFormD = 0, + kCFStringNormalizationFormKD, + kCFStringNormalizationFormC, + kCFStringNormalizationFormKC +}; +extern void CFStringNormalize(CFMutableStringRef theString, CFStringNormalizationForm theForm); +extern +void CFStringFold(CFMutableStringRef theString, CFStringCompareFlags theFlags, CFLocaleRef theLocale) __attribute__((availability(macosx,introduced=10_5))); + + + + + +extern +Boolean CFStringTransform(CFMutableStringRef string, CFRange *range, CFStringRef transform, Boolean reverse); + + + +extern const CFStringRef kCFStringTransformStripCombiningMarks; +extern const CFStringRef kCFStringTransformToLatin; +extern const CFStringRef kCFStringTransformFullwidthHalfwidth; +extern const CFStringRef kCFStringTransformLatinKatakana; +extern const CFStringRef kCFStringTransformLatinHiragana; +extern const CFStringRef kCFStringTransformHiraganaKatakana; +extern const CFStringRef kCFStringTransformMandarinLatin; +extern const CFStringRef kCFStringTransformLatinHangul; +extern const CFStringRef kCFStringTransformLatinArabic; +extern const CFStringRef kCFStringTransformLatinHebrew; +extern const CFStringRef kCFStringTransformLatinThai; +extern const CFStringRef kCFStringTransformLatinCyrillic; +extern const CFStringRef kCFStringTransformLatinGreek; +extern const CFStringRef kCFStringTransformToXMLHex; +extern const CFStringRef kCFStringTransformToUnicodeName; +extern const CFStringRef kCFStringTransformStripDiacritics __attribute__((availability(macosx,introduced=10_5))); + + + + + + +extern +Boolean CFStringIsEncodingAvailable(CFStringEncoding encoding); + + + +extern +const CFStringEncoding *CFStringGetListOfAvailableEncodings(void); + + + +extern +CFStringRef CFStringGetNameOfEncoding(CFStringEncoding encoding); + + + +extern +unsigned long CFStringConvertEncodingToNSStringEncoding(CFStringEncoding encoding); + +extern +CFStringEncoding CFStringConvertNSStringEncodingToEncoding(unsigned long encoding); + + + +extern +UInt32 CFStringConvertEncodingToWindowsCodepage(CFStringEncoding encoding); + +extern +CFStringEncoding CFStringConvertWindowsCodepageToEncoding(UInt32 codepage); + + + +extern +CFStringEncoding CFStringConvertIANACharSetNameToEncoding(CFStringRef theString); + +extern +CFStringRef CFStringConvertEncodingToIANACharSetName(CFStringEncoding encoding); + + + + + +extern +CFStringEncoding CFStringGetMostCompatibleMacStringEncoding(CFStringEncoding encoding); +typedef struct { + UniChar buffer[64]; + CFStringRef theString; + const UniChar *directUniCharBuffer; + const char *directCStringBuffer; + CFRange rangeToBuffer; + CFIndex bufferedRangeStart; + CFIndex bufferedRangeEnd; +} CFStringInlineBuffer; + + +static __inline__ __attribute__((always_inline)) void CFStringInitInlineBuffer(CFStringRef str, CFStringInlineBuffer *buf, CFRange range) { + buf->theString = str; + buf->rangeToBuffer = range; + buf->directCStringBuffer = (buf->directUniCharBuffer = CFStringGetCharactersPtr(str)) ? ((void*)0) : CFStringGetCStringPtr(str, kCFStringEncodingASCII); + buf->bufferedRangeStart = buf->bufferedRangeEnd = 0; +} + +static __inline__ __attribute__((always_inline)) UniChar CFStringGetCharacterFromInlineBuffer(CFStringInlineBuffer *buf, CFIndex idx) { + if (idx < 0 || idx >= buf->rangeToBuffer.length) return 0; + if (buf->directUniCharBuffer) return buf->directUniCharBuffer[idx + buf->rangeToBuffer.location]; + if (buf->directCStringBuffer) return (UniChar)(buf->directCStringBuffer[idx + buf->rangeToBuffer.location]); + if (idx >= buf->bufferedRangeEnd || idx < buf->bufferedRangeStart) { + if ((buf->bufferedRangeStart = idx - 4) < 0) buf->bufferedRangeStart = 0; + buf->bufferedRangeEnd = buf->bufferedRangeStart + 64; + if (buf->bufferedRangeEnd > buf->rangeToBuffer.length) buf->bufferedRangeEnd = buf->rangeToBuffer.length; + CFStringGetCharacters(buf->theString, CFRangeMake(buf->rangeToBuffer.location + buf->bufferedRangeStart, buf->bufferedRangeEnd - buf->bufferedRangeStart), buf->buffer); + } + return buf->buffer[idx - buf->bufferedRangeStart]; +} +static __inline__ __attribute__((always_inline)) Boolean CFStringIsSurrogateHighCharacter(UniChar character) { + return ((character >= 0xD800UL) && (character <= 0xDBFFUL) ? 1 : 0); +} + +static __inline__ __attribute__((always_inline)) Boolean CFStringIsSurrogateLowCharacter(UniChar character) { + return ((character >= 0xDC00UL) && (character <= 0xDFFFUL) ? 1 : 0); +} + +static __inline__ __attribute__((always_inline)) UTF32Char CFStringGetLongCharacterForSurrogatePair(UniChar surrogateHigh, UniChar surrogateLow) { + return (UTF32Char)(((surrogateHigh - 0xD800UL) << 10) + (surrogateLow - 0xDC00UL) + 0x0010000UL); +} + + +static __inline__ __attribute__((always_inline)) Boolean CFStringGetSurrogatePairForLongCharacter(UTF32Char character, UniChar *surrogates) { + if ((character > 0xFFFFUL) && (character < 0x110000UL)) { + character -= 0x10000; + if (((void*)0) != surrogates) { + surrogates[0] = (UniChar)((character >> 10) + 0xD800UL); + surrogates[1] = (UniChar)((character & 0x3FF) + 0xDC00UL); + } + return 1; + } else { + if (((void*)0) != surrogates) *surrogates = (UniChar)character; + return 0; + } +} + + + + + + + +extern +void CFShow(CFTypeRef obj); + +extern +void CFShowStr(CFStringRef str); + + +extern +CFStringRef __CFStringMakeConstantString(const char *cStr) __attribute__((format_arg(1))); + + + + + + +extern +CFTypeID CFTimeZoneGetTypeID(void); + +extern +CFTimeZoneRef CFTimeZoneCopySystem(void); + +extern +void CFTimeZoneResetSystem(void); + +extern +CFTimeZoneRef CFTimeZoneCopyDefault(void); + +extern +void CFTimeZoneSetDefault(CFTimeZoneRef tz); + +extern +CFArrayRef CFTimeZoneCopyKnownNames(void); + +extern +CFDictionaryRef CFTimeZoneCopyAbbreviationDictionary(void); + +extern +void CFTimeZoneSetAbbreviationDictionary(CFDictionaryRef dict); + +extern +CFTimeZoneRef CFTimeZoneCreate(CFAllocatorRef allocator, CFStringRef name, CFDataRef data); + +extern +CFTimeZoneRef CFTimeZoneCreateWithTimeIntervalFromGMT(CFAllocatorRef allocator, CFTimeInterval ti); + +extern +CFTimeZoneRef CFTimeZoneCreateWithName(CFAllocatorRef allocator, CFStringRef name, Boolean tryAbbrev); + +extern +CFStringRef CFTimeZoneGetName(CFTimeZoneRef tz); + +extern +CFDataRef CFTimeZoneGetData(CFTimeZoneRef tz); + +extern +CFTimeInterval CFTimeZoneGetSecondsFromGMT(CFTimeZoneRef tz, CFAbsoluteTime at); + +extern +CFStringRef CFTimeZoneCopyAbbreviation(CFTimeZoneRef tz, CFAbsoluteTime at); + +extern +Boolean CFTimeZoneIsDaylightSavingTime(CFTimeZoneRef tz, CFAbsoluteTime at); + +extern +CFTimeInterval CFTimeZoneGetDaylightSavingTimeOffset(CFTimeZoneRef tz, CFAbsoluteTime at) __attribute__((availability(macosx,introduced=10_5))); + +extern +CFAbsoluteTime CFTimeZoneGetNextDaylightSavingTimeTransition(CFTimeZoneRef tz, CFAbsoluteTime at) __attribute__((availability(macosx,introduced=10_5))); + +typedef CFIndex CFTimeZoneNameStyle; enum { + kCFTimeZoneNameStyleStandard, + kCFTimeZoneNameStyleShortStandard, + kCFTimeZoneNameStyleDaylightSaving, + kCFTimeZoneNameStyleShortDaylightSaving, + kCFTimeZoneNameStyleGeneric, + kCFTimeZoneNameStyleShortGeneric +} __attribute__((availability(macosx,introduced=10_5))); + +extern +CFStringRef CFTimeZoneCopyLocalizedName(CFTimeZoneRef tz, CFTimeZoneNameStyle style, CFLocaleRef locale) __attribute__((availability(macosx,introduced=10_5))); + +extern +const CFNotificationName kCFTimeZoneSystemTimeZoneDidChangeNotification __attribute__((availability(macosx,introduced=10_5))); + + + + +typedef struct __attribute__((objc_bridge_mutable(NSCalendar))) __CFCalendar * CFCalendarRef; + +extern +CFTypeID CFCalendarGetTypeID(void); + +extern +CFCalendarRef CFCalendarCopyCurrent(void); + +extern +CFCalendarRef CFCalendarCreateWithIdentifier(CFAllocatorRef allocator, CFCalendarIdentifier identifier); + + + +extern +CFCalendarIdentifier CFCalendarGetIdentifier(CFCalendarRef calendar); + + +extern +CFLocaleRef CFCalendarCopyLocale(CFCalendarRef calendar); + +extern +void CFCalendarSetLocale(CFCalendarRef calendar, CFLocaleRef locale); + +extern +CFTimeZoneRef CFCalendarCopyTimeZone(CFCalendarRef calendar); + +extern +void CFCalendarSetTimeZone(CFCalendarRef calendar, CFTimeZoneRef tz); + +extern +CFIndex CFCalendarGetFirstWeekday(CFCalendarRef calendar); + +extern +void CFCalendarSetFirstWeekday(CFCalendarRef calendar, CFIndex wkdy); + +extern +CFIndex CFCalendarGetMinimumDaysInFirstWeek(CFCalendarRef calendar); + +extern +void CFCalendarSetMinimumDaysInFirstWeek(CFCalendarRef calendar, CFIndex mwd); + + +typedef CFOptionFlags CFCalendarUnit; enum { + kCFCalendarUnitEra = (1UL << 1), + kCFCalendarUnitYear = (1UL << 2), + kCFCalendarUnitMonth = (1UL << 3), + kCFCalendarUnitDay = (1UL << 4), + kCFCalendarUnitHour = (1UL << 5), + kCFCalendarUnitMinute = (1UL << 6), + kCFCalendarUnitSecond = (1UL << 7), + kCFCalendarUnitWeek __attribute__((availability(macosx,introduced=10_4,deprecated=10_10,message="" ))) = (1UL << 8), + kCFCalendarUnitWeekday = (1UL << 9), + kCFCalendarUnitWeekdayOrdinal = (1UL << 10), + kCFCalendarUnitQuarter __attribute__((availability(macosx,introduced=10_6))) = (1UL << 11), + kCFCalendarUnitWeekOfMonth __attribute__((availability(macosx,introduced=10_7))) = (1UL << 12), + kCFCalendarUnitWeekOfYear __attribute__((availability(macosx,introduced=10_7))) = (1UL << 13), + kCFCalendarUnitYearForWeekOfYear __attribute__((availability(macosx,introduced=10_7))) = (1UL << 14), +}; + +extern +CFRange CFCalendarGetMinimumRangeOfUnit(CFCalendarRef calendar, CFCalendarUnit unit); + +extern +CFRange CFCalendarGetMaximumRangeOfUnit(CFCalendarRef calendar, CFCalendarUnit unit); + +extern +CFRange CFCalendarGetRangeOfUnit(CFCalendarRef calendar, CFCalendarUnit smallerUnit, CFCalendarUnit biggerUnit, CFAbsoluteTime at); + +extern +CFIndex CFCalendarGetOrdinalityOfUnit(CFCalendarRef calendar, CFCalendarUnit smallerUnit, CFCalendarUnit biggerUnit, CFAbsoluteTime at); + +extern +Boolean CFCalendarGetTimeRangeOfUnit(CFCalendarRef calendar, CFCalendarUnit unit, CFAbsoluteTime at, CFAbsoluteTime *startp, CFTimeInterval *tip) __attribute__((availability(macosx,introduced=10_5))); + +extern +Boolean CFCalendarComposeAbsoluteTime(CFCalendarRef calendar, CFAbsoluteTime *at, const char *componentDesc, ...); + +extern +Boolean CFCalendarDecomposeAbsoluteTime(CFCalendarRef calendar, CFAbsoluteTime at, const char *componentDesc, ...); + + +enum { + kCFCalendarComponentsWrap = (1UL << 0) +}; + +extern +Boolean CFCalendarAddComponents(CFCalendarRef calendar, CFAbsoluteTime *at, CFOptionFlags options, const char *componentDesc, ...); + +extern +Boolean CFCalendarGetComponentDifference(CFCalendarRef calendar, CFAbsoluteTime startingAT, CFAbsoluteTime resultAT, CFOptionFlags options, const char *componentDesc, ...); + + + +typedef CFStringRef CFDateFormatterKey __attribute__((swift_wrapper(enum))); + +typedef struct __attribute__((objc_bridge_mutable(id))) __CFDateFormatter *CFDateFormatterRef; + + + +extern +CFStringRef CFDateFormatterCreateDateFormatFromTemplate(CFAllocatorRef allocator, CFStringRef tmplate, CFOptionFlags options, CFLocaleRef locale) __attribute__((availability(macosx,introduced=10_6))); + + +extern +CFTypeID CFDateFormatterGetTypeID(void); +typedef CFIndex CFDateFormatterStyle; enum { + kCFDateFormatterNoStyle = 0, + kCFDateFormatterShortStyle = 1, + kCFDateFormatterMediumStyle = 2, + kCFDateFormatterLongStyle = 3, + kCFDateFormatterFullStyle = 4 +}; + +typedef CFOptionFlags CFISO8601DateFormatOptions; enum { + + + + + kCFISO8601DateFormatWithYear __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) __attribute__((availability(tvos,introduced=10.0))) = (1UL << 0), + kCFISO8601DateFormatWithMonth __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) __attribute__((availability(tvos,introduced=10.0))) = (1UL << 1), + + kCFISO8601DateFormatWithWeekOfYear __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) __attribute__((availability(tvos,introduced=10.0))) = (1UL << 2), + + + + + + + kCFISO8601DateFormatWithDay __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) __attribute__((availability(tvos,introduced=10.0))) = (1UL << 4), + + kCFISO8601DateFormatWithTime __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) __attribute__((availability(tvos,introduced=10.0))) = (1UL << 5), + kCFISO8601DateFormatWithTimeZone __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) __attribute__((availability(tvos,introduced=10.0))) = (1UL << 6), + + kCFISO8601DateFormatWithSpaceBetweenDateAndTime __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) __attribute__((availability(tvos,introduced=10.0))) = (1UL << 7), + kCFISO8601DateFormatWithDashSeparatorInDate __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) __attribute__((availability(tvos,introduced=10.0))) = (1UL << 8), + kCFISO8601DateFormatWithColonSeparatorInTime __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) __attribute__((availability(tvos,introduced=10.0))) = (1UL << 9), + kCFISO8601DateFormatWithColonSeparatorInTimeZone __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) __attribute__((availability(tvos,introduced=10.0))) = (1UL << 10), + + kCFISO8601DateFormatWithFullDate __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) __attribute__((availability(tvos,introduced=10.0))) = kCFISO8601DateFormatWithYear | kCFISO8601DateFormatWithMonth | kCFISO8601DateFormatWithDay | kCFISO8601DateFormatWithDashSeparatorInDate, + kCFISO8601DateFormatWithFullTime __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) __attribute__((availability(tvos,introduced=10.0))) = kCFISO8601DateFormatWithTime | kCFISO8601DateFormatWithColonSeparatorInTime | kCFISO8601DateFormatWithTimeZone | kCFISO8601DateFormatWithColonSeparatorInTimeZone, + + kCFISO8601DateFormatWithInternetDateTime __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) __attribute__((availability(tvos,introduced=10.0))) = kCFISO8601DateFormatWithFullDate | kCFISO8601DateFormatWithFullTime, +}; + +extern +CFDateFormatterRef CFDateFormatterCreateISO8601Formatter(CFAllocatorRef allocator, CFISO8601DateFormatOptions formatOptions) __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) __attribute__((availability(tvos,introduced=10.0))); + +extern +CFDateFormatterRef CFDateFormatterCreate(CFAllocatorRef allocator, CFLocaleRef locale, CFDateFormatterStyle dateStyle, CFDateFormatterStyle timeStyle); + + + +extern +CFLocaleRef CFDateFormatterGetLocale(CFDateFormatterRef formatter); + +extern +CFDateFormatterStyle CFDateFormatterGetDateStyle(CFDateFormatterRef formatter); + +extern +CFDateFormatterStyle CFDateFormatterGetTimeStyle(CFDateFormatterRef formatter); + + +extern +CFStringRef CFDateFormatterGetFormat(CFDateFormatterRef formatter); + +extern +void CFDateFormatterSetFormat(CFDateFormatterRef formatter, CFStringRef formatString); + + + + + + + +extern +CFStringRef CFDateFormatterCreateStringWithDate(CFAllocatorRef allocator, CFDateFormatterRef formatter, CFDateRef date); + +extern +CFStringRef CFDateFormatterCreateStringWithAbsoluteTime(CFAllocatorRef allocator, CFDateFormatterRef formatter, CFAbsoluteTime at); + + + + +extern +CFDateRef CFDateFormatterCreateDateFromString(CFAllocatorRef allocator, CFDateFormatterRef formatter, CFStringRef string, CFRange *rangep); + +extern +Boolean CFDateFormatterGetAbsoluteTimeFromString(CFDateFormatterRef formatter, CFStringRef string, CFRange *rangep, CFAbsoluteTime *atp); +extern +void CFDateFormatterSetProperty(CFDateFormatterRef formatter, CFStringRef key, CFTypeRef value); + +extern +CFTypeRef CFDateFormatterCopyProperty(CFDateFormatterRef formatter, CFDateFormatterKey key); + + + +extern const CFDateFormatterKey kCFDateFormatterIsLenient; +extern const CFDateFormatterKey kCFDateFormatterTimeZone; +extern const CFDateFormatterKey kCFDateFormatterCalendarName; +extern const CFDateFormatterKey kCFDateFormatterDefaultFormat; +extern const CFDateFormatterKey kCFDateFormatterTwoDigitStartDate; +extern const CFDateFormatterKey kCFDateFormatterDefaultDate; +extern const CFDateFormatterKey kCFDateFormatterCalendar; +extern const CFDateFormatterKey kCFDateFormatterEraSymbols; +extern const CFDateFormatterKey kCFDateFormatterMonthSymbols; +extern const CFDateFormatterKey kCFDateFormatterShortMonthSymbols; +extern const CFDateFormatterKey kCFDateFormatterWeekdaySymbols; +extern const CFDateFormatterKey kCFDateFormatterShortWeekdaySymbols; +extern const CFDateFormatterKey kCFDateFormatterAMSymbol; +extern const CFDateFormatterKey kCFDateFormatterPMSymbol; +extern const CFDateFormatterKey kCFDateFormatterLongEraSymbols __attribute__((availability(macosx,introduced=10_5))); +extern const CFDateFormatterKey kCFDateFormatterVeryShortMonthSymbols __attribute__((availability(macosx,introduced=10_5))); +extern const CFDateFormatterKey kCFDateFormatterStandaloneMonthSymbols __attribute__((availability(macosx,introduced=10_5))); +extern const CFDateFormatterKey kCFDateFormatterShortStandaloneMonthSymbols __attribute__((availability(macosx,introduced=10_5))); +extern const CFDateFormatterKey kCFDateFormatterVeryShortStandaloneMonthSymbols __attribute__((availability(macosx,introduced=10_5))); +extern const CFDateFormatterKey kCFDateFormatterVeryShortWeekdaySymbols __attribute__((availability(macosx,introduced=10_5))); +extern const CFDateFormatterKey kCFDateFormatterStandaloneWeekdaySymbols __attribute__((availability(macosx,introduced=10_5))); +extern const CFDateFormatterKey kCFDateFormatterShortStandaloneWeekdaySymbols __attribute__((availability(macosx,introduced=10_5))); +extern const CFDateFormatterKey kCFDateFormatterVeryShortStandaloneWeekdaySymbols __attribute__((availability(macosx,introduced=10_5))); +extern const CFDateFormatterKey kCFDateFormatterQuarterSymbols __attribute__((availability(macosx,introduced=10_5))); +extern const CFDateFormatterKey kCFDateFormatterShortQuarterSymbols __attribute__((availability(macosx,introduced=10_5))); +extern const CFDateFormatterKey kCFDateFormatterStandaloneQuarterSymbols __attribute__((availability(macosx,introduced=10_5))); +extern const CFDateFormatterKey kCFDateFormatterShortStandaloneQuarterSymbols __attribute__((availability(macosx,introduced=10_5))); +extern const CFDateFormatterKey kCFDateFormatterGregorianStartDate __attribute__((availability(macosx,introduced=10_5))); +extern const CFDateFormatterKey kCFDateFormatterDoesRelativeDateFormattingKey __attribute__((availability(macosx,introduced=10_6))); + +typedef CFStringRef CFErrorDomain __attribute__((swift_wrapper(struct))); + + + + + +typedef struct __attribute__((objc_bridge(NSError))) __CFError * CFErrorRef; + + + + + +extern +CFTypeID CFErrorGetTypeID(void) __attribute__((availability(macosx,introduced=10_5))); + + + +extern const CFErrorDomain kCFErrorDomainPOSIX __attribute__((availability(macosx,introduced=10_5))); +extern const CFErrorDomain kCFErrorDomainOSStatus __attribute__((availability(macosx,introduced=10_5))); +extern const CFErrorDomain kCFErrorDomainMach __attribute__((availability(macosx,introduced=10_5))); +extern const CFErrorDomain kCFErrorDomainCocoa __attribute__((availability(macosx,introduced=10_5))); + + +extern const CFStringRef kCFErrorLocalizedDescriptionKey __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFErrorLocalizedFailureReasonKey __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFErrorLocalizedRecoverySuggestionKey __attribute__((availability(macosx,introduced=10_5))); + + +extern const CFStringRef kCFErrorDescriptionKey __attribute__((availability(macosx,introduced=10_5))); + + +extern const CFStringRef kCFErrorUnderlyingErrorKey __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFErrorURLKey __attribute__((availability(macosx,introduced=10_7))); +extern const CFStringRef kCFErrorFilePathKey __attribute__((availability(macosx,introduced=10_7))); +extern +CFErrorRef CFErrorCreate(CFAllocatorRef allocator, CFErrorDomain domain, CFIndex code, CFDictionaryRef userInfo) __attribute__((availability(macosx,introduced=10_5))); +extern +CFErrorRef CFErrorCreateWithUserInfoKeysAndValues(CFAllocatorRef allocator, CFErrorDomain domain, CFIndex code, const void *const *userInfoKeys, const void *const *userInfoValues, CFIndex numUserInfoValues) __attribute__((availability(macosx,introduced=10_5))); + + + + + + + +extern +CFErrorDomain CFErrorGetDomain(CFErrorRef err) __attribute__((availability(macosx,introduced=10_5))); + + + + + + + +extern +CFIndex CFErrorGetCode(CFErrorRef err) __attribute__((availability(macosx,introduced=10_5))); +extern +CFDictionaryRef CFErrorCopyUserInfo(CFErrorRef err) __attribute__((availability(macosx,introduced=10_5))); +extern +CFStringRef CFErrorCopyDescription(CFErrorRef err) __attribute__((availability(macosx,introduced=10_5))); +extern +CFStringRef CFErrorCopyFailureReason(CFErrorRef err) __attribute__((availability(macosx,introduced=10_5))); +extern +CFStringRef CFErrorCopyRecoverySuggestion(CFErrorRef err) __attribute__((availability(macosx,introduced=10_5))); + +typedef const struct __attribute__((objc_bridge(NSNumber))) __CFBoolean * CFBooleanRef; + +extern +const CFBooleanRef kCFBooleanTrue; +extern +const CFBooleanRef kCFBooleanFalse; + +extern +CFTypeID CFBooleanGetTypeID(void); + +extern +Boolean CFBooleanGetValue(CFBooleanRef boolean); + +typedef CFIndex CFNumberType; enum { + + kCFNumberSInt8Type = 1, + kCFNumberSInt16Type = 2, + kCFNumberSInt32Type = 3, + kCFNumberSInt64Type = 4, + kCFNumberFloat32Type = 5, + kCFNumberFloat64Type = 6, + + kCFNumberCharType = 7, + kCFNumberShortType = 8, + kCFNumberIntType = 9, + kCFNumberLongType = 10, + kCFNumberLongLongType = 11, + kCFNumberFloatType = 12, + kCFNumberDoubleType = 13, + + kCFNumberCFIndexType = 14, + kCFNumberNSIntegerType __attribute__((availability(macosx,introduced=10_5))) = 15, + kCFNumberCGFloatType __attribute__((availability(macosx,introduced=10_5))) = 16, + kCFNumberMaxType = 16 +}; + +typedef const struct __attribute__((objc_bridge(NSNumber))) __CFNumber * CFNumberRef; + +extern +const CFNumberRef kCFNumberPositiveInfinity; +extern +const CFNumberRef kCFNumberNegativeInfinity; +extern +const CFNumberRef kCFNumberNaN; + +extern +CFTypeID CFNumberGetTypeID(void); +extern +CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType theType, const void *valuePtr); + + + + + +extern +CFNumberType CFNumberGetType(CFNumberRef number); + + + + +extern +CFIndex CFNumberGetByteSize(CFNumberRef number); + + + + + +extern +Boolean CFNumberIsFloatType(CFNumberRef number); +extern +Boolean CFNumberGetValue(CFNumberRef number, CFNumberType theType, void *valuePtr); +extern +CFComparisonResult CFNumberCompare(CFNumberRef number, CFNumberRef otherNumber, void *context); +typedef CFStringRef CFNumberFormatterKey __attribute__((swift_wrapper(enum))); + +typedef struct __attribute__((objc_bridge_mutable(id))) __CFNumberFormatter *CFNumberFormatterRef; + + + +extern +CFTypeID CFNumberFormatterGetTypeID(void); + +typedef CFIndex CFNumberFormatterStyle; enum { + kCFNumberFormatterNoStyle = 0, + kCFNumberFormatterDecimalStyle = 1, + kCFNumberFormatterCurrencyStyle = 2, + kCFNumberFormatterPercentStyle = 3, + kCFNumberFormatterScientificStyle = 4, + kCFNumberFormatterSpellOutStyle = 5, + kCFNumberFormatterOrdinalStyle __attribute__((availability(macosx,introduced=10_11))) = 6, + kCFNumberFormatterCurrencyISOCodeStyle __attribute__((availability(macosx,introduced=10_11))) = 8, + kCFNumberFormatterCurrencyPluralStyle __attribute__((availability(macosx,introduced=10_11))) = 9, + kCFNumberFormatterCurrencyAccountingStyle __attribute__((availability(macosx,introduced=10_11))) = 10, +}; + + +extern +CFNumberFormatterRef CFNumberFormatterCreate(CFAllocatorRef allocator, CFLocaleRef locale, CFNumberFormatterStyle style); + + + +extern +CFLocaleRef CFNumberFormatterGetLocale(CFNumberFormatterRef formatter); + +extern +CFNumberFormatterStyle CFNumberFormatterGetStyle(CFNumberFormatterRef formatter); + + +extern +CFStringRef CFNumberFormatterGetFormat(CFNumberFormatterRef formatter); + +extern +void CFNumberFormatterSetFormat(CFNumberFormatterRef formatter, CFStringRef formatString); +extern +CFStringRef CFNumberFormatterCreateStringWithNumber(CFAllocatorRef allocator, CFNumberFormatterRef formatter, CFNumberRef number); + +extern +CFStringRef CFNumberFormatterCreateStringWithValue(CFAllocatorRef allocator, CFNumberFormatterRef formatter, CFNumberType numberType, const void *valuePtr); + + + + +typedef CFOptionFlags CFNumberFormatterOptionFlags; enum { + kCFNumberFormatterParseIntegersOnly = 1 +}; + +extern +CFNumberRef CFNumberFormatterCreateNumberFromString(CFAllocatorRef allocator, CFNumberFormatterRef formatter, CFStringRef string, CFRange *rangep, CFOptionFlags options); + +extern +Boolean CFNumberFormatterGetValueFromString(CFNumberFormatterRef formatter, CFStringRef string, CFRange *rangep, CFNumberType numberType, void *valuePtr); +extern +void CFNumberFormatterSetProperty(CFNumberFormatterRef formatter, CFNumberFormatterKey key, CFTypeRef value); + +extern +CFTypeRef CFNumberFormatterCopyProperty(CFNumberFormatterRef formatter, CFNumberFormatterKey key); + + + +extern const CFNumberFormatterKey kCFNumberFormatterCurrencyCode; +extern const CFNumberFormatterKey kCFNumberFormatterDecimalSeparator; +extern const CFNumberFormatterKey kCFNumberFormatterCurrencyDecimalSeparator; +extern const CFNumberFormatterKey kCFNumberFormatterAlwaysShowDecimalSeparator; +extern const CFNumberFormatterKey kCFNumberFormatterGroupingSeparator; +extern const CFNumberFormatterKey kCFNumberFormatterUseGroupingSeparator; +extern const CFNumberFormatterKey kCFNumberFormatterPercentSymbol; +extern const CFNumberFormatterKey kCFNumberFormatterZeroSymbol; +extern const CFNumberFormatterKey kCFNumberFormatterNaNSymbol; +extern const CFNumberFormatterKey kCFNumberFormatterInfinitySymbol; +extern const CFNumberFormatterKey kCFNumberFormatterMinusSign; +extern const CFNumberFormatterKey kCFNumberFormatterPlusSign; +extern const CFNumberFormatterKey kCFNumberFormatterCurrencySymbol; +extern const CFNumberFormatterKey kCFNumberFormatterExponentSymbol; +extern const CFNumberFormatterKey kCFNumberFormatterMinIntegerDigits; +extern const CFNumberFormatterKey kCFNumberFormatterMaxIntegerDigits; +extern const CFNumberFormatterKey kCFNumberFormatterMinFractionDigits; +extern const CFNumberFormatterKey kCFNumberFormatterMaxFractionDigits; +extern const CFNumberFormatterKey kCFNumberFormatterGroupingSize; +extern const CFNumberFormatterKey kCFNumberFormatterSecondaryGroupingSize; +extern const CFNumberFormatterKey kCFNumberFormatterRoundingMode; +extern const CFNumberFormatterKey kCFNumberFormatterRoundingIncrement; +extern const CFNumberFormatterKey kCFNumberFormatterFormatWidth; +extern const CFNumberFormatterKey kCFNumberFormatterPaddingPosition; +extern const CFNumberFormatterKey kCFNumberFormatterPaddingCharacter; +extern const CFNumberFormatterKey kCFNumberFormatterDefaultFormat; +extern const CFNumberFormatterKey kCFNumberFormatterMultiplier; +extern const CFNumberFormatterKey kCFNumberFormatterPositivePrefix; +extern const CFNumberFormatterKey kCFNumberFormatterPositiveSuffix; +extern const CFNumberFormatterKey kCFNumberFormatterNegativePrefix; +extern const CFNumberFormatterKey kCFNumberFormatterNegativeSuffix; +extern const CFNumberFormatterKey kCFNumberFormatterPerMillSymbol; +extern const CFNumberFormatterKey kCFNumberFormatterInternationalCurrencySymbol; +extern const CFNumberFormatterKey kCFNumberFormatterCurrencyGroupingSeparator __attribute__((availability(macosx,introduced=10_5))); +extern const CFNumberFormatterKey kCFNumberFormatterIsLenient __attribute__((availability(macosx,introduced=10_5))); +extern const CFNumberFormatterKey kCFNumberFormatterUseSignificantDigits __attribute__((availability(macosx,introduced=10_5))); +extern const CFNumberFormatterKey kCFNumberFormatterMinSignificantDigits __attribute__((availability(macosx,introduced=10_5))); +extern const CFNumberFormatterKey kCFNumberFormatterMaxSignificantDigits __attribute__((availability(macosx,introduced=10_5))); + +typedef CFIndex CFNumberFormatterRoundingMode; enum { + kCFNumberFormatterRoundCeiling = 0, + kCFNumberFormatterRoundFloor = 1, + kCFNumberFormatterRoundDown = 2, + kCFNumberFormatterRoundUp = 3, + kCFNumberFormatterRoundHalfEven = 4, + kCFNumberFormatterRoundHalfDown = 5, + kCFNumberFormatterRoundHalfUp = 6 +}; + +typedef CFIndex CFNumberFormatterPadPosition; enum { + kCFNumberFormatterPadBeforePrefix = 0, + kCFNumberFormatterPadAfterPrefix = 1, + kCFNumberFormatterPadBeforeSuffix = 2, + kCFNumberFormatterPadAfterSuffix = 3 +}; + + +extern +Boolean CFNumberFormatterGetDecimalInfoForCurrencyCode(CFStringRef currencyCode, int32_t *defaultFractionDigits, double *roundingIncrement); +extern +const CFStringRef kCFPreferencesAnyApplication; +extern +const CFStringRef kCFPreferencesCurrentApplication; +extern +const CFStringRef kCFPreferencesAnyHost; +extern +const CFStringRef kCFPreferencesCurrentHost; +extern +const CFStringRef kCFPreferencesAnyUser; +extern +const CFStringRef kCFPreferencesCurrentUser; +extern +_Nullable CFPropertyListRef CFPreferencesCopyAppValue(CFStringRef key, CFStringRef applicationID); + + + + +extern +Boolean CFPreferencesGetAppBooleanValue(CFStringRef key, CFStringRef applicationID, Boolean * _Nullable keyExistsAndHasValidFormat); + + + + +extern +CFIndex CFPreferencesGetAppIntegerValue(CFStringRef key, CFStringRef applicationID, Boolean * _Nullable keyExistsAndHasValidFormat); + + + + +extern +void CFPreferencesSetAppValue(CFStringRef key, _Nullable CFPropertyListRef value, CFStringRef applicationID); + + + + + +extern +void CFPreferencesAddSuitePreferencesToApp(CFStringRef applicationID, CFStringRef suiteID); + +extern +void CFPreferencesRemoveSuitePreferencesFromApp(CFStringRef applicationID, CFStringRef suiteID); + + + +extern +Boolean CFPreferencesAppSynchronize(CFStringRef applicationID); + + + + + +extern +_Nullable CFPropertyListRef CFPreferencesCopyValue(CFStringRef key, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName); + + + + + +extern +CFDictionaryRef CFPreferencesCopyMultiple(_Nullable CFArrayRef keysToFetch, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName); + + + +extern +void CFPreferencesSetValue(CFStringRef key, _Nullable CFPropertyListRef value, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName); + + + +extern +void CFPreferencesSetMultiple(_Nullable CFDictionaryRef keysToSet, _Nullable CFArrayRef keysToRemove, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName); + +extern +Boolean CFPreferencesSynchronize(CFStringRef applicationID, CFStringRef userName, CFStringRef hostName); + + + + + +extern +_Nullable CFArrayRef CFPreferencesCopyApplicationList(CFStringRef userName, CFStringRef hostName) __attribute__((availability(macosx,introduced=10_0,deprecated=10_9,message="" ))); + + + + +extern +_Nullable CFArrayRef CFPreferencesCopyKeyList(CFStringRef applicationID, CFStringRef userName, CFStringRef hostName); + + + + + + + +extern +Boolean CFPreferencesAppValueIsForced(CFStringRef key, CFStringRef applicationID); +typedef CFIndex CFURLPathStyle; enum { + kCFURLPOSIXPathStyle = 0, + kCFURLHFSPathStyle __attribute__((availability(macosx,introduced=10_0,deprecated=10_9,message="" ))), + kCFURLWindowsPathStyle +}; + +typedef const struct __attribute__((objc_bridge(NSURL))) __CFURL * CFURLRef; +extern +CFTypeID CFURLGetTypeID(void); +extern +CFURLRef CFURLCreateWithBytes(CFAllocatorRef allocator, const UInt8 *URLBytes, CFIndex length, CFStringEncoding encoding, CFURLRef baseURL); + + + + + +extern +CFDataRef CFURLCreateData(CFAllocatorRef allocator, CFURLRef url, CFStringEncoding encoding, Boolean escapeWhitespace); + + +extern +CFURLRef CFURLCreateWithString(CFAllocatorRef allocator, CFStringRef URLString, CFURLRef baseURL); +extern +CFURLRef CFURLCreateAbsoluteURLWithBytes(CFAllocatorRef alloc, const UInt8 *relativeURLBytes, CFIndex length, CFStringEncoding encoding, CFURLRef baseURL, Boolean useCompatibilityMode); + + + + + + + +extern +CFURLRef CFURLCreateWithFileSystemPath(CFAllocatorRef allocator, CFStringRef filePath, CFURLPathStyle pathStyle, Boolean isDirectory); + +extern +CFURLRef CFURLCreateFromFileSystemRepresentation(CFAllocatorRef allocator, const UInt8 *buffer, CFIndex bufLen, Boolean isDirectory); + + + + + + + +extern +CFURLRef CFURLCreateWithFileSystemPathRelativeToBase(CFAllocatorRef allocator, CFStringRef filePath, CFURLPathStyle pathStyle, Boolean isDirectory, CFURLRef baseURL); + +extern +CFURLRef CFURLCreateFromFileSystemRepresentationRelativeToBase(CFAllocatorRef allocator, const UInt8 *buffer, CFIndex bufLen, Boolean isDirectory, CFURLRef baseURL); +extern +Boolean CFURLGetFileSystemRepresentation(CFURLRef url, Boolean resolveAgainstBase, UInt8 *buffer, CFIndex maxBufLen); + + +extern +CFURLRef CFURLCopyAbsoluteURL(CFURLRef relativeURL); + + +extern +CFStringRef CFURLGetString(CFURLRef anURL); + + +extern +CFURLRef CFURLGetBaseURL(CFURLRef anURL); +extern +Boolean CFURLCanBeDecomposed(CFURLRef anURL); + +extern +CFStringRef CFURLCopyScheme(CFURLRef anURL); + + +extern +CFStringRef CFURLCopyNetLocation(CFURLRef anURL); +extern +CFStringRef CFURLCopyPath(CFURLRef anURL); + + +extern +CFStringRef CFURLCopyStrictPath(CFURLRef anURL, Boolean *isAbsolute); + + + + +extern +CFStringRef CFURLCopyFileSystemPath(CFURLRef anURL, CFURLPathStyle pathStyle); + + + +extern +Boolean CFURLHasDirectoryPath(CFURLRef anURL); + + + + +extern +CFStringRef CFURLCopyResourceSpecifier(CFURLRef anURL); + + +extern +CFStringRef CFURLCopyHostName(CFURLRef anURL); + +extern +SInt32 CFURLGetPortNumber(CFURLRef anURL); + + +extern +CFStringRef CFURLCopyUserName(CFURLRef anURL); + + +extern +CFStringRef CFURLCopyPassword(CFURLRef anURL); + + + + + + + +extern +CFStringRef CFURLCopyParameterString(CFURLRef anURL, CFStringRef charactersToLeaveEscaped); + +extern +CFStringRef CFURLCopyQueryString(CFURLRef anURL, CFStringRef charactersToLeaveEscaped); + +extern +CFStringRef CFURLCopyFragment(CFURLRef anURL, CFStringRef charactersToLeaveEscaped); + + +extern +CFStringRef CFURLCopyLastPathComponent(CFURLRef url); + + +extern +CFStringRef CFURLCopyPathExtension(CFURLRef url); + +extern +CFURLRef CFURLCreateCopyAppendingPathComponent(CFAllocatorRef allocator, CFURLRef url, CFStringRef pathComponent, Boolean isDirectory); + +extern +CFURLRef CFURLCreateCopyDeletingLastPathComponent(CFAllocatorRef allocator, CFURLRef url); + +extern +CFURLRef CFURLCreateCopyAppendingPathExtension(CFAllocatorRef allocator, CFURLRef url, CFStringRef extension); + +extern +CFURLRef CFURLCreateCopyDeletingPathExtension(CFAllocatorRef allocator, CFURLRef url); + + + + + + + +extern +CFIndex CFURLGetBytes(CFURLRef url, UInt8 *buffer, CFIndex bufferLength); + +typedef CFIndex CFURLComponentType; enum { + kCFURLComponentScheme = 1, + kCFURLComponentNetLocation = 2, + kCFURLComponentPath = 3, + kCFURLComponentResourceSpecifier = 4, + + kCFURLComponentUser = 5, + kCFURLComponentPassword = 6, + kCFURLComponentUserInfo = 7, + kCFURLComponentHost = 8, + kCFURLComponentPort = 9, + kCFURLComponentParameterString = 10, + kCFURLComponentQuery = 11, + kCFURLComponentFragment = 12 +}; +extern +CFRange CFURLGetByteRangeForComponent(CFURLRef url, CFURLComponentType component, CFRange *rangeIncludingSeparators); +extern +CFStringRef CFURLCreateStringByReplacingPercentEscapes(CFAllocatorRef allocator, CFStringRef originalString, CFStringRef charactersToLeaveEscaped); + + +extern +CFStringRef CFURLCreateStringByReplacingPercentEscapesUsingEncoding(CFAllocatorRef allocator, CFStringRef origString, CFStringRef charsToLeaveEscaped, CFStringEncoding encoding) __attribute__((availability(macosx,introduced=10_0,deprecated=10_11,message="" "Use [NSString stringByRemovingPercentEncoding] or CFURLCreateStringByReplacingPercentEscapes() instead, which always uses the recommended UTF-8 encoding."))); +extern +CFStringRef CFURLCreateStringByAddingPercentEscapes(CFAllocatorRef allocator, CFStringRef originalString, CFStringRef charactersToLeaveUnescaped, CFStringRef legalURLCharactersToBeEscaped, CFStringEncoding encoding) __attribute__((availability(macosx,introduced=10_0,deprecated=10_11,message="" "Use [NSString stringByAddingPercentEncodingWithAllowedCharacters:] instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent (since each URL component or subcomponent has different rules for what characters are valid)."))); +extern +Boolean CFURLIsFileReferenceURL(CFURLRef url) __attribute__((availability(macosx,introduced=10_9))); +extern +CFURLRef CFURLCreateFileReferenceURL(CFAllocatorRef allocator, CFURLRef url, CFErrorRef *error) __attribute__((availability(macosx,introduced=10_6))); +extern +CFURLRef CFURLCreateFilePathURL(CFAllocatorRef allocator, CFURLRef url, CFErrorRef *error) __attribute__((availability(macosx,introduced=10_6))); + + + + + + + +struct FSRef; + + + +extern +CFURLRef CFURLCreateFromFSRef(CFAllocatorRef allocator, const struct FSRef *fsRef) __attribute__((availability(macosx,introduced=10_0,deprecated=10_9,message="" ))); + +extern +Boolean CFURLGetFSRef(CFURLRef url, struct FSRef *fsRef) __attribute__((availability(macosx,introduced=10_0,deprecated=10_9,message="" ))); +extern +Boolean CFURLCopyResourcePropertyForKey(CFURLRef url, CFStringRef key, void *propertyValueTypeRefPtr, CFErrorRef *error) __attribute__((availability(macosx,introduced=10_6))); +extern +CFDictionaryRef CFURLCopyResourcePropertiesForKeys(CFURLRef url, CFArrayRef keys, CFErrorRef *error) __attribute__((availability(macosx,introduced=10_6))); +extern +Boolean CFURLSetResourcePropertyForKey(CFURLRef url, CFStringRef key, CFTypeRef propertyValue, CFErrorRef *error) __attribute__((availability(macosx,introduced=10_6))); +extern +Boolean CFURLSetResourcePropertiesForKeys(CFURLRef url, CFDictionaryRef keyedPropertyValues, CFErrorRef *error) __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLKeysOfUnsetValuesKey __attribute__((availability(macosx,introduced=10_7))); +extern +void CFURLClearResourcePropertyCacheForKey(CFURLRef url, CFStringRef key) __attribute__((availability(macosx,introduced=10_6))); +extern +void CFURLClearResourcePropertyCache(CFURLRef url) __attribute__((availability(macosx,introduced=10_6))); +extern +void CFURLSetTemporaryResourcePropertyForKey(CFURLRef url, CFStringRef key, CFTypeRef propertyValue) __attribute__((availability(macosx,introduced=10_6))); +extern +Boolean CFURLResourceIsReachable(CFURLRef url, CFErrorRef *error) __attribute__((availability(macosx,introduced=10_6))); + + + + + + +extern +const CFStringRef kCFURLNameKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLLocalizedNameKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLIsRegularFileKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLIsDirectoryKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLIsSymbolicLinkKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLIsVolumeKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLIsPackageKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLIsApplicationKey __attribute__((availability(macosx,introduced=10_11))); + + +extern +const CFStringRef kCFURLApplicationIsScriptableKey __attribute__((availability(macosx,introduced=10_11))); + + +extern +const CFStringRef kCFURLIsSystemImmutableKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLIsUserImmutableKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLIsHiddenKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLHasHiddenExtensionKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLCreationDateKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLContentAccessDateKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLContentModificationDateKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLAttributeModificationDateKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLLinkCountKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLParentDirectoryURLKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLVolumeURLKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLTypeIdentifierKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLLocalizedTypeDescriptionKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLLabelNumberKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLLabelColorKey __attribute__((availability(macosx,introduced=10.6,deprecated=10.12,message="Use NSURLLabelColorKey"))) __attribute__((availability(ios,introduced=4.0,deprecated=10.0,message="Use NSURLLabelColorKey"))) __attribute__((availability(watchos,introduced=2.0,deprecated=3.0,message="Use NSURLLabelColorKey"))) __attribute__((availability(tvos,introduced=9.0,deprecated=10.0,message="Use NSURLLabelColorKey"))); + + +extern +const CFStringRef kCFURLLocalizedLabelKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLEffectiveIconKey __attribute__((availability(macosx,introduced=10.6,deprecated=10.12,message="Use NSURLEffectiveIconKey"))) __attribute__((availability(ios,introduced=4.0,deprecated=10.0,message="Use NSURLEffectiveIconKey"))) __attribute__((availability(watchos,introduced=2.0,deprecated=3.0,message="Use NSURLEffectiveIconKey"))) __attribute__((availability(tvos,introduced=9.0,deprecated=10.0,message="Use NSURLEffectiveIconKey"))); + + +extern +const CFStringRef kCFURLCustomIconKey __attribute__((availability(macosx,introduced=10.6,deprecated=10.12,message="Use NSURLCustomIconKey"))) __attribute__((availability(ios,introduced=4.0,deprecated=10.0,message="Use NSURLCustomIconKey"))) __attribute__((availability(watchos,introduced=2.0,deprecated=3.0,message="Use NSURLCustomIconKey"))) __attribute__((availability(tvos,introduced=9.0,deprecated=10.0,message="Use NSURLCustomIconKey"))); + + +extern +const CFStringRef kCFURLFileResourceIdentifierKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLVolumeIdentifierKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLPreferredIOBlockSizeKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLIsReadableKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLIsWritableKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLIsExecutableKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLFileSecurityKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLIsExcludedFromBackupKey __attribute__((availability(macosx,introduced=10_8))); + + +extern +const CFStringRef kCFURLTagNamesKey __attribute__((availability(macosx,introduced=10_9))); + + +extern +const CFStringRef kCFURLPathKey __attribute__((availability(macosx,introduced=10_8))); + + +extern +const CFStringRef kCFURLCanonicalPathKey __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) __attribute__((availability(tvos,introduced=10.0))); + + +extern +const CFStringRef kCFURLIsMountTriggerKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLGenerationIdentifierKey __attribute__((availability(macosx,introduced=10_10))); + + +extern +const CFStringRef kCFURLDocumentIdentifierKey __attribute__((availability(macosx,introduced=10_10))); + + +extern +const CFStringRef kCFURLAddedToDirectoryDateKey __attribute__((availability(macosx,introduced=10_10))); + + +extern +const CFStringRef kCFURLQuarantinePropertiesKey __attribute__((availability(macosx,introduced=10_10))); + + +extern +const CFStringRef kCFURLFileResourceTypeKey __attribute__((availability(macosx,introduced=10_7))); + + + +extern +const CFStringRef kCFURLFileResourceTypeNamedPipe __attribute__((availability(macosx,introduced=10_7))); +extern +const CFStringRef kCFURLFileResourceTypeCharacterSpecial __attribute__((availability(macosx,introduced=10_7))); +extern +const CFStringRef kCFURLFileResourceTypeDirectory __attribute__((availability(macosx,introduced=10_7))); +extern +const CFStringRef kCFURLFileResourceTypeBlockSpecial __attribute__((availability(macosx,introduced=10_7))); +extern +const CFStringRef kCFURLFileResourceTypeRegular __attribute__((availability(macosx,introduced=10_7))); +extern +const CFStringRef kCFURLFileResourceTypeSymbolicLink __attribute__((availability(macosx,introduced=10_7))); +extern +const CFStringRef kCFURLFileResourceTypeSocket __attribute__((availability(macosx,introduced=10_7))); +extern +const CFStringRef kCFURLFileResourceTypeUnknown __attribute__((availability(macosx,introduced=10_7))); + + + +extern +const CFStringRef kCFURLFileSizeKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLFileAllocatedSizeKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLTotalFileSizeKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLTotalFileAllocatedSizeKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLIsAliasFileKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLFileProtectionKey __attribute__((availability(macosx,unavailable))); + + + +extern +const CFStringRef kCFURLFileProtectionNone __attribute__((availability(macosx,unavailable))); + +extern +const CFStringRef kCFURLFileProtectionComplete __attribute__((availability(macosx,unavailable))); + +extern +const CFStringRef kCFURLFileProtectionCompleteUnlessOpen __attribute__((availability(macosx,unavailable))); + +extern +const CFStringRef kCFURLFileProtectionCompleteUntilFirstUserAuthentication __attribute__((availability(macosx,unavailable))); + + + + + +extern +const CFStringRef kCFURLVolumeLocalizedFormatDescriptionKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLVolumeTotalCapacityKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLVolumeAvailableCapacityKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLVolumeResourceCountKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLVolumeSupportsPersistentIDsKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLVolumeSupportsSymbolicLinksKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLVolumeSupportsHardLinksKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLVolumeSupportsJournalingKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLVolumeIsJournalingKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLVolumeSupportsSparseFilesKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLVolumeSupportsZeroRunsKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLVolumeSupportsCaseSensitiveNamesKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLVolumeSupportsCasePreservedNamesKey __attribute__((availability(macosx,introduced=10_6))); + + +extern +const CFStringRef kCFURLVolumeSupportsRootDirectoryDatesKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLVolumeSupportsVolumeSizesKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLVolumeSupportsRenamingKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLVolumeSupportsAdvisoryFileLockingKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLVolumeSupportsExtendedSecurityKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLVolumeIsBrowsableKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLVolumeMaximumFileSizeKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLVolumeIsEjectableKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLVolumeIsRemovableKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLVolumeIsInternalKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLVolumeIsAutomountedKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLVolumeIsLocalKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLVolumeIsReadOnlyKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLVolumeCreationDateKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLVolumeURLForRemountingKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLVolumeUUIDStringKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLVolumeNameKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLVolumeLocalizedNameKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLVolumeIsEncryptedKey __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) __attribute__((availability(tvos,introduced=10.0))); + + +extern +const CFStringRef kCFURLVolumeIsRootFileSystemKey __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) __attribute__((availability(tvos,introduced=10.0))); + + +extern +const CFStringRef kCFURLVolumeSupportsCompressionKey __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) __attribute__((availability(tvos,introduced=10.0))); + + +extern +const CFStringRef kCFURLVolumeSupportsFileCloningKey __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) __attribute__((availability(tvos,introduced=10.0))); + + +extern +const CFStringRef kCFURLVolumeSupportsSwapRenamingKey __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) __attribute__((availability(tvos,introduced=10.0))); + + +extern +const CFStringRef kCFURLVolumeSupportsExclusiveRenamingKey __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) __attribute__((availability(tvos,introduced=10.0))); + + + + +extern +const CFStringRef kCFURLIsUbiquitousItemKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLUbiquitousItemHasUnresolvedConflictsKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLUbiquitousItemIsDownloadedKey __attribute__((availability(macosx,introduced=10_7,deprecated=10_9,message="" "Use kCFURLUbiquitousItemDownloadingStatusKey instead"))); + + +extern +const CFStringRef kCFURLUbiquitousItemIsDownloadingKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLUbiquitousItemIsUploadedKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLUbiquitousItemIsUploadingKey __attribute__((availability(macosx,introduced=10_7))); + + +extern +const CFStringRef kCFURLUbiquitousItemPercentDownloadedKey __attribute__((availability(macosx,introduced=10_7,deprecated=10_8,message="" "Use NSMetadataQuery and NSMetadataUbiquitousItemPercentDownloadedKey on NSMetadataItem instead"))); + + +extern +const CFStringRef kCFURLUbiquitousItemPercentUploadedKey __attribute__((availability(macosx,introduced=10_7,deprecated=10_8,message="" "Use NSMetadataQuery and NSMetadataUbiquitousItemPercentUploadedKey on NSMetadataItem instead"))); + + +extern +const CFStringRef kCFURLUbiquitousItemDownloadingStatusKey __attribute__((availability(macosx,introduced=10_9))); + + +extern +const CFStringRef kCFURLUbiquitousItemDownloadingErrorKey __attribute__((availability(macosx,introduced=10_9))); + + +extern +const CFStringRef kCFURLUbiquitousItemUploadingErrorKey __attribute__((availability(macosx,introduced=10_9))); + + + + +extern +const CFStringRef kCFURLUbiquitousItemDownloadingStatusNotDownloaded __attribute__((availability(macosx,introduced=10_9))); + + +extern +const CFStringRef kCFURLUbiquitousItemDownloadingStatusDownloaded __attribute__((availability(macosx,introduced=10_9))); + + +extern +const CFStringRef kCFURLUbiquitousItemDownloadingStatusCurrent __attribute__((availability(macosx,introduced=10_9))); + + + +typedef CFOptionFlags CFURLBookmarkCreationOptions; enum { + kCFURLBookmarkCreationMinimalBookmarkMask = ( 1UL << 9 ), + kCFURLBookmarkCreationSuitableForBookmarkFile = ( 1UL << 10 ), + kCFURLBookmarkCreationWithSecurityScope __attribute__((availability(macosx,introduced=10_7))) = ( 1UL << 11 ), + kCFURLBookmarkCreationSecurityScopeAllowOnlyReadAccess __attribute__((availability(macosx,introduced=10_7))) = ( 1UL << 12 ), + + + kCFURLBookmarkCreationPreferFileIDResolutionMask __attribute__((availability(macosx,introduced=10_6,deprecated=10_9,message="" "kCFURLBookmarkCreationPreferFileIDResolutionMask does nothing and has no effect on bookmark resolution"))) = ( 1UL << 8 ), +} __attribute__((availability(macosx,introduced=10_6))); + +typedef CFOptionFlags CFURLBookmarkResolutionOptions; enum { + kCFURLBookmarkResolutionWithoutUIMask = ( 1UL << 8 ), + kCFURLBookmarkResolutionWithoutMountingMask = ( 1UL << 9 ), + kCFURLBookmarkResolutionWithSecurityScope __attribute__((availability(macosx,introduced=10_7))) = ( 1UL << 10 ), + + kCFBookmarkResolutionWithoutUIMask = kCFURLBookmarkResolutionWithoutUIMask, + kCFBookmarkResolutionWithoutMountingMask = kCFURLBookmarkResolutionWithoutMountingMask, +} __attribute__((availability(macosx,introduced=10_6))); + +typedef CFOptionFlags CFURLBookmarkFileCreationOptions; + + + + + +extern +CFDataRef CFURLCreateBookmarkData ( CFAllocatorRef allocator, CFURLRef url, CFURLBookmarkCreationOptions options, CFArrayRef resourcePropertiesToInclude, CFURLRef relativeToURL, CFErrorRef* error ) __attribute__((availability(macosx,introduced=10_6))); + + + +extern +CFURLRef CFURLCreateByResolvingBookmarkData ( CFAllocatorRef allocator, CFDataRef bookmark, CFURLBookmarkResolutionOptions options, CFURLRef relativeToURL, CFArrayRef resourcePropertiesToInclude, Boolean* isStale, CFErrorRef* error ) __attribute__((availability(macosx,introduced=10_6))); + + + +extern +CFDictionaryRef CFURLCreateResourcePropertiesForKeysFromBookmarkData ( CFAllocatorRef allocator, CFArrayRef resourcePropertiesToReturn, CFDataRef bookmark ) __attribute__((availability(macosx,introduced=10_6))); + + + +extern +CFTypeRef CFURLCreateResourcePropertyForKeyFromBookmarkData( CFAllocatorRef allocator, CFStringRef resourcePropertyKey, CFDataRef bookmark ) __attribute__((availability(macosx,introduced=10_6))); + + + +extern +CFDataRef CFURLCreateBookmarkDataFromFile(CFAllocatorRef allocator, CFURLRef fileURL, CFErrorRef *errorRef ) __attribute__((availability(macosx,introduced=10_6))); + + + +extern +Boolean CFURLWriteBookmarkDataToFile( CFDataRef bookmarkRef, CFURLRef fileURL, CFURLBookmarkFileCreationOptions options, CFErrorRef *errorRef ) __attribute__((availability(macosx,introduced=10_6))); + + + +extern +CFDataRef CFURLCreateBookmarkDataFromAliasRecord ( CFAllocatorRef allocatorRef, CFDataRef aliasRecordDataRef ) __attribute__((availability(macosx,introduced=10_6))); + + + + + +extern +Boolean CFURLStartAccessingSecurityScopedResource(CFURLRef url) __attribute__((availability(macosx,introduced=10_7))); + + + +extern +void CFURLStopAccessingSecurityScopedResource(CFURLRef url) __attribute__((availability(macosx,introduced=10_7))); +typedef unsigned int boolean_t; +typedef __darwin_natural_t natural_t; +typedef int integer_t; + + + + + + +typedef uintptr_t vm_offset_t; +typedef uintptr_t vm_size_t; +typedef uint64_t mach_vm_address_t; +typedef uint64_t mach_vm_offset_t; +typedef uint64_t mach_vm_size_t; + +typedef uint64_t vm_map_offset_t; +typedef uint64_t vm_map_address_t; +typedef uint64_t vm_map_size_t; + +typedef mach_vm_address_t mach_port_context_t; +typedef natural_t mach_port_name_t; +typedef mach_port_name_t *mach_port_name_array_t; +typedef __darwin_mach_port_t mach_port_t; + + +typedef mach_port_t *mach_port_array_t; +typedef natural_t mach_port_right_t; +typedef natural_t mach_port_type_t; +typedef mach_port_type_t *mach_port_type_array_t; +typedef natural_t mach_port_urefs_t; +typedef integer_t mach_port_delta_t; + + + +typedef natural_t mach_port_seqno_t; +typedef natural_t mach_port_mscount_t; +typedef natural_t mach_port_msgcount_t; +typedef natural_t mach_port_rights_t; + + + + + + +typedef unsigned int mach_port_srights_t; + +typedef struct mach_port_status { + mach_port_rights_t mps_pset; + mach_port_seqno_t mps_seqno; + mach_port_mscount_t mps_mscount; + mach_port_msgcount_t mps_qlimit; + mach_port_msgcount_t mps_msgcount; + mach_port_rights_t mps_sorights; + boolean_t mps_srights; + boolean_t mps_pdrequest; + boolean_t mps_nsrequest; + natural_t mps_flags; +} mach_port_status_t; +typedef struct mach_port_limits { + mach_port_msgcount_t mpl_qlimit; +} mach_port_limits_t; +typedef struct mach_port_info_ext { + mach_port_status_t mpie_status; + mach_port_msgcount_t mpie_boost_cnt; + uint32_t reserved[6]; +} mach_port_info_ext_t; + +typedef integer_t *mach_port_info_t; + + +typedef int mach_port_flavor_t; +typedef struct mach_port_qos { + unsigned int name:1; + unsigned int prealloc:1; + boolean_t pad1:30; + natural_t len; +} mach_port_qos_t; +typedef struct mach_port_options { + uint32_t flags; + mach_port_limits_t mpl; + uint64_t reserved[2]; +}mach_port_options_t; + +typedef mach_port_options_t *mach_port_options_ptr_t; +enum mach_port_guard_exception_codes { + kGUARD_EXC_DESTROY = 1u << 0, + kGUARD_EXC_MOD_REFS = 1u << 1, + kGUARD_EXC_SET_CONTEXT = 1u << 2, + kGUARD_EXC_UNGUARDED = 1u << 3, + kGUARD_EXC_INCORRECT_GUARD = 1u << 4 +}; + + + + + +typedef CFStringRef CFRunLoopMode __attribute__((swift_wrapper(struct))); + +typedef struct __attribute__((objc_bridge_mutable(id))) __CFRunLoop * CFRunLoopRef; + +typedef struct __attribute__((objc_bridge_mutable(id))) __CFRunLoopSource * CFRunLoopSourceRef; + +typedef struct __attribute__((objc_bridge_mutable(id))) __CFRunLoopObserver * CFRunLoopObserverRef; + +typedef struct __attribute__((objc_bridge_mutable(NSTimer))) __CFRunLoopTimer * CFRunLoopTimerRef; + + +typedef SInt32 CFRunLoopRunResult; enum { + kCFRunLoopRunFinished = 1, + kCFRunLoopRunStopped = 2, + kCFRunLoopRunTimedOut = 3, + kCFRunLoopRunHandledSource = 4 +}; + + +typedef CFOptionFlags CFRunLoopActivity; enum { + kCFRunLoopEntry = (1UL << 0), + kCFRunLoopBeforeTimers = (1UL << 1), + kCFRunLoopBeforeSources = (1UL << 2), + kCFRunLoopBeforeWaiting = (1UL << 5), + kCFRunLoopAfterWaiting = (1UL << 6), + kCFRunLoopExit = (1UL << 7), + kCFRunLoopAllActivities = 0x0FFFFFFFU +}; + +extern const CFRunLoopMode kCFRunLoopDefaultMode; +extern const CFRunLoopMode kCFRunLoopCommonModes; + +extern CFTypeID CFRunLoopGetTypeID(void); + +extern CFRunLoopRef CFRunLoopGetCurrent(void); +extern CFRunLoopRef CFRunLoopGetMain(void); + +extern CFRunLoopMode CFRunLoopCopyCurrentMode(CFRunLoopRef rl); + +extern CFArrayRef CFRunLoopCopyAllModes(CFRunLoopRef rl); + +extern void CFRunLoopAddCommonMode(CFRunLoopRef rl, CFRunLoopMode mode); + +extern CFAbsoluteTime CFRunLoopGetNextTimerFireDate(CFRunLoopRef rl, CFRunLoopMode mode); + +extern void CFRunLoopRun(void); +extern CFRunLoopRunResult CFRunLoopRunInMode(CFRunLoopMode mode, CFTimeInterval seconds, Boolean returnAfterSourceHandled); +extern Boolean CFRunLoopIsWaiting(CFRunLoopRef rl); +extern void CFRunLoopWakeUp(CFRunLoopRef rl); +extern void CFRunLoopStop(CFRunLoopRef rl); + + +extern void CFRunLoopPerformBlock(CFRunLoopRef rl, CFTypeRef mode, void (^block)(void)) __attribute__((availability(macosx,introduced=10_6))); + + +extern Boolean CFRunLoopContainsSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFRunLoopMode mode); +extern void CFRunLoopAddSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFRunLoopMode mode); +extern void CFRunLoopRemoveSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFRunLoopMode mode); + +extern Boolean CFRunLoopContainsObserver(CFRunLoopRef rl, CFRunLoopObserverRef observer, CFRunLoopMode mode); +extern void CFRunLoopAddObserver(CFRunLoopRef rl, CFRunLoopObserverRef observer, CFRunLoopMode mode); +extern void CFRunLoopRemoveObserver(CFRunLoopRef rl, CFRunLoopObserverRef observer, CFRunLoopMode mode); + +extern Boolean CFRunLoopContainsTimer(CFRunLoopRef rl, CFRunLoopTimerRef timer, CFRunLoopMode mode); +extern void CFRunLoopAddTimer(CFRunLoopRef rl, CFRunLoopTimerRef timer, CFRunLoopMode mode); +extern void CFRunLoopRemoveTimer(CFRunLoopRef rl, CFRunLoopTimerRef timer, CFRunLoopMode mode); + +typedef struct { + CFIndex version; + void * info; + const void *(*retain)(const void *info); + void (*release)(const void *info); + CFStringRef (*copyDescription)(const void *info); + Boolean (*equal)(const void *info1, const void *info2); + CFHashCode (*hash)(const void *info); + void (*schedule)(void *info, CFRunLoopRef rl, CFRunLoopMode mode); + void (*cancel)(void *info, CFRunLoopRef rl, CFRunLoopMode mode); + void (*perform)(void *info); +} CFRunLoopSourceContext; + +typedef struct { + CFIndex version; + void * info; + const void *(*retain)(const void *info); + void (*release)(const void *info); + CFStringRef (*copyDescription)(const void *info); + Boolean (*equal)(const void *info1, const void *info2); + CFHashCode (*hash)(const void *info); + + mach_port_t (*getPort)(void *info); + void * (*perform)(void *msg, CFIndex size, CFAllocatorRef allocator, void *info); + + + + +} CFRunLoopSourceContext1; + +extern CFTypeID CFRunLoopSourceGetTypeID(void); + +extern CFRunLoopSourceRef CFRunLoopSourceCreate(CFAllocatorRef allocator, CFIndex order, CFRunLoopSourceContext *context); + +extern CFIndex CFRunLoopSourceGetOrder(CFRunLoopSourceRef source); +extern void CFRunLoopSourceInvalidate(CFRunLoopSourceRef source); +extern Boolean CFRunLoopSourceIsValid(CFRunLoopSourceRef source); +extern void CFRunLoopSourceGetContext(CFRunLoopSourceRef source, CFRunLoopSourceContext *context); +extern void CFRunLoopSourceSignal(CFRunLoopSourceRef source); + +typedef struct { + CFIndex version; + void * info; + const void *(*retain)(const void *info); + void (*release)(const void *info); + CFStringRef (*copyDescription)(const void *info); +} CFRunLoopObserverContext; + +typedef void (*CFRunLoopObserverCallBack)(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info); + +extern CFTypeID CFRunLoopObserverGetTypeID(void); + +extern CFRunLoopObserverRef CFRunLoopObserverCreate(CFAllocatorRef allocator, CFOptionFlags activities, Boolean repeats, CFIndex order, CFRunLoopObserverCallBack callout, CFRunLoopObserverContext *context); + +extern CFRunLoopObserverRef CFRunLoopObserverCreateWithHandler(CFAllocatorRef allocator, CFOptionFlags activities, Boolean repeats, CFIndex order, void (^block) (CFRunLoopObserverRef observer, CFRunLoopActivity activity)) __attribute__((availability(macosx,introduced=10_7))); + + +extern CFOptionFlags CFRunLoopObserverGetActivities(CFRunLoopObserverRef observer); +extern Boolean CFRunLoopObserverDoesRepeat(CFRunLoopObserverRef observer); +extern CFIndex CFRunLoopObserverGetOrder(CFRunLoopObserverRef observer); +extern void CFRunLoopObserverInvalidate(CFRunLoopObserverRef observer); +extern Boolean CFRunLoopObserverIsValid(CFRunLoopObserverRef observer); +extern void CFRunLoopObserverGetContext(CFRunLoopObserverRef observer, CFRunLoopObserverContext *context); + +typedef struct { + CFIndex version; + void * info; + const void *(*retain)(const void *info); + void (*release)(const void *info); + CFStringRef (*copyDescription)(const void *info); +} CFRunLoopTimerContext; + +typedef void (*CFRunLoopTimerCallBack)(CFRunLoopTimerRef timer, void *info); + +extern CFTypeID CFRunLoopTimerGetTypeID(void); + +extern CFRunLoopTimerRef CFRunLoopTimerCreate(CFAllocatorRef allocator, CFAbsoluteTime fireDate, CFTimeInterval interval, CFOptionFlags flags, CFIndex order, CFRunLoopTimerCallBack callout, CFRunLoopTimerContext *context); + +extern CFRunLoopTimerRef CFRunLoopTimerCreateWithHandler(CFAllocatorRef allocator, CFAbsoluteTime fireDate, CFTimeInterval interval, CFOptionFlags flags, CFIndex order, void (^block) (CFRunLoopTimerRef timer)) __attribute__((availability(macosx,introduced=10_7))); + + +extern CFAbsoluteTime CFRunLoopTimerGetNextFireDate(CFRunLoopTimerRef timer); +extern void CFRunLoopTimerSetNextFireDate(CFRunLoopTimerRef timer, CFAbsoluteTime fireDate); +extern CFTimeInterval CFRunLoopTimerGetInterval(CFRunLoopTimerRef timer); +extern Boolean CFRunLoopTimerDoesRepeat(CFRunLoopTimerRef timer); +extern CFIndex CFRunLoopTimerGetOrder(CFRunLoopTimerRef timer); +extern void CFRunLoopTimerInvalidate(CFRunLoopTimerRef timer); +extern Boolean CFRunLoopTimerIsValid(CFRunLoopTimerRef timer); +extern void CFRunLoopTimerGetContext(CFRunLoopTimerRef timer, CFRunLoopTimerContext *context); + + + +extern CFTimeInterval CFRunLoopTimerGetTolerance(CFRunLoopTimerRef timer) __attribute__((availability(macosx,introduced=10_9))); +extern void CFRunLoopTimerSetTolerance(CFRunLoopTimerRef timer, CFTimeInterval tolerance) __attribute__((availability(macosx,introduced=10_9))); +typedef struct __attribute__((objc_bridge_mutable(id))) __CFSocket * CFSocketRef; +typedef CFIndex CFSocketError; enum { + kCFSocketSuccess = 0, + kCFSocketError = -1L, + kCFSocketTimeout = -2L +}; + +typedef struct { + SInt32 protocolFamily; + SInt32 socketType; + SInt32 protocol; + CFDataRef address; +} CFSocketSignature; + + +typedef CFOptionFlags CFSocketCallBackType; enum { + kCFSocketNoCallBack = 0, + kCFSocketReadCallBack = 1, + kCFSocketAcceptCallBack = 2, + kCFSocketDataCallBack = 3, + kCFSocketConnectCallBack = 4, + kCFSocketWriteCallBack = 8 +}; + + +enum { + kCFSocketAutomaticallyReenableReadCallBack = 1, + kCFSocketAutomaticallyReenableAcceptCallBack = 2, + kCFSocketAutomaticallyReenableDataCallBack = 3, + kCFSocketAutomaticallyReenableWriteCallBack = 8, + kCFSocketLeaveErrors __attribute__((availability(macosx,introduced=10_5))) = 64, + kCFSocketCloseOnInvalidate = 128 +}; + +typedef void (*CFSocketCallBack)(CFSocketRef s, CFSocketCallBackType type, CFDataRef address, const void *data, void *info); + + +typedef struct { + CFIndex version; + void * info; + const void *(*retain)(const void *info); + void (*release)(const void *info); + CFStringRef (*copyDescription)(const void *info); +} CFSocketContext; + + + + +typedef int CFSocketNativeHandle; + + +extern CFTypeID CFSocketGetTypeID(void); + +extern CFSocketRef CFSocketCreate(CFAllocatorRef allocator, SInt32 protocolFamily, SInt32 socketType, SInt32 protocol, CFOptionFlags callBackTypes, CFSocketCallBack callout, const CFSocketContext *context); +extern CFSocketRef CFSocketCreateWithNative(CFAllocatorRef allocator, CFSocketNativeHandle sock, CFOptionFlags callBackTypes, CFSocketCallBack callout, const CFSocketContext *context); +extern CFSocketRef CFSocketCreateWithSocketSignature(CFAllocatorRef allocator, const CFSocketSignature *signature, CFOptionFlags callBackTypes, CFSocketCallBack callout, const CFSocketContext *context); + +extern CFSocketRef CFSocketCreateConnectedToSocketSignature(CFAllocatorRef allocator, const CFSocketSignature *signature, CFOptionFlags callBackTypes, CFSocketCallBack callout, const CFSocketContext *context, CFTimeInterval timeout); + + +extern CFSocketError CFSocketSetAddress(CFSocketRef s, CFDataRef address); +extern CFSocketError CFSocketConnectToAddress(CFSocketRef s, CFDataRef address, CFTimeInterval timeout); +extern void CFSocketInvalidate(CFSocketRef s); + +extern Boolean CFSocketIsValid(CFSocketRef s); +extern CFDataRef CFSocketCopyAddress(CFSocketRef s); +extern CFDataRef CFSocketCopyPeerAddress(CFSocketRef s); +extern void CFSocketGetContext(CFSocketRef s, CFSocketContext *context); +extern CFSocketNativeHandle CFSocketGetNative(CFSocketRef s); + +extern CFRunLoopSourceRef CFSocketCreateRunLoopSource(CFAllocatorRef allocator, CFSocketRef s, CFIndex order); + +extern CFOptionFlags CFSocketGetSocketFlags(CFSocketRef s); +extern void CFSocketSetSocketFlags(CFSocketRef s, CFOptionFlags flags); +extern void CFSocketDisableCallBacks(CFSocketRef s, CFOptionFlags callBackTypes); +extern void CFSocketEnableCallBacks(CFSocketRef s, CFOptionFlags callBackTypes); + + + +extern CFSocketError CFSocketSendData(CFSocketRef s, CFDataRef address, CFDataRef data, CFTimeInterval timeout); +extern CFSocketError CFSocketRegisterValue(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name, CFPropertyListRef value); +extern CFSocketError CFSocketCopyRegisteredValue(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name, CFPropertyListRef *value, CFDataRef *nameServerAddress); + +extern CFSocketError CFSocketRegisterSocketSignature(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name, const CFSocketSignature *signature); +extern CFSocketError CFSocketCopyRegisteredSocketSignature(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name, CFSocketSignature *signature, CFDataRef *nameServerAddress); + +extern CFSocketError CFSocketUnregister(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name); + +extern void CFSocketSetDefaultNameRegistryPortNumber(UInt16 port); +extern UInt16 CFSocketGetDefaultNameRegistryPortNumber(void); + + +extern const CFStringRef kCFSocketCommandKey; +extern const CFStringRef kCFSocketNameKey; +extern const CFStringRef kCFSocketValueKey; +extern const CFStringRef kCFSocketResultKey; +extern const CFStringRef kCFSocketErrorKey; +extern const CFStringRef kCFSocketRegisterCommand; +extern const CFStringRef kCFSocketRetrieveCommand; + + + + +struct accessx_descriptor { + unsigned int ad_name_offset; + int ad_flags; + int ad_pad[2]; +}; +int getattrlistbulk(int, void *, void *, size_t, uint64_t) __attribute__((availability(macosx,introduced=10.10))); +int faccessat(int, const char *, int, int) __attribute__((availability(macosx,introduced=10.10))); +int fchownat(int, const char *, uid_t, gid_t, int) __attribute__((availability(macosx,introduced=10.10))); +int linkat(int, const char *, int, const char *, int) __attribute__((availability(macosx,introduced=10.10))); +ssize_t readlinkat(int, const char *, char *, size_t) __attribute__((availability(macosx,introduced=10.10))); +int symlinkat(const char *, int, const char *) __attribute__((availability(macosx,introduced=10.10))); +int unlinkat(int, const char *, int) __attribute__((availability(macosx,introduced=10.10))); +int getattrlistat(int, const char *, void *, void *, size_t, unsigned long) __attribute__((availability(macosx,introduced=10.10))); +void _exit(int) __attribute__((noreturn)); +int access(const char *, int); +unsigned int + alarm(unsigned int); +int chdir(const char *); +int chown(const char *, uid_t, gid_t); + +int close(int) __asm("_" "close" ); + +int dup(int); +int dup2(int, int); +int execl(const char * __path, const char * __arg0, ...) __attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))); +int execle(const char * __path, const char * __arg0, ...) __attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))); +int execlp(const char * __file, const char * __arg0, ...) __attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))); +int execv(const char * __path, char * const * __argv) __attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))); +int execve(const char * __file, char * const * __argv, char * const * __envp) __attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))); +int execvp(const char * __file, char * const * __argv) __attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))); +pid_t fork(void) __attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))); +long fpathconf(int, int); +char *getcwd(char *, size_t); +gid_t getegid(void); +uid_t geteuid(void); +gid_t getgid(void); + + + +int getgroups(int, gid_t []); + +char *getlogin(void); +pid_t getpgrp(void); +pid_t getpid(void); +pid_t getppid(void); +uid_t getuid(void); +int isatty(int); +int link(const char *, const char *); +off_t lseek(int, off_t, int); +long pathconf(const char *, int); + +int pause(void) __asm("_" "pause" ); + +int pipe(int [2]); + +ssize_t read(int, void *, size_t) __asm("_" "read" ); + +int rmdir(const char *); +int setgid(gid_t); +int setpgid(pid_t, pid_t); +pid_t setsid(void); +int setuid(uid_t); + +unsigned int + sleep(unsigned int) __asm("_" "sleep" ); + +long sysconf(int); +pid_t tcgetpgrp(int); +int tcsetpgrp(int, pid_t); +char *ttyname(int); + + +int ttyname_r(int, char *, size_t) __asm("_" "ttyname_r" ); + + + + +int unlink(const char *); + +ssize_t write(int __fd, const void * __buf, size_t __nbyte) __asm("_" "write" ); +size_t confstr(int, char *, size_t) __asm("_" "confstr" ); + +int getopt(int, char * const [], const char *) __asm("_" "getopt" ); + +extern char *optarg; +extern int optind, opterr, optopt; +__attribute__((deprecated)) __attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))) + +void *brk(const void *); +int chroot(const char *) ; + + +char *crypt(const char *, const char *); + + + + + + +void encrypt(char *, int) __asm("_" "encrypt" ); + + + +int fchdir(int); +long gethostid(void); +pid_t getpgid(pid_t); +pid_t getsid(pid_t); + + + +int getdtablesize(void) ; +int getpagesize(void) __attribute__((const)) ; +char *getpass(const char *) ; + + + + +char *getwd(char *) ; + + +int lchown(const char *, uid_t, gid_t) __asm("_" "lchown" ); + +int lockf(int, int, off_t) __asm("_" "lockf" ); + +int nice(int) __asm("_" "nice" ); + +ssize_t pread(int __fd, void * __buf, size_t __nbyte, off_t __offset) __asm("_" "pread" ); + +ssize_t pwrite(int __fd, const void * __buf, size_t __nbyte, off_t __offset) __asm("_" "pwrite" ); + + + + + + +__attribute__((deprecated)) __attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))) + +void *sbrk(int); + + + +pid_t setpgrp(void) __asm("_" "setpgrp" ); + + + + +int setregid(gid_t, gid_t) __asm("_" "setregid" ); + +int setreuid(uid_t, uid_t) __asm("_" "setreuid" ); + +void swab(const void * restrict, void * restrict, ssize_t); +void sync(void); +int truncate(const char *, off_t); +useconds_t ualarm(useconds_t, useconds_t); +int usleep(useconds_t) __asm("_" "usleep" ); +pid_t vfork(void) __attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))); + + +int fsync(int) __asm("_" "fsync" ); + +int ftruncate(int, off_t); +int getlogin_r(char *, size_t); +int fchown(int, uid_t, gid_t); +int gethostname(char *, size_t); +ssize_t readlink(const char * restrict, char * restrict, size_t); +int setegid(gid_t); +int seteuid(uid_t); +int symlink(const char *, const char *); +int pselect(int, fd_set * restrict, fd_set * restrict, + fd_set * restrict, const struct timespec * restrict, + const sigset_t * restrict) + + + + + __asm("_" "pselect" "$1050") + + + + + ; + + + +int select(int, fd_set * restrict, fd_set * restrict, + fd_set * restrict, struct timeval * restrict) + + + + + __asm("_" "select" "$1050") + + + + + ; + + + +typedef __darwin_uuid_t uuid_t; + + +void _Exit(int) __attribute__((noreturn)); +int accessx_np(const struct accessx_descriptor *, size_t, int *, uid_t); +int acct(const char *); +int add_profil(char *, size_t, unsigned long, unsigned int) __attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))); +void endusershell(void); +int execvP(const char * __file, const char * __searchpath, char * const * __argv) __attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))); +char *fflagstostr(unsigned long); +int getdomainname(char *, int); +int getgrouplist(const char *, int, int *, int *); + + + + + +int gethostuuid(uuid_t, const struct timespec *) __attribute__((availability(macosx,introduced=10.5))); + + + + +mode_t getmode(const void *, mode_t); +int getpeereid(int, uid_t *, gid_t *); +int getsgroups_np(int *, uuid_t); +char *getusershell(void); +int getwgroups_np(int *, uuid_t); +int initgroups(const char *, int); +int issetugid(void); +char *mkdtemp(char *); +int mknod(const char *, mode_t, dev_t); +int mkpath_np(const char *path, mode_t omode) __attribute__((availability(macosx,introduced=10.8))); +int mkpathat_np(int dfd, const char *path, mode_t omode) + __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) + __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +int mkstemp(char *); +int mkstemps(char *, int); +char *mktemp(char *); +int mkostemp(char *path, int oflags) + __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) + __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +int mkostemps(char *path, int slen, int oflags) + __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) + __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); + +int mkstemp_dprotected_np(char *path, int dpclass, int dpflags) + __attribute__((availability(macosx,unavailable))) __attribute__((availability(ios,introduced=10.0))) + __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +int nfssvc(int, void *); +int profil(char *, size_t, unsigned long, unsigned int); +int pthread_setugid_np(uid_t, gid_t); +int pthread_getugid_np( uid_t *, gid_t *); +int reboot(int); +int revoke(const char *); + +__attribute__((deprecated)) int rcmd(char **, int, const char *, const char *, const char *, int *); +__attribute__((deprecated)) int rcmd_af(char **, int, const char *, const char *, const char *, int *, + int); +__attribute__((deprecated)) int rresvport(int *); +__attribute__((deprecated)) int rresvport_af(int *, int); +__attribute__((deprecated)) int iruserok(unsigned long, int, const char *, const char *); +__attribute__((deprecated)) int iruserok_sa(const void *, int, int, const char *, const char *); +__attribute__((deprecated)) int ruserok(const char *, int, const char *, const char *); + +int setdomainname(const char *, int); +int setgroups(int, const gid_t *); +void sethostid(long); +int sethostname(const char *, int); + +void setkey(const char *) __asm("_" "setkey" ); + + + +int setlogin(const char *); +void *setmode(const char *) __asm("_" "setmode" ); +int setrgid(gid_t); +int setruid(uid_t); +int setsgroups_np(int, const uuid_t); +void setusershell(void); +int setwgroups_np(int, const uuid_t); +int strtofflags(char **, unsigned long *, unsigned long *); +int swapon(const char *); +int ttyslot(void); +int undelete(const char *); +int unwhiteout(const char *); +void *valloc(size_t); + +__attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))) +__attribute__((availability(ios,deprecated=10.0,message="syscall(2) is unsupported; " "please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost()."))) + +__attribute__((availability(macosx,deprecated=10.12,message="syscall(2) is unsupported; " "please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost()."))) + +int syscall(int, ...); + +extern char *suboptarg; +int getsubopt(char **, char * const *, char **); + + + +int fgetattrlist(int,void*,void*,size_t,unsigned int) __attribute__((availability(macosx,introduced=10.6))); +int fsetattrlist(int,void*,void*,size_t,unsigned int) __attribute__((availability(macosx,introduced=10.6))); +int getattrlist(const char*,void*,void*,size_t,unsigned int) __asm("_" "getattrlist" ); +int setattrlist(const char*,void*,void*,size_t,unsigned int) __asm("_" "setattrlist" ); +int exchangedata(const char*,const char*,unsigned int) __attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))); +int getdirentriesattr(int,void*,void*,size_t,unsigned int*,unsigned int*,unsigned int*,unsigned int) __attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))); +struct fssearchblock; +struct searchstate; + +int searchfs(const char *, struct fssearchblock *, unsigned long *, unsigned int, unsigned int, struct searchstate *) __attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))); +int fsctl(const char *,unsigned long,void*,unsigned int); +int ffsctl(int,unsigned long,void*,unsigned int) __attribute__((availability(macosx,introduced=10.6))); + + + + +int fsync_volume_np(int, int) __attribute__((availability(macosx,introduced=10.8))); +int sync_volume_np(const char *, int) __attribute__((availability(macosx,introduced=10.8))); + +extern int optreset; + + + + + +struct flock { + off_t l_start; + off_t l_len; + pid_t l_pid; + short l_type; + short l_whence; +}; +struct flocktimeout { + struct flock fl; + struct timespec timeout; +}; +struct radvisory { + off_t ra_offset; + int ra_count; +}; + + + +typedef struct fcodeblobs { + void *f_cd_hash; + size_t f_hash_size; + void *f_cd_buffer; + size_t f_cd_size; + unsigned int *f_out_size; + int f_arch; + int __padding; +} fcodeblobs_t; +typedef struct fsignatures { + off_t fs_file_start; + void *fs_blob_start; + size_t fs_blob_size; +} fsignatures_t; +typedef struct fchecklv { + off_t lv_file_start; + size_t lv_error_message_size; + void *lv_error_message; +} fchecklv_t; +typedef struct fstore { + unsigned int fst_flags; + int fst_posmode; + off_t fst_offset; + off_t fst_length; + off_t fst_bytesalloc; +} fstore_t; + + + +typedef struct fbootstraptransfer { + off_t fbt_offset; + size_t fbt_length; + void *fbt_buffer; +} fbootstraptransfer_t; + +struct log2phys { + unsigned int l2p_flags; + off_t l2p_contigbytes; + + + off_t l2p_devoffset; + + +}; + +struct _filesec; +typedef struct _filesec *filesec_t; + +typedef enum { + FILESEC_OWNER = 1, + FILESEC_GROUP = 2, + FILESEC_UUID = 3, + FILESEC_MODE = 4, + FILESEC_ACL = 5, + FILESEC_GRPUUID = 6, + + + FILESEC_ACL_RAW = 100, + FILESEC_ACL_ALLOCSIZE = 101 +} filesec_property_t; + + + + + + +int open(const char *, int, ...) __asm("_" "open" ); + +int openat(int, const char *, int, ...) __asm("_" "openat" ) __attribute__((availability(macosx,introduced=10.10))); + +int creat(const char *, mode_t) __asm("_" "creat" ); +int fcntl(int, int, ...) __asm("_" "fcntl" ); + + +int openx_np(const char *, int, filesec_t); + + + + +int open_dprotected_np ( const char *, int, int, int, ...); +int flock(int, int); +filesec_t filesec_init(void); +filesec_t filesec_dup(filesec_t); +void filesec_free(filesec_t); +int filesec_get_property(filesec_t, filesec_property_t, void *); +int filesec_query_property(filesec_t, filesec_property_t, int *); +int filesec_set_property(filesec_t, filesec_property_t, const void *); +int filesec_unset_property(filesec_t, filesec_property_t) __attribute__((availability(macosx,introduced=10.6))); +typedef void (*os_function_t)(void *_Nullable); +typedef void (^os_block_t)(void); +__attribute__((availability(macosx,introduced=10.10))) +extern __attribute__((__visibility__("default"))) __attribute__((__availability__(swift, unavailable, message="Can't be used with ARC"))) +void* +os_retain(void *object); +__attribute__((availability(macosx,introduced=10.10))) +extern __attribute__((__visibility__("default"))) +void __attribute__((__availability__(swift, unavailable, message="Can't be used with ARC"))) +os_release(void *object); +typedef void (*dispatch_function_t)(void *_Nullable); +struct time_value { + integer_t seconds; + integer_t microseconds; +}; + +typedef struct time_value time_value_t; + + + + +typedef int alarm_type_t; +typedef int sleep_type_t; +typedef int clock_id_t; +typedef int clock_flavor_t; +typedef int *clock_attr_t; +typedef int clock_res_t; + + + + +struct mach_timespec { + unsigned int tv_sec; + clock_res_t tv_nsec; +}; +typedef struct mach_timespec mach_timespec_t; +struct timespec; +typedef uint64_t dispatch_time_t; +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__warn_unused_result__)) __attribute__((__nothrow__)) +dispatch_time_t +dispatch_time(dispatch_time_t when, int64_t delta); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__warn_unused_result__)) __attribute__((__nothrow__)) +dispatch_time_t +dispatch_walltime(const struct timespec *_Nullable when, int64_t delta); +typedef union { + struct _os_object_s *_os_obj; + struct dispatch_object_s *_do; + struct dispatch_continuation_s *_dc; + struct dispatch_queue_s *_dq; + struct dispatch_queue_attr_s *_dqa; + struct dispatch_group_s *_dg; + struct dispatch_source_s *_ds; + struct dispatch_mach_s *_dm; + struct dispatch_mach_msg_s *_dmsg; + struct dispatch_timer_aggregate_s *_dta; + struct dispatch_source_attr_s *_dsa; + struct dispatch_semaphore_s *_dsema; + struct dispatch_data_s *_ddata; + struct dispatch_io_s *_dchannel; + struct dispatch_operation_s *_doperation; + struct dispatch_disk_s *_ddisk; +} dispatch_object_t __attribute__((__transparent_union__)); +typedef void (^dispatch_block_t)(void); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +__attribute__((__availability__(swift, unavailable, message="Can't be used with ARC"))) +void +dispatch_retain(dispatch_object_t object); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +__attribute__((__availability__(swift, unavailable, message="Can't be used with ARC"))) +void +dispatch_release(dispatch_object_t object); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__pure__)) __attribute__((__warn_unused_result__)) +__attribute__((__nothrow__)) +void *_Nullable +dispatch_get_context(dispatch_object_t object); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nothrow__)) +void +dispatch_set_context(dispatch_object_t object, void *_Nullable context); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nothrow__)) +void +dispatch_set_finalizer_f(dispatch_object_t object, + dispatch_function_t _Nullable finalizer); +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) +__attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +void +dispatch_activate(dispatch_object_t object); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +void +dispatch_suspend(dispatch_object_t object); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +void +dispatch_resume(dispatch_object_t object); +__attribute__((__unavailable__)) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nothrow__)) +long +dispatch_wait(void *object, dispatch_time_t timeout); +__attribute__((__unavailable__)) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +void +dispatch_notify(void *object, dispatch_object_t queue, + dispatch_block_t notification_block); +__attribute__((__unavailable__)) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +void +dispatch_cancel(void *object); +__attribute__((__unavailable__)) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__warn_unused_result__)) __attribute__((__pure__)) +__attribute__((__nothrow__)) +long +dispatch_testcancel(void *object); +__attribute__((availability(macosx,introduced=10.6,deprecated=10.9))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(2))) __attribute__((__nothrow__)) +__attribute__((__format__(printf,2,3))) +void +dispatch_debug(dispatch_object_t object, const char *message, ...); + +__attribute__((availability(macosx,introduced=10.6,deprecated=10.9))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(2))) __attribute__((__nothrow__)) +__attribute__((__format__(printf,2,0))) +void +dispatch_debugv(dispatch_object_t object, const char *message, va_list ap); +enum { QOS_CLASS_USER_INTERACTIVE __attribute__((availability(macosx,introduced=10.10))) = 0x21, QOS_CLASS_USER_INITIATED __attribute__((availability(macosx,introduced=10.10))) = 0x19, QOS_CLASS_DEFAULT __attribute__((availability(macosx,introduced=10.10))) = 0x15, QOS_CLASS_UTILITY __attribute__((availability(macosx,introduced=10.10))) = 0x11, QOS_CLASS_BACKGROUND __attribute__((availability(macosx,introduced=10.10))) = 0x09, QOS_CLASS_UNSPECIFIED __attribute__((availability(macosx,introduced=10.10))) = 0x00, }; typedef unsigned int qos_class_t; +__attribute__((availability(macosx,introduced=10.10))) +qos_class_t +qos_class_self(void); +__attribute__((availability(macosx,introduced=10.10))) +qos_class_t +qos_class_main(void); +typedef struct dispatch_queue_s *dispatch_queue_t; +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +void +dispatch_async(dispatch_queue_t queue, dispatch_block_t block); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nonnull__(3))) __attribute__((__nothrow__)) +void +dispatch_async_f(dispatch_queue_t queue, + void *_Nullable context, + dispatch_function_t work); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +void +dispatch_sync(dispatch_queue_t queue, __attribute__((__noescape__)) dispatch_block_t block); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nonnull__(3))) __attribute__((__nothrow__)) +void +dispatch_sync_f(dispatch_queue_t queue, + void *_Nullable context, + dispatch_function_t work); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(3))) __attribute__((__nothrow__)) +void +dispatch_apply(size_t iterations, dispatch_queue_t queue, + __attribute__((__noescape__)) void (^block)(size_t)); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(4))) __attribute__((__nothrow__)) +void +dispatch_apply_f(size_t iterations, dispatch_queue_t queue, + void *_Nullable context, + void (*work)(void *_Nullable, size_t)); +__attribute__((availability(macosx,introduced=10.6,deprecated=10.9))) +extern __attribute__((visibility("default"))) __attribute__((__pure__)) __attribute__((__warn_unused_result__)) __attribute__((__nothrow__)) +dispatch_queue_t +dispatch_get_current_queue(void); + +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) struct dispatch_queue_s _dispatch_main_q; +static __inline__ __attribute__((__always_inline__)) __attribute__((__const__)) __attribute__((__nothrow__)) +dispatch_queue_t +dispatch_get_main_queue(void) +{ + return (&(_dispatch_main_q)); +} +typedef long dispatch_queue_priority_t; + + + + + + +typedef qos_class_t dispatch_qos_class_t; +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__const__)) __attribute__((__warn_unused_result__)) __attribute__((__nothrow__)) +dispatch_queue_t +dispatch_get_global_queue(long identifier, unsigned long flags); + + + + + + + +typedef struct dispatch_queue_attr_s *dispatch_queue_attr_t; +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) +struct dispatch_queue_attr_s _dispatch_queue_attr_concurrent; +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) +__attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) +extern __attribute__((visibility("default"))) __attribute__((__warn_unused_result__)) __attribute__((__pure__)) __attribute__((__nothrow__)) +dispatch_queue_attr_t +dispatch_queue_attr_make_initially_inactive( + dispatch_queue_attr_t _Nullable attr); +enum { DISPATCH_AUTORELEASE_FREQUENCY_INHERIT __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) = 0, DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) = 1, DISPATCH_AUTORELEASE_FREQUENCY_NEVER __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) = 2, }; typedef unsigned long dispatch_autorelease_frequency_t; +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) +__attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) +extern __attribute__((visibility("default"))) __attribute__((__warn_unused_result__)) __attribute__((__pure__)) __attribute__((__nothrow__)) +dispatch_queue_attr_t +dispatch_queue_attr_make_with_autorelease_frequency( + dispatch_queue_attr_t _Nullable attr, + dispatch_autorelease_frequency_t frequency); +__attribute__((availability(macosx,introduced=10.10))) +extern __attribute__((visibility("default"))) __attribute__((__warn_unused_result__)) __attribute__((__pure__)) __attribute__((__nothrow__)) +dispatch_queue_attr_t +dispatch_queue_attr_make_with_qos_class(dispatch_queue_attr_t _Nullable attr, + dispatch_qos_class_t qos_class, int relative_priority); +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) +__attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) +extern __attribute__((visibility("default"))) __attribute__((__malloc__)) __attribute__((__warn_unused_result__)) +__attribute__((__nothrow__)) +dispatch_queue_t +dispatch_queue_create_with_target(const char *_Nullable label, + dispatch_queue_attr_t _Nullable attr, dispatch_queue_t _Nullable target) + __asm__("_" "dispatch_queue_create_with_target" "$V2"); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__malloc__)) __attribute__((__warn_unused_result__)) +__attribute__((__nothrow__)) +dispatch_queue_t +dispatch_queue_create(const char *_Nullable label, + dispatch_queue_attr_t _Nullable attr); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__pure__)) __attribute__((__warn_unused_result__)) __attribute__((__nothrow__)) +const char * +dispatch_queue_get_label(dispatch_queue_t _Nullable queue); +__attribute__((availability(macosx,introduced=10.10))) +extern __attribute__((visibility("default"))) __attribute__((__warn_unused_result__)) __attribute__((__nonnull__(1))) __attribute__((__nothrow__)) +dispatch_qos_class_t +dispatch_queue_get_qos_class(dispatch_queue_t queue, + int *_Nullable relative_priority_ptr); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nothrow__)) +void +dispatch_set_target_queue(dispatch_object_t object, + dispatch_queue_t _Nullable queue); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nothrow__)) __attribute__((__noreturn__)) +void +dispatch_main(void); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(2))) __attribute__((__nonnull__(3))) __attribute__((__nothrow__)) +void +dispatch_after(dispatch_time_t when, + dispatch_queue_t queue, + dispatch_block_t block); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(2))) __attribute__((__nonnull__(4))) __attribute__((__nothrow__)) +void +dispatch_after_f(dispatch_time_t when, + dispatch_queue_t queue, + void *_Nullable context, + dispatch_function_t work); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +void +dispatch_barrier_async(dispatch_queue_t queue, dispatch_block_t block); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nonnull__(3))) __attribute__((__nothrow__)) +void +dispatch_barrier_async_f(dispatch_queue_t queue, + void *_Nullable context, + dispatch_function_t work); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +void +dispatch_barrier_sync(dispatch_queue_t queue, + __attribute__((__noescape__)) dispatch_block_t block); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nonnull__(3))) __attribute__((__nothrow__)) +void +dispatch_barrier_sync_f(dispatch_queue_t queue, + void *_Nullable context, + dispatch_function_t work); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nothrow__)) +void +dispatch_queue_set_specific(dispatch_queue_t queue, const void *key, + void *_Nullable context, dispatch_function_t _Nullable destructor); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__pure__)) __attribute__((__warn_unused_result__)) +__attribute__((__nothrow__)) +void *_Nullable +dispatch_queue_get_specific(dispatch_queue_t queue, const void *key); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__pure__)) __attribute__((__warn_unused_result__)) __attribute__((__nothrow__)) +void *_Nullable +dispatch_get_specific(const void *key); +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) +__attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) +void +dispatch_assert_queue(dispatch_queue_t queue) + __asm__("_" "dispatch_assert_queue" "$V2"); +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) +__attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) +void +dispatch_assert_queue_barrier(dispatch_queue_t queue); +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) +__attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) +void +dispatch_assert_queue_not(dispatch_queue_t queue) + __asm__("_" "dispatch_assert_queue_not" "$V2"); +enum { DISPATCH_BLOCK_BARRIER __attribute__((availability(macosx,introduced=10.10))) = 0x1, DISPATCH_BLOCK_DETACHED __attribute__((availability(macosx,introduced=10.10))) = 0x2, DISPATCH_BLOCK_ASSIGN_CURRENT __attribute__((availability(macosx,introduced=10.10))) = 0x4, DISPATCH_BLOCK_NO_QOS_CLASS __attribute__((availability(macosx,introduced=10.10))) = 0x8, DISPATCH_BLOCK_INHERIT_QOS_CLASS __attribute__((availability(macosx,introduced=10.10))) = 0x10, DISPATCH_BLOCK_ENFORCE_QOS_CLASS __attribute__((availability(macosx,introduced=10.10))) = 0x20, }; typedef unsigned long dispatch_block_flags_t; +__attribute__((availability(macosx,introduced=10.10))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(2))) __attribute__((__ns_returns_retained__)) +__attribute__((__warn_unused_result__)) __attribute__((__nothrow__)) +dispatch_block_t +dispatch_block_create(dispatch_block_flags_t flags, dispatch_block_t block); +__attribute__((availability(macosx,introduced=10.10))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(4))) __attribute__((__ns_returns_retained__)) +__attribute__((__warn_unused_result__)) __attribute__((__nothrow__)) +dispatch_block_t +dispatch_block_create_with_qos_class(dispatch_block_flags_t flags, + dispatch_qos_class_t qos_class, int relative_priority, + dispatch_block_t block); +__attribute__((availability(macosx,introduced=10.10))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(2))) __attribute__((__nothrow__)) +void +dispatch_block_perform(dispatch_block_flags_t flags, + __attribute__((__noescape__)) dispatch_block_t block); +__attribute__((availability(macosx,introduced=10.10))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nothrow__)) +long +dispatch_block_wait(dispatch_block_t block, dispatch_time_t timeout); +__attribute__((availability(macosx,introduced=10.10))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +void +dispatch_block_notify(dispatch_block_t block, dispatch_queue_t queue, + dispatch_block_t notification_block); +__attribute__((availability(macosx,introduced=10.10))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +void +dispatch_block_cancel(dispatch_block_t block); +__attribute__((availability(macosx,introduced=10.10))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__warn_unused_result__)) __attribute__((__pure__)) +__attribute__((__nothrow__)) +long +dispatch_block_testcancel(dispatch_block_t block); +typedef int kern_return_t; +typedef natural_t mach_msg_timeout_t; +typedef unsigned int mach_msg_bits_t; +typedef natural_t mach_msg_size_t; +typedef integer_t mach_msg_id_t; + + + +typedef unsigned int mach_msg_priority_t; + + + +typedef unsigned int mach_msg_type_name_t; +typedef unsigned int mach_msg_copy_options_t; +typedef unsigned int mach_msg_descriptor_type_t; + + + + + + + +typedef struct +{ + natural_t pad1; + mach_msg_size_t pad2; + unsigned int pad3 : 24; + mach_msg_descriptor_type_t type : 8; +} mach_msg_type_descriptor_t; + +typedef struct +{ + mach_port_t name; + + mach_msg_size_t pad1; + unsigned int pad2 : 16; + mach_msg_type_name_t disposition : 8; + mach_msg_descriptor_type_t type : 8; +} mach_msg_port_descriptor_t; + +typedef struct +{ + uint32_t address; + mach_msg_size_t size; + boolean_t deallocate: 8; + mach_msg_copy_options_t copy: 8; + unsigned int pad1: 8; + mach_msg_descriptor_type_t type: 8; +} mach_msg_ool_descriptor32_t; + +typedef struct +{ + uint64_t address; + boolean_t deallocate: 8; + mach_msg_copy_options_t copy: 8; + unsigned int pad1: 8; + mach_msg_descriptor_type_t type: 8; + mach_msg_size_t size; +} mach_msg_ool_descriptor64_t; + +typedef struct +{ + void* address; + + + + boolean_t deallocate: 8; + mach_msg_copy_options_t copy: 8; + unsigned int pad1: 8; + mach_msg_descriptor_type_t type: 8; + + mach_msg_size_t size; + +} mach_msg_ool_descriptor_t; + +typedef struct +{ + uint32_t address; + mach_msg_size_t count; + boolean_t deallocate: 8; + mach_msg_copy_options_t copy: 8; + mach_msg_type_name_t disposition : 8; + mach_msg_descriptor_type_t type : 8; +} mach_msg_ool_ports_descriptor32_t; + +typedef struct +{ + uint64_t address; + boolean_t deallocate: 8; + mach_msg_copy_options_t copy: 8; + mach_msg_type_name_t disposition : 8; + mach_msg_descriptor_type_t type : 8; + mach_msg_size_t count; +} mach_msg_ool_ports_descriptor64_t; + +typedef struct +{ + void* address; + + + + boolean_t deallocate: 8; + mach_msg_copy_options_t copy: 8; + mach_msg_type_name_t disposition : 8; + mach_msg_descriptor_type_t type : 8; + + mach_msg_size_t count; + +} mach_msg_ool_ports_descriptor_t; + + + + + + +typedef union +{ + mach_msg_port_descriptor_t port; + mach_msg_ool_descriptor_t out_of_line; + mach_msg_ool_ports_descriptor_t ool_ports; + mach_msg_type_descriptor_t type; +} mach_msg_descriptor_t; + +typedef struct +{ + mach_msg_size_t msgh_descriptor_count; +} mach_msg_body_t; + + + + +typedef struct +{ + mach_msg_bits_t msgh_bits; + mach_msg_size_t msgh_size; + mach_port_t msgh_remote_port; + mach_port_t msgh_local_port; + mach_port_name_t msgh_voucher_port; + mach_msg_id_t msgh_id; +} mach_msg_header_t; + + + + +typedef struct +{ + mach_msg_header_t header; + mach_msg_body_t body; +} mach_msg_base_t; + +typedef unsigned int mach_msg_trailer_type_t; + + + +typedef unsigned int mach_msg_trailer_size_t; +typedef char *mach_msg_trailer_info_t; + +typedef struct +{ + mach_msg_trailer_type_t msgh_trailer_type; + mach_msg_trailer_size_t msgh_trailer_size; +} mach_msg_trailer_t; +typedef struct +{ + mach_msg_trailer_type_t msgh_trailer_type; + mach_msg_trailer_size_t msgh_trailer_size; + mach_port_seqno_t msgh_seqno; +} mach_msg_seqno_trailer_t; + +typedef struct +{ + unsigned int val[2]; +} security_token_t; + +typedef struct +{ + mach_msg_trailer_type_t msgh_trailer_type; + mach_msg_trailer_size_t msgh_trailer_size; + mach_port_seqno_t msgh_seqno; + security_token_t msgh_sender; +} mach_msg_security_trailer_t; +typedef struct +{ + unsigned int val[8]; +} audit_token_t; + +typedef struct +{ + mach_msg_trailer_type_t msgh_trailer_type; + mach_msg_trailer_size_t msgh_trailer_size; + mach_port_seqno_t msgh_seqno; + security_token_t msgh_sender; + audit_token_t msgh_audit; +} mach_msg_audit_trailer_t; + +typedef struct +{ + mach_msg_trailer_type_t msgh_trailer_type; + mach_msg_trailer_size_t msgh_trailer_size; + mach_port_seqno_t msgh_seqno; + security_token_t msgh_sender; + audit_token_t msgh_audit; + mach_port_context_t msgh_context; +} mach_msg_context_trailer_t; + + + +typedef struct +{ + mach_port_name_t sender; +} msg_labels_t; + + + + + + +typedef struct +{ + mach_msg_trailer_type_t msgh_trailer_type; + mach_msg_trailer_size_t msgh_trailer_size; + mach_port_seqno_t msgh_seqno; + security_token_t msgh_sender; + audit_token_t msgh_audit; + mach_port_context_t msgh_context; + int msgh_ad; + msg_labels_t msgh_labels; +} mach_msg_mac_trailer_t; +typedef mach_msg_mac_trailer_t mach_msg_max_trailer_t; +typedef mach_msg_security_trailer_t mach_msg_format_0_trailer_t; + + + + + + + +extern security_token_t KERNEL_SECURITY_TOKEN; + + +extern audit_token_t KERNEL_AUDIT_TOKEN; + +typedef integer_t mach_msg_options_t; + +typedef struct +{ + mach_msg_header_t header; +} mach_msg_empty_send_t; + +typedef struct +{ + mach_msg_header_t header; + mach_msg_trailer_t trailer; +} mach_msg_empty_rcv_t; + +typedef union +{ + mach_msg_empty_send_t send; + mach_msg_empty_rcv_t rcv; +} mach_msg_empty_t; + +typedef natural_t mach_msg_type_size_t; +typedef natural_t mach_msg_type_number_t; +typedef integer_t mach_msg_option_t; +typedef kern_return_t mach_msg_return_t; +__attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))) +extern mach_msg_return_t mach_msg_overwrite( + mach_msg_header_t *msg, + mach_msg_option_t option, + mach_msg_size_t send_size, + mach_msg_size_t rcv_size, + mach_port_name_t rcv_name, + mach_msg_timeout_t timeout, + mach_port_name_t notify, + mach_msg_header_t *rcv_msg, + mach_msg_size_t rcv_limit); +__attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))) +extern mach_msg_return_t mach_msg( + mach_msg_header_t *msg, + mach_msg_option_t option, + mach_msg_size_t send_size, + mach_msg_size_t rcv_size, + mach_port_name_t rcv_name, + mach_msg_timeout_t timeout, + mach_port_name_t notify); + + + + + + + +__attribute__((availability(watchos,unavailable))) __attribute__((availability(tvos,unavailable))) +extern kern_return_t mach_voucher_deallocate( + mach_port_name_t voucher); +typedef struct dispatch_source_s *dispatch_source_t;; +typedef const struct dispatch_source_type_s *dispatch_source_type_t; +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) const struct dispatch_source_type_s _dispatch_source_type_data_add; +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) const struct dispatch_source_type_s _dispatch_source_type_data_or; +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) const struct dispatch_source_type_s _dispatch_source_type_mach_send; +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) const struct dispatch_source_type_s _dispatch_source_type_mach_recv; +__attribute__((availability(macosx,introduced=10.9))) +extern __attribute__((visibility("default"))) const struct dispatch_source_type_s _dispatch_source_type_memorypressure; +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) const struct dispatch_source_type_s _dispatch_source_type_proc; +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) const struct dispatch_source_type_s _dispatch_source_type_read; +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) const struct dispatch_source_type_s _dispatch_source_type_signal; +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) const struct dispatch_source_type_s _dispatch_source_type_timer; +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) const struct dispatch_source_type_s _dispatch_source_type_vnode; +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) const struct dispatch_source_type_s _dispatch_source_type_write; +typedef unsigned long dispatch_source_mach_send_flags_t; +typedef unsigned long dispatch_source_memorypressure_flags_t; +typedef unsigned long dispatch_source_proc_flags_t; +typedef unsigned long dispatch_source_vnode_flags_t; +typedef unsigned long dispatch_source_timer_flags_t; +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__malloc__)) __attribute__((__warn_unused_result__)) +__attribute__((__nothrow__)) +dispatch_source_t +dispatch_source_create(dispatch_source_type_t type, + uintptr_t handle, + unsigned long mask, + dispatch_queue_t _Nullable queue); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nothrow__)) +void +dispatch_source_set_event_handler(dispatch_source_t source, + dispatch_block_t _Nullable handler); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nothrow__)) +void +dispatch_source_set_event_handler_f(dispatch_source_t source, + dispatch_function_t _Nullable handler); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nothrow__)) +void +dispatch_source_set_cancel_handler(dispatch_source_t source, + dispatch_block_t _Nullable handler); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nothrow__)) +void +dispatch_source_set_cancel_handler_f(dispatch_source_t source, + dispatch_function_t _Nullable handler); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +void +dispatch_source_cancel(dispatch_source_t source); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__warn_unused_result__)) __attribute__((__pure__)) +__attribute__((__nothrow__)) +long +dispatch_source_testcancel(dispatch_source_t source); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__warn_unused_result__)) __attribute__((__pure__)) +__attribute__((__nothrow__)) +uintptr_t +dispatch_source_get_handle(dispatch_source_t source); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__warn_unused_result__)) __attribute__((__pure__)) +__attribute__((__nothrow__)) +unsigned long +dispatch_source_get_mask(dispatch_source_t source); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__warn_unused_result__)) __attribute__((__pure__)) +__attribute__((__nothrow__)) +unsigned long +dispatch_source_get_data(dispatch_source_t source); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +void +dispatch_source_merge_data(dispatch_source_t source, unsigned long value); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +void +dispatch_source_set_timer(dispatch_source_t source, + dispatch_time_t start, + uint64_t interval, + uint64_t leeway); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nothrow__)) +void +dispatch_source_set_registration_handler(dispatch_source_t source, + dispatch_block_t _Nullable handler); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nothrow__)) +void +dispatch_source_set_registration_handler_f(dispatch_source_t source, + dispatch_function_t _Nullable handler); +typedef struct dispatch_group_s *dispatch_group_t; +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__malloc__)) __attribute__((__warn_unused_result__)) +__attribute__((__nothrow__)) +dispatch_group_t +dispatch_group_create(void); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +void +dispatch_group_async(dispatch_group_t group, + dispatch_queue_t queue, + dispatch_block_t block); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nonnull__(2))) __attribute__((__nonnull__(4))) +__attribute__((__nothrow__)) +void +dispatch_group_async_f(dispatch_group_t group, + dispatch_queue_t queue, + void *_Nullable context, + dispatch_function_t work); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +long +dispatch_group_wait(dispatch_group_t group, dispatch_time_t timeout); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +void +dispatch_group_notify(dispatch_group_t group, + dispatch_queue_t queue, + dispatch_block_t block); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nonnull__(2))) __attribute__((__nonnull__(4))) +__attribute__((__nothrow__)) +void +dispatch_group_notify_f(dispatch_group_t group, + dispatch_queue_t queue, + void *_Nullable context, + dispatch_function_t work); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +void +dispatch_group_enter(dispatch_group_t group); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +void +dispatch_group_leave(dispatch_group_t group); +typedef struct dispatch_semaphore_s *dispatch_semaphore_t; +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__malloc__)) __attribute__((__warn_unused_result__)) +__attribute__((__nothrow__)) +dispatch_semaphore_t +dispatch_semaphore_create(long value); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +long +dispatch_semaphore_wait(dispatch_semaphore_t dsema, dispatch_time_t timeout); +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +long +dispatch_semaphore_signal(dispatch_semaphore_t dsema); +typedef long dispatch_once_t; +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) + +void +dispatch_once(dispatch_once_t *predicate, + __attribute__((__noescape__)) dispatch_block_t block); + +static __inline__ __attribute__((__always_inline__)) __attribute__((__nonnull__)) __attribute__((__nothrow__)) + +void +_dispatch_once(dispatch_once_t *predicate, + __attribute__((__noescape__)) dispatch_block_t block) +{ + if (__builtin_expect((*predicate), (~0l)) != ~0l) { + dispatch_once(predicate, block); + } else { + __asm__ __volatile__("" ::: "memory"); + } + __builtin_assume(*predicate == ~0l); +} + + + + +__attribute__((availability(macosx,introduced=10.6))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nonnull__(3))) __attribute__((__nothrow__)) + +void +dispatch_once_f(dispatch_once_t *predicate, void *_Nullable context, + dispatch_function_t function); + +static __inline__ __attribute__((__always_inline__)) __attribute__((__nonnull__(1))) __attribute__((__nonnull__(3))) +__attribute__((__nothrow__)) + +void +_dispatch_once_f(dispatch_once_t *predicate, void *_Nullable context, + dispatch_function_t function) +{ + if (__builtin_expect((*predicate), (~0l)) != ~0l) { + dispatch_once_f(predicate, context, function); + } else { + __asm__ __volatile__("" ::: "memory"); + } + __builtin_assume(*predicate == ~0l); +} +typedef struct dispatch_data_s *dispatch_data_t; +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) struct dispatch_data_s _dispatch_data_empty; +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) const dispatch_block_t _dispatch_data_destructor_free; + + + + + + + +__attribute__((availability(macosx,introduced=10.9))) +extern __attribute__((visibility("default"))) const dispatch_block_t _dispatch_data_destructor_munmap; +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__warn_unused_result__)) __attribute__((__nothrow__)) +dispatch_data_t +dispatch_data_create(const void *buffer, + size_t size, + dispatch_queue_t _Nullable queue, + dispatch_block_t _Nullable destructor); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__pure__)) __attribute__((__nonnull__(1))) __attribute__((__nothrow__)) +size_t +dispatch_data_get_size(dispatch_data_t data); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) +__attribute__((__warn_unused_result__)) __attribute__((__nothrow__)) +dispatch_data_t +dispatch_data_create_map(dispatch_data_t data, + const void *_Nullable *_Nullable buffer_ptr, + size_t *_Nullable size_ptr); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) +__attribute__((__warn_unused_result__)) __attribute__((__nothrow__)) +dispatch_data_t +dispatch_data_create_concat(dispatch_data_t data1, dispatch_data_t data2); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) +__attribute__((__warn_unused_result__)) __attribute__((__nothrow__)) +dispatch_data_t +dispatch_data_create_subrange(dispatch_data_t data, + size_t offset, + size_t length); +typedef _Bool (^dispatch_data_applier_t)(dispatch_data_t region, + size_t offset, + const void *buffer, + size_t size); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +_Bool +dispatch_data_apply(dispatch_data_t data, dispatch_data_applier_t applier); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nonnull__(3))) +__attribute__((__warn_unused_result__)) __attribute__((__nothrow__)) +dispatch_data_t +dispatch_data_copy_region(dispatch_data_t data, + size_t location, + size_t *offset_ptr); +typedef int dispatch_fd_t; +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(3))) __attribute__((__nonnull__(4))) __attribute__((__nothrow__)) +void +dispatch_read(dispatch_fd_t fd, + size_t length, + dispatch_queue_t queue, + void (^handler)(dispatch_data_t data, int error)); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(2))) __attribute__((__nonnull__(3))) __attribute__((__nonnull__(4))) +__attribute__((__nothrow__)) +void +dispatch_write(dispatch_fd_t fd, + dispatch_data_t data, + dispatch_queue_t queue, + void (^handler)(dispatch_data_t _Nullable data, int error)); +typedef struct dispatch_io_s *dispatch_io_t; +typedef unsigned long dispatch_io_type_t; +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__malloc__)) __attribute__((__warn_unused_result__)) +__attribute__((__nothrow__)) +dispatch_io_t +dispatch_io_create(dispatch_io_type_t type, + dispatch_fd_t fd, + dispatch_queue_t queue, + void (^cleanup_handler)(int error)); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(2))) __attribute__((__malloc__)) +__attribute__((__warn_unused_result__)) __attribute__((__nothrow__)) +dispatch_io_t +dispatch_io_create_with_path(dispatch_io_type_t type, + const char *path, int oflag, mode_t mode, + dispatch_queue_t queue, + void (^cleanup_handler)(int error)); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(2))) __attribute__((__malloc__)) +__attribute__((__warn_unused_result__)) __attribute__((__nothrow__)) +dispatch_io_t +dispatch_io_create_with_io(dispatch_io_type_t type, + dispatch_io_t io, + dispatch_queue_t queue, + void (^cleanup_handler)(int error)); +typedef void (^dispatch_io_handler_t)(_Bool done, dispatch_data_t _Nullable data, + int error); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nonnull__(4))) __attribute__((__nonnull__(5))) +__attribute__((__nothrow__)) +void +dispatch_io_read(dispatch_io_t channel, + off_t offset, + size_t length, + dispatch_queue_t queue, + dispatch_io_handler_t io_handler); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nonnull__(3))) __attribute__((__nonnull__(4))) +__attribute__((__nonnull__(5))) __attribute__((__nothrow__)) +void +dispatch_io_write(dispatch_io_t channel, + off_t offset, + dispatch_data_t data, + dispatch_queue_t queue, + dispatch_io_handler_t io_handler); +typedef unsigned long dispatch_io_close_flags_t; +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nothrow__)) +void +dispatch_io_close(dispatch_io_t channel, dispatch_io_close_flags_t flags); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__nothrow__)) +void +dispatch_io_barrier(dispatch_io_t channel, dispatch_block_t barrier); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__)) __attribute__((__warn_unused_result__)) __attribute__((__nothrow__)) +dispatch_fd_t +dispatch_io_get_descriptor(dispatch_io_t channel); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nothrow__)) +void +dispatch_io_set_high_water(dispatch_io_t channel, size_t high_water); +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nothrow__)) +void +dispatch_io_set_low_water(dispatch_io_t channel, size_t low_water); +typedef unsigned long dispatch_io_interval_flags_t; +__attribute__((availability(macosx,introduced=10.7))) +extern __attribute__((visibility("default"))) __attribute__((__nonnull__(1))) __attribute__((__nothrow__)) +void +dispatch_io_set_interval(dispatch_io_t channel, + uint64_t interval, + dispatch_io_interval_flags_t flags); + + + + +typedef CFStringRef CFStreamPropertyKey __attribute__((swift_wrapper(struct))); + +typedef CFIndex CFStreamStatus; enum { + kCFStreamStatusNotOpen = 0, + kCFStreamStatusOpening, + kCFStreamStatusOpen, + kCFStreamStatusReading, + kCFStreamStatusWriting, + kCFStreamStatusAtEnd, + kCFStreamStatusClosed, + kCFStreamStatusError +}; + +typedef CFOptionFlags CFStreamEventType; enum { + kCFStreamEventNone = 0, + kCFStreamEventOpenCompleted = 1, + kCFStreamEventHasBytesAvailable = 2, + kCFStreamEventCanAcceptBytes = 4, + kCFStreamEventErrorOccurred = 8, + kCFStreamEventEndEncountered = 16 +}; + +typedef struct { + CFIndex version; + void *info; + void *(*retain)(void *info); + void (*release)(void *info); + CFStringRef (*copyDescription)(void *info); +} CFStreamClientContext; + +typedef struct __attribute__((objc_bridge_mutable(NSInputStream))) __CFReadStream * CFReadStreamRef; +typedef struct __attribute__((objc_bridge_mutable(NSOutputStream))) __CFWriteStream * CFWriteStreamRef; + +typedef void (*CFReadStreamClientCallBack)(CFReadStreamRef stream, CFStreamEventType type, void *clientCallBackInfo); +typedef void (*CFWriteStreamClientCallBack)(CFWriteStreamRef stream, CFStreamEventType type, void *clientCallBackInfo); + +extern +CFTypeID CFReadStreamGetTypeID(void); +extern +CFTypeID CFWriteStreamGetTypeID(void); + + + + +extern +const CFStreamPropertyKey kCFStreamPropertyDataWritten; + + +extern +CFReadStreamRef CFReadStreamCreateWithBytesNoCopy(CFAllocatorRef alloc, const UInt8 *bytes, CFIndex length, CFAllocatorRef bytesDeallocator); + + +extern +CFWriteStreamRef CFWriteStreamCreateWithBuffer(CFAllocatorRef alloc, UInt8 *buffer, CFIndex bufferCapacity); + + +extern +CFWriteStreamRef CFWriteStreamCreateWithAllocatedBuffers(CFAllocatorRef alloc, CFAllocatorRef bufferAllocator); + + +extern +CFReadStreamRef CFReadStreamCreateWithFile(CFAllocatorRef alloc, CFURLRef fileURL); +extern +CFWriteStreamRef CFWriteStreamCreateWithFile(CFAllocatorRef alloc, CFURLRef fileURL); + +extern +void CFStreamCreateBoundPair(CFAllocatorRef alloc, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream, CFIndex transferBufferSize); + + + +extern +const CFStreamPropertyKey kCFStreamPropertyAppendToFile; + +extern +const CFStreamPropertyKey kCFStreamPropertyFileCurrentOffset; + + + + + +extern +const CFStreamPropertyKey kCFStreamPropertySocketNativeHandle; + + +extern +const CFStreamPropertyKey kCFStreamPropertySocketRemoteHostName; + + +extern +const CFStreamPropertyKey kCFStreamPropertySocketRemotePortNumber; + + + +extern +void CFStreamCreatePairWithSocket(CFAllocatorRef alloc, CFSocketNativeHandle sock, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream); +extern +void CFStreamCreatePairWithSocketToHost(CFAllocatorRef alloc, CFStringRef host, UInt32 port, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream); +extern +void CFStreamCreatePairWithPeerSocketSignature(CFAllocatorRef alloc, const CFSocketSignature *signature, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream); + + + + +extern +CFStreamStatus CFReadStreamGetStatus(CFReadStreamRef stream); +extern +CFStreamStatus CFWriteStreamGetStatus(CFWriteStreamRef stream); + + +extern +CFErrorRef CFReadStreamCopyError(CFReadStreamRef stream) __attribute__((availability(macosx,introduced=10_5))); +extern +CFErrorRef CFWriteStreamCopyError(CFWriteStreamRef stream) __attribute__((availability(macosx,introduced=10_5))); + + + + + + +extern +Boolean CFReadStreamOpen(CFReadStreamRef stream); +extern +Boolean CFWriteStreamOpen(CFWriteStreamRef stream); + + + + +extern +void CFReadStreamClose(CFReadStreamRef stream); +extern +void CFWriteStreamClose(CFWriteStreamRef stream); + + + +extern +Boolean CFReadStreamHasBytesAvailable(CFReadStreamRef stream); +extern +CFIndex CFReadStreamRead(CFReadStreamRef stream, UInt8 *buffer, CFIndex bufferLength); +extern +const UInt8 *CFReadStreamGetBuffer(CFReadStreamRef stream, CFIndex maxBytesToRead, CFIndex *numBytesRead); + + + +extern +Boolean CFWriteStreamCanAcceptBytes(CFWriteStreamRef stream); + + + + + + +extern +CFIndex CFWriteStreamWrite(CFWriteStreamRef stream, const UInt8 *buffer, CFIndex bufferLength); +extern +CFTypeRef CFReadStreamCopyProperty(CFReadStreamRef stream, CFStreamPropertyKey propertyName); +extern +CFTypeRef CFWriteStreamCopyProperty(CFWriteStreamRef stream, CFStreamPropertyKey propertyName); + + + +extern +Boolean CFReadStreamSetProperty(CFReadStreamRef stream, CFStreamPropertyKey propertyName, CFTypeRef propertyValue); +extern +Boolean CFWriteStreamSetProperty(CFWriteStreamRef stream, CFStreamPropertyKey propertyName, CFTypeRef propertyValue); +extern +Boolean CFReadStreamSetClient(CFReadStreamRef stream, CFOptionFlags streamEvents, CFReadStreamClientCallBack clientCB, CFStreamClientContext *clientContext); +extern +Boolean CFWriteStreamSetClient(CFWriteStreamRef stream, CFOptionFlags streamEvents, CFWriteStreamClientCallBack clientCB, CFStreamClientContext *clientContext); + +extern +void CFReadStreamScheduleWithRunLoop(CFReadStreamRef stream, CFRunLoopRef runLoop, CFRunLoopMode runLoopMode); +extern +void CFWriteStreamScheduleWithRunLoop(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFRunLoopMode runLoopMode); + +extern +void CFReadStreamUnscheduleFromRunLoop(CFReadStreamRef stream, CFRunLoopRef runLoop, CFRunLoopMode runLoopMode); +extern +void CFWriteStreamUnscheduleFromRunLoop(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFRunLoopMode runLoopMode); +extern +void CFReadStreamSetDispatchQueue(CFReadStreamRef stream, dispatch_queue_t q) __attribute__((availability(macosx,introduced=10_9))); + +extern +void CFWriteStreamSetDispatchQueue(CFWriteStreamRef stream, dispatch_queue_t q) __attribute__((availability(macosx,introduced=10_9))); + + + + + + +extern +dispatch_queue_t CFReadStreamCopyDispatchQueue(CFReadStreamRef stream) __attribute__((availability(macosx,introduced=10_9))); + +extern +dispatch_queue_t CFWriteStreamCopyDispatchQueue(CFWriteStreamRef stream) __attribute__((availability(macosx,introduced=10_9))); + + + +typedef CFIndex CFStreamErrorDomain; enum { + kCFStreamErrorDomainCustom = -1L, + kCFStreamErrorDomainPOSIX = 1, + kCFStreamErrorDomainMacOSStatus +}; + +typedef struct { + CFIndex domain; + SInt32 error; +} CFStreamError; +extern +CFStreamError CFReadStreamGetError(CFReadStreamRef stream); +extern +CFStreamError CFWriteStreamGetError(CFWriteStreamRef stream); + + + + + +typedef CFOptionFlags CFPropertyListMutabilityOptions; enum { + kCFPropertyListImmutable = 0, + kCFPropertyListMutableContainers, + kCFPropertyListMutableContainersAndLeaves +}; +extern +CFPropertyListRef CFPropertyListCreateFromXMLData(CFAllocatorRef allocator, CFDataRef xmlData, CFOptionFlags mutabilityOption, CFStringRef *errorString) __attribute__((availability(macosx,introduced=10_0,deprecated=10_10,message="" "Use CFPropertyListCreateWithData instead."))); +extern +CFDataRef CFPropertyListCreateXMLData(CFAllocatorRef allocator, CFPropertyListRef propertyList) __attribute__((availability(macosx,introduced=10_0,deprecated=10_10,message="" "Use CFPropertyListCreateData instead."))); +extern +CFPropertyListRef CFPropertyListCreateDeepCopy(CFAllocatorRef allocator, CFPropertyListRef propertyList, CFOptionFlags mutabilityOption); + +typedef CFIndex CFPropertyListFormat; enum { + kCFPropertyListOpenStepFormat = 1, + kCFPropertyListXMLFormat_v1_0 = 100, + kCFPropertyListBinaryFormat_v1_0 = 200 +}; + + + + + + +extern +Boolean CFPropertyListIsValid(CFPropertyListRef plist, CFPropertyListFormat format); +extern +CFIndex CFPropertyListWriteToStream(CFPropertyListRef propertyList, CFWriteStreamRef stream, CFPropertyListFormat format, CFStringRef *errorString) __attribute__((availability(macosx,introduced=10_2,deprecated=10_10,message="" "Use CFPropertyListWrite instead."))); +extern +CFPropertyListRef CFPropertyListCreateFromStream(CFAllocatorRef allocator, CFReadStreamRef stream, CFIndex streamLength, CFOptionFlags mutabilityOption, CFPropertyListFormat *format, CFStringRef *errorString) __attribute__((availability(macosx,introduced=10_2,deprecated=10_10,message="" "Use CFPropertyListCreateWithStream instead."))); + + + + + + +enum { + kCFPropertyListReadCorruptError = 3840, + kCFPropertyListReadUnknownVersionError = 3841, + kCFPropertyListReadStreamError = 3842, + kCFPropertyListWriteStreamError = 3851, +} __attribute__((availability(macosx,introduced=10_6))); + + + +extern +CFPropertyListRef CFPropertyListCreateWithData(CFAllocatorRef allocator, CFDataRef data, CFOptionFlags options, CFPropertyListFormat *format, CFErrorRef *error) __attribute__((availability(macosx,introduced=10_6))); + + + + + +extern +CFPropertyListRef CFPropertyListCreateWithStream(CFAllocatorRef allocator, CFReadStreamRef stream, CFIndex streamLength, CFOptionFlags options, CFPropertyListFormat *format, CFErrorRef *error) __attribute__((availability(macosx,introduced=10_6))); + + + +extern +CFIndex CFPropertyListWrite(CFPropertyListRef propertyList, CFWriteStreamRef stream, CFPropertyListFormat format, CFOptionFlags options, CFErrorRef *error) __attribute__((availability(macosx,introduced=10_6))); + + + + + +extern +CFDataRef CFPropertyListCreateData(CFAllocatorRef allocator, CFPropertyListRef propertyList, CFPropertyListFormat format, CFOptionFlags options, CFErrorRef *error) __attribute__((availability(macosx,introduced=10_6))); +typedef const void * (*CFSetRetainCallBack)(CFAllocatorRef allocator, const void *value); + + + + + + + +typedef void (*CFSetReleaseCallBack)(CFAllocatorRef allocator, const void *value); + + + + + + + +typedef CFStringRef (*CFSetCopyDescriptionCallBack)(const void *value); +typedef Boolean (*CFSetEqualCallBack)(const void *value1, const void *value2); + + + + + + + +typedef CFHashCode (*CFSetHashCallBack)(const void *value); +typedef struct { + CFIndex version; + CFSetRetainCallBack retain; + CFSetReleaseCallBack release; + CFSetCopyDescriptionCallBack copyDescription; + CFSetEqualCallBack equal; + CFSetHashCallBack hash; +} CFSetCallBacks; + + + + + + +extern +const CFSetCallBacks kCFTypeSetCallBacks; + + + + + + + +extern +const CFSetCallBacks kCFCopyStringSetCallBacks; +typedef void (*CFSetApplierFunction)(const void *value, void *context); + + + + + +typedef const struct __attribute__((objc_bridge(NSSet))) __CFSet * CFSetRef; + + + + + +typedef struct __attribute__((objc_bridge_mutable(NSMutableSet))) __CFSet * CFMutableSetRef; + + + + + +extern +CFTypeID CFSetGetTypeID(void); +extern +CFSetRef CFSetCreate(CFAllocatorRef allocator, const void **values, CFIndex numValues, const CFSetCallBacks *callBacks); +extern +CFSetRef CFSetCreateCopy(CFAllocatorRef allocator, CFSetRef theSet); +extern +CFMutableSetRef CFSetCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFSetCallBacks *callBacks); +extern +CFMutableSetRef CFSetCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFSetRef theSet); +extern +CFIndex CFSetGetCount(CFSetRef theSet); +extern +CFIndex CFSetGetCountOfValue(CFSetRef theSet, const void *value); +extern +Boolean CFSetContainsValue(CFSetRef theSet, const void *value); +extern +const void *CFSetGetValue(CFSetRef theSet, const void *value); +extern +Boolean CFSetGetValueIfPresent(CFSetRef theSet, const void *candidate, const void **value); +extern +void CFSetGetValues(CFSetRef theSet, const void **values); +extern +void CFSetApplyFunction(CFSetRef theSet, CFSetApplierFunction __attribute__((noescape)) applier, void *context); +extern +void CFSetAddValue(CFMutableSetRef theSet, const void *value); +extern +void CFSetReplaceValue(CFMutableSetRef theSet, const void *value); +extern +void CFSetSetValue(CFMutableSetRef theSet, const void *value); +extern +void CFSetRemoveValue(CFMutableSetRef theSet, const void *value); +extern +void CFSetRemoveAllValues(CFMutableSetRef theSet); + +typedef CFIndex CFStringEncodings; enum { + + kCFStringEncodingMacJapanese = 1, + kCFStringEncodingMacChineseTrad = 2, + kCFStringEncodingMacKorean = 3, + kCFStringEncodingMacArabic = 4, + kCFStringEncodingMacHebrew = 5, + kCFStringEncodingMacGreek = 6, + kCFStringEncodingMacCyrillic = 7, + kCFStringEncodingMacDevanagari = 9, + kCFStringEncodingMacGurmukhi = 10, + kCFStringEncodingMacGujarati = 11, + kCFStringEncodingMacOriya = 12, + kCFStringEncodingMacBengali = 13, + kCFStringEncodingMacTamil = 14, + kCFStringEncodingMacTelugu = 15, + kCFStringEncodingMacKannada = 16, + kCFStringEncodingMacMalayalam = 17, + kCFStringEncodingMacSinhalese = 18, + kCFStringEncodingMacBurmese = 19, + kCFStringEncodingMacKhmer = 20, + kCFStringEncodingMacThai = 21, + kCFStringEncodingMacLaotian = 22, + kCFStringEncodingMacGeorgian = 23, + kCFStringEncodingMacArmenian = 24, + kCFStringEncodingMacChineseSimp = 25, + kCFStringEncodingMacTibetan = 26, + kCFStringEncodingMacMongolian = 27, + kCFStringEncodingMacEthiopic = 28, + kCFStringEncodingMacCentralEurRoman = 29, + kCFStringEncodingMacVietnamese = 30, + kCFStringEncodingMacExtArabic = 31, + + kCFStringEncodingMacSymbol = 33, + kCFStringEncodingMacDingbats = 34, + kCFStringEncodingMacTurkish = 35, + kCFStringEncodingMacCroatian = 36, + kCFStringEncodingMacIcelandic = 37, + kCFStringEncodingMacRomanian = 38, + kCFStringEncodingMacCeltic = 39, + kCFStringEncodingMacGaelic = 40, + + kCFStringEncodingMacFarsi = 0x8C, + + kCFStringEncodingMacUkrainian = 0x98, + + kCFStringEncodingMacInuit = 0xEC, + kCFStringEncodingMacVT100 = 0xFC, + + kCFStringEncodingMacHFS = 0xFF, + + + + + + + kCFStringEncodingISOLatin2 = 0x0202, + kCFStringEncodingISOLatin3 = 0x0203, + kCFStringEncodingISOLatin4 = 0x0204, + kCFStringEncodingISOLatinCyrillic = 0x0205, + kCFStringEncodingISOLatinArabic = 0x0206, + kCFStringEncodingISOLatinGreek = 0x0207, + kCFStringEncodingISOLatinHebrew = 0x0208, + kCFStringEncodingISOLatin5 = 0x0209, + kCFStringEncodingISOLatin6 = 0x020A, + kCFStringEncodingISOLatinThai = 0x020B, + kCFStringEncodingISOLatin7 = 0x020D, + kCFStringEncodingISOLatin8 = 0x020E, + kCFStringEncodingISOLatin9 = 0x020F, + kCFStringEncodingISOLatin10 = 0x0210, + + + kCFStringEncodingDOSLatinUS = 0x0400, + kCFStringEncodingDOSGreek = 0x0405, + kCFStringEncodingDOSBalticRim = 0x0406, + kCFStringEncodingDOSLatin1 = 0x0410, + kCFStringEncodingDOSGreek1 = 0x0411, + kCFStringEncodingDOSLatin2 = 0x0412, + kCFStringEncodingDOSCyrillic = 0x0413, + kCFStringEncodingDOSTurkish = 0x0414, + kCFStringEncodingDOSPortuguese = 0x0415, + kCFStringEncodingDOSIcelandic = 0x0416, + kCFStringEncodingDOSHebrew = 0x0417, + kCFStringEncodingDOSCanadianFrench = 0x0418, + kCFStringEncodingDOSArabic = 0x0419, + kCFStringEncodingDOSNordic = 0x041A, + kCFStringEncodingDOSRussian = 0x041B, + kCFStringEncodingDOSGreek2 = 0x041C, + kCFStringEncodingDOSThai = 0x041D, + kCFStringEncodingDOSJapanese = 0x0420, + kCFStringEncodingDOSChineseSimplif = 0x0421, + kCFStringEncodingDOSKorean = 0x0422, + kCFStringEncodingDOSChineseTrad = 0x0423, + + kCFStringEncodingWindowsLatin2 = 0x0501, + kCFStringEncodingWindowsCyrillic = 0x0502, + kCFStringEncodingWindowsGreek = 0x0503, + kCFStringEncodingWindowsLatin5 = 0x0504, + kCFStringEncodingWindowsHebrew = 0x0505, + kCFStringEncodingWindowsArabic = 0x0506, + kCFStringEncodingWindowsBalticRim = 0x0507, + kCFStringEncodingWindowsVietnamese = 0x0508, + kCFStringEncodingWindowsKoreanJohab = 0x0510, + + + + kCFStringEncodingANSEL = 0x0601, + kCFStringEncodingJIS_X0201_76 = 0x0620, + kCFStringEncodingJIS_X0208_83 = 0x0621, + kCFStringEncodingJIS_X0208_90 = 0x0622, + kCFStringEncodingJIS_X0212_90 = 0x0623, + kCFStringEncodingJIS_C6226_78 = 0x0624, + kCFStringEncodingShiftJIS_X0213 __attribute__((availability(macosx,introduced=10_5))) = 0x0628, + kCFStringEncodingShiftJIS_X0213_MenKuTen = 0x0629, + kCFStringEncodingGB_2312_80 = 0x0630, + kCFStringEncodingGBK_95 = 0x0631, + kCFStringEncodingGB_18030_2000 = 0x0632, + kCFStringEncodingKSC_5601_87 = 0x0640, + kCFStringEncodingKSC_5601_92_Johab = 0x0641, + kCFStringEncodingCNS_11643_92_P1 = 0x0651, + kCFStringEncodingCNS_11643_92_P2 = 0x0652, + kCFStringEncodingCNS_11643_92_P3 = 0x0653, + + + kCFStringEncodingISO_2022_JP = 0x0820, + kCFStringEncodingISO_2022_JP_2 = 0x0821, + kCFStringEncodingISO_2022_JP_1 = 0x0822, + kCFStringEncodingISO_2022_JP_3 = 0x0823, + kCFStringEncodingISO_2022_CN = 0x0830, + kCFStringEncodingISO_2022_CN_EXT = 0x0831, + kCFStringEncodingISO_2022_KR = 0x0840, + + + kCFStringEncodingEUC_JP = 0x0920, + kCFStringEncodingEUC_CN = 0x0930, + kCFStringEncodingEUC_TW = 0x0931, + kCFStringEncodingEUC_KR = 0x0940, + + + kCFStringEncodingShiftJIS = 0x0A01, + kCFStringEncodingKOI8_R = 0x0A02, + kCFStringEncodingBig5 = 0x0A03, + kCFStringEncodingMacRomanLatin1 = 0x0A04, + kCFStringEncodingHZ_GB_2312 = 0x0A05, + kCFStringEncodingBig5_HKSCS_1999 = 0x0A06, + kCFStringEncodingVISCII = 0x0A07, + kCFStringEncodingKOI8_U = 0x0A08, + kCFStringEncodingBig5_E = 0x0A09, + + + + kCFStringEncodingNextStepJapanese = 0x0B02, + + + kCFStringEncodingEBCDIC_US = 0x0C01, + kCFStringEncodingEBCDIC_CP037 = 0x0C02, + + kCFStringEncodingUTF7 __attribute__((availability(macosx,introduced=10_6))) = 0x04000100, + kCFStringEncodingUTF7_IMAP __attribute__((availability(macosx,introduced=10_6))) = 0x0A10, + + + kCFStringEncodingShiftJIS_X0213_00 = 0x0628 +}; + +typedef const void * (*CFTreeRetainCallBack)(const void *info); + + + + + + + +typedef void (*CFTreeReleaseCallBack)(const void *info); +typedef CFStringRef (*CFTreeCopyDescriptionCallBack)(const void *info); +typedef struct { + CFIndex version; + void * info; + CFTreeRetainCallBack retain; + CFTreeReleaseCallBack release; + CFTreeCopyDescriptionCallBack copyDescription; +} CFTreeContext; +typedef void (*CFTreeApplierFunction)(const void *value, void *context); + + + + + +typedef struct __attribute__((objc_bridge_mutable(id))) __CFTree * CFTreeRef; + + + + + +extern +CFTypeID CFTreeGetTypeID(void); +extern +CFTreeRef CFTreeCreate(CFAllocatorRef allocator, const CFTreeContext *context); +extern +CFTreeRef CFTreeGetParent(CFTreeRef tree); +extern +CFTreeRef CFTreeGetNextSibling(CFTreeRef tree); +extern +CFTreeRef CFTreeGetFirstChild(CFTreeRef tree); +extern +void CFTreeGetContext(CFTreeRef tree, CFTreeContext *context); +extern +CFIndex CFTreeGetChildCount(CFTreeRef tree); +extern +CFTreeRef CFTreeGetChildAtIndex(CFTreeRef tree, CFIndex idx); +extern +void CFTreeGetChildren(CFTreeRef tree, CFTreeRef *children); +extern +void CFTreeApplyFunctionToChildren(CFTreeRef tree, CFTreeApplierFunction __attribute__((noescape)) applier, void *context); +extern +CFTreeRef CFTreeFindRoot(CFTreeRef tree); +extern +void CFTreeSetContext(CFTreeRef tree, const CFTreeContext *context); +extern +void CFTreePrependChild(CFTreeRef tree, CFTreeRef newChild); +extern +void CFTreeAppendChild(CFTreeRef tree, CFTreeRef newChild); +extern +void CFTreeInsertSibling(CFTreeRef tree, CFTreeRef newSibling); + + + + + + + +extern +void CFTreeRemove(CFTreeRef tree); + + + + + + + +extern +void CFTreeRemoveAllChildren(CFTreeRef tree); +extern +void CFTreeSortChildren(CFTreeRef tree, CFComparatorFunction comparator, void *context); + +extern +Boolean CFURLCreateDataAndPropertiesFromResource(CFAllocatorRef alloc, CFURLRef url, CFDataRef *resourceData, CFDictionaryRef *properties, CFArrayRef desiredProperties, SInt32 *errorCode) __attribute__((availability(macosx,introduced=10_0,deprecated=10_9,message="" "For resource data, use the CFReadStream API. For file resource properties, use CFURLCopyResourcePropertiesForKeys."))); +extern +Boolean CFURLWriteDataAndPropertiesToResource(CFURLRef url, CFDataRef dataToWrite, CFDictionaryRef propertiesToWrite, SInt32 *errorCode) __attribute__((availability(macosx,introduced=10_0,deprecated=10_9,message="" "For resource data, use the CFWriteStream API. For file resource properties, use CFURLSetResourcePropertiesForKeys."))); + + + + + +extern +Boolean CFURLDestroyResource(CFURLRef url, SInt32 *errorCode) __attribute__((availability(macosx,introduced=10_0,deprecated=10_9,message="" "Use CFURLGetFileSystemRepresentation and removefile(3) instead."))); + + + + + +extern +CFTypeRef CFURLCreatePropertyFromResource(CFAllocatorRef alloc, CFURLRef url, CFStringRef property, SInt32 *errorCode) __attribute__((availability(macosx,introduced=10_0,deprecated=10_9,message="" "For file resource properties, use CFURLCopyResourcePropertyForKey."))); + + + +typedef CFIndex CFURLError; enum { + kCFURLUnknownError = -10L, + kCFURLUnknownSchemeError = -11L, + kCFURLResourceNotFoundError = -12L, + kCFURLResourceAccessViolationError = -13L, + kCFURLRemoteHostUnavailableError = -14L, + kCFURLImproperArgumentsError = -15L, + kCFURLUnknownPropertyKeyError = -16L, + kCFURLPropertyKeyUnavailableError = -17L, + kCFURLTimeoutError = -18L +} __attribute__((availability(macosx,introduced=10_0,deprecated=10_9,message="" ))); + + + +extern +const CFStringRef kCFURLFileExists __attribute__((availability(macosx,introduced=10_0,deprecated=10_9,message="" "Use CFURLResourceIsReachable instead."))); +extern +const CFStringRef kCFURLFileDirectoryContents __attribute__((availability(macosx,introduced=10_0,deprecated=10_9,message="" "Use the CFURLEnumerator API instead."))); +extern +const CFStringRef kCFURLFileLength __attribute__((availability(macosx,introduced=10_0,deprecated=10_9,message="" "Use CFURLCopyResourcePropertyForKey with kCFURLFileSizeKey instead."))); +extern +const CFStringRef kCFURLFileLastModificationTime __attribute__((availability(macosx,introduced=10_0,deprecated=10_9,message="" "Use CFURLCopyResourcePropertyForKey with kCFURLContentModificationDateKey instead."))); +extern +const CFStringRef kCFURLFilePOSIXMode __attribute__((availability(macosx,introduced=10_0,deprecated=10_9,message="" "Use CFURLCopyResourcePropertyForKey with kCFURLFileSecurityKey and then the CFFileSecurity API instead."))); +extern +const CFStringRef kCFURLFileOwnerID __attribute__((availability(macosx,introduced=10_0,deprecated=10_9,message="" "Use CFURLCopyResourcePropertyForKey with kCFURLFileSecurityKey and then the CFFileSecurity API instead."))); +extern +const CFStringRef kCFURLHTTPStatusCode __attribute__((availability(macosx,introduced=10_0,deprecated=10_9,message="" "Use NSHTTPURLResponse methods instead."))); +extern +const CFStringRef kCFURLHTTPStatusLine __attribute__((availability(macosx,introduced=10_0,deprecated=10_9,message="" "Use NSHTTPURLResponse methods instead."))); +typedef const struct __attribute__((objc_bridge(id))) __CFUUID * CFUUIDRef; + +typedef struct { + UInt8 byte0; + UInt8 byte1; + UInt8 byte2; + UInt8 byte3; + UInt8 byte4; + UInt8 byte5; + UInt8 byte6; + UInt8 byte7; + UInt8 byte8; + UInt8 byte9; + UInt8 byte10; + UInt8 byte11; + UInt8 byte12; + UInt8 byte13; + UInt8 byte14; + UInt8 byte15; +} CFUUIDBytes; + + + + + + +extern +CFTypeID CFUUIDGetTypeID(void); + +extern +CFUUIDRef CFUUIDCreate(CFAllocatorRef alloc); + + +extern +CFUUIDRef CFUUIDCreateWithBytes(CFAllocatorRef alloc, UInt8 byte0, UInt8 byte1, UInt8 byte2, UInt8 byte3, UInt8 byte4, UInt8 byte5, UInt8 byte6, UInt8 byte7, UInt8 byte8, UInt8 byte9, UInt8 byte10, UInt8 byte11, UInt8 byte12, UInt8 byte13, UInt8 byte14, UInt8 byte15); + + +extern +CFUUIDRef CFUUIDCreateFromString(CFAllocatorRef alloc, CFStringRef uuidStr); + + +extern +CFStringRef CFUUIDCreateString(CFAllocatorRef alloc, CFUUIDRef uuid); + + +extern +CFUUIDRef CFUUIDGetConstantUUIDWithBytes(CFAllocatorRef alloc, UInt8 byte0, UInt8 byte1, UInt8 byte2, UInt8 byte3, UInt8 byte4, UInt8 byte5, UInt8 byte6, UInt8 byte7, UInt8 byte8, UInt8 byte9, UInt8 byte10, UInt8 byte11, UInt8 byte12, UInt8 byte13, UInt8 byte14, UInt8 byte15); + + +extern +CFUUIDBytes CFUUIDGetUUIDBytes(CFUUIDRef uuid); + +extern +CFUUIDRef CFUUIDCreateFromUUIDBytes(CFAllocatorRef alloc, CFUUIDBytes bytes); +extern +CFURLRef CFCopyHomeDirectoryURL(void) __attribute__((availability(macosx,unavailable))); +typedef struct __attribute__((objc_bridge(id))) __CFBundle *CFBundleRef; +typedef struct __attribute__((objc_bridge(id))) __CFBundle *CFPlugInRef; + + +extern +const CFStringRef kCFBundleInfoDictionaryVersionKey; + +extern +const CFStringRef kCFBundleExecutableKey; + +extern +const CFStringRef kCFBundleIdentifierKey; + +extern +const CFStringRef kCFBundleVersionKey; + + + +extern +const CFStringRef kCFBundleDevelopmentRegionKey; + +extern +const CFStringRef kCFBundleNameKey; + +extern +const CFStringRef kCFBundleLocalizationsKey; + + + + +extern +CFBundleRef CFBundleGetMainBundle(void); + +extern +CFBundleRef CFBundleGetBundleWithIdentifier(CFStringRef bundleID); + + + + + + + +extern +CFArrayRef CFBundleGetAllBundles(void); + + + + + +extern +CFTypeID CFBundleGetTypeID(void); + +extern +CFBundleRef CFBundleCreate(CFAllocatorRef allocator, CFURLRef bundleURL); + + +extern +CFArrayRef CFBundleCreateBundlesFromDirectory(CFAllocatorRef allocator, CFURLRef directoryURL, CFStringRef bundleType); + + + + + +extern +CFURLRef CFBundleCopyBundleURL(CFBundleRef bundle); + +extern +CFTypeRef CFBundleGetValueForInfoDictionaryKey(CFBundleRef bundle, CFStringRef key); + + + +extern +CFDictionaryRef CFBundleGetInfoDictionary(CFBundleRef bundle); + + + +extern +CFDictionaryRef CFBundleGetLocalInfoDictionary(CFBundleRef bundle); + + +extern +void CFBundleGetPackageInfo(CFBundleRef bundle, UInt32 *packageType, UInt32 *packageCreator); + +extern +CFStringRef CFBundleGetIdentifier(CFBundleRef bundle); + +extern +UInt32 CFBundleGetVersionNumber(CFBundleRef bundle); + +extern +CFStringRef CFBundleGetDevelopmentRegion(CFBundleRef bundle); + +extern +CFURLRef CFBundleCopySupportFilesDirectoryURL(CFBundleRef bundle); + +extern +CFURLRef CFBundleCopyResourcesDirectoryURL(CFBundleRef bundle); + +extern +CFURLRef CFBundleCopyPrivateFrameworksURL(CFBundleRef bundle); + +extern +CFURLRef CFBundleCopySharedFrameworksURL(CFBundleRef bundle); + +extern +CFURLRef CFBundleCopySharedSupportURL(CFBundleRef bundle); + +extern +CFURLRef CFBundleCopyBuiltInPlugInsURL(CFBundleRef bundle); + + + + + + +extern +CFDictionaryRef CFBundleCopyInfoDictionaryInDirectory(CFURLRef bundleURL); + +extern +Boolean CFBundleGetPackageInfoInDirectory(CFURLRef url, UInt32 *packageType, UInt32 *packageCreator); + + + +extern +CFURLRef CFBundleCopyResourceURL(CFBundleRef bundle, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName); + +extern +CFArrayRef CFBundleCopyResourceURLsOfType(CFBundleRef bundle, CFStringRef resourceType, CFStringRef subDirName); + +extern +CFStringRef CFBundleCopyLocalizedString(CFBundleRef bundle, CFStringRef key, CFStringRef value, CFStringRef tableName) __attribute__((format_arg(2))); +extern +CFURLRef CFBundleCopyResourceURLInDirectory(CFURLRef bundleURL, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName); + +extern +CFArrayRef CFBundleCopyResourceURLsOfTypeInDirectory(CFURLRef bundleURL, CFStringRef resourceType, CFStringRef subDirName); + + + + + + +extern +CFArrayRef CFBundleCopyBundleLocalizations(CFBundleRef bundle); + + +extern +CFArrayRef CFBundleCopyPreferredLocalizationsFromArray(CFArrayRef locArray); + + + + + + +extern +CFArrayRef CFBundleCopyLocalizationsForPreferences(CFArrayRef locArray, CFArrayRef prefArray); +extern +CFURLRef CFBundleCopyResourceURLForLocalization(CFBundleRef bundle, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName, CFStringRef localizationName); + +extern +CFArrayRef CFBundleCopyResourceURLsOfTypeForLocalization(CFBundleRef bundle, CFStringRef resourceType, CFStringRef subDirName, CFStringRef localizationName); +extern +CFDictionaryRef CFBundleCopyInfoDictionaryForURL(CFURLRef url); + + + + + +extern +CFArrayRef CFBundleCopyLocalizationsForURL(CFURLRef url); + + + + + + +extern +CFArrayRef CFBundleCopyExecutableArchitecturesForURL(CFURLRef url) __attribute__((availability(macosx,introduced=10_5))); +extern +CFURLRef CFBundleCopyExecutableURL(CFBundleRef bundle); + +enum { + kCFBundleExecutableArchitectureI386 = 0x00000007, + kCFBundleExecutableArchitecturePPC = 0x00000012, + kCFBundleExecutableArchitectureX86_64 = 0x01000007, + kCFBundleExecutableArchitecturePPC64 = 0x01000012 +} __attribute__((availability(macosx,introduced=10_5))); + +extern +CFArrayRef CFBundleCopyExecutableArchitectures(CFBundleRef bundle) __attribute__((availability(macosx,introduced=10_5))); + + + + + +extern +Boolean CFBundlePreflightExecutable(CFBundleRef bundle, CFErrorRef *error) __attribute__((availability(macosx,introduced=10_5))); + + + + + + +extern +Boolean CFBundleLoadExecutableAndReturnError(CFBundleRef bundle, CFErrorRef *error) __attribute__((availability(macosx,introduced=10_5))); + + + + + +extern +Boolean CFBundleLoadExecutable(CFBundleRef bundle); + +extern +Boolean CFBundleIsExecutableLoaded(CFBundleRef bundle); + +extern +void CFBundleUnloadExecutable(CFBundleRef bundle); + +extern +void *CFBundleGetFunctionPointerForName(CFBundleRef bundle, CFStringRef functionName); + +extern +void CFBundleGetFunctionPointersForNames(CFBundleRef bundle, CFArrayRef functionNames, void *ftbl[]); + +extern +void *CFBundleGetDataPointerForName(CFBundleRef bundle, CFStringRef symbolName); + +extern +void CFBundleGetDataPointersForNames(CFBundleRef bundle, CFArrayRef symbolNames, void *stbl[]); + +extern +CFURLRef CFBundleCopyAuxiliaryExecutableURL(CFBundleRef bundle, CFStringRef executableName); +extern +CFPlugInRef CFBundleGetPlugIn(CFBundleRef bundle); + + + + +typedef int CFBundleRefNum; + + + + +extern +CFBundleRefNum CFBundleOpenBundleResourceMap(CFBundleRef bundle); + + + + + + +extern +SInt32 CFBundleOpenBundleResourceFiles(CFBundleRef bundle, CFBundleRefNum *refNum, CFBundleRefNum *localizedRefNum); + + + +extern +void CFBundleCloseBundleResourceMap(CFBundleRef bundle, CFBundleRefNum refNum); + + +typedef struct __attribute__((objc_bridge_mutable(NSMessagePort))) __CFMessagePort * CFMessagePortRef; + +enum { + kCFMessagePortSuccess = 0, + kCFMessagePortSendTimeout = -1, + kCFMessagePortReceiveTimeout = -2, + kCFMessagePortIsInvalid = -3, + kCFMessagePortTransportError = -4, + kCFMessagePortBecameInvalidError = -5 +}; + +typedef struct { + CFIndex version; + void * info; + const void *(*retain)(const void *info); + void (*release)(const void *info); + CFStringRef (*copyDescription)(const void *info); +} CFMessagePortContext; + +typedef CFDataRef (*CFMessagePortCallBack)(CFMessagePortRef local, SInt32 msgid, CFDataRef data, void *info); + +typedef void (*CFMessagePortInvalidationCallBack)(CFMessagePortRef ms, void *info); + +extern CFTypeID CFMessagePortGetTypeID(void); + +extern CFMessagePortRef CFMessagePortCreateLocal(CFAllocatorRef allocator, CFStringRef name, CFMessagePortCallBack callout, CFMessagePortContext *context, Boolean *shouldFreeInfo); +extern CFMessagePortRef CFMessagePortCreateRemote(CFAllocatorRef allocator, CFStringRef name); + +extern Boolean CFMessagePortIsRemote(CFMessagePortRef ms); +extern CFStringRef CFMessagePortGetName(CFMessagePortRef ms); +extern Boolean CFMessagePortSetName(CFMessagePortRef ms, CFStringRef newName); +extern void CFMessagePortGetContext(CFMessagePortRef ms, CFMessagePortContext *context); +extern void CFMessagePortInvalidate(CFMessagePortRef ms); +extern Boolean CFMessagePortIsValid(CFMessagePortRef ms); +extern CFMessagePortInvalidationCallBack CFMessagePortGetInvalidationCallBack(CFMessagePortRef ms); +extern void CFMessagePortSetInvalidationCallBack(CFMessagePortRef ms, CFMessagePortInvalidationCallBack callout); + + +extern SInt32 CFMessagePortSendRequest(CFMessagePortRef remote, SInt32 msgid, CFDataRef data, CFTimeInterval sendTimeout, CFTimeInterval rcvTimeout, CFStringRef replyMode, CFDataRef *returnData); + +extern CFRunLoopSourceRef CFMessagePortCreateRunLoopSource(CFAllocatorRef allocator, CFMessagePortRef local, CFIndex order); + +extern void CFMessagePortSetDispatchQueue(CFMessagePortRef ms, dispatch_queue_t queue) __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFPlugInDynamicRegistrationKey; +extern const CFStringRef kCFPlugInDynamicRegisterFunctionKey; +extern const CFStringRef kCFPlugInUnloadFunctionKey; +extern const CFStringRef kCFPlugInFactoriesKey; +extern const CFStringRef kCFPlugInTypesKey; + + + + +typedef void (*CFPlugInDynamicRegisterFunction)(CFPlugInRef plugIn); +typedef void (*CFPlugInUnloadFunction)(CFPlugInRef plugIn); +typedef void *(*CFPlugInFactoryFunction)(CFAllocatorRef allocator, CFUUIDRef typeUUID); + + + +extern CFTypeID CFPlugInGetTypeID(void); + +extern CFPlugInRef CFPlugInCreate(CFAllocatorRef allocator, CFURLRef plugInURL); + + +extern CFBundleRef CFPlugInGetBundle(CFPlugInRef plugIn); + + + + + + + +extern void CFPlugInSetLoadOnDemand(CFPlugInRef plugIn, Boolean flag); + +extern Boolean CFPlugInIsLoadOnDemand(CFPlugInRef plugIn); + + + + + + +extern CFArrayRef CFPlugInFindFactoriesForPlugInType(CFUUIDRef typeUUID) __attribute__((cf_returns_retained)); + + + +extern CFArrayRef CFPlugInFindFactoriesForPlugInTypeInPlugIn(CFUUIDRef typeUUID, CFPlugInRef plugIn) __attribute__((cf_returns_retained)); + + +extern void *CFPlugInInstanceCreate(CFAllocatorRef allocator, CFUUIDRef factoryUUID, CFUUIDRef typeUUID); + + + + + +extern Boolean CFPlugInRegisterFactoryFunction(CFUUIDRef factoryUUID, CFPlugInFactoryFunction func); + +extern Boolean CFPlugInRegisterFactoryFunctionByName(CFUUIDRef factoryUUID, CFPlugInRef plugIn, CFStringRef functionName); + +extern Boolean CFPlugInUnregisterFactory(CFUUIDRef factoryUUID); + +extern Boolean CFPlugInRegisterPlugInType(CFUUIDRef factoryUUID, CFUUIDRef typeUUID); + +extern Boolean CFPlugInUnregisterPlugInType(CFUUIDRef factoryUUID, CFUUIDRef typeUUID); + + + + + +extern void CFPlugInAddInstanceForFactory(CFUUIDRef factoryID); + +extern void CFPlugInRemoveInstanceForFactory(CFUUIDRef factoryID); + + + + +typedef struct __attribute__((objc_bridge(id))) __CFPlugInInstance *CFPlugInInstanceRef; + +typedef Boolean (*CFPlugInInstanceGetInterfaceFunction)(CFPlugInInstanceRef instance, CFStringRef interfaceName, void **ftbl); +typedef void (*CFPlugInInstanceDeallocateInstanceDataFunction)(void *instanceData); + +extern Boolean CFPlugInInstanceGetInterfaceFunctionTable(CFPlugInInstanceRef instance, CFStringRef interfaceName, void **ftbl); + + +extern CFStringRef CFPlugInInstanceGetFactoryName(CFPlugInInstanceRef instance) __attribute__((cf_returns_retained)); + +extern void *CFPlugInInstanceGetInstanceData(CFPlugInInstanceRef instance); + +extern CFTypeID CFPlugInInstanceGetTypeID(void); + +extern CFPlugInInstanceRef CFPlugInInstanceCreateWithInstanceDataSize(CFAllocatorRef allocator, CFIndex instanceDataSize, CFPlugInInstanceDeallocateInstanceDataFunction deallocateInstanceFunction, CFStringRef factoryName, CFPlugInInstanceGetInterfaceFunction getInterfaceFunction); + + + +typedef struct __attribute__((objc_bridge_mutable(NSMachPort))) __CFMachPort * CFMachPortRef; + +typedef struct { + CFIndex version; + void * info; + const void *(*retain)(const void *info); + void (*release)(const void *info); + CFStringRef (*copyDescription)(const void *info); +} CFMachPortContext; + +typedef void (*CFMachPortCallBack)(CFMachPortRef port, void *msg, CFIndex size, void *info); +typedef void (*CFMachPortInvalidationCallBack)(CFMachPortRef port, void *info); + +extern CFTypeID CFMachPortGetTypeID(void); + +extern CFMachPortRef CFMachPortCreate(CFAllocatorRef allocator, CFMachPortCallBack callout, CFMachPortContext *context, Boolean *shouldFreeInfo); +extern CFMachPortRef CFMachPortCreateWithPort(CFAllocatorRef allocator, mach_port_t portNum, CFMachPortCallBack callout, CFMachPortContext *context, Boolean *shouldFreeInfo); + +extern mach_port_t CFMachPortGetPort(CFMachPortRef port); +extern void CFMachPortGetContext(CFMachPortRef port, CFMachPortContext *context); +extern void CFMachPortInvalidate(CFMachPortRef port); +extern Boolean CFMachPortIsValid(CFMachPortRef port); +extern CFMachPortInvalidationCallBack CFMachPortGetInvalidationCallBack(CFMachPortRef port); +extern void CFMachPortSetInvalidationCallBack(CFMachPortRef port, CFMachPortInvalidationCallBack callout); + +extern CFRunLoopSourceRef CFMachPortCreateRunLoopSource(CFAllocatorRef allocator, CFMachPortRef port, CFIndex order); + + +typedef const struct __attribute__((objc_bridge(NSAttributedString))) __CFAttributedString *CFAttributedStringRef; +typedef struct __attribute__((objc_bridge_mutable(NSMutableAttributedString))) __CFAttributedString *CFMutableAttributedStringRef; + + + + +extern CFTypeID CFAttributedStringGetTypeID(void); +extern CFAttributedStringRef CFAttributedStringCreate(CFAllocatorRef alloc, CFStringRef str, CFDictionaryRef attributes); + + + + +extern CFAttributedStringRef CFAttributedStringCreateWithSubstring(CFAllocatorRef alloc, CFAttributedStringRef aStr, CFRange range); + + + + +extern CFAttributedStringRef CFAttributedStringCreateCopy(CFAllocatorRef alloc, CFAttributedStringRef aStr); + + + + +extern CFStringRef CFAttributedStringGetString(CFAttributedStringRef aStr); + + + + +extern CFIndex CFAttributedStringGetLength(CFAttributedStringRef aStr); + + + + + + +extern CFDictionaryRef CFAttributedStringGetAttributes(CFAttributedStringRef aStr, CFIndex loc, CFRange *effectiveRange); + + + + +extern CFTypeRef CFAttributedStringGetAttribute(CFAttributedStringRef aStr, CFIndex loc, CFStringRef attrName, CFRange *effectiveRange); + + + + +extern CFDictionaryRef CFAttributedStringGetAttributesAndLongestEffectiveRange(CFAttributedStringRef aStr, CFIndex loc, CFRange inRange, CFRange *longestEffectiveRange); + + + + +extern CFTypeRef CFAttributedStringGetAttributeAndLongestEffectiveRange(CFAttributedStringRef aStr, CFIndex loc, CFStringRef attrName, CFRange inRange, CFRange *longestEffectiveRange); +extern CFMutableAttributedStringRef CFAttributedStringCreateMutableCopy(CFAllocatorRef alloc, CFIndex maxLength, CFAttributedStringRef aStr); + + + + +extern CFMutableAttributedStringRef CFAttributedStringCreateMutable(CFAllocatorRef alloc, CFIndex maxLength); + + + + + + +extern void CFAttributedStringReplaceString(CFMutableAttributedStringRef aStr, CFRange range, CFStringRef replacement); + + + + + + +extern CFMutableStringRef CFAttributedStringGetMutableString(CFMutableAttributedStringRef aStr); + + + + +extern void CFAttributedStringSetAttributes(CFMutableAttributedStringRef aStr, CFRange range, CFDictionaryRef replacement, Boolean clearOtherAttributes); + + + + +extern void CFAttributedStringSetAttribute(CFMutableAttributedStringRef aStr, CFRange range, CFStringRef attrName, CFTypeRef value); + + + + +extern void CFAttributedStringRemoveAttribute(CFMutableAttributedStringRef aStr, CFRange range, CFStringRef attrName); + + + + +extern void CFAttributedStringReplaceAttributedString(CFMutableAttributedStringRef aStr, CFRange range, CFAttributedStringRef replacement); + + + + +extern void CFAttributedStringBeginEditing(CFMutableAttributedStringRef aStr); + + + + +extern void CFAttributedStringEndEditing(CFMutableAttributedStringRef aStr); + +typedef const struct __attribute__((objc_bridge_mutable(id))) __CFURLEnumerator *CFURLEnumeratorRef; + + +extern +CFTypeID CFURLEnumeratorGetTypeID( void ) __attribute__((availability(macosx,introduced=10_6))); + + + +typedef CFOptionFlags CFURLEnumeratorOptions; enum { + kCFURLEnumeratorDefaultBehavior = 0, + kCFURLEnumeratorDescendRecursively = 1UL << 0, + kCFURLEnumeratorSkipInvisibles = 1UL << 1, + kCFURLEnumeratorGenerateFileReferenceURLs = 1UL << 2, + kCFURLEnumeratorSkipPackageContents = 1UL << 3, + kCFURLEnumeratorIncludeDirectoriesPreOrder = 1UL << 4, + kCFURLEnumeratorIncludeDirectoriesPostOrder = 1UL << 5, + +}; + + + + + + + +extern +CFURLEnumeratorRef CFURLEnumeratorCreateForDirectoryURL( CFAllocatorRef alloc, CFURLRef directoryURL, CFURLEnumeratorOptions option, CFArrayRef propertyKeys ) __attribute__((availability(macosx,introduced=10_6))); +extern +CFURLEnumeratorRef CFURLEnumeratorCreateForMountedVolumes( CFAllocatorRef alloc, CFURLEnumeratorOptions option, CFArrayRef propertyKeys ) __attribute__((availability(macosx,introduced=10_6))); + + + +typedef CFIndex CFURLEnumeratorResult; enum { + kCFURLEnumeratorSuccess = 1, + kCFURLEnumeratorEnd = 2, + kCFURLEnumeratorError = 3, + kCFURLEnumeratorDirectoryPostOrderSuccess = 4, +}; + + + + + +extern +CFURLEnumeratorResult CFURLEnumeratorGetNextURL( CFURLEnumeratorRef enumerator, CFURLRef *url, CFErrorRef *error ) __attribute__((availability(macosx,introduced=10_6))); +extern +void CFURLEnumeratorSkipDescendents( CFURLEnumeratorRef enumerator ) __attribute__((availability(macosx,introduced=10_6))); + + + + +extern +CFIndex CFURLEnumeratorGetDescendentLevel( CFURLEnumeratorRef enumerator ) __attribute__((availability(macosx,introduced=10_6))); + + + + + + +extern +Boolean CFURLEnumeratorGetSourceDidChange( CFURLEnumeratorRef enumerator ) __attribute__((availability(macosx,introduced=10_6,deprecated=10_7,message="" ))); + + + + + + +typedef struct { + + unsigned char g_guid[16]; +} guid_t; + + +typedef struct { + u_int8_t sid_kind; + u_int8_t sid_authcount; + u_int8_t sid_authority[6]; + + u_int32_t sid_authorities[16]; +} ntsid_t; +struct kauth_identity_extlookup { + u_int32_t el_seqno; + u_int32_t el_result; + + + + + + u_int32_t el_flags; + __darwin_pid_t el_info_pid; + u_int64_t el_extend; + u_int32_t el_info_reserved_1; + + uid_t el_uid; + guid_t el_uguid; + u_int32_t el_uguid_valid; + ntsid_t el_usid; + u_int32_t el_usid_valid; + gid_t el_gid; + guid_t el_gguid; + u_int32_t el_gguid_valid; + ntsid_t el_gsid; + u_int32_t el_gsid_valid; + u_int32_t el_member_valid; + u_int32_t el_sup_grp_cnt; + gid_t el_sup_groups[16]; +}; + +struct kauth_cache_sizes { + u_int32_t kcs_group_size; + u_int32_t kcs_id_size; +}; +typedef u_int32_t kauth_ace_rights_t; + + +struct kauth_ace { + guid_t ace_applicable; + u_int32_t ace_flags; + kauth_ace_rights_t ace_rights; + + + + + + +}; + + + +typedef struct kauth_ace *kauth_ace_t; + + + + +struct kauth_acl { + u_int32_t acl_entrycount; + u_int32_t acl_flags; + + struct kauth_ace acl_ace[1]; +}; +typedef struct kauth_acl *kauth_acl_t; +struct kauth_filesec { + u_int32_t fsec_magic; + + guid_t fsec_owner; + guid_t fsec_group; + + struct kauth_acl fsec_acl; +}; +typedef struct kauth_filesec *kauth_filesec_t; +typedef enum { + ACL_READ_DATA = (1<<1), + ACL_LIST_DIRECTORY = (1<<1), + ACL_WRITE_DATA = (1<<2), + ACL_ADD_FILE = (1<<2), + ACL_EXECUTE = (1<<3), + ACL_SEARCH = (1<<3), + ACL_DELETE = (1<<4), + ACL_APPEND_DATA = (1<<5), + ACL_ADD_SUBDIRECTORY = (1<<5), + ACL_DELETE_CHILD = (1<<6), + ACL_READ_ATTRIBUTES = (1<<7), + ACL_WRITE_ATTRIBUTES = (1<<8), + ACL_READ_EXTATTRIBUTES = (1<<9), + ACL_WRITE_EXTATTRIBUTES = (1<<10), + ACL_READ_SECURITY = (1<<11), + ACL_WRITE_SECURITY = (1<<12), + ACL_CHANGE_OWNER = (1<<13), + ACL_SYNCHRONIZE = (1<<20), +} acl_perm_t; + + +typedef enum { + ACL_UNDEFINED_TAG = 0, + ACL_EXTENDED_ALLOW = 1, + ACL_EXTENDED_DENY = 2 +} acl_tag_t; + + +typedef enum { + ACL_TYPE_EXTENDED = 0x00000100, + + ACL_TYPE_ACCESS = 0x00000000, + ACL_TYPE_DEFAULT = 0x00000001, + + ACL_TYPE_AFS = 0x00000002, + ACL_TYPE_CODA = 0x00000003, + ACL_TYPE_NTFS = 0x00000004, + ACL_TYPE_NWFS = 0x00000005 +} acl_type_t; + + + + + + +typedef enum { + ACL_FIRST_ENTRY = 0, + ACL_NEXT_ENTRY = -1, + ACL_LAST_ENTRY = -2 +} acl_entry_id_t; + + +typedef enum { + ACL_FLAG_DEFER_INHERIT = (1 << 0), + ACL_FLAG_NO_INHERIT = (1<<17), + ACL_ENTRY_INHERITED = (1<<4), + ACL_ENTRY_FILE_INHERIT = (1<<5), + ACL_ENTRY_DIRECTORY_INHERIT = (1<<6), + ACL_ENTRY_LIMIT_INHERIT = (1<<7), + ACL_ENTRY_ONLY_INHERIT = (1<<8) +} acl_flag_t; + + + +struct _acl; +struct _acl_entry; +struct _acl_permset; +struct _acl_flagset; + +typedef struct _acl *acl_t; +typedef struct _acl_entry *acl_entry_t; +typedef struct _acl_permset *acl_permset_t; +typedef struct _acl_flagset *acl_flagset_t; + +typedef u_int64_t acl_permset_mask_t; + + + +extern acl_t acl_dup(acl_t acl); +extern int acl_free(void *obj_p); +extern acl_t acl_init(int count); + + +extern int acl_copy_entry(acl_entry_t dest_d, acl_entry_t src_d); +extern int acl_create_entry(acl_t *acl_p, acl_entry_t *entry_p); +extern int acl_create_entry_np(acl_t *acl_p, acl_entry_t *entry_p, int entry_index); +extern int acl_delete_entry(acl_t acl, acl_entry_t entry_d); +extern int acl_get_entry(acl_t acl, int entry_id, acl_entry_t *entry_p); +extern int acl_valid(acl_t acl); +extern int acl_valid_fd_np(int fd, acl_type_t type, acl_t acl); +extern int acl_valid_file_np(const char *path, acl_type_t type, acl_t acl); +extern int acl_valid_link_np(const char *path, acl_type_t type, acl_t acl); + + +extern int acl_add_perm(acl_permset_t permset_d, acl_perm_t perm); +extern int acl_calc_mask(acl_t *acl_p); +extern int acl_clear_perms(acl_permset_t permset_d); +extern int acl_delete_perm(acl_permset_t permset_d, acl_perm_t perm); +extern int acl_get_perm_np(acl_permset_t permset_d, acl_perm_t perm); +extern int acl_get_permset(acl_entry_t entry_d, acl_permset_t *permset_p); +extern int acl_set_permset(acl_entry_t entry_d, acl_permset_t permset_d); + + +extern int acl_maximal_permset_mask_np(acl_permset_mask_t * mask_p) __attribute__((availability(macosx,introduced=10.7))); +extern int acl_get_permset_mask_np(acl_entry_t entry_d, acl_permset_mask_t * mask_p) __attribute__((availability(macosx,introduced=10.7))); +extern int acl_set_permset_mask_np(acl_entry_t entry_d, acl_permset_mask_t mask) __attribute__((availability(macosx,introduced=10.7))); + + +extern int acl_add_flag_np(acl_flagset_t flagset_d, acl_flag_t flag); +extern int acl_clear_flags_np(acl_flagset_t flagset_d); +extern int acl_delete_flag_np(acl_flagset_t flagset_d, acl_flag_t flag); +extern int acl_get_flag_np(acl_flagset_t flagset_d, acl_flag_t flag); +extern int acl_get_flagset_np(void *obj_p, acl_flagset_t *flagset_p); +extern int acl_set_flagset_np(void *obj_p, acl_flagset_t flagset_d); + + +extern void *acl_get_qualifier(acl_entry_t entry_d); +extern int acl_get_tag_type(acl_entry_t entry_d, acl_tag_t *tag_type_p); +extern int acl_set_qualifier(acl_entry_t entry_d, const void *tag_qualifier_p); +extern int acl_set_tag_type(acl_entry_t entry_d, acl_tag_t tag_type); + + +extern int acl_delete_def_file(const char *path_p); +extern acl_t acl_get_fd(int fd); +extern acl_t acl_get_fd_np(int fd, acl_type_t type); +extern acl_t acl_get_file(const char *path_p, acl_type_t type); +extern acl_t acl_get_link_np(const char *path_p, acl_type_t type); +extern int acl_set_fd(int fd, acl_t acl); +extern int acl_set_fd_np(int fd, acl_t acl, acl_type_t acl_type); +extern int acl_set_file(const char *path_p, acl_type_t type, acl_t acl); +extern int acl_set_link_np(const char *path_p, acl_type_t type, acl_t acl); + + +extern ssize_t acl_copy_ext(void *buf_p, acl_t acl, ssize_t size); +extern ssize_t acl_copy_ext_native(void *buf_p, acl_t acl, ssize_t size); +extern acl_t acl_copy_int(const void *buf_p); +extern acl_t acl_copy_int_native(const void *buf_p); +extern acl_t acl_from_text(const char *buf_p); +extern ssize_t acl_size(acl_t acl); +extern char *acl_to_text(acl_t acl, ssize_t *len_p); +typedef struct __attribute__((objc_bridge_mutable(NSFileSecurity))) __CFFileSecurity* CFFileSecurityRef; + + + + + + + +extern +CFTypeID CFFileSecurityGetTypeID(void) __attribute__((availability(macosx,introduced=10_7))); +extern +CFFileSecurityRef CFFileSecurityCreate(CFAllocatorRef allocator) __attribute__((availability(macosx,introduced=10_7))); +extern +CFFileSecurityRef CFFileSecurityCreateCopy(CFAllocatorRef allocator, CFFileSecurityRef fileSec) __attribute__((availability(macosx,introduced=10_7))); +extern +Boolean CFFileSecurityCopyOwnerUUID(CFFileSecurityRef fileSec, CFUUIDRef *ownerUUID) __attribute__((availability(macosx,introduced=10_7))); +extern +Boolean CFFileSecuritySetOwnerUUID(CFFileSecurityRef fileSec, CFUUIDRef ownerUUID) __attribute__((availability(macosx,introduced=10_7))); +extern +Boolean CFFileSecurityCopyGroupUUID(CFFileSecurityRef fileSec, CFUUIDRef *groupUUID) __attribute__((availability(macosx,introduced=10_7))); +extern +Boolean CFFileSecuritySetGroupUUID(CFFileSecurityRef fileSec, CFUUIDRef groupUUID) __attribute__((availability(macosx,introduced=10_7))); +extern +Boolean CFFileSecurityCopyAccessControlList(CFFileSecurityRef fileSec, acl_t *accessControlList) __attribute__((availability(macosx,introduced=10_7))); +extern +Boolean CFFileSecuritySetAccessControlList(CFFileSecurityRef fileSec, acl_t accessControlList) __attribute__((availability(macosx,introduced=10_7))); +extern +Boolean CFFileSecurityGetOwner(CFFileSecurityRef fileSec, uid_t *owner) __attribute__((availability(macosx,introduced=10_7))); +extern +Boolean CFFileSecuritySetOwner(CFFileSecurityRef fileSec, uid_t owner) __attribute__((availability(macosx,introduced=10_7))); +extern +Boolean CFFileSecurityGetGroup(CFFileSecurityRef fileSec, gid_t *group) __attribute__((availability(macosx,introduced=10_7))); +extern +Boolean CFFileSecuritySetGroup(CFFileSecurityRef fileSec, gid_t group) __attribute__((availability(macosx,introduced=10_7))); +extern +Boolean CFFileSecurityGetMode(CFFileSecurityRef fileSec, mode_t *mode) __attribute__((availability(macosx,introduced=10_7))); +extern +Boolean CFFileSecuritySetMode(CFFileSecurityRef fileSec, mode_t mode) __attribute__((availability(macosx,introduced=10_7))); + + + +typedef CFOptionFlags CFFileSecurityClearOptions; enum { + kCFFileSecurityClearOwner = 1UL << 0, + kCFFileSecurityClearGroup = 1UL << 1, + kCFFileSecurityClearMode = 1UL << 2, + kCFFileSecurityClearOwnerUUID = 1UL << 3, + kCFFileSecurityClearGroupUUID = 1UL << 4, + kCFFileSecurityClearAccessControlList = 1UL << 5 +} __attribute__((availability(macosx,introduced=10_8))); +extern +Boolean CFFileSecurityClearProperties(CFFileSecurityRef fileSec, CFFileSecurityClearOptions clearPropertyMask) __attribute__((availability(macosx,introduced=10_8))); +extern +CFStringRef CFStringTokenizerCopyBestStringLanguage(CFStringRef string, CFRange range) __attribute__((availability(macosx,introduced=10_5))); + + + + + + + +typedef struct __attribute__((objc_bridge_mutable(id))) __CFStringTokenizer * CFStringTokenizerRef; + + + + +enum { + + + + + + + kCFStringTokenizerUnitWord = 0, + kCFStringTokenizerUnitSentence = 1, + kCFStringTokenizerUnitParagraph = 2, + kCFStringTokenizerUnitLineBreak = 3, + + + + + kCFStringTokenizerUnitWordBoundary = 4, + kCFStringTokenizerAttributeLatinTranscription = 1UL << 16, + + + kCFStringTokenizerAttributeLanguage = 1UL << 17, +}; + + + + + + +typedef CFOptionFlags CFStringTokenizerTokenType; enum { + + kCFStringTokenizerTokenNone = 0, + + + kCFStringTokenizerTokenNormal = 1UL << 0, + + + + + + kCFStringTokenizerTokenHasSubTokensMask = 1UL << 1, + + + + + + + kCFStringTokenizerTokenHasDerivedSubTokensMask = 1UL << 2, + + kCFStringTokenizerTokenHasHasNumbersMask = 1UL << 3, + kCFStringTokenizerTokenHasNonLettersMask = 1UL << 4, + kCFStringTokenizerTokenIsCJWordMask = 1UL << 5 +}; + + + + + + +extern +CFTypeID CFStringTokenizerGetTypeID(void) __attribute__((availability(macosx,introduced=10_5))); +extern +CFStringTokenizerRef CFStringTokenizerCreate(CFAllocatorRef alloc, CFStringRef string, CFRange range, CFOptionFlags options, CFLocaleRef locale) __attribute__((availability(macosx,introduced=10_5))); +extern +void CFStringTokenizerSetString(CFStringTokenizerRef tokenizer, CFStringRef string, CFRange range) __attribute__((availability(macosx,introduced=10_5))); +extern +CFStringTokenizerTokenType CFStringTokenizerGoToTokenAtIndex(CFStringTokenizerRef tokenizer, CFIndex index) __attribute__((availability(macosx,introduced=10_5))); +extern +CFStringTokenizerTokenType CFStringTokenizerAdvanceToNextToken(CFStringTokenizerRef tokenizer) __attribute__((availability(macosx,introduced=10_5))); +extern +CFRange CFStringTokenizerGetCurrentTokenRange(CFStringTokenizerRef tokenizer) __attribute__((availability(macosx,introduced=10_5))); +extern +CFTypeRef CFStringTokenizerCopyCurrentTokenAttribute(CFStringTokenizerRef tokenizer, CFOptionFlags attribute) __attribute__((availability(macosx,introduced=10_5))); +extern +CFIndex CFStringTokenizerGetCurrentSubTokens(CFStringTokenizerRef tokenizer, CFRange *ranges, CFIndex maxRangeLength, CFMutableArrayRef derivedSubTokens) __attribute__((availability(macosx,introduced=10_5))); +typedef int CFFileDescriptorNativeDescriptor; + +typedef struct __attribute__((objc_bridge_mutable(id))) __CFFileDescriptor * CFFileDescriptorRef; + + +enum { + kCFFileDescriptorReadCallBack = 1UL << 0, + kCFFileDescriptorWriteCallBack = 1UL << 1 +}; + +typedef void (*CFFileDescriptorCallBack)(CFFileDescriptorRef f, CFOptionFlags callBackTypes, void *info); + +typedef struct { + CFIndex version; + void * info; + void * (*retain)(void *info); + void (*release)(void *info); + CFStringRef (*copyDescription)(void *info); +} CFFileDescriptorContext; + +extern CFTypeID CFFileDescriptorGetTypeID(void) __attribute__((availability(macosx,introduced=10_5))); + +extern CFFileDescriptorRef CFFileDescriptorCreate(CFAllocatorRef allocator, CFFileDescriptorNativeDescriptor fd, Boolean closeOnInvalidate, CFFileDescriptorCallBack callout, const CFFileDescriptorContext *context) __attribute__((availability(macosx,introduced=10_5))); + +extern CFFileDescriptorNativeDescriptor CFFileDescriptorGetNativeDescriptor(CFFileDescriptorRef f) __attribute__((availability(macosx,introduced=10_5))); + +extern void CFFileDescriptorGetContext(CFFileDescriptorRef f, CFFileDescriptorContext *context) __attribute__((availability(macosx,introduced=10_5))); + +extern void CFFileDescriptorEnableCallBacks(CFFileDescriptorRef f, CFOptionFlags callBackTypes) __attribute__((availability(macosx,introduced=10_5))); +extern void CFFileDescriptorDisableCallBacks(CFFileDescriptorRef f, CFOptionFlags callBackTypes) __attribute__((availability(macosx,introduced=10_5))); + +extern void CFFileDescriptorInvalidate(CFFileDescriptorRef f) __attribute__((availability(macosx,introduced=10_5))); +extern Boolean CFFileDescriptorIsValid(CFFileDescriptorRef f) __attribute__((availability(macosx,introduced=10_5))); + +extern CFRunLoopSourceRef CFFileDescriptorCreateRunLoopSource(CFAllocatorRef allocator, CFFileDescriptorRef f, CFIndex order) __attribute__((availability(macosx,introduced=10_5))); + + + + +typedef struct __attribute__((objc_bridge_mutable(id))) __CFUserNotification * CFUserNotificationRef; +typedef void (*CFUserNotificationCallBack)(CFUserNotificationRef userNotification, CFOptionFlags responseFlags); + +extern +CFTypeID CFUserNotificationGetTypeID(void); + +extern +CFUserNotificationRef CFUserNotificationCreate(CFAllocatorRef allocator, CFTimeInterval timeout, CFOptionFlags flags, SInt32 *error, CFDictionaryRef dictionary); + +extern +SInt32 CFUserNotificationReceiveResponse(CFUserNotificationRef userNotification, CFTimeInterval timeout, CFOptionFlags *responseFlags); + +extern +CFStringRef CFUserNotificationGetResponseValue(CFUserNotificationRef userNotification, CFStringRef key, CFIndex idx); + +extern +CFDictionaryRef CFUserNotificationGetResponseDictionary(CFUserNotificationRef userNotification); + +extern +SInt32 CFUserNotificationUpdate(CFUserNotificationRef userNotification, CFTimeInterval timeout, CFOptionFlags flags, CFDictionaryRef dictionary); + +extern +SInt32 CFUserNotificationCancel(CFUserNotificationRef userNotification); + +extern +CFRunLoopSourceRef CFUserNotificationCreateRunLoopSource(CFAllocatorRef allocator, CFUserNotificationRef userNotification, CFUserNotificationCallBack callout, CFIndex order); + + + + +extern +SInt32 CFUserNotificationDisplayNotice(CFTimeInterval timeout, CFOptionFlags flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle); + +extern +SInt32 CFUserNotificationDisplayAlert(CFTimeInterval timeout, CFOptionFlags flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle, CFStringRef alternateButtonTitle, CFStringRef otherButtonTitle, CFOptionFlags *responseFlags); + + + + +enum { + kCFUserNotificationStopAlertLevel = 0, + kCFUserNotificationNoteAlertLevel = 1, + kCFUserNotificationCautionAlertLevel = 2, + kCFUserNotificationPlainAlertLevel = 3 +}; + +enum { + kCFUserNotificationDefaultResponse = 0, + kCFUserNotificationAlternateResponse = 1, + kCFUserNotificationOtherResponse = 2, + kCFUserNotificationCancelResponse = 3 +}; + +enum { + kCFUserNotificationNoDefaultButtonFlag = (1UL << 5), + kCFUserNotificationUseRadioButtonsFlag = (1UL << 6) +}; + +static __inline__ __attribute__((always_inline)) CFOptionFlags CFUserNotificationCheckBoxChecked(CFIndex i) {return ((CFOptionFlags)(1UL << (8 + i)));} +static __inline__ __attribute__((always_inline)) CFOptionFlags CFUserNotificationSecureTextField(CFIndex i) {return ((CFOptionFlags)(1UL << (16 + i)));} +static __inline__ __attribute__((always_inline)) CFOptionFlags CFUserNotificationPopUpSelection(CFIndex n) {return ((CFOptionFlags)(n << 24));} + + + + +extern +const CFStringRef kCFUserNotificationIconURLKey; + +extern +const CFStringRef kCFUserNotificationSoundURLKey; + +extern +const CFStringRef kCFUserNotificationLocalizationURLKey; + +extern +const CFStringRef kCFUserNotificationAlertHeaderKey; + +extern +const CFStringRef kCFUserNotificationAlertMessageKey; + +extern +const CFStringRef kCFUserNotificationDefaultButtonTitleKey; + +extern +const CFStringRef kCFUserNotificationAlternateButtonTitleKey; + +extern +const CFStringRef kCFUserNotificationOtherButtonTitleKey; + +extern +const CFStringRef kCFUserNotificationProgressIndicatorValueKey; + +extern +const CFStringRef kCFUserNotificationPopUpTitlesKey; + +extern +const CFStringRef kCFUserNotificationTextFieldTitlesKey; + +extern +const CFStringRef kCFUserNotificationCheckBoxTitlesKey; + +extern +const CFStringRef kCFUserNotificationTextFieldValuesKey; + +extern +const CFStringRef kCFUserNotificationPopUpSelectionKey __attribute__((availability(macosx,introduced=10_3))); +enum { + kCFXMLNodeCurrentVersion = 1 +}; + +typedef const struct __CFXMLNode * CFXMLNodeRef; +typedef CFTreeRef CFXMLTreeRef; +typedef CFIndex CFXMLNodeTypeCode; enum { + kCFXMLNodeTypeDocument = 1, + kCFXMLNodeTypeElement = 2, + kCFXMLNodeTypeAttribute = 3, + kCFXMLNodeTypeProcessingInstruction = 4, + kCFXMLNodeTypeComment = 5, + kCFXMLNodeTypeText = 6, + kCFXMLNodeTypeCDATASection = 7, + kCFXMLNodeTypeDocumentFragment = 8, + kCFXMLNodeTypeEntity = 9, + kCFXMLNodeTypeEntityReference = 10, + kCFXMLNodeTypeDocumentType = 11, + kCFXMLNodeTypeWhitespace = 12, + kCFXMLNodeTypeNotation = 13, + kCFXMLNodeTypeElementTypeDeclaration = 14, + kCFXMLNodeTypeAttributeListDeclaration = 15 +}; + +typedef struct { + CFDictionaryRef attributes; + CFArrayRef attributeOrder; + Boolean isEmpty; + char _reserved[3]; +} CFXMLElementInfo; + +typedef struct { + CFStringRef dataString; +} CFXMLProcessingInstructionInfo; + +typedef struct { + CFURLRef sourceURL; + CFStringEncoding encoding; +} CFXMLDocumentInfo; + +typedef struct { + CFURLRef systemID; + CFStringRef publicID; +} CFXMLExternalID; + +typedef struct { + CFXMLExternalID externalID; +} CFXMLDocumentTypeInfo; + +typedef struct { + CFXMLExternalID externalID; +} CFXMLNotationInfo; + +typedef struct { + + CFStringRef contentDescription; +} CFXMLElementTypeDeclarationInfo; + +typedef struct { + + CFStringRef attributeName; + CFStringRef typeString; + CFStringRef defaultString; +} CFXMLAttributeDeclarationInfo; + +typedef struct { + CFIndex numberOfAttributes; + CFXMLAttributeDeclarationInfo *attributes; +} CFXMLAttributeListDeclarationInfo; + +typedef CFIndex CFXMLEntityTypeCode; enum { + kCFXMLEntityTypeParameter, + kCFXMLEntityTypeParsedInternal, + kCFXMLEntityTypeParsedExternal, + kCFXMLEntityTypeUnparsed, + kCFXMLEntityTypeCharacter +}; + +typedef struct { + CFXMLEntityTypeCode entityType; + CFStringRef replacementText; + CFXMLExternalID entityID; + CFStringRef notationName; +} CFXMLEntityInfo; + +typedef struct { + CFXMLEntityTypeCode entityType; +} CFXMLEntityReferenceInfo; +extern +CFTypeID CFXMLNodeGetTypeID(void) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + + +extern +CFXMLNodeRef CFXMLNodeCreate(CFAllocatorRef alloc, CFXMLNodeTypeCode xmlType, CFStringRef dataString, const void *additionalInfoPtr, CFIndex version) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + + +extern +CFXMLNodeRef CFXMLNodeCreateCopy(CFAllocatorRef alloc, CFXMLNodeRef origNode) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + +extern +CFXMLNodeTypeCode CFXMLNodeGetTypeCode(CFXMLNodeRef node) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + +extern +CFStringRef CFXMLNodeGetString(CFXMLNodeRef node) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + +extern +const void *CFXMLNodeGetInfoPtr(CFXMLNodeRef node) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + +extern +CFIndex CFXMLNodeGetVersion(CFXMLNodeRef node) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + + + + +extern +CFXMLTreeRef CFXMLTreeCreateWithNode(CFAllocatorRef allocator, CFXMLNodeRef node) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + + +extern +CFXMLNodeRef CFXMLTreeGetNode(CFXMLTreeRef xmlTree) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); +typedef struct __CFXMLParser * CFXMLParserRef; +typedef CFOptionFlags CFXMLParserOptions; enum { + kCFXMLParserValidateDocument = (1UL << 0), + kCFXMLParserSkipMetaData = (1UL << 1), + kCFXMLParserReplacePhysicalEntities = (1UL << 2), + kCFXMLParserSkipWhitespace = (1UL << 3), + kCFXMLParserResolveExternalEntities = (1UL << 4), + kCFXMLParserAddImpliedAttributes = (1UL << 5), + kCFXMLParserAllOptions = 0x00FFFFFF, + kCFXMLParserNoOptions = 0 +}; + + +typedef CFIndex CFXMLParserStatusCode; enum { + kCFXMLStatusParseNotBegun = -2, + kCFXMLStatusParseInProgress = -1, + kCFXMLStatusParseSuccessful = 0, + kCFXMLErrorUnexpectedEOF = 1, + kCFXMLErrorUnknownEncoding, + kCFXMLErrorEncodingConversionFailure, + kCFXMLErrorMalformedProcessingInstruction, + kCFXMLErrorMalformedDTD, + kCFXMLErrorMalformedName, + kCFXMLErrorMalformedCDSect, + kCFXMLErrorMalformedCloseTag, + kCFXMLErrorMalformedStartTag, + kCFXMLErrorMalformedDocument, + kCFXMLErrorElementlessDocument, + kCFXMLErrorMalformedComment, + kCFXMLErrorMalformedCharacterReference, + kCFXMLErrorMalformedParsedCharacterData, + kCFXMLErrorNoData +}; +typedef void * (*CFXMLParserCreateXMLStructureCallBack)(CFXMLParserRef parser, CFXMLNodeRef nodeDesc, void *info); +typedef void (*CFXMLParserAddChildCallBack)(CFXMLParserRef parser, void *parent, void *child, void *info); +typedef void (*CFXMLParserEndXMLStructureCallBack)(CFXMLParserRef parser, void *xmlType, void *info); +typedef CFDataRef (*CFXMLParserResolveExternalEntityCallBack)(CFXMLParserRef parser, CFXMLExternalID *extID, void *info); +typedef Boolean (*CFXMLParserHandleErrorCallBack)(CFXMLParserRef parser, CFXMLParserStatusCode error, void *info); +typedef struct { + CFIndex version; + CFXMLParserCreateXMLStructureCallBack createXMLStructure; + CFXMLParserAddChildCallBack addChild; + CFXMLParserEndXMLStructureCallBack endXMLStructure; + CFXMLParserResolveExternalEntityCallBack resolveExternalEntity; + CFXMLParserHandleErrorCallBack handleError; +} CFXMLParserCallBacks; + +typedef const void * (*CFXMLParserRetainCallBack)(const void *info); +typedef void (*CFXMLParserReleaseCallBack)(const void *info); +typedef CFStringRef (*CFXMLParserCopyDescriptionCallBack)(const void *info); +typedef struct { + CFIndex version; + void * info; + CFXMLParserRetainCallBack retain; + CFXMLParserReleaseCallBack release; + CFXMLParserCopyDescriptionCallBack copyDescription; +} CFXMLParserContext; + +extern +CFTypeID CFXMLParserGetTypeID(void) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); +extern +CFXMLParserRef CFXMLParserCreate(CFAllocatorRef allocator, CFDataRef xmlData, CFURLRef dataSource, CFOptionFlags parseOptions, CFIndex versionOfNodes, CFXMLParserCallBacks *callBacks, CFXMLParserContext *context) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + + + +extern +CFXMLParserRef CFXMLParserCreateWithDataFromURL(CFAllocatorRef allocator, CFURLRef dataSource, CFOptionFlags parseOptions, CFIndex versionOfNodes, CFXMLParserCallBacks *callBacks, CFXMLParserContext *context) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + +extern +void CFXMLParserGetContext(CFXMLParserRef parser, CFXMLParserContext *context) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + +extern +void CFXMLParserGetCallBacks(CFXMLParserRef parser, CFXMLParserCallBacks *callBacks) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + +extern +CFURLRef CFXMLParserGetSourceURL(CFXMLParserRef parser) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + + +extern +CFIndex CFXMLParserGetLocation(CFXMLParserRef parser) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + + +extern +CFIndex CFXMLParserGetLineNumber(CFXMLParserRef parser) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + + +extern +void *CFXMLParserGetDocument(CFXMLParserRef parser) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + + + + +extern +CFXMLParserStatusCode CFXMLParserGetStatusCode(CFXMLParserRef parser) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + +extern +CFStringRef CFXMLParserCopyErrorDescription(CFXMLParserRef parser) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + + + + +extern +void CFXMLParserAbort(CFXMLParserRef parser, CFXMLParserStatusCode errorCode, CFStringRef errorDescription) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + + + + + + +extern +Boolean CFXMLParserParse(CFXMLParserRef parser) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + + + + + + + +extern +CFXMLTreeRef CFXMLTreeCreateFromData(CFAllocatorRef allocator, CFDataRef xmlData, CFURLRef dataSource, CFOptionFlags parseOptions, CFIndex versionOfNodes) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + + + + +extern +CFXMLTreeRef CFXMLTreeCreateFromDataWithError(CFAllocatorRef allocator, CFDataRef xmlData, CFURLRef dataSource, CFOptionFlags parseOptions, CFIndex versionOfNodes, CFDictionaryRef *errorDict) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + + +extern +CFXMLTreeRef CFXMLTreeCreateWithDataFromURL(CFAllocatorRef allocator, CFURLRef dataSource, CFOptionFlags parseOptions, CFIndex versionOfNodes) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + + + + + + +extern +CFDataRef CFXMLTreeCreateXMLData(CFAllocatorRef allocator, CFXMLTreeRef xmlTree) __attribute__((availability(macosx,introduced=10_0,deprecated=10_8,message="" ))); + + + + + + + +extern +CFStringRef CFXMLCreateStringByEscapingEntities(CFAllocatorRef allocator, CFStringRef string, CFDictionaryRef entitiesDictionary); + +extern +CFStringRef CFXMLCreateStringByUnescapingEntities(CFAllocatorRef allocator, CFStringRef string, CFDictionaryRef entitiesDictionary); + + +extern const CFStringRef kCFXMLTreeErrorDescription; + + +extern const CFStringRef kCFXMLTreeErrorLineNumber; + + +extern const CFStringRef kCFXMLTreeErrorLocation; + + +extern const CFStringRef kCFXMLTreeErrorStatusCode; + + + + + +enum { + kClippingCreator = 'drag', + kClippingPictureType = 'clpp', + kClippingTextType = 'clpt', + kClippingSoundType = 'clps', + kClippingUnknownType = 'clpu' +}; + + + +enum { + kInternetLocationCreator = 'drag', + kInternetLocationHTTP = 'ilht', + kInternetLocationFTP = 'ilft', + kInternetLocationFile = 'ilfi', + kInternetLocationMail = 'ilma', + kInternetLocationNNTP = 'ilnw', + kInternetLocationAFP = 'ilaf', + kInternetLocationAppleTalk = 'ilat', + kInternetLocationNSL = 'ilns', + kInternetLocationGeneric = 'ilge' +}; + + + +enum { + kCustomIconResource = -16455 +}; + + + + + + +enum { + kCustomBadgeResourceType = 'badg', + kCustomBadgeResourceID = kCustomIconResource, + kCustomBadgeResourceVersion = 0 +}; + +struct CustomBadgeResource { + SInt16 version; + SInt16 customBadgeResourceID; + + OSType customBadgeType; + OSType customBadgeCreator; + OSType windowBadgeType; + OSType windowBadgeCreator; + + OSType overrideType; + OSType overrideCreator; +}; +typedef struct CustomBadgeResource CustomBadgeResource; +typedef CustomBadgeResource * CustomBadgeResourcePtr; +typedef CustomBadgeResourcePtr * CustomBadgeResourceHandle; +enum { + kRoutingResourceType = 'rout', + kRoutingResourceID = 0 +}; + +struct RoutingResourceEntry { + OSType creator; + OSType fileType; + OSType targetFolder; + OSType destinationFolder; + OSType reservedField; +}; +typedef struct RoutingResourceEntry RoutingResourceEntry; +typedef RoutingResourceEntry * RoutingResourcePtr; +typedef RoutingResourcePtr * RoutingResourceHandle; + + +enum { + kContainerFolderAliasType = 'fdrp', + kContainerTrashAliasType = 'trsh', + kContainerHardDiskAliasType = 'hdsk', + kContainerFloppyAliasType = 'flpy', + kContainerServerAliasType = 'srvr', + kApplicationAliasType = 'adrp', + kContainerAliasType = 'drop', + kDesktopPrinterAliasType = 'dtpa', + kContainerCDROMAliasType = 'cddr', + kApplicationCPAliasType = 'acdp', + kApplicationDAAliasType = 'addp', + kPackageAliasType = 'fpka', + kAppPackageAliasType = 'fapa' +}; + + +enum { + kSystemFolderAliasType = 'fasy', + kAppleMenuFolderAliasType = 'faam', + kStartupFolderAliasType = 'fast', + kPrintMonitorDocsFolderAliasType = 'fapn', + kPreferencesFolderAliasType = 'fapf', + kControlPanelFolderAliasType = 'fact', + kExtensionFolderAliasType = 'faex' +}; + + +enum { + kExportedFolderAliasType = 'faet', + kDropFolderAliasType = 'fadr', + kSharedFolderAliasType = 'fash', + kMountedFolderAliasType = 'famn' +}; + + + + + +enum { + kIsOnDesk = 0x0001, + kColor = 0x000E, + + kIsShared = 0x0040, + + + + kHasNoINITs = 0x0080, + + kHasBeenInited = 0x0100, + + + + + + kHasCustomIcon = 0x0400, + kIsStationery = 0x0800, + kNameLocked = 0x1000, + kHasBundle = 0x2000, + + + kIsInvisible = 0x4000, + kIsAlias = 0x8000 +}; + + +enum { + fOnDesk = kIsOnDesk, + fHasBundle = kHasBundle, + fInvisible = kIsInvisible +}; + + +enum { + fTrash = -3, + fDesktop = -2, + fDisk = 0 +}; +enum { + kExtendedFlagsAreInvalid = 0x8000, + kExtendedFlagHasCustomBadge = 0x0100, + kExtendedFlagObjectIsBusy = 0x0080, + kExtendedFlagHasRoutingInfo = 0x0004 +}; +enum { + kFirstMagicBusyFiletype = 'bzy ', + kLastMagicBusyFiletype = 'bzy?' +}; + + + + + + +enum { + kMagicBusyCreationDate = 0x4F3AFDB0 +}; +struct FileInfo { + OSType fileType; + OSType fileCreator; + UInt16 finderFlags; + Point location; + + UInt16 reservedField; +}; +typedef struct FileInfo FileInfo; +struct FolderInfo { + Rect windowBounds; + UInt16 finderFlags; + Point location; + + UInt16 reservedField; +}; +typedef struct FolderInfo FolderInfo; +struct ExtendedFileInfo { + SInt16 reserved1[4]; + UInt16 extendedFinderFlags; + SInt16 reserved2; + SInt32 putAwayFolderID; +}; +typedef struct ExtendedFileInfo ExtendedFileInfo; +struct ExtendedFolderInfo { + Point scrollPosition; + SInt32 reserved1; + UInt16 extendedFinderFlags; + SInt16 reserved2; + SInt32 putAwayFolderID; +}; +typedef struct ExtendedFolderInfo ExtendedFolderInfo; +struct FInfo { + OSType fdType; + OSType fdCreator; + UInt16 fdFlags; + Point fdLocation; + + SInt16 fdFldr; +}; +typedef struct FInfo FInfo; + + + + + + + +struct FXInfo { + SInt16 fdIconID; + SInt16 fdReserved[3]; + SInt8 fdScript; + SInt8 fdXFlags; + SInt16 fdComment; + SInt32 fdPutAway; +}; +typedef struct FXInfo FXInfo; + + + + + + +struct DInfo { + Rect frRect; + UInt16 frFlags; + Point frLocation; + + SInt16 frView; +}; +typedef struct DInfo DInfo; + + + + + + + +struct DXInfo { + Point frScroll; + SInt32 frOpenChain; + SInt8 frScript; + SInt8 frXFlags; + SInt16 frComment; + SInt32 frPutAway; +}; +typedef struct DXInfo DXInfo; + + + + + +extern Fixed +FixRatio( + short numer, + short denom) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Fixed +FixMul( + Fixed a, + Fixed b) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern short +FixRound(Fixed x) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Fract +Fix2Frac(Fixed x) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt32 +Fix2Long(Fixed x) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Fixed +Long2Fix(SInt32 x) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Fixed +Frac2Fix(Fract x) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Fract +FracMul( + Fract x, + Fract y) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Fixed +FixDiv( + Fixed x, + Fixed y) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Fract +FracDiv( + Fract x, + Fract y) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Fract +FracSqrt(Fract x) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Fract +FracSin(Fixed x) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Fract +FracCos(Fixed x) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Fixed +FixATan2( + SInt32 x, + SInt32 y) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern double +Frac2X(Fract x) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern double +Fix2X(Fixed x) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Fixed +X2Fix(double x) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Fract +X2Frac(double x) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern short +WideCompare( + const wide * target, + const wide * source) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern wide * +WideAdd( + wide * target, + const wide * source) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern wide * +WideSubtract( + wide * target, + const wide * source) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern wide * +WideNegate(wide * target) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern wide * +WideShift( + wide * target, + SInt32 shift) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern UInt32 +WideSquareRoot(const wide * source) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern wide * +WideMultiply( + SInt32 multiplicand, + SInt32 multiplier, + wide * target) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt32 +WideDivide( + const wide * dividend, + SInt32 divisor, + SInt32 * remainder) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern wide * +WideWideDivide( + wide * dividend, + SInt32 divisor, + SInt32 * remainder) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern wide * +WideBitShift( + wide * target, + SInt32 shift) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern UnsignedFixed +UnsignedFixedMulDiv( + UnsignedFixed value, + UnsignedFixed multiplier, + UnsignedFixed divisor) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); + + + + +enum { + + itlcShowIcon = 7, + itlcDualCaret = 6, + + itlcSysDirection = 15 +}; + +enum { + + itlcDisableKeyScriptSync = 3 +}; + +enum { + + itlcDisableKeyScriptSyncMask = 1 << itlcDisableKeyScriptSync +}; + + +enum { + tokLeftQuote = 1, + tokRightQuote = 2, + tokLeadPlacer = 3, + tokLeader = 4, + tokNonLeader = 5, + tokZeroLead = 6, + tokPercent = 7, + tokPlusSign = 8, + tokMinusSign = 9, + tokThousands = 10, + tokReserved = 11, + tokSeparator = 12, + tokEscape = 13, + tokDecPoint = 14, + tokEPlus = 15, + tokEMinus = 16, + tokMaxSymbols = 31, + curNumberPartsVersion = 1 +}; + +enum { + currSymLead = 16, + currNegSym = 32, + currTrailingZ = 64, + currLeadingZ = 128 +}; + +enum { + mdy = 0, + dmy = 1, + ymd = 2, + myd = 3, + dym = 4, + ydm = 5 +}; + +typedef SInt8 DateOrders; +enum { + timeCycle24 = 0, + timeCycleZero = 1, + timeCycle12 = 255, + zeroCycle = 1, + longDay = 0, + longWeek = 1, + longMonth = 2, + longYear = 3, + supDay = 1, + supWeek = 2, + supMonth = 4, + supYear = 8, + dayLdingZ = 32, + mntLdingZ = 64, + century = 128, + secLeadingZ = 32, + minLeadingZ = 64, + hrLeadingZ = 128 +}; + + +struct OffPair { + short offFirst; + short offSecond; +}; +typedef struct OffPair OffPair; +typedef OffPair OffsetTable[3]; +struct Intl0Rec { + char decimalPt; + char thousSep; + char listSep; + char currSym1; + char currSym2; + char currSym3; + UInt8 currFmt; + UInt8 dateOrder; + UInt8 shrtDateFmt; + char dateSep; + UInt8 timeCycle; + UInt8 timeFmt; + char mornStr[4]; + char eveStr[4]; + char timeSep; + char time1Suff; + char time2Suff; + char time3Suff; + char time4Suff; + char time5Suff; + char time6Suff; + char time7Suff; + char time8Suff; + UInt8 metricSys; + short intl0Vers; +}; +typedef struct Intl0Rec Intl0Rec; +typedef Intl0Rec * Intl0Ptr; +typedef Intl0Ptr * Intl0Hndl; +struct Intl1Rec { + Str15 days[7]; + Str15 months[12]; + UInt8 suppressDay; + UInt8 lngDateFmt; + UInt8 dayLeading0; + UInt8 abbrLen; + char st0[4]; + char st1[4]; + char st2[4]; + char st3[4]; + char st4[4]; + short intl1Vers; + short localRtn[1]; +}; +typedef struct Intl1Rec Intl1Rec; +typedef Intl1Rec * Intl1Ptr; +typedef Intl1Ptr * Intl1Hndl; + +struct Itl1ExtRec { + Intl1Rec base; + short version; + short format; + short calendarCode; + SInt32 extraDaysTableOffset; + SInt32 extraDaysTableLength; + SInt32 extraMonthsTableOffset; + SInt32 extraMonthsTableLength; + SInt32 abbrevDaysTableOffset; + SInt32 abbrevDaysTableLength; + SInt32 abbrevMonthsTableOffset; + SInt32 abbrevMonthsTableLength; + SInt32 extraSepsTableOffset; + SInt32 extraSepsTableLength; + short tables[1]; +}; +typedef struct Itl1ExtRec Itl1ExtRec; +struct UntokenTable { + short len; + short lastToken; + short index[256]; +}; +typedef struct UntokenTable UntokenTable; +typedef UntokenTable * UntokenTablePtr; +typedef UntokenTablePtr * UntokenTableHandle; +union WideChar { + struct { + char lo; + char hi; + } a; + short b; +}; +typedef union WideChar WideChar; +struct WideCharArr { + short size; + WideChar data[10]; +}; +typedef struct WideCharArr WideCharArr; +struct NumberParts { + short version; + WideChar data[31]; + WideCharArr pePlus; + WideCharArr peMinus; + WideCharArr peMinusPlus; + WideCharArr altNumTable; + char reserved[20]; +}; +typedef struct NumberParts NumberParts; +typedef NumberParts * NumberPartsPtr; + +struct Itl4Rec { + short flags; + SInt32 resourceType; + short resourceNum; + short version; + SInt32 resHeader1; + SInt32 resHeader2; + short numTables; + SInt32 mapOffset; + SInt32 strOffset; + SInt32 fetchOffset; + SInt32 unTokenOffset; + SInt32 defPartsOffset; + SInt32 resOffset6; + SInt32 resOffset7; + SInt32 resOffset8; +}; +typedef struct Itl4Rec Itl4Rec; +typedef Itl4Rec * Itl4Ptr; +typedef Itl4Ptr * Itl4Handle; + +struct NItl4Rec { + short flags; + SInt32 resourceType; + short resourceNum; + short version; + short format; + short resHeader; + SInt32 resHeader2; + short numTables; + SInt32 mapOffset; + SInt32 strOffset; + SInt32 fetchOffset; + SInt32 unTokenOffset; + SInt32 defPartsOffset; + SInt32 whtSpListOffset; + SInt32 resOffset7; + SInt32 resOffset8; + short resLength1; + short resLength2; + short resLength3; + short unTokenLength; + short defPartsLength; + short whtSpListLength; + short resLength7; + short resLength8; +}; +typedef struct NItl4Rec NItl4Rec; +typedef NItl4Rec * NItl4Ptr; +typedef NItl4Ptr * NItl4Handle; + +struct TableDirectoryRecord { + OSType tableSignature; + UInt32 reserved; + UInt32 tableStartOffset; + UInt32 tableSize; +}; +typedef struct TableDirectoryRecord TableDirectoryRecord; +struct Itl5Record { + Fixed versionNumber; + unsigned short numberOfTables; + unsigned short reserved[3]; + TableDirectoryRecord tableDirectory[1]; +}; +typedef struct Itl5Record Itl5Record; +struct RuleBasedTrslRecord { + short sourceType; + short targetType; + short formatNumber; + short propertyFlag; + short numberOfRules; +}; +typedef struct RuleBasedTrslRecord RuleBasedTrslRecord; + +struct ItlcRecord { + short itlcSystem; + short itlcReserved; + SInt8 itlcFontForce; + SInt8 itlcIntlForce; + SInt8 itlcOldKybd; + SInt8 itlcFlags; + short itlcIconOffset; + SInt8 itlcIconSide; + SInt8 itlcIconRsvd; + short itlcRegionCode; + short itlcSysFlags; + SInt8 itlcReserved4[32]; +}; +typedef struct ItlcRecord ItlcRecord; +struct ItlbRecord { + short itlbNumber; + short itlbDate; + short itlbSort; + short itlbFlags; + short itlbToken; + short itlbEncoding; + short itlbLang; + SInt8 itlbNumRep; + SInt8 itlbDateRep; + short itlbKeys; + short itlbIcon; +}; +typedef struct ItlbRecord ItlbRecord; + +struct ItlbExtRecord { + ItlbRecord base; + SInt32 itlbLocalSize; + short itlbMonoFond; + short itlbMonoSize; + short itlbPrefFond; + short itlbPrefSize; + short itlbSmallFond; + short itlbSmallSize; + short itlbSysFond; + short itlbSysSize; + short itlbAppFond; + short itlbAppSize; + short itlbHelpFond; + short itlbHelpSize; + Style itlbValidStyles; + Style itlbAliasStyle; +}; +typedef struct ItlbExtRecord ItlbExtRecord; + + + + + +enum { + smSystemScript = -1, + smCurrentScript = -2, + smAllScripts = -3 +}; +enum { + smRoman = 0, + smJapanese = 1, + smTradChinese = 2, + smKorean = 3, + smArabic = 4, + smHebrew = 5, + smGreek = 6, + smCyrillic = 7, + smRSymbol = 8, + smDevanagari = 9, + smGurmukhi = 10, + smGujarati = 11, + smOriya = 12, + smBengali = 13, + smTamil = 14, + smTelugu = 15, + smKannada = 16, + smMalayalam = 17, + smSinhalese = 18, + smBurmese = 19, + smKhmer = 20, + smThai = 21, + smLao = 22, + smGeorgian = 23, + smArmenian = 24, + smSimpChinese = 25, + smTibetan = 26, + smMongolian = 27, + smEthiopic = 28, + smGeez = 28, + smCentralEuroRoman = 29, + smVietnamese = 30, + smExtArabic = 31, + smUninterp = 32 +}; + + +enum { + smUnicodeScript = 0x7E +}; + + +enum { + smChinese = 2, + smRussian = 7, + + smLaotian = 22, + smAmharic = 28, + smSlavic = 29, + smEastEurRoman = 29, + smSindhi = 31, + smKlingon = 32 +}; + + + + + + +enum { + langEnglish = 0, + langFrench = 1, + langGerman = 2, + langItalian = 3, + langDutch = 4, + langSwedish = 5, + langSpanish = 6, + langDanish = 7, + langPortuguese = 8, + langNorwegian = 9, + langHebrew = 10, + langJapanese = 11, + langArabic = 12, + langFinnish = 13, + langGreek = 14, + langIcelandic = 15, + langMaltese = 16, + langTurkish = 17, + langCroatian = 18, + langTradChinese = 19, + langUrdu = 20, + langHindi = 21, + langThai = 22, + langKorean = 23 +}; + +enum { + langLithuanian = 24, + langPolish = 25, + langHungarian = 26, + langEstonian = 27, + langLatvian = 28, + langSami = 29, + langFaroese = 30, + langFarsi = 31, + langPersian = 31, + langRussian = 32, + langSimpChinese = 33, + langFlemish = 34, + langIrishGaelic = 35, + langAlbanian = 36, + langRomanian = 37, + langCzech = 38, + langSlovak = 39, + langSlovenian = 40, + langYiddish = 41, + langSerbian = 42, + langMacedonian = 43, + langBulgarian = 44, + langUkrainian = 45, + langByelorussian = 46, + langBelorussian = 46 +}; + +enum { + langUzbek = 47, + langKazakh = 48, + langAzerbaijani = 49, + langAzerbaijanAr = 50, + langArmenian = 51, + langGeorgian = 52, + langMoldavian = 53, + langKirghiz = 54, + langTajiki = 55, + langTurkmen = 56, + langMongolian = 57, + langMongolianCyr = 58, + langPashto = 59, + langKurdish = 60, + langKashmiri = 61, + langSindhi = 62, + langTibetan = 63, + langNepali = 64, + langSanskrit = 65, + langMarathi = 66, + langBengali = 67, + langAssamese = 68, + langGujarati = 69, + langPunjabi = 70 +}; + +enum { + langOriya = 71, + langMalayalam = 72, + langKannada = 73, + langTamil = 74, + langTelugu = 75, + langSinhalese = 76, + langBurmese = 77, + langKhmer = 78, + langLao = 79, + langVietnamese = 80, + langIndonesian = 81, + langTagalog = 82, + langMalayRoman = 83, + langMalayArabic = 84, + langAmharic = 85, + langTigrinya = 86, + langOromo = 87, + langSomali = 88, + langSwahili = 89, + langKinyarwanda = 90, + langRuanda = 90, + langRundi = 91, + langNyanja = 92, + langChewa = 92, + langMalagasy = 93, + langEsperanto = 94 +}; + +enum { + langWelsh = 128, + langBasque = 129, + langCatalan = 130, + langLatin = 131, + langQuechua = 132, + langGuarani = 133, + langAymara = 134, + langTatar = 135, + langUighur = 136, + langDzongkha = 137, + langJavaneseRom = 138, + langSundaneseRom = 139, + langGalician = 140, + langAfrikaans = 141 +}; + +enum { + langBreton = 142, + langInuktitut = 143, + langScottishGaelic = 144, + langManxGaelic = 145, + langIrishGaelicScript = 146, + langTongan = 147, + langGreekAncient = 148, + langGreenlandic = 149, + langAzerbaijanRoman = 150, + langNynorsk = 151 +}; + +enum { + langUnspecified = 32767 +}; + + + + + +enum { + langPortugese = 8, + langMalta = 16, + langYugoslavian = 18, + langChinese = 19, + langLettish = 28, + langLapponian = 29, + langLappish = 29, + langSaamisk = 29, + langFaeroese = 30, + langIrish = 35, + langGalla = 87, + langAfricaans = 141, + langGreekPoly = 148 +}; +enum { + + verUS = 0, + verFrance = 1, + verBritain = 2, + verGermany = 3, + verItaly = 4, + verNetherlands = 5, + verFlemish = 6, + verSweden = 7, + verSpain = 8, + verDenmark = 9, + verPortugal = 10, + verFrCanada = 11, + verNorway = 12, + verIsrael = 13, + verJapan = 14, + verAustralia = 15, + verArabic = 16, + verFinland = 17, + verFrSwiss = 18, + verGrSwiss = 19, + verGreece = 20, + verIceland = 21, + verMalta = 22, + verCyprus = 23, + verTurkey = 24, + verYugoCroatian = 25 +}; + +enum { + verNetherlandsComma = 26, + verFlemishPoint = 27, + verCanadaComma = 28, + verCanadaPoint = 29, + vervariantPortugal = 30, + vervariantNorway = 31, + vervariantDenmark = 32 +}; + +enum { + verIndiaHindi = 33, + verPakistanUrdu = 34, + verTurkishModified = 35, + verItalianSwiss = 36, + verInternational = 37, + + verRomania = 39, + verGreekAncient = 40, + verLithuania = 41, + verPoland = 42, + verHungary = 43, + verEstonia = 44, + verLatvia = 45, + verSami = 46, + verFaroeIsl = 47, + verIran = 48, + verRussia = 49, + verIreland = 50, + verKorea = 51, + verChina = 52, + verTaiwan = 53, + verThailand = 54, + verScriptGeneric = 55, + verCzech = 56, + verSlovak = 57, + verEastAsiaGeneric = 58, + verMagyar = 59, + verBengali = 60, + verBelarus = 61 +}; + +enum { + verUkraine = 62, + + verGreeceAlt = 64, + verSerbian = 65, + verSlovenian = 66, + verMacedonian = 67, + verCroatia = 68, + + verGermanReformed = 70, + verBrazil = 71, + verBulgaria = 72, + verCatalonia = 73, + verMultilingual = 74, + verScottishGaelic = 75, + verManxGaelic = 76, + verBreton = 77, + verNunavut = 78, + verWelsh = 79, + + verIrishGaelicScript = 81, + verEngCanada = 82, + verBhutan = 83, + verArmenian = 84, + verGeorgian = 85, + verSpLatinAmerica = 86, + + verTonga = 88, + + + verFrenchUniversal = 91, + verAustria = 92, + + verGujarati = 94, + verPunjabi = 95, + verIndiaUrdu = 96, + verVietnam = 97 +}; + +enum { + verFrBelgium = 98, + verUzbek = 99, + verSingapore = 100, + verNynorsk = 101, + verAfrikaans = 102, + verEsperanto = 103, + verMarathi = 104, + verTibetan = 105, + verNepal = 106, + verGreenland = 107, + verIrelandEnglish = 108 +}; +enum { + verFrBelgiumLux = 6, + verBelgiumLux = 6, + verArabia = 16, + verYugoslavia = 25, + verBelgiumLuxPoint = 27, + verIndia = 33, + verPakistan = 34, + verRumania = 39, + verGreecePoly = 40, + verLapland = 46, + verFaeroeIsl = 47, + verGenericFE = 58, + verFarEastGeneric = 58, + verByeloRussian = 61, + verUkrania = 62, + verAlternateGr = 64, + verSerbia = 65, + verSlovenia = 66, + verMacedonia = 67, + verBrittany = 77, + verWales = 79, + verArmenia = 84, + verGeorgia = 85, + verAustriaGerman = 92, + verTibet = 105 +}; + +enum { + minCountry = verUS, + maxCountry = verIrelandEnglish +}; + +enum { + + calGregorian = 0, + calArabicCivil = 1, + calArabicLunar = 2, + calJapanese = 3, + calJewish = 4, + calCoptic = 5, + calPersian = 6 +}; + +enum { + + intWestern = 0, + intArabic = 1, + intRoman = 2, + intJapanese = 3, + intEuropean = 4, + intOutputMask = 0x8000 +}; + +enum { + + smSingleByte = 0, + smFirstByte = -1, + smLastByte = 1, + smMiddleByte = 2 +}; + +enum { + + smcTypeMask = 0x000F, + smcReserved = 0x00F0, + smcClassMask = 0x0F00, + smcOrientationMask = 0x1000, + smcRightMask = 0x2000, + smcUpperMask = 0x4000, + smcDoubleMask = 0x8000 +}; + +enum { + + smCharPunct = 0x0000, + smCharAscii = 0x0001, + smCharEuro = 0x0007, + smCharExtAscii = 0x0007, + + smCharKatakana = 0x0002, + smCharHiragana = 0x0003, + smCharIdeographic = 0x0004, + smCharTwoByteGreek = 0x0005, + smCharTwoByteRussian = 0x0006, + smCharBidirect = 0x0008, + smCharContextualLR = 0x0009, + smCharNonContextualLR = 0x000A, + smCharHangul = 0x000C, + smCharJamo = 0x000D, + smCharBopomofo = 0x000E, + smCharGanaKana = 0x000F, + + smCharFISKana = 0x0002, + smCharFISGana = 0x0003, + smCharFISIdeo = 0x0004 +}; + +enum { + smCharFISGreek = 0x0005, + smCharFISRussian = 0x0006, + + smPunctNormal = 0x0000, + smPunctNumber = 0x0100, + smPunctSymbol = 0x0200, + smPunctBlank = 0x0300, + smPunctRepeat = 0x0400, + smPunctGraphic = 0x0500, + + smKanaSmall = 0x0100, + smKanaHardOK = 0x0200, + smKanaSoftOK = 0x0300, + + smIdeographicLevel1 = 0x0000, + smIdeographicLevel2 = 0x0100, + smIdeographicUser = 0x0200, + + smFISClassLvl1 = 0x0000, + smFISClassLvl2 = 0x0100, + smFISClassUser = 0x0200, + + smJamoJaeum = 0x0000, + smJamoBogJaeum = 0x0100, + smJamoMoeum = 0x0200, + smJamoBogMoeum = 0x0300 +}; + +enum { + + smCharHorizontal = 0x0000, + smCharVertical = 0x1000, + + smCharLeft = 0x0000, + smCharRight = 0x2000, + smCharLower = 0x0000, + smCharUpper = 0x4000, + smChar1byte = 0x0000, + smChar2byte = 0x8000 +}; + +enum { + + smTransAscii = 0, + smTransNative = 1, + smTransCase = 0xFE, + smTransSystem = 0xFF, + + smTransAscii1 = 2, + smTransAscii2 = 3, + smTransKana1 = 4, + smTransKana2 = 5 +}; + +enum { + smTransGana2 = 7, + smTransHangul2 = 8, + smTransJamo2 = 9, + smTransBopomofo2 = 10, + + smTransLower = 0x4000, + smTransUpper = 0x8000, + + smTransRuleBaseFormat = 1, + smTransHangulFormat = 2, + + smTransPreDoubleByting = 1, + smTransPreLowerCasing = 2 +}; + +enum { + + smMaskAll = (int)0xFFFFFFFF, + + smMaskAscii = 0x00000001, + smMaskNative = 0x00000002, + + smMaskAscii1 = 0x00000004, + smMaskAscii2 = 0x00000008, + smMaskKana1 = 0x00000010, + smMaskKana2 = 0x00000020, + smMaskGana2 = 0x00000080, + smMaskHangul2 = 0x00000100, + smMaskJamo2 = 0x00000200, + smMaskBopomofo2 = 0x00000400 +}; + +enum { + + iuSystemScript = -1, + iuCurrentScript = -2 +}; + +enum { + + smKeyNextScript = -1, + smKeySysScript = -2, + smKeySwapScript = -3, + + smKeyNextKybd = -4, + smKeySwapKybd = -5, + smKeyDisableKybds = -6, + smKeyEnableKybds = -7, + smKeyToggleInline = -8, + smKeyToggleDirection = -9, + smKeyNextInputMethod = -10, + smKeySwapInputMethod = -11, + smKeyDisableKybdSwitch = -12, + smKeySetDirLeftRight = -15, + smKeySetDirRightLeft = -16, + smKeyRoman = -17 +}; + +enum { + + smKeyForceKeyScriptBit = 7, + smKeyForceKeyScriptMask = 1 << smKeyForceKeyScriptBit +}; + +enum { + + + + romanSysFond = 0x3FFF, + romanAppFond = 3, + romanFlags = 0x0007, + + smFondStart = 0x4000, + smFondEnd = 0xC000, + + smUprHalfCharSet = 0x80 +}; + +enum { + + diaeresisUprY = 0xD9, + fraction = 0xDA, + intlCurrency = 0xDB, + leftSingGuillemet = 0xDC, + rightSingGuillemet = 0xDD, + fiLigature = 0xDE, + flLigature = 0xDF, + dblDagger = 0xE0, + centeredDot = 0xE1, + baseSingQuote = 0xE2, + baseDblQuote = 0xE3, + perThousand = 0xE4, + circumflexUprA = 0xE5, + circumflexUprE = 0xE6, + acuteUprA = 0xE7, + diaeresisUprE = 0xE8, + graveUprE = 0xE9, + acuteUprI = 0xEA, + circumflexUprI = 0xEB, + diaeresisUprI = 0xEC, + graveUprI = 0xED, + acuteUprO = 0xEE, + circumflexUprO = 0xEF, + appleLogo = 0xF0, + graveUprO = 0xF1, + acuteUprU = 0xF2, + circumflexUprU = 0xF3, + graveUprU = 0xF4, + dotlessLwrI = 0xF5, + circumflex = 0xF6, + tilde = 0xF7, + macron = 0xF8, + breveMark = 0xF9, + overDot = 0xFA, + ringMark = 0xFB, + cedilla = 0xFC, + doubleAcute = 0xFD, + ogonek = 0xFE, + hachek = 0xFF +}; + +enum { + + tokenIntl = 4, + tokenEmpty = -1 +}; + +enum { + tokenUnknown = 0, + tokenWhite = 1, + tokenLeftLit = 2, + tokenRightLit = 3, + tokenAlpha = 4, + tokenNumeric = 5, + tokenNewLine = 6, + tokenLeftComment = 7, + tokenRightComment = 8, + tokenLiteral = 9, + tokenEscape = 10, + tokenAltNum = 11, + tokenRealNum = 12, + tokenAltReal = 13, + tokenReserve1 = 14, + tokenReserve2 = 15, + tokenLeftParen = 16, + tokenRightParen = 17, + tokenLeftBracket = 18, + tokenRightBracket = 19 +}; + +enum { + tokenLeftCurly = 20, + tokenRightCurly = 21, + tokenLeftEnclose = 22, + tokenRightEnclose = 23, + tokenPlus = 24, + tokenMinus = 25, + tokenAsterisk = 26, + tokenDivide = 27, + tokenPlusMinus = 28, + tokenSlash = 29, + tokenBackSlash = 30, + tokenLess = 31, + tokenGreat = 32, + tokenEqual = 33, + tokenLessEqual2 = 34, + tokenLessEqual1 = 35, + tokenGreatEqual2 = 36, + tokenGreatEqual1 = 37, + token2Equal = 38, + tokenColonEqual = 39 +}; + +enum { + tokenNotEqual = 40, + tokenLessGreat = 41, + tokenExclamEqual = 42, + tokenExclam = 43, + tokenTilde = 44, + tokenComma = 45, + tokenPeriod = 46, + tokenLeft2Quote = 47, + tokenRight2Quote = 48, + tokenLeft1Quote = 49, + tokenRight1Quote = 50, + token2Quote = 51, + token1Quote = 52, + tokenSemicolon = 53, + tokenPercent = 54, + tokenCaret = 55, + tokenUnderline = 56, + tokenAmpersand = 57, + tokenAtSign = 58, + tokenBar = 59 +}; + +enum { + tokenQuestion = 60, + tokenPi = 61, + tokenRoot = 62, + tokenSigma = 63, + tokenIntegral = 64, + tokenMicro = 65, + tokenCapPi = 66, + tokenInfinity = 67, + tokenColon = 68, + tokenHash = 69, + tokenDollar = 70, + tokenNoBreakSpace = 71, + tokenFraction = 72, + tokenIntlCurrency = 73, + tokenLeftSingGuillemet = 74, + tokenRightSingGuillemet = 75, + tokenPerThousand = 76, + tokenEllipsis = 77, + tokenCenterDot = 78, + tokenNil = 127 +}; + +enum { + delimPad = -2, + tokenTilda = 44, + tokenCarat = 55 +}; + +enum { + + smWordSelectTable = 0, + smWordWrapTable = 1, + smNumberPartsTable = 2, + smUnTokenTable = 3, + smWhiteSpaceList = 4, + iuWordSelectTable = 0, + iuWordWrapTable = 1, + iuNumberPartsTable = 2, + iuUnTokenTable = 3, + iuWhiteSpaceList = 4 +}; + + +enum { + tokenOK = 0, + tokenOverflow = 1, + stringOverflow = 2, + badDelim = 3, + badEnding = 4, + crash = 5 +}; + +typedef SInt8 TokenResults; +typedef char CharByteTable[256]; + +typedef short ScriptTokenType; +typedef ScriptTokenType DelimType[2]; +typedef ScriptTokenType CommentType[4]; +struct TokenRec { + ScriptTokenType theToken; + Ptr position; + long length; + StringPtr stringPosition; +}; +typedef struct TokenRec TokenRec; +typedef TokenRec * TokenRecPtr; +struct TokenBlock { + Ptr source; + long sourceLength; + Ptr tokenList; + long tokenLength; + long tokenCount; + Ptr stringList; + long stringLength; + long stringCount; + Boolean doString; + Boolean doAppend; + Boolean doAlphanumeric; + Boolean doNest; + ScriptTokenType leftDelims[2]; + ScriptTokenType rightDelims[2]; + ScriptTokenType leftComment[4]; + ScriptTokenType rightComment[4]; + ScriptTokenType escapeCode; + ScriptTokenType decimalCode; + Handle itlResource; + long reserved[8]; +}; +typedef struct TokenBlock TokenBlock; +typedef TokenBlock * TokenBlockPtr; + + +enum { + smNotInstalled = 0, + smBadVerb = -1, + smBadScript = -2 +}; + + + +enum { + smfShowIcon = 31, + smfDualCaret = 30, + smfNameTagEnab = 29, + smfUseAssocFontInfo = 28, + smfDisableKeyScriptSync = 27 +}; + + +enum { + smfDisableKeyScriptSyncMask = 1L << smfDisableKeyScriptSync +}; + + +enum { + smSysScript = 18, + smKeyScript = 22, + smKCHRCache = 38, + smRegionCode = 40 +}; +extern long +GetScriptManagerVariable(short selector) __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); +extern OSErr +SetScriptManagerVariable( + short selector, + long param) __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); +enum { + smsfIntellCP = 0, + smsfSingByte = 1, + smsfNatCase = 2, + smsfContext = 3, + smsfNoForceFont = 4, + smsfB0Digits = 5, + smsfAutoInit = 6, + smsfUnivExt = 7, + smsfSynchUnstyledTE = 8, + smsfForms = 13, + smsfLigatures = 14, + smsfReverse = 15 +}; + + + +enum { + paramErr = -50, + noHardwareErr = -200, + notEnoughHardwareErr = -201, + userCanceledErr = -128, + qErr = -1, + vTypErr = -2, + corErr = -3, + unimpErr = -4, + SlpTypeErr = -5, + seNoDB = -8, + controlErr = -17, + statusErr = -18, + readErr = -19, + writErr = -20, + badUnitErr = -21, + unitEmptyErr = -22, + openErr = -23, + closErr = -24, + dRemovErr = -25, + dInstErr = -26 +}; + +enum { + abortErr = -27, + iIOAbortErr = -27, + notOpenErr = -28, + unitTblFullErr = -29, + dceExtErr = -30, + slotNumErr = -360, + gcrOnMFMErr = -400, + dirFulErr = -33, + dskFulErr = -34, + nsvErr = -35, + ioErr = -36, + bdNamErr = -37, + fnOpnErr = -38, + eofErr = -39, + posErr = -40, + mFulErr = -41, + tmfoErr = -42, + fnfErr = -43, + wPrErr = -44, + fLckdErr = -45 +}; + +enum { + vLckdErr = -46, + fBsyErr = -47, + dupFNErr = -48, + opWrErr = -49, + rfNumErr = -51, + gfpErr = -52, + volOffLinErr = -53, + permErr = -54, + volOnLinErr = -55, + nsDrvErr = -56, + noMacDskErr = -57, + extFSErr = -58, + fsRnErr = -59, + badMDBErr = -60, + wrPermErr = -61, + dirNFErr = -120, + tmwdoErr = -121, + badMovErr = -122, + wrgVolTypErr = -123, + volGoneErr = -124 +}; + +enum { + fidNotFound = -1300, + fidExists = -1301, + notAFileErr = -1302, + diffVolErr = -1303, + catChangedErr = -1304, + desktopDamagedErr = -1305, + sameFileErr = -1306, + badFidErr = -1307, + notARemountErr = -1308, + fileBoundsErr = -1309, + fsDataTooBigErr = -1310, + volVMBusyErr = -1311, + badFCBErr = -1327, + errFSUnknownCall = -1400, + errFSBadFSRef = -1401, + errFSBadForkName = -1402, + errFSBadBuffer = -1403, + errFSBadForkRef = -1404, + errFSBadInfoBitmap = -1405, + errFSMissingCatInfo = -1406, + errFSNotAFolder = -1407, + errFSForkNotFound = -1409, + errFSNameTooLong = -1410, + errFSMissingName = -1411, + errFSBadPosMode = -1412, + errFSBadAllocFlags = -1413, + errFSNoMoreItems = -1417, + errFSBadItemCount = -1418, + errFSBadSearchParams = -1419, + errFSRefsDifferent = -1420, + errFSForkExists = -1421, + errFSBadIteratorFlags = -1422, + errFSIteratorNotFound = -1423, + errFSIteratorNotSupported = -1424, + errFSQuotaExceeded = -1425, + errFSOperationNotSupported = -1426, + errFSAttributeNotFound = -1427, + errFSPropertyNotValid = -1428, + errFSNotEnoughSpaceForOperation = -1429, + envNotPresent = -5500, + envBadVers = -5501, + envVersTooBig = -5502, + fontDecError = -64, + fontNotDeclared = -65, + fontSubErr = -66, + fontNotOutlineErr = -32615, + firstDskErr = -84, + lastDskErr = -64, + noDriveErr = -64, + offLinErr = -65, + noNybErr = -66 +}; + +enum { + noAdrMkErr = -67, + dataVerErr = -68, + badCksmErr = -69, + badBtSlpErr = -70, + noDtaMkErr = -71, + badDCksum = -72, + badDBtSlp = -73, + wrUnderrun = -74, + cantStepErr = -75, + tk0BadErr = -76, + initIWMErr = -77, + twoSideErr = -78, + spdAdjErr = -79, + seekErr = -80, + sectNFErr = -81, + fmt1Err = -82, + fmt2Err = -83, + verErr = -84, + clkRdErr = -85, + clkWrErr = -86, + prWrErr = -87, + prInitErr = -88, + rcvrErr = -89, + breakRecd = -90 +}; + +enum { + + noScrapErr = -100, + noTypeErr = -102 +}; + +enum { + + eLenErr = -92, + eMultiErr = -91 +}; + +enum { + ddpSktErr = -91, + ddpLenErr = -92, + noBridgeErr = -93, + lapProtErr = -94, + excessCollsns = -95, + portNotPwr = -96, + portInUse = -97, + portNotCf = -98 +}; + +enum { + + memROZWarn = -99, + memROZError = -99, + memROZErr = -99, + memFullErr = -108, + nilHandleErr = -109, + memWZErr = -111, + memPurErr = -112, + memAdrErr = -110, + memAZErr = -113, + memPCErr = -114, + memBCErr = -115, + memSCErr = -116, + memLockedErr = -117 +}; + +enum { + + iMemFullErr = -108, + iIOAbort = -27 +}; + + +enum { + resourceInMemory = -188, + writingPastEnd = -189, + inputOutOfBounds = -190, + resNotFound = -192, + resFNotFound = -193, + addResFailed = -194, + addRefFailed = -195, + rmvResFailed = -196, + rmvRefFailed = -197, + resAttrErr = -198, + mapReadErr = -199, + CantDecompress = -186, + badExtResource = -185, + noMemForPictPlaybackErr = -145, + rgnOverflowErr = -147, + rgnTooBigError = -147, + pixMapTooDeepErr = -148, + insufficientStackErr = -149, + nsStackErr = -149 +}; + +enum { + evtNotEnb = 1 +}; + + +enum { + cMatchErr = -150, + cTempMemErr = -151, + cNoMemErr = -152, + cRangeErr = -153, + cProtectErr = -154, + cDevErr = -155, + cResErr = -156, + cDepthErr = -157, + rgnTooBigErr = -500, + updPixMemErr = -125, + pictInfoVersionErr = -11000, + pictInfoIDErr = -11001, + pictInfoVerbErr = -11002, + cantLoadPickMethodErr = -11003, + colorsRequestedErr = -11004, + pictureDataErr = -11005 +}; + + +enum { + + cmProfileError = -170, + cmMethodError = -171, + cmMethodNotFound = -175, + cmProfileNotFound = -176, + cmProfilesIdentical = -177, + cmCantConcatenateError = -178, + cmCantXYZ = -179, + cmCantDeleteProfile = -180, + cmUnsupportedDataType = -181, + cmNoCurrentProfile = -182 +}; + + +enum { + + noHardware = noHardwareErr, + notEnoughHardware = notEnoughHardwareErr, + queueFull = -203, + resProblem = -204, + badChannel = -205, + badFormat = -206, + notEnoughBufferSpace = -207, + badFileFormat = -208, + channelBusy = -209, + buffersTooSmall = -210, + channelNotBusy = -211, + noMoreRealTime = -212, + siVBRCompressionNotSupported = -213, + siNoSoundInHardware = -220, + siBadSoundInDevice = -221, + siNoBufferSpecified = -222, + siInvalidCompression = -223, + siHardDriveTooSlow = -224, + siInvalidSampleRate = -225, + siInvalidSampleSize = -226, + siDeviceBusyErr = -227, + siBadDeviceName = -228, + siBadRefNum = -229, + siInputDeviceErr = -230, + siUnknownInfoType = -231, + siUnknownQuality = -232 +}; + + +enum { + noSynthFound = -240, + synthOpenFailed = -241, + synthNotReady = -242, + bufTooSmall = -243, + voiceNotFound = -244, + incompatibleVoice = -245, + badDictFormat = -246, + badInputText = -247 +}; + + +enum { + midiNoClientErr = -250, + midiNoPortErr = -251, + midiTooManyPortsErr = -252, + midiTooManyConsErr = -253, + midiVConnectErr = -254, + midiVConnectMade = -255, + midiVConnectRmvd = -256, + midiNoConErr = -257, + midiWriteErr = -258, + midiNameLenErr = -259, + midiDupIDErr = -260, + midiInvalidCmdErr = -261 +}; + + +enum { + nmTypErr = -299 +}; + + +enum { + siInitSDTblErr = 1, + siInitVBLQsErr = 2, + siInitSPTblErr = 3, + sdmJTInitErr = 10, + sdmInitErr = 11, + sdmSRTInitErr = 12, + sdmPRAMInitErr = 13, + sdmPriInitErr = 14 +}; + +enum { + smSDMInitErr = -290, + smSRTInitErr = -291, + smPRAMInitErr = -292, + smPriInitErr = -293, + smEmptySlot = -300, + smCRCFail = -301, + smFormatErr = -302, + smRevisionErr = -303, + smNoDir = -304, + smDisabledSlot = -305, + smNosInfoArray = -306 +}; + + +enum { + smResrvErr = -307, + smUnExBusErr = -308, + smBLFieldBad = -309, + smFHBlockRdErr = -310, + smFHBlkDispErr = -311, + smDisposePErr = -312, + smNoBoardSRsrc = -313, + smGetPRErr = -314, + smNoBoardId = -315, + smInitStatVErr = -316, + smInitTblVErr = -317, + smNoJmpTbl = -318, + smReservedSlot = -318, + smBadBoardId = -319, + smBusErrTO = -320, + + svTempDisable = -32768L, + svDisabled = -32640, + smBadRefId = -330, + smBadsList = -331, + smReservedErr = -332, + smCodeRevErr = -333 +}; + +enum { + smCPUErr = -334, + smsPointerNil = -335, + smNilsBlockErr = -336, + smSlotOOBErr = -337, + smSelOOBErr = -338, + smNewPErr = -339, + smBlkMoveErr = -340, + smCkStatusErr = -341, + smGetDrvrNamErr = -342, + smDisDrvrNamErr = -343, + smNoMoresRsrcs = -344, + smsGetDrvrErr = -345, + smBadsPtrErr = -346, + smByteLanesErr = -347, + smOffsetErr = -348, + smNoGoodOpens = -349, + smSRTOvrFlErr = -350, + smRecNotFnd = -351 +}; + + +enum { + + notBTree = -410, + btNoSpace = -413, + btDupRecErr = -414, + btRecNotFnd = -415, + btKeyLenErr = -416, + btKeyAttrErr = -417, + unknownInsertModeErr = -20000, + recordDataTooBigErr = -20001, + invalidIndexErr = -20002 +}; + + + + + +enum { + fsmFFSNotFoundErr = -431, + fsmBusyFFSErr = -432, + fsmBadFFSNameErr = -433, + fsmBadFSDLenErr = -434, + fsmDuplicateFSIDErr = -435, + fsmBadFSDVersionErr = -436, + fsmNoAlternateStackErr = -437, + fsmUnknownFSMMessageErr = -438 +}; + + +enum { + + editionMgrInitErr = -450, + badSectionErr = -451, + notRegisteredSectionErr = -452, + badEditionFileErr = -453, + badSubPartErr = -454, + multiplePublisherWrn = -460, + containerNotFoundWrn = -461, + containerAlreadyOpenWrn = -462, + notThePublisherWrn = -463 +}; + +enum { + teScrapSizeErr = -501, + hwParamErr = -502, + driverHardwareGoneErr = -503 +}; + +enum { + + procNotFound = -600, + memFragErr = -601, + appModeErr = -602, + protocolErr = -603, + hardwareConfigErr = -604, + appMemFullErr = -605, + appIsDaemon = -606, + bufferIsSmall = -607, + noOutstandingHLE = -608, + connectionInvalid = -609, + noUserInteractionAllowed = -610 +}; + +enum { + + wrongApplicationPlatform = -875, + appVersionTooOld = -876, + notAppropriateForClassic = -877 +}; + + +enum { + threadTooManyReqsErr = -617, + threadNotFoundErr = -618, + threadProtocolErr = -619 +}; + +enum { + threadBadAppContextErr = -616 +}; + + +enum { + notEnoughMemoryErr = -620, + notHeldErr = -621, + cannotMakeContiguousErr = -622, + notLockedErr = -623, + interruptsMaskedErr = -624, + cannotDeferErr = -625, + noMMUErr = -626 +}; + + +enum { + vmMorePhysicalThanVirtualErr = -628, + vmKernelMMUInitErr = -629, + vmOffErr = -630, + vmMemLckdErr = -631, + vmBadDriver = -632, + vmNoVectorErr = -633 +}; + + +enum { + vmInvalidBackingFileIDErr = -640, + vmMappingPrivilegesErr = -641, + vmBusyBackingFileErr = -642, + vmNoMoreBackingFilesErr = -643, + vmInvalidFileViewIDErr = -644, + vmFileViewAccessErr = -645, + vmNoMoreFileViewsErr = -646, + vmAddressNotInFileViewErr = -647, + vmInvalidOwningProcessErr = -648 +}; + + +enum { + rcDBNull = -800, + rcDBValue = -801, + rcDBError = -802, + rcDBBadType = -803, + rcDBBreak = -804, + rcDBExec = -805, + rcDBBadSessID = -806, + rcDBBadSessNum = -807, + rcDBBadDDEV = -808, + rcDBAsyncNotSupp = -809, + rcDBBadAsyncPB = -810, + rcDBNoHandler = -811, + rcDBWrongVersion = -812, + rcDBPackNotInited = -813 +}; + + + +enum { + hmHelpDisabled = -850, + hmBalloonAborted = -853, + hmSameAsLastBalloon = -854, + hmHelpManagerNotInited = -855, + hmSkippedBalloon = -857, + hmWrongVersion = -858, + hmUnknownHelpType = -859, + hmOperationUnsupported = -861, + hmNoBalloonUp = -862, + hmCloseViewActive = -863 +}; + + + +enum { + + notInitErr = -900, + nameTypeErr = -902, + noPortErr = -903, + + + noGlobalsErr = -904, + localOnlyErr = -905, + destPortErr = -906, + sessTableErr = -907, + noSessionErr = -908, + badReqErr = -909, + portNameExistsErr = -910, + noUserNameErr = -911, + userRejectErr = -912, + noMachineNameErr = -913, + noToolboxNameErr = -914, + noResponseErr = -915, + portClosedErr = -916, + sessClosedErr = -917, + badPortNameErr = -919, + noDefaultUserErr = -922, + notLoggedInErr = -923, + noUserRefErr = -924, + networkErr = -925, + noInformErr = -926, + authFailErr = -927, + noUserRecErr = -928, + badServiceMethodErr = -930, + badLocNameErr = -931, + guestNotAllowedErr = -932 +}; + + +enum { + kFMIterationCompleted = -980L, + kFMInvalidFontFamilyErr = -981L, + kFMInvalidFontErr = -982L, + kFMIterationScopeModifiedErr = -983L, + kFMFontTableAccessErr = -984L, + kFMFontContainerAccessErr = -985L +}; + +enum { + noMaskFoundErr = -1000 +}; + +enum { + nbpBuffOvr = -1024, + nbpNoConfirm = -1025, + nbpConfDiff = -1026, + nbpDuplicate = -1027, + nbpNotFound = -1028, + nbpNISErr = -1029 +}; + +enum { + aspBadVersNum = -1066, + aspBufTooSmall = -1067, + aspNoMoreSess = -1068, + aspNoServers = -1069, + aspParamErr = -1070, + aspServerBusy = -1071, + aspSessClosed = -1072, + aspSizeErr = -1073, + aspTooMany = -1074, + aspNoAck = -1075 +}; + +enum { + reqFailed = -1096, + tooManyReqs = -1097, + tooManySkts = -1098, + badATPSkt = -1099, + badBuffNum = -1100, + noRelErr = -1101, + cbNotFound = -1102, + noSendResp = -1103, + noDataArea = -1104, + reqAborted = -1105 +}; + + +enum { + + errRefNum = -1280, + errAborted = -1279, + errState = -1278, + errOpening = -1277, + errAttention = -1276, + errFwdReset = -1275, + errDSPQueueSize = -1274, + errOpenDenied = -1273 +}; + + + + + + +enum { + errAECoercionFail = -1700, + errAEDescNotFound = -1701, + errAECorruptData = -1702, + errAEWrongDataType = -1703, + errAENotAEDesc = -1704, + errAEBadListItem = -1705, + errAENewerVersion = -1706, + errAENotAppleEvent = -1707, + errAEEventNotHandled = -1708, + errAEReplyNotValid = -1709, + errAEUnknownSendMode = -1710, + errAEWaitCanceled = -1711, + errAETimeout = -1712, + errAENoUserInteraction = -1713, + errAENotASpecialFunction = -1714, + errAEParamMissed = -1715, + errAEUnknownAddressType = -1716, + errAEHandlerNotFound = -1717, + errAEReplyNotArrived = -1718, + errAEIllegalIndex = -1719, + errAEImpossibleRange = -1720, + errAEWrongNumberArgs = -1721, + errAEAccessorNotFound = -1723, + errAENoSuchLogical = -1725, + errAEBadTestKey = -1726, + errAENotAnObjSpec = -1727, + errAENoSuchObject = -1728, + errAENegativeCount = -1729, + errAEEmptyListContainer = -1730, + errAEUnknownObjectType = -1731, + errAERecordingIsAlreadyOn = -1732, + errAEReceiveTerminate = -1733, + errAEReceiveEscapeCurrent = -1734, + errAEEventFiltered = -1735, + errAEDuplicateHandler = -1736, + errAEStreamBadNesting = -1737, + errAEStreamAlreadyConverted = -1738, + errAEDescIsNull = -1739, + errAEBuildSyntaxError = -1740, + errAEBufferTooSmall = -1741 +}; + +enum { + errOSASystemError = -1750, + errOSAInvalidID = -1751, + errOSABadStorageType = -1752, + errOSAScriptError = -1753, + errOSABadSelector = -1754, + errOSASourceNotAvailable = -1756, + errOSANoSuchDialect = -1757, + errOSADataFormatObsolete = -1758, + errOSADataFormatTooNew = -1759, + errOSACorruptData = errAECorruptData, + errOSARecordingIsAlreadyOn = errAERecordingIsAlreadyOn, + errOSAComponentMismatch = -1761, + errOSACantOpenComponent = -1762, + errOSACantStorePointers = -1763 +}; + + + + +enum { + errOffsetInvalid = -1800, + errOffsetIsOutsideOfView = -1801, + errTopOfDocument = -1810, + errTopOfBody = -1811, + errEndOfDocument = -1812, + errEndOfBody = -1813 +}; + + +enum { + + badDragRefErr = -1850, + badDragItemErr = -1851, + badDragFlavorErr = -1852, + duplicateFlavorErr = -1853, + cantGetFlavorErr = -1854, + duplicateHandlerErr = -1855, + handlerNotFoundErr = -1856, + dragNotAcceptedErr = -1857, + unsupportedForPlatformErr = -1858, + noSuitableDisplaysErr = -1859, + badImageRgnErr = -1860, + badImageErr = -1861, + nonDragOriginatorErr = -1862 +}; + + + +enum { + couldNotResolveDataRef = -2000, + badImageDescription = -2001, + badPublicMovieAtom = -2002, + cantFindHandler = -2003, + cantOpenHandler = -2004, + badComponentType = -2005, + noMediaHandler = -2006, + noDataHandler = -2007, + invalidMedia = -2008, + invalidTrack = -2009, + invalidMovie = -2010, + invalidSampleTable = -2011, + invalidDataRef = -2012, + invalidHandler = -2013, + invalidDuration = -2014, + invalidTime = -2015, + cantPutPublicMovieAtom = -2016, + badEditList = -2017, + mediaTypesDontMatch = -2018, + progressProcAborted = -2019, + movieToolboxUninitialized = -2020, + noRecordOfApp = movieToolboxUninitialized, + wfFileNotFound = -2021, + cantCreateSingleForkFile = -2022, + invalidEditState = -2023, + nonMatchingEditState = -2024, + staleEditState = -2025, + userDataItemNotFound = -2026, + maxSizeToGrowTooSmall = -2027, + badTrackIndex = -2028, + trackIDNotFound = -2029, + trackNotInMovie = -2030, + timeNotInTrack = -2031, + timeNotInMedia = -2032, + badEditIndex = -2033, + internalQuickTimeError = -2034, + cantEnableTrack = -2035, + invalidRect = -2036, + invalidSampleNum = -2037, + invalidChunkNum = -2038, + invalidSampleDescIndex = -2039, + invalidChunkCache = -2040, + invalidSampleDescription = -2041, + dataNotOpenForRead = -2042, + dataNotOpenForWrite = -2043, + dataAlreadyOpenForWrite = -2044, + dataAlreadyClosed = -2045, + endOfDataReached = -2046, + dataNoDataRef = -2047, + noMovieFound = -2048, + invalidDataRefContainer = -2049, + badDataRefIndex = -2050, + noDefaultDataRef = -2051, + couldNotUseAnExistingSample = -2052, + featureUnsupported = -2053, + noVideoTrackInMovieErr = -2054, + noSoundTrackInMovieErr = -2055, + soundSupportNotAvailableErr = -2056, + unsupportedAuxiliaryImportData = -2057, + auxiliaryExportDataUnavailable = -2058, + samplesAlreadyInMediaErr = -2059, + noSourceTreeFoundErr = -2060, + sourceNotFoundErr = -2061, + movieTextNotFoundErr = -2062, + missingRequiredParameterErr = -2063, + invalidSpriteWorldPropertyErr = -2064, + invalidSpritePropertyErr = -2065, + gWorldsNotSameDepthAndSizeErr = -2066, + invalidSpriteIndexErr = -2067, + invalidImageIndexErr = -2068, + invalidSpriteIDErr = -2069 +}; + +enum { + internalComponentErr = -2070, + notImplementedMusicOSErr = -2071, + cantSendToSynthesizerOSErr = -2072, + cantReceiveFromSynthesizerOSErr = -2073, + illegalVoiceAllocationOSErr = -2074, + illegalPartOSErr = -2075, + illegalChannelOSErr = -2076, + illegalKnobOSErr = -2077, + illegalKnobValueOSErr = -2078, + illegalInstrumentOSErr = -2079, + illegalControllerOSErr = -2080, + midiManagerAbsentOSErr = -2081, + synthesizerNotRespondingOSErr = -2082, + synthesizerOSErr = -2083, + illegalNoteChannelOSErr = -2084, + noteChannelNotAllocatedOSErr = -2085, + tunePlayerFullOSErr = -2086, + tuneParseOSErr = -2087, + noExportProcAvailableErr = -2089, + videoOutputInUseErr = -2090 +}; + +enum { + componentDllLoadErr = -2091, + componentDllEntryNotFoundErr = -2092, + qtmlDllLoadErr = -2093, + qtmlDllEntryNotFoundErr = -2094, + qtmlUninitialized = -2095, + unsupportedOSErr = -2096, + unsupportedProcessorErr = -2097, + componentNotThreadSafeErr = -2098 +}; + +enum { + cannotFindAtomErr = -2101, + notLeafAtomErr = -2102, + atomsNotOfSameTypeErr = -2103, + atomIndexInvalidErr = -2104, + duplicateAtomTypeAndIDErr = -2105, + invalidAtomErr = -2106, + invalidAtomContainerErr = -2107, + invalidAtomTypeErr = -2108, + cannotBeLeafAtomErr = -2109, + pathTooLongErr = -2110, + emptyPathErr = -2111, + noPathMappingErr = -2112, + pathNotVerifiedErr = -2113, + unknownFormatErr = -2114, + wackBadFileErr = -2115, + wackForkNotFoundErr = -2116, + wackBadMetaDataErr = -2117, + qfcbNotFoundErr = -2118, + qfcbNotCreatedErr = -2119, + AAPNotCreatedErr = -2120, + AAPNotFoundErr = -2121, + ASDBadHeaderErr = -2122, + ASDBadForkErr = -2123, + ASDEntryNotFoundErr = -2124, + fileOffsetTooBigErr = -2125, + notAllowedToSaveMovieErr = -2126, + qtNetworkAlreadyAllocatedErr = -2127, + urlDataHHTTPProtocolErr = -2129, + urlDataHHTTPNoNetDriverErr = -2130, + urlDataHHTTPURLErr = -2131, + urlDataHHTTPRedirectErr = -2132, + urlDataHFTPProtocolErr = -2133, + urlDataHFTPShutdownErr = -2134, + urlDataHFTPBadUserErr = -2135, + urlDataHFTPBadPasswordErr = -2136, + urlDataHFTPServerErr = -2137, + urlDataHFTPDataConnectionErr = -2138, + urlDataHFTPNoDirectoryErr = -2139, + urlDataHFTPQuotaErr = -2140, + urlDataHFTPPermissionsErr = -2141, + urlDataHFTPFilenameErr = -2142, + urlDataHFTPNoNetDriverErr = -2143, + urlDataHFTPBadNameListErr = -2144, + urlDataHFTPNeedPasswordErr = -2145, + urlDataHFTPNoPasswordErr = -2146, + urlDataHFTPServerDisconnectedErr = -2147, + urlDataHFTPURLErr = -2148, + notEnoughDataErr = -2149, + qtActionNotHandledErr = -2157, + qtXMLParseErr = -2158, + qtXMLApplicationErr = -2159 +}; + + +enum { + digiUnimpErr = -2201, + qtParamErr = -2202, + matrixErr = -2203, + notExactMatrixErr = -2204, + noMoreKeyColorsErr = -2205, + notExactSizeErr = -2206, + badDepthErr = -2207, + noDMAErr = -2208, + badCallOrderErr = -2209 +}; + + + +enum { + kernelIncompleteErr = -2401, + kernelCanceledErr = -2402, + kernelOptionsErr = -2403, + kernelPrivilegeErr = -2404, + kernelUnsupportedErr = -2405, + kernelObjectExistsErr = -2406, + kernelWritePermissionErr = -2407, + kernelReadPermissionErr = -2408, + kernelExecutePermissionErr = -2409, + kernelDeletePermissionErr = -2410, + kernelExecutionLevelErr = -2411, + kernelAttributeErr = -2412, + kernelAsyncSendLimitErr = -2413, + kernelAsyncReceiveLimitErr = -2414, + kernelTimeoutErr = -2415, + kernelInUseErr = -2416, + kernelTerminatedErr = -2417, + kernelExceptionErr = -2418, + kernelIDErr = -2419, + kernelAlreadyFreeErr = -2421, + kernelReturnValueErr = -2422, + kernelUnrecoverableErr = -2499 +}; + + + +enum { + + tsmComponentNoErr = 0, + tsmUnsupScriptLanguageErr = -2500, + tsmInputMethodNotFoundErr = -2501, + tsmNotAnAppErr = -2502, + tsmAlreadyRegisteredErr = -2503, + tsmNeverRegisteredErr = -2504, + tsmInvalidDocIDErr = -2505, + tsmTSMDocBusyErr = -2506, + tsmDocNotActiveErr = -2507, + tsmNoOpenTSErr = -2508, + tsmCantOpenComponentErr = -2509, + tsmTextServiceNotFoundErr = -2510, + tsmDocumentOpenErr = -2511, + tsmUseInputWindowErr = -2512, + tsmTSHasNoMenuErr = -2513, + tsmTSNotOpenErr = -2514, + tsmComponentAlreadyOpenErr = -2515, + tsmInputMethodIsOldErr = -2516, + tsmScriptHasNoIMErr = -2517, + tsmUnsupportedTypeErr = -2518, + tsmUnknownErr = -2519, + tsmInvalidContext = -2520, + tsmNoHandler = -2521, + tsmNoMoreTokens = -2522, + tsmNoStem = -2523, + tsmDefaultIsNotInputMethodErr = -2524, + tsmDocPropertyNotFoundErr = -2528, + tsmDocPropertyBufferTooSmallErr = -2529, + tsmCantChangeForcedClassStateErr = -2530, + tsmComponentPropertyUnsupportedErr = -2531, + tsmComponentPropertyNotFoundErr = -2532, + tsmInputModeChangeFailedErr = -2533 +}; + + +enum { + + mmInternalError = -2526 +}; + + +enum { + nrLockedErr = -2536, + nrNotEnoughMemoryErr = -2537, + nrInvalidNodeErr = -2538, + nrNotFoundErr = -2539, + nrNotCreatedErr = -2540, + nrNameErr = -2541, + nrNotSlotDeviceErr = -2542, + nrDataTruncatedErr = -2543, + nrPowerErr = -2544, + nrPowerSwitchAbortErr = -2545, + nrTypeMismatchErr = -2546, + nrNotModifiedErr = -2547, + nrOverrunErr = -2548, + nrResultCodeBase = -2549, + nrPathNotFound = -2550, + nrPathBufferTooSmall = -2551, + nrInvalidEntryIterationOp = -2552, + nrPropertyAlreadyExists = -2553, + nrIterationDone = -2554, + nrExitedIteratorScope = -2555, + nrTransactionAborted = -2556, + nrCallNotSupported = -2557 +}; + + +enum { + invalidIconRefErr = -2580, + noSuchIconErr = -2581, + noIconDataAvailableErr = -2582 +}; +enum { + errOSACantCoerce = errAECoercionFail, + errOSACantAccess = errAENoSuchObject, + errOSACantAssign = -10006, + errOSAGeneralError = -2700, + errOSADivideByZero = -2701, + errOSANumericOverflow = -2702, + errOSACantLaunch = -2703, + errOSAAppNotHighLevelEventAware = -2704, + errOSACorruptTerminology = -2705, + errOSAStackOverflow = -2706, + errOSAInternalTableOverflow = -2707, + errOSADataBlockTooLarge = -2708, + errOSACantGetTerminology = -2709, + errOSACantCreate = -2710 +}; +enum { + errOSATypeError = errAEWrongDataType, + OSAMessageNotUnderstood = errAEEventNotHandled, + OSAUndefinedHandler = errAEHandlerNotFound, + OSAIllegalAccess = errAEAccessorNotFound, + OSAIllegalIndex = errAEIllegalIndex, + OSAIllegalRange = errAEImpossibleRange, + OSAIllegalAssign = -10003, + OSASyntaxError = -2740, + OSASyntaxTypeError = -2741, + OSATokenTooLong = -2742, + OSAMissingParameter = errAEDescNotFound, + OSAParameterMismatch = errAEWrongNumberArgs, + OSADuplicateParameter = -2750, + OSADuplicateProperty = -2751, + OSADuplicateHandler = -2752, + OSAUndefinedVariable = -2753, + OSAInconsistentDeclarations = -2754, + OSAControlFlowError = -2755 +}; +enum { + errASCantConsiderAndIgnore = -2720, + errASCantCompareMoreThan32k = -2721, + errASTerminologyNestingTooDeep = -2760, + errASIllegalFormalParameter = -2761, + errASParameterNotForEvent = -2762, + errASNoResultReturned = -2763, + errASInconsistentNames = -2780 +}; + + + +enum { + cfragFirstErrCode = -2800, + cfragContextIDErr = -2800, + cfragConnectionIDErr = -2801, + cfragNoSymbolErr = -2802, + cfragNoSectionErr = -2803, + cfragNoLibraryErr = -2804, + cfragDupRegistrationErr = -2805, + cfragFragmentFormatErr = -2806, + cfragUnresolvedErr = -2807, + cfragNoPositionErr = -2808, + cfragNoPrivateMemErr = -2809, + cfragNoClientMemErr = -2810, + cfragNoIDsErr = -2811, + cfragInitOrderErr = -2812, + cfragImportTooOldErr = -2813, + cfragImportTooNewErr = -2814, + cfragInitLoopErr = -2815, + cfragInitAtBootErr = -2816, + cfragLibConnErr = -2817, + cfragCFMStartupErr = -2818, + cfragCFMInternalErr = -2819, + cfragFragmentCorruptErr = -2820, + cfragInitFunctionErr = -2821, + cfragNoApplicationErr = -2822, + cfragArchitectureErr = -2823, + cfragFragmentUsageErr = -2824, + cfragFileSizeErr = -2825, + cfragNotClosureErr = -2826, + cfragNoRegistrationErr = -2827, + cfragContainerIDErr = -2828, + cfragClosureIDErr = -2829, + cfragAbortClosureErr = -2830, + cfragOutputLengthErr = -2831, + cfragMapFileErr = -2851, + cfragExecFileRefErr = -2854, + cfragStdFolderErr = -2855, + cfragRsrcForkErr = -2856, + cfragCFragRsrcErr = -2857, + cfragLastErrCode = -2899 +}; + +enum { + + cfragFirstReservedCode = -2897, + cfragReservedCode_3 = -2897, + cfragReservedCode_2 = -2898, + cfragReservedCode_1 = -2899 +}; +enum { + invalidComponentID = -3000, + validInstancesExist = -3001, + componentNotCaptured = -3002, + componentDontRegister = -3003, + unresolvedComponentDLLErr = -3004, + retryComponentRegistrationErr = -3005 +}; + + +enum { + invalidTranslationPathErr = -3025, + couldNotParseSourceFileErr = -3026, + noTranslationPathErr = -3030, + badTranslationSpecErr = -3031, + noPrefAppErr = -3032 +}; + +enum { + buf2SmallErr = -3101, + noMPPErr = -3102, + ckSumErr = -3103, + extractErr = -3104, + readQErr = -3105, + atpLenErr = -3106, + atpBadRsp = -3107, + recNotFnd = -3108, + sktClosedErr = -3109 +}; + + + +enum { + kOTNoError = 0, + kOTOutOfMemoryErr = -3211, + kOTNotFoundErr = -3201, + kOTDuplicateFoundErr = -3216, + kOTBadAddressErr = -3150, + kOTBadOptionErr = -3151, + kOTAccessErr = -3152, + kOTBadReferenceErr = -3153, + kOTNoAddressErr = -3154, + kOTOutStateErr = -3155, + kOTBadSequenceErr = -3156, + kOTSysErrorErr = -3157, + kOTLookErr = -3158, + kOTBadDataErr = -3159, + kOTBufferOverflowErr = -3160, + kOTFlowErr = -3161, + kOTNoDataErr = -3162, + kOTNoDisconnectErr = -3163, + kOTNoUDErrErr = -3164, + kOTBadFlagErr = -3165, + kOTNoReleaseErr = -3166, + kOTNotSupportedErr = -3167, + kOTStateChangeErr = -3168, + kOTNoStructureTypeErr = -3169, + kOTBadNameErr = -3170, + kOTBadQLenErr = -3171, + kOTAddressBusyErr = -3172, + kOTIndOutErr = -3173, + kOTProviderMismatchErr = -3174, + kOTResQLenErr = -3175, + kOTResAddressErr = -3176, + kOTQFullErr = -3177, + kOTProtocolErr = -3178, + kOTBadSyncErr = -3179, + kOTCanceledErr = -3180, + kEPERMErr = -3200, + kENOENTErr = -3201, + kENORSRCErr = -3202, + kEINTRErr = -3203, + kEIOErr = -3204, + kENXIOErr = -3205, + kEBADFErr = -3208, + kEAGAINErr = -3210, + kENOMEMErr = -3211, + kEACCESErr = -3212, + kEFAULTErr = -3213, + kEBUSYErr = -3215, + kEEXISTErr = -3216, + kENODEVErr = -3218, + kEINVALErr = -3221, + kENOTTYErr = -3224, + kEPIPEErr = -3231, + kERANGEErr = -3233, + kEWOULDBLOCKErr = -3234, + kEDEADLKErr = -3234, + kEALREADYErr = -3236, + kENOTSOCKErr = -3237, + kEDESTADDRREQErr = -3238, + kEMSGSIZEErr = -3239, + kEPROTOTYPEErr = -3240, + kENOPROTOOPTErr = -3241, + kEPROTONOSUPPORTErr = -3242, + kESOCKTNOSUPPORTErr = -3243, + kEOPNOTSUPPErr = -3244, + kEADDRINUSEErr = -3247, + kEADDRNOTAVAILErr = -3248, + kENETDOWNErr = -3249, + kENETUNREACHErr = -3250, + kENETRESETErr = -3251, + kECONNABORTEDErr = -3252, + kECONNRESETErr = -3253, + kENOBUFSErr = -3254, + kEISCONNErr = -3255, + kENOTCONNErr = -3256, + kESHUTDOWNErr = -3257, + kETOOMANYREFSErr = -3258, + kETIMEDOUTErr = -3259, + kECONNREFUSEDErr = -3260, + kEHOSTDOWNErr = -3263, + kEHOSTUNREACHErr = -3264, + kEPROTOErr = -3269, + kETIMEErr = -3270, + kENOSRErr = -3271, + kEBADMSGErr = -3272, + kECANCELErr = -3273, + kENOSTRErr = -3274, + kENODATAErr = -3275, + kEINPROGRESSErr = -3276, + kESRCHErr = -3277, + kENOMSGErr = -3278, + kOTClientNotInittedErr = -3279, + kOTPortHasDiedErr = -3280, + kOTPortWasEjectedErr = -3281, + kOTBadConfigurationErr = -3282, + kOTConfigurationChangedErr = -3283, + kOTUserRequestedErr = -3284, + kOTPortLostConnection = -3285 +}; + + + +enum { + kQDNoPalette = -3950, + kQDNoColorHWCursorSupport = -3951, + kQDCursorAlreadyRegistered = -3952, + kQDCursorNotRegistered = -3953, + kQDCorruptPICTDataErr = -3954 +}; + + + + +enum { + firstPickerError = -4000, + invalidPickerType = firstPickerError, + requiredFlagsDontMatch = -4001, + pickerResourceError = -4002, + cantLoadPicker = -4003, + cantCreatePickerWindow = -4004, + cantLoadPackage = -4005, + pickerCantLive = -4006, + colorSyncNotInstalled = -4007, + badProfileError = -4008, + noHelpForItem = -4009 +}; + + + + +enum { + kNSL68kContextNotSupported = -4170, + kNSLSchedulerError = -4171, + kNSLBadURLSyntax = -4172, + kNSLNoCarbonLib = -4173, + kNSLUILibraryNotAvailable = -4174, + kNSLNotImplementedYet = -4175, + kNSLErrNullPtrError = -4176, + kNSLSomePluginsFailedToLoad = -4177, + kNSLNullNeighborhoodPtr = -4178, + kNSLNoPluginsForSearch = -4179, + kNSLSearchAlreadyInProgress = -4180, + kNSLNoPluginsFound = -4181, + kNSLPluginLoadFailed = -4182, + kNSLBadProtocolTypeErr = -4183, + kNSLNullListPtr = -4184, + kNSLBadClientInfoPtr = -4185, + kNSLCannotContinueLookup = -4186, + kNSLBufferTooSmallForData = -4187, + kNSLNoContextAvailable = -4188, + kNSLRequestBufferAlreadyInList = -4189, + kNSLInvalidPluginSpec = -4190, + kNSLNoSupportForService = -4191, + kNSLBadNetConnection = -4192, + kNSLBadDataTypeErr = -4193, + kNSLBadServiceTypeErr = -4194, + kNSLBadReferenceErr = -4195, + kNSLNoElementsInList = -4196, + kNSLInsufficientOTVer = -4197, + kNSLInsufficientSysVer = -4198, + kNSLNotInitialized = -4199, + kNSLInitializationFailed = -4200 +}; + + + + +enum { + kDTPHoldJobErr = -4200, + kDTPStopQueueErr = -4201, + kDTPTryAgainErr = -4202, + kDTPAbortJobErr = 128 +}; + + + +enum { + + cmElementTagNotFound = -4200, + cmIndexRangeErr = -4201, + cmCantDeleteElement = -4202, + cmFatalProfileErr = -4203, + cmInvalidProfile = -4204, + cmInvalidProfileLocation = -4205, + cmCantCopyModifiedV1Profile = -4215, + + cmInvalidSearch = -4206, + cmSearchError = -4207, + cmErrIncompatibleProfile = -4208, + cmInvalidColorSpace = -4209, + cmInvalidSrcMap = -4210, + cmInvalidDstMap = -4211, + cmNoGDevicesError = -4212, + cmInvalidProfileComment = -4213, + cmRangeOverFlow = -4214, + cmNamedColorNotFound = -4216, + cmCantGamutCheckError = -4217 +}; + + +enum { + badFolderDescErr = -4270, + duplicateFolderDescErr = -4271, + noMoreFolderDescErr = -4272, + invalidFolderTypeErr = -4273, + duplicateRoutingErr = -4274, + routingNotFoundErr = -4275, + badRoutingSizeErr = -4276 +}; + + + +enum { + coreFoundationUnknownErr = -4960 +}; + + +enum { + errCoreEndianDataTooShortForFormat = -4940, + errCoreEndianDataTooLongForFormat = -4941, + errCoreEndianDataDoesNotMatchFormat = -4942 +}; + + + +enum { + internalScrapErr = -4988, + duplicateScrapFlavorErr = -4989, + badScrapRefErr = -4990, + processStateIncorrectErr = -4991, + scrapPromiseNotKeptErr = -4992, + noScrapPromiseKeeperErr = -4993, + nilScrapFlavorDataErr = -4994, + scrapFlavorFlagsMismatchErr = -4995, + scrapFlavorSizeMismatchErr = -4996, + illegalScrapFlavorFlagsErr = -4997, + illegalScrapFlavorTypeErr = -4998, + illegalScrapFlavorSizeErr = -4999, + scrapFlavorNotFoundErr = -102, + needClearScrapErr = -100 +}; + + +enum { + + afpAccessDenied = -5000, + afpAuthContinue = -5001, + afpBadUAM = -5002, + afpBadVersNum = -5003, + afpBitmapErr = -5004, + afpCantMove = -5005, + afpDenyConflict = -5006, + afpDirNotEmpty = -5007, + afpDiskFull = -5008, + afpEofError = -5009, + afpFileBusy = -5010, + afpFlatVol = -5011, + afpItemNotFound = -5012, + afpLockErr = -5013, + afpMiscErr = -5014, + afpNoMoreLocks = -5015, + afpNoServer = -5016, + afpObjectExists = -5017, + afpObjectNotFound = -5018, + afpParmErr = -5019, + afpRangeNotLocked = -5020, + afpRangeOverlap = -5021, + afpSessClosed = -5022, + afpUserNotAuth = -5023, + afpCallNotSupported = -5024, + afpObjectTypeErr = -5025, + afpTooManyFilesOpen = -5026, + afpServerGoingDown = -5027, + afpCantRename = -5028, + afpDirNotFound = -5029, + afpIconTypeError = -5030, + afpVolLocked = -5031, + afpObjectLocked = -5032, + afpContainsSharedErr = -5033, + afpIDNotFound = -5034, + afpIDExists = -5035, + afpDiffVolErr = -5036, + afpCatalogChanged = -5037, + afpSameObjectErr = -5038, + afpBadIDErr = -5039, + afpPwdSameErr = -5040, + afpPwdTooShortErr = -5041, + afpPwdExpiredErr = -5042, + afpInsideSharedErr = -5043, + + afpInsideTrashErr = -5044, + + afpPwdNeedsChangeErr = -5045, + afpPwdPolicyErr = -5046, + afpAlreadyLoggedInErr = -5047, + afpCallNotAllowed = -5048 +}; + +enum { + + afpBadDirIDType = -5060, + afpCantMountMoreSrvre = -5061, + afpAlreadyMounted = -5062, + afpSameNodeErr = -5063 +}; + + + + + + +enum { + numberFormattingNotANumberErr = -5200, + numberFormattingOverflowInDestinationErr = -5201, + numberFormattingBadNumberFormattingObjectErr = -5202, + numberFormattingSpuriousCharErr = -5203, + numberFormattingLiteralMissingErr = -5204, + numberFormattingDelimiterMissingErr = -5205, + numberFormattingEmptyFormatErr = -5206, + numberFormattingBadFormatErr = -5207, + numberFormattingBadOptionsErr = -5208, + numberFormattingBadTokenErr = -5209, + numberFormattingUnOrderedCurrencyRangeErr = -5210, + numberFormattingBadCurrencyPositionErr = -5211, + numberFormattingNotADigitErr = -5212, + numberFormattingUnOrdredCurrencyRangeErr = -5210, + numberFortmattingNotADigitErr = -5212 +}; + + +enum { + textParserBadParamErr = -5220, + textParserObjectNotFoundErr = -5221, + textParserBadTokenValueErr = -5222, + textParserBadParserObjectErr = -5223, + textParserParamErr = -5224, + textParserNoMoreTextErr = -5225, + textParserBadTextLanguageErr = -5226, + textParserBadTextEncodingErr = -5227, + textParserNoSuchTokenFoundErr = -5228, + textParserNoMoreTokensErr = -5229 +}; + +enum { + errUnknownAttributeTag = -5240, + errMarginWilllNotFit = -5241, + errNotInImagingMode = -5242, + errAlreadyInImagingMode = -5243, + errEngineNotFound = -5244, + errIteratorReachedEnd = -5245, + errInvalidRange = -5246, + errOffsetNotOnElementBounday = -5247, + errNoHiliteText = -5248, + errEmptyScrap = -5249, + errReadOnlyText = -5250, + errUnknownElement = -5251, + errNonContiuousAttribute = -5252, + errCannotUndo = -5253 +}; + + + +enum { + hrHTMLRenderingLibNotInstalledErr = -5360, + hrMiscellaneousExceptionErr = -5361, + hrUnableToResizeHandleErr = -5362, + hrURLNotHandledErr = -5363 +}; + + + +enum { + errIANoErr = 0, + errIAUnknownErr = -5380, + errIAAllocationErr = -5381, + errIAParamErr = -5382, + errIANoMoreItems = -5383, + errIABufferTooSmall = -5384, + errIACanceled = -5385, + errIAInvalidDocument = -5386, + errIATextExtractionErr = -5387, + errIAEndOfTextRun = -5388 +}; + + + +enum { + qtsBadSelectorErr = -5400, + qtsBadStateErr = -5401, + qtsBadDataErr = -5402, + qtsUnsupportedDataTypeErr = -5403, + qtsUnsupportedRateErr = -5404, + qtsUnsupportedFeatureErr = -5405, + qtsTooMuchDataErr = -5406, + qtsUnknownValueErr = -5407, + qtsTimeoutErr = -5408, + qtsConnectionFailedErr = -5420, + qtsAddressBusyErr = -5421 +}; + + +enum { + + gestaltUnknownErr = -5550, + gestaltUndefSelectorErr = -5551, + gestaltDupSelectorErr = -5552, + gestaltLocationErr = -5553 +}; + + + +enum { + menuPropertyInvalidErr = -5603, + menuPropertyInvalid = menuPropertyInvalidErr, + menuPropertyNotFoundErr = -5604, + menuNotFoundErr = -5620, + menuUsesSystemDefErr = -5621, + menuItemNotFoundErr = -5622, + menuInvalidErr = -5623 +}; + + + +enum { + errInvalidWindowPtr = -5600, + errInvalidWindowRef = -5600, + errUnsupportedWindowAttributesForClass = -5601, + errWindowDoesNotHaveProxy = -5602, + errInvalidWindowProperty = -5603, + errWindowPropertyNotFound = -5604, + errUnrecognizedWindowClass = -5605, + errCorruptWindowDescription = -5606, + errUserWantsToDragWindow = -5607, + errWindowsAlreadyInitialized = -5608, + errFloatingWindowsNotInitialized = -5609, + errWindowNotFound = -5610, + errWindowDoesNotFitOnscreen = -5611, + windowAttributeImmutableErr = -5612, + windowAttributesConflictErr = -5613, + windowManagerInternalErr = -5614, + windowWrongStateErr = -5615, + windowGroupInvalidErr = -5616, + windowAppModalStateAlreadyExistsErr = -5617, + windowNoAppModalStateErr = -5618, + errWindowDoesntSupportFocus = -30583, + errWindowRegionCodeInvalid = -30593 +}; + + + +enum { + dialogNoTimeoutErr = -5640 +}; + + + +enum { + kNavWrongDialogStateErr = -5694, + kNavWrongDialogClassErr = -5695, + kNavInvalidSystemConfigErr = -5696, + kNavCustomControlMessageFailedErr = -5697, + kNavInvalidCustomControlMessageErr = -5698, + kNavMissingKindStringErr = -5699 +}; + + + +enum { + collectionItemLockedErr = -5750, + collectionItemNotFoundErr = -5751, + collectionIndexRangeErr = -5752, + collectionVersionErr = -5753 +}; + + + +enum { + kQTSSUnknownErr = -6150 +}; + + +enum { + + kDMGenErr = -6220, + + kDMMirroringOnAlready = -6221, + kDMWrongNumberOfDisplays = -6222, + kDMMirroringBlocked = -6223, + kDMCantBlock = -6224, + kDMMirroringNotOn = -6225, + + kSysSWTooOld = -6226, + kDMSWNotInitializedErr = -6227, + kDMDriverNotDisplayMgrAwareErr = -6228, + kDMDisplayNotFoundErr = -6229, + kDMNotFoundErr = -6229, + kDMDisplayAlreadyInstalledErr = -6230, + kDMMainDisplayCannotMoveErr = -6231, + kDMNoDeviceTableclothErr = -6231, + kDMFoundErr = -6232 +}; + + + + + +enum { + laTooSmallBufferErr = -6984, + laEnvironmentBusyErr = -6985, + laEnvironmentNotFoundErr = -6986, + laEnvironmentExistErr = -6987, + laInvalidPathErr = -6988, + laNoMoreMorphemeErr = -6989, + laFailAnalysisErr = -6990, + laTextOverFlowErr = -6991, + laDictionaryNotOpenedErr = -6992, + laDictionaryUnknownErr = -6993, + laDictionaryTooManyErr = -6994, + laPropertyValueErr = -6995, + laPropertyUnknownErr = -6996, + laPropertyIsReadOnlyErr = -6997, + laPropertyNotFoundErr = -6998, + laPropertyErr = -6999, + laEngineNotFoundErr = -7000 +}; + + +enum { + kUSBNoErr = 0, + kUSBNoTran = 0, + kUSBNoDelay = 0, + kUSBPending = 1 +}; +enum { + kUSBNotSent2Err = -6901, + kUSBNotSent1Err = -6902, + kUSBBufUnderRunErr = -6903, + kUSBBufOvrRunErr = -6904, + kUSBRes2Err = -6905, + kUSBRes1Err = -6906, + kUSBUnderRunErr = -6907, + kUSBOverRunErr = -6908, + kUSBWrongPIDErr = -6909, + kUSBPIDCheckErr = -6910, + kUSBNotRespondingErr = -6911, + kUSBEndpointStallErr = -6912, + kUSBDataToggleErr = -6913, + kUSBBitstufErr = -6914, + kUSBCRCErr = -6915, + kUSBLinkErr = -6916 +}; + + + + + + +enum { + kUSBQueueFull = -6948, + kUSBNotHandled = -6987, + kUSBUnknownNotification = -6949, + kUSBBadDispatchTable = -6950 +}; + + + + + + + +enum { + kUSBInternalReserved10 = -6951, + kUSBInternalReserved9 = -6952, + kUSBInternalReserved8 = -6953, + kUSBInternalReserved7 = -6954, + kUSBInternalReserved6 = -6955, + kUSBInternalReserved5 = -6956, + kUSBInternalReserved4 = -6957, + kUSBInternalReserved3 = -6958, + kUSBInternalReserved2 = -6959, + kUSBInternalReserved1 = -6960 +}; + + +enum { + kUSBPortDisabled = -6969, + kUSBQueueAborted = -6970, + kUSBTimedOut = -6971, + kUSBDeviceDisconnected = -6972, + kUSBDeviceNotSuspended = -6973, + kUSBDeviceSuspended = -6974, + kUSBInvalidBuffer = -6975, + kUSBDevicePowerProblem = -6976, + kUSBDeviceBusy = -6977, + kUSBUnknownInterfaceErr = -6978, + kUSBPipeStalledError = -6979, + kUSBPipeIdleError = -6980, + kUSBNoBandwidthError = -6981, + kUSBAbortedError = -6982, + kUSBFlagsError = -6983, + kUSBCompletionError = -6984, + kUSBPBLengthError = -6985, + kUSBPBVersionError = -6986, + kUSBNotFound = -6987, + kUSBOutOfMemoryErr = -6988, + kUSBDeviceErr = -6989, + kUSBNoDeviceErr = -6990, + kUSBAlreadyOpenErr = -6991, + kUSBTooManyTransactionsErr = -6992, + kUSBUnknownRequestErr = -6993, + kUSBRqErr = -6994, + kUSBIncorrectTypeErr = -6995, + kUSBTooManyPipesErr = -6996, + kUSBUnknownPipeErr = -6997, + kUSBUnknownDeviceErr = -6998, + kUSBInternalErr = -6999 +}; + + + + + +enum { + dcmParamErr = -7100, + dcmNotDictionaryErr = -7101, + dcmBadDictionaryErr = -7102, + dcmPermissionErr = -7103, + dcmDictionaryNotOpenErr = -7104, + dcmDictionaryBusyErr = -7105, + dcmBlockFullErr = -7107, + dcmNoRecordErr = -7108, + dcmDupRecordErr = -7109, + dcmNecessaryFieldErr = -7110, + dcmBadFieldInfoErr = -7111, + dcmBadFieldTypeErr = -7112, + dcmNoFieldErr = -7113, + dcmBadKeyErr = -7115, + dcmTooManyKeyErr = -7116, + dcmBadDataSizeErr = -7117, + dcmBadFindMethodErr = -7118, + dcmBadPropertyErr = -7119, + dcmProtectedErr = -7121, + dcmNoAccessMethodErr = -7122, + dcmBadFeatureErr = -7124, + dcmIterationCompleteErr = -7126, + dcmBufferOverflowErr = -7127 +}; + + + +enum { + kRAInvalidParameter = -7100, + kRAInvalidPort = -7101, + kRAStartupFailed = -7102, + kRAPortSetupFailed = -7103, + kRAOutOfMemory = -7104, + kRANotSupported = -7105, + kRAMissingResources = -7106, + kRAIncompatiblePrefs = -7107, + kRANotConnected = -7108, + kRAConnectionCanceled = -7109, + kRAUnknownUser = -7110, + kRAInvalidPassword = -7111, + kRAInternalError = -7112, + kRAInstallationDamaged = -7113, + kRAPortBusy = -7114, + kRAUnknownPortState = -7115, + kRAInvalidPortState = -7116, + kRAInvalidSerialProtocol = -7117, + kRAUserLoginDisabled = -7118, + kRAUserPwdChangeRequired = -7119, + kRAUserPwdEntryRequired = -7120, + kRAUserInteractionRequired = -7121, + kRAInitOpenTransportFailed = -7122, + kRARemoteAccessNotReady = -7123, + kRATCPIPInactive = -7124, + kRATCPIPNotConfigured = -7125, + kRANotPrimaryInterface = -7126, + kRAConfigurationDBInitErr = -7127, + kRAPPPProtocolRejected = -7128, + kRAPPPAuthenticationFailed = -7129, + kRAPPPNegotiationFailed = -7130, + kRAPPPUserDisconnected = -7131, + kRAPPPPeerDisconnected = -7132, + kRAPeerNotResponding = -7133, + kRAATalkInactive = -7134, + kRAExtAuthenticationFailed = -7135, + kRANCPRejectedbyPeer = -7136, + kRADuplicateIPAddr = -7137, + kRACallBackFailed = -7138, + kRANotEnabled = -7139 +}; +enum { + kATSUInvalidTextLayoutErr = -8790, + + + kATSUInvalidStyleErr = -8791, + + + kATSUInvalidTextRangeErr = -8792, + + + kATSUFontsMatched = -8793, + + + kATSUFontsNotMatched = -8794, + + + kATSUNoCorrespondingFontErr = -8795, + + + + + + + kATSUInvalidFontErr = -8796, + kATSUInvalidAttributeValueErr = -8797, + + kATSUInvalidAttributeSizeErr = -8798, + + kATSUInvalidAttributeTagErr = -8799, + + kATSUInvalidCacheErr = -8800, + + + + + kATSUNotSetErr = -8801, + + + + kATSUNoStyleRunsAssignedErr = -8802, + + kATSUQuickDrawTextErr = -8803, + + kATSULowLevelErr = -8804, + + kATSUNoFontCmapAvailableErr = -8805, + + kATSUNoFontScalerAvailableErr = -8806, + + kATSUCoordinateOverflowErr = -8807, + + kATSULineBreakInWord = -8808, + + + kATSUBusyObjectErr = -8809 +}; +enum { + + kTextUnsupportedEncodingErr = -8738, + kTextMalformedInputErr = -8739, + kTextUndefinedElementErr = -8740, + kTECMissingTableErr = -8745, + kTECTableChecksumErr = -8746, + kTECTableFormatErr = -8747, + kTECCorruptConverterErr = -8748, + kTECNoConversionPathErr = -8749, + kTECBufferBelowMinimumSizeErr = -8750, + kTECArrayFullErr = -8751, + kTECBadTextRunErr = -8752, + kTECPartialCharErr = -8753, + kTECUnmappableElementErr = -8754, + kTECIncompleteElementErr = -8755, + kTECDirectionErr = -8756, + kTECGlobalsUnavailableErr = -8770, + kTECItemUnavailableErr = -8771, + + kTECUsedFallbacksStatus = -8783, + kTECNeedFlushStatus = -8784, + kTECOutputBufferFullStatus = -8785, + + unicodeChecksumErr = -8769, + unicodeNoTableErr = -8768, + unicodeVariantErr = -8767, + unicodeFallbacksErr = -8766, + unicodePartConvertErr = -8765, + unicodeBufErr = -8764, + unicodeCharErr = -8763, + unicodeElementErr = -8762, + unicodeNotFoundErr = -8761, + unicodeTableFormatErr = -8760, + unicodeDirectionErr = -8759, + unicodeContextualErr = -8758, + unicodeTextEncodingDataErr = -8757 +}; + + + +enum { + kUTCUnderflowErr = -8850, + kUTCOverflowErr = -8851, + kIllegalClockValueErr = -8852 +}; + + + + + +enum { + kATSUInvalidFontFallbacksErr = -8900, + + kATSUUnsupportedStreamFormatErr = -8901, + + kATSUBadStreamErr = -8902, + + + kATSUOutputBufferTooSmallErr = -8903, + + kATSUInvalidCallInsideCallbackErr = -8904, + + kATSUNoFontNameErr = -8905, + + kATSULastErr = -8959 +}; + + + +enum { + codecErr = -8960, + noCodecErr = -8961, + codecUnimpErr = -8962, + codecSizeErr = -8963, + codecScreenBufErr = -8964, + codecImageBufErr = -8965, + codecSpoolErr = -8966, + codecAbortErr = -8967, + codecWouldOffscreenErr = -8968, + codecBadDataErr = -8969, + codecDataVersErr = -8970, + codecExtensionNotFoundErr = -8971, + scTypeNotFoundErr = codecExtensionNotFoundErr, + codecConditionErr = -8972, + codecOpenErr = -8973, + codecCantWhenErr = -8974, + codecCantQueueErr = -8975, + codecNothingToBlitErr = -8976, + codecNoMemoryPleaseWaitErr = -8977, + codecDisabledErr = -8978, + codecNeedToFlushChainErr = -8979, + lockPortBitsBadSurfaceErr = -8980, + lockPortBitsWindowMovedErr = -8981, + lockPortBitsWindowResizedErr = -8982, + lockPortBitsWindowClippedErr = -8983, + lockPortBitsBadPortErr = -8984, + lockPortBitsSurfaceLostErr = -8985, + codecParameterDialogConfirm = -8986, + codecNeedAccessKeyErr = -8987, + codecOffscreenFailedErr = -8988, + codecDroppedFrameErr = -8989, + directXObjectAlreadyExists = -8990, + lockPortBitsWrongGDeviceErr = -8991, + codecOffscreenFailedPleaseRetryErr = -8992, + badCodecCharacterizationErr = -8993, + noThumbnailFoundErr = -8994 +}; + + + +enum { + kBadAdapterErr = -9050, + kBadAttributeErr = -9051, + kBadBaseErr = -9052, + kBadEDCErr = -9053, + kBadIRQErr = -9054, + kBadOffsetErr = -9055, + kBadPageErr = -9056, + kBadSizeErr = -9057, + kBadSocketErr = -9058, + kBadTypeErr = -9059, + kBadVccErr = -9060, + kBadVppErr = -9061, + kBadWindowErr = -9062, + kBadArgLengthErr = -9063, + kBadArgsErr = -9064, + kBadHandleErr = -9065, + kBadCISErr = -9066, + kBadSpeedErr = -9067, + kReadFailureErr = -9068, + kWriteFailureErr = -9069, + kGeneralFailureErr = -9070, + kNoCardErr = -9071, + kUnsupportedFunctionErr = -9072, + kUnsupportedModeErr = -9073, + kBusyErr = -9074, + kWriteProtectedErr = -9075, + kConfigurationLockedErr = -9076, + kInUseErr = -9077, + kNoMoreItemsErr = -9078, + kOutOfResourceErr = -9079, + kNoCardSevicesSocketsErr = -9080, + kInvalidRegEntryErr = -9081, + kBadLinkErr = -9082, + kBadDeviceErr = -9083, + k16BitCardErr = -9084, + kCardBusCardErr = -9085, + kPassCallToChainErr = -9086, + kCantConfigureCardErr = -9087, + kPostCardEventErr = -9088, + kInvalidDeviceNumber = -9089, + kUnsupportedVsErr = -9090, + kInvalidCSClientErr = -9091, + kBadTupleDataErr = -9092, + kBadCustomIFIDErr = -9093, + kNoIOWindowRequestedErr = -9094, + kNoMoreTimerClientsErr = -9095, + kNoMoreInterruptSlotsErr = -9096, + kNoClientTableErr = -9097, + kUnsupportedCardErr = -9098, + kNoCardEnablersFoundErr = -9099, + kNoEnablerForCardErr = -9100, + kNoCompatibleNameErr = -9101, + kClientRequestDenied = -9102, + + kNotReadyErr = -9103, + kTooManyIOWindowsErr = -9104, + kAlreadySavedStateErr = -9105, + kAttemptDupCardEntryErr = -9106, + kCardPowerOffErr = -9107, + kNotZVCapableErr = -9108, + kNoCardBusCISErr = -9109 +}; + + +enum { + noDeviceForChannel = -9400, + grabTimeComplete = -9401, + cantDoThatInCurrentMode = -9402, + notEnoughMemoryToGrab = -9403, + notEnoughDiskSpaceToGrab = -9404, + couldntGetRequiredComponent = -9405, + badSGChannel = -9406, + seqGrabInfoNotAvailable = -9407, + deviceCantMeetRequest = -9408, + badControllerHeight = -9994, + editingNotAllowed = -9995, + controllerBoundsNotExact = -9996, + cannotSetWidthOfAttachedController = -9997, + controllerHasFixedHeight = -9998, + cannotMoveAttachedController = -9999 +}; + + +enum { + errAEBadKeyForm = -10002, + errAECantHandleClass = -10010, + errAECantSupplyType = -10009, + errAECantUndo = -10015, + errAEEventFailed = -10000, + errAEIndexTooLarge = -10007, + errAEInTransaction = -10011, + errAELocalOnly = -10016, + errAENoSuchTransaction = -10012, + errAENotAnElement = -10008, + errAENotASingleObject = -10014, + errAENotModifiable = -10003, + errAENoUserSelection = -10013, + errAEPrivilegeError = -10004, + errAEReadDenied = -10005, + errAETypeError = -10001, + errAEWriteDenied = -10006, + errAENotAnEnumMember = -10023, + errAECantPutThatThere = -10024, + errAEPropertiesClash = -10025 +}; + + +enum { + telGenericError = -1, + telNoErr = 0, + telNoTools = 8, + telBadTermErr = -10001, + telBadDNErr = -10002, + telBadCAErr = -10003, + telBadHandErr = -10004, + telBadProcErr = -10005, + telCAUnavail = -10006, + telNoMemErr = -10007, + telNoOpenErr = -10008, + telBadHTypeErr = -10010, + telHTypeNotSupp = -10011, + telBadLevelErr = -10012, + telBadVTypeErr = -10013, + telVTypeNotSupp = -10014, + telBadAPattErr = -10015, + telAPattNotSupp = -10016, + telBadIndex = -10017, + telIndexNotSupp = -10018, + telBadStateErr = -10019, + telStateNotSupp = -10020, + telBadIntExt = -10021, + telIntExtNotSupp = -10022, + telBadDNDType = -10023, + telDNDTypeNotSupp = -10024, + telFeatNotSub = -10030, + telFeatNotAvail = -10031, + telFeatActive = -10032, + telFeatNotSupp = -10033, + telConfLimitErr = -10040, + telConfNoLimit = -10041, + telConfErr = -10042, + telConfRej = -10043, + telTransferErr = -10044, + telTransferRej = -10045, + telCBErr = -10046, + telConfLimitExceeded = -10047, + telBadDNType = -10050, + telBadPageID = -10051, + telBadIntercomID = -10052, + telBadFeatureID = -10053, + telBadFwdType = -10054, + telBadPickupGroupID = -10055, + telBadParkID = -10056, + telBadSelect = -10057, + telBadBearerType = -10058, + telBadRate = -10059, + telDNTypeNotSupp = -10060, + telFwdTypeNotSupp = -10061, + telBadDisplayMode = -10062, + telDisplayModeNotSupp = -10063, + telNoCallbackRef = -10064, + telAlreadyOpen = -10070, + telStillNeeded = -10071, + telTermNotOpen = -10072, + telCANotAcceptable = -10080, + telCANotRejectable = -10081, + telCANotDeflectable = -10082, + telPBErr = -10090, + telBadFunction = -10091, + + telNoSuchTool = -10102, + telUnknownErr = -10103, + telNoCommFolder = -10106, + telInitFailed = -10107, + telBadCodeResource = -10108, + telDeviceNotFound = -10109, + telBadProcID = -10110, + telValidateFailed = -10111, + telAutoAnsNotOn = -10112, + telDetAlreadyOn = -10113, + telBadSWErr = -10114, + telBadSampleRate = -10115, + telNotEnoughdspBW = -10116 +}; + +enum { + errTaskNotFound = -10780 +}; + + + + + +enum { + + pmBusyErr = -13000, + pmReplyTOErr = -13001, + pmSendStartErr = -13002, + pmSendEndErr = -13003, + pmRecvStartErr = -13004, + pmRecvEndErr = -13005 +}; + + +enum { + kPowerHandlerExistsForDeviceErr = -13006, + kPowerHandlerNotFoundForDeviceErr = -13007, + kPowerHandlerNotFoundForProcErr = -13008, + kPowerMgtMessageNotHandled = -13009, + kPowerMgtRequestDenied = -13010, + kCantReportProcessorTemperatureErr = -13013, + kProcessorTempRoutineRequiresMPLib2 = -13014, + kNoSuchPowerSource = -13020, + kBridgeSoftwareRunningCantSleep = -13038 +}; + + + +enum { + debuggingExecutionContextErr = -13880, + debuggingDuplicateSignatureErr = -13881, + debuggingDuplicateOptionErr = -13882, + debuggingInvalidSignatureErr = -13883, + debuggingInvalidOptionErr = -13884, + debuggingInvalidNameErr = -13885, + debuggingNoCallbackErr = -13886, + debuggingNoMatchErr = -13887 +}; + + + +enum { + kHIDVersionIncompatibleErr = -13909, + kHIDDeviceNotReady = -13910 +}; + + + +enum { + kHIDSuccess = 0, + kHIDInvalidRangePageErr = -13923, + kHIDReportIDZeroErr = -13924, + kHIDReportCountZeroErr = -13925, + kHIDReportSizeZeroErr = -13926, + kHIDUnmatchedDesignatorRangeErr = -13927, + kHIDUnmatchedStringRangeErr = -13928, + kHIDInvertedUsageRangeErr = -13929, + kHIDUnmatchedUsageRangeErr = -13930, + kHIDInvertedPhysicalRangeErr = -13931, + kHIDInvertedLogicalRangeErr = -13932, + kHIDBadLogicalMaximumErr = -13933, + kHIDBadLogicalMinimumErr = -13934, + kHIDUsagePageZeroErr = -13935, + kHIDEndOfDescriptorErr = -13936, + kHIDNotEnoughMemoryErr = -13937, + kHIDBadParameterErr = -13938, + kHIDNullPointerErr = -13939, + kHIDInvalidReportLengthErr = -13940, + kHIDInvalidReportTypeErr = -13941, + kHIDBadLogPhysValuesErr = -13942, + kHIDIncompatibleReportErr = -13943, + kHIDInvalidPreparsedDataErr = -13944, + kHIDNotValueArrayErr = -13945, + kHIDUsageNotFoundErr = -13946, + kHIDValueOutOfRangeErr = -13947, + kHIDBufferTooSmallErr = -13948, + kHIDNullStateErr = -13949, + kHIDBaseError = -13950 +}; + + + +enum { + kModemOutOfMemory = -14000, + kModemPreferencesMissing = -14001, + kModemScriptMissing = -14002 +}; + + + + +enum { + kTXNEndIterationErr = -22000, + kTXNCannotAddFrameErr = -22001, + kTXNInvalidFrameIDErr = -22002, + kTXNIllegalToCrossDataBoundariesErr = -22003, + kTXNUserCanceledOperationErr = -22004, + kTXNBadDefaultFileTypeWarning = -22005, + kTXNCannotSetAutoIndentErr = -22006, + kTXNRunIndexOutofBoundsErr = -22007, + kTXNNoMatchErr = -22008, + kTXNAttributeTagInvalidForRunErr = -22009, + kTXNSomeOrAllTagsInvalidForRunErr = -22010, + kTXNInvalidRunIndex = -22011, + kTXNAlreadyInitializedErr = -22012, + kTXNCannotTurnTSMOffWhenUsingUnicodeErr = -22013, + kTXNCopyNotAllowedInEchoModeErr = -22014, + kTXNDataTypeNotAllowedErr = -22015, + kTXNATSUIIsNotInstalledErr = -22016, + kTXNOutsideOfLineErr = -22017, + kTXNOutsideOfFrameErr = -22018 +}; + + + + + +enum { + printerStatusOpCodeNotSupportedErr = -25280 +}; + + + +enum { + errKCNotAvailable = -25291, + errKCReadOnly = -25292, + errKCAuthFailed = -25293, + errKCNoSuchKeychain = -25294, + errKCInvalidKeychain = -25295, + errKCDuplicateKeychain = -25296, + errKCDuplicateCallback = -25297, + errKCInvalidCallback = -25298, + errKCDuplicateItem = -25299, + errKCItemNotFound = -25300, + errKCBufferTooSmall = -25301, + errKCDataTooLarge = -25302, + errKCNoSuchAttr = -25303, + errKCInvalidItemRef = -25304, + errKCInvalidSearchRef = -25305, + errKCNoSuchClass = -25306, + errKCNoDefaultKeychain = -25307, + errKCInteractionNotAllowed = -25308, + errKCReadOnlyAttr = -25309, + errKCWrongKCVersion = -25310, + errKCKeySizeNotAllowed = -25311, + errKCNoStorageModule = -25312, + errKCNoCertificateModule = -25313, + errKCNoPolicyModule = -25314, + errKCInteractionRequired = -25315, + errKCDataNotAvailable = -25316, + errKCDataNotModifiable = -25317, + errKCCreateChainFailed = -25318 +}; + + + +enum { + kUCOutputBufferTooSmall = -25340, + kUCTextBreakLocatorMissingType = -25341 +}; + +enum { + kUCTSNoKeysAddedToObjectErr = -25342, + kUCTSSearchListErr = -25343 +}; + +enum { + kUCTokenizerIterationFinished = -25344, + kUCTokenizerUnknownLang = -25345, + kUCTokenNotFound = -25346 +}; + + +enum { + kMPIterationEndErr = -29275, + kMPPrivilegedErr = -29276, + kMPProcessCreatedErr = -29288, + kMPProcessTerminatedErr = -29289, + kMPTaskCreatedErr = -29290, + kMPTaskBlockedErr = -29291, + kMPTaskStoppedErr = -29292, + kMPBlueBlockingErr = -29293, + kMPDeletedErr = -29295, + kMPTimeoutErr = -29296, + kMPTaskAbortedErr = -29297, + kMPInsufficientResourcesErr = -29298, + kMPInvalidIDErr = -29299 +}; + +enum { + kMPNanokernelNeedsMemoryErr = -29294 +}; + + +enum { + kCollateAttributesNotFoundErr = -29500, + kCollateInvalidOptions = -29501, + kCollateMissingUnicodeTableErr = -29502, + kCollateUnicodeConvertFailedErr = -29503, + kCollatePatternNotFoundErr = -29504, + kCollateInvalidChar = -29505, + kCollateBufferTooSmall = -29506, + kCollateInvalidCollationRef = -29507 +}; + + + +enum { + kFNSInvalidReferenceErr = -29580, + kFNSBadReferenceVersionErr = -29581, + kFNSInvalidProfileErr = -29582, + kFNSBadProfileVersionErr = -29583, + kFNSDuplicateReferenceErr = -29584, + kFNSMismatchErr = -29585, + kFNSInsufficientDataErr = -29586, + kFNSBadFlattenedSizeErr = -29587, + kFNSNameNotFoundErr = -29589 +}; + + + + +enum { + kLocalesBufferTooSmallErr = -30001, + kLocalesTableFormatErr = -30002, + kLocalesDefaultDisplayStatus = -30029 +}; + + + +enum { + kALMInternalErr = -30049, + kALMGroupNotFoundErr = -30048, + kALMNoSuchModuleErr = -30047, + kALMModuleCommunicationErr = -30046, + kALMDuplicateModuleErr = -30045, + kALMInstallationErr = -30044, + kALMDeferSwitchErr = -30043, + kALMRebootFlagsLevelErr = -30042 +}; + +enum { + kALMLocationNotFoundErr = kALMGroupNotFoundErr +}; + + + +enum { + kSSpInternalErr = -30340, + kSSpVersionErr = -30341, + kSSpCantInstallErr = -30342, + kSSpParallelUpVectorErr = -30343, + kSSpScaleToZeroErr = -30344 +}; + + + +enum { + kNSpInitializationFailedErr = -30360, + kNSpAlreadyInitializedErr = -30361, + kNSpTopologyNotSupportedErr = -30362, + kNSpPipeFullErr = -30364, + kNSpHostFailedErr = -30365, + kNSpProtocolNotAvailableErr = -30366, + kNSpInvalidGameRefErr = -30367, + kNSpInvalidParameterErr = -30369, + kNSpOTNotPresentErr = -30370, + kNSpOTVersionTooOldErr = -30371, + kNSpMemAllocationErr = -30373, + kNSpAlreadyAdvertisingErr = -30374, + kNSpNotAdvertisingErr = -30376, + kNSpInvalidAddressErr = -30377, + kNSpFreeQExhaustedErr = -30378, + kNSpRemovePlayerFailedErr = -30379, + kNSpAddressInUseErr = -30380, + kNSpFeatureNotImplementedErr = -30381, + kNSpNameRequiredErr = -30382, + kNSpInvalidPlayerIDErr = -30383, + kNSpInvalidGroupIDErr = -30384, + kNSpNoPlayersErr = -30385, + kNSpNoGroupsErr = -30386, + kNSpNoHostVolunteersErr = -30387, + kNSpCreateGroupFailedErr = -30388, + kNSpAddPlayerFailedErr = -30389, + kNSpInvalidDefinitionErr = -30390, + kNSpInvalidProtocolRefErr = -30391, + kNSpInvalidProtocolListErr = -30392, + kNSpTimeoutErr = -30393, + kNSpGameTerminatedErr = -30394, + kNSpConnectFailedErr = -30395, + kNSpSendFailedErr = -30396, + kNSpMessageTooBigErr = -30397, + kNSpCantBlockErr = -30398, + kNSpJoinFailedErr = -30399 +}; + + + +enum { + kISpInternalErr = -30420, + kISpSystemListErr = -30421, + kISpBufferToSmallErr = -30422, + kISpElementInListErr = -30423, + kISpElementNotInListErr = -30424, + kISpSystemInactiveErr = -30425, + kISpDeviceInactiveErr = -30426, + kISpSystemActiveErr = -30427, + kISpDeviceActiveErr = -30428, + kISpListBusyErr = -30429 +}; + + +enum { + kDSpNotInitializedErr = -30440L, + kDSpSystemSWTooOldErr = -30441L, + kDSpInvalidContextErr = -30442L, + kDSpInvalidAttributesErr = -30443L, + kDSpContextAlreadyReservedErr = -30444L, + kDSpContextNotReservedErr = -30445L, + kDSpContextNotFoundErr = -30446L, + kDSpFrameRateNotReadyErr = -30447L, + kDSpConfirmSwitchWarning = -30448L, + kDSpInternalErr = -30449L, + kDSpStereoContextErr = -30450L +}; + + + + + + + +enum { + kFBCvTwinExceptionErr = -30500, + kFBCnoIndexesFound = -30501, + kFBCallocFailed = -30502, + kFBCbadParam = -30503, + kFBCfileNotIndexed = -30504, + kFBCbadIndexFile = -30505, + kFBCcompactionFailed = -30506, + kFBCvalidationFailed = -30507, + kFBCindexingFailed = -30508, + kFBCcommitFailed = -30509, + kFBCdeletionFailed = -30510, + kFBCmoveFailed = -30511, + kFBCtokenizationFailed = -30512, + kFBCmergingFailed = -30513, + kFBCindexCreationFailed = -30514, + kFBCaccessorStoreFailed = -30515, + kFBCaddDocFailed = -30516, + kFBCflushFailed = -30517, + kFBCindexNotFound = -30518, + kFBCnoSearchSession = -30519, + kFBCindexingCanceled = -30520, + kFBCaccessCanceled = -30521, + kFBCindexFileDestroyed = -30522, + kFBCindexNotAvailable = -30523, + kFBCsearchFailed = -30524, + kFBCsomeFilesNotIndexed = -30525, + kFBCillegalSessionChange = -30526, + + kFBCanalysisNotAvailable = -30527, + kFBCbadIndexFileVersion = -30528, + kFBCsummarizationCanceled = -30529, + kFBCindexDiskIOFailed = -30530, + kFBCbadSearchSession = -30531, + kFBCnoSuchHit = -30532 +}; + + + +enum { + notAQTVRMovieErr = -30540, + constraintReachedErr = -30541, + callNotSupportedByNodeErr = -30542, + selectorNotSupportedByNodeErr = -30543, + invalidNodeIDErr = -30544, + invalidViewStateErr = -30545, + timeNotInViewErr = -30546, + propertyNotSupportedByNodeErr = -30547, + settingNotSupportedByNodeErr = -30548, + limitReachedErr = -30549, + invalidNodeFormatErr = -30550, + invalidHotSpotIDErr = -30551, + noMemoryNodeFailedInitialize = -30552, + streamingNodeNotReadyErr = -30553, + qtvrLibraryLoadErr = -30554, + qtvrUninitialized = -30555 +}; + + + +enum { + themeInvalidBrushErr = -30560, + themeProcessRegisteredErr = -30561, + themeProcessNotRegisteredErr = -30562, + themeBadTextColorErr = -30563, + themeHasNoAccentsErr = -30564, + themeBadCursorIndexErr = -30565, + themeScriptFontNotFoundErr = -30566, + themeMonitorDepthNotSupportedErr = -30567, + themeNoAppropriateBrushErr = -30568 +}; + + + + + + + +enum { + + + + + + + errMessageNotSupported = -30580, + + + + + + + + errDataNotSupported = -30581, + + + + + + + errControlDoesntSupportFocus = -30582, + + + + + + + + errUnknownControl = -30584, + errCouldntSetFocus = -30585, + errNoRootControl = -30586, + + + + + + errRootAlreadyExists = -30587, + + + + + + errInvalidPartCode = -30588, + errControlsAlreadyExist = -30589, + + + + + + errControlIsNotEmbedder = -30590, + + + + + + + errDataSizeMismatch = -30591, + + + + + + + errControlHiddenOrDisabled = -30592, + + + + + + + errCantEmbedIntoSelf = -30594, + + + + + + + errCantEmbedRoot = -30595, + + + + + + errItemNotControl = -30596, + + + + + + + + controlInvalidDataVersionErr = -30597, + + + + + + controlPropertyInvalid = -5603, + + + + + + + controlPropertyNotFoundErr = -5604, + + + + + controlHandleInvalidErr = -30599 +}; + + + + + +enum { + kURLInvalidURLReferenceError = -30770, + kURLProgressAlreadyDisplayedError = -30771, + kURLDestinationExistsError = -30772, + kURLInvalidURLError = -30773, + kURLUnsupportedSchemeError = -30774, + kURLServerBusyError = -30775, + kURLAuthenticationError = -30776, + kURLPropertyNotYetKnownError = -30777, + kURLUnknownPropertyError = -30778, + kURLPropertyBufferTooSmallError = -30779, + kURLUnsettablePropertyError = -30780, + kURLInvalidCallError = -30781, + kURLFileEmptyError = -30783, + kURLExtensionFailureError = -30785, + kURLInvalidConfigurationError = -30786, + kURLAccessNotAvailableError = -30787, + kURL68kNotSupportedError = -30788 +}; +enum { + errCppGeneral = -32000, + errCppbad_alloc = -32001, + errCppbad_cast = -32002, + errCppbad_exception = -32003, + errCppbad_typeid = -32004, + errCpplogic_error = -32005, + errCppdomain_error = -32006, + errCppinvalid_argument = -32007, + errCpplength_error = -32008, + errCppout_of_range = -32009, + errCppruntime_error = -32010, + errCppoverflow_error = -32011, + errCpprange_error = -32012, + errCppunderflow_error = -32013, + errCppios_base_failure = -32014, + errCppLastSystemDefinedError = -32020, + errCppLastUserDefinedError = -32049 +}; + + +enum { + badComponentInstance = (int)0x80008001, + badComponentSelector = (int)0x80008002 +}; + + + +enum { + dsBusError = 1, + dsAddressErr = 2, + dsIllInstErr = 3, + dsZeroDivErr = 4, + dsChkErr = 5, + dsOvflowErr = 6, + dsPrivErr = 7, + dsTraceErr = 8, + dsLineAErr = 9, + dsLineFErr = 10, + dsMiscErr = 11, + dsCoreErr = 12, + dsIrqErr = 13, + dsIOCoreErr = 14, + dsLoadErr = 15, + dsFPErr = 16, + dsNoPackErr = 17, + dsNoPk1 = 18, + dsNoPk2 = 19 +}; + +enum { + dsNoPk3 = 20, + dsNoPk4 = 21, + dsNoPk5 = 22, + dsNoPk6 = 23, + dsNoPk7 = 24, + dsMemFullErr = 25, + dsBadLaunch = 26, + dsFSErr = 27, + dsStknHeap = 28, + negZcbFreeErr = 33, + dsFinderErr = 41, + dsBadSlotInt = 51, + dsBadSANEOpcode = 81, + dsBadPatchHeader = 83, + menuPrgErr = 84, + dsMBarNFnd = 85, + dsHMenuFindErr = 86, + dsWDEFNotFound = 87, + dsCDEFNotFound = 88, + dsMDEFNotFound = 89 +}; + +enum { + dsNoFPU = 90, + dsNoPatch = 98, + dsBadPatch = 99, + dsParityErr = 101, + dsOldSystem = 102, + ds32BitMode = 103, + dsNeedToWriteBootBlocks = 104, + dsNotEnoughRAMToBoot = 105, + dsBufPtrTooLow = 106, + dsVMDeferredFuncTableFull = 112, + dsVMBadBackingStore = 113, + dsCantHoldSystemHeap = 114, + dsSystemRequiresPowerPC = 116, + dsGibblyMovedToDisabledFolder = 117, + dsUnBootableSystem = 118, + dsMustUseFCBAccessors = 119, + dsMacOSROMVersionTooOld = 120, + dsLostConnectionToNetworkDisk = 121, + dsRAMDiskTooBig = 122, + dsWriteToSupervisorStackGuardPage = 128, + dsReinsert = 30, + shutDownAlert = 42, + dsShutDownOrRestart = 20000, + dsSwitchOffOrRestart = 20001, + dsForcedQuit = 20002, + dsRemoveDisk = 20003, + dsDirtyDisk = 20004, + dsShutDownOrResume = 20109, + dsSCSIWarn = 20010, + dsMBSysError = 29200, + dsMBFlpySysError = 29201, + dsMBATASysError = 29202, + dsMBATAPISysError = 29203, + dsMBExternFlpySysError = 29204, + dsPCCardATASysError = 29205 +}; + + + + + + +enum { + dsNoExtsMacsBug = -1, + dsNoExtsDisassembler = -2, + dsMacsBugInstalled = -10, + dsDisassemblerInstalled = -11, + dsExtensionsDisabled = -13, + dsGreeting = 40, + dsSysErr = 32767, + + WDEFNFnd = dsWDEFNotFound +}; + +enum { + CDEFNFnd = dsCDEFNotFound, + dsNotThe1 = 31, + dsBadStartupDisk = 42, + dsSystemFileErr = 43, + dsHD20Installed = -12, + mBarNFnd = -126, + fsDSIntErr = -127, + hMenuFindErr = -127, + userBreak = -490, + strUserBreak = -491, + exUserBreak = -492 +}; + + +enum { + + dsBadLibrary = 1010, + dsMixedModeFailure = 1011 +}; +enum { + kPOSIXErrorBase = 100000, + kPOSIXErrorEPERM = 100001, + kPOSIXErrorENOENT = 100002, + kPOSIXErrorESRCH = 100003, + kPOSIXErrorEINTR = 100004, + kPOSIXErrorEIO = 100005, + kPOSIXErrorENXIO = 100006, + kPOSIXErrorE2BIG = 100007, + kPOSIXErrorENOEXEC = 100008, + kPOSIXErrorEBADF = 100009, + kPOSIXErrorECHILD = 100010, + kPOSIXErrorEDEADLK = 100011, + kPOSIXErrorENOMEM = 100012, + kPOSIXErrorEACCES = 100013, + kPOSIXErrorEFAULT = 100014, + kPOSIXErrorENOTBLK = 100015, + kPOSIXErrorEBUSY = 100016, + kPOSIXErrorEEXIST = 100017, + kPOSIXErrorEXDEV = 100018, + kPOSIXErrorENODEV = 100019, + kPOSIXErrorENOTDIR = 100020, + kPOSIXErrorEISDIR = 100021, + kPOSIXErrorEINVAL = 100022, + kPOSIXErrorENFILE = 100023, + kPOSIXErrorEMFILE = 100024, + kPOSIXErrorENOTTY = 100025, + kPOSIXErrorETXTBSY = 100026, + kPOSIXErrorEFBIG = 100027, + kPOSIXErrorENOSPC = 100028, + kPOSIXErrorESPIPE = 100029, + kPOSIXErrorEROFS = 100030, + kPOSIXErrorEMLINK = 100031, + kPOSIXErrorEPIPE = 100032, + kPOSIXErrorEDOM = 100033, + kPOSIXErrorERANGE = 100034, + kPOSIXErrorEAGAIN = 100035, + kPOSIXErrorEINPROGRESS = 100036, + kPOSIXErrorEALREADY = 100037, + kPOSIXErrorENOTSOCK = 100038, + kPOSIXErrorEDESTADDRREQ = 100039, + kPOSIXErrorEMSGSIZE = 100040, + kPOSIXErrorEPROTOTYPE = 100041, + kPOSIXErrorENOPROTOOPT = 100042, + kPOSIXErrorEPROTONOSUPPORT = 100043, + kPOSIXErrorESOCKTNOSUPPORT = 100044, + kPOSIXErrorENOTSUP = 100045, + kPOSIXErrorEPFNOSUPPORT = 100046, + kPOSIXErrorEAFNOSUPPORT = 100047, + kPOSIXErrorEADDRINUSE = 100048, + kPOSIXErrorEADDRNOTAVAIL = 100049, + kPOSIXErrorENETDOWN = 100050, + kPOSIXErrorENETUNREACH = 100051, + kPOSIXErrorENETRESET = 100052, + kPOSIXErrorECONNABORTED = 100053, + kPOSIXErrorECONNRESET = 100054, + kPOSIXErrorENOBUFS = 100055, + kPOSIXErrorEISCONN = 100056, + kPOSIXErrorENOTCONN = 100057, + kPOSIXErrorESHUTDOWN = 100058, + kPOSIXErrorETOOMANYREFS = 100059, + kPOSIXErrorETIMEDOUT = 100060, + kPOSIXErrorECONNREFUSED = 100061, + kPOSIXErrorELOOP = 100062, + kPOSIXErrorENAMETOOLONG = 100063, + kPOSIXErrorEHOSTDOWN = 100064, + kPOSIXErrorEHOSTUNREACH = 100065, + kPOSIXErrorENOTEMPTY = 100066, + kPOSIXErrorEPROCLIM = 100067, + kPOSIXErrorEUSERS = 100068, + kPOSIXErrorEDQUOT = 100069, + kPOSIXErrorESTALE = 100070, + kPOSIXErrorEREMOTE = 100071, + kPOSIXErrorEBADRPC = 100072, + kPOSIXErrorERPCMISMATCH = 100073, + kPOSIXErrorEPROGUNAVAIL = 100074, + kPOSIXErrorEPROGMISMATCH = 100075, + kPOSIXErrorEPROCUNAVAIL = 100076, + kPOSIXErrorENOLCK = 100077, + kPOSIXErrorENOSYS = 100078, + kPOSIXErrorEFTYPE = 100079, + kPOSIXErrorEAUTH = 100080, + kPOSIXErrorENEEDAUTH = 100081, + kPOSIXErrorEPWROFF = 100082, + kPOSIXErrorEDEVERR = 100083, + kPOSIXErrorEOVERFLOW = 100084, + kPOSIXErrorEBADEXEC = 100085, + kPOSIXErrorEBADARCH = 100086, + kPOSIXErrorESHLIBVERS = 100087, + kPOSIXErrorEBADMACHO = 100088, + kPOSIXErrorECANCELED = 100089, + kPOSIXErrorEIDRM = 100090, + kPOSIXErrorENOMSG = 100091, + kPOSIXErrorEILSEQ = 100092, + kPOSIXErrorENOATTR = 100093, + kPOSIXErrorEBADMSG = 100094, + kPOSIXErrorEMULTIHOP = 100095, + kPOSIXErrorENODATA = 100096, + kPOSIXErrorENOLINK = 100097, + kPOSIXErrorENOSR = 100098, + kPOSIXErrorENOSTR = 100099, + kPOSIXErrorEPROTO = 100100, + kPOSIXErrorETIME = 100101, + kPOSIXErrorEOPNOTSUPP = 100102 +}; +extern void +SysError(short errorCode) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); + + +enum { + kUTCDefaultOptions = 0 +}; + + +struct UTCDateTime { + UInt16 highSeconds; + UInt32 lowSeconds; + UInt16 fraction; +}; +typedef struct UTCDateTime UTCDateTime; +typedef UTCDateTime * UTCDateTimePtr; +typedef UTCDateTimePtr * UTCDateTimeHandle; +struct LocalDateTime { + UInt16 highSeconds; + UInt32 lowSeconds; + UInt16 fraction; +}; +typedef struct LocalDateTime LocalDateTime; +typedef LocalDateTime * LocalDateTimePtr; +typedef LocalDateTimePtr * LocalDateTimeHandle; + + + +enum { + + + + + kTextFlushDefault = 0, + + + + + kTextCenter = 1, + + + + + kTextFlushRight = -1, + + + + + kTextFlushLeft = -2 +}; + + + +typedef UInt32 TextEncodingBase; +enum { + + kTextEncodingMacRoman = 0, + kTextEncodingMacJapanese = 1, + kTextEncodingMacChineseTrad = 2, + kTextEncodingMacKorean = 3, + kTextEncodingMacArabic = 4, + kTextEncodingMacHebrew = 5, + kTextEncodingMacGreek = 6, + kTextEncodingMacCyrillic = 7, + kTextEncodingMacDevanagari = 9, + kTextEncodingMacGurmukhi = 10, + kTextEncodingMacGujarati = 11, + kTextEncodingMacOriya = 12, + kTextEncodingMacBengali = 13, + kTextEncodingMacTamil = 14, + kTextEncodingMacTelugu = 15, + kTextEncodingMacKannada = 16, + kTextEncodingMacMalayalam = 17, + kTextEncodingMacSinhalese = 18, + kTextEncodingMacBurmese = 19, + kTextEncodingMacKhmer = 20, + kTextEncodingMacThai = 21, + kTextEncodingMacLaotian = 22, + kTextEncodingMacGeorgian = 23, + kTextEncodingMacArmenian = 24, + kTextEncodingMacChineseSimp = 25, + kTextEncodingMacTibetan = 26, + kTextEncodingMacMongolian = 27, + kTextEncodingMacEthiopic = 28, + kTextEncodingMacCentralEurRoman = 29, + kTextEncodingMacVietnamese = 30, + kTextEncodingMacExtArabic = 31, + kTextEncodingMacSymbol = 33, + kTextEncodingMacDingbats = 34, + kTextEncodingMacTurkish = 35, + kTextEncodingMacCroatian = 36, + kTextEncodingMacIcelandic = 37, + kTextEncodingMacRomanian = 38, + kTextEncodingMacCeltic = 39, + kTextEncodingMacGaelic = 40, + kTextEncodingMacKeyboardGlyphs = 41 +}; + + +enum { + kTextEncodingMacTradChinese = kTextEncodingMacChineseTrad, + kTextEncodingMacRSymbol = 8, + kTextEncodingMacSimpChinese = kTextEncodingMacChineseSimp, + kTextEncodingMacGeez = kTextEncodingMacEthiopic, + kTextEncodingMacEastEurRoman = kTextEncodingMacCentralEurRoman, + kTextEncodingMacUninterp = 32 +}; +enum { + kTextEncodingMacUnicode = 0x7E +}; + + +enum { + + kTextEncodingMacFarsi = 0x8C, + + kTextEncodingMacUkrainian = 0x98, + + kTextEncodingMacInuit = 0xEC, + kTextEncodingMacVT100 = 0xFC +}; + + +enum { + kTextEncodingMacHFS = 0xFF +}; + + +enum { + kTextEncodingUnicodeDefault = 0x0100, + kTextEncodingUnicodeV1_1 = 0x0101, + kTextEncodingISO10646_1993 = 0x0101, + kTextEncodingUnicodeV2_0 = 0x0103, + kTextEncodingUnicodeV2_1 = 0x0103, + kTextEncodingUnicodeV3_0 = 0x0104, + kTextEncodingUnicodeV3_1 = 0x0105, + kTextEncodingUnicodeV3_2 = 0x0106, + kTextEncodingUnicodeV4_0 = 0x0108, + kTextEncodingUnicodeV5_0 = 0x010A, + kTextEncodingUnicodeV5_1 = 0x010B, + kTextEncodingUnicodeV6_0 = 0x010D, + kTextEncodingUnicodeV6_1 = 0x010E, + kTextEncodingUnicodeV6_3 = 0x0110, + kTextEncodingUnicodeV7_0 = 0x0111 +}; + + +enum { + kTextEncodingISOLatin1 = 0x0201, + kTextEncodingISOLatin2 = 0x0202, + kTextEncodingISOLatin3 = 0x0203, + kTextEncodingISOLatin4 = 0x0204, + kTextEncodingISOLatinCyrillic = 0x0205, + kTextEncodingISOLatinArabic = 0x0206, + kTextEncodingISOLatinGreek = 0x0207, + kTextEncodingISOLatinHebrew = 0x0208, + kTextEncodingISOLatin5 = 0x0209, + kTextEncodingISOLatin6 = 0x020A, + kTextEncodingISOLatin7 = 0x020D, + kTextEncodingISOLatin8 = 0x020E, + kTextEncodingISOLatin9 = 0x020F, + kTextEncodingISOLatin10 = 0x0210 +}; + + +enum { + kTextEncodingDOSLatinUS = 0x0400, + kTextEncodingDOSGreek = 0x0405, + kTextEncodingDOSBalticRim = 0x0406, + kTextEncodingDOSLatin1 = 0x0410, + kTextEncodingDOSGreek1 = 0x0411, + kTextEncodingDOSLatin2 = 0x0412, + kTextEncodingDOSCyrillic = 0x0413, + kTextEncodingDOSTurkish = 0x0414, + kTextEncodingDOSPortuguese = 0x0415, + kTextEncodingDOSIcelandic = 0x0416, + kTextEncodingDOSHebrew = 0x0417, + kTextEncodingDOSCanadianFrench = 0x0418, + kTextEncodingDOSArabic = 0x0419, + kTextEncodingDOSNordic = 0x041A, + kTextEncodingDOSRussian = 0x041B, + kTextEncodingDOSGreek2 = 0x041C, + kTextEncodingDOSThai = 0x041D, + kTextEncodingDOSJapanese = 0x0420, + kTextEncodingDOSChineseSimplif = 0x0421, + kTextEncodingDOSKorean = 0x0422, + kTextEncodingDOSChineseTrad = 0x0423, + kTextEncodingWindowsLatin1 = 0x0500, + kTextEncodingWindowsANSI = 0x0500, + kTextEncodingWindowsLatin2 = 0x0501, + kTextEncodingWindowsCyrillic = 0x0502, + kTextEncodingWindowsGreek = 0x0503, + kTextEncodingWindowsLatin5 = 0x0504, + kTextEncodingWindowsHebrew = 0x0505, + kTextEncodingWindowsArabic = 0x0506, + kTextEncodingWindowsBalticRim = 0x0507, + kTextEncodingWindowsVietnamese = 0x0508, + kTextEncodingWindowsKoreanJohab = 0x0510 +}; + + +enum { + kTextEncodingUS_ASCII = 0x0600, + kTextEncodingANSEL = 0x0601, + kTextEncodingJIS_X0201_76 = 0x0620, + kTextEncodingJIS_X0208_83 = 0x0621, + kTextEncodingJIS_X0208_90 = 0x0622, + kTextEncodingJIS_X0212_90 = 0x0623, + kTextEncodingJIS_C6226_78 = 0x0624, + kTextEncodingShiftJIS_X0213 = 0x0628, + kTextEncodingJIS_X0213_MenKuTen = 0x0629, + kTextEncodingGB_2312_80 = 0x0630, + kTextEncodingGBK_95 = 0x0631, + kTextEncodingGB_18030_2000 = 0x0632, + kTextEncodingGB_18030_2005 = 0x0632, + kTextEncodingKSC_5601_87 = 0x0640, + kTextEncodingKSC_5601_92_Johab = 0x0641, + kTextEncodingCNS_11643_92_P1 = 0x0651, + kTextEncodingCNS_11643_92_P2 = 0x0652, + kTextEncodingCNS_11643_92_P3 = 0x0653 +}; + + +enum { + kTextEncodingISO_2022_JP = 0x0820, + kTextEncodingISO_2022_JP_2 = 0x0821, + kTextEncodingISO_2022_JP_1 = 0x0822, + kTextEncodingISO_2022_JP_3 = 0x0823, + kTextEncodingISO_2022_CN = 0x0830, + kTextEncodingISO_2022_CN_EXT = 0x0831, + kTextEncodingISO_2022_KR = 0x0840 +}; + + +enum { + kTextEncodingEUC_JP = 0x0920, + kTextEncodingEUC_CN = 0x0930, + kTextEncodingEUC_TW = 0x0931, + kTextEncodingEUC_KR = 0x0940 +}; + + +enum { + kTextEncodingShiftJIS = 0x0A01, + kTextEncodingKOI8_R = 0x0A02, + kTextEncodingBig5 = 0x0A03, + kTextEncodingMacRomanLatin1 = 0x0A04, + kTextEncodingHZ_GB_2312 = 0x0A05, + kTextEncodingBig5_HKSCS_1999 = 0x0A06, + kTextEncodingVISCII = 0x0A07, + kTextEncodingKOI8_U = 0x0A08, + kTextEncodingBig5_E = 0x0A09 +}; + + +enum { + kTextEncodingNextStepLatin = 0x0B01, + kTextEncodingNextStepJapanese = 0x0B02 +}; + + +enum { + kTextEncodingEBCDIC_LatinCore = 0x0C01, + kTextEncodingEBCDIC_CP037 = 0x0C02 +}; + + +enum { + kTextEncodingMultiRun = 0x0FFF, + kTextEncodingUnknown = 0xFFFF +}; + + +enum { + kTextEncodingEBCDIC_US = 0x0C01 +}; + + + +typedef UInt32 TextEncodingVariant; + +enum { + kTextEncodingDefaultVariant = 0 +}; + + +enum { + kMacRomanDefaultVariant = 0, + kMacRomanCurrencySignVariant = 1, + kMacRomanEuroSignVariant = 2 +}; + + +enum { + kMacCyrillicDefaultVariant = 0, + kMacCyrillicCurrSignStdVariant = 1, + kMacCyrillicCurrSignUkrVariant = 2, + kMacCyrillicEuroSignVariant = 3 +}; + + +enum { + kMacIcelandicStdDefaultVariant = 0, + kMacIcelandicTTDefaultVariant = 1, + + kMacIcelandicStdCurrSignVariant = 2, + kMacIcelandicTTCurrSignVariant = 3, + + kMacIcelandicStdEuroSignVariant = 4, + kMacIcelandicTTEuroSignVariant = 5 +}; + + +enum { + kMacCroatianDefaultVariant = 0, + kMacCroatianCurrencySignVariant = 1, + kMacCroatianEuroSignVariant = 2 +}; + + + +enum { + kMacRomanianDefaultVariant = 0, + kMacRomanianCurrencySignVariant = 1, + kMacRomanianEuroSignVariant = 2 +}; + + + +enum { + kMacJapaneseStandardVariant = 0, + kMacJapaneseStdNoVerticalsVariant = 1, + kMacJapaneseBasicVariant = 2, + kMacJapanesePostScriptScrnVariant = 3, + kMacJapanesePostScriptPrintVariant = 4, + kMacJapaneseVertAtKuPlusTenVariant = 5 +}; + + +enum { + kMacArabicStandardVariant = 0, + kMacArabicTrueTypeVariant = 1, + kMacArabicThuluthVariant = 2, + kMacArabicAlBayanVariant = 3 +}; + + +enum { + kMacFarsiStandardVariant = 0, + kMacFarsiTrueTypeVariant = 1 +}; + + +enum { + kMacHebrewStandardVariant = 0, + kMacHebrewFigureSpaceVariant = 1 +}; + + +enum { + kMacGreekDefaultVariant = 0, + kMacGreekNoEuroSignVariant = 1, + kMacGreekEuroSignVariant = 2 +}; + + +enum { + kMacVT100DefaultVariant = 0, + kMacVT100CurrencySignVariant = 1, + kMacVT100EuroSignVariant = 2 +}; + + +enum { + kUnicodeNoSubset = 0, + kUnicodeNormalizationFormD = 5, + kUnicodeNormalizationFormC = 3, + kUnicodeHFSPlusDecompVariant = 8, + kUnicodeHFSPlusCompVariant = 9 +}; + + +enum { + kISOLatin1StandardVariant = 0, + kISOLatin1MusicCDVariant = 1 +}; +enum { + kISOLatinArabicImplicitOrderVariant = 0, + kISOLatinArabicVisualOrderVariant = 1, + kISOLatinArabicExplicitOrderVariant = 2 +}; + +enum { + kISOLatinHebrewImplicitOrderVariant = 0, + kISOLatinHebrewVisualOrderVariant = 1, + kISOLatinHebrewExplicitOrderVariant = 2 +}; + + +enum { + kWindowsLatin1StandardVariant = 0, + kWindowsLatin1PalmVariant = 1 +}; + + +enum { + kDOSJapaneseStandardVariant = 0, + kDOSJapanesePalmVariant = 1 +}; + + + + + + +enum { + kEUC_CN_BasicVariant = 0, + kEUC_CN_DOSVariant = 1 +}; + + + + + + +enum { + kEUC_KR_BasicVariant = 0, + kEUC_KR_DOSVariant = 1 +}; + + + + + + +enum { + kShiftJIS_BasicVariant = 0, + kShiftJIS_DOSVariant = 1, + kShiftJIS_MusicCDVariant = 2 +}; + + + + + + +enum { + kBig5_BasicVariant = 0, + kBig5_StandardVariant = 1, + kBig5_ETenVariant = 2, + kBig5_DOSVariant = 3 +}; + + +enum { + kMacRomanLatin1DefaultVariant = 0, + kMacRomanLatin1StandardVariant = 2, + kMacRomanLatin1TurkishVariant = 6, + kMacRomanLatin1CroatianVariant = 8, + kMacRomanLatin1IcelandicVariant = 11, + kMacRomanLatin1RomanianVariant = 14 +}; + + +enum { + kUnicodeNoCompatibilityVariant = 1, + kUnicodeNoCorporateVariant = 4 +}; + + +enum { + kMacRomanStandardVariant = 0, + kMacIcelandicStandardVariant = 0, + kMacIcelandicTrueTypeVariant = 1, + kJapaneseStandardVariant = 0, + kJapaneseStdNoVerticalsVariant = 1, + kJapaneseBasicVariant = 2, + kJapanesePostScriptScrnVariant = 3, + kJapanesePostScriptPrintVariant = 4, + kJapaneseVertAtKuPlusTenVariant = 5, + kTextEncodingShiftJIS_X0213_00 = 0x0628, + + + kHebrewStandardVariant = 0, + kHebrewFigureSpaceVariant = 1, + + + + + + + kUnicodeCanonicalDecompVariant = 2, + kUnicodeMaxDecomposedVariant = 2, + kUnicodeCanonicalCompVariant = 3, + kUnicodeNoComposedVariant = 3 +}; + + +typedef UInt32 TextEncodingFormat; +enum { + + kTextEncodingDefaultFormat = 0, + kUnicodeUTF16Format = 0, + kUnicodeUTF7Format = 1, + kUnicodeUTF8Format = 2, + kUnicodeUTF32Format = 3, + kUnicodeUTF16BEFormat = 4, + kUnicodeUTF16LEFormat = 5, + kUnicodeUTF32BEFormat = 6, + kUnicodeUTF32LEFormat = 7, + kUnicodeSCSUFormat = 8, + kUnicode16BitFormat = 0, + kUnicode32BitFormat = 3 +}; + + +typedef UInt32 TextEncoding; + +typedef UInt32 TextEncodingNameSelector; +enum { + kTextEncodingFullName = 0, + kTextEncodingBaseName = 1, + kTextEncodingVariantName = 2, + kTextEncodingFormatName = 3 +}; + + +struct TextEncodingRun { + ByteOffset offset; + TextEncoding textEncoding; +}; +typedef struct TextEncodingRun TextEncodingRun; +typedef TextEncodingRun * TextEncodingRunPtr; +typedef const TextEncodingRun * ConstTextEncodingRunPtr; +struct ScriptCodeRun { + ByteOffset offset; + ScriptCode script; +}; +typedef struct ScriptCodeRun ScriptCodeRun; +typedef ScriptCodeRun * ScriptCodeRunPtr; +typedef const ScriptCodeRun * ConstScriptCodeRunPtr; +typedef UInt8 * TextPtr; +typedef const UInt8 * ConstTextPtr; + +typedef UniChar * UniCharArrayPtr; +typedef const UniChar * ConstUniCharArrayPtr; + + + + +typedef UniCharArrayPtr * UniCharArrayHandle; + + + + +typedef unsigned long UniCharArrayOffset; + +enum { + kTextScriptDontCare = -128, + kTextLanguageDontCare = -128, + kTextRegionDontCare = -128 +}; + + + +struct TECInfo { + UInt16 format; + UInt16 tecVersion; + UInt32 tecTextConverterFeatures; + UInt32 tecUnicodeConverterFeatures; + UInt32 tecTextCommonFeatures; + Str31 tecTextEncodingsFolderName; + Str31 tecExtensionFileName; + UInt16 tecLowestTEFileVersion; + UInt16 tecHighestTEFileVersion; +}; +typedef struct TECInfo TECInfo; +typedef TECInfo * TECInfoPtr; +typedef TECInfoPtr * TECInfoHandle; + +enum { + kTECInfoCurrentFormat = 2 +}; +enum { + kTECKeepInfoFixBit = 0, + kTECFallbackTextLengthFixBit = 1, + kTECTextRunBitClearFixBit = 2, + kTECTextToUnicodeScanFixBit = 3, + kTECAddForceASCIIChangesBit = 4, + kTECPreferredEncodingFixBit = 5, + kTECAddTextRunHeuristicsBit = 6, + kTECAddFallbackInterruptBit = 7 +}; + +enum { + kTECKeepInfoFixMask = 1L << kTECKeepInfoFixBit, + kTECFallbackTextLengthFixMask = 1L << kTECFallbackTextLengthFixBit, + kTECTextRunBitClearFixMask = 1L << kTECTextRunBitClearFixBit, + kTECTextToUnicodeScanFixMask = 1L << kTECTextToUnicodeScanFixBit, + kTECAddForceASCIIChangesMask = 1L << kTECAddForceASCIIChangesBit, + kTECPreferredEncodingFixMask = 1L << kTECPreferredEncodingFixBit, + kTECAddTextRunHeuristicsMask = 1L << kTECAddTextRunHeuristicsBit, + kTECAddFallbackInterruptMask = 1L << kTECAddFallbackInterruptBit +}; + + + + + + + +enum { + kUnicodeByteOrderMark = 0xFEFF, + kUnicodeObjectReplacement = 0xFFFC, + kUnicodeReplacementChar = 0xFFFD, + kUnicodeSwappedByteOrderMark = 0xFFFE, + kUnicodeNotAChar = 0xFFFF +}; +typedef SInt32 UCCharPropertyType; +enum { + kUCCharPropTypeGenlCategory = 1, + kUCCharPropTypeCombiningClass = 2, + kUCCharPropTypeBidiCategory = 3, + kUCCharPropTypeDecimalDigitValue = 4 +}; + +typedef UInt32 UCCharPropertyValue; + +enum { + + kUCGenlCatOtherNotAssigned = 0, + kUCGenlCatOtherControl = 1, + kUCGenlCatOtherFormat = 2, + kUCGenlCatOtherSurrogate = 3, + kUCGenlCatOtherPrivateUse = 4, + kUCGenlCatMarkNonSpacing = 5, + kUCGenlCatMarkSpacingCombining = 6, + kUCGenlCatMarkEnclosing = 7, + kUCGenlCatNumberDecimalDigit = 8, + kUCGenlCatNumberLetter = 9, + kUCGenlCatNumberOther = 10, + kUCGenlCatSeparatorSpace = 11, + kUCGenlCatSeparatorLine = 12, + kUCGenlCatSeparatorParagraph = 13, + kUCGenlCatLetterUppercase = 14, + kUCGenlCatLetterLowercase = 15, + kUCGenlCatLetterTitlecase = 16, + + kUCGenlCatLetterModifier = 17, + kUCGenlCatLetterOther = 18, + kUCGenlCatPunctConnector = 20, + kUCGenlCatPunctDash = 21, + kUCGenlCatPunctOpen = 22, + kUCGenlCatPunctClose = 23, + kUCGenlCatPunctInitialQuote = 24, + kUCGenlCatPunctFinalQuote = 25, + kUCGenlCatPunctOther = 26, + kUCGenlCatSymbolMath = 28, + kUCGenlCatSymbolCurrency = 29, + kUCGenlCatSymbolModifier = 30, + kUCGenlCatSymbolOther = 31 +}; + + +enum { + kUCBidiCatNotApplicable = 0, + + kUCBidiCatLeftRight = 1, + kUCBidiCatRightLeft = 2, + + kUCBidiCatEuroNumber = 3, + kUCBidiCatEuroNumberSeparator = 4, + kUCBidiCatEuroNumberTerminator = 5, + kUCBidiCatArabicNumber = 6, + kUCBidiCatCommonNumberSeparator = 7, + + kUCBidiCatBlockSeparator = 8, + kUCBidiCatSegmentSeparator = 9, + + kUCBidiCatWhitespace = 10, + kUCBidiCatOtherNeutral = 11, + + kUCBidiCatRightLeftArabic = 12, + kUCBidiCatLeftRightEmbedding = 13, + kUCBidiCatRightLeftEmbedding = 14, + kUCBidiCatLeftRightOverride = 15, + kUCBidiCatRightLeftOverride = 16, + kUCBidiCatPopDirectionalFormat = 17, + kUCBidiCatNonSpacingMark = 18, + kUCBidiCatBoundaryNeutral = 19, + + kUCBidiCatLeftRightIsolate = 20, + kUCBidiCatRightLeftIsolate = 21, + kUCBidiCatFirstStrongIsolate = 22, + kUCBidiCatPopDirectionalIsolate = 23 +}; +extern TextEncoding +CreateTextEncoding( + TextEncodingBase encodingBase, + TextEncodingVariant encodingVariant, + TextEncodingFormat encodingFormat) __attribute__((availability(macosx,introduced=10.0))); +extern TextEncodingBase +GetTextEncodingBase(TextEncoding encoding) __attribute__((availability(macosx,introduced=10.0))); +extern TextEncodingVariant +GetTextEncodingVariant(TextEncoding encoding) __attribute__((availability(macosx,introduced=10.0))); +extern TextEncodingFormat +GetTextEncodingFormat(TextEncoding encoding) __attribute__((availability(macosx,introduced=10.0))); +extern TextEncoding +ResolveDefaultTextEncoding(TextEncoding encoding) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +GetTextEncodingName( + TextEncoding iEncoding, + TextEncodingNameSelector iNamePartSelector, + RegionCode iPreferredRegion, + TextEncoding iPreferredEncoding, + ByteCount iOutputBufLen, + ByteCount * oNameLength, + RegionCode * oActualRegion, + TextEncoding * oActualEncoding, + TextPtr oEncodingName) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECGetInfo(TECInfoHandle * tecInfo) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +UpgradeScriptInfoToTextEncoding( + ScriptCode iTextScriptID, + LangCode iTextLanguageID, + RegionCode iRegionID, + ConstStr255Param iTextFontname, + TextEncoding * oEncoding) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +RevertTextEncodingToScriptInfo( + TextEncoding iEncoding, + ScriptCode * oTextScriptID, + LangCode * oTextLanguageID, + Str255 oTextFontname) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +GetTextEncodingFromScriptInfo( + ScriptCode iTextScriptID, + LangCode iTextLanguageID, + RegionCode iTextRegionID, + TextEncoding * oEncoding) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +GetScriptInfoFromTextEncoding( + TextEncoding iEncoding, + ScriptCode * oTextScriptID, + LangCode * oTextLanguageID) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +NearestMacTextEncodings( + TextEncoding generalEncoding, + TextEncoding * bestMacEncoding, + TextEncoding * alternateMacEncoding) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +UCGetCharProperty( + const UniChar * charPtr, + UniCharCount textLength, + UCCharPropertyType propType, + UCCharPropertyValue * propValue) __attribute__((availability(macosx,introduced=10.0))); +enum { + kUCHighSurrogateRangeStart = 0xD800, + kUCHighSurrogateRangeEnd = 0xDBFF, + kUCLowSurrogateRangeStart = 0xDC00, + kUCLowSurrogateRangeEnd = 0xDFFF +}; +static __inline__ Boolean UCIsSurrogateHighCharacter( UniChar character ) { + + return ( ( character & 0xFC00 ) == kUCHighSurrogateRangeStart ); +} + + + + + + + +static __inline__ Boolean UCIsSurrogateLowCharacter( UniChar character ) { + + return ( ( character & 0xFC00 ) == kUCLowSurrogateRangeStart ); +} +static __inline__ UnicodeScalarValue UCGetUnicodeScalarValueForSurrogatePair( UniChar surrogateHigh, UniChar surrogateLow ) { + return ( (UnicodeScalarValue)( surrogateHigh - kUCHighSurrogateRangeStart ) << 10 ) + ( surrogateLow - kUCLowSurrogateRangeStart ) + 0x0010000; +} + + + + + + +enum { + kRoutineDescriptorVersion = 7 +}; + + +enum { + _MixedModeMagic = 0xAAFE +}; + + +enum { + kCurrentMixedModeStateRecord = 1 +}; + + +typedef unsigned short CallingConventionType; +enum { + kPascalStackBased = 0, + kCStackBased = 1, + kRegisterBased = 2, + kD0DispatchedPascalStackBased = 8, + kD1DispatchedPascalStackBased = 12, + kD0DispatchedCStackBased = 9, + kStackDispatchedPascalStackBased = 14, + kThinkCStackBased = 5 +}; + + +typedef SInt8 ISAType; +enum { + kM68kISA = 0, + kPowerPCISA = 1 +}; + +enum { + kX86ISA = 2 +}; + + +typedef SInt8 RTAType; +enum { + kOld68kRTA = 0 << 4, + kPowerPCRTA = 0 << 4, + kCFM68kRTA = 1 << 4 +}; + +enum { + kX86RTA = 2 << 4 +}; +enum { + kRegisterD0 = 0, + kRegisterD1 = 1, + kRegisterD2 = 2, + kRegisterD3 = 3, + kRegisterD4 = 8, + kRegisterD5 = 9, + kRegisterD6 = 10, + kRegisterD7 = 11, + kRegisterA0 = 4, + kRegisterA1 = 5, + kRegisterA2 = 6, + kRegisterA3 = 7, + kRegisterA4 = 12, + kRegisterA5 = 13, + kRegisterA6 = 14, + kCCRegisterCBit = 16, + kCCRegisterVBit = 17, + kCCRegisterZBit = 18, + kCCRegisterNBit = 19, + kCCRegisterXBit = 20 +}; + +typedef unsigned short registerSelectorType; + +enum { + kNoByteCode = 0, + kOneByteCode = 1, + kTwoByteCode = 2, + kFourByteCode = 3 +}; + + +typedef unsigned long ProcInfoType; + +typedef unsigned short RoutineFlagsType; +enum { + kProcDescriptorIsAbsolute = 0x00, + kProcDescriptorIsRelative = 0x01 +}; + +enum { + kFragmentIsPrepared = 0x00, + kFragmentNeedsPreparing = 0x02 +}; + +enum { + kUseCurrentISA = 0x00, + kUseNativeISA = 0x04 +}; + +enum { + kPassSelector = 0x00, + kDontPassSelector = 0x08 +}; + +enum { + kRoutineIsNotDispatchedDefaultRoutine = 0x00, + kRoutineIsDispatchedDefaultRoutine = 0x10 +}; + +enum { + kProcDescriptorIsProcPtr = 0x00, + kProcDescriptorIsIndex = 0x20 +}; + +struct RoutineRecord { + ProcInfoType procInfo; + SInt8 reserved1; + ISAType ISA; + RoutineFlagsType routineFlags; + ProcPtr procDescriptor; + UInt32 reserved2; + UInt32 selector; +}; +typedef struct RoutineRecord RoutineRecord; +typedef RoutineRecord * RoutineRecordPtr; +typedef RoutineRecordPtr * RoutineRecordHandle; + + +typedef UInt8 RDFlagsType; +enum { + kSelectorsAreNotIndexable = 0x00, + kSelectorsAreIndexable = 0x01 +}; + + +struct RoutineDescriptor { + UInt16 goMixedModeTrap; + SInt8 version; + RDFlagsType routineDescriptorFlags; + UInt32 reserved1; + UInt8 reserved2; + UInt8 selectorInfo; + UInt16 routineCount; + RoutineRecord routineRecords[1]; +}; +typedef struct RoutineDescriptor RoutineDescriptor; +typedef RoutineDescriptor * RoutineDescriptorPtr; +typedef RoutineDescriptorPtr * RoutineDescriptorHandle; + +struct MixedModeStateRecord { + UInt32 state1; + UInt32 state2; + UInt32 state3; + UInt32 state4; +}; +typedef struct MixedModeStateRecord MixedModeStateRecord; +enum { + + kCallingConventionWidth = 4, + kCallingConventionPhase = 0, + kCallingConventionMask = 0x0F, + kResultSizeWidth = 2, + kResultSizePhase = kCallingConventionWidth, + kResultSizeMask = 0x30, + kStackParameterWidth = 2, + kStackParameterPhase = (kCallingConventionWidth + kResultSizeWidth), + kStackParameterMask = (int)0xFFFFFFC0, + kRegisterResultLocationWidth = 5, + kRegisterResultLocationPhase = (kCallingConventionWidth + kResultSizeWidth), + kRegisterParameterWidth = 5, + kRegisterParameterPhase = (kCallingConventionWidth + kResultSizeWidth + kRegisterResultLocationWidth), + kRegisterParameterMask = 0x7FFFF800, + kRegisterParameterSizePhase = 0, + kRegisterParameterSizeWidth = 2, + kRegisterParameterWhichPhase = kRegisterParameterSizeWidth, + kRegisterParameterWhichWidth = 3, + kDispatchedSelectorSizeWidth = 2, + kDispatchedSelectorSizePhase = (kCallingConventionWidth + kResultSizeWidth), + kDispatchedParameterPhase = (kCallingConventionWidth + kResultSizeWidth + kDispatchedSelectorSizeWidth), + kSpecialCaseSelectorWidth = 6, + kSpecialCaseSelectorPhase = kCallingConventionWidth, + kSpecialCaseSelectorMask = 0x03F0 +}; + +enum { + kSpecialCase = 0x000F +}; + +enum { + + kSpecialCaseHighHook = 0, + kSpecialCaseCaretHook = 0, + kSpecialCaseEOLHook = 1, + kSpecialCaseWidthHook = 2, + kSpecialCaseTextWidthHook = 2, + kSpecialCaseNWidthHook = 3, + kSpecialCaseDrawHook = 4, + kSpecialCaseHitTestHook = 5, + kSpecialCaseTEFindWord = 6, + kSpecialCaseProtocolHandler = 7, + kSpecialCaseSocketListener = 8, + kSpecialCaseTERecalc = 9, + kSpecialCaseTEDoText = 10, + kSpecialCaseGNEFilterProc = 11, + kSpecialCaseMBarHook = 12 +}; +enum { + kCollectionDontWantTag = 0, + kCollectionDontWantId = 0, + kCollectionDontWantSize = 0, + kCollectionDontWantAttributes = 0, + kCollectionDontWantIndex = 0, + kCollectionDontWantData = 0 +}; + + + +enum { + kCollectionNoAttributes = 0x00000000, + kCollectionAllAttributes = (int)0xFFFFFFFF, + kCollectionUserAttributes = 0x0000FFFF, + kCollectionDefaultAttributes = 0x40000000 +}; + + + + + + + +enum { + kCollectionUser0Bit = 0, + kCollectionUser1Bit = 1, + kCollectionUser2Bit = 2, + kCollectionUser3Bit = 3, + kCollectionUser4Bit = 4, + kCollectionUser5Bit = 5, + kCollectionUser6Bit = 6, + kCollectionUser7Bit = 7, + kCollectionUser8Bit = 8, + kCollectionUser9Bit = 9, + kCollectionUser10Bit = 10, + kCollectionUser11Bit = 11, + kCollectionUser12Bit = 12, + kCollectionUser13Bit = 13, + kCollectionUser14Bit = 14, + kCollectionUser15Bit = 15, + kCollectionReserved0Bit = 16, + kCollectionReserved1Bit = 17, + kCollectionReserved2Bit = 18, + kCollectionReserved3Bit = 19, + kCollectionReserved4Bit = 20, + kCollectionReserved5Bit = 21, + kCollectionReserved6Bit = 22, + kCollectionReserved7Bit = 23, + kCollectionReserved8Bit = 24, + kCollectionReserved9Bit = 25, + kCollectionReserved10Bit = 26, + kCollectionReserved11Bit = 27, + kCollectionReserved12Bit = 28, + kCollectionReserved13Bit = 29, + kCollectionPersistenceBit = 30, + kCollectionLockBit = 31 +}; + + + +enum { + kCollectionUser0Mask = 1UL << kCollectionUser0Bit, + kCollectionUser1Mask = 1UL << kCollectionUser1Bit, + kCollectionUser2Mask = 1UL << kCollectionUser2Bit, + kCollectionUser3Mask = 1UL << kCollectionUser3Bit, + kCollectionUser4Mask = 1UL << kCollectionUser4Bit, + kCollectionUser5Mask = 1UL << kCollectionUser5Bit, + kCollectionUser6Mask = 1UL << kCollectionUser6Bit, + kCollectionUser7Mask = 1UL << kCollectionUser7Bit, + kCollectionUser8Mask = 1UL << kCollectionUser8Bit, + kCollectionUser9Mask = 1UL << kCollectionUser9Bit, + kCollectionUser10Mask = 1UL << kCollectionUser10Bit, + kCollectionUser11Mask = 1UL << kCollectionUser11Bit, + kCollectionUser12Mask = 1UL << kCollectionUser12Bit, + kCollectionUser13Mask = 1UL << kCollectionUser13Bit, + kCollectionUser14Mask = 1UL << kCollectionUser14Bit, + kCollectionUser15Mask = 1UL << kCollectionUser15Bit, + kCollectionReserved0Mask = 1UL << kCollectionReserved0Bit, + kCollectionReserved1Mask = 1UL << kCollectionReserved1Bit, + kCollectionReserved2Mask = 1UL << kCollectionReserved2Bit, + kCollectionReserved3Mask = 1UL << kCollectionReserved3Bit, + kCollectionReserved4Mask = 1UL << kCollectionReserved4Bit, + kCollectionReserved5Mask = 1UL << kCollectionReserved5Bit, + kCollectionReserved6Mask = 1UL << kCollectionReserved6Bit, + kCollectionReserved7Mask = 1UL << kCollectionReserved7Bit, + kCollectionReserved8Mask = 1UL << kCollectionReserved8Bit, + kCollectionReserved9Mask = 1UL << kCollectionReserved9Bit, + kCollectionReserved10Mask = 1UL << kCollectionReserved10Bit, + kCollectionReserved11Mask = 1UL << kCollectionReserved11Bit, + kCollectionReserved12Mask = 1UL << kCollectionReserved12Bit, + kCollectionReserved13Mask = 1UL << kCollectionReserved13Bit, + kCollectionPersistenceMask = 1UL << kCollectionPersistenceBit, + kCollectionLockMask = 1UL << kCollectionLockBit +}; + + + + + + +typedef struct OpaqueCollection* Collection; + +typedef FourCharCode CollectionTag; +typedef OSErr ( * CollectionFlattenProcPtr)(SInt32 size, void *data, void *refCon); +typedef OSErr ( * CollectionExceptionProcPtr)(Collection c, OSErr status); +typedef CollectionFlattenProcPtr CollectionFlattenUPP; +typedef CollectionExceptionProcPtr CollectionExceptionUPP; +extern CollectionFlattenUPP +NewCollectionFlattenUPP(CollectionFlattenProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern CollectionExceptionUPP +NewCollectionExceptionUPP(CollectionExceptionProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeCollectionFlattenUPP(CollectionFlattenUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeCollectionExceptionUPP(CollectionExceptionUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +InvokeCollectionFlattenUPP( + SInt32 size, + void * data, + void * refCon, + CollectionFlattenUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +InvokeCollectionExceptionUPP( + Collection c, + OSErr status, + CollectionExceptionUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Collection +NewCollection(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeCollection(Collection c) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Collection +CloneCollection(Collection c) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt32 +CountCollectionOwners(Collection c) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus +RetainCollection(Collection c) __attribute__((availability(macosx,introduced=10.1,deprecated=10.8))); +extern OSStatus +ReleaseCollection(Collection c) __attribute__((availability(macosx,introduced=10.1,deprecated=10.8))); +extern ItemCount +GetCollectionRetainCount(Collection c) __attribute__((availability(macosx,introduced=10.1,deprecated=10.8))); +extern Collection +CopyCollection( + Collection srcCollection, + Collection dstCollection) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt32 +GetCollectionDefaultAttributes(Collection c) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +SetCollectionDefaultAttributes( + Collection c, + SInt32 whichAttributes, + SInt32 newAttributes) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt32 +CountCollectionItems(Collection c) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +AddCollectionItem( + Collection c, + CollectionTag tag, + SInt32 id, + SInt32 itemSize, + const void * itemData) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +GetCollectionItem( + Collection c, + CollectionTag tag, + SInt32 id, + SInt32 * itemSize, + void * itemData) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +RemoveCollectionItem( + Collection c, + CollectionTag tag, + SInt32 id) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +SetCollectionItemInfo( + Collection c, + CollectionTag tag, + SInt32 id, + SInt32 whichAttributes, + SInt32 newAttributes) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +GetCollectionItemInfo( + Collection c, + CollectionTag tag, + SInt32 id, + SInt32 * itemIndex, + SInt32 * itemSize, + SInt32 * attributes) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +ReplaceIndexedCollectionItem( + Collection c, + SInt32 itemIndex, + SInt32 itemSize, + const void * itemData) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +GetIndexedCollectionItem( + Collection c, + SInt32 itemIndex, + SInt32 * itemSize, + void * itemData) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +RemoveIndexedCollectionItem( + Collection c, + SInt32 itemIndex) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +SetIndexedCollectionItemInfo( + Collection c, + SInt32 itemIndex, + SInt32 whichAttributes, + SInt32 newAttributes) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +GetIndexedCollectionItemInfo( + Collection c, + SInt32 itemIndex, + CollectionTag * tag, + SInt32 * id, + SInt32 * itemSize, + SInt32 * attributes) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Boolean +CollectionTagExists( + Collection c, + CollectionTag tag) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt32 +CountCollectionTags(Collection c) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +GetIndexedCollectionTag( + Collection c, + SInt32 tagIndex, + CollectionTag * tag) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt32 +CountTaggedCollectionItems( + Collection c, + CollectionTag tag) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +GetTaggedCollectionItem( + Collection c, + CollectionTag tag, + SInt32 whichItem, + SInt32 * itemSize, + void * itemData) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +GetTaggedCollectionItemInfo( + Collection c, + CollectionTag tag, + SInt32 whichItem, + SInt32 * id, + SInt32 * itemIndex, + SInt32 * itemSize, + SInt32 * attributes) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +PurgeCollection( + Collection c, + SInt32 whichAttributes, + SInt32 matchingAttributes) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +PurgeCollectionTag( + Collection c, + CollectionTag tag) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +EmptyCollection(Collection c) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +FlattenCollection( + Collection c, + CollectionFlattenUPP flattenProc, + void * refCon) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +FlattenPartialCollection( + Collection c, + CollectionFlattenUPP flattenProc, + void * refCon, + SInt32 whichAttributes, + SInt32 matchingAttributes) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +UnflattenCollection( + Collection c, + CollectionFlattenUPP flattenProc, + void * refCon) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern CollectionExceptionUPP +GetCollectionExceptionProc(Collection c) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +SetCollectionExceptionProc( + Collection c, + CollectionExceptionUPP exceptionProc) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Collection +GetNewCollection(SInt16 collectionID) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +AddCollectionItemHdl( + Collection aCollection, + CollectionTag tag, + SInt32 id, + Handle itemData) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +GetCollectionItemHdl( + Collection aCollection, + CollectionTag tag, + SInt32 id, + Handle itemData) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +ReplaceIndexedCollectionItemHdl( + Collection aCollection, + SInt32 itemIndex, + Handle itemData) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +GetIndexedCollectionItemHdl( + Collection aCollection, + SInt32 itemIndex, + Handle itemData) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +FlattenCollectionToHdl( + Collection aCollection, + Handle flattened) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +UnflattenCollectionFromHdl( + Collection aCollection, + Handle flattened) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); + + + +struct BigEndianUInt32 { + UInt32 bigEndianValue; +}; +typedef struct BigEndianUInt32 BigEndianUInt32; +struct BigEndianLong { + long bigEndianValue; +}; +typedef struct BigEndianLong BigEndianLong; +struct BigEndianUnsignedLong { + unsigned long bigEndianValue; +}; +typedef struct BigEndianUnsignedLong BigEndianUnsignedLong; +struct BigEndianShort { + short bigEndianValue; +}; +typedef struct BigEndianShort BigEndianShort; +struct BigEndianUnsignedShort { + unsigned short bigEndianValue; +}; +typedef struct BigEndianUnsignedShort BigEndianUnsignedShort; +struct BigEndianFixed { + Fixed bigEndianValue; +}; +typedef struct BigEndianFixed BigEndianFixed; +struct BigEndianUnsignedFixed { + UnsignedFixed bigEndianValue; +}; +typedef struct BigEndianUnsignedFixed BigEndianUnsignedFixed; +struct BigEndianOSType { + OSType bigEndianValue; +}; +typedef struct BigEndianOSType BigEndianOSType; +enum { + kCoreEndianResourceManagerDomain = 'rsrc', + kCoreEndianAppleEventManagerDomain = 'aevt' +}; +typedef OSStatus ( * CoreEndianFlipProc)(OSType dataDomain, OSType dataType, SInt16 id, void *dataPtr, ByteCount dataSize, Boolean currentlyNative, void *refcon); +extern OSStatus +CoreEndianInstallFlipper( + OSType dataDomain, + OSType dataType, + CoreEndianFlipProc proc, + void * refcon) __attribute__((availability(macosx,introduced=10.3,deprecated=10.8))); +extern OSStatus +CoreEndianGetFlipper( + OSType dataDomain, + OSType dataType, + CoreEndianFlipProc * proc, + void ** refcon) __attribute__((availability(macosx,introduced=10.3,deprecated=10.8))); +extern OSStatus +CoreEndianFlipData( + OSType dataDomain, + OSType dataType, + SInt16 id, + void * data, + ByteCount dataLen, + Boolean currentlyNative) __attribute__((availability(macosx,introduced=10.3,deprecated=10.8))); + + + + + + + + +typedef OSErr ( * SelectorFunctionProcPtr)(OSType selector, SInt32 *response); +typedef SelectorFunctionProcPtr SelectorFunctionUPP; +extern OSErr +Gestalt( + OSType selector, + SInt32 * response) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +NewGestaltValue( + OSType selector, + SInt32 newValue) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +ReplaceGestaltValue( + OSType selector, + SInt32 replacementValue) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +SetGestaltValue( + OSType selector, + SInt32 newValue) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +DeleteGestaltValue(OSType selector) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SelectorFunctionUPP +NewSelectorFunctionUPP(SelectorFunctionProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeSelectorFunctionUPP(SelectorFunctionUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +InvokeSelectorFunctionUPP( + OSType selector, + SInt32 * response, + SelectorFunctionUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +enum { + gestaltAddressingModeAttr = 'addr', + gestalt32BitAddressing = 0, + gestalt32BitSysZone = 1, + gestalt32BitCapable = 2 +}; + +enum { + gestaltAFPClient = 'afps', + gestaltAFPClientVersionMask = 0x0000FFFF, + + gestaltAFPClient3_5 = 0x0001, + gestaltAFPClient3_6 = 0x0002, + gestaltAFPClient3_6_1 = 0x0003, + gestaltAFPClient3_6_2 = 0x0004, + gestaltAFPClient3_6_3 = 0x0005, + gestaltAFPClient3_7 = 0x0006, + gestaltAFPClient3_7_2 = 0x0007, + gestaltAFPClient3_8 = 0x0008, + gestaltAFPClient3_8_1 = 0x0009, + gestaltAFPClient3_8_3 = 0x000A, + gestaltAFPClient3_8_4 = 0x000B, + gestaltAFPClientAttributeMask = (int)0xFFFF0000, + + gestaltAFPClientCfgRsrc = 16, + gestaltAFPClientSupportsIP = 29, + gestaltAFPClientVMUI = 30, + gestaltAFPClientMultiReq = 31 +}; + + +enum { + gestaltAliasMgrAttr = 'alis', + gestaltAliasMgrPresent = 0, + gestaltAliasMgrSupportsRemoteAppletalk = 1, + gestaltAliasMgrSupportsAOCEKeychain = 2, + gestaltAliasMgrResolveAliasFileWithMountOptions = 3, + gestaltAliasMgrFollowsAliasesWhenResolving = 4, + gestaltAliasMgrSupportsExtendedCalls = 5, + gestaltAliasMgrSupportsFSCalls = 6, + gestaltAliasMgrPrefersPath = 7, + gestaltAliasMgrRequiresAccessors = 8 +}; + + +enum { + gestaltAppearanceAttr = 'appr', + gestaltAppearanceExists = 0, + gestaltAppearanceCompatMode = 1 +}; + + + + + + + +enum { + gestaltAppearanceVersion = 'apvr' +}; + +enum { + gestaltArbitorAttr = 'arb ', + gestaltSerialArbitrationExists = 0 +}; + +enum { + gestaltAppleScriptVersion = 'ascv' +}; + +enum { + gestaltAppleScriptAttr = 'ascr', + gestaltAppleScriptPresent = 0, + gestaltAppleScriptPowerPCSupport = 1 +}; + +enum { + gestaltATAAttr = 'ata ', + gestaltATAPresent = 0 +}; + +enum { + gestaltATalkVersion = 'atkv' +}; + +enum { + gestaltAppleTalkVersion = 'atlk' +}; +enum { + gestaltAUXVersion = 'a/ux' +}; + +enum { + gestaltMacOSCompatibilityBoxAttr = 'bbox', + gestaltMacOSCompatibilityBoxPresent = 0, + gestaltMacOSCompatibilityBoxHasSerial = 1, + gestaltMacOSCompatibilityBoxless = 2 +}; + +enum { + gestaltBusClkSpeed = 'bclk' +}; + +enum { + gestaltBusClkSpeedMHz = 'bclm' +}; + +enum { + gestaltCloseViewAttr = 'BSDa', + gestaltCloseViewEnabled = 0, + gestaltCloseViewDisplayMgrFriendly = 1 +}; + +enum { + gestaltCarbonVersion = 'cbon' +}; + +enum { + gestaltCFMAttr = 'cfrg', + gestaltCFMPresent = 0, + gestaltCFMPresentMask = 0x0001, + gestaltCFM99Present = 2, + gestaltCFM99PresentMask = 0x0004 +}; + +enum { + gestaltProcessorCacheLineSize = 'csiz' +}; + +enum { + gestaltCollectionMgrVersion = 'cltn' +}; + +enum { + gestaltColorMatchingAttr = 'cmta', + gestaltHighLevelMatching = 0, + gestaltColorMatchingLibLoaded = 1 +}; + +enum { + gestaltColorMatchingVersion = 'cmtc', + gestaltColorSync10 = 0x0100, + gestaltColorSync11 = 0x0110, + gestaltColorSync104 = 0x0104, + gestaltColorSync105 = 0x0105, + gestaltColorSync20 = 0x0200, + gestaltColorSync21 = 0x0210, + gestaltColorSync211 = 0x0211, + gestaltColorSync212 = 0x0212, + gestaltColorSync213 = 0x0213, + gestaltColorSync25 = 0x0250, + gestaltColorSync26 = 0x0260, + gestaltColorSync261 = 0x0261, + gestaltColorSync30 = 0x0300 +}; + +enum { + gestaltControlMgrVersion = 'cmvr' +}; + +enum { + gestaltControlMgrAttr = 'cntl', + gestaltControlMgrPresent = (1L << 0), + + + gestaltControlMgrPresentBit = 0, + gestaltControlMsgPresentMask = (1L << gestaltControlMgrPresentBit) +}; + +enum { + gestaltConnMgrAttr = 'conn', + gestaltConnMgrPresent = 0, + gestaltConnMgrCMSearchFix = 1, + gestaltConnMgrErrorString = 2, + gestaltConnMgrMultiAsyncIO = 3 +}; + +enum { + gestaltColorPickerVersion = 'cpkr', + gestaltColorPicker = 'cpkr' +}; + +enum { + gestaltComponentMgr = 'cpnt', + gestaltComponentPlatform = 'copl' +}; +enum { + gestaltNativeCPUtype = 'cput', + gestaltNativeCPUfamily = 'cpuf', + gestaltCPU68000 = 0, + gestaltCPU68010 = 1, + gestaltCPU68020 = 2, + gestaltCPU68030 = 3, + gestaltCPU68040 = 4, + gestaltCPU601 = 0x0101, + gestaltCPU603 = 0x0103, + gestaltCPU604 = 0x0104, + gestaltCPU603e = 0x0106, + gestaltCPU603ev = 0x0107, + gestaltCPU750 = 0x0108, + gestaltCPU604e = 0x0109, + gestaltCPU604ev = 0x010A, + gestaltCPUG4 = 0x010C, + gestaltCPUG47450 = 0x0110 +}; + +enum { + gestaltCPUApollo = 0x0111, + gestaltCPUG47447 = 0x0112, + gestaltCPU750FX = 0x0120, + gestaltCPU970 = 0x0139, + gestaltCPU970FX = 0x013C, + gestaltCPU970MP = 0x0144 +}; + +enum { + + gestaltCPU486 = 'i486', + gestaltCPUPentium = 'i586', + gestaltCPUPentiumPro = 'i5pr', + gestaltCPUPentiumII = 'i5ii', + gestaltCPUX86 = 'ixxx', + gestaltCPUPentium4 = 'i5iv' +}; + +enum { + gestaltCRMAttr = 'crm ', + gestaltCRMPresent = 0, + gestaltCRMPersistentFix = 1, + gestaltCRMToolRsrcCalls = 2 +}; + +enum { + gestaltControlStripVersion = 'csvr' +}; + +enum { + gestaltCountOfCPUs = 'cpus' +}; + +enum { + gestaltCTBVersion = 'ctbv' +}; + +enum { + gestaltDBAccessMgrAttr = 'dbac', + gestaltDBAccessMgrPresent = 0 +}; + +enum { + gestaltDiskCacheSize = 'dcsz' +}; + +enum { + gestaltSDPFindVersion = 'dfnd' +}; + +enum { + gestaltDictionaryMgrAttr = 'dict', + gestaltDictionaryMgrPresent = 0 +}; + +enum { + gestaltDITLExtAttr = 'ditl', + gestaltDITLExtPresent = 0, + gestaltDITLExtSupportsIctb = 1 +}; + +enum { + gestaltDialogMgrAttr = 'dlog', + gestaltDialogMgrPresent = (1L << 0), + + + gestaltDialogMgrPresentBit = 0, + gestaltDialogMgrHasAquaAlertBit = 2, + gestaltDialogMgrPresentMask = (1L << gestaltDialogMgrPresentBit), + gestaltDialogMgrHasAquaAlertMask = (1L << gestaltDialogMgrHasAquaAlertBit), + gestaltDialogMsgPresentMask = gestaltDialogMgrPresentMask +}; + +enum { + gestaltDesktopPicturesAttr = 'dkpx', + gestaltDesktopPicturesInstalled = 0, + gestaltDesktopPicturesDisplayed = 1 +}; + +enum { + gestaltDisplayMgrVers = 'dplv' +}; + +enum { + gestaltDisplayMgrAttr = 'dply', + gestaltDisplayMgrPresent = 0, + gestaltDisplayMgrCanSwitchMirrored = 2, + gestaltDisplayMgrSetDepthNotifies = 3, + gestaltDisplayMgrCanConfirm = 4, + gestaltDisplayMgrColorSyncAware = 5, + gestaltDisplayMgrGeneratesProfiles = 6, + gestaltDisplayMgrSleepNotifies = 7 +}; + +enum { + gestaltDragMgrAttr = 'drag', + gestaltDragMgrPresent = 0, + gestaltDragMgrFloatingWind = 1, + gestaltPPCDragLibPresent = 2, + gestaltDragMgrHasImageSupport = 3, + gestaltCanStartDragInFloatWindow = 4, + gestaltSetDragImageUpdates = 5 +}; + +enum { + gestaltDrawSprocketVersion = 'dspv' +}; + +enum { + gestaltDigitalSignatureVersion = 'dsig' +}; + + + + + +enum { + gestaltDTPFeatures = 'dtpf', + kDTPThirdPartySupported = 0x00000004 +}; + + + + + + +enum { + gestaltDTPInfo = 'dtpx' +}; + +enum { + gestaltEasyAccessAttr = 'easy', + gestaltEasyAccessOff = 0, + gestaltEasyAccessOn = 1, + gestaltEasyAccessSticky = 2, + gestaltEasyAccessLocked = 3 +}; + +enum { + gestaltEditionMgrAttr = 'edtn', + gestaltEditionMgrPresent = 0, + gestaltEditionMgrTranslationAware = 1 +}; + +enum { + gestaltAppleEventsAttr = 'evnt', + gestaltAppleEventsPresent = 0, + gestaltScriptingSupport = 1, + gestaltOSLInSystem = 2, + gestaltSupportsApplicationURL = 4 +}; + +enum { + gestaltExtensionTableVersion = 'etbl' +}; + + +enum { + gestaltFBCIndexingState = 'fbci', + gestaltFBCindexingSafe = 0, + gestaltFBCindexingCritical = 1 +}; + +enum { + gestaltFBCVersion = 'fbcv', + gestaltFBCCurrentVersion = 0x0011, + gestaltOSXFBCCurrentVersion = 0x0100 +}; + + +enum { + gestaltFileMappingAttr = 'flmp', + gestaltFileMappingPresent = 0, + gestaltFileMappingMultipleFilesFix = 1 +}; + +enum { + gestaltFloppyAttr = 'flpy', + gestaltFloppyIsMFMOnly = 0, + gestaltFloppyIsManualEject = 1, + gestaltFloppyUsesDiskInPlace = 2 +}; + +enum { + gestaltFinderAttr = 'fndr', + gestaltFinderDropEvent = 0, + gestaltFinderMagicPlacement = 1, + gestaltFinderCallsAEProcess = 2, + gestaltOSLCompliantFinder = 3, + gestaltFinderSupports4GBVolumes = 4, + gestaltFinderHasClippings = 6, + gestaltFinderFullDragManagerSupport = 7, + gestaltFinderFloppyRootComments = 8, + gestaltFinderLargeAndNotSavedFlavorsOK = 9, + gestaltFinderUsesExtensibleFolderManager = 10, + gestaltFinderUnderstandsRedirectedDesktopFolder = 11 +}; + +enum { + gestaltFindFolderAttr = 'fold', + gestaltFindFolderPresent = 0, + gestaltFolderDescSupport = 1, + gestaltFolderMgrFollowsAliasesWhenResolving = 2, + gestaltFolderMgrSupportsExtendedCalls = 3, + gestaltFolderMgrSupportsDomains = 4, + gestaltFolderMgrSupportsFSCalls = 5 +}; + +enum { + gestaltFindFolderRedirectionAttr = 'fole' +}; + + +enum { + gestaltFontMgrAttr = 'font', + gestaltOutlineFonts = 0 +}; + +enum { + gestaltFPUType = 'fpu ', + gestaltNoFPU = 0, + gestalt68881 = 1, + gestalt68882 = 2, + gestalt68040FPU = 3 +}; + +enum { + gestaltFSAttr = 'fs ', + gestaltFullExtFSDispatching = 0, + gestaltHasFSSpecCalls = 1, + gestaltHasFileSystemManager = 2, + gestaltFSMDoesDynamicLoad = 3, + gestaltFSSupports4GBVols = 4, + gestaltFSSupports2TBVols = 5, + gestaltHasExtendedDiskInit = 6, + gestaltDTMgrSupportsFSM = 7, + gestaltFSNoMFSVols = 8, + gestaltFSSupportsHFSPlusVols = 9, + gestaltFSIncompatibleDFA82 = 10 +}; + +enum { + gestaltFSSupportsDirectIO = 11 +}; + +enum { + gestaltHasHFSPlusAPIs = 12, + gestaltMustUseFCBAccessors = 13, + gestaltFSUsesPOSIXPathsForConversion = 14, + gestaltFSSupportsExclusiveLocks = 15, + gestaltFSSupportsHardLinkDetection = 16, + gestaltFSAllowsConcurrentAsyncIO = 17 +}; + +enum { + gestaltAdminFeaturesFlagsAttr = 'fred', + gestaltFinderUsesSpecialOpenFoldersFile = 0 +}; + +enum { + gestaltFSMVersion = 'fsm ' +}; + +enum { + gestaltFXfrMgrAttr = 'fxfr', + gestaltFXfrMgrPresent = 0, + gestaltFXfrMgrMultiFile = 1, + gestaltFXfrMgrErrorString = 2, + gestaltFXfrMgrAsync = 3 +}; + +enum { + gestaltGraphicsAttr = 'gfxa', + gestaltGraphicsIsDebugging = 0x00000001, + gestaltGraphicsIsLoaded = 0x00000002, + gestaltGraphicsIsPowerPC = 0x00000004 +}; + +enum { + gestaltGraphicsVersion = 'grfx', + gestaltCurrentGraphicsVersion = 0x00010200 +}; + +enum { + gestaltHardwareAttr = 'hdwr', + gestaltHasVIA1 = 0, + gestaltHasVIA2 = 1, + gestaltHasASC = 3, + gestaltHasSCC = 4, + gestaltHasSCSI = 7, + gestaltHasSoftPowerOff = 19, + gestaltHasSCSI961 = 21, + gestaltHasSCSI962 = 22, + gestaltHasUniversalROM = 24, + gestaltHasEnhancedLtalk = 30 +}; + +enum { + gestaltHelpMgrAttr = 'help', + gestaltHelpMgrPresent = 0, + gestaltHelpMgrExtensions = 1, + gestaltAppleGuideIsDebug = 30, + gestaltAppleGuidePresent = 31 +}; + +enum { + gestaltHardwareVendorCode = 'hrad', + gestaltHardwareVendorApple = 'Appl' +}; + +enum { + gestaltCompressionMgr = 'icmp' +}; + +enum { + gestaltIconUtilitiesAttr = 'icon', + gestaltIconUtilitiesPresent = 0, + gestaltIconUtilitiesHas48PixelIcons = 1, + gestaltIconUtilitiesHas32BitIcons = 2, + gestaltIconUtilitiesHas8BitDeepMasks = 3, + gestaltIconUtilitiesHasIconServices = 4 +}; + +enum { + gestaltInternalDisplay = 'idsp' +}; + + + + + +enum { + gestaltKeyboardType = 'kbd ', + gestaltMacKbd = 1, + gestaltMacAndPad = 2, + gestaltMacPlusKbd = 3, + gestaltUnknownThirdPartyKbd = 3, + gestaltExtADBKbd = 4, + gestaltStdADBKbd = 5, + gestaltPrtblADBKbd = 6, + gestaltPrtblISOKbd = 7, + gestaltStdISOADBKbd = 8, + gestaltExtISOADBKbd = 9, + gestaltADBKbdII = 10, + gestaltADBISOKbdII = 11, + gestaltPwrBookADBKbd = 12, + gestaltPwrBookISOADBKbd = 13, + gestaltAppleAdjustKeypad = 14, + gestaltAppleAdjustADBKbd = 15, + gestaltAppleAdjustISOKbd = 16, + gestaltJapanAdjustADBKbd = 17, + gestaltPwrBkExtISOKbd = 20, + gestaltPwrBkExtJISKbd = 21, + gestaltPwrBkExtADBKbd = 24, + gestaltPS2Keyboard = 27, + gestaltPwrBkSubDomKbd = 28, + gestaltPwrBkSubISOKbd = 29, + gestaltPwrBkSubJISKbd = 30, + gestaltPortableUSBANSIKbd = 37, + gestaltPortableUSBISOKbd = 38, + gestaltPortableUSBJISKbd = 39, + gestaltThirdPartyANSIKbd = 40, + gestaltThirdPartyISOKbd = 41, + gestaltThirdPartyJISKbd = 42, + gestaltPwrBkEKDomKbd = 195, + gestaltPwrBkEKISOKbd = 196, + gestaltPwrBkEKJISKbd = 197, + gestaltUSBCosmoANSIKbd = 198, + gestaltUSBCosmoISOKbd = 199, + gestaltUSBCosmoJISKbd = 200, + gestaltPwrBk99JISKbd = 201, + gestaltUSBAndyANSIKbd = 204, + gestaltUSBAndyISOKbd = 205, + gestaltUSBAndyJISKbd = 206 +}; + + +enum { + gestaltPortable2001ANSIKbd = 202, + gestaltPortable2001ISOKbd = 203, + gestaltPortable2001JISKbd = 207 +}; + +enum { + gestaltUSBProF16ANSIKbd = 34, + gestaltUSBProF16ISOKbd = 35, + gestaltUSBProF16JISKbd = 36, + gestaltProF16ANSIKbd = 31, + gestaltProF16ISOKbd = 32, + gestaltProF16JISKbd = 33 +}; + + + + + +enum { + gestaltUDFSupport = 'kudf' +}; + +enum { + gestaltLowMemorySize = 'lmem' +}; + +enum { + gestaltLogicalRAMSize = 'lram' +}; +enum { + gestaltMachineType = 'mach', + gestaltClassic = 1, + gestaltMacXL = 2, + gestaltMac512KE = 3, + gestaltMacPlus = 4, + gestaltMacSE = 5, + gestaltMacII = 6, + gestaltMacIIx = 7, + gestaltMacIIcx = 8, + gestaltMacSE030 = 9, + gestaltPortable = 10, + gestaltMacIIci = 11, + gestaltPowerMac8100_120 = 12, + gestaltMacIIfx = 13, + gestaltMacClassic = 17, + gestaltMacIIsi = 18, + gestaltMacLC = 19, + gestaltMacQuadra900 = 20, + gestaltPowerBook170 = 21, + gestaltMacQuadra700 = 22, + gestaltClassicII = 23, + gestaltPowerBook100 = 24, + gestaltPowerBook140 = 25, + gestaltMacQuadra950 = 26, + gestaltMacLCIII = 27, + gestaltPerforma450 = gestaltMacLCIII, + gestaltPowerBookDuo210 = 29, + gestaltMacCentris650 = 30, + gestaltPowerBookDuo230 = 32, + gestaltPowerBook180 = 33, + gestaltPowerBook160 = 34, + gestaltMacQuadra800 = 35, + gestaltMacQuadra650 = 36, + gestaltMacLCII = 37, + gestaltPowerBookDuo250 = 38, + gestaltAWS9150_80 = 39, + gestaltPowerMac8100_110 = 40, + gestaltAWS8150_110 = gestaltPowerMac8100_110, + gestaltPowerMac5200 = 41, + gestaltPowerMac5260 = gestaltPowerMac5200, + gestaltPerforma5300 = gestaltPowerMac5200, + gestaltPowerMac6200 = 42, + gestaltPerforma6300 = gestaltPowerMac6200, + gestaltMacIIvi = 44, + gestaltMacIIvm = 45, + gestaltPerforma600 = gestaltMacIIvm, + gestaltPowerMac7100_80 = 47, + gestaltMacIIvx = 48, + gestaltMacColorClassic = 49, + gestaltPerforma250 = gestaltMacColorClassic, + gestaltPowerBook165c = 50, + gestaltMacCentris610 = 52, + gestaltMacQuadra610 = 53, + gestaltPowerBook145 = 54, + gestaltPowerMac8100_100 = 55, + gestaltMacLC520 = 56, + gestaltAWS9150_120 = 57, + gestaltPowerMac6400 = 58, + gestaltPerforma6400 = gestaltPowerMac6400, + gestaltPerforma6360 = gestaltPerforma6400, + gestaltMacCentris660AV = 60, + gestaltMacQuadra660AV = gestaltMacCentris660AV, + gestaltPerforma46x = 62, + gestaltPowerMac8100_80 = 65, + gestaltAWS8150_80 = gestaltPowerMac8100_80, + gestaltPowerMac9500 = 67, + gestaltPowerMac9600 = gestaltPowerMac9500, + gestaltPowerMac7500 = 68, + gestaltPowerMac7600 = gestaltPowerMac7500, + gestaltPowerMac8500 = 69, + gestaltPowerMac8600 = gestaltPowerMac8500, + gestaltAWS8550 = gestaltPowerMac7500, + gestaltPowerBook180c = 71, + gestaltPowerBook520 = 72, + gestaltPowerBook520c = gestaltPowerBook520, + gestaltPowerBook540 = gestaltPowerBook520, + gestaltPowerBook540c = gestaltPowerBook520, + gestaltPowerMac5400 = 74, + gestaltPowerMac6100_60 = 75, + gestaltAWS6150_60 = gestaltPowerMac6100_60, + gestaltPowerBookDuo270c = 77, + gestaltMacQuadra840AV = 78, + gestaltPerforma550 = 80, + gestaltPowerBook165 = 84, + gestaltPowerBook190 = 85, + gestaltMacTV = 88, + gestaltMacLC475 = 89, + gestaltPerforma47x = gestaltMacLC475, + gestaltMacLC575 = 92, + gestaltMacQuadra605 = 94, + gestaltMacQuadra630 = 98, + gestaltMacLC580 = 99, + gestaltPerforma580 = gestaltMacLC580, + gestaltPowerMac6100_66 = 100, + gestaltAWS6150_66 = gestaltPowerMac6100_66, + gestaltPowerBookDuo280 = 102, + gestaltPowerBookDuo280c = 103, + gestaltPowerMacLC475 = 104, + gestaltPowerMacPerforma47x = gestaltPowerMacLC475, + gestaltPowerMacLC575 = 105, + gestaltPowerMacPerforma57x = gestaltPowerMacLC575, + gestaltPowerMacQuadra630 = 106, + gestaltPowerMacLC630 = gestaltPowerMacQuadra630, + gestaltPowerMacPerforma63x = gestaltPowerMacQuadra630, + gestaltPowerMac7200 = 108, + gestaltPowerMac7300 = 109, + gestaltPowerMac7100_66 = 112, + gestaltPowerBook150 = 115, + gestaltPowerMacQuadra700 = 116, + gestaltPowerMacQuadra900 = 117, + gestaltPowerMacQuadra950 = 118, + gestaltPowerMacCentris610 = 119, + gestaltPowerMacCentris650 = 120, + gestaltPowerMacQuadra610 = 121, + gestaltPowerMacQuadra650 = 122, + gestaltPowerMacQuadra800 = 123, + gestaltPowerBookDuo2300 = 124, + gestaltPowerBook500PPCUpgrade = 126, + gestaltPowerBook5300 = 128, + gestaltPowerBook1400 = 310, + gestaltPowerBook3400 = 306, + gestaltPowerBook2400 = 307, + gestaltPowerBookG3Series = 312, + gestaltPowerBookG3 = 313, + gestaltPowerBookG3Series2 = 314, + gestaltPowerMacNewWorld = 406, + gestaltPowerMacG3 = 510, + gestaltPowerMac5500 = 512, + gestalt20thAnniversary = gestaltPowerMac5500, + gestaltPowerMac6500 = 513, + gestaltPowerMac4400_160 = 514, + gestaltPowerMac4400 = 515, + gestaltMacOSCompatibility = 1206 +}; + + +enum { + gestaltQuadra605 = gestaltMacQuadra605, + gestaltQuadra610 = gestaltMacQuadra610, + gestaltQuadra630 = gestaltMacQuadra630, + gestaltQuadra650 = gestaltMacQuadra650, + gestaltQuadra660AV = gestaltMacQuadra660AV, + gestaltQuadra700 = gestaltMacQuadra700, + gestaltQuadra800 = gestaltMacQuadra800, + gestaltQuadra840AV = gestaltMacQuadra840AV, + gestaltQuadra900 = gestaltMacQuadra900, + gestaltQuadra950 = gestaltMacQuadra950 +}; + +enum { + kMachineNameStrID = -16395 +}; + +enum { + gestaltSMPMailerVersion = 'malr' +}; + +enum { + gestaltMediaBay = 'mbeh', + gestaltMBLegacy = 0, + gestaltMBSingleBay = 1, + gestaltMBMultipleBays = 2 +}; + +enum { + gestaltMessageMgrVersion = 'mess' +}; + + + +enum { + gestaltMenuMgrAttr = 'menu', + gestaltMenuMgrPresent = (1L << 0), + + + gestaltMenuMgrPresentBit = 0, + gestaltMenuMgrAquaLayoutBit = 1, + gestaltMenuMgrMultipleItemsWithCommandIDBit = 2, + gestaltMenuMgrRetainsIconRefBit = 3, + gestaltMenuMgrSendsMenuBoundsToDefProcBit = 4, + gestaltMenuMgrMoreThanFiveMenusDeepBit = 5, + gestaltMenuMgrCGImageMenuTitleBit = 6, + + gestaltMenuMgrPresentMask = (1L << gestaltMenuMgrPresentBit), + gestaltMenuMgrAquaLayoutMask = (1L << gestaltMenuMgrAquaLayoutBit), + gestaltMenuMgrMultipleItemsWithCommandIDMask = (1L << gestaltMenuMgrMultipleItemsWithCommandIDBit), + gestaltMenuMgrRetainsIconRefMask = (1L << gestaltMenuMgrRetainsIconRefBit), + gestaltMenuMgrSendsMenuBoundsToDefProcMask = (1L << gestaltMenuMgrSendsMenuBoundsToDefProcBit), + gestaltMenuMgrMoreThanFiveMenusDeepMask = (1L << gestaltMenuMgrMoreThanFiveMenusDeepBit), + gestaltMenuMgrCGImageMenuTitleMask = (1L << gestaltMenuMgrCGImageMenuTitleBit) +}; + + +enum { + gestaltMultipleUsersState = 'mfdr' +}; + + +enum { + gestaltMachineIcon = 'micn' +}; + +enum { + gestaltMiscAttr = 'misc', + gestaltScrollingThrottle = 0, + gestaltSquareMenuBar = 2 +}; +enum { + gestaltMixedModeVersion = 'mixd' +}; + +enum { + gestaltMixedModeAttr = 'mixd', + gestaltMixedModePowerPC = 0, + gestaltPowerPCAware = 0, + gestaltMixedModeCFM68K = 1, + gestaltMixedModeCFM68KHasTrap = 2, + gestaltMixedModeCFM68KHasState = 3 +}; + +enum { + gestaltQuickTimeConferencing = 'mtlk' +}; + +enum { + gestaltMemoryMapAttr = 'mmap', + gestaltMemoryMapSparse = 0 +}; + +enum { + gestaltMMUType = 'mmu ', + gestaltNoMMU = 0, + gestaltAMU = 1, + gestalt68851 = 2, + gestalt68030MMU = 3, + gestalt68040MMU = 4, + gestaltEMMU1 = 5 +}; + +enum { + + + + gestaltUserVisibleMachineName = 'mnam' +}; + +enum { + gestaltMPCallableAPIsAttr = 'mpsc', + gestaltMPFileManager = 0, + gestaltMPDeviceManager = 1, + gestaltMPTrapCalls = 2 +}; + +enum { + gestaltStdNBPAttr = 'nlup', + gestaltStdNBPPresent = 0, + gestaltStdNBPSupportsAutoPosition = 1 +}; + +enum { + gestaltNotificationMgrAttr = 'nmgr', + gestaltNotificationPresent = 0 +}; + +enum { + gestaltNameRegistryVersion = 'nreg' +}; + +enum { + gestaltNuBusSlotCount = 'nubs' +}; + +enum { + gestaltOCEToolboxVersion = 'ocet', + gestaltOCETB = 0x0102, + gestaltSFServer = 0x0100 +}; + +enum { + gestaltOCEToolboxAttr = 'oceu', + gestaltOCETBPresent = 0x01, + gestaltOCETBAvailable = 0x02, + gestaltOCESFServerAvailable = 0x04, + gestaltOCETBNativeGlueAvailable = 0x10 +}; + +enum { + gestaltOpenFirmwareInfo = 'opfw' +}; + +enum { + gestaltOSAttr = 'os ', + gestaltSysZoneGrowable = 0, + gestaltLaunchCanReturn = 1, + gestaltLaunchFullFileSpec = 2, + gestaltLaunchControl = 3, + gestaltTempMemSupport = 4, + gestaltRealTempMemory = 5, + gestaltTempMemTracked = 6, + gestaltIPCSupport = 7, + gestaltSysDebuggerSupport = 8, + gestaltNativeProcessMgrBit = 19, + gestaltAltivecRegistersSwappedCorrectlyBit = 20 +}; + +enum { + gestaltOSTable = 'ostt' +}; +enum { + gestaltOpenTptNetworkSetup = 'otcf', + gestaltOpenTptNetworkSetupLegacyImport = 0, + gestaltOpenTptNetworkSetupLegacyExport = 1, + gestaltOpenTptNetworkSetupSupportsMultihoming = 2 +}; + +enum { + gestaltOpenTptNetworkSetupVersion = 'otcv' +}; + + + + + + + +enum { + gestaltOpenTptRemoteAccess = 'otra', + gestaltOpenTptRemoteAccessPresent = 0, + gestaltOpenTptRemoteAccessLoaded = 1, + gestaltOpenTptRemoteAccessClientOnly = 2, + gestaltOpenTptRemoteAccessPServer = 3, + gestaltOpenTptRemoteAccessMPServer = 4, + gestaltOpenTptPPPPresent = 5, + gestaltOpenTptARAPPresent = 6 +}; + +enum { + gestaltOpenTptRemoteAccessVersion = 'otrv' +}; + + + + + +enum { + gestaltOpenTptVersions = 'otvr' +}; + +enum { + gestaltOpenTpt = 'otan', + gestaltOpenTptPresentMask = 0x00000001, + gestaltOpenTptLoadedMask = 0x00000002, + gestaltOpenTptAppleTalkPresentMask = 0x00000004, + gestaltOpenTptAppleTalkLoadedMask = 0x00000008, + gestaltOpenTptTCPPresentMask = 0x00000010, + gestaltOpenTptTCPLoadedMask = 0x00000020, + gestaltOpenTptIPXSPXPresentMask = 0x00000040, + gestaltOpenTptIPXSPXLoadedMask = 0x00000080, + gestaltOpenTptPresentBit = 0, + gestaltOpenTptLoadedBit = 1, + gestaltOpenTptAppleTalkPresentBit = 2, + gestaltOpenTptAppleTalkLoadedBit = 3, + gestaltOpenTptTCPPresentBit = 4, + gestaltOpenTptTCPLoadedBit = 5, + gestaltOpenTptIPXSPXPresentBit = 6, + gestaltOpenTptIPXSPXLoadedBit = 7 +}; + + +enum { + gestaltPCCard = 'pccd', + gestaltCardServicesPresent = 0, + gestaltPCCardFamilyPresent = 1, + gestaltPCCardHasPowerControl = 2, + gestaltPCCardSupportsCardBus = 3 +}; + +enum { + gestaltProcClkSpeed = 'pclk' +}; + +enum { + gestaltProcClkSpeedMHz = 'mclk' +}; + +enum { + gestaltPCXAttr = 'pcxg', + gestaltPCXHas8and16BitFAT = 0, + gestaltPCXHasProDOS = 1, + gestaltPCXNewUI = 2, + gestaltPCXUseICMapping = 3 +}; + +enum { + gestaltLogicalPageSize = 'pgsz' +}; +enum { + gestaltScreenCaptureMain = 'pic1', + gestaltScreenCaptureDir = 'pic2' +}; + +enum { + gestaltGXPrintingMgrVersion = 'pmgr' +}; + +enum { + gestaltPopupAttr = 'pop!', + gestaltPopupPresent = 0 +}; + +enum { + gestaltPowerMgrAttr = 'powr', + gestaltPMgrExists = 0, + gestaltPMgrCPUIdle = 1, + gestaltPMgrSCC = 2, + gestaltPMgrSound = 3, + gestaltPMgrDispatchExists = 4, + gestaltPMgrSupportsAVPowerStateAtSleepWake = 5 +}; + +enum { + gestaltPowerMgrVers = 'pwrv' +}; + + + + + + + +enum { + gestaltPPCToolboxAttr = 'ppc ', + gestaltPPCToolboxPresent = 0x0000, + gestaltPPCSupportsRealTime = 0x1000, + gestaltPPCSupportsIncoming = 0x0001, + gestaltPPCSupportsOutGoing = 0x0002, + gestaltPPCSupportsTCP_IP = 0x0004, + gestaltPPCSupportsIncomingAppleTalk = 0x0010, + gestaltPPCSupportsIncomingTCP_IP = 0x0020, + gestaltPPCSupportsOutgoingAppleTalk = 0x0100, + gestaltPPCSupportsOutgoingTCP_IP = 0x0200 +}; + + + + + + +enum { + gestaltPowerPCProcessorFeatures = 'ppcf', + gestaltPowerPCHasGraphicsInstructions = 0, + gestaltPowerPCHasSTFIWXInstruction = 1, + gestaltPowerPCHasSquareRootInstructions = 2, + gestaltPowerPCHasDCBAInstruction = 3, + gestaltPowerPCHasVectorInstructions = 4, + gestaltPowerPCHasDataStreams = 5, + gestaltPowerPCHas64BitSupport = 6, + gestaltPowerPCHasDCBTStreams = 7, + gestaltPowerPCASArchitecture = 8, + gestaltPowerPCIgnoresDCBST = 9 +}; + +enum { + gestaltProcessorType = 'proc', + gestalt68000 = 1, + gestalt68010 = 2, + gestalt68020 = 3, + gestalt68030 = 4, + gestalt68040 = 5 +}; + +enum { + gestaltSDPPromptVersion = 'prpv' +}; + +enum { + gestaltParityAttr = 'prty', + gestaltHasParityCapability = 0, + gestaltParityEnabled = 1 +}; + +enum { + gestaltQD3DVersion = 'q3v ' +}; + +enum { + gestaltQD3DViewer = 'q3vc', + gestaltQD3DViewerPresent = 0 +}; +enum { + gestaltQuickdrawVersion = 'qd ', + gestaltOriginalQD = 0x0000, + gestalt8BitQD = 0x0100, + gestalt32BitQD = 0x0200, + gestalt32BitQD11 = 0x0201, + gestalt32BitQD12 = 0x0220, + gestalt32BitQD13 = 0x0230, + gestaltAllegroQD = 0x0250, + gestaltMacOSXQD = 0x0300 +}; + +enum { + gestaltQD3D = 'qd3d', + gestaltQD3DPresent = 0 +}; +enum { + gestaltGXVersion = 'qdgx' +}; + +enum { + gestaltQuickdrawFeatures = 'qdrw', + gestaltHasColor = 0, + gestaltHasDeepGWorlds = 1, + gestaltHasDirectPixMaps = 2, + gestaltHasGrayishTextOr = 3, + gestaltSupportsMirroring = 4, + gestaltQDHasLongRowBytes = 5 +}; + +enum { + gestaltQDTextVersion = 'qdtx', + gestaltOriginalQDText = 0x0000, + gestaltAllegroQDText = 0x0100, + gestaltMacOSXQDText = 0x0200 +}; + +enum { + gestaltQDTextFeatures = 'qdtf', + gestaltWSIISupport = 0, + gestaltSbitFontSupport = 1, + gestaltAntiAliasedTextAvailable = 2, + gestaltOFA2available = 3, + gestaltCreatesAliasFontRsrc = 4, + gestaltNativeType1FontSupport = 5, + gestaltCanUseCGTextRendering = 6 +}; + + +enum { + gestaltQuickTimeConferencingInfo = 'qtci' +}; + +enum { + gestaltQuickTimeVersion = 'qtim', + gestaltQuickTime = 'qtim' +}; + +enum { + gestaltQuickTimeFeatures = 'qtrs', + gestaltPPCQuickTimeLibPresent = 0 +}; + +enum { + gestaltQuickTimeStreamingFeatures = 'qtsf' +}; + +enum { + gestaltQuickTimeStreamingVersion = 'qtst' +}; + +enum { + gestaltQuickTimeThreadSafeFeaturesAttr = 'qtth', + gestaltQuickTimeThreadSafeICM = 0, + gestaltQuickTimeThreadSafeMovieToolbox = 1, + gestaltQuickTimeThreadSafeMovieImport = 2, + gestaltQuickTimeThreadSafeMovieExport = 3, + gestaltQuickTimeThreadSafeGraphicsImport = 4, + gestaltQuickTimeThreadSafeGraphicsExport = 5, + gestaltQuickTimeThreadSafeMoviePlayback = 6 +}; + +enum { + gestaltQTVRMgrAttr = 'qtvr', + gestaltQTVRMgrPresent = 0, + gestaltQTVRObjMoviesPresent = 1, + gestaltQTVRCylinderPanosPresent = 2, + gestaltQTVRCubicPanosPresent = 3 +}; + +enum { + gestaltQTVRMgrVers = 'qtvv' +}; +enum { + gestaltPhysicalRAMSize = 'ram ' +}; + +enum { + gestaltPhysicalRAMSizeInMegabytes = 'ramm' +}; + +enum { + gestaltRBVAddr = 'rbv ' +}; + +enum { + gestaltROMSize = 'rom ' +}; + +enum { + gestaltROMVersion = 'romv' +}; + +enum { + gestaltResourceMgrAttr = 'rsrc', + gestaltPartialRsrcs = 0, + gestaltHasResourceOverrides = 1 +}; + +enum { + gestaltResourceMgrBugFixesAttrs = 'rmbg', + gestaltRMForceSysHeapRolledIn = 0, + gestaltRMFakeAppleMenuItemsRolledIn = 1, + gestaltSanityCheckResourceFiles = 2, + gestaltSupportsFSpResourceFileAlreadyOpenBit = 3, + gestaltRMSupportsFSCalls = 4, + gestaltRMTypeIndexOrderingReverse = 8 +}; + + +enum { + gestaltRealtimeMgrAttr = 'rtmr', + gestaltRealtimeMgrPresent = 0 +}; + + +enum { + gestaltSafeOFAttr = 'safe', + gestaltVMZerosPagesBit = 0, + gestaltInitHeapZerosOutHeapsBit = 1, + gestaltNewHandleReturnsZeroedMemoryBit = 2, + gestaltNewPtrReturnsZeroedMemoryBit = 3, + gestaltFileAllocationZeroedBlocksBit = 4 +}; + + +enum { + gestaltSCCReadAddr = 'sccr' +}; + +enum { + gestaltSCCWriteAddr = 'sccw' +}; + +enum { + gestaltScrapMgrAttr = 'scra', + gestaltScrapMgrTranslationAware = 0 +}; + +enum { + gestaltScriptMgrVersion = 'scri' +}; + +enum { + gestaltScriptCount = 'scr#' +}; + +enum { + gestaltSCSI = 'scsi', + gestaltAsyncSCSI = 0, + gestaltAsyncSCSIINROM = 1, + gestaltSCSISlotBoot = 2, + gestaltSCSIPollSIH = 3 +}; + +enum { + gestaltControlStripAttr = 'sdev', + gestaltControlStripExists = 0, + gestaltControlStripVersionFixed = 1, + gestaltControlStripUserFont = 2, + gestaltControlStripUserHotKey = 3 +}; + +enum { + gestaltSDPStandardDirectoryVersion = 'sdvr' +}; + +enum { + gestaltSerialAttr = 'ser ', + gestaltHasGPIaToDCDa = 0, + gestaltHasGPIaToRTxCa = 1, + gestaltHasGPIbToDCDb = 2, + gestaltHidePortA = 3, + gestaltHidePortB = 4, + gestaltPortADisabled = 5, + gestaltPortBDisabled = 6 +}; + +enum { + gestaltShutdownAttributes = 'shut', + gestaltShutdownHassdOnBootVolUnmount = 0 +}; + +enum { + gestaltNuBusConnectors = 'sltc' +}; + +enum { + gestaltSlotAttr = 'slot', + gestaltSlotMgrExists = 0, + gestaltNuBusPresent = 1, + gestaltSESlotPresent = 2, + gestaltSE30SlotPresent = 3, + gestaltPortableSlotPresent = 4 +}; + +enum { + gestaltFirstSlotNumber = 'slt1' +}; + +enum { + gestaltSoundAttr = 'snd ', + gestaltStereoCapability = 0, + gestaltStereoMixing = 1, + gestaltSoundIOMgrPresent = 3, + gestaltBuiltInSoundInput = 4, + gestaltHasSoundInputDevice = 5, + gestaltPlayAndRecord = 6, + gestalt16BitSoundIO = 7, + gestaltStereoInput = 8, + gestaltLineLevelInput = 9, + + gestaltSndPlayDoubleBuffer = 10, + gestaltMultiChannels = 11, + gestalt16BitAudioSupport = 12 +}; + +enum { + gestaltSplitOSAttr = 'spos', + gestaltSplitOSBootDriveIsNetworkVolume = 0, + gestaltSplitOSAware = 1, + gestaltSplitOSEnablerVolumeIsDifferentFromBootVolume = 2, + gestaltSplitOSMachineNameSetToNetworkNameTemp = 3, + gestaltSplitOSMachineNameStartupDiskIsNonPersistent = 5 +}; + +enum { + gestaltSMPSPSendLetterVersion = 'spsl' +}; + +enum { + gestaltSpeechRecognitionAttr = 'srta', + gestaltDesktopSpeechRecognition = 1, + gestaltTelephoneSpeechRecognition = 2 +}; + +enum { + gestaltSpeechRecognitionVersion = 'srtb' +}; + +enum { + gestaltSoftwareVendorCode = 'srad', + gestaltSoftwareVendorApple = 'Appl', + gestaltSoftwareVendorLicensee = 'Lcns' +}; + +enum { + gestaltStandardFileAttr = 'stdf', + gestaltStandardFile58 = 0, + gestaltStandardFileTranslationAware = 1, + gestaltStandardFileHasColorIcons = 2, + gestaltStandardFileUseGenericIcons = 3, + gestaltStandardFileHasDynamicVolumeAllocation = 4 +}; + +enum { + gestaltSysArchitecture = 'sysa', + gestalt68k = 1, + gestaltPowerPC = 2, + gestaltIntel = 10 +}; + +enum { + gestaltSystemUpdateVersion = 'sysu' +}; +enum { + gestaltSystemVersion = 'sysv', + gestaltSystemVersionMajor = 'sys1', + gestaltSystemVersionMinor = 'sys2', + gestaltSystemVersionBugFix = 'sys3' +} __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Use NSProcessInfo's operatingSystemVersion property instead."))); + +enum { + gestaltToolboxTable = 'tbtt' +}; + +enum { + gestaltTextEditVersion = 'te ', + gestaltTE1 = 1, + gestaltTE2 = 2, + gestaltTE3 = 3, + gestaltTE4 = 4, + gestaltTE5 = 5 +}; + +enum { + gestaltTE6 = 6 +}; + +enum { + gestaltTEAttr = 'teat', + gestaltTEHasGetHiliteRgn = 0, + gestaltTESupportsInlineInput = 1, + gestaltTESupportsTextObjects = 2, + gestaltTEHasWhiteBackground = 3 +}; + +enum { + gestaltTeleMgrAttr = 'tele', + gestaltTeleMgrPresent = 0, + gestaltTeleMgrPowerPCSupport = 1, + gestaltTeleMgrSoundStreams = 2, + gestaltTeleMgrAutoAnswer = 3, + gestaltTeleMgrIndHandset = 4, + gestaltTeleMgrSilenceDetect = 5, + gestaltTeleMgrNewTELNewSupport = 6 +}; + +enum { + gestaltTermMgrAttr = 'term', + gestaltTermMgrPresent = 0, + gestaltTermMgrErrorString = 2 +}; + +enum { + gestaltThreadMgrAttr = 'thds', + gestaltThreadMgrPresent = 0, + gestaltSpecificMatchSupport = 1, + gestaltThreadsLibraryPresent = 2 +}; + +enum { + gestaltTimeMgrVersion = 'tmgr', + gestaltStandardTimeMgr = 1, + gestaltRevisedTimeMgr = 2, + gestaltExtendedTimeMgr = 3, + gestaltNativeTimeMgr = 4 +}; + +enum { + gestaltTSMTEVersion = 'tmTV', + gestaltTSMTE1 = 0x0100, + gestaltTSMTE15 = 0x0150, + gestaltTSMTE152 = 0x0152 +}; + +enum { + gestaltTSMTEAttr = 'tmTE', + gestaltTSMTEPresent = 0, + gestaltTSMTE = 0 +}; + +enum { + gestaltAVLTreeAttr = 'tree', + gestaltAVLTreePresentBit = 0, + gestaltAVLTreeSupportsHandleBasedTreeBit = 1, + gestaltAVLTreeSupportsTreeLockingBit = 2 +}; + +enum { + gestaltALMAttr = 'trip', + gestaltALMPresent = 0, + gestaltALMHasSFGroup = 1, + gestaltALMHasCFMSupport = 2, + gestaltALMHasRescanNotifiers = 3 +}; + +enum { + gestaltALMHasSFLocation = gestaltALMHasSFGroup +}; + +enum { + gestaltTSMgrVersion = 'tsmv', + gestaltTSMgr15 = 0x0150, + gestaltTSMgr20 = 0x0200, + gestaltTSMgr22 = 0x0220, + gestaltTSMgr23 = 0x0230 +}; + +enum { + gestaltTSMgrAttr = 'tsma', + gestaltTSMDisplayMgrAwareBit = 0, + gestaltTSMdoesTSMTEBit = 1 +}; + +enum { + gestaltSpeechAttr = 'ttsc', + gestaltSpeechMgrPresent = 0, + gestaltSpeechHasPPCGlue = 1 +}; + +enum { + gestaltTVAttr = 'tv ', + gestaltHasTVTuner = 0, + gestaltHasSoundFader = 1, + gestaltHasHWClosedCaptioning = 2, + gestaltHasIRRemote = 3, + gestaltHasVidDecoderScaler = 4, + gestaltHasStereoDecoder = 5, + gestaltHasSerialFader = 6, + gestaltHasFMTuner = 7, + gestaltHasSystemIRFunction = 8, + gestaltIRDisabled = 9, + gestaltINeedIRPowerOffConfirm = 10, + gestaltHasZoomedVideo = 11 +}; + + +enum { + gestaltATSUVersion = 'uisv', + gestaltOriginalATSUVersion = (1 << 16), + gestaltATSUUpdate1 = (2 << 16), + gestaltATSUUpdate2 = (3 << 16), + gestaltATSUUpdate3 = (4 << 16), + gestaltATSUUpdate4 = (5 << 16), + gestaltATSUUpdate5 = (6 << 16), + gestaltATSUUpdate6 = (7 << 16), + gestaltATSUUpdate7 = (8 << 16) +}; + +enum { + gestaltATSUFeatures = 'uisf', + gestaltATSUTrackingFeature = 0x00000001, + gestaltATSUMemoryFeature = 0x00000001, + gestaltATSUFallbacksFeature = 0x00000001, + gestaltATSUGlyphBoundsFeature = 0x00000001, + gestaltATSULineControlFeature = 0x00000001, + gestaltATSULayoutCreateAndCopyFeature = 0x00000001, + gestaltATSULayoutCacheClearFeature = 0x00000001, + gestaltATSUTextLocatorUsageFeature = 0x00000002, + gestaltATSULowLevelOrigFeatures = 0x00000004, + gestaltATSUFallbacksObjFeatures = 0x00000008, + gestaltATSUIgnoreLeadingFeature = 0x00000008, + gestaltATSUByCharacterClusterFeature = 0x00000010, + gestaltATSUAscentDescentControlsFeature = 0x00000010, + gestaltATSUHighlightInactiveTextFeature = 0x00000010, + gestaltATSUPositionToCursorFeature = 0x00000010, + gestaltATSUBatchBreakLinesFeature = 0x00000010, + gestaltATSUTabSupportFeature = 0x00000010, + gestaltATSUDirectAccess = 0x00000010, + gestaltATSUDecimalTabFeature = 0x00000020, + gestaltATSUBiDiCursorPositionFeature = 0x00000020, + gestaltATSUNearestCharLineBreakFeature = 0x00000020, + gestaltATSUHighlightColorControlFeature = 0x00000020, + gestaltATSUUnderlineOptionsStyleFeature = 0x00000020, + gestaltATSUStrikeThroughStyleFeature = 0x00000020, + gestaltATSUDropShadowStyleFeature = 0x00000020 +}; + +enum { + gestaltUSBAttr = 'usb ', + gestaltUSBPresent = 0, + gestaltUSBHasIsoch = 1 +}; + +enum { + gestaltUSBVersion = 'usbv' +}; + +enum { + gestaltVersion = 'vers', + gestaltValueImplementedVers = 5 +}; + +enum { + gestaltVIA1Addr = 'via1' +}; + +enum { + gestaltVIA2Addr = 'via2' +}; + +enum { + gestaltVMAttr = 'vm ', + gestaltVMPresent = 0, + gestaltVMHasLockMemoryForOutput = 1, + gestaltVMFilemappingOn = 3, + gestaltVMHasPagingControl = 4 +}; + +enum { + gestaltVMInfoType = 'vmin', + + gestaltVMInfoSizeStorageType = 0, + gestaltVMInfoSizeType = 1, + gestaltVMInfoSimpleType = 2, + gestaltVMInfoNoneType = 3 +}; + +enum { + gestaltVMBackingStoreFileRefNum = 'vmbs' +}; + + + +enum { + gestaltALMVers = 'walk' +}; + +enum { + gestaltWindowMgrAttr = 'wind', + gestaltWindowMgrPresent = (1L << 0), + + + gestaltWindowMgrPresentBit = 0, + gestaltExtendedWindowAttributes = 1, + gestaltExtendedWindowAttributesBit = 1, + gestaltHasFloatingWindows = 2, + gestaltHasFloatingWindowsBit = 2, + gestaltHasWindowBuffering = 3, + gestaltHasWindowBufferingBit = 3, + gestaltWindowLiveResizeBit = 4, + gestaltWindowMinimizeToDockBit = 5, + gestaltHasWindowShadowsBit = 6, + gestaltSheetsAreWindowModalBit = 7, + gestaltFrontWindowMayBeHiddenBit = 8, + + gestaltWindowMgrPresentMask = (1L << gestaltWindowMgrPresentBit), + gestaltExtendedWindowAttributesMask = (1L << gestaltExtendedWindowAttributesBit), + gestaltHasFloatingWindowsMask = (1L << gestaltHasFloatingWindowsBit), + gestaltHasWindowBufferingMask = (1L << gestaltHasWindowBufferingBit), + gestaltWindowLiveResizeMask = (1L << gestaltWindowLiveResizeBit), + gestaltWindowMinimizeToDockMask = (1L << gestaltWindowMinimizeToDockBit), + gestaltHasWindowShadowsMask = (1L << gestaltHasWindowShadowsBit), + gestaltSheetsAreWindowModalMask = (1L << gestaltSheetsAreWindowModalBit), + gestaltFrontWindowMayBeHiddenMask = (1L << gestaltFrontWindowMayBeHiddenBit) +}; + +enum { + gestaltHasSingleWindowModeBit = 8, + gestaltHasSingleWindowModeMask = (1L << gestaltHasSingleWindowModeBit) +}; + + + + + + +enum { + gestaltX86Features = 'x86f', + gestaltX86HasFPU = 0, + gestaltX86HasVME = 1, + gestaltX86HasDE = 2, + gestaltX86HasPSE = 3, + gestaltX86HasTSC = 4, + gestaltX86HasMSR = 5, + gestaltX86HasPAE = 6, + gestaltX86HasMCE = 7, + gestaltX86HasCX8 = 8, + gestaltX86HasAPIC = 9, + gestaltX86HasSEP = 11, + gestaltX86HasMTRR = 12, + gestaltX86HasPGE = 13, + gestaltX86HasMCA = 14, + gestaltX86HasCMOV = 15, + + gestaltX86HasPAT = 16, + gestaltX86HasPSE36 = 17, + gestaltX86HasPSN = 18, + gestaltX86HasCLFSH = 19, + gestaltX86Serviced20 = 20, + gestaltX86HasDS = 21, + gestaltX86ResACPI = 22, + gestaltX86HasMMX = 23, + gestaltX86HasFXSR = 24, + gestaltX86HasSSE = 25, + gestaltX86HasSSE2 = 26, + gestaltX86HasSS = 27, + gestaltX86HasHTT = 28, + gestaltX86HasTM = 29 +}; + + + + +enum { + gestaltX86AdditionalFeatures = 'x86a', + gestaltX86HasSSE3 = 0, + gestaltX86HasMONITOR = 3, + gestaltX86HasDSCPL = 4, + gestaltX86HasVMX = 5, + gestaltX86HasSMX = 6, + gestaltX86HasEST = 7, + gestaltX86HasTM2 = 8, + gestaltX86HasSupplementalSSE3 = 9, + gestaltX86HasCID = 10, + gestaltX86HasCX16 = 13, + gestaltX86HasxTPR = 14 +}; + +enum { + gestaltTranslationAttr = 'xlat', + gestaltTranslationMgrExists = 0, + gestaltTranslationMgrHintOrder = 1, + gestaltTranslationPPCAvail = 2, + gestaltTranslationGetPathAPIAvail = 3 +}; + +enum { + gestaltExtToolboxTable = 'xttt' +}; + +enum { + gestaltUSBPrinterSharingVersion = 'zak ', + gestaltUSBPrinterSharingVersionMask = 0x0000FFFF, + gestaltUSBPrinterSharingAttr = 'zak ', + gestaltUSBPrinterSharingAttrMask = (int)0xFFFF0000, + gestaltUSBPrinterSharingAttrRunning = (int)0x80000000, + gestaltUSBPrinterSharingAttrBooted = 0x40000000 +}; + + +enum { + gestaltWorldScriptIIVersion = 'doub', + gestaltWorldScriptIIAttr = 'wsat', + gestaltWSIICanPrintWithoutPrGeneralBit = 0 +}; + + + + +enum { + kMacMemoryMaximumMemoryManagerBlockSize = 0x7FFFFFF0 +}; +enum { + defaultPhysicalEntryCount = 8 +}; + +enum { + + kPageInMemory = 0, + kPageOnDisk = 1, + kNotPaged = 2 +}; + +enum { + + k32BitHeap = 1, + kNewStyleHeap = 2, + kNewDebugHeap = 4 +}; + + + + + +enum { + kHandleIsResourceBit = 5, + kHandlePurgeableBit = 6, + kHandleLockedBit = 7 +}; + + +enum { + kHandleIsResourceMask = 0x20, + kHandlePurgeableMask = 0x40, + kHandleLockedMask = 0x80 +}; +extern OSErr +MemError(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt16 +LMGetMemErr(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +LMSetMemErr(SInt16 value) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Handle +NewHandle(Size byteCount) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Handle +NewHandleClear(Size byteCount) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Handle +RecoverHandle(Ptr p) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Ptr +NewPtr(Size byteCount) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Ptr +NewPtrClear(Size byteCount) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Handle +NewEmptyHandle(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +HLock(Handle h) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +HLockHi(Handle h) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +HUnlock(Handle h) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Handle +TempNewHandle( + Size logicalSize, + OSErr * resultCode) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposePtr(Ptr p) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Size +GetPtrSize(Ptr p) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +SetPtrSize( + Ptr p, + Size newSize) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeHandle(Handle h) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +SetHandleSize( + Handle h, + Size newSize) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Size +GetHandleSize(Handle h) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +ReallocateHandle( + Handle h, + Size byteCount) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +EmptyHandle(Handle h) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +HSetRBit(Handle h) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +HClrRBit(Handle h) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt8 +HGetState(Handle h) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +HSetState( + Handle h, + SInt8 flags) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +HandToHand(Handle * theHndl) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +PtrToXHand( + const void * srcPtr, + Handle dstHndl, + long size) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +PtrToHand( + const void * srcPtr, + Handle * dstHndl, + long size) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +HandAndHand( + Handle hand1, + Handle hand2) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +PtrAndHand( + const void * ptr1, + Handle hand2, + long size) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Boolean +IsHeapValid(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Boolean +IsHandleValid(Handle h) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Boolean +IsPointerValid(Ptr p) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); + + + +extern SInt64 +S64Max(void); +extern SInt64 +S64Min(void); +extern SInt64 +S64Add( + SInt64 left, + SInt64 right); +extern SInt64 +S64Subtract( + SInt64 left, + SInt64 right); +extern SInt64 +S64Negate(SInt64 value); +extern SInt64 +S64Multiply( + SInt64 left, + SInt64 right); +extern SInt64 +S64Mod( + SInt64 dividend, + SInt64 divisor); +extern SInt64 +S64Divide( + SInt64 dividend, + SInt64 divisor, + SInt64 * remainder); +extern SInt64 +S64Div( + SInt64 dividend, + SInt64 divisor); +extern SInt64 +S64Set(SInt32 value); +extern SInt64 +S64SetU(UInt32 value); +extern SInt32 +S32Set(SInt64 value); +extern Boolean +S64And( + SInt64 left, + SInt64 right); +extern Boolean +S64Or( + SInt64 left, + SInt64 right); +extern Boolean +S64Eor( + SInt64 left, + SInt64 right); +extern Boolean +S64Not(SInt64 value); +extern SInt32 +S64Compare( + SInt64 left, + SInt64 right) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt64 +S64BitwiseAnd( + SInt64 left, + SInt64 right); +extern SInt64 +S64BitwiseOr( + SInt64 left, + SInt64 right); +extern SInt64 +S64BitwiseEor( + SInt64 left, + SInt64 right); +extern SInt64 +S64BitwiseNot(SInt64 value); +extern SInt64 +S64ShiftRight( + SInt64 value, + UInt32 shift); +extern SInt64 +S64ShiftLeft( + SInt64 value, + UInt32 shift); +extern long double +SInt64ToLongDouble(SInt64 value); +extern SInt64 +LongDoubleToSInt64(long double value); +extern UInt64 +U64Max(void); +extern UInt64 +U64Add( + UInt64 left, + UInt64 right); +extern UInt64 +U64Subtract( + UInt64 left, + UInt64 right); +extern UInt64 +U64Multiply( + UInt64 left, + UInt64 right); +extern UInt64 +U64Mod( + UInt64 dividend, + UInt64 divisor); +extern UInt64 +U64Divide( + UInt64 dividend, + UInt64 divisor, + UInt64 * remainder); +extern UInt64 +U64Div( + UInt64 dividend, + UInt64 divisor); +extern UInt64 +U64Set(SInt32 value); +extern UInt64 +U64SetU(UInt32 value); +extern UInt32 +U32SetU(UInt64 value); +extern Boolean +U64And( + UInt64 left, + UInt64 right); +extern Boolean +U64Or( + UInt64 left, + UInt64 right); +extern Boolean +U64Eor( + UInt64 left, + UInt64 right); +extern Boolean +U64Not(UInt64 value); +extern SInt32 +U64Compare( + UInt64 left, + UInt64 right) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern UInt64 +U64BitwiseAnd( + UInt64 left, + UInt64 right); +extern UInt64 +U64BitwiseOr( + UInt64 left, + UInt64 right); +extern UInt64 +U64BitwiseEor( + UInt64 left, + UInt64 right); +extern UInt64 +U64BitwiseNot(UInt64 value); +extern UInt64 +U64ShiftRight( + UInt64 value, + UInt32 shift); +extern UInt64 +U64ShiftLeft( + UInt64 value, + UInt32 shift); +extern long double +UInt64ToLongDouble(UInt64 value); +extern UInt64 +LongDoubleToUInt64(long double value); +extern SInt64 +UInt64ToSInt64(UInt64 value); +extern UInt64 +SInt64ToUInt64(SInt64 value); + static inline wide SInt64ToWide(SInt64 s) { wide result; result.hi = (SInt32)(((UInt64)s >> 32) & 0xffffffffUL); result.lo = (UInt32)((UInt64)s & 0xffffffffUL); return result; } + static inline SInt64 WideToSInt64(wide w) { SInt64 result = w.hi; result = (result << 32) | w.lo; return result; } + + static inline UnsignedWide UInt64ToUnsignedWide(UInt64 u) { UnsignedWide result; result.hi = (UInt32)((u >> 32) & 0xffffffffUL); result.lo = (UInt32)(u & 0xffffffffUL); return result; } + static inline UInt64 UnsignedWideToUInt64(UnsignedWide uw) { UInt64 result = uw.hi; result = (result << 32) | uw.lo; return result; } +extern OSStatus +CSBackupSetItemExcluded( + CFURLRef item, + Boolean exclude, + Boolean excludeByPath) __attribute__((availability(macosx,introduced=10.5))); +extern Boolean +CSBackupIsItemExcluded( + CFURLRef item, + Boolean * excludeByPath) __attribute__((availability(macosx,introduced=10.5))); + + + +enum { + kCSDiskSpaceRecoveryOptionNoUI = (1 << 0) +}; + +typedef int CSDiskSpaceRecoveryOptions; + + +typedef void (^CSDiskSpaceRecoveryCallback)(Boolean succeeded, UInt64 bytesFree, CFErrorRef error); +extern void +CSDiskSpaceStartRecovery( + CFURLRef volumeURL, + UInt64 bytesNeeded, + CSDiskSpaceRecoveryOptions options, + CFUUIDRef * outOperationUUID, + dispatch_queue_t callbackQueue, + CSDiskSpaceRecoveryCallback callback) __attribute__((availability(macosx,introduced=10.7))); +extern void +CSDiskSpaceCancelRecovery(CFUUIDRef operationUUID) __attribute__((availability(macosx,introduced=10.7))); +extern UInt64 +CSDiskSpaceGetRecoveryEstimate(CFURLRef volumeURL) __attribute__((availability(macosx,introduced=10.7))); + + + +typedef SInt16 ToggleResults; +enum { + + toggleUndefined = 0, + toggleOK = 1, + toggleBadField = 2, + toggleBadDelta = 3, + toggleBadChar = 4, + toggleUnknown = 5, + toggleBadNum = 6, + toggleOutOfRange = 7, + toggleErr3 = 7, + toggleErr4 = 8, + toggleErr5 = 9 +}; + +enum { + + smallDateBit = 31, + togChar12HourBit = 30, + togCharZCycleBit = 29, + togDelta12HourBit = 28, + genCdevRangeBit = 27, + validDateFields = -1, + maxDateField = 10 +}; + +enum { + eraMask = 0x0001, + yearMask = 0x0002, + monthMask = 0x0004, + dayMask = 0x0008, + hourMask = 0x0010, + minuteMask = 0x0020, + secondMask = 0x0040, + dayOfWeekMask = 0x0080, + dayOfYearMask = 0x0100, + weekOfYearMask = 0x0200, + pmMask = 0x0400, + dateStdMask = 0x007F +}; + +typedef SInt8 LongDateField; +enum { + eraField = 0, + yearField = 1, + monthField = 2, + dayField = 3, + hourField = 4, + minuteField = 5, + secondField = 6, + dayOfWeekField = 7, + dayOfYearField = 8, + weekOfYearField = 9, + pmField = 10, + res1Field = 11, + res2Field = 12, + res3Field = 13 +}; + +typedef SInt8 DateForm; +enum { + shortDate = 0, + longDate = 1, + abbrevDate = 2 +}; + +enum { + + fatalDateTime = 0x8000, + longDateFound = 1, + leftOverChars = 2, + sepNotIntlSep = 4, + fieldOrderNotIntl = 8, + extraneousStrings = 16, + tooManySeps = 32, + sepNotConsistent = 64, + tokenErr = 0x8100, + cantReadUtilities = 0x8200, + dateTimeNotFound = 0x8400, + dateTimeInvalid = 0x8800 +}; + +typedef short StringToDateStatus; +typedef StringToDateStatus String2DateStatus; +struct DateCacheRecord { + short hidden[256]; +}; +typedef struct DateCacheRecord DateCacheRecord; +typedef DateCacheRecord * DateCachePtr; +struct DateTimeRec { + short year; + short month; + short day; + short hour; + short minute; + short second; + short dayOfWeek; +}; +typedef struct DateTimeRec DateTimeRec; + +typedef SInt64 LongDateTime; +union LongDateCvt { + SInt64 c; + struct { + UInt32 lLow; + UInt32 lHigh; + } hl; +}; +typedef union LongDateCvt LongDateCvt; + + +union LongDateRec { + struct { + short era; + short year; + short month; + short day; + short hour; + short minute; + short second; + short dayOfWeek; + short dayOfYear; + short weekOfYear; + short pm; + short res1; + short res2; + short res3; + } ld; + short list[14]; + struct { + short eraAlt; + DateTimeRec oldDate; + } od; +}; +typedef union LongDateRec LongDateRec; + +typedef SInt8 DateDelta; +struct TogglePB { + long togFlags; + ResType amChars; + ResType pmChars; + long reserved[4]; +}; +typedef struct TogglePB TogglePB; +extern OSStatus +UCConvertUTCDateTimeToCFAbsoluteTime( + const UTCDateTime * iUTCDate, + CFAbsoluteTime * oCFTime) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +UCConvertSecondsToCFAbsoluteTime( + UInt32 iSeconds, + CFAbsoluteTime * oCFTime) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +UCConvertLongDateTimeToCFAbsoluteTime( + LongDateTime iLongTime, + CFAbsoluteTime * oCFTime) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +UCConvertCFAbsoluteTimeToUTCDateTime( + CFAbsoluteTime iCFTime, + UTCDateTime * oUTCDate) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +UCConvertCFAbsoluteTimeToSeconds( + CFAbsoluteTime iCFTime, + UInt32 * oSeconds) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +UCConvertCFAbsoluteTimeToLongDateTime( + CFAbsoluteTime iCFTime, + LongDateTime * oLongDate) __attribute__((availability(macosx,introduced=10.2))); + +enum { + + sortsBefore = -1, + sortsEqual = 0, + sortsAfter = 1 +}; + +enum { + dummyType = 0, + vType = 1, + ioQType = 2, + drvQType = 3, + evType = 4, + fsQType = 5, + sIQType = 6, + dtQType = 7, + nmType = 8 +}; + +typedef SignedByte QTypes; +struct QElem { + struct QElem * qLink; + short qType; + short qData[1]; +}; +typedef struct QElem QElem; +typedef QElem * QElemPtr; +struct QHdr { + volatile short qFlags; + volatile QElemPtr qHead; + volatile QElemPtr qTail; +}; +typedef struct QHdr QHdr; +typedef QHdr * QHdrPtr; +struct MachineLocation { + Fract latitude; + Fract longitude; + union { + + + + long gmtDelta; + struct { + + SInt8 pad[3]; + + SInt8 Delta; + } dls; + } u; +}; +typedef struct MachineLocation MachineLocation; +extern Boolean +IsMetric(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern void +Delay( + unsigned long numTicks, + unsigned long * finalTicks) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +Enqueue( + QElemPtr qElement, + QHdrPtr qHeader) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +Dequeue( + QElemPtr qElement, + QHdrPtr qHeader) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +ReadLocation(MachineLocation * loc) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern UInt32 +TickCount(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern CFStringRef +CSCopyUserName(Boolean useShortName) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern CFStringRef +CSCopyMachineName(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); + + +enum { + useFree = 0, + useATalk = 1, + useAsync = 2, + useExtClk = 3, + useMIDI = 4 +}; + +enum { + false32b = 0, + true32b = 1 +} __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +typedef void * SysPPtr; +typedef void ( * DeferredTaskProcPtr)(long dtParam); +typedef DeferredTaskProcPtr DeferredTaskUPP; +extern DeferredTaskUPP +NewDeferredTaskUPP(DeferredTaskProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeDeferredTaskUPP(DeferredTaskUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +InvokeDeferredTaskUPP( + long dtParam, + DeferredTaskUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +struct DeferredTask { + volatile QElemPtr qLink; + short qType; + volatile short dtFlags; + DeferredTaskUPP dtAddr; + long dtParam; + long dtReserved; +}; +typedef struct DeferredTask DeferredTask; +typedef DeferredTask * DeferredTaskPtr; +struct vm_statistics { + natural_t free_count; + natural_t active_count; + natural_t inactive_count; + natural_t wire_count; + natural_t zero_fill_count; + natural_t reactivations; + natural_t pageins; + natural_t pageouts; + natural_t faults; + natural_t cow_faults; + natural_t lookups; + natural_t hits; + + + natural_t purgeable_count; + natural_t purges; + natural_t speculative_count; +}; + + +typedef struct vm_statistics *vm_statistics_t; +typedef struct vm_statistics vm_statistics_data_t; +struct vm_statistics64 { + natural_t free_count; + natural_t active_count; + natural_t inactive_count; + natural_t wire_count; + uint64_t zero_fill_count; + uint64_t reactivations; + uint64_t pageins; + uint64_t pageouts; + uint64_t faults; + uint64_t cow_faults; + uint64_t lookups; + uint64_t hits; + uint64_t purges; + natural_t purgeable_count; + + + + + + + natural_t speculative_count; + + + uint64_t decompressions; + uint64_t compressions; + uint64_t swapins; + uint64_t swapouts; + natural_t compressor_page_count; + natural_t throttled_count; + natural_t external_page_count; + natural_t internal_page_count; + uint64_t total_uncompressed_pages_in_compressor; +} __attribute__((aligned(8))); + +typedef struct vm_statistics64 *vm_statistics64_t; +typedef struct vm_statistics64 vm_statistics64_data_t; +struct vm_extmod_statistics { + int64_t task_for_pid_count; + int64_t task_for_pid_caller_count; + int64_t thread_creation_count; + int64_t thread_creation_caller_count; + int64_t thread_set_state_count; + int64_t thread_set_state_caller_count; +} __attribute__((aligned(8))); + +typedef struct vm_extmod_statistics *vm_extmod_statistics_t; +typedef struct vm_extmod_statistics vm_extmod_statistics_data_t; + +typedef struct vm_purgeable_stat { + uint64_t count; + uint64_t size; +}vm_purgeable_stat_t; + +struct vm_purgeable_info { + vm_purgeable_stat_t fifo_data[8]; + vm_purgeable_stat_t obsolete_data; + vm_purgeable_stat_t lifo_data[8]; +}; + +typedef struct vm_purgeable_info *vm_purgeable_info_t; +typedef integer_t cpu_type_t; +typedef integer_t cpu_subtype_t; +typedef integer_t cpu_threadtype_t; + + + + + + + + +typedef integer_t *host_info_t; +typedef integer_t *host_info64_t; + + +typedef integer_t host_info_data_t[(1024)]; + + +typedef char kernel_version_t[(512)]; + + +typedef char kernel_boot_info_t[(4096)]; + + + + + +typedef integer_t host_flavor_t; +struct host_can_has_debugger_info { + boolean_t can_has_debugger; +}; +typedef struct host_can_has_debugger_info host_can_has_debugger_info_data_t; +typedef struct host_can_has_debugger_info *host_can_has_debugger_info_t; + + + + +struct host_basic_info { + integer_t max_cpus; + integer_t avail_cpus; + natural_t memory_size; + cpu_type_t cpu_type; + cpu_subtype_t cpu_subtype; + cpu_threadtype_t cpu_threadtype; + integer_t physical_cpu; + integer_t physical_cpu_max; + integer_t logical_cpu; + integer_t logical_cpu_max; + uint64_t max_mem; +}; + + +typedef struct host_basic_info host_basic_info_data_t; +typedef struct host_basic_info *host_basic_info_t; + + + +struct host_sched_info { + integer_t min_timeout; + integer_t min_quantum; +}; + +typedef struct host_sched_info host_sched_info_data_t; +typedef struct host_sched_info *host_sched_info_t; + + + +struct kernel_resource_sizes { + natural_t task; + natural_t thread; + natural_t port; + natural_t memory_region; + natural_t memory_object; +}; + +typedef struct kernel_resource_sizes kernel_resource_sizes_data_t; +typedef struct kernel_resource_sizes *kernel_resource_sizes_t; + + + +struct host_priority_info { + integer_t kernel_priority; + integer_t system_priority; + integer_t server_priority; + integer_t user_priority; + integer_t depress_priority; + integer_t idle_priority; + integer_t minimum_priority; + integer_t maximum_priority; +}; + +typedef struct host_priority_info host_priority_info_data_t; +typedef struct host_priority_info *host_priority_info_t; +struct host_load_info { + integer_t avenrun[3]; + integer_t mach_factor[3]; +}; + +typedef struct host_load_info host_load_info_data_t; +typedef struct host_load_info *host_load_info_t; + + + +typedef struct vm_purgeable_info host_purgable_info_data_t; +typedef struct vm_purgeable_info *host_purgable_info_t; +struct host_cpu_load_info { + natural_t cpu_ticks[4]; +}; + +typedef struct host_cpu_load_info host_cpu_load_info_data_t; +typedef struct host_cpu_load_info *host_cpu_load_info_t; + + +typedef int vm_prot_t; +typedef unsigned vm_sync_t; +typedef vm_offset_t pointer_t; +typedef vm_offset_t vm_address_t; + + + + + + + +typedef uint64_t addr64_t; +typedef uint32_t reg64_t; + + + + + + +typedef uint32_t ppnum_t; + + + + +typedef mach_port_t vm_map_t; +typedef uint64_t vm_object_offset_t; +typedef uint64_t vm_object_size_t; + + + + +typedef mach_port_t upl_t; +typedef mach_port_t vm_named_entry_t; + + + + + + +typedef unsigned long long memory_object_offset_t; +typedef unsigned long long memory_object_size_t; +typedef natural_t memory_object_cluster_size_t; +typedef natural_t * memory_object_fault_info_t; + +typedef unsigned long long vm_object_id_t; + + + + + + + +typedef mach_port_t memory_object_t; +typedef mach_port_t memory_object_control_t; + + +typedef memory_object_t *memory_object_array_t; + + + + +typedef mach_port_t memory_object_name_t; + + + +typedef mach_port_t memory_object_default_t; +typedef int memory_object_copy_strategy_t; +typedef int memory_object_return_t; +typedef int *memory_object_info_t; +typedef int memory_object_flavor_t; +typedef int memory_object_info_data_t[(1024)]; + + + + + + + +struct memory_object_perf_info { + memory_object_cluster_size_t cluster_size; + boolean_t may_cache; +}; + +struct memory_object_attr_info { + memory_object_copy_strategy_t copy_strategy; + memory_object_cluster_size_t cluster_size; + boolean_t may_cache_object; + boolean_t temporary; +}; + +struct memory_object_behave_info { + memory_object_copy_strategy_t copy_strategy; + boolean_t temporary; + boolean_t invalidate; + boolean_t silent_overwrite; + boolean_t advisory_pageout; +}; + + +typedef struct memory_object_behave_info *memory_object_behave_info_t; +typedef struct memory_object_behave_info memory_object_behave_info_data_t; + +typedef struct memory_object_perf_info *memory_object_perf_info_t; +typedef struct memory_object_perf_info memory_object_perf_info_data_t; + +typedef struct memory_object_attr_info *memory_object_attr_info_t; +typedef struct memory_object_attr_info memory_object_attr_info_data_t; + +struct x86_state_hdr { + int flavor; + int count; +}; +typedef struct x86_state_hdr x86_state_hdr_t; +typedef struct __darwin_i386_thread_state i386_thread_state_t; + + + +typedef struct __darwin_i386_thread_state x86_thread_state32_t; + + + + + + +typedef struct __darwin_i386_float_state i386_float_state_t; + + + +typedef struct __darwin_i386_float_state x86_float_state32_t; + + + +typedef struct __darwin_i386_avx_state x86_avx_state32_t; + + + + + + +typedef struct __darwin_i386_exception_state i386_exception_state_t; + + + +typedef struct __darwin_i386_exception_state x86_exception_state32_t; + + + + + +typedef struct __darwin_x86_debug_state32 x86_debug_state32_t; + + + + + +typedef struct __darwin_x86_thread_state64 x86_thread_state64_t; + + + +typedef struct __darwin_x86_float_state64 x86_float_state64_t; + + + +typedef struct __darwin_x86_avx_state64 x86_avx_state64_t; + + + +typedef struct __darwin_x86_exception_state64 x86_exception_state64_t; + + + + + +typedef struct __darwin_x86_debug_state64 x86_debug_state64_t; +struct x86_thread_state { + x86_state_hdr_t tsh; + union { + x86_thread_state32_t ts32; + x86_thread_state64_t ts64; + } uts; +}; + +struct x86_float_state { + x86_state_hdr_t fsh; + union { + x86_float_state32_t fs32; + x86_float_state64_t fs64; + } ufs; +}; + +struct x86_exception_state { + x86_state_hdr_t esh; + union { + x86_exception_state32_t es32; + x86_exception_state64_t es64; + } ues; +}; + +struct x86_debug_state { + x86_state_hdr_t dsh; + union { + x86_debug_state32_t ds32; + x86_debug_state64_t ds64; + } uds; +}; + +struct x86_avx_state { + x86_state_hdr_t ash; + union { + x86_avx_state32_t as32; + x86_avx_state64_t as64; + } ufs; +}; + +typedef struct x86_thread_state x86_thread_state_t; + + + +typedef struct x86_float_state x86_float_state_t; + + + +typedef struct x86_exception_state x86_exception_state_t; + + + +typedef struct x86_debug_state x86_debug_state_t; + + + +typedef struct x86_avx_state x86_avx_state_t; + + + + + +typedef natural_t *thread_state_t; + + +typedef natural_t thread_state_data_t[(224)]; + + + + + +typedef int thread_state_flavor_t; +typedef thread_state_flavor_t *thread_state_flavor_array_t; + + + + + +typedef int exception_type_t; +typedef integer_t exception_data_type_t; +typedef int64_t mach_exception_data_type_t; +typedef int exception_behavior_t; +typedef exception_data_type_t *exception_data_t; +typedef mach_exception_data_type_t *mach_exception_data_t; +typedef unsigned int exception_mask_t; +typedef exception_mask_t *exception_mask_array_t; +typedef exception_behavior_t *exception_behavior_array_t; +typedef thread_state_flavor_t *exception_flavor_array_t; +typedef mach_port_t *exception_port_array_t; +typedef mach_exception_data_type_t mach_exception_code_t; +typedef mach_exception_data_type_t mach_exception_subcode_t; + +typedef mach_port_t mach_voucher_t; + + +typedef mach_port_name_t mach_voucher_name_t; + + +typedef mach_voucher_name_t *mach_voucher_name_array_t; + + + + + + +typedef mach_voucher_t ipc_voucher_t; + + + + + + + +typedef uint32_t mach_voucher_selector_t; +typedef uint32_t mach_voucher_attr_key_t; +typedef mach_voucher_attr_key_t *mach_voucher_attr_key_array_t; +typedef uint8_t *mach_voucher_attr_content_t; +typedef uint32_t mach_voucher_attr_content_size_t; + + + + + +typedef uint32_t mach_voucher_attr_command_t; +typedef uint32_t mach_voucher_attr_recipe_command_t; +typedef mach_voucher_attr_recipe_command_t *mach_voucher_attr_recipe_command_array_t; + +typedef struct mach_voucher_attr_recipe_data { + mach_voucher_attr_key_t key; + mach_voucher_attr_recipe_command_t command; + mach_voucher_name_t previous_voucher; + mach_voucher_attr_content_size_t content_size; + uint8_t content[]; +} mach_voucher_attr_recipe_data_t; +typedef mach_voucher_attr_recipe_data_t *mach_voucher_attr_recipe_t; +typedef mach_msg_type_number_t mach_voucher_attr_recipe_size_t; + + +typedef uint8_t *mach_voucher_attr_raw_recipe_t; +typedef mach_voucher_attr_raw_recipe_t mach_voucher_attr_raw_recipe_array_t; +typedef mach_msg_type_number_t mach_voucher_attr_raw_recipe_size_t; +typedef mach_msg_type_number_t mach_voucher_attr_raw_recipe_array_size_t; + + + + +typedef mach_port_t mach_voucher_attr_manager_t; +typedef mach_port_t mach_voucher_attr_control_t; + + + + + + + +typedef mach_port_t ipc_voucher_attr_manager_t; +typedef mach_port_t ipc_voucher_attr_control_t; +typedef uint64_t mach_voucher_attr_value_handle_t; +typedef mach_voucher_attr_value_handle_t *mach_voucher_attr_value_handle_array_t; + +typedef mach_msg_type_number_t mach_voucher_attr_value_handle_array_size_t; + + +typedef uint32_t mach_voucher_attr_value_reference_t; +typedef uint32_t mach_voucher_attr_value_flags_t; + + + + +typedef uint32_t mach_voucher_attr_control_flags_t; +typedef uint32_t mach_voucher_attr_importance_refs; + + + + +typedef integer_t *processor_info_t; +typedef integer_t *processor_info_array_t; + + +typedef integer_t processor_info_data_t[(1024)]; + + +typedef integer_t *processor_set_info_t; + + +typedef integer_t processor_set_info_data_t[(1024)]; + + + + +typedef int processor_flavor_t; + + + + + +struct processor_basic_info { + cpu_type_t cpu_type; + cpu_subtype_t cpu_subtype; + boolean_t running; + int slot_num; + boolean_t is_master; +}; + +typedef struct processor_basic_info processor_basic_info_data_t; +typedef struct processor_basic_info *processor_basic_info_t; + + + +struct processor_cpu_load_info { + unsigned int cpu_ticks[4]; +}; + +typedef struct processor_cpu_load_info processor_cpu_load_info_data_t; +typedef struct processor_cpu_load_info *processor_cpu_load_info_t; +typedef int processor_set_flavor_t; + + +struct processor_set_basic_info { + int processor_count; + int default_policy; +}; + +typedef struct processor_set_basic_info processor_set_basic_info_data_t; +typedef struct processor_set_basic_info *processor_set_basic_info_t; + + + + + +struct processor_set_load_info { + int task_count; + int thread_count; + integer_t load_average; + integer_t mach_factor; +}; + +typedef struct processor_set_load_info processor_set_load_info_data_t; +typedef struct processor_set_load_info *processor_set_load_info_t; +typedef int policy_t; +typedef integer_t *policy_info_t; +typedef integer_t *policy_base_t; +typedef integer_t *policy_limit_t; +struct policy_timeshare_base { + integer_t base_priority; +}; +struct policy_timeshare_limit { + integer_t max_priority; +}; +struct policy_timeshare_info { + integer_t max_priority; + integer_t base_priority; + integer_t cur_priority; + boolean_t depressed; + integer_t depress_priority; +}; + +typedef struct policy_timeshare_base *policy_timeshare_base_t; +typedef struct policy_timeshare_limit *policy_timeshare_limit_t; +typedef struct policy_timeshare_info *policy_timeshare_info_t; + +typedef struct policy_timeshare_base policy_timeshare_base_data_t; +typedef struct policy_timeshare_limit policy_timeshare_limit_data_t; +typedef struct policy_timeshare_info policy_timeshare_info_data_t; +struct policy_rr_base { + integer_t base_priority; + integer_t quantum; +}; +struct policy_rr_limit { + integer_t max_priority; +}; +struct policy_rr_info { + integer_t max_priority; + integer_t base_priority; + integer_t quantum; + boolean_t depressed; + integer_t depress_priority; +}; + +typedef struct policy_rr_base *policy_rr_base_t; +typedef struct policy_rr_limit *policy_rr_limit_t; +typedef struct policy_rr_info *policy_rr_info_t; + +typedef struct policy_rr_base policy_rr_base_data_t; +typedef struct policy_rr_limit policy_rr_limit_data_t; +typedef struct policy_rr_info policy_rr_info_data_t; +struct policy_fifo_base { + integer_t base_priority; +}; +struct policy_fifo_limit { + integer_t max_priority; +}; +struct policy_fifo_info { + integer_t max_priority; + integer_t base_priority; + boolean_t depressed; + integer_t depress_priority; +}; + +typedef struct policy_fifo_base *policy_fifo_base_t; +typedef struct policy_fifo_limit *policy_fifo_limit_t; +typedef struct policy_fifo_info *policy_fifo_info_t; + +typedef struct policy_fifo_base policy_fifo_base_data_t; +typedef struct policy_fifo_limit policy_fifo_limit_data_t; +typedef struct policy_fifo_info policy_fifo_info_data_t; +struct policy_bases { + policy_timeshare_base_data_t ts; + policy_rr_base_data_t rr; + policy_fifo_base_data_t fifo; +}; + +struct policy_limits { + policy_timeshare_limit_data_t ts; + policy_rr_limit_data_t rr; + policy_fifo_limit_data_t fifo; +}; + +struct policy_infos { + policy_timeshare_info_data_t ts; + policy_rr_info_data_t rr; + policy_fifo_info_data_t fifo; +}; + +typedef struct policy_bases policy_base_data_t; +typedef struct policy_limits policy_limit_data_t; +typedef struct policy_infos policy_info_data_t; + + + + + + + + +typedef natural_t task_flavor_t; +typedef integer_t *task_info_t; + + + +typedef integer_t task_info_data_t[(1024)]; + + + + + + + + + + +struct task_basic_info_32 { + integer_t suspend_count; + natural_t virtual_size; + natural_t resident_size; + time_value_t user_time; + + time_value_t system_time; + + policy_t policy; +}; +typedef struct task_basic_info_32 task_basic_info_32_data_t; +typedef struct task_basic_info_32 *task_basic_info_32_t; + + + + +struct task_basic_info_64 { + integer_t suspend_count; + mach_vm_size_t virtual_size; + mach_vm_size_t resident_size; + time_value_t user_time; + + time_value_t system_time; + + policy_t policy; +}; +typedef struct task_basic_info_64 task_basic_info_64_data_t; +typedef struct task_basic_info_64 *task_basic_info_64_t; +struct task_basic_info { + integer_t suspend_count; + vm_size_t virtual_size; + vm_size_t resident_size; + time_value_t user_time; + + time_value_t system_time; + + policy_t policy; +}; + +typedef struct task_basic_info task_basic_info_data_t; +typedef struct task_basic_info *task_basic_info_t; +struct task_events_info { + integer_t faults; + integer_t pageins; + integer_t cow_faults; + integer_t messages_sent; + integer_t messages_received; + integer_t syscalls_mach; + integer_t syscalls_unix; + integer_t csw; +}; +typedef struct task_events_info task_events_info_data_t; +typedef struct task_events_info *task_events_info_t; + + + + + + +struct task_thread_times_info { + time_value_t user_time; + + time_value_t system_time; + +}; + +typedef struct task_thread_times_info task_thread_times_info_data_t; +typedef struct task_thread_times_info *task_thread_times_info_t; + + + + + +struct task_absolutetime_info { + uint64_t total_user; + uint64_t total_system; + uint64_t threads_user; + uint64_t threads_system; +}; + +typedef struct task_absolutetime_info task_absolutetime_info_data_t; +typedef struct task_absolutetime_info *task_absolutetime_info_t; + + + + + +struct task_kernelmemory_info { + uint64_t total_palloc; + uint64_t total_pfree; + uint64_t total_salloc; + uint64_t total_sfree; +}; + +typedef struct task_kernelmemory_info task_kernelmemory_info_data_t; +typedef struct task_kernelmemory_info *task_kernelmemory_info_t; +struct task_affinity_tag_info { + integer_t set_count; + integer_t min; + integer_t max; + integer_t task_count; +}; +typedef struct task_affinity_tag_info task_affinity_tag_info_data_t; +typedef struct task_affinity_tag_info *task_affinity_tag_info_t; + + + + + +struct task_dyld_info { + mach_vm_address_t all_image_info_addr; + mach_vm_size_t all_image_info_size; + integer_t all_image_info_format; +}; +typedef struct task_dyld_info task_dyld_info_data_t; +typedef struct task_dyld_info *task_dyld_info_t; +struct task_extmod_info { + unsigned char task_uuid[16]; + vm_extmod_statistics_data_t extmod_statistics; +}; +typedef struct task_extmod_info task_extmod_info_data_t; +typedef struct task_extmod_info *task_extmod_info_t; + + + + + +struct mach_task_basic_info { + mach_vm_size_t virtual_size; + mach_vm_size_t resident_size; + mach_vm_size_t resident_size_max; + time_value_t user_time; + + time_value_t system_time; + + policy_t policy; + integer_t suspend_count; +}; +typedef struct mach_task_basic_info mach_task_basic_info_data_t; +typedef struct mach_task_basic_info *mach_task_basic_info_t; + + + + + + +struct task_power_info { + uint64_t total_user; + uint64_t total_system; + uint64_t task_interrupt_wakeups; + uint64_t task_platform_idle_wakeups; + uint64_t task_timer_wakeups_bin_1; + uint64_t task_timer_wakeups_bin_2; +}; + +typedef struct task_power_info task_power_info_data_t; +typedef struct task_power_info *task_power_info_t; + + + + + + + +struct task_vm_info { + mach_vm_size_t virtual_size; + integer_t region_count; + integer_t page_size; + mach_vm_size_t resident_size; + mach_vm_size_t resident_size_peak; + + mach_vm_size_t device; + mach_vm_size_t device_peak; + mach_vm_size_t internal; + mach_vm_size_t internal_peak; + mach_vm_size_t external; + mach_vm_size_t external_peak; + mach_vm_size_t reusable; + mach_vm_size_t reusable_peak; + mach_vm_size_t purgeable_volatile_pmap; + mach_vm_size_t purgeable_volatile_resident; + mach_vm_size_t purgeable_volatile_virtual; + mach_vm_size_t compressed; + mach_vm_size_t compressed_peak; + mach_vm_size_t compressed_lifetime; + + + mach_vm_size_t phys_footprint; + + + mach_vm_address_t min_address; + mach_vm_address_t max_address; +}; +typedef struct task_vm_info task_vm_info_data_t; +typedef struct task_vm_info *task_vm_info_t; +typedef struct vm_purgeable_info task_purgable_info_t; + + + +struct task_trace_memory_info { + uint64_t user_memory_address; + uint64_t buffer_size; + uint64_t mailbox_array_size; +}; +typedef struct task_trace_memory_info task_trace_memory_info_data_t; +typedef struct task_trace_memory_info * task_trace_memory_info_t; + + + + +struct task_wait_state_info { + uint64_t total_wait_state_time; + uint64_t total_wait_sfi_state_time; + uint32_t _reserved[4]; +}; +typedef struct task_wait_state_info task_wait_state_info_data_t; +typedef struct task_wait_state_info * task_wait_state_info_t; + + + + + +typedef struct { + uint64_t task_gpu_utilisation; + uint64_t task_gpu_stat_reserved0; + uint64_t task_gpu_stat_reserved1; + uint64_t task_gpu_stat_reserved2; +} gpu_energy_data; + +typedef gpu_energy_data *gpu_energy_data_t; +struct task_power_info_v2 { + task_power_info_data_t cpu_energy; + gpu_energy_data gpu_energy; +}; + +typedef struct task_power_info_v2 task_power_info_v2_data_t; +typedef struct task_power_info_v2 *task_power_info_v2_t; +struct task_flags_info { + uint32_t flags; +}; +typedef struct task_flags_info task_flags_info_data_t; +typedef struct task_flags_info * task_flags_info_t; +typedef natural_t task_policy_flavor_t; +typedef integer_t *task_policy_t; +enum task_role { + TASK_RENICED = -1, + TASK_UNSPECIFIED = 0, + TASK_FOREGROUND_APPLICATION, + TASK_BACKGROUND_APPLICATION, + TASK_CONTROL_APPLICATION, + TASK_GRAPHICS_SERVER, + TASK_THROTTLE_APPLICATION, + TASK_NONUI_APPLICATION, + TASK_DEFAULT_APPLICATION +}; + +typedef integer_t task_role_t; + +struct task_category_policy { + task_role_t role; +}; + +typedef struct task_category_policy task_category_policy_data_t; +typedef struct task_category_policy *task_category_policy_t; + + + + + +enum task_latency_qos { + LATENCY_QOS_TIER_UNSPECIFIED = 0x0, + LATENCY_QOS_TIER_0 = ((0xFF<<16) | 1), + LATENCY_QOS_TIER_1 = ((0xFF<<16) | 2), + LATENCY_QOS_TIER_2 = ((0xFF<<16) | 3), + LATENCY_QOS_TIER_3 = ((0xFF<<16) | 4), + LATENCY_QOS_TIER_4 = ((0xFF<<16) | 5), + LATENCY_QOS_TIER_5 = ((0xFF<<16) | 6) + +}; +typedef integer_t task_latency_qos_t; +enum task_throughput_qos { + THROUGHPUT_QOS_TIER_UNSPECIFIED = 0x0, + THROUGHPUT_QOS_TIER_0 = ((0xFE<<16) | 1), + THROUGHPUT_QOS_TIER_1 = ((0xFE<<16) | 2), + THROUGHPUT_QOS_TIER_2 = ((0xFE<<16) | 3), + THROUGHPUT_QOS_TIER_3 = ((0xFE<<16) | 4), + THROUGHPUT_QOS_TIER_4 = ((0xFE<<16) | 5), + THROUGHPUT_QOS_TIER_5 = ((0xFE<<16) | 6), +}; + + + + +typedef integer_t task_throughput_qos_t; + +struct task_qos_policy { + task_latency_qos_t task_latency_qos_tier; + task_throughput_qos_t task_throughput_qos_tier; +}; + +typedef struct task_qos_policy *task_qos_policy_t; +typedef int task_special_port_t; +typedef natural_t thread_flavor_t; +typedef integer_t *thread_info_t; + + +typedef integer_t thread_info_data_t[(32)]; + + + + + + +struct thread_basic_info { + time_value_t user_time; + time_value_t system_time; + integer_t cpu_usage; + policy_t policy; + integer_t run_state; + integer_t flags; + integer_t suspend_count; + integer_t sleep_time; + +}; + +typedef struct thread_basic_info thread_basic_info_data_t; +typedef struct thread_basic_info *thread_basic_info_t; + + + + + +struct thread_identifier_info { + uint64_t thread_id; + uint64_t thread_handle; + uint64_t dispatch_qaddr; +}; + +typedef struct thread_identifier_info thread_identifier_info_data_t; +typedef struct thread_identifier_info *thread_identifier_info_t; +struct thread_extended_info { + uint64_t pth_user_time; + uint64_t pth_system_time; + int32_t pth_cpu_usage; + int32_t pth_policy; + int32_t pth_run_state; + int32_t pth_flags; + int32_t pth_sleep_time; + int32_t pth_curpri; + int32_t pth_priority; + int32_t pth_maxpriority; + char pth_name[64]; +}; +typedef struct thread_extended_info thread_extended_info_data_t; +typedef struct thread_extended_info * thread_extended_info_t; +struct io_stat_entry { + uint64_t count; + uint64_t size; +}; + +struct io_stat_info { + struct io_stat_entry disk_reads; + struct io_stat_entry io_priority[4]; + struct io_stat_entry paging; + struct io_stat_entry metadata; + struct io_stat_entry total_io; +}; + +typedef struct io_stat_info *io_stat_info_t; +typedef natural_t thread_policy_flavor_t; +typedef integer_t *thread_policy_t; +struct thread_standard_policy { + natural_t no_data; +}; + +typedef struct thread_standard_policy thread_standard_policy_data_t; +typedef struct thread_standard_policy *thread_standard_policy_t; +struct thread_extended_policy { + boolean_t timeshare; +}; + +typedef struct thread_extended_policy thread_extended_policy_data_t; +typedef struct thread_extended_policy *thread_extended_policy_t; +struct thread_time_constraint_policy { + uint32_t period; + uint32_t computation; + uint32_t constraint; + boolean_t preemptible; +}; + +typedef struct thread_time_constraint_policy thread_time_constraint_policy_data_t; + +typedef struct thread_time_constraint_policy *thread_time_constraint_policy_t; +struct thread_precedence_policy { + integer_t importance; +}; + +typedef struct thread_precedence_policy thread_precedence_policy_data_t; +typedef struct thread_precedence_policy *thread_precedence_policy_t; +struct thread_affinity_policy { + integer_t affinity_tag; +}; + + + +typedef struct thread_affinity_policy thread_affinity_policy_data_t; +typedef struct thread_affinity_policy *thread_affinity_policy_t; +struct thread_background_policy { + integer_t priority; +}; + + + +typedef struct thread_background_policy thread_background_policy_data_t; +typedef struct thread_background_policy *thread_background_policy_t; + + + + + + +typedef integer_t thread_latency_qos_t; + +struct thread_latency_qos_policy { + thread_latency_qos_t thread_latency_qos_tier; +}; + +typedef struct thread_latency_qos_policy thread_latency_qos_policy_data_t; +typedef struct thread_latency_qos_policy *thread_latency_qos_policy_t; + + + + + +typedef integer_t thread_throughput_qos_t; + +struct thread_throughput_qos_policy { + thread_throughput_qos_t thread_throughput_qos_tier; +}; + +typedef struct thread_throughput_qos_policy thread_throughput_qos_policy_data_t; +typedef struct thread_throughput_qos_policy *thread_throughput_qos_policy_t; + + + +typedef unsigned int vm_machine_attribute_t; +typedef int vm_machine_attribute_val_t; +typedef unsigned int vm_inherit_t; +typedef int vm_purgable_t; +typedef int vm_behavior_t; + + + + + + + + + + + + + +typedef uint32_t vm32_object_id_t; +typedef int *vm_region_info_t; +typedef int *vm_region_info_64_t; +typedef int *vm_region_recurse_info_t; +typedef int *vm_region_recurse_info_64_t; +typedef int vm_region_flavor_t; +typedef int vm_region_info_data_t[(1024)]; + + +struct vm_region_basic_info_64 { + vm_prot_t protection; + vm_prot_t max_protection; + vm_inherit_t inheritance; + boolean_t shared; + boolean_t reserved; + memory_object_offset_t offset; + vm_behavior_t behavior; + unsigned short user_wired_count; +}; +typedef struct vm_region_basic_info_64 *vm_region_basic_info_64_t; +typedef struct vm_region_basic_info_64 vm_region_basic_info_data_64_t; +struct vm_region_basic_info { + vm_prot_t protection; + vm_prot_t max_protection; + vm_inherit_t inheritance; + boolean_t shared; + boolean_t reserved; + uint32_t offset; + vm_behavior_t behavior; + unsigned short user_wired_count; +}; + +typedef struct vm_region_basic_info *vm_region_basic_info_t; +typedef struct vm_region_basic_info vm_region_basic_info_data_t; +struct vm_region_extended_info { + vm_prot_t protection; + unsigned int user_tag; + unsigned int pages_resident; + unsigned int pages_shared_now_private; + unsigned int pages_swapped_out; + unsigned int pages_dirtied; + unsigned int ref_count; + unsigned short shadow_depth; + unsigned char external_pager; + unsigned char share_mode; + unsigned int pages_reusable; +}; +typedef struct vm_region_extended_info *vm_region_extended_info_t; +typedef struct vm_region_extended_info vm_region_extended_info_data_t; +struct vm_region_top_info { + unsigned int obj_id; + unsigned int ref_count; + unsigned int private_pages_resident; + unsigned int shared_pages_resident; + unsigned char share_mode; +}; + +typedef struct vm_region_top_info *vm_region_top_info_t; +typedef struct vm_region_top_info vm_region_top_info_data_t; +struct vm_region_submap_info { + vm_prot_t protection; + vm_prot_t max_protection; + vm_inherit_t inheritance; + uint32_t offset; + unsigned int user_tag; + unsigned int pages_resident; + unsigned int pages_shared_now_private; + unsigned int pages_swapped_out; + unsigned int pages_dirtied; + unsigned int ref_count; + unsigned short shadow_depth; + unsigned char external_pager; + unsigned char share_mode; + boolean_t is_submap; + vm_behavior_t behavior; + vm32_object_id_t object_id; + unsigned short user_wired_count; +}; + +typedef struct vm_region_submap_info *vm_region_submap_info_t; +typedef struct vm_region_submap_info vm_region_submap_info_data_t; + + + + + +struct vm_region_submap_info_64 { + vm_prot_t protection; + vm_prot_t max_protection; + vm_inherit_t inheritance; + memory_object_offset_t offset; + unsigned int user_tag; + unsigned int pages_resident; + unsigned int pages_shared_now_private; + unsigned int pages_swapped_out; + unsigned int pages_dirtied; + unsigned int ref_count; + unsigned short shadow_depth; + unsigned char external_pager; + unsigned char share_mode; + boolean_t is_submap; + vm_behavior_t behavior; + vm32_object_id_t object_id; + unsigned short user_wired_count; + unsigned int pages_reusable; +}; + +typedef struct vm_region_submap_info_64 *vm_region_submap_info_64_t; +typedef struct vm_region_submap_info_64 vm_region_submap_info_data_64_t; +struct vm_region_submap_short_info_64 { + vm_prot_t protection; + vm_prot_t max_protection; + vm_inherit_t inheritance; + memory_object_offset_t offset; + unsigned int user_tag; + unsigned int ref_count; + unsigned short shadow_depth; + unsigned char external_pager; + unsigned char share_mode; + boolean_t is_submap; + vm_behavior_t behavior; + vm32_object_id_t object_id; + unsigned short user_wired_count; +}; + +typedef struct vm_region_submap_short_info_64 *vm_region_submap_short_info_64_t; +typedef struct vm_region_submap_short_info_64 vm_region_submap_short_info_data_64_t; + + + + + + + +struct mach_vm_read_entry { + mach_vm_address_t address; + mach_vm_size_t size; +}; + +struct vm_read_entry { + vm_address_t address; + vm_size_t size; +}; +typedef struct mach_vm_read_entry mach_vm_read_entry_t[(256)]; +typedef struct vm_read_entry vm_read_entry_t[(256)]; + + + + + + + +typedef int *vm_page_info_t; +typedef int vm_page_info_data_t[]; +typedef int vm_page_info_flavor_t; + + +struct vm_page_info_basic { + int disposition; + int ref_count; + vm_object_id_t object_id; + memory_object_offset_t offset; + int depth; + int __pad; +}; +typedef struct vm_page_info_basic *vm_page_info_basic_t; +typedef struct vm_page_info_basic vm_page_info_basic_data_t; +typedef int kmod_t; + +struct kmod_info; +typedef kern_return_t kmod_start_func_t(struct kmod_info * ki, void * data); +typedef kern_return_t kmod_stop_func_t(struct kmod_info * ki, void * data); + + +typedef struct kmod_reference { + struct kmod_reference * next; + struct kmod_info * info; +} kmod_reference_t; +typedef struct kmod_info { + struct kmod_info * next; + int32_t info_version; + uint32_t id; + char name[64]; + char version[64]; + int32_t reference_count; + kmod_reference_t * reference_list; + vm_address_t address; + vm_size_t size; + vm_size_t hdr_size; + kmod_start_func_t * start; + kmod_stop_func_t * stop; +} kmod_info_t; + + + +typedef struct kmod_info_32_v1 { + uint32_t next_addr; + int32_t info_version; + uint32_t id; + uint8_t name[64]; + uint8_t version[64]; + int32_t reference_count; + uint32_t reference_list_addr; + uint32_t address; + uint32_t size; + uint32_t hdr_size; + uint32_t start_addr; + uint32_t stop_addr; +} kmod_info_32_v1_t; + + + +typedef struct kmod_info_64_v1 { + uint64_t next_addr; + int32_t info_version; + uint32_t id; + uint8_t name[64]; + uint8_t version[64]; + int32_t reference_count; + uint64_t reference_list_addr; + uint64_t address; + uint64_t size; + uint64_t hdr_size; + uint64_t start_addr; + uint64_t stop_addr; +} kmod_info_64_v1_t; + +typedef void * kmod_args_t; +typedef int kmod_control_flavor_t; +typedef kmod_info_t * kmod_info_array_t; +typedef struct fsid { int32_t val[2]; } fsid_t; + +typedef struct fsobj_id { + u_int32_t fid_objno; + u_int32_t fid_generation; +} fsobj_id_t; + + + + + + +struct dyld_kernel_image_info { + uuid_t uuid; + fsobj_id_t fsobjid; + fsid_t fsid; + uint64_t load_addr; +}; + +struct dyld_kernel_process_info { + struct dyld_kernel_image_info cache_image_info; + uint64_t timestamp; + uint32_t imageCount; + uint32_t initialImageCount; + uint8_t dyldState; + boolean_t no_cache; + boolean_t private_cache; +}; + + + +typedef struct dyld_kernel_image_info dyld_kernel_image_info_t; +typedef struct dyld_kernel_process_info dyld_kernel_process_info_t; +typedef dyld_kernel_image_info_t *dyld_kernel_image_info_array_t; + + + + + + +typedef mach_port_t task_t; +typedef mach_port_t task_name_t; +typedef mach_port_t task_suspension_token_t; +typedef mach_port_t thread_t; +typedef mach_port_t thread_act_t; +typedef mach_port_t ipc_space_t; +typedef mach_port_t coalition_t; +typedef mach_port_t host_t; +typedef mach_port_t host_priv_t; +typedef mach_port_t host_security_t; +typedef mach_port_t processor_t; +typedef mach_port_t processor_set_t; +typedef mach_port_t processor_set_control_t; +typedef mach_port_t semaphore_t; +typedef mach_port_t lock_set_t; +typedef mach_port_t ledger_t; +typedef mach_port_t alarm_t; +typedef mach_port_t clock_serv_t; +typedef mach_port_t clock_ctrl_t; + + + + + + + +typedef processor_set_t processor_set_name_t; + + + + +typedef mach_port_t clock_reply_t; +typedef mach_port_t bootstrap_t; +typedef mach_port_t mem_entry_name_port_t; +typedef mach_port_t exception_handler_t; +typedef exception_handler_t *exception_handler_array_t; +typedef mach_port_t vm_task_entry_t; +typedef mach_port_t io_master_t; +typedef mach_port_t UNDServerRef; +typedef task_t *task_array_t; +typedef thread_t *thread_array_t; +typedef processor_set_t *processor_set_array_t; +typedef processor_set_t *processor_set_name_array_t; +typedef processor_t *processor_array_t; +typedef thread_act_t *thread_act_array_t; +typedef ledger_t *ledger_array_t; + + + + + + + +typedef task_t task_port_t; +typedef task_array_t task_port_array_t; +typedef thread_t thread_port_t; +typedef thread_array_t thread_port_array_t; +typedef ipc_space_t ipc_space_port_t; +typedef host_t host_name_t; +typedef host_t host_name_port_t; +typedef processor_set_t processor_set_port_t; +typedef processor_set_t processor_set_name_port_t; +typedef processor_set_array_t processor_set_name_port_array_t; +typedef processor_set_t processor_set_control_port_t; +typedef processor_t processor_port_t; +typedef processor_array_t processor_port_array_t; +typedef thread_act_t thread_act_port_t; +typedef thread_act_array_t thread_act_port_array_t; +typedef semaphore_t semaphore_port_t; +typedef lock_set_t lock_set_port_t; +typedef ledger_t ledger_port_t; +typedef ledger_array_t ledger_port_array_t; +typedef alarm_t alarm_port_t; +typedef clock_serv_t clock_serv_port_t; +typedef clock_ctrl_t clock_ctrl_port_t; +typedef exception_handler_t exception_port_t; +typedef exception_handler_array_t exception_port_arrary_t; +typedef natural_t ledger_item_t; + + +typedef int64_t ledger_amount_t; + + +typedef mach_vm_offset_t *emulation_vector_t; +typedef char *user_subsystem_t; + +typedef char *labelstr_t; +extern vm_size_t vm_page_size; +extern vm_size_t vm_page_mask; +extern int vm_page_shift; +extern vm_size_t vm_kernel_page_size __attribute__((availability(macosx,introduced=10.9))); +extern vm_size_t vm_kernel_page_mask __attribute__((availability(macosx,introduced=10.9))); +extern int vm_kernel_page_shift __attribute__((availability(macosx,introduced=10.9))); +extern mach_port_t mach_host_self(void); +extern mach_port_t mach_thread_self(void); +extern kern_return_t host_page_size(host_t, vm_size_t *); + +extern mach_port_t mach_task_self_; + + + + + +extern kern_return_t clock_sleep_trap( + mach_port_name_t clock_name, + sleep_type_t sleep_type, + int sleep_sec, + int sleep_nsec, + mach_timespec_t *wakeup_time); + +extern kern_return_t _kernelrpc_mach_vm_allocate_trap( + mach_port_name_t target, + mach_vm_offset_t *addr, + mach_vm_size_t size, + int flags); + +extern kern_return_t _kernelrpc_mach_vm_deallocate_trap( + mach_port_name_t target, + mach_vm_address_t address, + mach_vm_size_t size +); + +extern kern_return_t _kernelrpc_mach_vm_protect_trap( + mach_port_name_t target, + mach_vm_address_t address, + mach_vm_size_t size, + boolean_t set_maximum, + vm_prot_t new_protection +); + +extern kern_return_t _kernelrpc_mach_vm_map_trap( + mach_port_name_t target, + mach_vm_offset_t *address, + mach_vm_size_t size, + mach_vm_offset_t mask, + int flags, + vm_prot_t cur_protection +); + +extern kern_return_t _kernelrpc_mach_vm_purgable_control_trap( + mach_port_name_t target, + mach_vm_offset_t address, + vm_purgable_t control, + int *state); + +extern kern_return_t _kernelrpc_mach_port_allocate_trap( + mach_port_name_t target, + mach_port_right_t right, + mach_port_name_t *name +); + + +extern kern_return_t _kernelrpc_mach_port_destroy_trap( + mach_port_name_t target, + mach_port_name_t name +); + +extern kern_return_t _kernelrpc_mach_port_deallocate_trap( + mach_port_name_t target, + mach_port_name_t name +); + +extern kern_return_t _kernelrpc_mach_port_mod_refs_trap( + mach_port_name_t target, + mach_port_name_t name, + mach_port_right_t right, + mach_port_delta_t delta +); + +extern kern_return_t _kernelrpc_mach_port_move_member_trap( + mach_port_name_t target, + mach_port_name_t member, + mach_port_name_t after +); + +extern kern_return_t _kernelrpc_mach_port_insert_right_trap( + mach_port_name_t target, + mach_port_name_t name, + mach_port_name_t poly, + mach_msg_type_name_t polyPoly +); + +extern kern_return_t _kernelrpc_mach_port_insert_member_trap( + mach_port_name_t target, + mach_port_name_t name, + mach_port_name_t pset +); + +extern kern_return_t _kernelrpc_mach_port_extract_member_trap( + mach_port_name_t target, + mach_port_name_t name, + mach_port_name_t pset +); + +extern kern_return_t _kernelrpc_mach_port_construct_trap( + mach_port_name_t target, + mach_port_options_t *options, + uint64_t context, + mach_port_name_t *name +); + +extern kern_return_t _kernelrpc_mach_port_destruct_trap( + mach_port_name_t target, + mach_port_name_t name, + mach_port_delta_t srdelta, + uint64_t guard +); + +extern kern_return_t _kernelrpc_mach_port_guard_trap( + mach_port_name_t target, + mach_port_name_t name, + uint64_t guard, + boolean_t strict +); + +extern kern_return_t _kernelrpc_mach_port_unguard_trap( + mach_port_name_t target, + mach_port_name_t name, + uint64_t guard +); + +extern kern_return_t mach_generate_activity_id( + mach_port_name_t target, + int count, + uint64_t *activity_id +); + +extern kern_return_t macx_swapon( + uint64_t filename, + int flags, + int size, + int priority); + +extern kern_return_t macx_swapoff( + uint64_t filename, + int flags); + +extern kern_return_t macx_triggers( + int hi_water, + int low_water, + int flags, + mach_port_t alert_port); + +extern kern_return_t macx_backing_store_suspend( + boolean_t suspend); + +extern kern_return_t macx_backing_store_recovery( + int pid); + +extern boolean_t swtch_pri(int pri); + +extern boolean_t swtch(void); + +extern kern_return_t thread_switch( + mach_port_name_t thread_name, + int option, + mach_msg_timeout_t option_time); + +extern mach_port_name_t task_self_trap(void); + +extern kern_return_t host_create_mach_voucher_trap( + mach_port_name_t host, + mach_voucher_attr_raw_recipe_array_t recipes, + int recipes_size, + mach_port_name_t *voucher); + +extern kern_return_t mach_voucher_extract_attr_recipe_trap( + mach_port_name_t voucher_name, + mach_voucher_attr_key_t key, + mach_voucher_attr_raw_recipe_t recipe, + mach_msg_type_number_t *recipe_size); + + + + + +extern kern_return_t task_for_pid( + mach_port_name_t target_tport, + int pid, + mach_port_name_t *t); + +extern kern_return_t task_name_for_pid( + mach_port_name_t target_tport, + int pid, + mach_port_name_t *tn); + +extern kern_return_t pid_for_task( + mach_port_name_t t, + int *x); + + + + + + +extern mach_port_t bootstrap_port; +extern int (*vprintf_stderr_func)(const char *format, va_list ap); + + + + + +typedef kern_return_t mach_error_t; +typedef mach_error_t (* mach_error_fn_t)( void ); + +typedef kern_return_t IOReturn; +typedef unsigned int UInt; +typedef signed int SInt; + + +typedef UInt32 IOOptionBits; +typedef SInt32 IOFixed; +typedef UInt32 IOVersion; +typedef UInt32 IOItemCount; +typedef UInt32 IOCacheMode; + +typedef UInt32 IOByteCount32; +typedef UInt64 IOByteCount64; + +typedef UInt32 IOPhysicalAddress32; +typedef UInt64 IOPhysicalAddress64; +typedef UInt32 IOPhysicalLength32; +typedef UInt64 IOPhysicalLength64; + + +typedef mach_vm_address_t IOVirtualAddress; + + + + + + + +typedef IOByteCount32 IOByteCount; + + +typedef IOVirtualAddress IOLogicalAddress; +typedef IOPhysicalAddress32 IOPhysicalAddress; +typedef IOPhysicalLength32 IOPhysicalLength; + + + + + + +typedef struct +{ + IOPhysicalAddress address; + IOByteCount length; +} IOPhysicalRange; + +typedef struct +{ + IOVirtualAddress address; + IOByteCount length; +} IOVirtualRange; + + +typedef IOVirtualRange IOAddressRange; +typedef struct { + int value; + const char *name; +} IONamedValue; + + + + + +typedef unsigned int IOAlignment; +typedef mach_port_t io_object_t; + + + +typedef char * io_buf_ptr_t; +typedef char io_name_t[128]; +typedef char io_string_t[512]; +typedef char io_string_inband_t[4096]; +typedef char io_struct_inband_t[4096]; + + +typedef uint64_t io_user_scalar_t; +typedef uint64_t io_user_reference_t; +typedef io_user_scalar_t io_scalar_inband_t[16]; +typedef io_user_reference_t io_async_ref_t[8]; +typedef io_user_scalar_t io_scalar_inband64_t[16]; +typedef io_user_reference_t io_async_ref64_t[8]; + +typedef io_object_t io_connect_t; +typedef io_object_t io_enumerator_t; +typedef io_object_t io_iterator_t; +typedef io_object_t io_registry_entry_t; +typedef io_object_t io_service_t; + + + + + + +enum { + kIODefaultMemoryType = 0 +}; + +enum { + kIODefaultCache = 0, + kIOInhibitCache = 1, + kIOWriteThruCache = 2, + kIOCopybackCache = 3, + kIOWriteCombineCache = 4, + kIOCopybackInnerCache = 5 +}; + + +enum { + kIOMapAnywhere = 0x00000001, + + kIOMapCacheMask = 0x00000700, + kIOMapCacheShift = 8, + kIOMapDefaultCache = kIODefaultCache << kIOMapCacheShift, + kIOMapInhibitCache = kIOInhibitCache << kIOMapCacheShift, + kIOMapWriteThruCache = kIOWriteThruCache << kIOMapCacheShift, + kIOMapCopybackCache = kIOCopybackCache << kIOMapCacheShift, + kIOMapWriteCombineCache = kIOWriteCombineCache << kIOMapCacheShift, + kIOMapCopybackInnerCache = kIOCopybackInnerCache << kIOMapCacheShift, + + kIOMapUserOptionsMask = 0x00000fff, + + kIOMapReadOnly = 0x00001000, + + kIOMapStatic = 0x01000000, + kIOMapReference = 0x02000000, + kIOMapUnique = 0x04000000, + kIOMapPrefault = 0x10000000, + kIOMapOverwrite = 0x20000000 +}; +enum { + kNanosecondScale = 1, + kMicrosecondScale = 1000, + kMillisecondScale = 1000 * 1000, + kSecondScale = 1000 * 1000 * 1000, + kTickScale = (kSecondScale / 100) +}; + +enum { + kIOConnectMethodVarOutputSize = -3 +}; + + + + +typedef unsigned int IODeviceNumber; + +enum { + kFirstIOKitNotificationType = 100, + kIOServicePublishNotificationType = 100, + kIOServiceMatchedNotificationType = 101, + kIOServiceTerminatedNotificationType = 102, + kIOAsyncCompletionNotificationType = 150, + kIOServiceMessageNotificationType = 160, + kLastIOKitNotificationType = 199, + + + kIOKitNoticationTypeMask = 0x00000FFF, + kIOKitNoticationTypeSizeAdjShift = 30, + kIOKitNoticationMsgSizeMask = 3, +}; + +enum { + kOSNotificationMessageID = 53, + kOSAsyncCompleteMessageID = 57, + kMaxAsyncArgs = 16 +}; + +enum { + kIOAsyncReservedIndex = 0, + kIOAsyncReservedCount, + + kIOAsyncCalloutFuncIndex = kIOAsyncReservedCount, + kIOAsyncCalloutRefconIndex, + kIOAsyncCalloutCount, + + kIOMatchingCalloutFuncIndex = kIOAsyncReservedCount, + kIOMatchingCalloutRefconIndex, + kIOMatchingCalloutCount, + + kIOInterestCalloutFuncIndex = kIOAsyncReservedCount, + kIOInterestCalloutRefconIndex, + kIOInterestCalloutServiceIndex, + kIOInterestCalloutCount +}; + + + + +enum { + kOSAsyncRef64Count = 8, + kOSAsyncRef64Size = kOSAsyncRef64Count * ((int) sizeof(io_user_reference_t)) +}; +typedef io_user_reference_t OSAsyncReference64[kOSAsyncRef64Count]; + +struct OSNotificationHeader64 { + mach_msg_size_t size; + natural_t type; + OSAsyncReference64 reference; + + + unsigned char content[]; + + + +}; + +struct IOServiceInterestContent64 { + natural_t messageType; + io_user_reference_t messageArgument[1]; +}; + + + + +enum { + kOSAsyncRefCount = 8, + kOSAsyncRefSize = 32 +}; +typedef natural_t OSAsyncReference[kOSAsyncRefCount]; + +struct OSNotificationHeader { + mach_msg_size_t size; + natural_t type; + OSAsyncReference reference; + + + unsigned char content[]; + + + +}; + +struct IOServiceInterestContent { + natural_t messageType; + void * messageArgument[1]; +}; + + + +struct IOAsyncCompletionContent { + IOReturn result; + + void * args[] __attribute__ ((packed)); + + + +}; + + +typedef struct OSNotificationHeader OSNotificationHeader; +typedef struct IOServiceInterestContent IOServiceInterestContent; +typedef struct IOAsyncCompletionContent IOAsyncCompletionContent; +typedef struct IONotificationPort * IONotificationPortRef; + + + + + + + +typedef void +(*IOServiceMatchingCallback)( + void * refcon, + io_iterator_t iterator ); +typedef void +(*IOServiceInterestCallback)( + void * refcon, + io_service_t service, + uint32_t messageType, + void * messageArgument ); +extern +const mach_port_t kIOMasterPortDefault; +kern_return_t +IOMasterPort( mach_port_t bootstrapPort, + mach_port_t * masterPort ); +IONotificationPortRef +IONotificationPortCreate( + mach_port_t masterPort ); +void +IONotificationPortDestroy( + IONotificationPortRef notify ); +CFRunLoopSourceRef +IONotificationPortGetRunLoopSource( + IONotificationPortRef notify ); +mach_port_t +IONotificationPortGetMachPort( + IONotificationPortRef notify ); + + + + + + + +void +IONotificationPortSetDispatchQueue( + IONotificationPortRef notify, dispatch_queue_t queue ) +__attribute__((availability(macosx,introduced=10.6))); +void +IODispatchCalloutFromMessage( + void *unused, + mach_msg_header_t *msg, + void *reference ); +kern_return_t +IOCreateReceivePort( uint32_t msgType, mach_port_t * recvPort ); +kern_return_t +IOObjectRelease( + io_object_t object ); + + + + + + + +kern_return_t +IOObjectRetain( + io_object_t object ); +kern_return_t +IOObjectGetClass( + io_object_t object, + io_name_t className ); + + + + + + + +CFStringRef +IOObjectCopyClass(io_object_t object) +__attribute__((availability(macosx,introduced=10.4))); + + + + + + + +CFStringRef +IOObjectCopySuperclassForClass(CFStringRef classname) +__attribute__((availability(macosx,introduced=10.4))); + + + + + + + +CFStringRef +IOObjectCopyBundleIdentifierForClass(CFStringRef classname) +__attribute__((availability(macosx,introduced=10.4))); +boolean_t +IOObjectConformsTo( + io_object_t object, + const io_name_t className ); +boolean_t +IOObjectIsEqualTo( + io_object_t object, + io_object_t anObject ); + + + + + + + +uint32_t +IOObjectGetKernelRetainCount( + io_object_t object ) +__attribute__((availability(macosx,introduced=10.6))); + + + + + + + +uint32_t +IOObjectGetUserRetainCount( + io_object_t object ) +__attribute__((availability(macosx,introduced=10.6))); + + + + + + + +uint32_t +IOObjectGetRetainCount( + io_object_t object ); +io_object_t +IOIteratorNext( + io_iterator_t iterator ); + + + + + + +void +IOIteratorReset( + io_iterator_t iterator ); + + + + + + + +boolean_t +IOIteratorIsValid( + io_iterator_t iterator ); +io_service_t +IOServiceGetMatchingService( + mach_port_t masterPort, + CFDictionaryRef matching __attribute__((cf_consumed))); +kern_return_t +IOServiceGetMatchingServices( + mach_port_t masterPort, + CFDictionaryRef matching __attribute__((cf_consumed)), + io_iterator_t * existing ); + + +kern_return_t +IOServiceAddNotification( + mach_port_t masterPort, + const io_name_t notificationType, + CFDictionaryRef matching, + mach_port_t wakePort, + uintptr_t reference, + io_iterator_t * notification ) __attribute__((deprecated)); +kern_return_t +IOServiceAddMatchingNotification( + IONotificationPortRef notifyPort, + const io_name_t notificationType, + CFDictionaryRef matching __attribute__((cf_consumed)), + IOServiceMatchingCallback callback, + void * refCon, + io_iterator_t * notification ); +kern_return_t +IOServiceAddInterestNotification( + IONotificationPortRef notifyPort, + io_service_t service, + const io_name_t interestType, + IOServiceInterestCallback callback, + void * refCon, + io_object_t * notification ); +kern_return_t +IOServiceMatchPropertyTable( + io_service_t service, + CFDictionaryRef matching, + boolean_t * matches ); +kern_return_t +IOServiceGetBusyState( + io_service_t service, + uint32_t * busyState ); +kern_return_t +IOServiceWaitQuiet( + io_service_t service, + mach_timespec_t * waitTime ); +kern_return_t +IOKitGetBusyState( + mach_port_t masterPort, + uint32_t * busyState ); +kern_return_t +IOKitWaitQuiet( + mach_port_t masterPort, + mach_timespec_t * waitTime ); +kern_return_t +IOServiceOpen( + io_service_t service, + task_port_t owningTask, + uint32_t type, + io_connect_t * connect ); +kern_return_t +IOServiceRequestProbe( + io_service_t service, + uint32_t options ); + + +enum { + kIOServiceInteractionAllowed = 0x00000001 +}; +kern_return_t +IOServiceAuthorize( + io_service_t service, + uint32_t options ); + +int +IOServiceOpenAsFileDescriptor( + io_service_t service, + int oflag ); +kern_return_t +IOServiceClose( + io_connect_t connect ); + + + + + + + +kern_return_t +IOConnectAddRef( + io_connect_t connect ); + + + + + + + +kern_return_t +IOConnectRelease( + io_connect_t connect ); +kern_return_t +IOConnectGetService( + io_connect_t connect, + io_service_t * service ); +kern_return_t +IOConnectSetNotificationPort( + io_connect_t connect, + uint32_t type, + mach_port_t port, + uintptr_t reference ); +kern_return_t +IOConnectMapMemory( + io_connect_t connect, + uint32_t memoryType, + task_port_t intoTask, + mach_vm_address_t *atAddress, + mach_vm_size_t *ofSize, + IOOptionBits options ); +kern_return_t IOConnectMapMemory64( + io_connect_t connect, + uint32_t memoryType, + task_port_t intoTask, + mach_vm_address_t *atAddress, + mach_vm_size_t *ofSize, + IOOptionBits options ); +kern_return_t +IOConnectUnmapMemory( + io_connect_t connect, + uint32_t memoryType, + task_port_t fromTask, + mach_vm_address_t atAddress ); +kern_return_t IOConnectUnmapMemory64( + io_connect_t connect, + uint32_t memoryType, + task_port_t fromTask, + mach_vm_address_t atAddress ); +kern_return_t +IOConnectSetCFProperties( + io_connect_t connect, + CFTypeRef properties ); +kern_return_t +IOConnectSetCFProperty( + io_connect_t connect, + CFStringRef propertyName, + CFTypeRef property ); + + + + + +kern_return_t +IOConnectCallMethod( + mach_port_t connection, + uint32_t selector, + const uint64_t *input, + uint32_t inputCnt, + const void *inputStruct, + size_t inputStructCnt, + uint64_t *output, + uint32_t *outputCnt, + void *outputStruct, + size_t *outputStructCnt) +__attribute__((availability(macosx,introduced=10.5))); + +kern_return_t +IOConnectCallAsyncMethod( + mach_port_t connection, + uint32_t selector, + mach_port_t wake_port, + uint64_t *reference, + uint32_t referenceCnt, + const uint64_t *input, + uint32_t inputCnt, + const void *inputStruct, + size_t inputStructCnt, + uint64_t *output, + uint32_t *outputCnt, + void *outputStruct, + size_t *outputStructCnt) +__attribute__((availability(macosx,introduced=10.5))); + +kern_return_t +IOConnectCallStructMethod( + mach_port_t connection, + uint32_t selector, + const void *inputStruct, + size_t inputStructCnt, + void *outputStruct, + size_t *outputStructCnt) +__attribute__((availability(macosx,introduced=10.5))); + +kern_return_t +IOConnectCallAsyncStructMethod( + mach_port_t connection, + uint32_t selector, + mach_port_t wake_port, + uint64_t *reference, + uint32_t referenceCnt, + const void *inputStruct, + size_t inputStructCnt, + void *outputStruct, + size_t *outputStructCnt) +__attribute__((availability(macosx,introduced=10.5))); + +kern_return_t +IOConnectCallScalarMethod( + mach_port_t connection, + uint32_t selector, + const uint64_t *input, + uint32_t inputCnt, + uint64_t *output, + uint32_t *outputCnt) +__attribute__((availability(macosx,introduced=10.5))); + +kern_return_t +IOConnectCallAsyncScalarMethod( + mach_port_t connection, + uint32_t selector, + mach_port_t wake_port, + uint64_t *reference, + uint32_t referenceCnt, + const uint64_t *input, + uint32_t inputCnt, + uint64_t *output, + uint32_t *outputCnt) +__attribute__((availability(macosx,introduced=10.5))); + + + +kern_return_t +IOConnectTrap0(io_connect_t connect, + uint32_t index ); + +kern_return_t +IOConnectTrap1(io_connect_t connect, + uint32_t index, + uintptr_t p1 ); + +kern_return_t +IOConnectTrap2(io_connect_t connect, + uint32_t index, + uintptr_t p1, + uintptr_t p2); + +kern_return_t +IOConnectTrap3(io_connect_t connect, + uint32_t index, + uintptr_t p1, + uintptr_t p2, + uintptr_t p3); + +kern_return_t +IOConnectTrap4(io_connect_t connect, + uint32_t index, + uintptr_t p1, + uintptr_t p2, + uintptr_t p3, + uintptr_t p4); + +kern_return_t +IOConnectTrap5(io_connect_t connect, + uint32_t index, + uintptr_t p1, + uintptr_t p2, + uintptr_t p3, + uintptr_t p4, + uintptr_t p5); + +kern_return_t +IOConnectTrap6(io_connect_t connect, + uint32_t index, + uintptr_t p1, + uintptr_t p2, + uintptr_t p3, + uintptr_t p4, + uintptr_t p5, + uintptr_t p6); +kern_return_t +IOConnectAddClient( + io_connect_t connect, + io_connect_t client ); +io_registry_entry_t +IORegistryGetRootEntry( + mach_port_t masterPort ); +io_registry_entry_t +IORegistryEntryFromPath( + mach_port_t masterPort, + const io_string_t path ); +io_registry_entry_t +IORegistryEntryCopyFromPath( + mach_port_t masterPort, + CFStringRef path ) + +__attribute__((availability(macosx,introduced=10.11))) + +; + + +enum { + kIORegistryIterateRecursively = 0x00000001, + kIORegistryIterateParents = 0x00000002 +}; +kern_return_t +IORegistryCreateIterator( + mach_port_t masterPort, + const io_name_t plane, + IOOptionBits options, + io_iterator_t * iterator ); +kern_return_t +IORegistryEntryCreateIterator( + io_registry_entry_t entry, + const io_name_t plane, + IOOptionBits options, + io_iterator_t * iterator ); +kern_return_t +IORegistryIteratorEnterEntry( + io_iterator_t iterator ); + + + + + + +kern_return_t +IORegistryIteratorExitEntry( + io_iterator_t iterator ); +kern_return_t +IORegistryEntryGetName( + io_registry_entry_t entry, + io_name_t name ); +kern_return_t +IORegistryEntryGetNameInPlane( + io_registry_entry_t entry, + const io_name_t plane, + io_name_t name ); +kern_return_t +IORegistryEntryGetLocationInPlane( + io_registry_entry_t entry, + const io_name_t plane, + io_name_t location ); +kern_return_t +IORegistryEntryGetPath( + io_registry_entry_t entry, + const io_name_t plane, + io_string_t path ); +CFStringRef +IORegistryEntryCopyPath( + io_registry_entry_t entry, + const io_name_t plane) + +__attribute__((availability(macosx,introduced=10.11))) + +; +kern_return_t +IORegistryEntryGetRegistryEntryID( + io_registry_entry_t entry, + uint64_t * entryID ); +kern_return_t +IORegistryEntryCreateCFProperties( + io_registry_entry_t entry, + CFMutableDictionaryRef * properties, + CFAllocatorRef allocator, + IOOptionBits options ); +CFTypeRef +IORegistryEntryCreateCFProperty( + io_registry_entry_t entry, + CFStringRef key, + CFAllocatorRef allocator, + IOOptionBits options ); +CFTypeRef +IORegistryEntrySearchCFProperty( + io_registry_entry_t entry, + const io_name_t plane, + CFStringRef key, + CFAllocatorRef allocator, + IOOptionBits options ) __attribute__((cf_returns_retained)); + + + + +kern_return_t +IORegistryEntryGetProperty( + io_registry_entry_t entry, + const io_name_t propertyName, + io_struct_inband_t buffer, + uint32_t * size ); +kern_return_t +IORegistryEntrySetCFProperties( + io_registry_entry_t entry, + CFTypeRef properties ); +kern_return_t +IORegistryEntrySetCFProperty( + io_registry_entry_t entry, + CFStringRef propertyName, + CFTypeRef property ); +kern_return_t +IORegistryEntryGetChildIterator( + io_registry_entry_t entry, + const io_name_t plane, + io_iterator_t * iterator ); +kern_return_t +IORegistryEntryGetChildEntry( + io_registry_entry_t entry, + const io_name_t plane, + io_registry_entry_t * child ); +kern_return_t +IORegistryEntryGetParentIterator( + io_registry_entry_t entry, + const io_name_t plane, + io_iterator_t * iterator ); +kern_return_t +IORegistryEntryGetParentEntry( + io_registry_entry_t entry, + const io_name_t plane, + io_registry_entry_t * parent ); +boolean_t +IORegistryEntryInPlane( + io_registry_entry_t entry, + const io_name_t plane ); +CFMutableDictionaryRef +IOServiceMatching( + const char * name ) __attribute__((cf_returns_retained)); + + + + + + + +CFMutableDictionaryRef +IOServiceNameMatching( + const char * name ) __attribute__((cf_returns_retained)); +CFMutableDictionaryRef +IOBSDNameMatching( + mach_port_t masterPort, + uint32_t options, + const char * bsdName ) __attribute__((cf_returns_retained)); + +CFMutableDictionaryRef +IOOpenFirmwarePathMatching( + mach_port_t masterPort, + uint32_t options, + const char * path ) __attribute__((deprecated)); + + + + + + + +CFMutableDictionaryRef +IORegistryEntryIDMatching( + uint64_t entryID ) __attribute__((cf_returns_retained)); + + + +kern_return_t +IOServiceOFPathToBSDName(mach_port_t masterPort, + const io_name_t openFirmwarePath, + io_name_t bsdName) __attribute__((deprecated)); +typedef void (*IOAsyncCallback0)(void *refcon, IOReturn result); +typedef void (*IOAsyncCallback1)(void *refcon, IOReturn result, void *arg0); +typedef void (*IOAsyncCallback2)(void *refcon, IOReturn result, void *arg0, void *arg1); +typedef void (*IOAsyncCallback)(void *refcon, IOReturn result, void **args, + uint32_t numArgs); + + + + +kern_return_t +OSGetNotificationFromMessage( + mach_msg_header_t * msg, + uint32_t index, + uint32_t * type, + uintptr_t * reference, + void ** content, + vm_size_t * size ); + + + + + +kern_return_t +IOCatalogueSendData( + mach_port_t masterPort, + uint32_t flag, + const char *buffer, + uint32_t size ); + +kern_return_t +IOCatalogueTerminate( + mach_port_t masterPort, + uint32_t flag, + io_name_t description ); + +kern_return_t +IOCatalogueGetData( + mach_port_t masterPort, + uint32_t flag, + char **buffer, + uint32_t *size ); + +kern_return_t +IOCatalogueModuleLoaded( + mach_port_t masterPort, + io_name_t name ); + + + + + +kern_return_t +IOCatalogueReset( + mach_port_t masterPort, + uint32_t flag ); + +typedef struct __attribute__((objc_bridge(id))) __DASession * DASessionRef; + + + + + + +extern CFTypeID DASessionGetTypeID( void ); +extern DASessionRef _Nullable DASessionCreate( CFAllocatorRef _Nullable allocator ); +extern void DASessionScheduleWithRunLoop( DASessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode ); +extern void DASessionUnscheduleFromRunLoop( DASessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode ); +extern void DASessionSetDispatchQueue( DASessionRef session, dispatch_queue_t _Nullable queue ); + + + + + + +typedef struct __attribute__((objc_bridge(id))) __DASession * DAApprovalSessionRef __attribute__((availability(swift, unavailable, message="Use DASessionRef instead"))); + + + + + + +extern CFTypeID DAApprovalSessionGetTypeID( void ) __attribute__((availability(swift, unavailable, message="Use DASessionGetTypeID instead"))); +extern DAApprovalSessionRef _Nullable DAApprovalSessionCreate( CFAllocatorRef _Nullable allocator ) __attribute__((availability(swift, unavailable, message="Use DASessionCreate instead"))); +extern void DAApprovalSessionScheduleWithRunLoop( DAApprovalSessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode ) __attribute__((availability(swift, unavailable, message="Use DASessionSetDispatchQueue instead"))); +extern void DAApprovalSessionUnscheduleFromRunLoop( DAApprovalSessionRef session, CFRunLoopRef runLoop, CFStringRef runLoopMode ) __attribute__((availability(swift, unavailable, message="Use DASessionSetDispatchQueue instead"))); + + + + + + + + +extern const CFStringRef kDADiskDescriptionVolumeKindKey; +extern const CFStringRef kDADiskDescriptionVolumeMountableKey; +extern const CFStringRef kDADiskDescriptionVolumeNameKey; +extern const CFStringRef kDADiskDescriptionVolumeNetworkKey; +extern const CFStringRef kDADiskDescriptionVolumePathKey; +extern const CFStringRef kDADiskDescriptionVolumeTypeKey; +extern const CFStringRef kDADiskDescriptionVolumeUUIDKey; + +extern const CFStringRef kDADiskDescriptionMediaBlockSizeKey; +extern const CFStringRef kDADiskDescriptionMediaBSDMajorKey; +extern const CFStringRef kDADiskDescriptionMediaBSDMinorKey; +extern const CFStringRef kDADiskDescriptionMediaBSDNameKey; +extern const CFStringRef kDADiskDescriptionMediaBSDUnitKey; +extern const CFStringRef kDADiskDescriptionMediaContentKey; +extern const CFStringRef kDADiskDescriptionMediaEjectableKey; +extern const CFStringRef kDADiskDescriptionMediaIconKey; +extern const CFStringRef kDADiskDescriptionMediaKindKey; +extern const CFStringRef kDADiskDescriptionMediaLeafKey; +extern const CFStringRef kDADiskDescriptionMediaNameKey; +extern const CFStringRef kDADiskDescriptionMediaPathKey; +extern const CFStringRef kDADiskDescriptionMediaRemovableKey; +extern const CFStringRef kDADiskDescriptionMediaSizeKey; +extern const CFStringRef kDADiskDescriptionMediaTypeKey; +extern const CFStringRef kDADiskDescriptionMediaUUIDKey; +extern const CFStringRef kDADiskDescriptionMediaWholeKey; +extern const CFStringRef kDADiskDescriptionMediaWritableKey; + +extern const CFStringRef kDADiskDescriptionDeviceGUIDKey; +extern const CFStringRef kDADiskDescriptionDeviceInternalKey; +extern const CFStringRef kDADiskDescriptionDeviceModelKey; +extern const CFStringRef kDADiskDescriptionDevicePathKey; +extern const CFStringRef kDADiskDescriptionDeviceProtocolKey; +extern const CFStringRef kDADiskDescriptionDeviceRevisionKey; +extern const CFStringRef kDADiskDescriptionDeviceUnitKey; +extern const CFStringRef kDADiskDescriptionDeviceVendorKey; + +extern const CFStringRef kDADiskDescriptionBusNameKey; +extern const CFStringRef kDADiskDescriptionBusPathKey; +typedef struct __attribute__((objc_bridge(id))) __DADisk * DADiskRef; + + + + + + +extern CFTypeID DADiskGetTypeID( void ); +extern DADiskRef _Nullable DADiskCreateFromBSDName( CFAllocatorRef _Nullable allocator, DASessionRef session, const char * name ); +extern DADiskRef _Nullable DADiskCreateFromIOMedia( CFAllocatorRef _Nullable allocator, DASessionRef session, io_service_t media ); +extern DADiskRef _Nullable DADiskCreateFromVolumePath( CFAllocatorRef _Nullable allocator, DASessionRef session, CFURLRef path ); +extern const char * _Nullable DADiskGetBSDName( DADiskRef disk ); +extern io_service_t DADiskCopyIOMedia( DADiskRef disk ); +extern CFDictionaryRef _Nullable DADiskCopyDescription( DADiskRef disk ); +extern DADiskRef _Nullable DADiskCopyWholeDisk( DADiskRef disk ); +struct HFSUniStr255 { + u_int16_t length; + u_int16_t unicode[255]; +} __attribute__((aligned(2), packed)); +typedef struct HFSUniStr255 HFSUniStr255; +typedef const HFSUniStr255 *ConstHFSUniStr255Param; +enum { + fsCurPerm = 0x00, + fsRdPerm = 0x01, + fsWrPerm = 0x02, + fsRdWrPerm = 0x03, + fsRdWrShPerm = 0x04 +}; +enum { + fsRdAccessPerm = 0x01, + fsWrAccessPerm = 0x02, + fsRdDenyPerm = 0x10, + fsWrDenyPerm = 0x20 +}; + +enum { + fsRtParID = 1, + fsRtDirID = 2 +}; + +enum { + fsAtMark = 0, + fsFromStart = 1, + fsFromLEOF = 2, + fsFromMark = 3 +}; + +enum { + + kFSAllowConcurrentAsyncIOBit = 3, + kFSAllowConcurrentAsyncIOMask = 0x0008, + kFSPleaseCacheBit = 4, + kFSPleaseCacheMask = 0x0010, + kFSNoCacheBit = 5, + kFSNoCacheMask = 0x0020, + kFSRdVerifyBit = 6, + kFSRdVerifyMask = 0x0040, + kFSForceReadBit = 6, + kFSForceReadMask = 0x0040, + kFSNewLineBit = 7, + kFSNewLineMask = 0x0080, + kFSNewLineCharMask = 0xFF00 +}; + + +enum { + + fsSBPartialName = 0x01, + fsSBFullName = 0x02, + fsSBFlAttrib = 0x04, + fsSBFlFndrInfo = 0x08, + fsSBFlLgLen = 0x20, + fsSBFlPyLen = 0x40, + fsSBFlRLgLen = 0x80, + fsSBFlRPyLen = 0x0100, + fsSBFlCrDat = 0x0200, + fsSBFlMdDat = 0x0400, + fsSBFlBkDat = 0x0800, + fsSBFlXFndrInfo = 0x1000, + fsSBFlParID = 0x2000, + fsSBNegate = 0x4000, + fsSBDrUsrWds = 0x08, + fsSBDrNmFls = 0x10, + fsSBDrCrDat = 0x0200, + fsSBDrMdDat = 0x0400, + fsSBDrBkDat = 0x0800, + fsSBDrFndrInfo = 0x1000, + fsSBDrParID = 0x2000, + fsSBNodeID = 0x8000, + fsSBAttributeModDate = 0x00010000, + fsSBAccessDate = 0x00020000, + fsSBPermissions = 0x00040000, + fsSBSkipPackageContents = 0x00080000, + fsSBSkipHiddenItems = 0x00100000, + fsSBUserID = 0x00200000, + fsSBGroupID = 0x00400000 +}; + +enum { + + fsSBPartialNameBit = 0, + fsSBFullNameBit = 1, + fsSBFlAttribBit = 2, + fsSBFlFndrInfoBit = 3, + fsSBFlLgLenBit = 5, + fsSBFlPyLenBit = 6, + fsSBFlRLgLenBit = 7, + fsSBFlRPyLenBit = 8, + fsSBFlCrDatBit = 9, + fsSBFlMdDatBit = 10, + fsSBFlBkDatBit = 11, + fsSBFlXFndrInfoBit = 12, + fsSBFlParIDBit = 13, + fsSBNegateBit = 14, + fsSBDrUsrWdsBit = 3, + fsSBDrNmFlsBit = 4, + fsSBDrCrDatBit = 9, + fsSBDrMdDatBit = 10, + fsSBDrBkDatBit = 11, + fsSBDrFndrInfoBit = 12, + fsSBDrParIDBit = 13, + fsSBNodeIDBit = 15, + fsSBAttributeModDateBit = 16, + fsSBAccessDateBit = 17, + fsSBPermissionsBit = 18, + fsSBSkipPackageContentsBit = 19, + fsSBSkipHiddenItemsBit = 20, + fsSBUserIDBit = 21, + fsSBGroupIDBit = 22 +}; + +enum { + + bLimitFCBs = 31, + bLocalWList = 30, + bNoMiniFndr = 29, + bNoVNEdit = 28, + bNoLclSync = 27, + bTrshOffLine = 26, + bNoSwitchTo = 25, + bNoDeskItems = 20, + bNoBootBlks = 19, + bAccessCntl = 18, + bNoSysDir = 17, + bHasExtFSVol = 16, + bHasOpenDeny = 15, + bHasCopyFile = 14, + bHasMoveRename = 13, + bHasDesktopMgr = 12, + bHasShortName = 11, + bHasFolderLock = 10, + bHasPersonalAccessPrivileges = 9, + bHasUserGroupList = 8, + bHasCatSearch = 7, + bHasFileIDs = 6, + bHasBTreeMgr = 5, + bHasBlankAccessPrivileges = 4, + bSupportsAsyncRequests = 3, + bSupportsTrashVolumeCache = 2 +}; + +enum { + + bHasDirectIO = 1 +}; + +enum { + + bIsEjectable = 0, + bSupportsHFSPlusAPIs = 1, + bSupportsFSCatalogSearch = 2, + bSupportsFSExchangeObjects = 3, + bSupports2TBFiles = 4, + bSupportsLongNames = 5, + bSupportsMultiScriptNames = 6, + bSupportsNamedForks = 7, + bSupportsSubtreeIterators = 8, + bL2PCanMapFileBlocks = 9, + bParentModDateChanges = 10, + bAncestorModDateChanges = 11, + bSupportsSymbolicLinks = 13, + bIsAutoMounted = 14, + bAllowCDiDataHandler = 17, + bSupportsExclusiveLocks = 18, + bSupportsJournaling = 19, + bNoVolumeSizes = 20, + bIsOnInternalBus = 21, + bIsCaseSensitive = 22, + bIsCasePreserving = 23, + bDoNotDisplay = 24, + bIsRemovable = 25, + bNoRootTimes = 26, + bIsOnExternalBus = 27, + bSupportsExtendedFileSecurity = 28 +}; + + + + + + +enum { + + kWidePosOffsetBit = 8, + kUseWidePositioning = (1 << kWidePosOffsetBit), + kMaximumBlocksIn4GB = 0x007FFFFF +}; + +enum { + + fsUnixPriv = 1 +}; + +enum { + + kNoUserAuthentication = 1, + kPassword = 2, + kEncryptPassword = 3, + kTwoWayEncryptPassword = 6 +}; + + + +enum { + knoUser = 0, + kadministratorUser = 1 +}; + +enum { + knoGroup = 0 +}; + + +typedef SInt16 FSVolumeRefNum; + +typedef int FSIORefNum; + + + + +enum { + kFSInvalidVolumeRefNum = 0 +}; + +struct FSRef { + UInt8 hidden[80]; +}; +typedef struct FSRef FSRef; +typedef FSRef * FSRefPtr; +typedef struct __FSFileSecurity* FSFileSecurityRef; + +struct CatPositionRec { + SInt32 initialize; + SInt16 priv[6]; +}; +typedef struct CatPositionRec CatPositionRec; + +struct FSSpec { + UInt8 hidden[70]; +}; +typedef struct FSSpec FSSpec; +typedef FSSpec * FSSpecPtr; +typedef FSSpecPtr * FSSpecHandle; + +typedef FSSpecPtr FSSpecArrayPtr; + + + + +typedef const FSSpec * ConstFSSpecPtr; +typedef union ParamBlockRec ParamBlockRec; + +typedef void * ParmBlkPtr; + + + + +typedef void ( * IOCompletionProcPtr)(ParmBlkPtr paramBlock); +typedef IOCompletionProcPtr IOCompletionUPP; +struct FSPermissionInfo { + UInt32 userID; + UInt32 groupID; + UInt8 reserved1; + UInt8 userAccess; + UInt16 mode; + FSFileSecurityRef fileSec; +}; +typedef struct FSPermissionInfo FSPermissionInfo; + + +typedef UInt32 FSCatalogInfoBitmap; +enum { + kFSCatInfoNone = 0x00000000, + kFSCatInfoTextEncoding = 0x00000001, + kFSCatInfoNodeFlags = 0x00000002, + kFSCatInfoVolume = 0x00000004, + kFSCatInfoParentDirID = 0x00000008, + kFSCatInfoNodeID = 0x00000010, + kFSCatInfoCreateDate = 0x00000020, + kFSCatInfoContentMod = 0x00000040, + kFSCatInfoAttrMod = 0x00000080, + kFSCatInfoAccessDate = 0x00000100, + kFSCatInfoBackupDate = 0x00000200, + kFSCatInfoPermissions = 0x00000400, + kFSCatInfoFinderInfo = 0x00000800, + kFSCatInfoFinderXInfo = 0x00001000, + kFSCatInfoValence = 0x00002000, + kFSCatInfoDataSizes = 0x00004000, + kFSCatInfoRsrcSizes = 0x00008000, + kFSCatInfoSharingFlags = 0x00010000, + kFSCatInfoUserPrivs = 0x00020000, + kFSCatInfoUserAccess = 0x00080000, + kFSCatInfoSetOwnership = 0x00100000, + kFSCatInfoFSFileSecurityRef = 0x00400000, + kFSCatInfoAllDates = 0x000003E0, + kFSCatInfoGettableInfo = 0x0003FFFF, + kFSCatInfoSettableInfo = 0x00001FE3, + kFSCatInfoReserved = (int)0xFFFC0000 +}; + + +enum { + kFSNodeLockedBit = 0, + kFSNodeLockedMask = 0x0001, + kFSNodeResOpenBit = 2, + kFSNodeResOpenMask = 0x0004, + kFSNodeDataOpenBit = 3, + kFSNodeDataOpenMask = 0x0008, + kFSNodeIsDirectoryBit = 4, + kFSNodeIsDirectoryMask = 0x0010, + kFSNodeCopyProtectBit = 6, + kFSNodeCopyProtectMask = 0x0040, + kFSNodeForkOpenBit = 7, + kFSNodeForkOpenMask = 0x0080, + kFSNodeHardLinkBit = 8, + kFSNodeHardLinkMask = 0x00000100 +}; + + +enum { + kFSNodeInSharedBit = 2, + kFSNodeInSharedMask = 0x0004, + kFSNodeIsMountedBit = 3, + kFSNodeIsMountedMask = 0x0008, + kFSNodeIsSharePointBit = 5, + kFSNodeIsSharePointMask = 0x0020 +}; +struct FSCatalogInfo { + + + + + + UInt16 nodeFlags; + + + + + FSVolumeRefNum volume; + + + + + + UInt32 parentDirID; + + + + + UInt32 nodeID; + + + + + + UInt8 sharingFlags; + UInt8 userPrivileges; + UInt8 reserved1; + + + + + UInt8 reserved2; + + + + + UTCDateTime createDate; + + + + + + UTCDateTime contentModDate; + + + + + + UTCDateTime attributeModDate; + + + + + + UTCDateTime accessDate; + + + + + + UTCDateTime backupDate; + + + + + + FSPermissionInfo permissions; + + + + + + UInt8 finderInfo[16]; + + + + + + UInt8 extFinderInfo[16]; + + + + + + + UInt64 dataLogicalSize; + + + + + + UInt64 dataPhysicalSize; + + + + + + UInt64 rsrcLogicalSize; + + + + + + UInt64 rsrcPhysicalSize; + + + + + + UInt32 valence; + + + + + + TextEncoding textEncodingHint; +}; +typedef struct FSCatalogInfo FSCatalogInfo; +typedef FSCatalogInfo * FSCatalogInfoPtr; +struct FSRefParam { + QElemPtr qLink; + SInt16 qType; + SInt16 ioTrap; + Ptr ioCmdAddr; + IOCompletionUPP ioCompletion; + volatile OSErr ioResult; + ConstStringPtr ioNamePtr; + FSVolumeRefNum ioVRefNum; + + SInt16 reserved1; + UInt8 reserved2; + UInt8 reserved3; + + const FSRef * ref; + FSCatalogInfoBitmap whichInfo; + FSCatalogInfo * catInfo; + UniCharCount nameLength; + const UniChar * name; + UInt32 ioDirID; + FSSpecPtr spec; + FSRef * parentRef; + FSRef * newRef; + TextEncoding textEncodingHint; + HFSUniStr255 * outName; +}; +typedef struct FSRefParam FSRefParam; +typedef FSRefParam * FSRefParamPtr; + +struct FSRefForkIOParam { + QElemPtr qLink; + SInt16 qType; + SInt16 ioTrap; + Ptr ioCmdAddr; + IOCompletionUPP ioCompletion; + volatile OSErr ioResult; + const FSRef * parentRef; + UniCharCount nameLength; + const UniChar * name; + FSCatalogInfoBitmap whichInfo; + const FSCatalogInfo * catInfo; + UniCharCount forkNameLength; + const UniChar * forkName; + SInt8 permissions; + UInt8 reserved1; + FSIORefNum forkRefNum; + FSRef * newRef; +}; +typedef struct FSRefForkIOParam FSRefForkIOParam; +typedef FSRefForkIOParam * FSRefForkIOParamPtr; +typedef struct OpaqueFSIterator* FSIterator; +enum { + kFSIterateFlat = 0, + kFSIterateSubtree = 1, + kFSIterateDelete = 2, + kFSIterateReserved = (int)0xFFFFFFFC +}; + +typedef OptionBits FSIteratorFlags; +struct FSSearchParams { + Duration searchTime; + OptionBits searchBits; + UniCharCount searchNameLength; + const UniChar * searchName; + FSCatalogInfo * searchInfo1; + FSCatalogInfo * searchInfo2; +}; +typedef struct FSSearchParams FSSearchParams; +typedef FSSearchParams * FSSearchParamsPtr; +struct FSCatalogBulkParam { + QElemPtr qLink; + SInt16 qType; + SInt16 ioTrap; + Ptr ioCmdAddr; + IOCompletionUPP ioCompletion; + volatile OSErr ioResult; + Boolean containerChanged; + UInt8 reserved; + + FSIteratorFlags iteratorFlags; + FSIterator iterator; + const FSRef * container; + ItemCount maximumItems; + ItemCount actualItems; + FSCatalogInfoBitmap whichInfo; + FSCatalogInfo * catalogInfo; + FSRef * refs; + FSSpecPtr specs; + HFSUniStr255 * names; + const FSSearchParams * searchParams; +}; +typedef struct FSCatalogBulkParam FSCatalogBulkParam; +typedef FSCatalogBulkParam * FSCatalogBulkParamPtr; +typedef UInt16 FSAllocationFlags; +enum { + kFSAllocDefaultFlags = 0x0000, + kFSAllocAllOrNothingMask = 0x0001, + kFSAllocContiguousMask = 0x0002, + kFSAllocNoRoundUpMask = 0x0004, + kFSAllocReservedMask = 0xFFF8 +}; + +struct FSForkIOParam { + QElemPtr qLink; + SInt16 qType; + SInt16 ioTrap; + Ptr ioCmdAddr; + IOCompletionUPP ioCompletion; + volatile OSErr ioResult; + void * reserved1; + SInt16 reserved2; + FSIORefNum forkRefNum; + UInt8 reserved3; + SInt8 permissions; + const FSRef * ref; + + + Ptr buffer; + UInt32 requestCount; + UInt32 actualCount; + UInt16 positionMode; + SInt64 positionOffset; + + FSAllocationFlags allocationFlags; + UInt64 allocationAmount; + + UniCharCount forkNameLength; + const UniChar * forkName; + + CatPositionRec forkIterator; + HFSUniStr255 * outForkName; +}; +typedef struct FSForkIOParam FSForkIOParam; +typedef FSForkIOParam * FSForkIOParamPtr; +typedef UInt8 FSForkInfoFlags; +struct FSForkInfo { + FSForkInfoFlags flags; + SInt8 permissions; + FSVolumeRefNum volume; + UInt32 reserved2; + UInt32 nodeID; + UInt32 forkID; + UInt64 currentPosition; + UInt64 logicalEOF; + UInt64 physicalEOF; + UInt64 process; +}; +typedef struct FSForkInfo FSForkInfo; +typedef FSForkInfo * FSForkInfoPtr; +struct FSForkCBInfoParam { + QElemPtr qLink; + SInt16 qType; + SInt16 ioTrap; + Ptr ioCmdAddr; + IOCompletionUPP ioCompletion; + volatile OSErr ioResult; + FSIORefNum desiredRefNum; + FSVolumeRefNum volumeRefNum; + FSIORefNum iterator; + FSVolumeRefNum actualRefNum; + + FSRef * ref; + FSForkInfo * forkInfo; + HFSUniStr255 * forkName; +}; +typedef struct FSForkCBInfoParam FSForkCBInfoParam; +typedef FSForkCBInfoParam * FSForkCBInfoParamPtr; + +struct FSRangeLockParam { + QElemPtr qLink; + SInt16 qType; + SInt16 ioTrap; + Ptr ioCmdAddr; + IOCompletionUPP ioCompletion; + volatile OSErr ioResult; + FSIORefNum forkRefNum; + UInt64 requestCount; + UInt16 positionMode; + SInt64 positionOffset; + UInt64 rangeStart; + +}; +typedef struct FSRangeLockParam FSRangeLockParam; +typedef FSRangeLockParam * FSRangeLockParamPtr; +typedef UInt32 FSVolumeInfoBitmap; +enum { + kFSVolInfoNone = 0x0000, + kFSVolInfoCreateDate = 0x0001, + kFSVolInfoModDate = 0x0002, + kFSVolInfoBackupDate = 0x0004, + kFSVolInfoCheckedDate = 0x0008, + kFSVolInfoFileCount = 0x0010, + kFSVolInfoDirCount = 0x0020, + kFSVolInfoSizes = 0x0040, + kFSVolInfoBlocks = 0x0080, + kFSVolInfoNextAlloc = 0x0100, + kFSVolInfoRsrcClump = 0x0200, + kFSVolInfoDataClump = 0x0400, + kFSVolInfoNextID = 0x0800, + kFSVolInfoFinderInfo = 0x1000, + kFSVolInfoFlags = 0x2000, + kFSVolInfoFSInfo = 0x4000, + kFSVolInfoDriveInfo = 0x8000, + kFSVolInfoGettableInfo = 0xFFFF, + kFSVolInfoSettableInfo = 0x3004 +}; + + +enum { + kFSVolFlagDefaultVolumeBit = 5, + kFSVolFlagDefaultVolumeMask = 0x0020, + kFSVolFlagFilesOpenBit = 6, + kFSVolFlagFilesOpenMask = 0x0040, + kFSVolFlagHardwareLockedBit = 7, + kFSVolFlagHardwareLockedMask = 0x0080, + kFSVolFlagJournalingActiveBit = 14, + kFSVolFlagJournalingActiveMask = 0x4000, + kFSVolFlagSoftwareLockedBit = 15, + kFSVolFlagSoftwareLockedMask = 0x8000 +}; + + +struct FSVolumeInfo { + + UTCDateTime createDate; + UTCDateTime modifyDate; + UTCDateTime backupDate; + UTCDateTime checkedDate; + + + UInt32 fileCount; + UInt32 folderCount; + + + UInt64 totalBytes; + UInt64 freeBytes; + + + UInt32 blockSize; + UInt32 totalBlocks; + UInt32 freeBlocks; + UInt32 nextAllocation; + UInt32 rsrcClumpSize; + UInt32 dataClumpSize; + UInt32 nextCatalogID; + UInt8 finderInfo[32]; + + + UInt16 flags; + UInt16 filesystemID; + UInt16 signature; + UInt16 driveNumber; + FSIORefNum driverRefNum; +}; +typedef struct FSVolumeInfo FSVolumeInfo; +typedef FSVolumeInfo * FSVolumeInfoPtr; +struct FSVolumeInfoParam { + QElemPtr qLink; + SInt16 qType; + SInt16 ioTrap; + Ptr ioCmdAddr; + IOCompletionUPP ioCompletion; + volatile OSErr ioResult; + StringPtr ioNamePtr; + FSVolumeRefNum ioVRefNum; + + UInt32 volumeIndex; + FSVolumeInfoBitmap whichInfo; + FSVolumeInfo * volumeInfo; + HFSUniStr255 * volumeName; + FSRef * ref; +}; +typedef struct FSVolumeInfoParam FSVolumeInfoParam; +typedef FSVolumeInfoParam * FSVolumeInfoParamPtr; +struct GetVolParmsInfoBuffer { + SInt16 vMVersion; + SInt32 vMAttrib; + Handle vMLocalHand; + SInt32 vMServerAdr; + + SInt32 vMVolumeGrade; + SInt16 vMForeignPrivID; + + SInt32 vMExtendedAttributes; + + void * vMDeviceID; + + UniCharCount vMMaxNameLength; + +}; +typedef struct GetVolParmsInfoBuffer GetVolParmsInfoBuffer; + + + + + + +typedef OSType VolumeType; +enum { + + AppleShareMediaType = 'afpm' +}; + + + + +struct VolMountInfoHeader { + SInt16 length; + VolumeType media; +}; +typedef struct VolMountInfoHeader VolMountInfoHeader; +typedef VolMountInfoHeader * VolMountInfoPtr; + + + + +struct VolumeMountInfoHeader { + SInt16 length; + VolumeType media; + SInt16 flags; +}; +typedef struct VolumeMountInfoHeader VolumeMountInfoHeader; +typedef VolumeMountInfoHeader * VolumeMountInfoHeaderPtr; + +enum { + volMountNoLoginMsgFlagBit = 0, + volMountNoLoginMsgFlagMask = 0x0001, + volMountExtendedFlagsBit = 7, + volMountExtendedFlagsMask = 0x0080, + volMountInteractBit = 15, + volMountInteractMask = 0x8000, + volMountChangedBit = 14, + volMountChangedMask = 0x4000, + volMountFSReservedMask = 0x00FF, + volMountSysReservedMask = 0xFF00 +}; + + + +struct AFPVolMountInfo { + SInt16 length; + VolumeType media; + SInt16 flags; + SInt8 nbpInterval; + SInt8 nbpCount; + SInt16 uamType; + SInt16 zoneNameOffset; + SInt16 serverNameOffset; + SInt16 volNameOffset; + SInt16 userNameOffset; + SInt16 userPasswordOffset; + SInt16 volPasswordOffset; + char AFPData[144]; +}; +typedef struct AFPVolMountInfo AFPVolMountInfo; +typedef AFPVolMountInfo * AFPVolMountInfoPtr; + + + +struct AFPXVolMountInfo { + SInt16 length; + VolumeType media; + SInt16 flags; + SInt8 nbpInterval; + SInt8 nbpCount; + SInt16 uamType; + SInt16 zoneNameOffset; + SInt16 serverNameOffset; + SInt16 volNameOffset; + SInt16 userNameOffset; + SInt16 userPasswordOffset; + SInt16 volPasswordOffset; + SInt16 extendedFlags; + SInt16 uamNameOffset; + SInt16 alternateAddressOffset; + char AFPData[176]; +}; +typedef struct AFPXVolMountInfo AFPXVolMountInfo; +typedef AFPXVolMountInfo * AFPXVolMountInfoPtr; +enum { + kAFPExtendedFlagsAlternateAddressMask = 1 +}; + + +enum { + + kAFPTagTypeIP = 0x01, + kAFPTagTypeIPPort = 0x02, + kAFPTagTypeDDP = 0x03, + kAFPTagTypeDNS = 0x04 +}; + + +enum { + + kAFPTagLengthIP = 0x06, + kAFPTagLengthIPPort = 0x08, + kAFPTagLengthDDP = 0x06 +}; + +struct AFPTagData { + UInt8 fLength; + UInt8 fType; + UInt8 fData[1]; +}; +typedef struct AFPTagData AFPTagData; +struct AFPAlternateAddress { + + UInt8 fVersion; + UInt8 fAddressCount; + UInt8 fAddressList[1]; +}; +typedef struct AFPAlternateAddress AFPAlternateAddress; +enum { + kLargeIconSize = 256, + kLarge4BitIconSize = 512, + kLarge8BitIconSize = 1024, + kSmallIconSize = 64, + kSmall4BitIconSize = 128, + kSmall8BitIconSize = 256 +}; +extern IOCompletionUPP +NewIOCompletionUPP(IOCompletionProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeIOCompletionUPP(IOCompletionUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +InvokeIOCompletionUPP( + ParmBlkPtr paramBlock, + IOCompletionUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSMakeFSRefUnicode(const FSRef *parentRef, UniCharCount nameLength, const UniChar *name, TextEncoding textEncodingHint, FSRef *newRef) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBMakeFSRefUnicodeSync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBMakeFSRefUnicodeAsync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSCompareFSRefs(const FSRef *ref1, const FSRef *ref2) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBCompareFSRefsSync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBCompareFSRefsAsync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSCreateFileUnicode(const FSRef *parentRef, UniCharCount nameLength, const UniChar *name, FSCatalogInfoBitmap whichInfo, const FSCatalogInfo *catalogInfo, FSRef *newRef, FSSpecPtr newSpec) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBCreateFileUnicodeSync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBCreateFileUnicodeAsync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSCreateDirectoryUnicode(const FSRef *parentRef, UniCharCount nameLength, const UniChar *name, FSCatalogInfoBitmap whichInfo, const FSCatalogInfo *catalogInfo, FSRef *newRef, FSSpecPtr newSpec, UInt32 *newDirID) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBCreateDirectoryUnicodeSync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBCreateDirectoryUnicodeAsync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSDeleteObject(const FSRef * ref) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBDeleteObjectSync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBDeleteObjectAsync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSUnlinkObject(const FSRef * ref) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSErr PBUnlinkObjectSync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern void PBUnlinkObjectAsync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSErr FSMoveObject(const FSRef *ref, const FSRef *destDirectory, FSRef *newRef) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBMoveObjectSync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBMoveObjectAsync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSExchangeObjects(const FSRef *ref, const FSRef *destRef) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBExchangeObjectsSync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBExchangeObjectsAsync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +enum { + + + + + + kFSReplaceObjectDefaultOptions = 0, + + + + + + + kFSReplaceObjectReplaceMetadata = 0x01, + + + + + + + + kFSReplaceObjectSaveOriginalAsABackup = 0x02, + + + + + kFSReplaceObjectReplacePermissionInfo = 0x04, + + + + + kFSReplaceObjectPreservePermissionInfo = 0x08, + kFSReplaceObjectDoNotCheckObjectWriteAccess = 0x10 +}; +extern OSStatus FSReplaceObject(const FSRef *originalObject, const FSRef *replacementObject, CFStringRef newName, CFStringRef temporaryName, const FSRef *temporaryDirectory, OptionBits flags, FSRef *resultObject) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8,message="Use NSFileManager's -replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error: instead. WARNING: FSReplaceObject does not work correctly in sandboxed apps."))); + extern OSStatus FSPathReplaceObject(const char *originalObjectPath, const char *replacementObjectPath, CFStringRef newName, CFStringRef temporaryName, const char *temporaryDirectoryPath, OptionBits flags) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8,message="Use NSFileManager's -replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error: instead. WARNING: FSPathReplaceObject does not work correctly in sandboxed apps."))); +extern OSStatus FSGetTemporaryDirectoryForReplaceObject(const FSRef *originalObject, FSRef *temporaryDirectory, OptionBits flags) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSStatus FSPathGetTemporaryDirectoryForReplaceObject(const char *originalObjectPath, char *temporaryDirectoryPath, UInt32 maxPathSize, OptionBits flags) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSErr FSRenameUnicode(const FSRef *ref, UniCharCount nameLength, const UniChar *name, TextEncoding textEncodingHint, FSRef *newRef) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBRenameUnicodeSync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBRenameUnicodeAsync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSGetCatalogInfo(const FSRef *ref, FSCatalogInfoBitmap whichInfo, FSCatalogInfo *catalogInfo, HFSUniStr255 *outName, FSSpecPtr fsSpec, FSRef *parentRef) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBGetCatalogInfoSync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBGetCatalogInfoAsync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSSetCatalogInfo(const FSRef *ref, FSCatalogInfoBitmap whichInfo, const FSCatalogInfo *catalogInfo) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBSetCatalogInfoSync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBSetCatalogInfoAsync(FSRefParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSOpenIterator(const FSRef *container, FSIteratorFlags iteratorFlags, FSIterator *iterator) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBOpenIteratorSync(FSCatalogBulkParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBOpenIteratorAsync(FSCatalogBulkParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSCloseIterator(FSIterator iterator) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBCloseIteratorSync(FSCatalogBulkParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBCloseIteratorAsync(FSCatalogBulkParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSGetCatalogInfoBulk(FSIterator iterator, ItemCount maximumObjects, ItemCount *actualObjects, Boolean *containerChanged, FSCatalogInfoBitmap whichInfo, FSCatalogInfo *catalogInfos, FSRef *refs, FSSpecPtr specs, HFSUniStr255 *names) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBGetCatalogInfoBulkSync(FSCatalogBulkParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBGetCatalogInfoBulkAsync(FSCatalogBulkParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSCatalogSearch(FSIterator iterator, const FSSearchParams *searchCriteria, ItemCount maximumObjects, ItemCount *actualObjects, Boolean *containerChanged, FSCatalogInfoBitmap whichInfo, FSCatalogInfo *catalogInfos, FSRef *refs, FSSpecPtr specs, HFSUniStr255 *names) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBCatalogSearchSync(FSCatalogBulkParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBCatalogSearchAsync(FSCatalogBulkParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus FSCreateFileAndOpenForkUnicode(const FSRef *parentRef, UniCharCount nameLength, const UniChar *name, FSCatalogInfoBitmap whichInfo, const FSCatalogInfo *catalogInfo, UniCharCount forkNameLength, const UniChar *forkName, SInt8 permissions, FSIORefNum *forkRefNum, FSRef *newRef) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus PBCreateFileAndOpenForkUnicodeSync(FSRefForkIOParamPtr paramBlock) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern void PBCreateFileAndOpenForkUnicodeAsync(FSRefForkIOParamPtr paramBlock) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSErr FSCreateFork(const FSRef *ref, UniCharCount forkNameLength, const UniChar *forkName) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBCreateForkSync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBCreateForkAsync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSDeleteFork(const FSRef *ref, UniCharCount forkNameLength, const UniChar *forkName) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBDeleteForkSync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBDeleteForkAsync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSIterateForks(const FSRef *ref, CatPositionRec *forkIterator, HFSUniStr255 *forkName, SInt64 *forkSize, UInt64 *forkPhysicalSize) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBIterateForksSync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBIterateForksAsync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSOpenFork(const FSRef *ref, UniCharCount forkNameLength, const UniChar *forkName, SInt8 permissions, FSIORefNum *forkRefNum) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBOpenForkSync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBOpenForkAsync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSReadFork(FSIORefNum forkRefNum, UInt16 positionMode, SInt64 positionOffset, ByteCount requestCount, void *buffer, ByteCount *actualCount) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBReadForkSync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBReadForkAsync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSWriteFork(FSIORefNum forkRefNum, UInt16 positionMode, SInt64 positionOffset, ByteCount requestCount, const void *buffer, ByteCount *actualCount) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBWriteForkSync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBWriteForkAsync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSGetForkPosition(FSIORefNum forkRefNum, SInt64 *position) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBGetForkPositionSync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBGetForkPositionAsync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSSetForkPosition(FSIORefNum forkRefNum, UInt16 positionMode, SInt64 positionOffset) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBSetForkPositionSync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBSetForkPositionAsync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSGetForkSize(FSIORefNum forkRefNum, SInt64 *forkSize) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBGetForkSizeSync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBGetForkSizeAsync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSSetForkSize(FSIORefNum forkRefNum, UInt16 positionMode, SInt64 positionOffset) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBSetForkSizeSync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBSetForkSizeAsync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSAllocateFork(FSIORefNum forkRefNum, FSAllocationFlags flags, UInt16 positionMode, SInt64 positionOffset, UInt64 requestCount, UInt64 *actualCount) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBAllocateForkSync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBAllocateForkAsync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSFlushFork(FSIORefNum forkRefNum) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBFlushForkSync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBFlushForkAsync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSCloseFork(FSIORefNum forkRefNum) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBCloseForkSync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBCloseForkAsync(FSForkIOParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSGetForkCBInfo(FSIORefNum desiredRefNum, FSVolumeRefNum volume, short *iterator, FSIORefNum *actualRefNum, FSForkInfo *forkInfo, FSRef *ref, HFSUniStr255 *outForkName) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBGetForkCBInfoSync(FSForkCBInfoParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBGetForkCBInfoAsync(FSForkCBInfoParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus FSLockRange(FSIORefNum forkRefNum, UInt16 positionMode, SInt64 positionOffset, UInt64 requestCount, UInt64 *rangeStart) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus PBXLockRangeSync(FSRangeLockParamPtr paramBlock) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus PBXLockRangeAsync(FSRangeLockParamPtr paramBlock) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSUnlockRange(FSIORefNum forkRefNum, UInt16 positionMode, SInt64 positionOffset, UInt64 requestCount, UInt64 *rangeStart) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus PBXUnlockRangeSync(FSRangeLockParamPtr paramBlock) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus PBXUnlockRangeAsync(FSRangeLockParamPtr paramBlock) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSErr FSGetVolumeInfo(FSVolumeRefNum volume, ItemCount volumeIndex, FSVolumeRefNum *actualVolume, FSVolumeInfoBitmap whichInfo, FSVolumeInfo *info, HFSUniStr255 *volumeName, FSRef *rootDirectory) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBGetVolumeInfoSync(FSVolumeInfoParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBGetVolumeInfoAsync(FSVolumeInfoParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSSetVolumeInfo(FSVolumeRefNum volume, FSVolumeInfoBitmap whichInfo, const FSVolumeInfo *info) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr PBSetVolumeInfoSync(FSVolumeInfoParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void PBSetVolumeInfoAsync(FSVolumeInfoParam * paramBlock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSGetDataForkName(HFSUniStr255 * dataForkName) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr FSGetResourceForkName(HFSUniStr255 * resourceForkName) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus FSRefMakePath(const FSRef *ref, UInt8 *path, UInt32 pathBufferSize) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus FSPathMakeRef(const UInt8 *path, FSRef *ref, Boolean *isDirectory) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +enum { + kFSPathMakeRefDefaultOptions = 0, + kFSPathMakeRefDoNotFollowLeafSymlink = 0x01 +}; +extern OSStatus FSPathMakeRefWithOptions(const UInt8 *path, OptionBits options, FSRef *ref, Boolean *isDirectory) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern Boolean FSIsFSRefValid(const FSRef * ref) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +typedef UInt32 FNMessage; +enum { + kFNDirectoryModifiedMessage = 1 +}; +extern OSStatus FNNotify(const FSRef *ref, FNMessage message, OptionBits flags) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus FNNotifyByPath(const UInt8 *path, FNMessage message, OptionBits flags) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus FNNotifyAll(FNMessage message, OptionBits flags) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +typedef struct OpaqueFNSubscriptionRef* FNSubscriptionRef; + + + + + +enum { + + + + + + + + kFNNoImplicitAllSubscription = (1 << 0), + + + + + + + + kFNNotifyInBackground = (1 << 1) +}; +typedef void ( * FNSubscriptionProcPtr)(FNMessage message, OptionBits flags, void *refcon, FNSubscriptionRef subscription); +typedef FNSubscriptionProcPtr FNSubscriptionUPP; +extern FNSubscriptionUPP +NewFNSubscriptionUPP(FNSubscriptionProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.1,deprecated=10.8))); +extern void +DisposeFNSubscriptionUPP(FNSubscriptionUPP userUPP) __attribute__((availability(macosx,introduced=10.1,deprecated=10.8))); +extern void +InvokeFNSubscriptionUPP( + FNMessage message, + OptionBits flags, + void * refcon, + FNSubscriptionRef subscription, + FNSubscriptionUPP userUPP) __attribute__((availability(macosx,introduced=10.1,deprecated=10.8))); +extern OSStatus FNSubscribe(const FSRef *directoryRef, FNSubscriptionUPP callback, void *refcon, OptionBits flags, FNSubscriptionRef *subscription) __attribute__((availability(macosx,introduced=10.1,deprecated=10.8))); +extern OSStatus FNSubscribeByPath(const UInt8 *directoryPath, FNSubscriptionUPP callback, void *refcon, OptionBits flags, FNSubscriptionRef *subscription) __attribute__((availability(macosx,introduced=10.1,deprecated=10.8))); +extern OSStatus FNUnsubscribe(FNSubscriptionRef subscription) __attribute__((availability(macosx,introduced=10.1,deprecated=10.8))); +extern OSStatus FNGetDirectoryForSubscription(FNSubscriptionRef subscription, FSRef *ref) __attribute__((availability(macosx,introduced=10.1,deprecated=10.8))); + + + + +enum { + kAsyncMountInProgress = 1, + kAsyncMountComplete = 2, + kAsyncUnmountInProgress = 3, + kAsyncUnmountComplete = 4, + kAsyncEjectInProgress = 5, + kAsyncEjectComplete = 6 +}; + + +typedef UInt32 FSMountStatus; +typedef UInt32 FSEjectStatus; +typedef UInt32 FSUnmountStatus; +typedef struct OpaqueFSVolumeOperation* FSVolumeOperation; +typedef void ( * FSVolumeMountProcPtr)(FSVolumeOperation volumeOp, void *clientData, OSStatus err, FSVolumeRefNum mountedVolumeRefNum); +typedef void ( * FSVolumeUnmountProcPtr)(FSVolumeOperation volumeOp, void *clientData, OSStatus err, FSVolumeRefNum volumeRefNum, pid_t dissenter); +typedef void ( * FSVolumeEjectProcPtr)(FSVolumeOperation volumeOp, void *clientData, OSStatus err, FSVolumeRefNum volumeRefNum, pid_t dissenter); +typedef FSVolumeMountProcPtr FSVolumeMountUPP; +typedef FSVolumeUnmountProcPtr FSVolumeUnmountUPP; +typedef FSVolumeEjectProcPtr FSVolumeEjectUPP; +extern FSVolumeMountUPP +NewFSVolumeMountUPP(FSVolumeMountProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern FSVolumeUnmountUPP +NewFSVolumeUnmountUPP(FSVolumeUnmountProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern FSVolumeEjectUPP +NewFSVolumeEjectUPP(FSVolumeEjectProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern void +DisposeFSVolumeMountUPP(FSVolumeMountUPP userUPP) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern void +DisposeFSVolumeUnmountUPP(FSVolumeUnmountUPP userUPP) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern void +DisposeFSVolumeEjectUPP(FSVolumeEjectUPP userUPP) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern void +InvokeFSVolumeMountUPP( + FSVolumeOperation volumeOp, + void * clientData, + OSStatus err, + FSVolumeRefNum mountedVolumeRefNum, + FSVolumeMountUPP userUPP) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern void +InvokeFSVolumeUnmountUPP( + FSVolumeOperation volumeOp, + void * clientData, + OSStatus err, + FSVolumeRefNum volumeRefNum, + pid_t dissenter, + FSVolumeUnmountUPP userUPP) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern void +InvokeFSVolumeEjectUPP( + FSVolumeOperation volumeOp, + void * clientData, + OSStatus err, + FSVolumeRefNum volumeRefNum, + pid_t dissenter, + FSVolumeEjectUPP userUPP) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +enum { + + + + + + kFSMountServerMarkDoNotDisplay = (1 << 0), + + + + + + kFSMountServerMountOnMountDir = (1 << 2), + + + + + + kFSMountServerSuppressConnectionUI = (1 << 6) +}; +enum { + + + + + + + kFSMountServerMountWithoutNotification = (1 << 1) +}; + + + + + + +enum { + kFSEjectVolumeForceEject = (1 << 0) +}; + + + + + + +enum { + kFSUnmountVolumeForceUnmount = (1 << 0) +}; +extern OSStatus FSCreateVolumeOperation(FSVolumeOperation * volumeOp) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern OSStatus FSDisposeVolumeOperation(FSVolumeOperation volumeOp) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern OSStatus FSMountLocalVolumeSync(CFStringRef diskID, CFURLRef mountDir, FSVolumeRefNum *mountedVolumeRefNum, OptionBits flags) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern OSStatus FSMountLocalVolumeAsync(CFStringRef diskID, CFURLRef mountDir, FSVolumeOperation volumeOp, void *clientData, OptionBits flags, FSVolumeMountUPP callback, CFRunLoopRef runloop, CFStringRef runloopMode) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern OSStatus FSMountServerVolumeSync(CFURLRef url, CFURLRef mountDir, CFStringRef user, CFStringRef password, FSVolumeRefNum *mountedVolumeRefNum, OptionBits flags) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern OSStatus FSMountServerVolumeAsync(CFURLRef url, CFURLRef mountDir, CFStringRef user, CFStringRef password, FSVolumeOperation volumeOp, void *clientData, OptionBits flags, FSVolumeMountUPP callback, CFRunLoopRef runloop, CFStringRef runloopMode) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern OSStatus FSGetAsyncMountStatus(FSVolumeOperation volumeOp, FSMountStatus *status, OSStatus *volumeOpStatus, FSVolumeRefNum *mountedVolumeRefNum, void **clientData) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern OSStatus FSUnmountVolumeSync(FSVolumeRefNum vRefNum, OptionBits flags, pid_t *dissenter) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern OSStatus FSUnmountVolumeAsync(FSVolumeRefNum vRefNum, OptionBits flags, FSVolumeOperation volumeOp, void *clientData, FSVolumeUnmountUPP callback, CFRunLoopRef runloop, CFStringRef runloopMode) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern OSStatus FSGetAsyncUnmountStatus(FSVolumeOperation volumeOp, FSUnmountStatus *status, OSStatus *volumeOpStatus, FSVolumeRefNum *volumeRefNum, pid_t *dissenter, void **clientData) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern OSStatus FSCancelVolumeOperation(FSVolumeOperation volumeOp) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern OSStatus FSEjectVolumeSync(FSVolumeRefNum vRefNum, OptionBits flags, pid_t *dissenter) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern OSStatus FSEjectVolumeAsync(FSVolumeRefNum vRefNum, OptionBits flags, FSVolumeOperation volumeOp, void *clientData, FSVolumeEjectUPP callback, CFRunLoopRef runloop, CFStringRef runloopMode) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern OSStatus FSGetAsyncEjectStatus(FSVolumeOperation volumeOp, FSEjectStatus *status, OSStatus *volumeOpStatus, FSVolumeRefNum *volumeRefNum, pid_t *dissenter, void **clientData) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern OSStatus FSCopyDiskIDForVolume(FSVolumeRefNum vRefNum, CFStringRef *diskID) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern OSStatus FSCopyURLForVolume(FSVolumeRefNum vRefNum, CFURLRef *url) __attribute__((availability(macosx,introduced=10.3,deprecated=10.8))); +extern OSStatus FSGetVolumeForDiskID(CFStringRef diskID, FSVolumeRefNum *vRefNum) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSCopyDADiskForVolume(FSVolumeRefNum vRefNum, DADiskRef *disk) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSGetVolumeForDADisk(DADiskRef disk, FSVolumeRefNum *vRefNum) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); + + + + +typedef struct __FSFileOperation* FSFileOperationRef; +typedef UInt32 FSFileOperationStage; +struct FSFileOperationClientContext { + + + + + + + CFIndex version; + + + + + + void * info; + CFAllocatorRetainCallBack retain; + + + + + + CFAllocatorReleaseCallBack release; + + + + + + + + CFAllocatorCopyDescriptionCallBack copyDescription; +}; +typedef struct FSFileOperationClientContext FSFileOperationClientContext; +typedef void ( * FSFileOperationStatusProcPtr)(FSFileOperationRef fileOp, const FSRef *currentItem, FSFileOperationStage stage, OSStatus error, CFDictionaryRef statusDictionary, void *info); +typedef void ( * FSPathFileOperationStatusProcPtr)(FSFileOperationRef fileOp, const char *currentItem, FSFileOperationStage stage, OSStatus error, CFDictionaryRef statusDictionary, void *info); +enum { + + + + + + kFSFileOperationDefaultOptions = 0, + + + + + + kFSFileOperationOverwrite = 0x01, + + + + + + kFSFileOperationSkipSourcePermissionErrors = 0x02, + + + + + + kFSFileOperationDoNotMoveAcrossVolumes = 0x04, + + + + + + + kFSFileOperationSkipPreflight = 0x08 +}; +enum { + + + + + kFSOperationStageUndefined = 0, + + + + + + kFSOperationStagePreflighting = 1, + + + + + kFSOperationStageRunning = 2, + + + + + kFSOperationStageComplete = 3 +}; +extern const CFStringRef kFSOperationTotalBytesKey __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern const CFStringRef kFSOperationBytesCompleteKey __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern const CFStringRef kFSOperationBytesRemainingKey __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern const CFStringRef kFSOperationTotalObjectsKey __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern const CFStringRef kFSOperationObjectsCompleteKey __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern const CFStringRef kFSOperationObjectsRemainingKey __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern const CFStringRef kFSOperationTotalUserVisibleObjectsKey __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern const CFStringRef kFSOperationUserVisibleObjectsCompleteKey __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern const CFStringRef kFSOperationUserVisibleObjectsRemainingKey __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern const CFStringRef kFSOperationThroughputKey __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSCopyObjectSync(const FSRef *source, const FSRef *destDir, CFStringRef destName, FSRef *target, OptionBits options) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSMoveObjectSync(const FSRef *source, const FSRef *destDir, CFStringRef destName, FSRef *target, OptionBits options) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSMoveObjectToTrashSync(const FSRef *source, FSRef *target, OptionBits options) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSStatus FSPathCopyObjectSync(const char *sourcePath, const char *destDirPath, CFStringRef destName, char **targetPath, OptionBits options) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSPathMoveObjectSync(const char *sourcePath, const char *destDirPath, CFStringRef destName, char **targetPath, OptionBits options) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSPathMoveObjectToTrashSync(const char *sourcePath, char **targetPath, OptionBits options) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern CFTypeID FSFileOperationGetTypeID(void) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern FSFileOperationRef FSFileOperationCreate(CFAllocatorRef alloc) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSFileOperationScheduleWithRunLoop(FSFileOperationRef fileOp, CFRunLoopRef runLoop, CFStringRef runLoopMode) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSFileOperationUnscheduleFromRunLoop(FSFileOperationRef fileOp, CFRunLoopRef runLoop, CFStringRef runLoopMode) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSCopyObjectAsync(FSFileOperationRef fileOp, const FSRef *source, const FSRef *destDir, CFStringRef destName, OptionBits flags, FSFileOperationStatusProcPtr callback, CFTimeInterval statusChangeInterval, FSFileOperationClientContext *clientContext) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSMoveObjectAsync(FSFileOperationRef fileOp, const FSRef *source, const FSRef *destDir, CFStringRef destName, OptionBits flags, FSFileOperationStatusProcPtr callback, CFTimeInterval statusChangeInterval, FSFileOperationClientContext *clientContext) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSMoveObjectToTrashAsync(FSFileOperationRef fileOp, const FSRef *source, OptionBits flags, FSFileOperationStatusProcPtr callback, CFTimeInterval statusChangeInterval, FSFileOperationClientContext *clientContext) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSStatus FSPathCopyObjectAsync(FSFileOperationRef fileOp, const char *sourcePath, const char *destDirPath, CFStringRef destName, OptionBits flags, FSPathFileOperationStatusProcPtr callback, CFTimeInterval statusChangeInterval, FSFileOperationClientContext *clientContext) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSPathMoveObjectAsync(FSFileOperationRef fileOp, const char *sourcePath, const char *destDirPath, CFStringRef destName, OptionBits flags, FSPathFileOperationStatusProcPtr callback, CFTimeInterval statusChangeInterval, FSFileOperationClientContext *clientContext) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSPathMoveObjectToTrashAsync(FSFileOperationRef fileOp, const char *sourcePath, OptionBits flags, FSPathFileOperationStatusProcPtr callback, CFTimeInterval statusChangeInterval, FSFileOperationClientContext *clientContext) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSStatus FSFileOperationCancel(FSFileOperationRef fileOp) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSFileOperationCopyStatus(FSFileOperationRef fileOp, FSRef *currentItem, FSFileOperationStage *stage, OSStatus *error, CFDictionaryRef *statusDictionary, void **info) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSPathFileOperationCopyStatus(FSFileOperationRef fileOp, char **currentItem, FSFileOperationStage *stage, OSStatus *error, CFDictionaryRef *statusDictionary, void **info) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern CFStringRef FSCreateStringFromHFSUniStr(CFAllocatorRef alloc, const HFSUniStr255 *uniStr) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSGetHFSUniStrFromString(CFStringRef theString, HFSUniStr255 *uniStr) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern CFTypeID FSFileSecurityGetTypeID(void) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern FSFileSecurityRef FSFileSecurityCreate(CFAllocatorRef alloc) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern FSFileSecurityRef FSFileSecurityCreateWithFSPermissionInfo(CFAllocatorRef alloc, const FSPermissionInfo *permissions) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern FSFileSecurityRef FSFileSecurityRefCreateCopy(CFAllocatorRef alloc, FSFileSecurityRef fileSec) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSFileSecurityGetOwnerUUID(FSFileSecurityRef fileSec, CFUUIDBytes *owner) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSFileSecuritySetOwnerUUID(FSFileSecurityRef fileSec, const CFUUIDBytes *owner) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSFileSecurityGetGroupUUID(FSFileSecurityRef fileSec, CFUUIDBytes *group) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSFileSecuritySetGroupUUID(FSFileSecurityRef fileSec, const CFUUIDBytes *group) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSFileSecurityCopyAccessControlList(FSFileSecurityRef fileSec, acl_t *accessControlList) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSFileSecuritySetAccessControlList(FSFileSecurityRef fileSec, acl_t accessControlList) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSFileSecurityGetOwner(FSFileSecurityRef fileSec, UInt32 *owner) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSFileSecuritySetOwner(FSFileSecurityRef fileSec, UInt32 owner) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSFileSecurityGetGroup(FSFileSecurityRef fileSec, UInt32 *group) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSFileSecuritySetGroup(FSFileSecurityRef fileSec, UInt32 group) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSFileSecurityGetMode(FSFileSecurityRef fileSec, UInt16 *mode) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSStatus FSFileSecuritySetMode(FSFileSecurityRef fileSec, UInt16 mode) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); + + + +enum { + + pleaseCacheBit = 4, + pleaseCacheMask = 0x0010, + noCacheBit = 5, + noCacheMask = 0x0020, + rdVerifyBit = 6, + rdVerifyMask = 0x0040, + rdVerify = 64, + forceReadBit = 6, + forceReadMask = 0x0040, + newLineBit = 7, + newLineMask = 0x0080, + newLineCharMask = 0xFF00 +}; + + + +enum { + kOwnerID2Name = 1, + kGroupID2Name = 2, + kOwnerName2ID = 3, + kGroupName2ID = 4, + kReturnNextUser = 1, + kReturnNextGroup = 2, + kReturnNextUG = 3 +}; + + +enum { + kVCBFlagsIdleFlushBit = 3, + kVCBFlagsIdleFlushMask = 0x0008, + kVCBFlagsHFSPlusAPIsBit = 4, + kVCBFlagsHFSPlusAPIsMask = 0x0010, + kVCBFlagsHardwareGoneBit = 5, + kVCBFlagsHardwareGoneMask = 0x0020, + kVCBFlagsVolumeDirtyBit = 15, + kVCBFlagsVolumeDirtyMask = 0x8000 +}; + + +enum { + kioVAtrbDefaultVolumeBit = 5, + kioVAtrbDefaultVolumeMask = 0x0020, + kioVAtrbFilesOpenBit = 6, + kioVAtrbFilesOpenMask = 0x0040, + kioVAtrbHardwareLockedBit = 7, + kioVAtrbHardwareLockedMask = 0x0080, + kioVAtrbSoftwareLockedBit = 15, + kioVAtrbSoftwareLockedMask = 0x8000 +}; + + +enum { + + kioFlAttribLockedBit = 0, + kioFlAttribLockedMask = 0x01, + kioFlAttribResOpenBit = 2, + kioFlAttribResOpenMask = 0x04, + kioFlAttribDataOpenBit = 3, + kioFlAttribDataOpenMask = 0x08, + kioFlAttribDirBit = 4, + kioFlAttribDirMask = 0x10, + ioDirFlg = 4, + ioDirMask = 0x10, + kioFlAttribCopyProtBit = 6, + kioFlAttribCopyProtMask = 0x40, + kioFlAttribFileOpenBit = 7, + kioFlAttribFileOpenMask = 0x80, + kioFlAttribInSharedBit = 2, + kioFlAttribInSharedMask = 0x04, + kioFlAttribMountedBit = 3, + kioFlAttribMountedMask = 0x08, + kioFlAttribSharePointBit = 5, + kioFlAttribSharePointMask = 0x20 +}; + + + + + +enum { + kioFCBWriteBit = 8, + kioFCBWriteMask = 0x0100, + kioFCBResourceBit = 9, + kioFCBResourceMask = 0x0200, + kioFCBWriteLockedBit = 10, + kioFCBWriteLockedMask = 0x0400, + kioFCBLargeFileBit = 11, + kioFCBLargeFileMask = 0x0800, + kioFCBSharedWriteBit = 12, + kioFCBSharedWriteMask = 0x1000, + kioFCBFileLockedBit = 13, + kioFCBFileLockedMask = 0x2000, + kioFCBOwnClumpBit = 14, + kioFCBOwnClumpMask = 0x4000, + kioFCBModifiedBit = 15, + kioFCBModifiedMask = 0x8000 +}; + + + + +enum { + kForkInfoFlagsWriteBit = (kioFCBWriteBit - 8), + kForkInfoFlagsWriteMask = (1 << kForkInfoFlagsWriteBit), + kForkInfoFlagsResourceBit = (kioFCBResourceBit - 8), + kForkInfoFlagsResourceMask = (1 << kForkInfoFlagsResourceBit), + kForkInfoFlagsWriteLockedBit = (kioFCBWriteLockedBit - 8), + kForkInfoFlagsWriteLockedMask = (1 << kForkInfoFlagsWriteLockedBit), + kForkInfoFlagsLargeFileBit = (kioFCBLargeFileBit - 8), + kForkInfoFlagsLargeFileMask = (1 << kForkInfoFlagsLargeFileBit), + kForkInfoFlagsSharedWriteBit = (kioFCBSharedWriteBit - 8), + kForkInfoFlagsSharedWriteMask = (1 << kForkInfoFlagsSharedWriteBit), + kForkInfoFlagsFileLockedBit = (kioFCBFileLockedBit - 8), + kForkInfoFlagsFileLockedMask = (1 << kForkInfoFlagsFileLockedBit), + kForkInfoFlagsOwnClumpBit = (kioFCBOwnClumpBit - 8), + kForkInfoFlagsOwnClumpMask = (1 << kForkInfoFlagsOwnClumpBit), + kForkInfoFlagsModifiedBit = (kioFCBModifiedBit - 8), + kForkInfoFlagsModifiedMask = (1 << kForkInfoFlagsModifiedBit) +}; + + + +enum { + kioACUserNoSeeFolderBit = 0, + kioACUserNoSeeFolderMask = 0x01, + kioACUserNoSeeFilesBit = 1, + kioACUserNoSeeFilesMask = 0x02, + kioACUserNoMakeChangesBit = 2, + kioACUserNoMakeChangesMask = 0x04, + kioACUserNotOwnerBit = 7, + kioACUserNotOwnerMask = 0x80 +}; + + +enum { + kioACAccessOwnerBit = 31, + kioACAccessOwnerMask = (int)0x80000000, + kioACAccessBlankAccessBit = 28, + kioACAccessBlankAccessMask = 0x10000000, + kioACAccessUserWriteBit = 26, + kioACAccessUserWriteMask = 0x04000000, + kioACAccessUserReadBit = 25, + kioACAccessUserReadMask = 0x02000000, + kioACAccessUserSearchBit = 24, + kioACAccessUserSearchMask = 0x01000000, + kioACAccessEveryoneWriteBit = 18, + kioACAccessEveryoneWriteMask = 0x00040000, + kioACAccessEveryoneReadBit = 17, + kioACAccessEveryoneReadMask = 0x00020000, + kioACAccessEveryoneSearchBit = 16, + kioACAccessEveryoneSearchMask = 0x00010000, + kioACAccessGroupWriteBit = 10, + kioACAccessGroupWriteMask = 0x00000400, + kioACAccessGroupReadBit = 9, + kioACAccessGroupReadMask = 0x00000200, + kioACAccessGroupSearchBit = 8, + kioACAccessGroupSearchMask = 0x00000100, + kioACAccessOwnerWriteBit = 2, + kioACAccessOwnerWriteMask = 0x00000004, + kioACAccessOwnerReadBit = 1, + kioACAccessOwnerReadMask = 0x00000002, + kioACAccessOwnerSearchBit = 0, + kioACAccessOwnerSearchMask = 0x00000001, + kfullPrivileges = 0x00070007, + kownerPrivileges = 0x00000007 +}; +extern OSStatus FSGetVolumeParms(FSVolumeRefNum volume, GetVolParmsInfoBuffer *buffer, ByteCount bufferSize) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSStatus FSGetVolumeMountInfoSize(FSVolumeRefNum volume, ByteCount *size) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSStatus FSGetVolumeMountInfo(FSVolumeRefNum volume, BytePtr buffer, ByteCount bufferSize, ByteCount *actualSize) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSStatus FSVolumeMount(BytePtr buffer, FSVolumeRefNum *mountedVolume) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSStatus FSFlushVolume(FSVolumeRefNum vRefNum) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSStatus PBFlushVolumeSync(FSRefParamPtr paramBlock) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSStatus PBFlushVolumeAsync(FSRefParamPtr paramBlock) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSStatus PBFSCopyFileSync(FSRefParamPtr paramBlock) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSStatus PBFSCopyFileAsync(FSRefParamPtr paramBlock) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSStatus FSResolveNodeID(FSVolumeRefNum volume, UInt32 nodeID, FSRefPtr newRef) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSStatus PBFSResolveNodeIDSync(FSRefParamPtr paramBlock) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSStatus PBFSResolveNodeIDAsync(FSRefParamPtr paramBlock) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); + + + +typedef SInt16 ResID; +typedef SInt16 ResAttributes; +typedef SInt16 ResFileAttributes; +typedef SInt16 ResourceCount; +typedef SInt16 ResourceIndex; +typedef FSIORefNum ResFileRefNum; + +enum { + resSysRefBit = 7, + resSysHeapBit = 6, + resPurgeableBit = 5, + resLockedBit = 4, + resProtectedBit = 3, + resPreloadBit = 2, + resChangedBit = 1 +}; + + +enum { + resSysHeap = 64, + resPurgeable = 32, + resLocked = 16, + resProtected = 8, + resPreload = 4, + resChanged = 2 +}; + + +enum { + mapReadOnlyBit = 7, + mapCompactBit = 6, + mapChangedBit = 5 +}; + + +enum { + mapReadOnly = 128, + mapCompact = 64, + mapChanged = 32 +}; + + +enum { + kResFileNotOpened = -1, + kSystemResFile = 0 +}; + + +typedef void ( * ResErrProcPtr)(OSErr thErr); +typedef ResErrProcPtr ResErrUPP; +extern ResErrUPP +NewResErrUPP(ResErrProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeResErrUPP(ResErrUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +InvokeResErrUPP( + OSErr thErr, + ResErrUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +typedef OSErr ( * ResourceEndianFilterPtr)(Handle theResource, Boolean currentlyNativeEndian); +extern void +CloseResFile(ResFileRefNum refNum) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +ResError(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ResFileRefNum +CurResFile(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ResFileRefNum +HomeResFile(Handle theResource) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +UseResFile(ResFileRefNum refNum) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ResourceCount +CountTypes(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ResourceCount +Count1Types(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +GetIndType( + ResType * theType, + ResourceIndex itemIndex) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +Get1IndType( + ResType * theType, + ResourceIndex itemIndex) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +SetResLoad(Boolean load) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ResourceCount +CountResources(ResType theType) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ResourceCount +Count1Resources(ResType theType) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Handle +GetIndResource( + ResType theType, + ResourceIndex itemIndex) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Handle +Get1IndResource( + ResType theType, + ResourceIndex itemIndex) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Handle +GetResource( + ResType theType, + ResID theID) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Handle +Get1Resource( + ResType theType, + ResID theID) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Handle +GetNamedResource( + ResType theType, + ConstStr255Param name) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Handle +Get1NamedResource( + ResType theType, + ConstStr255Param name) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +LoadResource(Handle theResource) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +ReleaseResource(Handle theResource) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DetachResource(Handle theResource) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ResID +UniqueID(ResType theType) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ResID +Unique1ID(ResType theType) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ResAttributes +GetResAttrs(Handle theResource) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +GetResInfo( + Handle theResource, + ResID * theID, + ResType * theType, + Str255 name) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +SetResInfo( + Handle theResource, + ResID theID, + ConstStr255Param name) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +AddResource( + Handle theData, + ResType theType, + ResID theID, + ConstStr255Param name) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern long +GetResourceSizeOnDisk(Handle theResource) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern long +GetMaxResourceSize(Handle theResource) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +SetResAttrs( + Handle theResource, + ResAttributes attrs) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +ChangedResource(Handle theResource) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +RemoveResource(Handle theResource) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +UpdateResFile(ResFileRefNum refNum) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +WriteResource(Handle theResource) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +SetResPurge(Boolean install) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ResFileAttributes +GetResFileAttrs(ResFileRefNum refNum) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +SetResFileAttrs( + ResFileRefNum refNum, + ResFileAttributes attrs) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +ReadPartialResource( + Handle theResource, + long offset, + void * buffer, + long count) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +WritePartialResource( + Handle theResource, + long offset, + const void * buffer, + long count) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +SetResourceSize( + Handle theResource, + long newSize) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Handle +GetNextFOND(Handle fondHandle) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +typedef SInt16 RsrcChainLocation; +enum { + kRsrcChainBelowSystemMap = 0, + kRsrcChainBelowApplicationMap = 1, + kRsrcChainAboveApplicationMap = 2, + kRsrcChainAboveAllMaps = 4 +}; +extern OSErr +InsertResourceFile( + ResFileRefNum refNum, + RsrcChainLocation where) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +DetachResourceFile(ResFileRefNum refNum) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +GetTopResourceFile(ResFileRefNum * refNum) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +GetNextResourceFile( + ResFileRefNum curRefNum, + ResFileRefNum * nextRefNum) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ResFileRefNum +FSOpenResFile( + const FSRef * ref, + SInt8 permission) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +FSCreateResFile( + const FSRef * parentRef, + UniCharCount nameLength, + const UniChar * name, + FSCatalogInfoBitmap whichInfo, + const FSCatalogInfo * catalogInfo, + FSRef * newRef, + FSSpecPtr newSpec) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Boolean +FSResourceFileAlreadyOpen( + const FSRef * resourceFileRef, + Boolean * inChain, + ResFileRefNum * refNum) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +FSOpenOrphanResFile( + const FSRef * ref, + SignedByte permission, + ResFileRefNum * refNum) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSErr +FSCreateResourceFile( + const FSRef * parentRef, + UniCharCount nameLength, + const UniChar * name, + FSCatalogInfoBitmap whichInfo, + const FSCatalogInfo * catalogInfo, + UniCharCount forkNameLength, + const UniChar * forkName, + FSRef * newRef, + FSSpecPtr newSpec) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +FSCreateResourceFork( + const FSRef * ref, + UniCharCount forkNameLength, + const UniChar * forkName, + UInt32 flags) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern OSErr +FSOpenResourceFile( + const FSRef * ref, + UniCharCount forkNameLength, + const UniChar * forkName, + SInt8 permissions, + ResFileRefNum * refNum) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); + +enum { + kAppleManufacturer = 'appl', + kComponentResourceType = 'thng', + kComponentAliasResourceType = 'thga' +}; + +enum { + kAnyComponentType = 0, + kAnyComponentSubType = 0, + kAnyComponentManufacturer = 0, + kAnyComponentFlagsMask = 0 +}; + +enum { + cmpThreadSafe = 1UL << 28, + cmpIsMissing = 1UL << 29, + cmpWantsRegisterMessage = 1UL << 31 +}; + +enum { + kComponentOpenSelect = -1, + kComponentCloseSelect = -2, + kComponentCanDoSelect = -3, + kComponentVersionSelect = -4, + kComponentRegisterSelect = -5, + kComponentTargetSelect = -6, + kComponentUnregisterSelect = -7, + kComponentGetMPWorkFunctionSelect = -8, + kComponentExecuteWiredActionSelect = -9, + kComponentGetPublicResourceSelect = -10 +}; + + +enum { + componentDoAutoVersion = (1 << 0), + componentWantsUnregister = (1 << 1), + componentAutoVersionIncludeFlags = (1 << 2), + componentHasMultiplePlatforms = (1 << 3), + componentLoadResident = (1 << 4) +}; + + + + +enum { + defaultComponentIdentical = 0, + defaultComponentAnyFlags = 1, + defaultComponentAnyManufacturer = 2, + defaultComponentAnySubType = 4, + defaultComponentAnyFlagsAnyManufacturer = (defaultComponentAnyFlags + defaultComponentAnyManufacturer), + defaultComponentAnyFlagsAnyManufacturerAnySubType = (defaultComponentAnyFlags + defaultComponentAnyManufacturer + defaultComponentAnySubType) +}; + + +enum { + registerComponentGlobal = 1, + registerComponentNoDuplicates = 2, + registerComponentAfterExisting = 4, + registerComponentAliasesOnly = 8 +}; + + +struct ComponentDescription { + OSType componentType; + OSType componentSubType; + OSType componentManufacturer; + UInt32 componentFlags; + UInt32 componentFlagsMask; +}; +typedef struct ComponentDescription ComponentDescription; + +struct ResourceSpec { + OSType resType; + SInt16 resID; +}; +typedef struct ResourceSpec ResourceSpec; +struct ComponentResource { + ComponentDescription cd; + ResourceSpec component; + ResourceSpec componentName; + ResourceSpec componentInfo; + ResourceSpec componentIcon; +}; +typedef struct ComponentResource ComponentResource; +typedef ComponentResource * ComponentResourcePtr; +typedef ComponentResourcePtr * ComponentResourceHandle; +struct ComponentPlatformInfo { + SInt32 componentFlags; + ResourceSpec component; + SInt16 platformType; +}; +typedef struct ComponentPlatformInfo ComponentPlatformInfo; +struct ComponentResourceExtension { + SInt32 componentVersion; + SInt32 componentRegisterFlags; + SInt16 componentIconFamily; +}; +typedef struct ComponentResourceExtension ComponentResourceExtension; +struct ComponentPlatformInfoArray { + SInt32 count; + ComponentPlatformInfo platformArray[1]; +}; +typedef struct ComponentPlatformInfoArray ComponentPlatformInfoArray; +struct ExtComponentResource { + ComponentDescription cd; + ResourceSpec component; + ResourceSpec componentName; + ResourceSpec componentInfo; + ResourceSpec componentIcon; + SInt32 componentVersion; + SInt32 componentRegisterFlags; + SInt16 componentIconFamily; + SInt32 count; + ComponentPlatformInfo platformArray[1]; +}; +typedef struct ExtComponentResource ExtComponentResource; +typedef ExtComponentResource * ExtComponentResourcePtr; +typedef ExtComponentResourcePtr * ExtComponentResourceHandle; +struct ComponentAliasResource { + ComponentResource cr; + ComponentDescription aliasCD; +}; +typedef struct ComponentAliasResource ComponentAliasResource; + +struct ComponentParameters { + UInt8 flags; + UInt8 paramSize; + SInt16 what; + + + UInt32 padding; + + + long params[1]; +}; +typedef struct ComponentParameters ComponentParameters; +struct ComponentRecord { + long data[1]; +}; +typedef struct ComponentRecord ComponentRecord; +typedef ComponentRecord * Component; +struct ComponentInstanceRecord { + long data[1]; +}; +typedef struct ComponentInstanceRecord ComponentInstanceRecord; +typedef ComponentInstanceRecord * ComponentInstance; +struct RegisteredComponentRecord { + long data[1]; +}; +typedef struct RegisteredComponentRecord RegisteredComponentRecord; +typedef RegisteredComponentRecord * RegisteredComponentRecordPtr; +struct RegisteredComponentInstanceRecord { + long data[1]; +}; +typedef struct RegisteredComponentInstanceRecord RegisteredComponentInstanceRecord; +typedef RegisteredComponentInstanceRecord * RegisteredComponentInstanceRecordPtr; +typedef SInt32 ComponentResult; +enum { + platform68k = 1, + platformPowerPC = 2, + platformInterpreted = 3, + platformWin32 = 4, + platformPowerPCNativeEntryPoint = 5, + platformIA32NativeEntryPoint = 6, + platformPowerPC64NativeEntryPoint = 7, + platformX86_64NativeEntryPoint = 8 +}; + +enum { + platformIRIXmips = 1000, + platformSunOSsparc = 1100, + platformSunOSintel = 1101, + platformLinuxppc = 1200, + platformLinuxintel = 1201, + platformAIXppc = 1300, + platformNeXTIntel = 1400, + platformNeXTppc = 1401, + platformNeXTsparc = 1402, + platformNeXT68k = 1403, + platformMacOSx86 = 1500 +}; + +enum { + mpWorkFlagDoWork = (1 << 0), + mpWorkFlagDoCompletion = (1 << 1), + mpWorkFlagCopyWorkBlock = (1 << 2), + mpWorkFlagDontBlock = (1 << 3), + mpWorkFlagGetProcessorCount = (1 << 4), + mpWorkFlagGetIsRunning = (1 << 6) +}; + +enum { + cmpAliasNoFlags = 0, + cmpAliasOnlyThisFile = 1 +}; + +typedef UInt32 CSComponentsThreadMode; +enum { + kCSAcceptAllComponentsMode = 0, + kCSAcceptThreadSafeComponentsOnlyMode = 1 +}; +extern void +CSSetComponentsThreadMode(CSComponentsThreadMode mode) __attribute__((availability(macosx,introduced=10.3,deprecated=10.8))); +extern CSComponentsThreadMode +CSGetComponentsThreadMode(void) __attribute__((availability(macosx,introduced=10.3,deprecated=10.8))); + + +struct ComponentMPWorkFunctionHeaderRecord { + UInt32 headerSize; + UInt32 recordSize; + UInt32 workFlags; + UInt16 processorCount; + UInt8 unused; + UInt8 isRunning; +}; +typedef struct ComponentMPWorkFunctionHeaderRecord ComponentMPWorkFunctionHeaderRecord; +typedef ComponentMPWorkFunctionHeaderRecord * ComponentMPWorkFunctionHeaderRecordPtr; +typedef ComponentResult ( * ComponentMPWorkFunctionProcPtr)(void *globalRefCon, ComponentMPWorkFunctionHeaderRecordPtr header); +typedef ComponentResult ( * ComponentRoutineProcPtr)(ComponentParameters *cp, Handle componentStorage); +typedef OSErr ( * GetMissingComponentResourceProcPtr)(Component c, OSType resType, SInt16 resID, void *refCon, Handle *resource); +typedef ComponentMPWorkFunctionProcPtr ComponentMPWorkFunctionUPP; +typedef ComponentRoutineProcPtr ComponentRoutineUPP; +typedef GetMissingComponentResourceProcPtr GetMissingComponentResourceUPP; + + + + + +typedef UniversalProcPtr ComponentFunctionUPP; +extern ComponentFunctionUPP +NewComponentFunctionUPP( + ProcPtr userRoutine, + ProcInfoType procInfo) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeComponentFunctionUPP(ComponentFunctionUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Component +RegisterComponent( + ComponentDescription * cd, + ComponentRoutineUPP componentEntryPoint, + SInt16 global, + Handle componentName, + Handle componentInfo, + Handle componentIcon) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Component +RegisterComponentResource( + ComponentResourceHandle cr, + SInt16 global) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +UnregisterComponent(Component aComponent) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Component +FindNextComponent( + Component aComponent, + ComponentDescription * looking) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern long +CountComponents(ComponentDescription * looking) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +GetComponentInfo( + Component aComponent, + ComponentDescription * cd, + Handle componentName, + Handle componentInfo, + Handle componentIcon) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt32 +GetComponentListModSeed(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt32 +GetComponentTypeModSeed(OSType componentType) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +OpenAComponent( + Component aComponent, + ComponentInstance * ci) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ComponentInstance +OpenComponent(Component aComponent) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +CloseComponent(ComponentInstance aComponentInstance) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +GetComponentInstanceError(ComponentInstance aComponentInstance) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Component +ResolveComponentAlias(Component aComponent) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +GetComponentPublicResource( + Component aComponent, + OSType resourceType, + SInt16 resourceID, + Handle * theResource) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +GetComponentPublicResourceList( + OSType resourceType, + SInt16 resourceID, + SInt32 flags, + ComponentDescription * cd, + GetMissingComponentResourceUPP missingProc, + void * refCon, + void * atomContainerPtr) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +GetComponentPublicIndString( + Component aComponent, + Str255 theString, + SInt16 strListID, + SInt16 index) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +SetComponentInstanceError( + ComponentInstance aComponentInstance, + OSErr theError) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern long +GetComponentRefcon(Component aComponent) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +SetComponentRefcon( + Component aComponent, + long theRefcon) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ResFileRefNum +OpenComponentResFile(Component aComponent) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +OpenAComponentResFile( + Component aComponent, + ResFileRefNum * resRef) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +CloseComponentResFile(ResFileRefNum refnum) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +GetComponentResource( + Component aComponent, + OSType resType, + SInt16 resID, + Handle * theResource) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +GetComponentIndString( + Component aComponent, + Str255 theString, + SInt16 strListID, + SInt16 index) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Handle +GetComponentInstanceStorage(ComponentInstance aComponentInstance) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +SetComponentInstanceStorage( + ComponentInstance aComponentInstance, + Handle theStorage) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern long +CountComponentInstances(Component aComponent) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ComponentResult +CallComponentFunction( + ComponentParameters * params, + ComponentFunctionUPP func) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ComponentResult +CallComponentFunctionWithStorage( + Handle storage, + ComponentParameters * params, + ComponentFunctionUPP func) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ComponentResult +CallComponentFunctionWithStorageProcInfo( + Handle storage, + ComponentParameters * params, + ProcPtr func, + ProcInfoType funcProcInfo) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ComponentResult +DelegateComponentCall( + ComponentParameters * originalParams, + ComponentInstance ci) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +SetDefaultComponent( + Component aComponent, + SInt16 flags) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ComponentInstance +OpenDefaultComponent( + OSType componentType, + OSType componentSubType) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +OpenADefaultComponent( + OSType componentType, + OSType componentSubType, + ComponentInstance * ci) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Component +CaptureComponent( + Component capturedComponent, + Component capturingComponent) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +UncaptureComponent(Component aComponent) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt32 +RegisterComponentResourceFile( + SInt16 resRefNum, + SInt16 global) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +RegisterComponentFileRef( + const FSRef * ref, + SInt16 global) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +RegisterComponentFileRefEntries( + const FSRef * ref, + SInt16 global, + const ComponentDescription * toRegister, + UInt32 registerCount) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ComponentResult +CallComponentOpen( + ComponentInstance ci, + ComponentInstance self) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ComponentResult +CallComponentClose( + ComponentInstance ci, + ComponentInstance self) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ComponentResult +CallComponentCanDo( + ComponentInstance ci, + SInt16 ftnNumber) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ComponentResult +CallComponentVersion(ComponentInstance ci) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ComponentResult +CallComponentRegister(ComponentInstance ci) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ComponentResult +CallComponentTarget( + ComponentInstance ci, + ComponentInstance target) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ComponentResult +CallComponentUnregister(ComponentInstance ci) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ComponentResult +CallComponentGetMPWorkFunction( + ComponentInstance ci, + ComponentMPWorkFunctionUPP * workFunction, + void ** refCon) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ComponentResult +CallComponentGetPublicResource( + ComponentInstance ci, + OSType resourceType, + SInt16 resourceID, + Handle * resource) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ComponentResult +CallComponentDispatch(ComponentParameters * cp) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ComponentMPWorkFunctionUPP +NewComponentMPWorkFunctionUPP(ComponentMPWorkFunctionProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ComponentRoutineUPP +NewComponentRoutineUPP(ComponentRoutineProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern GetMissingComponentResourceUPP +NewGetMissingComponentResourceUPP(GetMissingComponentResourceProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeComponentMPWorkFunctionUPP(ComponentMPWorkFunctionUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeComponentRoutineUPP(ComponentRoutineUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeGetMissingComponentResourceUPP(GetMissingComponentResourceUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ComponentResult +InvokeComponentMPWorkFunctionUPP( + void * globalRefCon, + ComponentMPWorkFunctionHeaderRecordPtr header, + ComponentMPWorkFunctionUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ComponentResult +InvokeComponentRoutineUPP( + ComponentParameters * cp, + Handle componentStorage, + ComponentRoutineUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +InvokeGetMissingComponentResourceUPP( + Component c, + OSType resType, + SInt16 resID, + void * refCon, + Handle * resource, + GetMissingComponentResourceUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +enum { + uppComponentFunctionImplementedProcInfo = 0x000002F0, + uppGetComponentVersionProcInfo = 0x000000F0, + uppComponentSetTargetProcInfo = 0x000003F0, + uppCallComponentOpenProcInfo = 0x000003F0, + uppCallComponentCloseProcInfo = 0x000003F0, + uppCallComponentCanDoProcInfo = 0x000002F0, + uppCallComponentVersionProcInfo = 0x000000F0, + uppCallComponentRegisterProcInfo = 0x000000F0, + uppCallComponentTargetProcInfo = 0x000003F0, + uppCallComponentUnregisterProcInfo = 0x000000F0, + uppCallComponentGetMPWorkFunctionProcInfo = 0x00000FF0, + uppCallComponentGetPublicResourceProcInfo = 0x00003BF0 +}; + + + + + + + +enum { + MPLibrary_MajorVersion = 2, + MPLibrary_MinorVersion = 3, + MPLibrary_Release = 1, + MPLibrary_DevelopmentRevision = 1 +}; + + + +typedef struct OpaqueMPProcessID* MPProcessID; +typedef struct OpaqueMPTaskID* MPTaskID; +typedef struct OpaqueMPQueueID* MPQueueID; +typedef struct OpaqueMPSemaphoreID* MPSemaphoreID; +typedef struct OpaqueMPCriticalRegionID* MPCriticalRegionID; +typedef struct OpaqueMPTimerID* MPTimerID; +typedef struct OpaqueMPEventID* MPEventID; +typedef struct OpaqueMPAddressSpaceID* MPAddressSpaceID; +typedef struct OpaqueMPNotificationID* MPNotificationID; +typedef struct OpaqueMPCoherenceID* MPCoherenceID; +typedef struct OpaqueMPCpuID* MPCpuID; +typedef struct OpaqueMPAreaID* MPAreaID; +typedef struct OpaqueMPConsoleID* MPConsoleID; +typedef struct OpaqueMPOpaqueID* MPOpaqueID; +enum { + + kOpaqueAnyID = 0, + kOpaqueProcessID = 1, + kOpaqueTaskID = 2, + kOpaqueTimerID = 3, + kOpaqueQueueID = 4, + kOpaqueSemaphoreID = 5, + kOpaqueCriticalRegionID = 6, + kOpaqueCpuID = 7, + kOpaqueAddressSpaceID = 8, + kOpaqueEventID = 9, + kOpaqueCoherenceID = 10, + kOpaqueAreaID = 11, + kOpaqueNotificationID = 12, + kOpaqueConsoleID = 13 +}; + +typedef UInt32 MPOpaqueIDClass; + +enum { + kMPNoID = 0 +}; + + +typedef OptionBits MPTaskOptions; +typedef ItemCount TaskStorageIndex; +typedef LogicalAddress TaskStorageValue; +typedef ItemCount MPSemaphoreCount; +typedef UInt32 MPTaskWeight; +typedef UInt32 MPEventFlags; +typedef UInt32 MPExceptionKind; +typedef UInt32 MPTaskStateKind; +typedef UInt32 MPPageSizeClass; + +enum { + kDurationImmediate = 0, + kDurationForever = 0x7FFFFFFF, + kDurationMillisecond = 1, + kDurationMicrosecond = -1 +}; +extern ItemCount +MPProcessors(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern ItemCount +MPProcessorsScheduled(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +enum { + + kMPCreateTaskSuspendedMask = 1L << 0, + kMPCreateTaskTakesAllExceptionsMask = 1L << 1, + kMPCreateTaskNotDebuggableMask = 1L << 2, + kMPCreateTaskValidOptionsMask = kMPCreateTaskSuspendedMask | kMPCreateTaskTakesAllExceptionsMask | kMPCreateTaskNotDebuggableMask +}; + + + + + + + +typedef OSStatus ( * TaskProc)(void * parameter); +extern OSStatus +MPCreateTask( + TaskProc entryPoint, + void * parameter, + ByteCount stackSize, + MPQueueID notifyQueue, + void * terminationParameter1, + void * terminationParameter2, + MPTaskOptions options, + MPTaskID * task) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPTerminateTask( + MPTaskID task, + OSStatus terminationStatus) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPSetTaskWeight( + MPTaskID task, + MPTaskWeight weight) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern Boolean +MPTaskIsPreemptive(MPTaskID taskID) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern void +MPExit(OSStatus status) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern void +MPYield(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern MPTaskID +MPCurrentTaskID(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPSetTaskType( + MPTaskID task, + OSType taskType) __attribute__((availability(macosx,introduced=10.1,deprecated=10.8))); +extern OSStatus +MPAllocateTaskStorageIndex(TaskStorageIndex * taskIndex) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPDeallocateTaskStorageIndex(TaskStorageIndex taskIndex) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPSetTaskStorageValue( + TaskStorageIndex taskIndex, + TaskStorageValue value) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern TaskStorageValue +MPGetTaskStorageValue(TaskStorageIndex taskIndex) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPCreateQueue(MPQueueID * queue) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPDeleteQueue(MPQueueID queue) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPNotifyQueue( + MPQueueID queue, + void * param1, + void * param2, + void * param3) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPWaitOnQueue( + MPQueueID queue, + void ** param1, + void ** param2, + void ** param3, + Duration timeout) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPSetQueueReserve( + MPQueueID queue, + ItemCount count) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPCreateSemaphore( + MPSemaphoreCount maximumValue, + MPSemaphoreCount initialValue, + MPSemaphoreID * semaphore) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPDeleteSemaphore(MPSemaphoreID semaphore) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPSignalSemaphore(MPSemaphoreID semaphore) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPWaitOnSemaphore( + MPSemaphoreID semaphore, + Duration timeout) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPCreateCriticalRegion(MPCriticalRegionID * criticalRegion) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPDeleteCriticalRegion(MPCriticalRegionID criticalRegion) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPEnterCriticalRegion( + MPCriticalRegionID criticalRegion, + Duration timeout) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPExitCriticalRegion(MPCriticalRegionID criticalRegion) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPCreateEvent(MPEventID * event) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPDeleteEvent(MPEventID event) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPSetEvent( + MPEventID event, + MPEventFlags flags) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPWaitForEvent( + MPEventID event, + MPEventFlags * flags, + Duration timeout) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPCreateNotification(MPNotificationID * notificationID) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPDeleteNotification(MPNotificationID notificationID) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPModifyNotification( + MPNotificationID notificationID, + MPOpaqueID anID, + void * notifyParam1, + void * notifyParam2, + void * notifyParam3) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPModifyNotificationParameters( + MPNotificationID notificationID, + MPOpaqueIDClass kind, + void * notifyParam1, + void * notifyParam2, + void * notifyParam3) __attribute__((availability(macosx,introduced=10.1,deprecated=10.7))); +extern OSStatus +MPCauseNotification(MPNotificationID notificationID) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +enum { + + kMPPreserveTimerIDMask = 1L << 0, + kMPTimeIsDeltaMask = 1L << 1, + kMPTimeIsDurationMask = 1L << 2 +}; +extern OSStatus +MPDelayUntil(AbsoluteTime * expirationTime) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPCreateTimer(MPTimerID * timerID) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPDeleteTimer(MPTimerID timerID) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPSetTimerNotify( + MPTimerID timerID, + MPOpaqueID anID, + void * notifyParam1, + void * notifyParam2, + void * notifyParam3) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPArmTimer( + MPTimerID timerID, + AbsoluteTime * expirationTime, + OptionBits options) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPCancelTimer( + MPTimerID timerID, + AbsoluteTime * timeRemaining) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +enum { + + kMPMaxAllocSize = 1024L * 1024 * 1024 +}; + +enum { + + kMPAllocateDefaultAligned = 0, + kMPAllocate8ByteAligned = 3, + kMPAllocate16ByteAligned = 4, + kMPAllocate32ByteAligned = 5, + kMPAllocate1024ByteAligned = 10, + kMPAllocate4096ByteAligned = 12, + kMPAllocateMaxAlignment = 16, + kMPAllocateAltiVecAligned = kMPAllocate16ByteAligned, + kMPAllocateVMXAligned = kMPAllocateAltiVecAligned, + kMPAllocateVMPageAligned = 254, + kMPAllocateInterlockAligned = 255 +}; + + + +enum { + + kMPAllocateClearMask = 0x0001, + kMPAllocateGloballyMask = 0x0002, + kMPAllocateResidentMask = 0x0004, + kMPAllocateNoGrowthMask = 0x0010, + kMPAllocateNoCreateMask = 0x0020 +}; +extern LogicalAddress +MPAllocateAligned( + ByteCount size, + UInt8 alignment, + OptionBits options) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern LogicalAddress +MPAllocate(ByteCount size) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern void +MPFree(LogicalAddress object) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern ByteCount +MPGetAllocatedBlockSize(LogicalAddress object) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern void +MPBlockCopy( + LogicalAddress source, + LogicalAddress destination, + ByteCount size) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern void +MPBlockClear( + LogicalAddress address, + ByteCount size) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +enum { + + kMPTaskStateRegisters = 0, + kMPTaskStateFPU = 1, + kMPTaskStateVectors = 2, + kMPTaskStateMachine = 3, + kMPTaskState32BitMemoryException = 4, + kMPTaskStateTaskInfo = 5 +}; + + + +enum { + + kMPTaskPropagate = 0, + kMPTaskResumeStep = 1, + kMPTaskResumeBranch = 2, + kMPTaskResumeMask = 0x0000, + kMPTaskPropagateMask = 1 << kMPTaskPropagate, + kMPTaskResumeStepMask = 1 << kMPTaskResumeStep, + kMPTaskResumeBranchMask = 1 << kMPTaskResumeBranch +}; + + + +enum { + + kMPTaskBlocked = 0, + kMPTaskReady = 1, + kMPTaskRunning = 2 +}; + +enum { + + kMPTaskInfoVersion = 3 +}; + + +struct MPTaskInfoVersion2 { + PBVersion version; + + OSType name; + + OSType queueName; + UInt16 runState; + UInt16 lastCPU; + UInt32 weight; + + MPProcessID processID; + + AbsoluteTime cpuTime; + AbsoluteTime schedTime; + AbsoluteTime creationTime; + + ItemCount codePageFaults; + ItemCount dataPageFaults; + ItemCount preemptions; + + MPCpuID cpuID; +}; +typedef struct MPTaskInfoVersion2 MPTaskInfoVersion2; +struct MPTaskInfo { + PBVersion version; + + OSType name; + + OSType queueName; + UInt16 runState; + UInt16 lastCPU; + UInt32 weight; + + MPProcessID processID; + + AbsoluteTime cpuTime; + AbsoluteTime schedTime; + AbsoluteTime creationTime; + + ItemCount codePageFaults; + ItemCount dataPageFaults; + ItemCount preemptions; + + MPCpuID cpuID; + MPOpaqueID blockedObject; + MPAddressSpaceID spaceID; + + LogicalAddress stackBase; + LogicalAddress stackLimit; + LogicalAddress stackCurr; +}; +typedef struct MPTaskInfo MPTaskInfo; +extern OSStatus +MPSetExceptionHandler( + MPTaskID task, + MPQueueID exceptionQ) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPDisposeTaskException( + MPTaskID task, + OptionBits action) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPExtractTaskState( + MPTaskID task, + MPTaskStateKind kind, + void * info) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPSetTaskState( + MPTaskID task, + MPTaskStateKind kind, + void * info) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPThrowException( + MPTaskID task, + MPExceptionKind kind) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +typedef UInt32 MPDebuggerLevel; +enum { + kMPLowLevelDebugger = 0x00000000, + kMPMidLevelDebugger = 0x10000000, + kMPHighLevelDebugger = 0x20000000 +}; +extern OSStatus +MPRegisterDebugger( + MPQueueID queue, + MPDebuggerLevel level) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +MPUnregisterDebugger(MPQueueID queue) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +typedef void * ( * MPRemoteProcedure)(void * parameter); + +typedef UInt8 MPRemoteContext; +enum { + kMPAnyRemoteContext = 0, + kMPOwningProcessRemoteContext = 1, + kMPInterruptRemoteContext = 2, + kMPAsyncInterruptRemoteContext = 3 +}; +extern void * +MPRemoteCall( + MPRemoteProcedure remoteProc, + void * parameter, + MPRemoteContext context) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern void * +MPRemoteCallCFM( + MPRemoteProcedure remoteProc, + void * parameter, + MPRemoteContext context) __attribute__((availability(macosx,introduced=10.4,deprecated=10.7))); +extern Boolean +_MPIsFullyInitialized(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + +typedef Boolean ( * MPIsFullyInitializedProc)(void); +extern void +_MPLibraryVersion( + const char ** versionCString, + UInt32 * major, + UInt32 * minor, + UInt32 * release, + UInt32 * revision) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern Boolean +_MPLibraryIsCompatible( + const char * versionCString, + UInt32 major, + UInt32 minor, + UInt32 release, + UInt32 revision) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + +typedef UInt32 FSAliasInfoBitmap; +enum { + kFSAliasInfoNone = 0x00000000, + kFSAliasInfoVolumeCreateDate = 0x00000001, + kFSAliasInfoTargetCreateDate = 0x00000002, + kFSAliasInfoFinderInfo = 0x00000004, + kFSAliasInfoIsDirectory = 0x00000008, + kFSAliasInfoIDs = 0x00000010, + kFSAliasInfoFSInfo = 0x00000020, + kFSAliasInfoVolumeFlags = 0x00000040 +}; + +enum { + rAliasType = 'alis' +}; + +enum { + + kARMMountVol = 0x00000001, + kARMNoUI = 0x00000002, + kARMMultVols = 0x00000008, + kARMSearch = 0x00000100, + kARMSearchMore = 0x00000200, + kARMSearchRelFirst = 0x00000400, + kARMTryFileIDFirst = 0x00000800 +}; + +enum { + + asiZoneName = -3, + asiServerName = -2, + asiVolumeName = -1, + asiAliasName = 0, + asiParentName = 1 +}; + + +enum { + kResolveAliasFileNoUI = 0x00000001, + kResolveAliasTryFileIDFirst = 0x00000002 +}; +struct AliasRecord { + UInt8 hidden[6]; +}; +typedef struct AliasRecord AliasRecord; +typedef AliasRecord * AliasPtr; +typedef AliasPtr * AliasHandle; + +struct FSAliasInfo { + UTCDateTime volumeCreateDate; + UTCDateTime targetCreateDate; + OSType fileType; + OSType fileCreator; + UInt32 parentDirID; + UInt32 nodeID; + UInt16 filesystemID; + UInt16 signature; + Boolean volumeIsBootVolume; + Boolean volumeIsAutomounted; + Boolean volumeIsEjectable; + Boolean volumeHasPersistentFileIDs; + Boolean isDirectory; +}; +typedef struct FSAliasInfo FSAliasInfo; +typedef FSAliasInfo * FSAliasInfoPtr; + +typedef short AliasInfoType; +typedef Boolean ( * FSAliasFilterProcPtr)(const FSRef *ref, Boolean *quitFlag, Ptr myDataPtr); +extern OSErr +FSNewAlias( + const FSRef * fromFile, + const FSRef * target, + AliasHandle * inAlias) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +FSNewAliasMinimal( + const FSRef * target, + AliasHandle * inAlias) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +FSIsAliasFile( + const FSRef * fileRef, + Boolean * aliasFileFlag, + Boolean * folderFlag) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +FSResolveAliasWithMountFlags( + const FSRef * fromFile, + AliasHandle inAlias, + FSRef * target, + Boolean * wasChanged, + unsigned long mountFlags) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +FSResolveAlias( + const FSRef * fromFile, + AliasHandle alias, + FSRef * target, + Boolean * wasChanged) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +FSResolveAliasFileWithMountFlags( + FSRef * theRef, + Boolean resolveAliasChains, + Boolean * targetIsFolder, + Boolean * wasAliased, + unsigned long mountFlags) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +FSResolveAliasFile( + FSRef * theRef, + Boolean resolveAliasChains, + Boolean * targetIsFolder, + Boolean * wasAliased) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +FSFollowFinderAlias( + FSRef * fromFile, + AliasHandle alias, + Boolean logon, + FSRef * target, + Boolean * wasChanged) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +FSUpdateAlias( + const FSRef * fromFile, + const FSRef * target, + AliasHandle alias, + Boolean * wasChanged) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +FSNewAliasUnicode( + const FSRef * fromFile, + const FSRef * targetParentRef, + UniCharCount targetNameLength, + const UniChar * targetName, + AliasHandle * inAlias, + Boolean * isDirectory) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern OSErr +FSNewAliasMinimalUnicode( + const FSRef * targetParentRef, + UniCharCount targetNameLength, + const UniChar * targetName, + AliasHandle * inAlias, + Boolean * isDirectory) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern OSStatus +FSNewAliasFromPath( + const char * fromFilePath, + const char * targetPath, + OptionBits flags, + AliasHandle * inAlias, + Boolean * isDirectory) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSStatus +FSMatchAliasBulk( + const FSRef * fromFile, + unsigned long rulesMask, + AliasHandle inAlias, + short * aliasCount, + FSRef * aliasList, + Boolean * needsUpdate, + FSAliasFilterProcPtr aliasFilter, + void * yourDataPtr) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSStatus +FSCopyAliasInfo( + AliasHandle inAlias, + HFSUniStr255 * targetName, + HFSUniStr255 * volumeName, + CFStringRef * pathString, + FSAliasInfoBitmap * whichInfo, + FSAliasInfo * info) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern Size +GetAliasSize(AliasHandle alias) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSType +GetAliasUserType(AliasHandle alias) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern void +SetAliasUserType( + AliasHandle alias, + OSType userType) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern Size +GetAliasSizeFromPtr(const AliasRecord * alias) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSType +GetAliasUserTypeFromPtr(const AliasRecord * alias) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern void +SetAliasUserTypeWithPtr( + AliasPtr alias, + OSType userType) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); + + + + + + + + + + + +typedef struct OpaqueLocaleRef* LocaleRef; +typedef UInt32 LocalePartMask; +enum { + + kLocaleLanguageMask = 1L << 0, + kLocaleLanguageVariantMask = 1L << 1, + kLocaleScriptMask = 1L << 2, + kLocaleScriptVariantMask = 1L << 3, + kLocaleRegionMask = 1L << 4, + kLocaleRegionVariantMask = 1L << 5, + kLocaleAllPartsMask = 0x0000003F +}; + +typedef FourCharCode LocaleOperationClass; + +typedef FourCharCode LocaleOperationVariant; +struct LocaleAndVariant { + LocaleRef locale; + LocaleOperationVariant opVariant; +}; +typedef struct LocaleAndVariant LocaleAndVariant; + +typedef UInt32 LocaleNameMask; +enum { + + kLocaleNameMask = 1L << 0, + kLocaleOperationVariantNameMask = 1L << 1, + kLocaleAndVariantNameMask = 0x00000003 +}; +extern OSStatus +LocaleRefFromLangOrRegionCode( + LangCode lang, + RegionCode region, + LocaleRef * locale) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +LocaleRefFromLocaleString( + const char localeString[], + LocaleRef * locale) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +LocaleRefGetPartString( + LocaleRef locale, + LocalePartMask partMask, + ByteCount maxStringLen, + char partString[]) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +LocaleStringToLangAndRegionCodes( + const char localeString[], + LangCode * lang, + RegionCode * region) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +LocaleOperationCountLocales( + LocaleOperationClass opClass, + ItemCount * localeCount) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus +LocaleOperationGetLocales( + LocaleOperationClass opClass, + ItemCount maxLocaleCount, + ItemCount * actualLocaleCount, + LocaleAndVariant localeVariantList[]) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus +LocaleGetName( + LocaleRef locale, + LocaleOperationVariant opVariant, + LocaleNameMask nameMask, + LocaleRef displayLocale, + UniCharCount maxNameLen, + UniCharCount * actualNameLen, + UniChar displayName[]) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus +LocaleCountNames( + LocaleRef locale, + LocaleOperationVariant opVariant, + LocaleNameMask nameMask, + ItemCount * nameCount) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus +LocaleGetIndName( + LocaleRef locale, + LocaleOperationVariant opVariant, + LocaleNameMask nameMask, + ItemCount nameIndex, + UniCharCount maxNameLen, + UniCharCount * actualNameLen, + UniChar displayName[], + LocaleRef * displayLocale) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus +LocaleOperationGetName( + LocaleOperationClass opClass, + LocaleRef displayLocale, + UniCharCount maxNameLen, + UniCharCount * actualNameLen, + UniChar displayName[]) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +LocaleOperationCountNames( + LocaleOperationClass opClass, + ItemCount * nameCount) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +LocaleOperationGetIndName( + LocaleOperationClass opClass, + ItemCount nameIndex, + UniCharCount maxNameLen, + UniCharCount * actualNameLen, + UniChar displayName[], + LocaleRef * displayLocale) __attribute__((availability(macosx,introduced=10.0))); + + + + + + +enum { + kBlessedBusErrorBait = 0x68F168F1 +}; +extern void +DebugAssert( + OSType componentSignature, + UInt32 options, + const char * assertionString, + const char * exceptionLabelString, + const char * errorString, + const char * fileName, + long lineNumber, + void * value) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); + + + + + +enum { + k68kInterruptLevelMask = 0x00000007, + kInVBLTaskMask = 0x00000010, + kInDeferredTaskMask = 0x00000020, + kInSecondaryIntHandlerMask = 0x00000040, + kInNestedInterruptMask = 0x00000080 +}; +extern UInt32 +TaskLevel(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); + + + + + +enum { + kComponentDebugOption = 0 +}; + +enum { + kGetDebugOption = 1, + kSetDebugOption = 2 +}; +typedef void ( * DebugComponentCallbackProcPtr)(SInt32 optionSelectorNum, UInt32 command, Boolean *optionSetting); +typedef DebugComponentCallbackProcPtr DebugComponentCallbackUPP; +extern OSStatus +NewDebugComponent( + OSType componentSignature, + ConstStr255Param componentName, + DebugComponentCallbackUPP componentCallback) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus +NewDebugOption( + OSType componentSignature, + SInt32 optionSelectorNum, + ConstStr255Param optionName) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus +DisposeDebugComponent(OSType componentSignature) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus +GetDebugComponentInfo( + UInt32 itemIndex, + OSType * componentSignature, + Str255 componentName) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus +GetDebugOptionInfo( + UInt32 itemIndex, + OSType componentSignature, + SInt32 * optionSelectorNum, + Str255 optionName, + Boolean * optionSetting) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus +SetDebugOptionValue( + OSType componentSignature, + SInt32 optionSelectorNum, + Boolean newOptionSetting) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +typedef void ( * DebugAssertOutputHandlerProcPtr)(OSType componentSignature, UInt32 options, const char *assertionString, const char *exceptionLabelString, const char *errorString, const char *fileName, long lineNumber, void *value, ConstStr255Param outputMsg); +typedef DebugAssertOutputHandlerProcPtr DebugAssertOutputHandlerUPP; +extern void +InstallDebugAssertOutputHandler(DebugAssertOutputHandlerUPP handler) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern const char * +GetMacOSStatusErrorString(OSStatus err) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern const char * +GetMacOSStatusCommentString(OSStatus err) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern DebugComponentCallbackUPP +NewDebugComponentCallbackUPP(DebugComponentCallbackProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern DebugAssertOutputHandlerUPP +NewDebugAssertOutputHandlerUPP(DebugAssertOutputHandlerProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeDebugComponentCallbackUPP(DebugComponentCallbackUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeDebugAssertOutputHandlerUPP(DebugAssertOutputHandlerUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +InvokeDebugComponentCallbackUPP( + SInt32 optionSelectorNum, + UInt32 command, + Boolean * optionSetting, + DebugComponentCallbackUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +InvokeDebugAssertOutputHandlerUPP( + OSType componentSignature, + UInt32 options, + const char * assertionString, + const char * exceptionLabelString, + const char * errorString, + const char * fileName, + long lineNumber, + void * value, + ConstStr255Param outputMsg, + DebugAssertOutputHandlerUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); + + + +extern short +PLstrcmp( + ConstStr255Param str1, + ConstStr255Param str2) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern short +PLstrncmp( + ConstStr255Param str1, + ConstStr255Param str2, + short num) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern StringPtr +PLstrcpy( + StringPtr dest, + ConstStr255Param source) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern StringPtr +PLstrncpy( + StringPtr dest, + ConstStr255Param source, + short num) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern StringPtr +PLstrcat( + StringPtr str, + ConstStr255Param append) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern StringPtr +PLstrncat( + StringPtr str1, + ConstStr255Param append, + short num) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern Ptr +PLstrchr( + ConstStr255Param str1, + short ch1) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern Ptr +PLstrrchr( + ConstStr255Param str1, + short ch1) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern Ptr +PLstrpbrk( + ConstStr255Param str1, + ConstStr255Param charSet) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern short +PLstrspn( + ConstStr255Param str1, + ConstStr255Param charSet) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern Ptr +PLstrstr( + ConstStr255Param str1, + ConstStr255Param searchStr) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern short +PLstrlen(ConstStr255Param str) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern short +PLpos( + ConstStr255Param str1, + ConstStr255Param searchStr) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); + + + +extern Boolean +CompareAndSwap( + UInt32 oldValue, + UInt32 newValue, + UInt32 * address) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Boolean +TestAndClear( + UInt32 bit, + UInt8 * address) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Boolean +TestAndSet( + UInt32 bit, + UInt8 * address) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt8 +IncrementAtomic8(SInt8 * address) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt8 +DecrementAtomic8(SInt8 * address) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt8 +AddAtomic8( + SInt32 amount, + SInt8 * address) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern UInt8 +BitAndAtomic8( + UInt32 mask, + UInt8 * address) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern UInt8 +BitOrAtomic8( + UInt32 mask, + UInt8 * address) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern UInt8 +BitXorAtomic8( + UInt32 mask, + UInt8 * address) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt16 +IncrementAtomic16(SInt16 * address) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt16 +DecrementAtomic16(SInt16 * address) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt16 +AddAtomic16( + SInt32 amount, + SInt16 * address) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern UInt16 +BitAndAtomic16( + UInt32 mask, + UInt16 * address) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern UInt16 +BitOrAtomic16( + UInt32 mask, + UInt16 * address) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern UInt16 +BitXorAtomic16( + UInt32 mask, + UInt16 * address) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt32 +IncrementAtomic(SInt32 * address) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt32 +DecrementAtomic(SInt32 * address) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt32 +AddAtomic( + SInt32 amount, + SInt32 * address) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern UInt32 +BitAndAtomic( + UInt32 mask, + UInt32 * address) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern UInt32 +BitOrAtomic( + UInt32 mask, + UInt32 * address) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern UInt32 +BitXorAtomic( + UInt32 mask, + UInt32 * address) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); + + + +typedef long long __m64 __attribute__((__vector_size__(8))); + +typedef int __v2si __attribute__((__vector_size__(8))); +typedef short __v4hi __attribute__((__vector_size__(8))); +typedef char __v8qi __attribute__((__vector_size__(8))); + + + + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_empty(void) +{ + __builtin_ia32_emms(); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_cvtsi32_si64(int __i) +{ + return (__m64)__builtin_ia32_vec_init_v2si(__i, 0); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_cvtsi64_si32(__m64 __m) +{ + return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_cvtsi64_m64(long long __i) +{ + return (__m64)__i; +} + +static __inline__ long long __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_cvtm64_si64(__m64 __m) +{ + return (long long)__m; +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_packs_pi16(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_packs_pi32(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_packssdw((__v2si)__m1, (__v2si)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_packs_pu16(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_packuswb((__v4hi)__m1, (__v4hi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_unpackhi_pi8(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_punpckhbw((__v8qi)__m1, (__v8qi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_unpackhi_pi16(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_punpckhwd((__v4hi)__m1, (__v4hi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_unpackhi_pi32(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_punpckhdq((__v2si)__m1, (__v2si)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_unpacklo_pi8(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_punpcklbw((__v8qi)__m1, (__v8qi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_unpacklo_pi16(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_punpcklwd((__v4hi)__m1, (__v4hi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_unpacklo_pi32(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_punpckldq((__v2si)__m1, (__v2si)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_add_pi8(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_add_pi16(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_paddw((__v4hi)__m1, (__v4hi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_add_pi32(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_paddd((__v2si)__m1, (__v2si)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_adds_pi8(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_paddsb((__v8qi)__m1, (__v8qi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_adds_pi16(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_paddsw((__v4hi)__m1, (__v4hi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_adds_pu8(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_paddusb((__v8qi)__m1, (__v8qi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_adds_pu16(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_paddusw((__v4hi)__m1, (__v4hi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_sub_pi8(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_psubb((__v8qi)__m1, (__v8qi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_sub_pi16(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_psubw((__v4hi)__m1, (__v4hi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_sub_pi32(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_psubd((__v2si)__m1, (__v2si)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_subs_pi8(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_psubsb((__v8qi)__m1, (__v8qi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_subs_pi16(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_psubsw((__v4hi)__m1, (__v4hi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_subs_pu8(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_psubusb((__v8qi)__m1, (__v8qi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_subs_pu16(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_psubusw((__v4hi)__m1, (__v4hi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_madd_pi16(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_pmaddwd((__v4hi)__m1, (__v4hi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_mulhi_pi16(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_pmulhw((__v4hi)__m1, (__v4hi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_mullo_pi16(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_pmullw((__v4hi)__m1, (__v4hi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_sll_pi16(__m64 __m, __m64 __count) +{ + return (__m64)__builtin_ia32_psllw((__v4hi)__m, __count); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_slli_pi16(__m64 __m, int __count) +{ + return (__m64)__builtin_ia32_psllwi((__v4hi)__m, __count); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_sll_pi32(__m64 __m, __m64 __count) +{ + return (__m64)__builtin_ia32_pslld((__v2si)__m, __count); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_slli_pi32(__m64 __m, int __count) +{ + return (__m64)__builtin_ia32_pslldi((__v2si)__m, __count); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_sll_si64(__m64 __m, __m64 __count) +{ + return (__m64)__builtin_ia32_psllq(__m, __count); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_slli_si64(__m64 __m, int __count) +{ + return (__m64)__builtin_ia32_psllqi(__m, __count); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_sra_pi16(__m64 __m, __m64 __count) +{ + return (__m64)__builtin_ia32_psraw((__v4hi)__m, __count); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_srai_pi16(__m64 __m, int __count) +{ + return (__m64)__builtin_ia32_psrawi((__v4hi)__m, __count); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_sra_pi32(__m64 __m, __m64 __count) +{ + return (__m64)__builtin_ia32_psrad((__v2si)__m, __count); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_srai_pi32(__m64 __m, int __count) +{ + return (__m64)__builtin_ia32_psradi((__v2si)__m, __count); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_srl_pi16(__m64 __m, __m64 __count) +{ + return (__m64)__builtin_ia32_psrlw((__v4hi)__m, __count); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_srli_pi16(__m64 __m, int __count) +{ + return (__m64)__builtin_ia32_psrlwi((__v4hi)__m, __count); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_srl_pi32(__m64 __m, __m64 __count) +{ + return (__m64)__builtin_ia32_psrld((__v2si)__m, __count); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_srli_pi32(__m64 __m, int __count) +{ + return (__m64)__builtin_ia32_psrldi((__v2si)__m, __count); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_srl_si64(__m64 __m, __m64 __count) +{ + return (__m64)__builtin_ia32_psrlq(__m, __count); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_srli_si64(__m64 __m, int __count) +{ + return (__m64)__builtin_ia32_psrlqi(__m, __count); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_and_si64(__m64 __m1, __m64 __m2) +{ + return __builtin_ia32_pand(__m1, __m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_andnot_si64(__m64 __m1, __m64 __m2) +{ + return __builtin_ia32_pandn(__m1, __m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_or_si64(__m64 __m1, __m64 __m2) +{ + return __builtin_ia32_por(__m1, __m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_xor_si64(__m64 __m1, __m64 __m2) +{ + return __builtin_ia32_pxor(__m1, __m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_cmpeq_pi8(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_pcmpeqb((__v8qi)__m1, (__v8qi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_cmpeq_pi16(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_pcmpeqw((__v4hi)__m1, (__v4hi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_cmpeq_pi32(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_pcmpeqd((__v2si)__m1, (__v2si)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_cmpgt_pi8(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_pcmpgtb((__v8qi)__m1, (__v8qi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_cmpgt_pi16(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_pcmpgtw((__v4hi)__m1, (__v4hi)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_cmpgt_pi32(__m64 __m1, __m64 __m2) +{ + return (__m64)__builtin_ia32_pcmpgtd((__v2si)__m1, (__v2si)__m2); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_setzero_si64(void) +{ + return (__m64){ 0LL }; +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_set_pi32(int __i1, int __i0) +{ + return (__m64)__builtin_ia32_vec_init_v2si(__i0, __i1); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_set_pi16(short __s3, short __s2, short __s1, short __s0) +{ + return (__m64)__builtin_ia32_vec_init_v4hi(__s0, __s1, __s2, __s3); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_set_pi8(char __b7, char __b6, char __b5, char __b4, char __b3, char __b2, + char __b1, char __b0) +{ + return (__m64)__builtin_ia32_vec_init_v8qi(__b0, __b1, __b2, __b3, + __b4, __b5, __b6, __b7); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_set1_pi32(int __i) +{ + return _mm_set_pi32(__i, __i); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_set1_pi16(short __w) +{ + return _mm_set_pi16(__w, __w, __w, __w); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_set1_pi8(char __b) +{ + return _mm_set_pi8(__b, __b, __b, __b, __b, __b, __b, __b); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_setr_pi32(int __i0, int __i1) +{ + return _mm_set_pi32(__i1, __i0); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_setr_pi16(short __w0, short __w1, short __w2, short __w3) +{ + return _mm_set_pi16(__w3, __w2, __w1, __w0); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) +_mm_setr_pi8(char __b0, char __b1, char __b2, char __b3, char __b4, char __b5, + char __b6, char __b7) +{ + return _mm_set_pi8(__b7, __b6, __b5, __b4, __b3, __b2, __b1, __b0); +} + +typedef int __v4si __attribute__((__vector_size__(16))); +typedef float __v4sf __attribute__((__vector_size__(16))); +typedef float __m128 __attribute__((__vector_size__(16))); + + + + + +extern int posix_memalign(void **__memptr, size_t __alignment, size_t __size); +static __inline__ void *__attribute__((__always_inline__, __nodebug__, + __malloc__)) +_mm_malloc(size_t __size, size_t __align) +{ + if (__align == 1) { + return malloc(__size); + } + + if (!(__align & (__align - 1)) && __align < sizeof(void *)) + __align = sizeof(void *); + + void *__mallocedMemory; + + + + + + if (posix_memalign(&__mallocedMemory, __align, __size)) + return 0; + + + return __mallocedMemory; +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__)) +_mm_free(void *__p) +{ + free(__p); +} + + + + + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_add_ss(__m128 __a, __m128 __b) +{ + __a[0] += __b[0]; + return __a; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_add_ps(__m128 __a, __m128 __b) +{ + return __a + __b; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_sub_ss(__m128 __a, __m128 __b) +{ + __a[0] -= __b[0]; + return __a; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_sub_ps(__m128 __a, __m128 __b) +{ + return __a - __b; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_mul_ss(__m128 __a, __m128 __b) +{ + __a[0] *= __b[0]; + return __a; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_mul_ps(__m128 __a, __m128 __b) +{ + return __a * __b; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_div_ss(__m128 __a, __m128 __b) +{ + __a[0] /= __b[0]; + return __a; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_div_ps(__m128 __a, __m128 __b) +{ + return __a / __b; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_sqrt_ss(__m128 __a) +{ + __m128 __c = __builtin_ia32_sqrtss(__a); + return (__m128) { __c[0], __a[1], __a[2], __a[3] }; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_sqrt_ps(__m128 __a) +{ + return __builtin_ia32_sqrtps(__a); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_rcp_ss(__m128 __a) +{ + __m128 __c = __builtin_ia32_rcpss(__a); + return (__m128) { __c[0], __a[1], __a[2], __a[3] }; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_rcp_ps(__m128 __a) +{ + return __builtin_ia32_rcpps(__a); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_rsqrt_ss(__m128 __a) +{ + __m128 __c = __builtin_ia32_rsqrtss(__a); + return (__m128) { __c[0], __a[1], __a[2], __a[3] }; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_rsqrt_ps(__m128 __a) +{ + return __builtin_ia32_rsqrtps(__a); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_min_ss(__m128 __a, __m128 __b) +{ + return __builtin_ia32_minss(__a, __b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_min_ps(__m128 __a, __m128 __b) +{ + return __builtin_ia32_minps(__a, __b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_max_ss(__m128 __a, __m128 __b) +{ + return __builtin_ia32_maxss(__a, __b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_max_ps(__m128 __a, __m128 __b) +{ + return __builtin_ia32_maxps(__a, __b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_and_ps(__m128 __a, __m128 __b) +{ + return (__m128)((__v4si)__a & (__v4si)__b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_andnot_ps(__m128 __a, __m128 __b) +{ + return (__m128)(~(__v4si)__a & (__v4si)__b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_or_ps(__m128 __a, __m128 __b) +{ + return (__m128)((__v4si)__a | (__v4si)__b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_xor_ps(__m128 __a, __m128 __b) +{ + return (__m128)((__v4si)__a ^ (__v4si)__b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmpeq_ss(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_ia32_cmpeqss(__a, __b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmpeq_ps(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_ia32_cmpeqps(__a, __b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmplt_ss(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_ia32_cmpltss(__a, __b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmplt_ps(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_ia32_cmpltps(__a, __b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmple_ss(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_ia32_cmpless(__a, __b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmple_ps(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_ia32_cmpleps(__a, __b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmpgt_ss(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_shufflevector(__a, + __builtin_ia32_cmpltss(__b, __a), + 4, 1, 2, 3); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmpgt_ps(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_ia32_cmpltps(__b, __a); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmpge_ss(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_shufflevector(__a, + __builtin_ia32_cmpless(__b, __a), + 4, 1, 2, 3); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmpge_ps(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_ia32_cmpleps(__b, __a); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmpneq_ss(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_ia32_cmpneqss(__a, __b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmpneq_ps(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_ia32_cmpneqps(__a, __b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmpnlt_ss(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_ia32_cmpnltss(__a, __b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmpnlt_ps(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_ia32_cmpnltps(__a, __b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmpnle_ss(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_ia32_cmpnless(__a, __b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmpnle_ps(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_ia32_cmpnleps(__a, __b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmpngt_ss(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_shufflevector(__a, + __builtin_ia32_cmpnltss(__b, __a), + 4, 1, 2, 3); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmpngt_ps(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_ia32_cmpnltps(__b, __a); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmpnge_ss(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_shufflevector(__a, + __builtin_ia32_cmpnless(__b, __a), + 4, 1, 2, 3); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmpnge_ps(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_ia32_cmpnleps(__b, __a); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmpord_ss(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_ia32_cmpordss(__a, __b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmpord_ps(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_ia32_cmpordps(__a, __b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmpunord_ss(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_ia32_cmpunordss(__a, __b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cmpunord_ps(__m128 __a, __m128 __b) +{ + return (__m128)__builtin_ia32_cmpunordps(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_comieq_ss(__m128 __a, __m128 __b) +{ + return __builtin_ia32_comieq(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_comilt_ss(__m128 __a, __m128 __b) +{ + return __builtin_ia32_comilt(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_comile_ss(__m128 __a, __m128 __b) +{ + return __builtin_ia32_comile(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_comigt_ss(__m128 __a, __m128 __b) +{ + return __builtin_ia32_comigt(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_comige_ss(__m128 __a, __m128 __b) +{ + return __builtin_ia32_comige(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_comineq_ss(__m128 __a, __m128 __b) +{ + return __builtin_ia32_comineq(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_ucomieq_ss(__m128 __a, __m128 __b) +{ + return __builtin_ia32_ucomieq(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_ucomilt_ss(__m128 __a, __m128 __b) +{ + return __builtin_ia32_ucomilt(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_ucomile_ss(__m128 __a, __m128 __b) +{ + return __builtin_ia32_ucomile(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_ucomigt_ss(__m128 __a, __m128 __b) +{ + return __builtin_ia32_ucomigt(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_ucomige_ss(__m128 __a, __m128 __b) +{ + return __builtin_ia32_ucomige(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_ucomineq_ss(__m128 __a, __m128 __b) +{ + return __builtin_ia32_ucomineq(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvtss_si32(__m128 __a) +{ + return __builtin_ia32_cvtss2si(__a); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvt_ss2si(__m128 __a) +{ + return _mm_cvtss_si32(__a); +} + + + +static __inline__ long long __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvtss_si64(__m128 __a) +{ + return __builtin_ia32_cvtss2si64(__a); +} + + + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvtps_pi32(__m128 __a) +{ + return (__m64)__builtin_ia32_cvtps2pi(__a); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvt_ps2pi(__m128 __a) +{ + return _mm_cvtps_pi32(__a); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvttss_si32(__m128 __a) +{ + return __a[0]; +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvtt_ss2si(__m128 __a) +{ + return _mm_cvttss_si32(__a); +} + +static __inline__ long long __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvttss_si64(__m128 __a) +{ + return __a[0]; +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvttps_pi32(__m128 __a) +{ + return (__m64)__builtin_ia32_cvttps2pi(__a); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvtt_ps2pi(__m128 __a) +{ + return _mm_cvttps_pi32(__a); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvtsi32_ss(__m128 __a, int __b) +{ + __a[0] = __b; + return __a; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvt_si2ss(__m128 __a, int __b) +{ + return _mm_cvtsi32_ss(__a, __b); +} + + + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvtsi64_ss(__m128 __a, long long __b) +{ + __a[0] = __b; + return __a; +} + + + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvtpi32_ps(__m128 __a, __m64 __b) +{ + return __builtin_ia32_cvtpi2ps(__a, (__v2si)__b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvt_pi2ps(__m128 __a, __m64 __b) +{ + return _mm_cvtpi32_ps(__a, __b); +} + +static __inline__ float __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvtss_f32(__m128 __a) +{ + return __a[0]; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_loadh_pi(__m128 __a, const __m64 *__p) +{ + typedef float __mm_loadh_pi_v2f32 __attribute__((__vector_size__(8))); + struct __mm_loadh_pi_struct { + __mm_loadh_pi_v2f32 __u; + } __attribute__((__packed__, __may_alias__)); + __mm_loadh_pi_v2f32 __b = ((struct __mm_loadh_pi_struct*)__p)->__u; + __m128 __bb = __builtin_shufflevector(__b, __b, 0, 1, 0, 1); + return __builtin_shufflevector(__a, __bb, 0, 1, 4, 5); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_loadl_pi(__m128 __a, const __m64 *__p) +{ + typedef float __mm_loadl_pi_v2f32 __attribute__((__vector_size__(8))); + struct __mm_loadl_pi_struct { + __mm_loadl_pi_v2f32 __u; + } __attribute__((__packed__, __may_alias__)); + __mm_loadl_pi_v2f32 __b = ((struct __mm_loadl_pi_struct*)__p)->__u; + __m128 __bb = __builtin_shufflevector(__b, __b, 0, 1, 0, 1); + return __builtin_shufflevector(__a, __bb, 4, 5, 2, 3); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_load_ss(const float *__p) +{ + struct __mm_load_ss_struct { + float __u; + } __attribute__((__packed__, __may_alias__)); + float __u = ((struct __mm_load_ss_struct*)__p)->__u; + return (__m128){ __u, 0, 0, 0 }; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_load1_ps(const float *__p) +{ + struct __mm_load1_ps_struct { + float __u; + } __attribute__((__packed__, __may_alias__)); + float __u = ((struct __mm_load1_ps_struct*)__p)->__u; + return (__m128){ __u, __u, __u, __u }; +} + + + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_load_ps(const float *__p) +{ + return *(__m128*)__p; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_loadu_ps(const float *__p) +{ + struct __loadu_ps { + __m128 __v; + } __attribute__((__packed__, __may_alias__)); + return ((struct __loadu_ps*)__p)->__v; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_loadr_ps(const float *__p) +{ + __m128 __a = _mm_load_ps(__p); + return __builtin_shufflevector(__a, __a, 3, 2, 1, 0); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_undefined_ps() +{ + return (__m128)__builtin_ia32_undef128(); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_set_ss(float __w) +{ + return (__m128){ __w, 0, 0, 0 }; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_set1_ps(float __w) +{ + return (__m128){ __w, __w, __w, __w }; +} + + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_set_ps1(float __w) +{ + return _mm_set1_ps(__w); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_set_ps(float __z, float __y, float __x, float __w) +{ + return (__m128){ __w, __x, __y, __z }; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_setr_ps(float __z, float __y, float __x, float __w) +{ + return (__m128){ __z, __y, __x, __w }; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_setzero_ps(void) +{ + return (__m128){ 0, 0, 0, 0 }; +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_storeh_pi(__m64 *__p, __m128 __a) +{ + __builtin_ia32_storehps((__v2si *)__p, __a); +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_storel_pi(__m64 *__p, __m128 __a) +{ + __builtin_ia32_storelps((__v2si *)__p, __a); +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_store_ss(float *__p, __m128 __a) +{ + struct __mm_store_ss_struct { + float __u; + } __attribute__((__packed__, __may_alias__)); + ((struct __mm_store_ss_struct*)__p)->__u = __a[0]; +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_storeu_ps(float *__p, __m128 __a) +{ + __builtin_ia32_storeups(__p, __a); +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_store1_ps(float *__p, __m128 __a) +{ + __a = __builtin_shufflevector(__a, __a, 0, 0, 0, 0); + _mm_storeu_ps(__p, __a); +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_store_ps1(float *__p, __m128 __a) +{ + return _mm_store1_ps(__p, __a); +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_store_ps(float *__p, __m128 __a) +{ + *(__m128 *)__p = __a; +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_storer_ps(float *__p, __m128 __a) +{ + __a = __builtin_shufflevector(__a, __a, 3, 2, 1, 0); + _mm_store_ps(__p, __a); +} +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_stream_pi(__m64 *__p, __m64 __a) +{ + __builtin_ia32_movntq(__p, __a); +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_stream_ps(float *__p, __m128 __a) +{ + __builtin_ia32_movntps(__p, __a); +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_sfence(void) +{ + __builtin_ia32_sfence(); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_extract_pi16(__m64 __a, int __n) +{ + __v4hi __b = (__v4hi)__a; + return (unsigned short)__b[__n & 3]; +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_insert_pi16(__m64 __a, int __d, int __n) +{ + __v4hi __b = (__v4hi)__a; + __b[__n & 3] = __d; + return (__m64)__b; +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_max_pi16(__m64 __a, __m64 __b) +{ + return (__m64)__builtin_ia32_pmaxsw((__v4hi)__a, (__v4hi)__b); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_max_pu8(__m64 __a, __m64 __b) +{ + return (__m64)__builtin_ia32_pmaxub((__v8qi)__a, (__v8qi)__b); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_min_pi16(__m64 __a, __m64 __b) +{ + return (__m64)__builtin_ia32_pminsw((__v4hi)__a, (__v4hi)__b); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_min_pu8(__m64 __a, __m64 __b) +{ + return (__m64)__builtin_ia32_pminub((__v8qi)__a, (__v8qi)__b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_movemask_pi8(__m64 __a) +{ + return __builtin_ia32_pmovmskb((__v8qi)__a); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_mulhi_pu16(__m64 __a, __m64 __b) +{ + return (__m64)__builtin_ia32_pmulhuw((__v4hi)__a, (__v4hi)__b); +} + + + + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_maskmove_si64(__m64 __d, __m64 __n, char *__p) +{ + __builtin_ia32_maskmovq((__v8qi)__d, (__v8qi)__n, __p); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_avg_pu8(__m64 __a, __m64 __b) +{ + return (__m64)__builtin_ia32_pavgb((__v8qi)__a, (__v8qi)__b); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_avg_pu16(__m64 __a, __m64 __b) +{ + return (__m64)__builtin_ia32_pavgw((__v4hi)__a, (__v4hi)__b); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_sad_pu8(__m64 __a, __m64 __b) +{ + return (__m64)__builtin_ia32_psadbw((__v8qi)__a, (__v8qi)__b); +} + +static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_getcsr(void) +{ + return __builtin_ia32_stmxcsr(); +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_setcsr(unsigned int __i) +{ + __builtin_ia32_ldmxcsr(__i); +} + + + + + + + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_unpackhi_ps(__m128 __a, __m128 __b) +{ + return __builtin_shufflevector(__a, __b, 2, 6, 3, 7); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_unpacklo_ps(__m128 __a, __m128 __b) +{ + return __builtin_shufflevector(__a, __b, 0, 4, 1, 5); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_move_ss(__m128 __a, __m128 __b) +{ + return __builtin_shufflevector(__a, __b, 4, 1, 2, 3); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_movehl_ps(__m128 __a, __m128 __b) +{ + return __builtin_shufflevector(__a, __b, 6, 7, 2, 3); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_movelh_ps(__m128 __a, __m128 __b) +{ + return __builtin_shufflevector(__a, __b, 0, 1, 4, 5); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvtpi16_ps(__m64 __a) +{ + __m64 __b, __c; + __m128 __r; + + __b = _mm_setzero_si64(); + __b = _mm_cmpgt_pi16(__b, __a); + __c = _mm_unpackhi_pi16(__a, __b); + __r = _mm_setzero_ps(); + __r = _mm_cvtpi32_ps(__r, __c); + __r = _mm_movelh_ps(__r, __r); + __c = _mm_unpacklo_pi16(__a, __b); + __r = _mm_cvtpi32_ps(__r, __c); + + return __r; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvtpu16_ps(__m64 __a) +{ + __m64 __b, __c; + __m128 __r; + + __b = _mm_setzero_si64(); + __c = _mm_unpackhi_pi16(__a, __b); + __r = _mm_setzero_ps(); + __r = _mm_cvtpi32_ps(__r, __c); + __r = _mm_movelh_ps(__r, __r); + __c = _mm_unpacklo_pi16(__a, __b); + __r = _mm_cvtpi32_ps(__r, __c); + + return __r; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvtpi8_ps(__m64 __a) +{ + __m64 __b; + + __b = _mm_setzero_si64(); + __b = _mm_cmpgt_pi8(__b, __a); + __b = _mm_unpacklo_pi8(__a, __b); + + return _mm_cvtpi16_ps(__b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvtpu8_ps(__m64 __a) +{ + __m64 __b; + + __b = _mm_setzero_si64(); + __b = _mm_unpacklo_pi8(__a, __b); + + return _mm_cvtpi16_ps(__b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvtpi32x2_ps(__m64 __a, __m64 __b) +{ + __m128 __c; + + __c = _mm_setzero_ps(); + __c = _mm_cvtpi32_ps(__c, __b); + __c = _mm_movelh_ps(__c, __c); + + return _mm_cvtpi32_ps(__c, __a); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvtps_pi16(__m128 __a) +{ + __m64 __b, __c; + + __b = _mm_cvtps_pi32(__a); + __a = _mm_movehl_ps(__a, __a); + __c = _mm_cvtps_pi32(__a); + + return _mm_packs_pi32(__b, __c); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_cvtps_pi8(__m128 __a) +{ + __m64 __b, __c; + + __b = _mm_cvtps_pi16(__a); + __c = _mm_setzero_si64(); + + return _mm_packs_pi16(__b, __c); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse"))) +_mm_movemask_ps(__m128 __a) +{ + return __builtin_ia32_movmskps(__a); +} + +typedef double __m128d __attribute__((__vector_size__(16))); +typedef long long __m128i __attribute__((__vector_size__(16))); + + +typedef double __v2df __attribute__ ((__vector_size__ (16))); +typedef long long __v2di __attribute__ ((__vector_size__ (16))); +typedef short __v8hi __attribute__((__vector_size__(16))); +typedef char __v16qi __attribute__((__vector_size__(16))); + + + +typedef signed char __v16qs __attribute__((__vector_size__(16))); + + +static __inline __m128 __attribute__((__always_inline__, __nodebug__, __target__("f16c"))) +_mm_cvtph_ps(__m128i __a) +{ + return (__m128)__builtin_ia32_vcvtph2ps((__v8hi)__a); +} + + + + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_add_sd(__m128d __a, __m128d __b) +{ + __a[0] += __b[0]; + return __a; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_add_pd(__m128d __a, __m128d __b) +{ + return __a + __b; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_sub_sd(__m128d __a, __m128d __b) +{ + __a[0] -= __b[0]; + return __a; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_sub_pd(__m128d __a, __m128d __b) +{ + return __a - __b; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_mul_sd(__m128d __a, __m128d __b) +{ + __a[0] *= __b[0]; + return __a; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_mul_pd(__m128d __a, __m128d __b) +{ + return __a * __b; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_div_sd(__m128d __a, __m128d __b) +{ + __a[0] /= __b[0]; + return __a; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_div_pd(__m128d __a, __m128d __b) +{ + return __a / __b; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_sqrt_sd(__m128d __a, __m128d __b) +{ + __m128d __c = __builtin_ia32_sqrtsd(__b); + return (__m128d) { __c[0], __a[1] }; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_sqrt_pd(__m128d __a) +{ + return __builtin_ia32_sqrtpd(__a); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_min_sd(__m128d __a, __m128d __b) +{ + return __builtin_ia32_minsd(__a, __b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_min_pd(__m128d __a, __m128d __b) +{ + return __builtin_ia32_minpd(__a, __b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_max_sd(__m128d __a, __m128d __b) +{ + return __builtin_ia32_maxsd(__a, __b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_max_pd(__m128d __a, __m128d __b) +{ + return __builtin_ia32_maxpd(__a, __b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_and_pd(__m128d __a, __m128d __b) +{ + return (__m128d)((__v4si)__a & (__v4si)__b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_andnot_pd(__m128d __a, __m128d __b) +{ + return (__m128d)(~(__v4si)__a & (__v4si)__b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_or_pd(__m128d __a, __m128d __b) +{ + return (__m128d)((__v4si)__a | (__v4si)__b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_xor_pd(__m128d __a, __m128d __b) +{ + return (__m128d)((__v4si)__a ^ (__v4si)__b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpeq_pd(__m128d __a, __m128d __b) +{ + return (__m128d)__builtin_ia32_cmpeqpd(__a, __b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmplt_pd(__m128d __a, __m128d __b) +{ + return (__m128d)__builtin_ia32_cmpltpd(__a, __b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmple_pd(__m128d __a, __m128d __b) +{ + return (__m128d)__builtin_ia32_cmplepd(__a, __b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpgt_pd(__m128d __a, __m128d __b) +{ + return (__m128d)__builtin_ia32_cmpltpd(__b, __a); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpge_pd(__m128d __a, __m128d __b) +{ + return (__m128d)__builtin_ia32_cmplepd(__b, __a); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpord_pd(__m128d __a, __m128d __b) +{ + return (__m128d)__builtin_ia32_cmpordpd(__a, __b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpunord_pd(__m128d __a, __m128d __b) +{ + return (__m128d)__builtin_ia32_cmpunordpd(__a, __b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpneq_pd(__m128d __a, __m128d __b) +{ + return (__m128d)__builtin_ia32_cmpneqpd(__a, __b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpnlt_pd(__m128d __a, __m128d __b) +{ + return (__m128d)__builtin_ia32_cmpnltpd(__a, __b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpnle_pd(__m128d __a, __m128d __b) +{ + return (__m128d)__builtin_ia32_cmpnlepd(__a, __b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpngt_pd(__m128d __a, __m128d __b) +{ + return (__m128d)__builtin_ia32_cmpnltpd(__b, __a); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpnge_pd(__m128d __a, __m128d __b) +{ + return (__m128d)__builtin_ia32_cmpnlepd(__b, __a); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpeq_sd(__m128d __a, __m128d __b) +{ + return (__m128d)__builtin_ia32_cmpeqsd(__a, __b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmplt_sd(__m128d __a, __m128d __b) +{ + return (__m128d)__builtin_ia32_cmpltsd(__a, __b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmple_sd(__m128d __a, __m128d __b) +{ + return (__m128d)__builtin_ia32_cmplesd(__a, __b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpgt_sd(__m128d __a, __m128d __b) +{ + __m128d __c = __builtin_ia32_cmpltsd(__b, __a); + return (__m128d) { __c[0], __a[1] }; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpge_sd(__m128d __a, __m128d __b) +{ + __m128d __c = __builtin_ia32_cmplesd(__b, __a); + return (__m128d) { __c[0], __a[1] }; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpord_sd(__m128d __a, __m128d __b) +{ + return (__m128d)__builtin_ia32_cmpordsd(__a, __b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpunord_sd(__m128d __a, __m128d __b) +{ + return (__m128d)__builtin_ia32_cmpunordsd(__a, __b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpneq_sd(__m128d __a, __m128d __b) +{ + return (__m128d)__builtin_ia32_cmpneqsd(__a, __b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpnlt_sd(__m128d __a, __m128d __b) +{ + return (__m128d)__builtin_ia32_cmpnltsd(__a, __b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpnle_sd(__m128d __a, __m128d __b) +{ + return (__m128d)__builtin_ia32_cmpnlesd(__a, __b); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpngt_sd(__m128d __a, __m128d __b) +{ + __m128d __c = __builtin_ia32_cmpnltsd(__b, __a); + return (__m128d) { __c[0], __a[1] }; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpnge_sd(__m128d __a, __m128d __b) +{ + __m128d __c = __builtin_ia32_cmpnlesd(__b, __a); + return (__m128d) { __c[0], __a[1] }; +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_comieq_sd(__m128d __a, __m128d __b) +{ + return __builtin_ia32_comisdeq(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_comilt_sd(__m128d __a, __m128d __b) +{ + return __builtin_ia32_comisdlt(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_comile_sd(__m128d __a, __m128d __b) +{ + return __builtin_ia32_comisdle(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_comigt_sd(__m128d __a, __m128d __b) +{ + return __builtin_ia32_comisdgt(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_comige_sd(__m128d __a, __m128d __b) +{ + return __builtin_ia32_comisdge(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_comineq_sd(__m128d __a, __m128d __b) +{ + return __builtin_ia32_comisdneq(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_ucomieq_sd(__m128d __a, __m128d __b) +{ + return __builtin_ia32_ucomisdeq(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_ucomilt_sd(__m128d __a, __m128d __b) +{ + return __builtin_ia32_ucomisdlt(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_ucomile_sd(__m128d __a, __m128d __b) +{ + return __builtin_ia32_ucomisdle(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_ucomigt_sd(__m128d __a, __m128d __b) +{ + return __builtin_ia32_ucomisdgt(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_ucomige_sd(__m128d __a, __m128d __b) +{ + return __builtin_ia32_ucomisdge(__a, __b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_ucomineq_sd(__m128d __a, __m128d __b) +{ + return __builtin_ia32_ucomisdneq(__a, __b); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvtpd_ps(__m128d __a) +{ + return __builtin_ia32_cvtpd2ps(__a); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvtps_pd(__m128 __a) +{ + return __builtin_ia32_cvtps2pd(__a); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvtepi32_pd(__m128i __a) +{ + return __builtin_ia32_cvtdq2pd((__v4si)__a); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvtpd_epi32(__m128d __a) +{ + return __builtin_ia32_cvtpd2dq(__a); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvtsd_si32(__m128d __a) +{ + return __builtin_ia32_cvtsd2si(__a); +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvtsd_ss(__m128 __a, __m128d __b) +{ + __a[0] = __b[0]; + return __a; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvtsi32_sd(__m128d __a, int __b) +{ + __a[0] = __b; + return __a; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvtss_sd(__m128d __a, __m128 __b) +{ + __a[0] = __b[0]; + return __a; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvttpd_epi32(__m128d __a) +{ + return (__m128i)__builtin_ia32_cvttpd2dq(__a); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvttsd_si32(__m128d __a) +{ + return __a[0]; +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvtpd_pi32(__m128d __a) +{ + return (__m64)__builtin_ia32_cvtpd2pi(__a); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvttpd_pi32(__m128d __a) +{ + return (__m64)__builtin_ia32_cvttpd2pi(__a); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvtpi32_pd(__m64 __a) +{ + return __builtin_ia32_cvtpi2pd((__v2si)__a); +} + +static __inline__ double __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvtsd_f64(__m128d __a) +{ + return __a[0]; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_load_pd(double const *__dp) +{ + return *(__m128d*)__dp; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_load1_pd(double const *__dp) +{ + struct __mm_load1_pd_struct { + double __u; + } __attribute__((__packed__, __may_alias__)); + double __u = ((struct __mm_load1_pd_struct*)__dp)->__u; + return (__m128d){ __u, __u }; +} + + + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_loadr_pd(double const *__dp) +{ + __m128d __u = *(__m128d*)__dp; + return __builtin_shufflevector(__u, __u, 1, 0); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_loadu_pd(double const *__dp) +{ + struct __loadu_pd { + __m128d __v; + } __attribute__((__packed__, __may_alias__)); + return ((struct __loadu_pd*)__dp)->__v; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_load_sd(double const *__dp) +{ + struct __mm_load_sd_struct { + double __u; + } __attribute__((__packed__, __may_alias__)); + double __u = ((struct __mm_load_sd_struct*)__dp)->__u; + return (__m128d){ __u, 0 }; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_loadh_pd(__m128d __a, double const *__dp) +{ + struct __mm_loadh_pd_struct { + double __u; + } __attribute__((__packed__, __may_alias__)); + double __u = ((struct __mm_loadh_pd_struct*)__dp)->__u; + return (__m128d){ __a[0], __u }; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_loadl_pd(__m128d __a, double const *__dp) +{ + struct __mm_loadl_pd_struct { + double __u; + } __attribute__((__packed__, __may_alias__)); + double __u = ((struct __mm_loadl_pd_struct*)__dp)->__u; + return (__m128d){ __u, __a[1] }; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_undefined_pd() +{ + return (__m128d)__builtin_ia32_undef128(); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_set_sd(double __w) +{ + return (__m128d){ __w, 0 }; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_set1_pd(double __w) +{ + return (__m128d){ __w, __w }; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_set_pd(double __w, double __x) +{ + return (__m128d){ __x, __w }; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_setr_pd(double __w, double __x) +{ + return (__m128d){ __w, __x }; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_setzero_pd(void) +{ + return (__m128d){ 0, 0 }; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_move_sd(__m128d __a, __m128d __b) +{ + return (__m128d){ __b[0], __a[1] }; +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_store_sd(double *__dp, __m128d __a) +{ + struct __mm_store_sd_struct { + double __u; + } __attribute__((__packed__, __may_alias__)); + ((struct __mm_store_sd_struct*)__dp)->__u = __a[0]; +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_store1_pd(double *__dp, __m128d __a) +{ + struct __mm_store1_pd_struct { + double __u[2]; + } __attribute__((__packed__, __may_alias__)); + ((struct __mm_store1_pd_struct*)__dp)->__u[0] = __a[0]; + ((struct __mm_store1_pd_struct*)__dp)->__u[1] = __a[0]; +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_store_pd(double *__dp, __m128d __a) +{ + *(__m128d *)__dp = __a; +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_storeu_pd(double *__dp, __m128d __a) +{ + __builtin_ia32_storeupd(__dp, __a); +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_storer_pd(double *__dp, __m128d __a) +{ + __a = __builtin_shufflevector(__a, __a, 1, 0); + *(__m128d *)__dp = __a; +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_storeh_pd(double *__dp, __m128d __a) +{ + struct __mm_storeh_pd_struct { + double __u; + } __attribute__((__packed__, __may_alias__)); + ((struct __mm_storeh_pd_struct*)__dp)->__u = __a[1]; +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_storel_pd(double *__dp, __m128d __a) +{ + struct __mm_storeh_pd_struct { + double __u; + } __attribute__((__packed__, __may_alias__)); + ((struct __mm_storeh_pd_struct*)__dp)->__u = __a[0]; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_add_epi8(__m128i __a, __m128i __b) +{ + return (__m128i)((__v16qi)__a + (__v16qi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_add_epi16(__m128i __a, __m128i __b) +{ + return (__m128i)((__v8hi)__a + (__v8hi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_add_epi32(__m128i __a, __m128i __b) +{ + return (__m128i)((__v4si)__a + (__v4si)__b); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_add_si64(__m64 __a, __m64 __b) +{ + return (__m64)__builtin_ia32_paddq(__a, __b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_add_epi64(__m128i __a, __m128i __b) +{ + return __a + __b; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_adds_epi8(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_ia32_paddsb128((__v16qi)__a, (__v16qi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_adds_epi16(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_ia32_paddsw128((__v8hi)__a, (__v8hi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_adds_epu8(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_ia32_paddusb128((__v16qi)__a, (__v16qi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_adds_epu16(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_ia32_paddusw128((__v8hi)__a, (__v8hi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_avg_epu8(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_ia32_pavgb128((__v16qi)__a, (__v16qi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_avg_epu16(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_ia32_pavgw128((__v8hi)__a, (__v8hi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_madd_epi16(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_ia32_pmaddwd128((__v8hi)__a, (__v8hi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_max_epi16(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_ia32_pmaxsw128((__v8hi)__a, (__v8hi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_max_epu8(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_ia32_pmaxub128((__v16qi)__a, (__v16qi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_min_epi16(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_ia32_pminsw128((__v8hi)__a, (__v8hi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_min_epu8(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_ia32_pminub128((__v16qi)__a, (__v16qi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_mulhi_epi16(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_ia32_pmulhw128((__v8hi)__a, (__v8hi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_mulhi_epu16(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_ia32_pmulhuw128((__v8hi)__a, (__v8hi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_mullo_epi16(__m128i __a, __m128i __b) +{ + return (__m128i)((__v8hi)__a * (__v8hi)__b); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_mul_su32(__m64 __a, __m64 __b) +{ + return __builtin_ia32_pmuludq((__v2si)__a, (__v2si)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_mul_epu32(__m128i __a, __m128i __b) +{ + return __builtin_ia32_pmuludq128((__v4si)__a, (__v4si)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_sad_epu8(__m128i __a, __m128i __b) +{ + return __builtin_ia32_psadbw128((__v16qi)__a, (__v16qi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_sub_epi8(__m128i __a, __m128i __b) +{ + return (__m128i)((__v16qi)__a - (__v16qi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_sub_epi16(__m128i __a, __m128i __b) +{ + return (__m128i)((__v8hi)__a - (__v8hi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_sub_epi32(__m128i __a, __m128i __b) +{ + return (__m128i)((__v4si)__a - (__v4si)__b); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_sub_si64(__m64 __a, __m64 __b) +{ + return (__m64)__builtin_ia32_psubq(__a, __b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_sub_epi64(__m128i __a, __m128i __b) +{ + return __a - __b; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_subs_epi8(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_ia32_psubsb128((__v16qi)__a, (__v16qi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_subs_epi16(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_ia32_psubsw128((__v8hi)__a, (__v8hi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_subs_epu8(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_ia32_psubusb128((__v16qi)__a, (__v16qi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_subs_epu16(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_ia32_psubusw128((__v8hi)__a, (__v8hi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_and_si128(__m128i __a, __m128i __b) +{ + return __a & __b; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_andnot_si128(__m128i __a, __m128i __b) +{ + return ~__a & __b; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_or_si128(__m128i __a, __m128i __b) +{ + return __a | __b; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_xor_si128(__m128i __a, __m128i __b) +{ + return __a ^ __b; +} +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_slli_epi16(__m128i __a, int __count) +{ + return (__m128i)__builtin_ia32_psllwi128((__v8hi)__a, __count); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_sll_epi16(__m128i __a, __m128i __count) +{ + return (__m128i)__builtin_ia32_psllw128((__v8hi)__a, (__v8hi)__count); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_slli_epi32(__m128i __a, int __count) +{ + return (__m128i)__builtin_ia32_pslldi128((__v4si)__a, __count); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_sll_epi32(__m128i __a, __m128i __count) +{ + return (__m128i)__builtin_ia32_pslld128((__v4si)__a, (__v4si)__count); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_slli_epi64(__m128i __a, int __count) +{ + return __builtin_ia32_psllqi128(__a, __count); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_sll_epi64(__m128i __a, __m128i __count) +{ + return __builtin_ia32_psllq128(__a, __count); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_srai_epi16(__m128i __a, int __count) +{ + return (__m128i)__builtin_ia32_psrawi128((__v8hi)__a, __count); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_sra_epi16(__m128i __a, __m128i __count) +{ + return (__m128i)__builtin_ia32_psraw128((__v8hi)__a, (__v8hi)__count); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_srai_epi32(__m128i __a, int __count) +{ + return (__m128i)__builtin_ia32_psradi128((__v4si)__a, __count); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_sra_epi32(__m128i __a, __m128i __count) +{ + return (__m128i)__builtin_ia32_psrad128((__v4si)__a, (__v4si)__count); +} +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_srli_epi16(__m128i __a, int __count) +{ + return (__m128i)__builtin_ia32_psrlwi128((__v8hi)__a, __count); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_srl_epi16(__m128i __a, __m128i __count) +{ + return (__m128i)__builtin_ia32_psrlw128((__v8hi)__a, (__v8hi)__count); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_srli_epi32(__m128i __a, int __count) +{ + return (__m128i)__builtin_ia32_psrldi128((__v4si)__a, __count); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_srl_epi32(__m128i __a, __m128i __count) +{ + return (__m128i)__builtin_ia32_psrld128((__v4si)__a, (__v4si)__count); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_srli_epi64(__m128i __a, int __count) +{ + return __builtin_ia32_psrlqi128(__a, __count); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_srl_epi64(__m128i __a, __m128i __count) +{ + return __builtin_ia32_psrlq128(__a, __count); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpeq_epi8(__m128i __a, __m128i __b) +{ + return (__m128i)((__v16qi)__a == (__v16qi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpeq_epi16(__m128i __a, __m128i __b) +{ + return (__m128i)((__v8hi)__a == (__v8hi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpeq_epi32(__m128i __a, __m128i __b) +{ + return (__m128i)((__v4si)__a == (__v4si)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpgt_epi8(__m128i __a, __m128i __b) +{ + + + return (__m128i)((__v16qs)__a > (__v16qs)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpgt_epi16(__m128i __a, __m128i __b) +{ + return (__m128i)((__v8hi)__a > (__v8hi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmpgt_epi32(__m128i __a, __m128i __b) +{ + return (__m128i)((__v4si)__a > (__v4si)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmplt_epi8(__m128i __a, __m128i __b) +{ + return _mm_cmpgt_epi8(__b, __a); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmplt_epi16(__m128i __a, __m128i __b) +{ + return _mm_cmpgt_epi16(__b, __a); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cmplt_epi32(__m128i __a, __m128i __b) +{ + return _mm_cmpgt_epi32(__b, __a); +} + + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvtsi64_sd(__m128d __a, long long __b) +{ + __a[0] = __b; + return __a; +} + +static __inline__ long long __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvtsd_si64(__m128d __a) +{ + return __builtin_ia32_cvtsd2si64(__a); +} + +static __inline__ long long __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvttsd_si64(__m128d __a) +{ + return __a[0]; +} + + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvtepi32_ps(__m128i __a) +{ + return __builtin_ia32_cvtdq2ps((__v4si)__a); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvtps_epi32(__m128 __a) +{ + return (__m128i)__builtin_ia32_cvtps2dq(__a); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvttps_epi32(__m128 __a) +{ + return (__m128i)__builtin_ia32_cvttps2dq(__a); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvtsi32_si128(int __a) +{ + return (__m128i)(__v4si){ __a, 0, 0, 0 }; +} + + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvtsi64_si128(long long __a) +{ + return (__m128i){ __a, 0 }; +} + + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvtsi128_si32(__m128i __a) +{ + __v4si __b = (__v4si)__a; + return __b[0]; +} + + +static __inline__ long long __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_cvtsi128_si64(__m128i __a) +{ + return __a[0]; +} + + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_load_si128(__m128i const *__p) +{ + return *__p; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_loadu_si128(__m128i const *__p) +{ + struct __loadu_si128 { + __m128i __v; + } __attribute__((__packed__, __may_alias__)); + return ((struct __loadu_si128*)__p)->__v; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_loadl_epi64(__m128i const *__p) +{ + struct __mm_loadl_epi64_struct { + long long __u; + } __attribute__((__packed__, __may_alias__)); + return (__m128i) { ((struct __mm_loadl_epi64_struct*)__p)->__u, 0}; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_undefined_si128() +{ + return (__m128i)__builtin_ia32_undef128(); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_set_epi64x(long long __q1, long long __q0) +{ + return (__m128i){ __q0, __q1 }; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_set_epi64(__m64 __q1, __m64 __q0) +{ + return (__m128i){ (long long)__q0, (long long)__q1 }; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_set_epi32(int __i3, int __i2, int __i1, int __i0) +{ + return (__m128i)(__v4si){ __i0, __i1, __i2, __i3}; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_set_epi16(short __w7, short __w6, short __w5, short __w4, short __w3, short __w2, short __w1, short __w0) +{ + return (__m128i)(__v8hi){ __w0, __w1, __w2, __w3, __w4, __w5, __w6, __w7 }; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_set_epi8(char __b15, char __b14, char __b13, char __b12, char __b11, char __b10, char __b9, char __b8, char __b7, char __b6, char __b5, char __b4, char __b3, char __b2, char __b1, char __b0) +{ + return (__m128i)(__v16qi){ __b0, __b1, __b2, __b3, __b4, __b5, __b6, __b7, __b8, __b9, __b10, __b11, __b12, __b13, __b14, __b15 }; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_set1_epi64x(long long __q) +{ + return (__m128i){ __q, __q }; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_set1_epi64(__m64 __q) +{ + return (__m128i){ (long long)__q, (long long)__q }; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_set1_epi32(int __i) +{ + return (__m128i)(__v4si){ __i, __i, __i, __i }; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_set1_epi16(short __w) +{ + return (__m128i)(__v8hi){ __w, __w, __w, __w, __w, __w, __w, __w }; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_set1_epi8(char __b) +{ + return (__m128i)(__v16qi){ __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b }; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_setr_epi64(__m64 __q0, __m64 __q1) +{ + return (__m128i){ (long long)__q0, (long long)__q1 }; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_setr_epi32(int __i0, int __i1, int __i2, int __i3) +{ + return (__m128i)(__v4si){ __i0, __i1, __i2, __i3}; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_setr_epi16(short __w0, short __w1, short __w2, short __w3, short __w4, short __w5, short __w6, short __w7) +{ + return (__m128i)(__v8hi){ __w0, __w1, __w2, __w3, __w4, __w5, __w6, __w7 }; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_setr_epi8(char __b0, char __b1, char __b2, char __b3, char __b4, char __b5, char __b6, char __b7, char __b8, char __b9, char __b10, char __b11, char __b12, char __b13, char __b14, char __b15) +{ + return (__m128i)(__v16qi){ __b0, __b1, __b2, __b3, __b4, __b5, __b6, __b7, __b8, __b9, __b10, __b11, __b12, __b13, __b14, __b15 }; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_setzero_si128(void) +{ + return (__m128i){ 0LL, 0LL }; +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_store_si128(__m128i *__p, __m128i __b) +{ + *__p = __b; +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_storeu_si128(__m128i *__p, __m128i __b) +{ + __builtin_ia32_storedqu((char *)__p, (__v16qi)__b); +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_maskmoveu_si128(__m128i __d, __m128i __n, char *__p) +{ + __builtin_ia32_maskmovdqu((__v16qi)__d, (__v16qi)__n, __p); +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_storel_epi64(__m128i *__p, __m128i __a) +{ + struct __mm_storel_epi64_struct { + long long __u; + } __attribute__((__packed__, __may_alias__)); + ((struct __mm_storel_epi64_struct*)__p)->__u = __a[0]; +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_stream_pd(double *__p, __m128d __a) +{ + __builtin_ia32_movntpd(__p, __a); +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_stream_si128(__m128i *__p, __m128i __a) +{ + __builtin_ia32_movntdq(__p, __a); +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_stream_si32(int *__p, int __a) +{ + __builtin_ia32_movnti(__p, __a); +} + + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_stream_si64(long long *__p, long long __a) +{ + __builtin_ia32_movnti64(__p, __a); +} + + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_clflush(void const *__p) +{ + __builtin_ia32_clflush(__p); +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_lfence(void) +{ + __builtin_ia32_lfence(); +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_mfence(void) +{ + __builtin_ia32_mfence(); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_packs_epi16(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_ia32_packsswb128((__v8hi)__a, (__v8hi)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_packs_epi32(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_ia32_packssdw128((__v4si)__a, (__v4si)__b); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_packus_epi16(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_ia32_packuswb128((__v8hi)__a, (__v8hi)__b); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_extract_epi16(__m128i __a, int __imm) +{ + __v8hi __b = (__v8hi)__a; + return (unsigned short)__b[__imm & 7]; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_insert_epi16(__m128i __a, int __b, int __imm) +{ + __v8hi __c = (__v8hi)__a; + __c[__imm & 7] = __b; + return (__m128i)__c; +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_movemask_epi8(__m128i __a) +{ + return __builtin_ia32_pmovmskb128((__v16qi)__a); +} +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_unpackhi_epi8(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_shufflevector((__v16qi)__a, (__v16qi)__b, 8, 16+8, 9, 16+9, 10, 16+10, 11, 16+11, 12, 16+12, 13, 16+13, 14, 16+14, 15, 16+15); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_unpackhi_epi16(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_shufflevector((__v8hi)__a, (__v8hi)__b, 4, 8+4, 5, 8+5, 6, 8+6, 7, 8+7); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_unpackhi_epi32(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_shufflevector((__v4si)__a, (__v4si)__b, 2, 4+2, 3, 4+3); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_unpackhi_epi64(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_shufflevector(__a, __b, 1, 2+1); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_unpacklo_epi8(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_shufflevector((__v16qi)__a, (__v16qi)__b, 0, 16+0, 1, 16+1, 2, 16+2, 3, 16+3, 4, 16+4, 5, 16+5, 6, 16+6, 7, 16+7); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_unpacklo_epi16(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_shufflevector((__v8hi)__a, (__v8hi)__b, 0, 8+0, 1, 8+1, 2, 8+2, 3, 8+3); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_unpacklo_epi32(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_shufflevector((__v4si)__a, (__v4si)__b, 0, 4+0, 1, 4+1); +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_unpacklo_epi64(__m128i __a, __m128i __b) +{ + return (__m128i)__builtin_shufflevector(__a, __b, 0, 2+0); +} + +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_movepi64_pi64(__m128i __a) +{ + return (__m64)__a[0]; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_movpi64_epi64(__m64 __a) +{ + return (__m128i){ (long long)__a, 0 }; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_move_epi64(__m128i __a) +{ + return __builtin_shufflevector(__a, (__m128i){ 0 }, 0, 2); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_unpackhi_pd(__m128d __a, __m128d __b) +{ + return __builtin_shufflevector(__a, __b, 1, 2+1); +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_unpacklo_pd(__m128d __a, __m128d __b) +{ + return __builtin_shufflevector(__a, __b, 0, 2+0); +} + +static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_movemask_pd(__m128d __a) +{ + return __builtin_ia32_movmskpd(__a); +} + + + + + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_castpd_ps(__m128d __a) +{ + return (__m128)__a; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_castpd_si128(__m128d __a) +{ + return (__m128i)__a; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_castps_pd(__m128 __a) +{ + return (__m128d)__a; +} + +static __inline__ __m128i __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_castps_si128(__m128 __a) +{ + return (__m128i)__a; +} + +static __inline__ __m128 __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_castsi128_ps(__m128i __a) +{ + return (__m128)__a; +} + +static __inline__ __m128d __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_castsi128_pd(__m128i __a) +{ + return (__m128d)__a; +} + +static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) +_mm_pause(void) +{ + __builtin_ia32_pause(); +} + + +typedef struct OpaqueAreaID* AreaID; +struct MachineInformationPowerPC { + UnsignedWide CTR; + UnsignedWide LR; + UnsignedWide PC; + unsigned long CRRegister; + unsigned long XER; + unsigned long MSR; + unsigned long MQ; + unsigned long ExceptKind; + unsigned long DSISR; + UnsignedWide DAR; + UnsignedWide Reserved; +}; +typedef struct MachineInformationPowerPC MachineInformationPowerPC; +struct RegisterInformationPowerPC { + UnsignedWide R0; + UnsignedWide R1; + UnsignedWide R2; + UnsignedWide R3; + UnsignedWide R4; + UnsignedWide R5; + UnsignedWide R6; + UnsignedWide R7; + UnsignedWide R8; + UnsignedWide R9; + UnsignedWide R10; + UnsignedWide R11; + UnsignedWide R12; + UnsignedWide R13; + UnsignedWide R14; + UnsignedWide R15; + UnsignedWide R16; + UnsignedWide R17; + UnsignedWide R18; + UnsignedWide R19; + UnsignedWide R20; + UnsignedWide R21; + UnsignedWide R22; + UnsignedWide R23; + UnsignedWide R24; + UnsignedWide R25; + UnsignedWide R26; + UnsignedWide R27; + UnsignedWide R28; + UnsignedWide R29; + UnsignedWide R30; + UnsignedWide R31; +}; +typedef struct RegisterInformationPowerPC RegisterInformationPowerPC; +struct FPUInformationPowerPC { + UnsignedWide Registers[32]; + unsigned long FPSCR; + unsigned long Reserved; +}; +typedef struct FPUInformationPowerPC FPUInformationPowerPC; +union Vector128 { + + + + unsigned long l[4]; + unsigned short s[8]; + unsigned char c[16]; +}; +typedef union Vector128 Vector128; +struct VectorInformationPowerPC { + Vector128 Registers[32]; + Vector128 VSCR; + UInt32 VRsave; +}; +typedef struct VectorInformationPowerPC VectorInformationPowerPC; + +enum { + kWriteReference = 0, + kReadReference = 1, + kFetchReference = 2, + writeReference = kWriteReference, + readReference = kReadReference, + fetchReference = kFetchReference +}; + + +typedef unsigned long MemoryReferenceKind; +struct MemoryExceptionInformation { + AreaID theArea; + LogicalAddress theAddress; + OSStatus theError; + MemoryReferenceKind theReference; +}; +typedef struct MemoryExceptionInformation MemoryExceptionInformation; +enum { + kUnknownException = 0, + kIllegalInstructionException = 1, + kTrapException = 2, + kAccessException = 3, + kUnmappedMemoryException = 4, + kExcludedMemoryException = 5, + kReadOnlyMemoryException = 6, + kUnresolvablePageFaultException = 7, + kPrivilegeViolationException = 8, + kTraceException = 9, + kInstructionBreakpointException = 10, + kDataBreakpointException = 11, + kIntegerException = 12, + kFloatingPointException = 13, + kStackOverflowException = 14, + kTaskTerminationException = 15, + kTaskCreationException = 16, + kDataAlignmentException = 17 +}; +typedef unsigned long ExceptionKind; +union ExceptionInfo { + MemoryExceptionInformation * memoryInfo; +}; +typedef union ExceptionInfo ExceptionInfo; +struct ExceptionInformationPowerPC { + ExceptionKind theKind; + MachineInformationPowerPC * machineState; + RegisterInformationPowerPC * registerImage; + FPUInformationPowerPC * FPUImage; + ExceptionInfo info; + VectorInformationPowerPC * vectorImage; +}; +typedef struct ExceptionInformationPowerPC ExceptionInformationPowerPC; +union Vector128Intel { + __m128 s; + __m128i si; + __m128d sd; + unsigned char c[16]; +}; +typedef union Vector128Intel Vector128Intel; +struct MachineInformationIntel64 { + unsigned long CS; + unsigned long FS; + unsigned long GS; + unsigned long RFLAGS; + unsigned long RIP; + unsigned long ExceptTrap; + unsigned long ExceptErr; + unsigned long ExceptAddr; +}; +typedef struct MachineInformationIntel64 MachineInformationIntel64; +struct RegisterInformationIntel64 { + unsigned long RAX; + unsigned long RBX; + unsigned long RCX; + unsigned long RDX; + unsigned long RDI; + unsigned long RSI; + unsigned long RBP; + unsigned long RSP; + unsigned long R8; + unsigned long R9; + unsigned long R10; + unsigned long R11; + unsigned long R12; + unsigned long R13; + unsigned long R14; + unsigned long R15; +}; +typedef struct RegisterInformationIntel64 RegisterInformationIntel64; + +typedef unsigned char FPRegIntel[10]; +struct FPUInformationIntel64 { + FPRegIntel Registers[8]; + unsigned short Control; + unsigned short Status; + unsigned short Tag; + unsigned short Opcode; + unsigned int IP; + unsigned int DP; + unsigned int DS; +}; +typedef struct FPUInformationIntel64 FPUInformationIntel64; +struct VectorInformationIntel64 { + Vector128Intel Registers[16]; +}; +typedef struct VectorInformationIntel64 VectorInformationIntel64; + +typedef MachineInformationIntel64 MachineInformation; +typedef RegisterInformationIntel64 RegisterInformation; +typedef FPUInformationIntel64 FPUInformation; +typedef VectorInformationIntel64 VectorInformation; + + + +struct ExceptionInformation { + ExceptionKind theKind; + MachineInformation * machineState; + RegisterInformation * registerImage; + FPUInformation * FPUImage; + ExceptionInfo info; + VectorInformation * vectorImage; +}; +typedef struct ExceptionInformation ExceptionInformation; +typedef OSStatus ( * ExceptionHandlerProcPtr)(ExceptionInformation * theException); +typedef ExceptionHandlerProcPtr ExceptionHandlerUPP; +extern ExceptionHandlerUPP +NewExceptionHandlerUPP(ExceptionHandlerProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeExceptionHandlerUPP(ExceptionHandlerUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus +InvokeExceptionHandlerUPP( + ExceptionInformation * theException, + ExceptionHandlerUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +typedef ExceptionHandlerUPP ExceptionHandlerTPP; +typedef ExceptionHandlerTPP ExceptionHandler; +extern ExceptionHandlerTPP InstallExceptionHandler(ExceptionHandlerTPP theHandler) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); + + + + + + +enum { + durationMicrosecond = -1L, + durationMillisecond = 1, + durationSecond = 1000, + durationMinute = 60000, + durationHour = 3600000, + durationDay = 86400000, + durationNoWait = 0, + durationForever = 0x7FFFFFFF +}; + + +typedef UnsignedWide Nanoseconds; +extern AbsoluteTime +UpTime(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Nanoseconds +AbsoluteToNanoseconds(AbsoluteTime absoluteTime) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Duration +AbsoluteToDuration(AbsoluteTime absoluteTime) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern AbsoluteTime +NanosecondsToAbsolute(Nanoseconds nanoseconds) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern AbsoluteTime +DurationToAbsolute(Duration duration) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern AbsoluteTime +AddAbsoluteToAbsolute( + AbsoluteTime absoluteTime1, + AbsoluteTime absoluteTime2) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern AbsoluteTime +SubAbsoluteFromAbsolute( + AbsoluteTime leftAbsoluteTime, + AbsoluteTime rightAbsoluteTime) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern AbsoluteTime +AddNanosecondsToAbsolute( + Nanoseconds nanoseconds, + AbsoluteTime absoluteTime) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern AbsoluteTime +AddDurationToAbsolute( + Duration duration, + AbsoluteTime absoluteTime) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern AbsoluteTime +SubNanosecondsFromAbsolute( + Nanoseconds nanoseconds, + AbsoluteTime absoluteTime) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern AbsoluteTime +SubDurationFromAbsolute( + Duration duration, + AbsoluteTime absoluteTime) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Nanoseconds +AbsoluteDeltaToNanoseconds( + AbsoluteTime leftAbsoluteTime, + AbsoluteTime rightAbsoluteTime) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Duration +AbsoluteDeltaToDuration( + AbsoluteTime leftAbsoluteTime, + AbsoluteTime rightAbsoluteTime) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Nanoseconds +DurationToNanoseconds(Duration theDuration) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Duration +NanosecondsToDuration(Nanoseconds theNanoseconds) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); + + + + + + + + + + + + +struct NumFormatString { + UInt8 fLength; + UInt8 fVersion; + char data[254]; +}; +typedef struct NumFormatString NumFormatString; +typedef NumFormatString NumFormatStringRec; +typedef short FormatStatus; +enum { + fVNumber = 0 +}; + +typedef SInt8 FormatClass; +enum { + fPositive = 0, + fNegative = 1, + fZero = 2 +}; + +typedef SInt8 FormatResultType; +enum { + fFormatOK = 0, + fBestGuess = 1, + fOutOfSynch = 2, + fSpuriousChars = 3, + fMissingDelimiter = 4, + fExtraDecimal = 5, + fMissingLiteral = 6, + fExtraExp = 7, + fFormatOverflow = 8, + fFormStrIsNAN = 9, + fBadPartsTable = 10, + fExtraPercent = 11, + fExtraSeparator = 12, + fEmptyFormatString = 13 +}; + +struct FVector { + short start; + short length; +}; +typedef struct FVector FVector; + +typedef FVector TripleInt[3]; +extern void +numtostring( + long theNum, + char * theString) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); + + + + + + + +enum { + + systemCurLang = -2, + systemDefLang = -3, + currentCurLang = -4, + currentDefLang = -5, + scriptCurLang = -6, + scriptDefLang = -7 +}; + + +enum { + iuSystemCurLang = systemCurLang, + iuSystemDefLang = systemDefLang, + iuCurrentCurLang = currentCurLang, + iuCurrentDefLang = currentDefLang, + iuScriptCurLang = scriptCurLang, + iuScriptDefLang = scriptDefLang +}; + + + +extern long +Munger( + Handle h, + long offset, + const void * ptr1, + long len1, + const void * ptr2, + long len2) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + +extern Boolean +BitTst( + const void * bytePtr, + long bitNum) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +BitSet( + void * bytePtr, + long bitNum) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +BitClr( + void * bytePtr, + long bitNum) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern long +BitAnd( + long value1, + long value2) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern long +BitOr( + long value1, + long value2) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern long +BitXor( + long value1, + long value2) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern long +BitNot(long value) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern long +BitShift( + long value, + short count) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); + + + + + + + + + +typedef UInt16 UCKeyOutput; +typedef UInt16 UCKeyCharSeq; +enum { + kUCKeyOutputStateIndexMask = 0x4000, + kUCKeyOutputSequenceIndexMask = 0x8000, + kUCKeyOutputTestForIndexMask = 0xC000, + kUCKeyOutputGetIndexMask = 0x3FFF +}; +struct UCKeyStateRecord { + UCKeyCharSeq stateZeroCharData; + UInt16 stateZeroNextState; + UInt16 stateEntryCount; + UInt16 stateEntryFormat; + + + UInt32 stateEntryData[1]; +}; +typedef struct UCKeyStateRecord UCKeyStateRecord; + + + + +enum { + kUCKeyStateEntryTerminalFormat = 0x0001, + kUCKeyStateEntryRangeFormat = 0x0002 +}; + + + + + + +struct UCKeyStateEntryTerminal { + UInt16 curState; + UCKeyCharSeq charData; +}; +typedef struct UCKeyStateEntryTerminal UCKeyStateEntryTerminal; + + + + + + + +struct UCKeyStateEntryRange { + UInt16 curStateStart; + UInt8 curStateRange; + UInt8 deltaMultiplier; + UCKeyCharSeq charData; + UInt16 nextState; +}; +typedef struct UCKeyStateEntryRange UCKeyStateEntryRange; +struct UCKeyboardTypeHeader { + UInt32 keyboardTypeFirst; + UInt32 keyboardTypeLast; + UInt32 keyModifiersToTableNumOffset; + UInt32 keyToCharTableIndexOffset; + UInt32 keyStateRecordsIndexOffset; + UInt32 keyStateTerminatorsOffset; + UInt32 keySequenceDataIndexOffset; +}; +typedef struct UCKeyboardTypeHeader UCKeyboardTypeHeader; +struct UCKeyboardLayout { + + UInt16 keyLayoutHeaderFormat; + UInt16 keyLayoutDataVersion; + UInt32 keyLayoutFeatureInfoOffset; + UInt32 keyboardTypeCount; + UCKeyboardTypeHeader keyboardTypeList[1]; +}; +typedef struct UCKeyboardLayout UCKeyboardLayout; + +struct UCKeyLayoutFeatureInfo { + UInt16 keyLayoutFeatureInfoFormat; + UInt16 reserved; + UInt32 maxOutputStringLength; +}; +typedef struct UCKeyLayoutFeatureInfo UCKeyLayoutFeatureInfo; + +struct UCKeyModifiersToTableNum { + UInt16 keyModifiersToTableNumFormat; + UInt16 defaultTableNum; + UInt32 modifiersCount; + UInt8 tableNum[1]; + + +}; +typedef struct UCKeyModifiersToTableNum UCKeyModifiersToTableNum; + +struct UCKeyToCharTableIndex { + UInt16 keyToCharTableIndexFormat; + UInt16 keyToCharTableSize; + UInt32 keyToCharTableCount; + UInt32 keyToCharTableOffsets[1]; + + + + + + +}; +typedef struct UCKeyToCharTableIndex UCKeyToCharTableIndex; + +struct UCKeyStateRecordsIndex { + UInt16 keyStateRecordsIndexFormat; + UInt16 keyStateRecordCount; + UInt32 keyStateRecordOffsets[1]; + + + + +}; +typedef struct UCKeyStateRecordsIndex UCKeyStateRecordsIndex; + +struct UCKeyStateTerminators { + UInt16 keyStateTerminatorsFormat; + UInt16 keyStateTerminatorCount; + UCKeyCharSeq keyStateTerminators[1]; + + + +}; +typedef struct UCKeyStateTerminators UCKeyStateTerminators; + +struct UCKeySequenceDataIndex { + UInt16 keySequenceDataIndexFormat; + UInt16 charSequenceCount; + UInt16 charSequenceOffsets[1]; + + + + + +}; +typedef struct UCKeySequenceDataIndex UCKeySequenceDataIndex; + + + +enum { + kUCKeyLayoutHeaderFormat = 0x1002, + kUCKeyLayoutFeatureInfoFormat = 0x2001, + kUCKeyModifiersToTableNumFormat = 0x3001, + kUCKeyToCharTableIndexFormat = 0x4001, + kUCKeyStateRecordsIndexFormat = 0x5001, + kUCKeyStateTerminatorsFormat = 0x6001, + kUCKeySequenceDataIndexFormat = 0x7001 +}; +enum { + kUCKeyActionDown = 0, + kUCKeyActionUp = 1, + kUCKeyActionAutoKey = 2, + kUCKeyActionDisplay = 3 +}; + + + + + + + +enum { + kUCKeyTranslateNoDeadKeysBit = 0 +}; + +enum { + kUCKeyTranslateNoDeadKeysMask = 1L << kUCKeyTranslateNoDeadKeysBit +}; +enum { + kUnicodeCollationClass = 'ucol' +}; + +typedef struct OpaqueCollatorRef* CollatorRef; +typedef UInt32 UCCollateOptions; +enum { + + kUCCollateComposeInsensitiveMask = 1L << 1, + kUCCollateWidthInsensitiveMask = 1L << 2, + kUCCollateCaseInsensitiveMask = 1L << 3, + kUCCollateDiacritInsensitiveMask = 1L << 4, + kUCCollatePunctuationSignificantMask = 1L << 15, + kUCCollateDigitsOverrideMask = 1L << 16, + kUCCollateDigitsAsNumberMask = 1L << 17 +}; + +enum { + kUCCollateStandardOptions = kUCCollateComposeInsensitiveMask | kUCCollateWidthInsensitiveMask +}; + + + + + +enum { + kUCCollateTypeHFSExtended = 1 +}; + + +enum { + kUCCollateTypeSourceMask = 0x000000FF, + kUCCollateTypeShiftBits = 24 +}; + +enum { + kUCCollateTypeMask = (UInt32)kUCCollateTypeSourceMask << kUCCollateTypeShiftBits +}; + + +typedef UInt32 UCCollationValue; +typedef struct OpaqueUCTypeSelectRef* UCTypeSelectRef; + + + + +typedef SInt32 UCTypeSelectCompareResult; + + + + +typedef UInt16 UCTSWalkDirection; +enum { + kUCTSDirectionNext = 0, + kUCTSDirectionPrevious = 1 +}; +typedef UInt16 UCTypeSelectOptions; +enum { + kUCTSOptionsNoneMask = 0, + kUCTSOptionsReleaseStringMask = 1, + kUCTSOptionsDataIsOrderedMask = 2 + +}; + + + + + + +typedef Boolean ( * IndexToUCStringProcPtr)(UInt32 index, void *listDataPtr, void *refcon, CFStringRef *outString, UCTypeSelectOptions *tsOptions); + +typedef IndexToUCStringProcPtr IndexToUCStringUPP; +extern IndexToUCStringUPP +NewIndexToUCStringUPP(IndexToUCStringProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.4))); +extern void +DisposeIndexToUCStringUPP(IndexToUCStringUPP userUPP) __attribute__((availability(macosx,introduced=10.4))); +extern Boolean +InvokeIndexToUCStringUPP( + UInt32 index, + void * listDataPtr, + void * refcon, + CFStringRef * outString, + UCTypeSelectOptions * tsOptions, + IndexToUCStringUPP userUPP) __attribute__((availability(macosx,introduced=10.4))); +enum { + kUCTypeSelectMaxListSize = (UInt32)0xFFFFFFFF +}; +enum { + kUnicodeTextBreakClass = 'ubrk' +}; + +typedef struct OpaqueTextBreakLocatorRef* TextBreakLocatorRef; + + + + + + + +typedef UInt32 UCTextBreakType; +enum { + + + + + + + kUCTextBreakCharMask = 1L << 0, + kUCTextBreakClusterMask = 1L << 2, + + + + + + + kUCTextBreakWordMask = 1L << 4, + kUCTextBreakLineMask = 1L << 6, + + + + + + + kUCTextBreakParagraphMask = 1L << 8 +}; + +typedef UInt32 UCTextBreakOptions; +enum { + kUCTextBreakLeadingEdgeMask = 1L << 0, + kUCTextBreakGoBackwardsMask = 1L << 1, + kUCTextBreakIterateMask = 1L << 2 +}; +extern OSStatus +UCKeyTranslate( + const UCKeyboardLayout * keyLayoutPtr, + UInt16 virtualKeyCode, + UInt16 keyAction, + UInt32 modifierKeyState, + UInt32 keyboardType, + OptionBits keyTranslateOptions, + UInt32 * deadKeyState, + UniCharCount maxStringLength, + UniCharCount * actualStringLength, + UniChar unicodeString[]) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +UCCreateCollator( + LocaleRef locale, + LocaleOperationVariant opVariant, + UCCollateOptions options, + CollatorRef * collatorRef) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +UCGetCollationKey( + CollatorRef collatorRef, + const UniChar * textPtr, + UniCharCount textLength, + ItemCount maxKeySize, + ItemCount * actualKeySize, + UCCollationValue collationKey[]) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +UCCompareCollationKeys( + const UCCollationValue * key1Ptr, + ItemCount key1Length, + const UCCollationValue * key2Ptr, + ItemCount key2Length, + Boolean * equivalent, + SInt32 * order) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +UCCompareText( + CollatorRef collatorRef, + const UniChar * text1Ptr, + UniCharCount text1Length, + const UniChar * text2Ptr, + UniCharCount text2Length, + Boolean * equivalent, + SInt32 * order) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +UCDisposeCollator(CollatorRef * collatorRef) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +UCCompareTextDefault( + UCCollateOptions options, + const UniChar * text1Ptr, + UniCharCount text1Length, + const UniChar * text2Ptr, + UniCharCount text2Length, + Boolean * equivalent, + SInt32 * order) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +UCCompareTextNoLocale( + UCCollateOptions options, + const UniChar * text1Ptr, + UniCharCount text1Length, + const UniChar * text2Ptr, + UniCharCount text2Length, + Boolean * equivalent, + SInt32 * order) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +UCCreateTextBreakLocator( + LocaleRef locale, + LocaleOperationVariant opVariant, + UCTextBreakType breakTypes, + TextBreakLocatorRef * breakRef) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +UCFindTextBreak( + TextBreakLocatorRef breakRef, + UCTextBreakType breakType, + UCTextBreakOptions options, + const UniChar * textPtr, + UniCharCount textLength, + UniCharArrayOffset startOffset, + UniCharArrayOffset * breakOffset) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +UCDisposeTextBreakLocator(TextBreakLocatorRef * breakRef) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +UCTypeSelectCreateSelector( + LocaleRef locale, + LocaleOperationVariant opVariant, + UCCollateOptions options, + UCTypeSelectRef * newSelector) __attribute__((availability(macosx,introduced=10.4))); +extern OSStatus +UCTypeSelectFlushSelectorData(UCTypeSelectRef ref) __attribute__((availability(macosx,introduced=10.4))); +extern OSStatus +UCTypeSelectReleaseSelector(UCTypeSelectRef * ref) __attribute__((availability(macosx,introduced=10.4))); +extern Boolean +UCTypeSelectWouldResetBuffer( + UCTypeSelectRef inRef, + CFStringRef inText, + double inEventTime) __attribute__((availability(macosx,introduced=10.4))); +extern OSStatus +UCTypeSelectAddKeyToSelector( + UCTypeSelectRef inRef, + CFStringRef inText, + double inEventTime, + Boolean * updateFlag) __attribute__((availability(macosx,introduced=10.4))); +extern OSStatus +UCTypeSelectCompare( + UCTypeSelectRef ref, + CFStringRef inText, + UCTypeSelectCompareResult * result) __attribute__((availability(macosx,introduced=10.4))); +extern OSStatus +UCTypeSelectFindItem( + UCTypeSelectRef ref, + UInt32 listSize, + void * listDataPtr, + void * refcon, + IndexToUCStringUPP userUPP, + UInt32 * closestItem) __attribute__((availability(macosx,introduced=10.4))); +extern OSStatus +UCTypeSelectWalkList( + UCTypeSelectRef ref, + CFStringRef currSelect, + UCTSWalkDirection direction, + UInt32 listSize, + void * listDataPtr, + void * refcon, + IndexToUCStringUPP userUPP, + UInt32 * closestItem) __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern const double_t pi __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern double compound(double rate, double periods) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern double annuity(double rate, double periods) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern double_t randomx(double_t * x) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +typedef short relop; +enum { + GREATERTHAN = 0, + LESSTHAN = 1, + EQUALTO = 2, + UNORDERED = 3 +}; +extern relop relation(double_t x, double_t y) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +struct decimal { + char sgn; + char unused; + short exp; + struct { + unsigned char length; + unsigned char text[36]; + unsigned char unused; + } sig; +}; +typedef struct decimal decimal; + +struct decform { + char style; + char unused; + short digits; +}; +typedef struct decform decform; +extern void num2dec(const decform *f, double_t x, decimal *d) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern double_t dec2num(const decimal * d) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void dec2str(const decform *f, const decimal *d, char *s) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void str2dec(const char *s, short *ix, decimal *d, short *vp) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern float dec2f(const decimal * d) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern short dec2s(const decimal * d) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern long dec2l(const decimal * d) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern relop relationl(long double x, long double y); +extern void num2decl(const decform *f, long double x, decimal *d); +extern long double dec2numl(const decimal * d); +extern double x80tod(const extended80 * x80) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void dtox80(const double *x, extended80 *x80) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void x80told(const extended80 *x80, long double *x); +extern void ldtox80(const long double *x, extended80 *x80); + + +typedef struct { + unsigned short __control; + unsigned short __status; + unsigned int __mxcsr; + char __reserved[8]; +} fenv_t; + +typedef unsigned short fexcept_t; +extern const fenv_t _FE_DFL_ENV; +extern const fenv_t _FE_DFL_DISABLE_SSE_DENORMS_ENV; +extern int feclearexcept(int ); +extern int fegetexceptflag(fexcept_t * , int ); +extern int feraiseexcept(int ); +extern int fesetexceptflag(const fexcept_t * , int ); +extern int fetestexcept(int ); +extern int fegetround(void); +extern int fesetround(int ); +extern int fegetenv(fenv_t * ); +extern int feholdexcept(fenv_t * ); +extern int fesetenv(const fenv_t * ); +extern int feupdateenv(const fenv_t * ); + + +typedef OSType TECPluginSignature; +typedef UInt32 TECPluginVersion; + +enum { + kTECSignature = 'encv', + kTECUnicodePluginSignature = 'puni', + kTECJapanesePluginSignature = 'pjpn', + kTECChinesePluginSignature = 'pzho', + kTECKoreanPluginSignature = 'pkor' +}; + + + +typedef struct OpaqueTECObjectRef* TECObjectRef; +typedef struct OpaqueTECSnifferObjectRef* TECSnifferObjectRef; +typedef OSType TECPluginSig; +struct TECConversionInfo { + TextEncoding sourceEncoding; + TextEncoding destinationEncoding; + UInt16 reserved1; + UInt16 reserved2; +}; +typedef struct TECConversionInfo TECConversionInfo; +typedef UInt32 TECInternetNameUsageMask; +enum { + + + + + + + kTECInternetNameDefaultUsageMask = 0, + + + + + + kTECInternetNameStrictUsageMask = 1, + kTECInternetNameTolerantUsageMask = 2 +}; + + +enum { + kTEC_MIBEnumDontCare = -1 +}; + + +enum { + kTECDisableFallbacksBit = 16, + kTECDisableLooseMappingsBit = 17 +}; + +enum { + kTECDisableFallbacksMask = 1L << kTECDisableFallbacksBit, + kTECDisableLooseMappingsMask = 1L << kTECDisableLooseMappingsBit +}; +extern OSStatus +TECCountAvailableTextEncodings(ItemCount * numberEncodings) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECGetAvailableTextEncodings( + TextEncoding availableEncodings[], + ItemCount maxAvailableEncodings, + ItemCount * actualAvailableEncodings) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECCountDirectTextEncodingConversions(ItemCount * numberOfEncodings) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECGetDirectTextEncodingConversions( + TECConversionInfo availableConversions[], + ItemCount maxAvailableConversions, + ItemCount * actualAvailableConversions) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECCountDestinationTextEncodings( + TextEncoding inputEncoding, + ItemCount * numberOfEncodings) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECGetDestinationTextEncodings( + TextEncoding inputEncoding, + TextEncoding destinationEncodings[], + ItemCount maxDestinationEncodings, + ItemCount * actualDestinationEncodings) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECGetTextEncodingInternetName( + TextEncoding textEncoding, + Str255 encodingName) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECGetTextEncodingFromInternetName( + TextEncoding * textEncoding, + ConstStr255Param encodingName) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECCreateConverter( + TECObjectRef * newEncodingConverter, + TextEncoding inputEncoding, + TextEncoding outputEncoding) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECCreateConverterFromPath( + TECObjectRef * newEncodingConverter, + const TextEncoding inPath[], + ItemCount inEncodings) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECDisposeConverter(TECObjectRef newEncodingConverter) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECClearConverterContextInfo(TECObjectRef encodingConverter) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECConvertText( + TECObjectRef encodingConverter, + ConstTextPtr inputBuffer, + ByteCount inputBufferLength, + ByteCount * actualInputLength, + TextPtr outputBuffer, + ByteCount outputBufferLength, + ByteCount * actualOutputLength) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECFlushText( + TECObjectRef encodingConverter, + TextPtr outputBuffer, + ByteCount outputBufferLength, + ByteCount * actualOutputLength) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECCountSubTextEncodings( + TextEncoding inputEncoding, + ItemCount * numberOfEncodings) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECGetSubTextEncodings( + TextEncoding inputEncoding, + TextEncoding subEncodings[], + ItemCount maxSubEncodings, + ItemCount * actualSubEncodings) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECGetEncodingList( + TECObjectRef encodingConverter, + ItemCount * numEncodings, + Handle * encodingList) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECCreateOneToManyConverter( + TECObjectRef * newEncodingConverter, + TextEncoding inputEncoding, + ItemCount numOutputEncodings, + const TextEncoding outputEncodings[]) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECConvertTextToMultipleEncodings( + TECObjectRef encodingConverter, + ConstTextPtr inputBuffer, + ByteCount inputBufferLength, + ByteCount * actualInputLength, + TextPtr outputBuffer, + ByteCount outputBufferLength, + ByteCount * actualOutputLength, + TextEncodingRun outEncodingsBuffer[], + ItemCount maxOutEncodingRuns, + ItemCount * actualOutEncodingRuns) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECFlushMultipleEncodings( + TECObjectRef encodingConverter, + TextPtr outputBuffer, + ByteCount outputBufferLength, + ByteCount * actualOutputLength, + TextEncodingRun outEncodingsBuffer[], + ItemCount maxOutEncodingRuns, + ItemCount * actualOutEncodingRuns) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECCountWebTextEncodings( + RegionCode locale, + ItemCount * numberEncodings) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECGetWebTextEncodings( + RegionCode locale, + TextEncoding availableEncodings[], + ItemCount maxAvailableEncodings, + ItemCount * actualAvailableEncodings) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECCountMailTextEncodings( + RegionCode locale, + ItemCount * numberEncodings) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECGetMailTextEncodings( + RegionCode locale, + TextEncoding availableEncodings[], + ItemCount maxAvailableEncodings, + ItemCount * actualAvailableEncodings) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECCountAvailableSniffers(ItemCount * numberOfEncodings) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECGetAvailableSniffers( + TextEncoding availableSniffers[], + ItemCount maxAvailableSniffers, + ItemCount * actualAvailableSniffers) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECCreateSniffer( + TECSnifferObjectRef * encodingSniffer, + const TextEncoding testEncodings[], + ItemCount numTextEncodings) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECSniffTextEncoding( + TECSnifferObjectRef encodingSniffer, + ConstTextPtr inputBuffer, + ByteCount inputBufferLength, + TextEncoding testEncodings[], + ItemCount numTextEncodings, + ItemCount numErrsArray[], + ItemCount maxErrs, + ItemCount numFeaturesArray[], + ItemCount maxFeatures) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECDisposeSniffer(TECSnifferObjectRef encodingSniffer) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECClearSnifferContextInfo(TECSnifferObjectRef encodingSniffer) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TECSetBasicOptions( + TECObjectRef encodingConverter, + OptionBits controlFlags) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +TECCopyTextEncodingInternetNameAndMIB( + TextEncoding textEncoding, + TECInternetNameUsageMask usage, + CFStringRef * encodingNamePtr, + SInt32 * mibEnumPtr) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +TECGetTextEncodingFromInternetNameOrMIB( + TextEncoding * textEncodingPtr, + TECInternetNameUsageMask usage, + CFStringRef encodingName, + SInt32 mibEnum) __attribute__((availability(macosx,introduced=10.3))); + + + + + + + + + + + +typedef struct OpaqueTextToUnicodeInfo* TextToUnicodeInfo; +typedef struct OpaqueUnicodeToTextInfo* UnicodeToTextInfo; +typedef struct OpaqueUnicodeToTextRunInfo* UnicodeToTextRunInfo; +typedef const TextToUnicodeInfo ConstTextToUnicodeInfo; +typedef const UnicodeToTextInfo ConstUnicodeToTextInfo; + +typedef SInt32 UnicodeMapVersion; +enum { + kUnicodeUseLatestMapping = -1, + kUnicodeUseHFSPlusMapping = 4 +}; + + +struct UnicodeMapping { + TextEncoding unicodeEncoding; + TextEncoding otherEncoding; + UnicodeMapVersion mappingVersion; +}; +typedef struct UnicodeMapping UnicodeMapping; +typedef UnicodeMapping * UnicodeMappingPtr; +typedef const UnicodeMapping * ConstUnicodeMappingPtr; + +enum { + kUnicodeUseFallbacksBit = 0, + kUnicodeKeepInfoBit = 1, + kUnicodeDirectionalityBits = 2, + kUnicodeVerticalFormBit = 4, + kUnicodeLooseMappingsBit = 5, + kUnicodeStringUnterminatedBit = 6, + kUnicodeTextRunBit = 7, + kUnicodeKeepSameEncodingBit = 8, + kUnicodeForceASCIIRangeBit = 9, + kUnicodeNoHalfwidthCharsBit = 10, + kUnicodeTextRunHeuristicsBit = 11, + kUnicodeMapLineFeedToReturnBit = 12, + + + + + + kUnicodeUseExternalEncodingFormBit = 13 +}; + +enum { + kUnicodeUseFallbacksMask = 1L << kUnicodeUseFallbacksBit, + kUnicodeKeepInfoMask = 1L << kUnicodeKeepInfoBit, + kUnicodeDirectionalityMask = 3L << kUnicodeDirectionalityBits, + kUnicodeVerticalFormMask = 1L << kUnicodeVerticalFormBit, + kUnicodeLooseMappingsMask = 1L << kUnicodeLooseMappingsBit, + kUnicodeStringUnterminatedMask = 1L << kUnicodeStringUnterminatedBit, + kUnicodeTextRunMask = 1L << kUnicodeTextRunBit, + kUnicodeKeepSameEncodingMask = 1L << kUnicodeKeepSameEncodingBit, + kUnicodeForceASCIIRangeMask = 1L << kUnicodeForceASCIIRangeBit, + kUnicodeNoHalfwidthCharsMask = 1L << kUnicodeNoHalfwidthCharsBit, + kUnicodeTextRunHeuristicsMask = 1L << kUnicodeTextRunHeuristicsBit, + kUnicodeMapLineFeedToReturnMask = 1L << kUnicodeMapLineFeedToReturnBit, + + + + + + kUnicodeUseExternalEncodingFormMask = 1L << kUnicodeUseExternalEncodingFormBit +}; + + +enum { + kUnicodeDefaultDirection = 0, + kUnicodeLeftToRight = 1, + kUnicodeRightToLeft = 2 +}; + + +enum { + kUnicodeDefaultDirectionMask = kUnicodeDefaultDirection << kUnicodeDirectionalityBits, + kUnicodeLeftToRightMask = kUnicodeLeftToRight << kUnicodeDirectionalityBits, + kUnicodeRightToLeftMask = kUnicodeRightToLeft << kUnicodeDirectionalityBits +}; +enum { + kUnicodeMatchUnicodeBaseBit = 0, + kUnicodeMatchUnicodeVariantBit = 1, + kUnicodeMatchUnicodeFormatBit = 2, + kUnicodeMatchOtherBaseBit = 3, + kUnicodeMatchOtherVariantBit = 4, + kUnicodeMatchOtherFormatBit = 5 +}; + +enum { + kUnicodeMatchUnicodeBaseMask = 1L << kUnicodeMatchUnicodeBaseBit, + kUnicodeMatchUnicodeVariantMask = 1L << kUnicodeMatchUnicodeVariantBit, + kUnicodeMatchUnicodeFormatMask = 1L << kUnicodeMatchUnicodeFormatBit, + kUnicodeMatchOtherBaseMask = 1L << kUnicodeMatchOtherBaseBit, + kUnicodeMatchOtherVariantMask = 1L << kUnicodeMatchOtherVariantBit, + kUnicodeMatchOtherFormatMask = 1L << kUnicodeMatchOtherFormatBit +}; + + +enum { + kUnicodeFallbackSequencingBits = 0 +}; + +enum { + kUnicodeFallbackSequencingMask = 3L << kUnicodeFallbackSequencingBits, + kUnicodeFallbackInterruptSafeMask = 1L << 2 +}; + + +enum { + kUnicodeFallbackDefaultOnly = 0, + kUnicodeFallbackCustomOnly = 1, + kUnicodeFallbackDefaultFirst = 2, + kUnicodeFallbackCustomFirst = 3 +}; + + + +typedef OSStatus ( * UnicodeToTextFallbackProcPtr)(UniChar *iSrcUniStr, ByteCount iSrcUniStrLen, ByteCount *oSrcConvLen, TextPtr oDestStr, ByteCount iDestStrLen, ByteCount *oDestConvLen, LogicalAddress iInfoPtr, ConstUnicodeMappingPtr iUnicodeMappingPtr); +typedef UnicodeToTextFallbackProcPtr UnicodeToTextFallbackUPP; +extern UnicodeToTextFallbackUPP +NewUnicodeToTextFallbackUPP(UnicodeToTextFallbackProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0))); +extern void +DisposeUnicodeToTextFallbackUPP(UnicodeToTextFallbackUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +InvokeUnicodeToTextFallbackUPP( + UniChar * iSrcUniStr, + ByteCount iSrcUniStrLen, + ByteCount * oSrcConvLen, + TextPtr oDestStr, + ByteCount iDestStrLen, + ByteCount * oDestConvLen, + LogicalAddress iInfoPtr, + ConstUnicodeMappingPtr iUnicodeMappingPtr, + UnicodeToTextFallbackUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +CreateTextToUnicodeInfo( + ConstUnicodeMappingPtr iUnicodeMapping, + TextToUnicodeInfo * oTextToUnicodeInfo) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +CreateTextToUnicodeInfoByEncoding( + TextEncoding iEncoding, + TextToUnicodeInfo * oTextToUnicodeInfo) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +CreateUnicodeToTextInfo( + ConstUnicodeMappingPtr iUnicodeMapping, + UnicodeToTextInfo * oUnicodeToTextInfo) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +CreateUnicodeToTextInfoByEncoding( + TextEncoding iEncoding, + UnicodeToTextInfo * oUnicodeToTextInfo) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +CreateUnicodeToTextRunInfo( + ItemCount iNumberOfMappings, + const UnicodeMapping iUnicodeMappings[], + UnicodeToTextRunInfo * oUnicodeToTextInfo) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +CreateUnicodeToTextRunInfoByEncoding( + ItemCount iNumberOfEncodings, + const TextEncoding iEncodings[], + UnicodeToTextRunInfo * oUnicodeToTextInfo) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +CreateUnicodeToTextRunInfoByScriptCode( + ItemCount iNumberOfScriptCodes, + const ScriptCode iScripts[], + UnicodeToTextRunInfo * oUnicodeToTextInfo) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +ChangeTextToUnicodeInfo( + TextToUnicodeInfo ioTextToUnicodeInfo, + ConstUnicodeMappingPtr iUnicodeMapping) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +ChangeUnicodeToTextInfo( + UnicodeToTextInfo ioUnicodeToTextInfo, + ConstUnicodeMappingPtr iUnicodeMapping) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +DisposeTextToUnicodeInfo(TextToUnicodeInfo * ioTextToUnicodeInfo) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +DisposeUnicodeToTextInfo(UnicodeToTextInfo * ioUnicodeToTextInfo) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +DisposeUnicodeToTextRunInfo(UnicodeToTextRunInfo * ioUnicodeToTextRunInfo) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +ConvertFromTextToUnicode( + TextToUnicodeInfo iTextToUnicodeInfo, + ByteCount iSourceLen, + ConstLogicalAddress iSourceStr, + OptionBits iControlFlags, + ItemCount iOffsetCount, + const ByteOffset iOffsetArray[], + ItemCount * oOffsetCount, + ByteOffset oOffsetArray[], + ByteCount iOutputBufLen, + ByteCount * oSourceRead, + ByteCount * oUnicodeLen, + UniChar oUnicodeStr[]) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +ConvertFromUnicodeToText( + UnicodeToTextInfo iUnicodeToTextInfo, + ByteCount iUnicodeLen, + const UniChar iUnicodeStr[], + OptionBits iControlFlags, + ItemCount iOffsetCount, + const ByteOffset iOffsetArray[], + ItemCount * oOffsetCount, + ByteOffset oOffsetArray[], + ByteCount iOutputBufLen, + ByteCount * oInputRead, + ByteCount * oOutputLen, + LogicalAddress oOutputStr) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +ConvertFromUnicodeToTextRun( + UnicodeToTextRunInfo iUnicodeToTextInfo, + ByteCount iUnicodeLen, + const UniChar iUnicodeStr[], + OptionBits iControlFlags, + ItemCount iOffsetCount, + const ByteOffset iOffsetArray[], + ItemCount * oOffsetCount, + ByteOffset oOffsetArray[], + ByteCount iOutputBufLen, + ByteCount * oInputRead, + ByteCount * oOutputLen, + LogicalAddress oOutputStr, + ItemCount iEncodingRunBufLen, + ItemCount * oEncodingRunOutLen, + TextEncodingRun oEncodingRuns[]) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +ConvertFromUnicodeToScriptCodeRun( + UnicodeToTextRunInfo iUnicodeToTextInfo, + ByteCount iUnicodeLen, + const UniChar iUnicodeStr[], + OptionBits iControlFlags, + ItemCount iOffsetCount, + const ByteOffset iOffsetArray[], + ItemCount * oOffsetCount, + ByteOffset oOffsetArray[], + ByteCount iOutputBufLen, + ByteCount * oInputRead, + ByteCount * oOutputLen, + LogicalAddress oOutputStr, + ItemCount iScriptRunBufLen, + ItemCount * oScriptRunOutLen, + ScriptCodeRun oScriptCodeRuns[]) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TruncateForTextToUnicode( + ConstTextToUnicodeInfo iTextToUnicodeInfo, + ByteCount iSourceLen, + ConstLogicalAddress iSourceStr, + ByteCount iMaxLen, + ByteCount * oTruncatedLen) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +TruncateForUnicodeToText( + ConstUnicodeToTextInfo iUnicodeToTextInfo, + ByteCount iSourceLen, + const UniChar iSourceStr[], + OptionBits iControlFlags, + ByteCount iMaxLen, + ByteCount * oTruncatedLen) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +ConvertFromPStringToUnicode( + TextToUnicodeInfo iTextToUnicodeInfo, + ConstStr255Param iPascalStr, + ByteCount iOutputBufLen, + ByteCount * oUnicodeLen, + UniChar oUnicodeStr[]) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +ConvertFromUnicodeToPString( + UnicodeToTextInfo iUnicodeToTextInfo, + ByteCount iUnicodeLen, + const UniChar iUnicodeStr[], + Str255 oPascalStr) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +CountUnicodeMappings( + OptionBits iFilter, + ConstUnicodeMappingPtr iFindMapping, + ItemCount * oActualCount) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +QueryUnicodeMappings( + OptionBits iFilter, + ConstUnicodeMappingPtr iFindMapping, + ItemCount iMaxCount, + ItemCount * oActualCount, + UnicodeMapping oReturnedMappings[]) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +SetFallbackUnicodeToText( + UnicodeToTextInfo iUnicodeToTextInfo, + UnicodeToTextFallbackUPP iFallback, + OptionBits iControlFlags, + LogicalAddress iInfoPtr) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +SetFallbackUnicodeToTextRun( + UnicodeToTextRunInfo iUnicodeToTextRunInfo, + UnicodeToTextFallbackUPP iFallback, + OptionBits iControlFlags, + LogicalAddress iInfoPtr) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +ResetTextToUnicodeInfo(TextToUnicodeInfo ioTextToUnicodeInfo) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +ResetUnicodeToTextInfo(UnicodeToTextInfo ioUnicodeToTextInfo) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +ResetUnicodeToTextRunInfo(UnicodeToTextRunInfo ioUnicodeToTextRunInfo) __attribute__((availability(macosx,introduced=10.0))); + + + + + + + +typedef UInt16 ThreadState; +enum { + kReadyThreadState = 0, + kStoppedThreadState = 1, + kRunningThreadState = 2 +}; + + + + +typedef void * ThreadTaskRef; + +typedef UInt32 ThreadStyle; +enum { + kCooperativeThread = 1L << 0, + kPreemptiveThread = 1L << 1 +}; + + +typedef unsigned long ThreadID; +enum { + kNoThreadID = 0, + kCurrentThreadID = 1, + kApplicationThreadID = 2 +}; + + +typedef UInt32 ThreadOptions; +enum { + kNewSuspend = (1 << 0), + kUsePremadeThread = (1 << 1), + kCreateIfNeeded = (1 << 2), + kFPUNotNeeded = (1 << 3), + kExactMatchThread = (1 << 4) +}; + + +struct SchedulerInfoRec { + UInt32 InfoRecSize; + ThreadID CurrentThreadID; + ThreadID SuggestedThreadID; + ThreadID InterruptedCoopThreadID; +}; +typedef struct SchedulerInfoRec SchedulerInfoRec; +typedef SchedulerInfoRec * SchedulerInfoRecPtr; + + + + + + +typedef void * voidPtr; + +typedef voidPtr ( * ThreadEntryProcPtr)(void * threadParam); + +typedef ThreadID ( * ThreadSchedulerProcPtr)(SchedulerInfoRecPtr schedulerInfo); + +typedef void ( * ThreadSwitchProcPtr)(ThreadID threadBeingSwitched, void *switchProcParam); + +typedef void ( * ThreadTerminationProcPtr)(ThreadID threadTerminated, void *terminationProcParam); + +typedef void ( * DebuggerNewThreadProcPtr)(ThreadID threadCreated); + +typedef void ( * DebuggerDisposeThreadProcPtr)(ThreadID threadDeleted); + +typedef ThreadID ( * DebuggerThreadSchedulerProcPtr)(SchedulerInfoRecPtr schedulerInfo); +typedef ThreadEntryProcPtr ThreadEntryUPP; +typedef ThreadSchedulerProcPtr ThreadSchedulerUPP; +typedef ThreadSwitchProcPtr ThreadSwitchUPP; +typedef ThreadTerminationProcPtr ThreadTerminationUPP; +typedef DebuggerNewThreadProcPtr DebuggerNewThreadUPP; +typedef DebuggerDisposeThreadProcPtr DebuggerDisposeThreadUPP; +typedef DebuggerThreadSchedulerProcPtr DebuggerThreadSchedulerUPP; +extern ThreadEntryUPP +NewThreadEntryUPP(ThreadEntryProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern ThreadSchedulerUPP +NewThreadSchedulerUPP(ThreadSchedulerProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern ThreadSwitchUPP +NewThreadSwitchUPP(ThreadSwitchProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern ThreadTerminationUPP +NewThreadTerminationUPP(ThreadTerminationProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern DebuggerNewThreadUPP +NewDebuggerNewThreadUPP(DebuggerNewThreadProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern DebuggerDisposeThreadUPP +NewDebuggerDisposeThreadUPP(DebuggerDisposeThreadProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern DebuggerThreadSchedulerUPP +NewDebuggerThreadSchedulerUPP(DebuggerThreadSchedulerProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern void +DisposeThreadEntryUPP(ThreadEntryUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern void +DisposeThreadSchedulerUPP(ThreadSchedulerUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern void +DisposeThreadSwitchUPP(ThreadSwitchUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern void +DisposeThreadTerminationUPP(ThreadTerminationUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern void +DisposeDebuggerNewThreadUPP(DebuggerNewThreadUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern void +DisposeDebuggerDisposeThreadUPP(DebuggerDisposeThreadUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern void +DisposeDebuggerThreadSchedulerUPP(DebuggerThreadSchedulerUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern voidPtr +InvokeThreadEntryUPP( + void * threadParam, + ThreadEntryUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern ThreadID +InvokeThreadSchedulerUPP( + SchedulerInfoRecPtr schedulerInfo, + ThreadSchedulerUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern void +InvokeThreadSwitchUPP( + ThreadID threadBeingSwitched, + void * switchProcParam, + ThreadSwitchUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern void +InvokeThreadTerminationUPP( + ThreadID threadTerminated, + void * terminationProcParam, + ThreadTerminationUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern void +InvokeDebuggerNewThreadUPP( + ThreadID threadCreated, + DebuggerNewThreadUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern void +InvokeDebuggerDisposeThreadUPP( + ThreadID threadDeleted, + DebuggerDisposeThreadUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern ThreadID +InvokeDebuggerThreadSchedulerUPP( + SchedulerInfoRecPtr schedulerInfo, + DebuggerThreadSchedulerUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +typedef ThreadEntryUPP ThreadEntryTPP; +typedef ThreadSchedulerUPP ThreadSchedulerTPP; +typedef ThreadSwitchUPP ThreadSwitchTPP; +typedef ThreadTerminationUPP ThreadTerminationTPP; +typedef DebuggerNewThreadUPP DebuggerNewThreadTPP; +typedef DebuggerDisposeThreadUPP DebuggerDisposeThreadTPP; +typedef DebuggerThreadSchedulerUPP DebuggerThreadSchedulerTPP; +extern OSErr +NewThread( + ThreadStyle threadStyle, + ThreadEntryTPP threadEntry, + void * threadParam, + Size stackSize, + ThreadOptions options, + void ** threadResult, + ThreadID * threadMade) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSErr +SetThreadScheduler(ThreadSchedulerTPP threadScheduler) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSErr +SetThreadSwitcher( + ThreadID thread, + ThreadSwitchTPP threadSwitcher, + void * switchProcParam, + Boolean inOrOut) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSErr +SetThreadTerminator( + ThreadID thread, + ThreadTerminationTPP threadTerminator, + void * terminationProcParam) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSErr +SetDebuggerNotificationProcs( + DebuggerNewThreadTPP notifyNewThread, + DebuggerDisposeThreadTPP notifyDisposeThread, + DebuggerThreadSchedulerTPP notifyThreadScheduler) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSErr +CreateThreadPool( + ThreadStyle threadStyle, + SInt16 numToCreate, + Size stackSize) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSErr +GetDefaultThreadStackSize( + ThreadStyle threadStyle, + Size * stackSize) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSErr +ThreadCurrentStackSpace( + ThreadID thread, + ByteCount * freeStack) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSErr +DisposeThread( + ThreadID threadToDump, + void * threadResult, + Boolean recycleThread) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSErr +YieldToThread(ThreadID suggestedThread) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSErr +YieldToAnyThread(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSErr +GetCurrentThread(ThreadID * currentThreadID) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSErr +GetThreadState( + ThreadID threadToGet, + ThreadState * threadState) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSErr +SetThreadState( + ThreadID threadToSet, + ThreadState newState, + ThreadID suggestedThread) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSErr +SetThreadStateEndCritical( + ThreadID threadToSet, + ThreadState newState, + ThreadID suggestedThread) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSErr +ThreadBeginCritical(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSErr +ThreadEndCritical(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSErr +GetThreadCurrentTaskRef(ThreadTaskRef * threadTRef) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSErr +GetThreadStateGivenTaskRef( + ThreadTaskRef threadTRef, + ThreadID threadToGet, + ThreadState * threadState) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSErr +SetThreadReadyGivenTaskRef( + ThreadTaskRef threadTRef, + ThreadID threadToSet) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + +enum { + kOnSystemDisk = -32768L, + kOnAppropriateDisk = -32767, + + + kSystemDomain = -32766, + kLocalDomain = -32765, + kNetworkDomain = -32764, + kUserDomain = -32763, + kClassicDomain = -32762, + kFolderManagerLastDomain = -32760 +}; + + + + + +enum { + kLastDomainConstant = -32760 +}; + +enum { + kCreateFolder = 1, + kDontCreateFolder = 0 +}; +extern OSErr +FindFolder( + FSVolumeRefNum vRefNum, + OSType folderType, + Boolean createFolder, + FSVolumeRefNum * foundVRefNum, + SInt32 * foundDirID) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +ReleaseFolder( + FSVolumeRefNum vRefNum, + OSType folderType) __attribute__((availability(macosx,introduced=10.0,deprecated=10.3))); +extern OSErr +FSFindFolder( + FSVolumeRefNum vRefNum, + OSType folderType, + Boolean createFolder, + FSRef * foundRef) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +enum { + kDesktopFolderType = 'desk', + kTrashFolderType = 'trsh', + kWhereToEmptyTrashFolderType = 'empt', + kFontsFolderType = 'font', + kPreferencesFolderType = 'pref', + kSystemPreferencesFolderType = 'sprf', + kTemporaryFolderType = 'temp', + kChewableItemsFolderType = 'flnt', + kTemporaryItemsInCacheDataFolderType = 'vtmp', + kApplicationsFolderType = 'apps', + kVolumeRootFolderType = 'root', + kDomainTopLevelFolderType = 'dtop', + kDomainLibraryFolderType = 'dlib', + kUsersFolderType = 'usrs', + kCurrentUserFolderType = 'cusr', + kSharedUserDataFolderType = 'sdat' +}; + + + + + +enum { + kDocumentsFolderType = 'docs', + kPictureDocumentsFolderType = 'pdoc', + kMovieDocumentsFolderType = 'mdoc', + kMusicDocumentsFolderType = 0xB5646F63 , + kInternetSitesFolderType = 'site', + kPublicFolderType = 'pubb' +}; + + +enum { + kDropBoxFolderType = 'drop' +}; + +enum { + kSharedLibrariesFolderType = 0xC46C6962 , + kVoicesFolderType = 'fvoc', + kUtilitiesFolderType = 0x757469C4 , + kThemesFolderType = 'thme', + kFavoritesFolderType = 'favs', + kInternetSearchSitesFolderType = 'issf', + kInstallerLogsFolderType = 'ilgf', + kScriptsFolderType = 0x736372C4 , + kFolderActionsFolderType = 'fasf', + kSpeakableItemsFolderType = 'spki', + kKeychainFolderType = 'kchn' +}; + + + +enum { + kColorSyncFolderType = 'sync', + kColorSyncCMMFolderType = 'ccmm', + kColorSyncScriptingFolderType = 'cscr', + kPrintersFolderType = 'impr', + kSpeechFolderType = 'spch', + kCarbonLibraryFolderType = 'carb', + kDocumentationFolderType = 'info', + kISSDownloadsFolderType = 'issd', + kUserSpecificTmpFolderType = 'utmp', + kCachedDataFolderType = 'cach', + kFrameworksFolderType = 'fram', + kPrivateFrameworksFolderType = 'pfrm', + kClassicDesktopFolderType = 'sdsk', + kSystemSoundsFolderType = 'ssnd', + kComponentsFolderType = 'cmpd', + kQuickTimeComponentsFolderType = 'wcmp', + kCoreServicesFolderType = 'csrv', + kAudioSupportFolderType = 'adio', + kAudioPresetsFolderType = 'apst', + kAudioSoundsFolderType = 'asnd', + kAudioSoundBanksFolderType = 'bank', + kAudioAlertSoundsFolderType = 'alrt', + kAudioPlugInsFolderType = 'aplg', + kAudioComponentsFolderType = 'acmp', + kKernelExtensionsFolderType = 'kext', + kDirectoryServicesFolderType = 'dsrv', + kDirectoryServicesPlugInsFolderType = 'dplg', + kInstallerReceiptsFolderType = 'rcpt', + kFileSystemSupportFolderType = 'fsys', + kAppleShareSupportFolderType = 'shar', + kAppleShareAuthenticationFolderType = 'auth', + kMIDIDriversFolderType = 'midi', + kKeyboardLayoutsFolderType = 'klay', + kIndexFilesFolderType = 'indx', + kFindByContentIndexesFolderType = 'fbcx', + kManagedItemsFolderType = 'mang', + kBootTimeStartupItemsFolderType = 'empz', + kAutomatorWorkflowsFolderType = 'flow', + kAutosaveInformationFolderType = 'asav', + kSpotlightSavedSearchesFolderType = 'spot', + + kSpotlightImportersFolderType = 'simp', + kSpotlightMetadataCacheFolderType = 'scch', + kInputManagersFolderType = 'inpt', + kInputMethodsFolderType = 'inpf', + kLibraryAssistantsFolderType = 'astl', + kAudioDigidesignFolderType = 'adig', + kAudioVSTFolderType = 'avst', + kColorPickersFolderType = 'cpkr', + kCompositionsFolderType = 'cmps', + kFontCollectionsFolderType = 'fncl', + kiMovieFolderType = 'imov', + kiMoviePlugInsFolderType = 'impi', + kiMovieSoundEffectsFolderType = 'imse', + kDownloadsFolderType = 'down' +}; + +enum { + kColorSyncProfilesFolderType = 'prof', + kApplicationSupportFolderType = 'asup', + kTextEncodingsFolderType = 0xC4746578 , + kPrinterDescriptionFolderType = 'ppdf', + kPrinterDriverFolderType = 0xC4707264 , + kScriptingAdditionsFolderType = 0xC4736372 +}; + +enum { + kClassicPreferencesFolderType = 'cprf' +}; + +enum { + kQuickLookFolderType = 'qlck' +}; + +enum { + kServicesFolderType = 'svcs' +}; + +enum { + + kSystemFolderType = 'macs', + kSystemDesktopFolderType = 'sdsk', + kSystemTrashFolderType = 'strs', + kPrintMonitorDocsFolderType = 'prnt', + kALMModulesFolderType = 'walk', + kALMPreferencesFolderType = 'trip', + kALMLocationsFolderType = 'fall', + kAppleExtrasFolderType = 0x616578C4 , + kContextualMenuItemsFolderType = 'cmnu', + kMacOSReadMesFolderType = 0x6D6F72C4 , + kStartupFolderType = 'strt', + kShutdownFolderType = 'shdf', + kAppleMenuFolderType = 'amnu', + kControlPanelFolderType = 'ctrl', + kSystemControlPanelFolderType = 'sctl', + kExtensionFolderType = 'extn', + kExtensionDisabledFolderType = 'extD', + kControlPanelDisabledFolderType = 'ctrD', + kSystemExtensionDisabledFolderType = 'macD', + kStartupItemsDisabledFolderType = 'strD', + kShutdownItemsDisabledFolderType = 'shdD', + kAssistantsFolderType = 0x617374C4 , + kStationeryFolderType = 'odst', + kOpenDocFolderType = 'odod', + kOpenDocShellPlugInsFolderType = 'odsp', + kEditorsFolderType = 'oded', + kOpenDocEditorsFolderType = 0xC46F6466 , + kOpenDocLibrariesFolderType = 'odlb', + kGenEditorsFolderType = 0xC4656469 , + kHelpFolderType = 0xC4686C70 , + kInternetPlugInFolderType = 0xC46E6574 , + kModemScriptsFolderType = 0xC46D6F64 , + kControlStripModulesFolderType = 'sdev', + kInternetFolderType = 0x696E74C4 , + kAppearanceFolderType = 'appr', + kSoundSetsFolderType = 'snds', + kDesktopPicturesFolderType = 0x647470C4 , + kFindSupportFolderType = 'fnds', + kRecentApplicationsFolderType = 'rapp', + kRecentDocumentsFolderType = 'rdoc', + kRecentServersFolderType = 'rsvr', + kLauncherItemsFolderType = 'laun', + kQuickTimeExtensionsFolderType = 'qtex', + kDisplayExtensionsFolderType = 'dspl', + kMultiprocessingFolderType = 'mpxf', + kPrintingPlugInsFolderType = 'pplg', + kAppleshareAutomountServerAliasesFolderType = 0x737276C4 , + kVolumeSettingsFolderType = 'vsfd', + kPreMacOS91ApplicationsFolderType = 0x8C707073 , + kPreMacOS91InstallerLogsFolderType = 0x946C6766 , + kPreMacOS91AssistantsFolderType = 0x8C7374C4 , + kPreMacOS91UtilitiesFolderType = 0x9F7469C4 , + kPreMacOS91AppleExtrasFolderType = 0x8C6578C4 , + kPreMacOS91MacOSReadMesFolderType = 0xB56F72C4 , + kPreMacOS91InternetFolderType = 0x946E74C4 , + kPreMacOS91AutomountedServersFolderType = 0xA77276C4 , + kPreMacOS91StationeryFolderType = 0xBF647374 , + kLocalesFolderType = 0xC46C6F63 , + kFindByContentPluginsFolderType = 'fbcp', + kFindByContentFolderType = 'fbcf' +}; + + +enum { + kMagicTemporaryItemsFolderType = 'mtmp', + kTemporaryItemsInUserDomainFolderType = 'temq', + kCurrentUserRemoteFolderLocation = 'rusf', + kCurrentUserRemoteFolderType = 'rusr' +}; + + + + + +enum { + kDeveloperDocsFolderType = 'ddoc', + kDeveloperHelpFolderType = 'devh', + kDeveloperFolderType = 'devf', + kDeveloperApplicationsFolderType = 'dapp' +}; + + +enum { + kCreateFolderAtBoot = 0x00000002, + kCreateFolderAtBootBit = 1, + kFolderCreatedInvisible = 0x00000004, + kFolderCreatedInvisibleBit = 2, + kFolderCreatedNameLocked = 0x00000008, + kFolderCreatedNameLockedBit = 3, + kFolderCreatedAdminPrivs = 0x00000010, + kFolderCreatedAdminPrivsBit = 4 +}; + +enum { + kFolderInUserFolder = 0x00000020, + kFolderInUserFolderBit = 5, + kFolderTrackedByAlias = 0x00000040, + kFolderTrackedByAliasBit = 6, + kFolderInRemoteUserFolderIfAvailable = 0x00000080, + kFolderInRemoteUserFolderIfAvailableBit = 7, + kFolderNeverMatchedInIdentifyFolder = 0x00000100, + kFolderNeverMatchedInIdentifyFolderBit = 8, + kFolderMustStayOnSameVolume = 0x00000200, + kFolderMustStayOnSameVolumeBit = 9, + kFolderManagerFolderInMacOS9FolderIfMacOSXIsInstalledMask = 0x00000400, + kFolderManagerFolderInMacOS9FolderIfMacOSXIsInstalledBit = 10, + kFolderInLocalOrRemoteUserFolder = kFolderInUserFolder | kFolderInRemoteUserFolderIfAvailable, + kFolderManagerNotCreatedOnRemoteVolumesBit = 11, + kFolderManagerNotCreatedOnRemoteVolumesMask = (1 << kFolderManagerNotCreatedOnRemoteVolumesBit), + kFolderManagerNewlyCreatedFolderIsLocalizedBit = 12, + kFolderManagerNewlyCreatedFolderShouldHaveDotLocalizedCreatedWithinMask = (1 << kFolderManagerNewlyCreatedFolderIsLocalizedBit) +}; + +typedef UInt32 FolderDescFlags; + +enum { + kRelativeFolder = 'relf', + kRedirectedRelativeFolder = 'rrel', + kSpecialFolder = 'spcf' +}; + +typedef OSType FolderClass; + +enum { + kBlessedFolder = 'blsf', + kRootFolder = 'rotf' +}; + +enum { + kCurrentUserFolderLocation = 'cusf' +}; + + +enum { + kDictionariesFolderType = 'dict', + kLogsFolderType = 'logs', + kPreferencePanesFolderType = 'ppan' +}; + + +enum { + kWidgetsFolderType = 'wdgt', + kScreenSaversFolderType = 'scrn' +}; + +typedef OSType FolderType; +typedef OSType FolderLocation; + +struct FolderDesc { + Size descSize; + FolderType foldType; + FolderDescFlags flags; + FolderClass foldClass; + FolderType foldLocation; + OSType badgeSignature; + OSType badgeType; + UInt32 reserved; + StrFileName name; +}; +typedef struct FolderDesc FolderDesc; +typedef FolderDesc * FolderDescPtr; + +typedef UInt32 RoutingFlags; +struct FolderRouting { + Size descSize; + OSType fileType; + FolderType routeFromFolder; + FolderType routeToFolder; + RoutingFlags flags; +}; +typedef struct FolderRouting FolderRouting; +typedef FolderRouting * FolderRoutingPtr; +extern OSErr +AddFolderDescriptor( + FolderType foldType, + FolderDescFlags flags, + FolderClass foldClass, + FolderLocation foldLocation, + OSType badgeSignature, + OSType badgeType, + ConstStrFileNameParam name, + Boolean replaceFlag) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +GetFolderTypes( + UInt32 requestedTypeCount, + UInt32 * totalTypeCount, + FolderType * theTypes) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +RemoveFolderDescriptor(FolderType foldType) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus +GetFolderNameUnicode( + FSVolumeRefNum vRefNum, + OSType foldType, + FSVolumeRefNum * foundVRefNum, + HFSUniStr255 * name) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern OSErr +InvalidateFolderDescriptorCache( + FSVolumeRefNum vRefNum, + SInt32 dirID) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +IdentifyFolder( + FSVolumeRefNum vRefNum, + SInt32 dirID, + FolderType * foldType) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +FSDetermineIfRefIsEnclosedByFolder( + FSVolumeRefNum domainOrVRefNum, + OSType folderType, + const FSRef * inRef, + Boolean * outResult) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +extern OSErr +DetermineIfPathIsEnclosedByFolder( + FSVolumeRefNum domainOrVRefNum, + OSType folderType, + const UInt8 * utf8Path, + Boolean pathIsRealPath, + Boolean * outResult) __attribute__((availability(macosx,introduced=10.4,deprecated=10.8))); +typedef OSStatus ( * FolderManagerNotificationProcPtr)(OSType message, void *arg, void *userRefCon); +typedef FolderManagerNotificationProcPtr FolderManagerNotificationUPP; +extern FolderManagerNotificationUPP +NewFolderManagerNotificationUPP(FolderManagerNotificationProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeFolderManagerNotificationUPP(FolderManagerNotificationUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus +InvokeFolderManagerNotificationUPP( + OSType message, + void * arg, + void * userRefCon, + FolderManagerNotificationUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); + + + +extern void +Microseconds(UnsignedWide * microTickCount) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +enum { + + kTMTaskActive = (1L << 15) +}; + +typedef struct TMTask TMTask; +typedef TMTask * TMTaskPtr; +typedef void ( * TimerProcPtr)(TMTaskPtr tmTaskPtr); +typedef TimerProcPtr TimerUPP; +struct TMTask { + QElemPtr qLink; + short qType; + TimerUPP tmAddr; + long tmCount; + long tmWakeUp; + long tmReserved; +}; +extern void +InsTime(QElemPtr tmTaskPtr) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern void +InsXTime(QElemPtr tmTaskPtr) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern void +PrimeTime( + QElemPtr tmTaskPtr, + long count) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern void +RmvTime(QElemPtr tmTaskPtr) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern OSErr +InstallTimeTask(QElemPtr tmTaskPtr) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern OSErr +InstallXTimeTask(QElemPtr tmTaskPtr) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern OSErr +PrimeTimeTask( + QElemPtr tmTaskPtr, + long count) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern OSErr +RemoveTimeTask(QElemPtr tmTaskPtr) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern TimerUPP +NewTimerUPP(TimerProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeTimerUPP(TimerUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +InvokeTimerUPP( + TMTaskPtr tmTaskPtr, + TimerUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); + + + +extern OSStatus +MPGetNextCpuID( + MPCoherenceID owningCoherenceID, + MPCpuID * cpuID) __attribute__((availability(macosx,introduced=10.4,deprecated=10.7))); +extern OSStatus +MPGetNextTaskID( + MPProcessID owningProcessID, + MPTaskID * taskID) __attribute__((availability(macosx,introduced=10.4,deprecated=10.7))); +enum { + + kMPQueueInfoVersion = 1L | (kOpaqueQueueID << 16), + kMPSemaphoreInfoVersion = 1L | (kOpaqueSemaphoreID << 16), + kMPEventInfoVersion = 1L | (kOpaqueEventID << 16), + kMPCriticalRegionInfoVersion = 1L | (kOpaqueCriticalRegionID << 16), + kMPNotificationInfoVersion = 1L | (kOpaqueNotificationID << 16), + kMPAddressSpaceInfoVersion = 1L | (kOpaqueAddressSpaceID << 16) +}; + + +struct MPQueueInfo { + PBVersion version; + + MPProcessID processID; + OSType queueName; + + ItemCount nWaiting; + MPTaskID waitingTaskID; + + ItemCount nMessages; + ItemCount nReserved; + + void * p1; + void * p2; + void * p3; +}; +typedef struct MPQueueInfo MPQueueInfo; +struct MPSemaphoreInfo { + PBVersion version; + + MPProcessID processID; + OSType semaphoreName; + + ItemCount nWaiting; + MPTaskID waitingTaskID; + + ItemCount maximum; + ItemCount count; +}; +typedef struct MPSemaphoreInfo MPSemaphoreInfo; +struct MPEventInfo { + PBVersion version; + + MPProcessID processID; + OSType eventName; + + ItemCount nWaiting; + MPTaskID waitingTaskID; + + MPEventFlags events; +}; +typedef struct MPEventInfo MPEventInfo; +struct MPCriticalRegionInfo { + PBVersion version; + + MPProcessID processID; + OSType regionName; + + ItemCount nWaiting; + MPTaskID waitingTaskID; + + MPTaskID owningTask; + ItemCount count; +}; +typedef struct MPCriticalRegionInfo MPCriticalRegionInfo; +struct MPNotificationInfo { + PBVersion version; + + MPProcessID processID; + OSType notificationName; + + MPQueueID queueID; + void * p1; + void * p2; + void * p3; + + MPEventID eventID; + MPEventFlags events; + + MPSemaphoreID semaphoreID; +}; +typedef struct MPNotificationInfo MPNotificationInfo; +struct MPAddressSpaceInfo { + PBVersion version; + + MPProcessID processID; + MPCoherenceID groupID; + ItemCount nTasks; + UInt32 vsid[16]; +}; +typedef struct MPAddressSpaceInfo MPAddressSpaceInfo; +extern SInt16 LMGetBootDrive(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void LMSetBootDrive(SInt16 value) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt16 LMGetApFontID(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern void LMSetApFontID(SInt16 value) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern SInt16 LMGetSysMap(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void LMSetSysMap(SInt16 value) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern UInt8 LMGetResLoad(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void LMSetResLoad(UInt8 value) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SInt16 LMGetResErr(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void LMSetResErr(SInt16 value) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern UInt8 LMGetTmpResLoad(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void LMSetTmpResLoad(UInt8 value) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern Ptr LMGetIntlSpec(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void LMSetIntlSpec(Ptr value) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void LMSetSysFontFam(SInt16 value) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern SInt16 LMGetSysFontSize(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.4))); +extern void LMSetSysFontSize(SInt16 value) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); + + + + + + + + + + + +typedef UInt16 AVLVisitStage; +enum { + + + + + kAVLPreOrder = 0, + + + + + + kAVLInOrder = 1, + + + + + kAVLPostOrder = 2 +}; +typedef UInt16 AVLOrder; +enum { + + + + + kLeftToRight = 0, + + + + + kRightToLeft = 1 +}; +typedef UInt16 AVLNodeType; +enum { + kAVLIsTree = 0, + kAVLIsLeftBranch = 1, + kAVLIsRightBranch = 2, + kAVLIsLeaf = 3, + kAVLNullNode = 4 +}; + +enum { + errItemAlreadyInTree = -960, + errNotValidTree = -961, + errItemNotFoundInTree = -962, + errCanNotInsertWhileWalkProcInProgress = -963, + errTreeIsLocked = -964 +}; +struct AVLTreeStruct { + OSType signature; + unsigned long privateStuff[8]; +}; +typedef struct AVLTreeStruct AVLTreeStruct; +typedef AVLTreeStruct * AVLTreePtr; +typedef SInt32 ( * AVLCompareItemsProcPtr)(AVLTreePtr tree, const void *i1, const void *i2, AVLNodeType nd_typ); +typedef ByteCount ( * AVLItemSizeProcPtr)(AVLTreePtr tree, const void *itemPtr); +typedef void ( * AVLDisposeItemProcPtr)(AVLTreePtr tree, const void *dataP); +typedef OSErr ( * AVLWalkProcPtr)(AVLTreePtr tree, const void *dataPtr, AVLVisitStage visitStage, AVLNodeType node, UInt32 level, SInt32 balance, void *refCon); +typedef AVLCompareItemsProcPtr AVLCompareItemsUPP; +typedef AVLItemSizeProcPtr AVLItemSizeUPP; +typedef AVLDisposeItemProcPtr AVLDisposeItemUPP; +typedef AVLWalkProcPtr AVLWalkUPP; +extern AVLCompareItemsUPP +NewAVLCompareItemsUPP(AVLCompareItemsProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); +extern AVLItemSizeUPP +NewAVLItemSizeUPP(AVLItemSizeProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); +extern AVLDisposeItemUPP +NewAVLDisposeItemUPP(AVLDisposeItemProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); +extern AVLWalkUPP +NewAVLWalkUPP(AVLWalkProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); +extern void +DisposeAVLCompareItemsUPP(AVLCompareItemsUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); +extern void +DisposeAVLItemSizeUPP(AVLItemSizeUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); +extern void +DisposeAVLDisposeItemUPP(AVLDisposeItemUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); +extern void +DisposeAVLWalkUPP(AVLWalkUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); +extern SInt32 +InvokeAVLCompareItemsUPP( + AVLTreePtr tree, + const void * i1, + const void * i2, + AVLNodeType nd_typ, + AVLCompareItemsUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); +extern ByteCount +InvokeAVLItemSizeUPP( + AVLTreePtr tree, + const void * itemPtr, + AVLItemSizeUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); +extern void +InvokeAVLDisposeItemUPP( + AVLTreePtr tree, + const void * dataP, + AVLDisposeItemUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); +extern OSErr +InvokeAVLWalkUPP( + AVLTreePtr tree, + const void * dataPtr, + AVLVisitStage visitStage, + AVLNodeType node, + UInt32 level, + SInt32 balance, + void * refCon, + AVLWalkUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); + + + +struct PEFContainerHeader { + OSType tag1; + OSType tag2; + OSType architecture; + UInt32 formatVersion; + UInt32 dateTimeStamp; + UInt32 oldDefVersion; + UInt32 oldImpVersion; + UInt32 currentVersion; + UInt16 sectionCount; + UInt16 instSectionCount; + UInt32 reservedA; +}; +typedef struct PEFContainerHeader PEFContainerHeader; +enum { + kPEFTag1 = 'Joy!', + kPEFTag2 = 'peff', + kPEFVersion = 0x00000001 +}; + + +enum { + kPEFFirstSectionHeaderOffset = sizeof(PEFContainerHeader) +}; +struct PEFSectionHeader { + SInt32 nameOffset; + UInt32 defaultAddress; + UInt32 totalLength; + UInt32 unpackedLength; + UInt32 containerLength; + UInt32 containerOffset; + UInt8 sectionKind; + UInt8 shareKind; + UInt8 alignment; + UInt8 reservedA; +}; +typedef struct PEFSectionHeader PEFSectionHeader; +enum { + + + kPEFCodeSection = 0, + kPEFUnpackedDataSection = 1, + kPEFPackedDataSection = 2, + kPEFConstantSection = 3, + kPEFExecDataSection = 6, + + kPEFLoaderSection = 4, + kPEFDebugSection = 5, + kPEFExceptionSection = 7, + kPEFTracebackSection = 8 +}; + + +enum { + + kPEFProcessShare = 1, + kPEFGlobalShare = 4, + kPEFProtectedShare = 5 +}; +enum { + + kPEFPkDataZero = 0, + kPEFPkDataBlock = 1, + kPEFPkDataRepeat = 2, + kPEFPkDataRepeatBlock = 3, + kPEFPkDataRepeatZero = 4 +}; + + +enum { + kPEFPkDataOpcodeShift = 5, + kPEFPkDataCount5Mask = 0x1F, + kPEFPkDataMaxCount5 = 31, + kPEFPkDataVCountShift = 7, + kPEFPkDataVCountMask = 0x7F, + kPEFPkDataVCountEndMask = 0x80 +}; +struct PEFLoaderInfoHeader { + SInt32 mainSection; + UInt32 mainOffset; + SInt32 initSection; + UInt32 initOffset; + SInt32 termSection; + UInt32 termOffset; + UInt32 importedLibraryCount; + UInt32 totalImportedSymbolCount; + UInt32 relocSectionCount; + UInt32 relocInstrOffset; + UInt32 loaderStringsOffset; + UInt32 exportHashOffset; + UInt32 exportHashTablePower; + UInt32 exportedSymbolCount; +}; +typedef struct PEFLoaderInfoHeader PEFLoaderInfoHeader; + + + + + + + +struct PEFImportedLibrary { + UInt32 nameOffset; + UInt32 oldImpVersion; + UInt32 currentVersion; + UInt32 importedSymbolCount; + UInt32 firstImportedSymbol; + UInt8 options; + UInt8 reservedA; + UInt16 reservedB; +}; +typedef struct PEFImportedLibrary PEFImportedLibrary; +enum { + + kPEFWeakImportLibMask = 0x40, + kPEFInitLibBeforeMask = 0x80 +}; +struct PEFImportedSymbol { + UInt32 classAndName; +}; +typedef struct PEFImportedSymbol PEFImportedSymbol; +enum { + kPEFImpSymClassShift = 24, + kPEFImpSymNameOffsetMask = 0x00FFFFFF, + kPEFImpSymMaxNameOffset = 0x00FFFFFF +}; + + + + + + + +enum { + + kPEFCodeSymbol = 0x00, + kPEFDataSymbol = 0x01, + kPEFTVectorSymbol = 0x02, + kPEFTOCSymbol = 0x03, + kPEFGlueSymbol = 0x04, + kPEFUndefinedSymbol = 0x0F, + kPEFWeakImportSymMask = 0x80 +}; +struct PEFExportedSymbolHashSlot { + UInt32 countAndStart; +}; +typedef struct PEFExportedSymbolHashSlot PEFExportedSymbolHashSlot; +enum { + kPEFHashSlotSymCountShift = 18, + kPEFHashSlotFirstKeyMask = 0x0003FFFF, + kPEFHashSlotMaxSymbolCount = 0x00003FFF, + kPEFHashSlotMaxKeyIndex = 0x0003FFFF +}; +struct PEFSplitHashWord { + UInt16 nameLength; + UInt16 hashValue; +}; +typedef struct PEFSplitHashWord PEFSplitHashWord; +struct PEFExportedSymbolKey { + union { + UInt32 fullHashWord; + PEFSplitHashWord splitHashWord; + } u; +}; +typedef struct PEFExportedSymbolKey PEFExportedSymbolKey; +enum { + kPEFHashLengthShift = 16, + kPEFHashValueMask = 0x0000FFFF, + kPEFHashMaxLength = 0x0000FFFF +}; +struct PEFExportedSymbol { + UInt32 classAndName; + UInt32 symbolValue; + SInt16 sectionIndex; +}; +typedef struct PEFExportedSymbol PEFExportedSymbol; +enum { + kPEFExpSymClassShift = 24, + kPEFExpSymNameOffsetMask = 0x00FFFFFF, + kPEFExpSymMaxNameOffset = 0x00FFFFFF +}; + + + + + + + +enum { + + kPEFAbsoluteExport = -2, + kPEFReexportedImport = -3 +}; +typedef UInt16 PEFRelocChunk; +struct PEFLoaderRelocationHeader { + UInt16 sectionIndex; + UInt16 reservedA; + UInt32 relocCount; + UInt32 firstRelocOffset; +}; +typedef struct PEFLoaderRelocationHeader PEFLoaderRelocationHeader; +enum { + kPEFRelocBasicOpcodeRange = 128 +}; +enum { + kPEFRelocBySectDWithSkip = 0x00, + kPEFRelocBySectC = 0x20, + kPEFRelocBySectD = 0x21, + kPEFRelocTVector12 = 0x22, + kPEFRelocTVector8 = 0x23, + kPEFRelocVTable8 = 0x24, + kPEFRelocImportRun = 0x25, + kPEFRelocSmByImport = 0x30, + kPEFRelocSmSetSectC = 0x31, + kPEFRelocSmSetSectD = 0x32, + kPEFRelocSmBySection = 0x33, + kPEFRelocIncrPosition = 0x40, + kPEFRelocSmRepeat = 0x48, + kPEFRelocSetPosition = 0x50, + kPEFRelocLgByImport = 0x52, + kPEFRelocLgRepeat = 0x58, + kPEFRelocLgSetOrBySection = 0x5A, + kPEFRelocUndefinedOpcode = 0xFF +}; +enum { + kPEFRelocLgBySectionSubopcode = 0x00, + kPEFRelocLgSetSectCSubopcode = 0x01, + kPEFRelocLgSetSectDSubopcode = 0x02 +}; +enum { + kPEFRelocWithSkipMaxSkipCount = 255, + kPEFRelocWithSkipMaxRelocCount = 63 +}; +enum { + kPEFRelocRunMaxRunLength = 512 +}; +enum { + kPEFRelocSmIndexMaxIndex = 511 +}; +enum { + kPEFRelocIncrPositionMaxOffset = 4096 +}; +enum { + kPEFRelocSmRepeatMaxChunkCount = 16, + kPEFRelocSmRepeatMaxRepeatCount = 256 +}; +enum { + kPEFRelocSetPosMaxOffset = 0x03FFFFFF +}; +enum { + kPEFRelocLgByImportMaxIndex = 0x03FFFFFF +}; +enum { + kPEFRelocLgRepeatMaxChunkCount = 16, + kPEFRelocLgRepeatMaxRepeatCount = 0x003FFFFF +}; +enum { + kPEFRelocLgSetOrBySectionMaxIndex = 0x003FFFFF +}; +struct XLibContainerHeader { + + + + OSType tag1; + OSType tag2; + UInt32 currentFormat; + UInt32 containerStringsOffset; + UInt32 exportHashOffset; + UInt32 exportKeyOffset; + UInt32 exportSymbolOffset; + UInt32 exportNamesOffset; + UInt32 exportHashTablePower; + UInt32 exportedSymbolCount; + + + + UInt32 fragNameOffset; + UInt32 fragNameLength; + UInt32 dylibPathOffset; + UInt32 dylibPathLength; + OSType cpuFamily; + OSType cpuModel; + UInt32 dateTimeStamp; + UInt32 currentVersion; + UInt32 oldDefVersion; + UInt32 oldImpVersion; + +}; +typedef struct XLibContainerHeader XLibContainerHeader; +enum { + kXLibTag1 = (int)0xF04D6163 , + kVLibTag2 = 'VLib', + kBLibTag2 = 'BLib', + kXLibVersion = 0x00000001 +}; + + + +typedef PEFExportedSymbolHashSlot XLibExportedSymbolHashSlot; +typedef PEFExportedSymbolKey XLibExportedSymbolKey; +struct XLibExportedSymbol { + UInt32 classAndName; + UInt32 bpOffset; +}; +typedef struct XLibExportedSymbol XLibExportedSymbol; + + + +enum { + kHFSSigWord = 0x4244, + kHFSPlusSigWord = 0x482B, + kHFSXSigWord = 0x4858, + + kHFSPlusVersion = 0x0004, + kHFSXVersion = 0x0005, + + kHFSPlusMountVersion = 0x31302E30, + kHFSJMountVersion = 0x4846534a, + kFSKMountVersion = 0x46534b21 +}; +enum { + kHardLinkFileType = 0x686C6E6B, + kHFSPlusCreator = 0x6866732B +}; + + + + + +enum { + kSymLinkFileType = 0x736C6E6B, + kSymLinkCreator = 0x72686170 +}; + + +enum { + kHFSMaxVolumeNameChars = 27, + kHFSMaxFileNameChars = 31, + kHFSPlusMaxFileNameChars = 255 +}; + + + + + +struct HFSExtentKey { + u_int8_t keyLength; + u_int8_t forkType; + u_int32_t fileID; + u_int16_t startBlock; +} __attribute__((aligned(2), packed)); +typedef struct HFSExtentKey HFSExtentKey; + + +struct HFSPlusExtentKey { + u_int16_t keyLength; + u_int8_t forkType; + u_int8_t pad; + u_int32_t fileID; + u_int32_t startBlock; +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusExtentKey HFSPlusExtentKey; + + +enum { + kHFSExtentDensity = 3, + kHFSPlusExtentDensity = 8 +}; + + +struct HFSExtentDescriptor { + u_int16_t startBlock; + u_int16_t blockCount; +} __attribute__((aligned(2), packed)); +typedef struct HFSExtentDescriptor HFSExtentDescriptor; + + +struct HFSPlusExtentDescriptor { + u_int32_t startBlock; + u_int32_t blockCount; +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusExtentDescriptor HFSPlusExtentDescriptor; + + +typedef HFSExtentDescriptor HFSExtentRecord[3]; + + +typedef HFSPlusExtentDescriptor HFSPlusExtentRecord[8]; + + + +struct FndrFileInfo { + u_int32_t fdType; + u_int32_t fdCreator; + u_int16_t fdFlags; + struct { + int16_t v; + int16_t h; + } fdLocation; + int16_t opaque; +} __attribute__((aligned(2), packed)); +typedef struct FndrFileInfo FndrFileInfo; + +struct FndrDirInfo { + struct { + int16_t top; + int16_t left; + int16_t bottom; + int16_t right; + } frRect; + unsigned short frFlags; + struct { + u_int16_t v; + u_int16_t h; + } frLocation; + int16_t opaque; +} __attribute__((aligned(2), packed)); +typedef struct FndrDirInfo FndrDirInfo; + +struct FndrOpaqueInfo { + int8_t opaque[16]; +} __attribute__((aligned(2), packed)); +typedef struct FndrOpaqueInfo FndrOpaqueInfo; + +struct FndrExtendedDirInfo { + u_int32_t document_id; + u_int32_t date_added; + u_int16_t extended_flags; + u_int16_t reserved3; + u_int32_t write_gen_counter; +} __attribute__((aligned(2), packed)); + +struct FndrExtendedFileInfo { + u_int32_t document_id; + u_int32_t date_added; + u_int16_t extended_flags; + u_int16_t reserved2; + u_int32_t write_gen_counter; +} __attribute__((aligned(2), packed)); + + +struct HFSPlusForkData { + u_int64_t logicalSize; + u_int32_t clumpSize; + u_int32_t totalBlocks; + HFSPlusExtentRecord extents; +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusForkData HFSPlusForkData; + + + + + + + +struct HFSPlusBSDInfo { + u_int32_t ownerID; + u_int32_t groupID; + u_int8_t adminFlags; + u_int8_t ownerFlags; + u_int16_t fileMode; + union { + u_int32_t iNodeNum; + u_int32_t linkCount; + u_int32_t rawDevice; + } special; +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusBSDInfo HFSPlusBSDInfo; +enum { + kHFSRootParentID = 1, + kHFSRootFolderID = 2, + kHFSExtentsFileID = 3, + kHFSCatalogFileID = 4, + kHFSBadBlockFileID = 5, + kHFSAllocationFileID = 6, + kHFSStartupFileID = 7, + kHFSAttributesFileID = 8, + kHFSAttributeDataFileID = 13, + + kHFSRepairCatalogFileID = 14, + kHFSBogusExtentFileID = 15, + kHFSFirstUserCatalogNodeID = 16 +}; + + +struct HFSCatalogKey { + u_int8_t keyLength; + u_int8_t reserved; + u_int32_t parentID; + u_int8_t nodeName[kHFSMaxFileNameChars + 1]; +} __attribute__((aligned(2), packed)); +typedef struct HFSCatalogKey HFSCatalogKey; + + +struct HFSPlusCatalogKey { + u_int16_t keyLength; + u_int32_t parentID; + HFSUniStr255 nodeName; +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusCatalogKey HFSPlusCatalogKey; + + +enum { + + kHFSFolderRecord = 0x0100, + kHFSFileRecord = 0x0200, + kHFSFolderThreadRecord = 0x0300, + kHFSFileThreadRecord = 0x0400, + + + kHFSPlusFolderRecord = 1, + kHFSPlusFileRecord = 2, + kHFSPlusFolderThreadRecord = 3, + kHFSPlusFileThreadRecord = 4 +}; + + + +enum { + kHFSFileLockedBit = 0x0000, + kHFSFileLockedMask = 0x0001, + + kHFSThreadExistsBit = 0x0001, + kHFSThreadExistsMask = 0x0002, + + kHFSHasAttributesBit = 0x0002, + kHFSHasAttributesMask = 0x0004, + + kHFSHasSecurityBit = 0x0003, + kHFSHasSecurityMask = 0x0008, + + kHFSHasFolderCountBit = 0x0004, + kHFSHasFolderCountMask = 0x0010, + + kHFSHasLinkChainBit = 0x0005, + kHFSHasLinkChainMask = 0x0020, + + kHFSHasChildLinkBit = 0x0006, + kHFSHasChildLinkMask = 0x0040, + + kHFSHasDateAddedBit = 0x0007, + kHFSHasDateAddedMask = 0x0080, + + kHFSFastDevPinnedBit = 0x0008, + kHFSFastDevPinnedMask = 0x0100, + + kHFSDoNotFastDevPinBit = 0x0009, + kHFSDoNotFastDevPinMask = 0x0200, + + kHFSFastDevCandidateBit = 0x000a, + kHFSFastDevCandidateMask = 0x0400, + + kHFSAutoCandidateBit = 0x000b, + kHFSAutoCandidateMask = 0x0800 + + + +}; + + + +struct HFSCatalogFolder { + int16_t recordType; + u_int16_t flags; + u_int16_t valence; + u_int32_t folderID; + u_int32_t createDate; + u_int32_t modifyDate; + u_int32_t backupDate; + FndrDirInfo userInfo; + FndrOpaqueInfo finderInfo; + u_int32_t reserved[4]; +} __attribute__((aligned(2), packed)); +typedef struct HFSCatalogFolder HFSCatalogFolder; + + +struct HFSPlusCatalogFolder { + int16_t recordType; + u_int16_t flags; + u_int32_t valence; + u_int32_t folderID; + u_int32_t createDate; + u_int32_t contentModDate; + u_int32_t attributeModDate; + u_int32_t accessDate; + u_int32_t backupDate; + HFSPlusBSDInfo bsdInfo; + FndrDirInfo userInfo; + FndrOpaqueInfo finderInfo; + u_int32_t textEncoding; + u_int32_t folderCount; +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusCatalogFolder HFSPlusCatalogFolder; + + +struct HFSCatalogFile { + int16_t recordType; + u_int8_t flags; + int8_t fileType; + FndrFileInfo userInfo; + u_int32_t fileID; + u_int16_t dataStartBlock; + int32_t dataLogicalSize; + int32_t dataPhysicalSize; + u_int16_t rsrcStartBlock; + int32_t rsrcLogicalSize; + int32_t rsrcPhysicalSize; + u_int32_t createDate; + u_int32_t modifyDate; + u_int32_t backupDate; + FndrOpaqueInfo finderInfo; + u_int16_t clumpSize; + HFSExtentRecord dataExtents; + HFSExtentRecord rsrcExtents; + u_int32_t reserved; +} __attribute__((aligned(2), packed)); +typedef struct HFSCatalogFile HFSCatalogFile; + + +struct HFSPlusCatalogFile { + int16_t recordType; + u_int16_t flags; + u_int32_t reserved1; + u_int32_t fileID; + u_int32_t createDate; + u_int32_t contentModDate; + u_int32_t attributeModDate; + u_int32_t accessDate; + u_int32_t backupDate; + HFSPlusBSDInfo bsdInfo; + FndrFileInfo userInfo; + FndrOpaqueInfo finderInfo; + u_int32_t textEncoding; + u_int32_t reserved2; + + + HFSPlusForkData dataFork; + HFSPlusForkData resourceFork; +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusCatalogFile HFSPlusCatalogFile; + + +struct HFSCatalogThread { + int16_t recordType; + int32_t reserved[2]; + u_int32_t parentID; + u_int8_t nodeName[kHFSMaxFileNameChars + 1]; +} __attribute__((aligned(2), packed)); +typedef struct HFSCatalogThread HFSCatalogThread; + + +struct HFSPlusCatalogThread { + int16_t recordType; + int16_t reserved; + u_int32_t parentID; + HFSUniStr255 nodeName; +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusCatalogThread HFSPlusCatalogThread; + + + + + + +enum { + kHFSPlusAttrInlineData = 0x10, + kHFSPlusAttrForkData = 0x20, + kHFSPlusAttrExtents = 0x30 +}; +struct HFSPlusAttrForkData { + u_int32_t recordType; + u_int32_t reserved; + HFSPlusForkData theFork; +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusAttrForkData HFSPlusAttrForkData; + + + + + + +struct HFSPlusAttrExtents { + u_int32_t recordType; + u_int32_t reserved; + HFSPlusExtentRecord extents; +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusAttrExtents HFSPlusAttrExtents; + + + + + + + +struct HFSPlusAttrData { + u_int32_t recordType; + u_int32_t reserved[2]; + u_int32_t attrSize; + u_int8_t attrData[2]; +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusAttrData HFSPlusAttrData; + + + +struct HFSPlusAttrInlineData { + u_int32_t recordType; + u_int32_t reserved; + u_int32_t logicalSize; + u_int8_t userData[2]; +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusAttrInlineData HFSPlusAttrInlineData; + + + +union HFSPlusAttrRecord { + u_int32_t recordType; + HFSPlusAttrInlineData inlineData; + HFSPlusAttrData attrData; + HFSPlusAttrForkData forkData; + HFSPlusAttrExtents overflowExtents; +}; +typedef union HFSPlusAttrRecord HFSPlusAttrRecord; + + +enum { kHFSMaxAttrNameLen = 127 }; +struct HFSPlusAttrKey { + u_int16_t keyLength; + u_int16_t pad; + u_int32_t fileID; + u_int32_t startBlock; + u_int16_t attrNameLen; + u_int16_t attrName[kHFSMaxAttrNameLen]; +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusAttrKey HFSPlusAttrKey; +enum { + kHFSPlusExtentKeyMaximumLength = sizeof(HFSPlusExtentKey) - sizeof(u_int16_t), + kHFSExtentKeyMaximumLength = sizeof(HFSExtentKey) - sizeof(u_int8_t), + kHFSPlusCatalogKeyMaximumLength = sizeof(HFSPlusCatalogKey) - sizeof(u_int16_t), + kHFSPlusCatalogKeyMinimumLength = kHFSPlusCatalogKeyMaximumLength - sizeof(HFSUniStr255) + sizeof(u_int16_t), + kHFSCatalogKeyMaximumLength = sizeof(HFSCatalogKey) - sizeof(u_int8_t), + kHFSCatalogKeyMinimumLength = kHFSCatalogKeyMaximumLength - (kHFSMaxFileNameChars + 1) + sizeof(u_int8_t), + kHFSPlusCatalogMinNodeSize = 4096, + kHFSPlusExtentMinNodeSize = 512, + kHFSPlusAttrMinNodeSize = 4096 +}; + + +enum { + + kHFSVolumeHardwareLockBit = 7, + kHFSVolumeUnmountedBit = 8, + kHFSVolumeSparedBlocksBit = 9, + kHFSVolumeNoCacheRequiredBit = 10, + kHFSBootVolumeInconsistentBit = 11, + kHFSCatalogNodeIDsReusedBit = 12, + kHFSVolumeJournaledBit = 13, + kHFSVolumeInconsistentBit = 14, + kHFSVolumeSoftwareLockBit = 15, + + + + + kHFSUnusedNodeFixBit = 31, + kHFSContentProtectionBit = 30, + + + kHFSVolumeHardwareLockMask = 0x00000080, + kHFSVolumeUnmountedMask = 0x00000100, + kHFSVolumeSparedBlocksMask = 0x00000200, + kHFSVolumeNoCacheRequiredMask = 0x00000400, + kHFSBootVolumeInconsistentMask = 0x00000800, + kHFSCatalogNodeIDsReusedMask = 0x00001000, + kHFSVolumeJournaledMask = 0x00002000, + kHFSVolumeInconsistentMask = 0x00004000, + kHFSVolumeSoftwareLockMask = 0x00008000, + + + + kHFSContentProtectionMask = 0x40000000, + kHFSUnusedNodeFixMask = 0x80000000, + + kHFSMDBAttributesMask = 0x8380 +}; + +enum { + kHFSUnusedNodesFixDate = 0xc5ef2480 +}; + + + +struct HFSMasterDirectoryBlock { + u_int16_t drSigWord; + u_int32_t drCrDate; + u_int32_t drLsMod; + u_int16_t drAtrb; + u_int16_t drNmFls; + u_int16_t drVBMSt; + u_int16_t drAllocPtr; + u_int16_t drNmAlBlks; + u_int32_t drAlBlkSiz; + u_int32_t drClpSiz; + u_int16_t drAlBlSt; + u_int32_t drNxtCNID; + u_int16_t drFreeBks; + u_int8_t drVN[kHFSMaxVolumeNameChars + 1]; + u_int32_t drVolBkUp; + u_int16_t drVSeqNum; + u_int32_t drWrCnt; + u_int32_t drXTClpSiz; + u_int32_t drCTClpSiz; + u_int16_t drNmRtDirs; + u_int32_t drFilCnt; + u_int32_t drDirCnt; + u_int32_t drFndrInfo[8]; + u_int16_t drEmbedSigWord; + HFSExtentDescriptor drEmbedExtent; + u_int32_t drXTFlSize; + HFSExtentRecord drXTExtRec; + u_int32_t drCTFlSize; + HFSExtentRecord drCTExtRec; +} __attribute__((aligned(2), packed)); +typedef struct HFSMasterDirectoryBlock HFSMasterDirectoryBlock; +struct HFSPlusVolumeHeader { + u_int16_t signature; + u_int16_t version; + u_int32_t attributes; + u_int32_t lastMountedVersion; + u_int32_t journalInfoBlock; + + u_int32_t createDate; + u_int32_t modifyDate; + u_int32_t backupDate; + u_int32_t checkedDate; + + u_int32_t fileCount; + u_int32_t folderCount; + + u_int32_t blockSize; + u_int32_t totalBlocks; + u_int32_t freeBlocks; + + u_int32_t nextAllocation; + u_int32_t rsrcClumpSize; + u_int32_t dataClumpSize; + u_int32_t nextCatalogID; + + u_int32_t writeCount; + u_int64_t encodingsBitmap; + + u_int8_t finderInfo[32]; + + HFSPlusForkData allocationFile; + HFSPlusForkData extentsFile; + HFSPlusForkData catalogFile; + HFSPlusForkData attributesFile; + HFSPlusForkData startupFile; +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusVolumeHeader HFSPlusVolumeHeader; + + + + +enum BTreeKeyLimits{ + kMaxKeyLength = 520 +}; + +union BTreeKey{ + u_int8_t length8; + u_int16_t length16; + u_int8_t rawData [kMaxKeyLength+2]; +}; +typedef union BTreeKey BTreeKey; + + +struct BTNodeDescriptor { + u_int32_t fLink; + u_int32_t bLink; + int8_t kind; + u_int8_t height; + u_int16_t numRecords; + u_int16_t reserved; +} __attribute__((aligned(2), packed)); +typedef struct BTNodeDescriptor BTNodeDescriptor; + + +enum { + kBTLeafNode = -1, + kBTIndexNode = 0, + kBTHeaderNode = 1, + kBTMapNode = 2 +}; + + +struct BTHeaderRec { + u_int16_t treeDepth; + u_int32_t rootNode; + u_int32_t leafRecords; + u_int32_t firstLeafNode; + u_int32_t lastLeafNode; + u_int16_t nodeSize; + u_int16_t maxKeyLength; + u_int32_t totalNodes; + u_int32_t freeNodes; + u_int16_t reserved1; + u_int32_t clumpSize; + u_int8_t btreeType; + u_int8_t keyCompareType; + u_int32_t attributes; + u_int32_t reserved3[16]; +} __attribute__((aligned(2), packed)); +typedef struct BTHeaderRec BTHeaderRec; + + +enum { + kBTBadCloseMask = 0x00000001, + kBTBigKeysMask = 0x00000002, + kBTVariableIndexKeysMask = 0x00000004 +}; + + + +enum { + kHFSCaseFolding = 0xCF, + kHFSBinaryCompare = 0xBC +}; + + +typedef __darwin_uuid_string_t uuid_string_t; + + + + + +static const uuid_t UUID_NULL __attribute__ ((unused)) = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + + + + + +void uuid_clear(uuid_t uu); + +int uuid_compare(const uuid_t uu1, const uuid_t uu2); + +void uuid_copy(uuid_t dst, const uuid_t src); + +void uuid_generate(uuid_t out); +void uuid_generate_random(uuid_t out); +void uuid_generate_time(uuid_t out); + +int uuid_is_null(const uuid_t uu); + +int uuid_parse(const uuid_string_t in, uuid_t uu); + +void uuid_unparse(const uuid_t uu, uuid_string_t out); +void uuid_unparse_lower(const uuid_t uu, uuid_string_t out); +void uuid_unparse_upper(const uuid_t uu, uuid_string_t out); +struct JournalInfoBlock { + u_int32_t flags; + u_int32_t device_signature[8]; + u_int64_t offset; + u_int64_t size; + uuid_string_t ext_jnl_uuid; + char machine_serial_num[48]; + char reserved[((32*sizeof(u_int32_t)) - sizeof(uuid_string_t) - 48)]; +} __attribute__((aligned(2), packed)); +typedef struct JournalInfoBlock JournalInfoBlock; + +enum { + kJIJournalInFSMask = 0x00000001, + kJIJournalOnOtherDeviceMask = 0x00000002, + kJIJournalNeedInitMask = 0x00000004 +}; + + + + + + + + +typedef UInt32 HFSCatalogNodeID; + + + + +enum { + AIFFID = 'AIFF', + AIFCID = 'AIFC', + FormatVersionID = 'FVER', + CommonID = 'COMM', + FORMID = 'FORM', + SoundDataID = 'SSND', + MarkerID = 'MARK', + InstrumentID = 'INST', + MIDIDataID = 'MIDI', + AudioRecordingID = 'AESD', + ApplicationSpecificID = 'APPL', + CommentID = 'COMT', + NameID = 'NAME', + AuthorID = 'AUTH', + CopyrightID = '(c) ', + AnnotationID = 'ANNO' +}; + +enum { + NoLooping = 0, + ForwardLooping = 1, + ForwardBackwardLooping = 2 +}; + + +enum { + + AIFCVersion1 = (uint32_t)0xA2805140 +}; + + + + + + + +enum { + + NoneType = 'NONE', + ACE2Type = 'ACE2', + ACE8Type = 'ACE8', + MACE3Type = 'MAC3', + MACE6Type = 'MAC6' +}; +typedef SInt16 MarkerIdType; +struct ChunkHeader { + UInt32 ckID; + SInt32 ckSize; +}; +typedef struct ChunkHeader ChunkHeader; +struct ContainerChunk { + UInt32 ckID; + SInt32 ckSize; + UInt32 formType; +}; +typedef struct ContainerChunk ContainerChunk; +struct FormatVersionChunk { + UInt32 ckID; + SInt32 ckSize; + UInt32 timestamp; +}; +typedef struct FormatVersionChunk FormatVersionChunk; +typedef FormatVersionChunk * FormatVersionChunkPtr; +struct CommonChunk { + UInt32 ckID; + SInt32 ckSize; + SInt16 numChannels; + UInt32 numSampleFrames; + SInt16 sampleSize; + extended80 sampleRate; +}; +typedef struct CommonChunk CommonChunk; +typedef CommonChunk * CommonChunkPtr; +struct ExtCommonChunk { + UInt32 ckID; + SInt32 ckSize; + SInt16 numChannels; + UInt32 numSampleFrames; + SInt16 sampleSize; + extended80 sampleRate; + UInt32 compressionType; + char compressionName[1]; +}; +typedef struct ExtCommonChunk ExtCommonChunk; +typedef ExtCommonChunk * ExtCommonChunkPtr; +struct SoundDataChunk { + UInt32 ckID; + SInt32 ckSize; + UInt32 offset; + UInt32 blockSize; +}; +typedef struct SoundDataChunk SoundDataChunk; +typedef SoundDataChunk * SoundDataChunkPtr; +struct Marker { + MarkerIdType id; + UInt32 position; + Str255 markerName; +}; +typedef struct Marker Marker; +struct MarkerChunk { + UInt32 ckID; + SInt32 ckSize; + UInt16 numMarkers; + Marker Markers[1]; +}; +typedef struct MarkerChunk MarkerChunk; +typedef MarkerChunk * MarkerChunkPtr; +struct AIFFLoop { + SInt16 playMode; + MarkerIdType beginLoop; + MarkerIdType endLoop; +}; +typedef struct AIFFLoop AIFFLoop; +struct InstrumentChunk { + UInt32 ckID; + SInt32 ckSize; + UInt8 baseFrequency; + UInt8 detune; + UInt8 lowFrequency; + UInt8 highFrequency; + UInt8 lowVelocity; + UInt8 highVelocity; + SInt16 gain; + AIFFLoop sustainLoop; + AIFFLoop releaseLoop; +}; +typedef struct InstrumentChunk InstrumentChunk; +typedef InstrumentChunk * InstrumentChunkPtr; +struct MIDIDataChunk { + UInt32 ckID; + SInt32 ckSize; + UInt8 MIDIdata[1]; +}; +typedef struct MIDIDataChunk MIDIDataChunk; +typedef MIDIDataChunk * MIDIDataChunkPtr; +struct AudioRecordingChunk { + UInt32 ckID; + SInt32 ckSize; + UInt8 AESChannelStatus[24]; +}; +typedef struct AudioRecordingChunk AudioRecordingChunk; +typedef AudioRecordingChunk * AudioRecordingChunkPtr; +struct ApplicationSpecificChunk { + UInt32 ckID; + SInt32 ckSize; + OSType applicationSignature; + UInt8 data[1]; +}; +typedef struct ApplicationSpecificChunk ApplicationSpecificChunk; +typedef ApplicationSpecificChunk * ApplicationSpecificChunkPtr; +struct Comment { + UInt32 timeStamp; + MarkerIdType marker; + UInt16 count; + char text[1]; +}; +typedef struct Comment Comment; +struct CommentsChunk { + UInt32 ckID; + SInt32 ckSize; + UInt16 numComments; + Comment comments[1]; +}; +typedef struct CommentsChunk CommentsChunk; +typedef CommentsChunk * CommentsChunkPtr; +struct TextChunk { + UInt32 ckID; + SInt32 ckSize; + char text[1]; +}; +typedef struct TextChunk TextChunk; +typedef TextChunk * TextChunkPtr; + + + + +enum { + kTECAvailableEncodingsResType = 'cven', + kTECAvailableSniffersResType = 'cvsf', + kTECSubTextEncodingsResType = 'cvsb', + kTECConversionInfoResType = 'cvif', + kTECMailEncodingsResType = 'cvml', + kTECWebEncodingsResType = 'cvwb', + kTECInternetNamesResType = 'cvmm' +}; + +enum { + kTECPluginType = 'ecpg', + kTECPluginCreator = 'encv', + kTECPluginOneToOne = 'otoo', + kTECPluginOneToMany = 'otom', + kTECPluginManyToOne = 'mtoo', + kTECPluginSniffObj = 'snif' +}; + +enum { + verUnspecified = 32767, + kTECResourceID = 128 +}; +struct TextEncodingRec { + UInt32 base; + UInt32 variant; + UInt32 format; +}; +typedef struct TextEncodingRec TextEncodingRec; + +struct TECEncodingsListRec { + UInt32 count; + TextEncodingRec encodings; +}; +typedef struct TECEncodingsListRec TECEncodingsListRec; +typedef TECEncodingsListRec * TECEncodingsListPtr; +typedef TECEncodingsListPtr * TECEncodingsListHandle; + +struct TECSubTextEncodingRec { + UInt32 offset; + TextEncodingRec searchEncoding; + UInt32 count; + TextEncodingRec subEncodings; +}; +typedef struct TECSubTextEncodingRec TECSubTextEncodingRec; +struct TECSubTextEncodingsRec { + UInt32 count; + TECSubTextEncodingRec subTextEncodingRec; +}; +typedef struct TECSubTextEncodingsRec TECSubTextEncodingsRec; +typedef TECSubTextEncodingsRec * TECSubTextEncodingsPtr; +typedef TECSubTextEncodingsPtr * TECSubTextEncodingsHandle; + +struct TECEncodingPairRec { + TextEncodingRec source; + TextEncodingRec dest; +}; +typedef struct TECEncodingPairRec TECEncodingPairRec; +struct TECEncodingPairs { + TECEncodingPairRec encodingPair; + UInt32 flags; + UInt32 speed; +}; +typedef struct TECEncodingPairs TECEncodingPairs; +struct TECEncodingPairsRec { + UInt32 count; + TECEncodingPairs encodingPairs; +}; +typedef struct TECEncodingPairsRec TECEncodingPairsRec; +typedef TECEncodingPairsRec * TECEncodingPairsPtr; +typedef TECEncodingPairsPtr * TECEncodingPairsHandle; + +struct TECLocaleListToEncodingListRec { + UInt32 offset; + UInt32 count; + RegionCode locales; + +}; +typedef struct TECLocaleListToEncodingListRec TECLocaleListToEncodingListRec; +typedef TECLocaleListToEncodingListRec * TECLocaleListToEncodingListPtr; +struct TECLocaleToEncodingsListRec { + UInt32 count; + TECLocaleListToEncodingListRec localeListToEncodingList; +}; +typedef struct TECLocaleToEncodingsListRec TECLocaleToEncodingsListRec; +typedef TECLocaleToEncodingsListRec * TECLocaleToEncodingsListPtr; +typedef TECLocaleToEncodingsListPtr * TECLocaleToEncodingsListHandle; + +struct TECInternetNameRec { + UInt32 offset; + TextEncodingRec searchEncoding; + UInt8 encodingNameLength; + UInt8 encodingName[1]; +}; +typedef struct TECInternetNameRec TECInternetNameRec; +struct TECInternetNamesRec { + UInt32 count; + TECInternetNameRec InternetNames; +}; +typedef struct TECInternetNamesRec TECInternetNamesRec; +typedef TECInternetNamesRec * TECInternetNamesPtr; +typedef TECInternetNamesPtr * TECInternetNamesHandle; + +struct TECBufferContextRec { + ConstTextPtr textInputBuffer; + ConstTextPtr textInputBufferEnd; + TextPtr textOutputBuffer; + TextPtr textOutputBufferEnd; + + ConstTextEncodingRunPtr encodingInputBuffer; + ConstTextEncodingRunPtr encodingInputBufferEnd; + TextEncodingRunPtr encodingOutputBuffer; + TextEncodingRunPtr encodingOutputBufferEnd; +}; +typedef struct TECBufferContextRec TECBufferContextRec; +struct TECPluginStateRec { + + UInt8 state1; + UInt8 state2; + UInt8 state3; + UInt8 state4; + + UInt32 longState1; + UInt32 longState2; + UInt32 longState3; + UInt32 longState4; +}; +typedef struct TECPluginStateRec TECPluginStateRec; +struct TECConverterContextRec { + + + Ptr pluginRec; + TextEncoding sourceEncoding; + TextEncoding destEncoding; + UInt32 reserved1; + UInt32 reserved2; + TECBufferContextRec bufferContext; + + URefCon contextRefCon; + ProcPtr conversionProc; + ProcPtr flushProc; + ProcPtr clearContextInfoProc; + UInt32 options1; + UInt32 options2; + TECPluginStateRec pluginState; +}; +typedef struct TECConverterContextRec TECConverterContextRec; +struct TECSnifferContextRec { + + Ptr pluginRec; + TextEncoding encoding; + ItemCount maxErrors; + ItemCount maxFeatures; + ConstTextPtr textInputBuffer; + ConstTextPtr textInputBufferEnd; + ItemCount numFeatures; + ItemCount numErrors; + + URefCon contextRefCon; + ProcPtr sniffProc; + ProcPtr clearContextInfoProc; + TECPluginStateRec pluginState; +}; +typedef struct TECSnifferContextRec TECSnifferContextRec; + + + + + + +typedef OSStatus ( * TECPluginNewEncodingConverterPtr)(TECObjectRef *newEncodingConverter, TECConverterContextRec *plugContext, TextEncoding inputEncoding, TextEncoding outputEncoding); +typedef OSStatus ( * TECPluginClearContextInfoPtr)(TECObjectRef encodingConverter, TECConverterContextRec *plugContext); +typedef OSStatus ( * TECPluginConvertTextEncodingPtr)(TECObjectRef encodingConverter, TECConverterContextRec *plugContext); +typedef OSStatus ( * TECPluginFlushConversionPtr)(TECObjectRef encodingConverter, TECConverterContextRec *plugContext); +typedef OSStatus ( * TECPluginDisposeEncodingConverterPtr)(TECObjectRef newEncodingConverter, TECConverterContextRec *plugContext); +typedef OSStatus ( * TECPluginNewEncodingSnifferPtr)(TECSnifferObjectRef *encodingSniffer, TECSnifferContextRec *snifContext, TextEncoding inputEncoding); +typedef OSStatus ( * TECPluginClearSnifferContextInfoPtr)(TECSnifferObjectRef encodingSniffer, TECSnifferContextRec *snifContext); +typedef OSStatus ( * TECPluginSniffTextEncodingPtr)(TECSnifferObjectRef encodingSniffer, TECSnifferContextRec *snifContext); +typedef OSStatus ( * TECPluginDisposeEncodingSnifferPtr)(TECSnifferObjectRef encodingSniffer, TECSnifferContextRec *snifContext); +typedef OSStatus ( * TECPluginGetCountAvailableTextEncodingsPtr)(TextEncoding *availableEncodings, ItemCount maxAvailableEncodings, ItemCount *actualAvailableEncodings); +typedef OSStatus ( * TECPluginGetCountAvailableTextEncodingPairsPtr)(TECConversionInfo *availableEncodings, ItemCount maxAvailableEncodings, ItemCount *actualAvailableEncodings); +typedef OSStatus ( * TECPluginGetCountDestinationTextEncodingsPtr)(TextEncoding inputEncoding, TextEncoding *destinationEncodings, ItemCount maxDestinationEncodings, ItemCount *actualDestinationEncodings); +typedef OSStatus ( * TECPluginGetCountSubTextEncodingsPtr)(TextEncoding inputEncoding, TextEncoding subEncodings[], ItemCount maxSubEncodings, ItemCount *actualSubEncodings); +typedef OSStatus ( * TECPluginGetCountAvailableSniffersPtr)(TextEncoding *availableEncodings, ItemCount maxAvailableEncodings, ItemCount *actualAvailableEncodings); +typedef OSStatus ( * TECPluginGetTextEncodingInternetNamePtr)(TextEncoding textEncoding, Str255 encodingName); +typedef OSStatus ( * TECPluginGetTextEncodingFromInternetNamePtr)(TextEncoding *textEncoding, ConstStr255Param encodingName); +typedef OSStatus ( * TECPluginGetCountWebEncodingsPtr)(TextEncoding *availableEncodings, ItemCount maxAvailableEncodings, ItemCount *actualAvailableEncodings); +typedef OSStatus ( * TECPluginGetCountMailEncodingsPtr)(TextEncoding *availableEncodings, ItemCount maxAvailableEncodings, ItemCount *actualAvailableEncodings); + + + + + + +enum { + kTECPluginDispatchTableVersion1 = 0x00010000, + kTECPluginDispatchTableVersion1_1 = 0x00010001, + kTECPluginDispatchTableVersion1_2 = 0x00010002, + kTECPluginDispatchTableCurrentVersion = kTECPluginDispatchTableVersion1_2 +}; + +struct TECPluginDispatchTable { + + TECPluginVersion version; + TECPluginVersion compatibleVersion; + TECPluginSignature PluginID; + + TECPluginNewEncodingConverterPtr PluginNewEncodingConverter; + TECPluginClearContextInfoPtr PluginClearContextInfo; + TECPluginConvertTextEncodingPtr PluginConvertTextEncoding; + TECPluginFlushConversionPtr PluginFlushConversion; + TECPluginDisposeEncodingConverterPtr PluginDisposeEncodingConverter; + + TECPluginNewEncodingSnifferPtr PluginNewEncodingSniffer; + TECPluginClearSnifferContextInfoPtr PluginClearSnifferContextInfo; + TECPluginSniffTextEncodingPtr PluginSniffTextEncoding; + TECPluginDisposeEncodingSnifferPtr PluginDisposeEncodingSniffer; + + TECPluginGetCountAvailableTextEncodingsPtr PluginGetCountAvailableTextEncodings; + TECPluginGetCountAvailableTextEncodingPairsPtr PluginGetCountAvailableTextEncodingPairs; + TECPluginGetCountDestinationTextEncodingsPtr PluginGetCountDestinationTextEncodings; + TECPluginGetCountSubTextEncodingsPtr PluginGetCountSubTextEncodings; + TECPluginGetCountAvailableSniffersPtr PluginGetCountAvailableSniffers; + TECPluginGetCountWebEncodingsPtr PluginGetCountWebTextEncodings; + TECPluginGetCountMailEncodingsPtr PluginGetCountMailTextEncodings; + + TECPluginGetTextEncodingInternetNamePtr PluginGetTextEncodingInternetName; + TECPluginGetTextEncodingFromInternetNamePtr PluginGetTextEncodingFromInternetName; + +}; +typedef struct TECPluginDispatchTable TECPluginDispatchTable; +typedef TECPluginDispatchTable * ( * TECPluginGetPluginDispatchTablePtr)(void); + + + + + + + + + + + + +typedef ResType DescType; +typedef FourCharCode AEKeyword; + + +enum { + typeBoolean = 'bool', + typeChar = 'TEXT' +}; + + + + + +enum { + typeStyledUnicodeText = 'sutx', + typeEncodedString = 'encs', + typeUnicodeText = 'utxt', + typeCString = 'cstr', + typePString = 'pstr' +}; + + + + +enum { + typeUTF16ExternalRepresentation = 'ut16', + typeUTF8Text = 'utf8' +}; + + +enum { + typeSInt16 = 'shor', + typeUInt16 = 'ushr', + typeSInt32 = 'long', + typeUInt32 = 'magn', + typeSInt64 = 'comp', + typeUInt64 = 'ucom', + typeIEEE32BitFloatingPoint = 'sing', + typeIEEE64BitFloatingPoint = 'doub', + type128BitFloatingPoint = 'ldbl', + typeDecimalStruct = 'decm' +}; +enum { + typeAEList = 'list', + typeAERecord = 'reco', + typeAppleEvent = 'aevt', + typeEventRecord = 'evrc', + typeTrue = 'true', + typeFalse = 'fals', + typeAlias = 'alis', + typeEnumerated = 'enum', + typeType = 'type', + typeAppParameters = 'appa', + typeProperty = 'prop', + typeFSRef = 'fsrf', + typeFileURL = 'furl', + typeBookmarkData = 'bmrk', + typeKeyword = 'keyw', + typeSectionH = 'sect', + typeWildCard = '****', + typeApplSignature = 'sign', + typeQDRectangle = 'qdrt', + typeFixed = 'fixd', + typeProcessSerialNumber = 'psn ', + typeApplicationURL = 'aprl', + typeNull = 'null' +}; +enum { + typeCFAttributedStringRef = 'cfas', + typeCFMutableAttributedStringRef = 'cfaa', + typeCFStringRef = 'cfst', + typeCFMutableStringRef = 'cfms', + typeCFArrayRef = 'cfar', + typeCFMutableArrayRef = 'cfma', + typeCFDictionaryRef = 'cfdc', + typeCFMutableDictionaryRef = 'cfmd', + typeCFNumberRef = 'cfnb', + typeCFBooleanRef = 'cftf', + typeCFTypeRef = 'cfty' +}; + + +enum { + typeKernelProcessID = 'kpid', + typeMachPort = 'port' +}; + + +enum { + typeAuditToken = 'tokn', +}; + + +enum { + typeApplicationBundleID = 'bund' +}; + + +enum { + keyTransactionIDAttr = 'tran', + keyReturnIDAttr = 'rtid', + keyEventClassAttr = 'evcl', + keyEventIDAttr = 'evid', + keyAddressAttr = 'addr', + keyOptionalKeywordAttr = 'optk', + keyTimeoutAttr = 'timo', + keyInteractLevelAttr = 'inte', + keyEventSourceAttr = 'esrc', + keyMissedKeywordAttr = 'miss', + keyOriginalAddressAttr = 'from', + keyAcceptTimeoutAttr = 'actm', + keyReplyRequestedAttr = 'repq', + + keySenderEUIDAttr = 'seid', + keySenderEGIDAttr = 'sgid', + keySenderUIDAttr = 'uids', + keySenderGIDAttr = 'gids', + keySenderPIDAttr = 'spid', + keySenderAuditTokenAttr = 'tokn', + + + keySenderApplescriptEntitlementsAttr = 'entl', + keySenderApplicationIdentifierEntitlementAttr = 'aiea', + keySenderApplicationSandboxed = 'sssb', + keyActualSenderAuditToken = 'acat', + +}; + + +enum { + kAEDebugPOSTHeader = (1 << 0), + kAEDebugReplyHeader = (1 << 1), + kAEDebugXMLRequest = (1 << 2), + kAEDebugXMLResponse = (1 << 3), + kAEDebugXMLDebugAll = (int)0xFFFFFFFF +}; + + + + + +enum { + kSOAP1999Schema = 'ss99', + kSOAP2001Schema = 'ss01' +}; + +enum { + + keyUserNameAttr = 'unam', + keyUserPasswordAttr = 'pass', + keyDisableAuthenticationAttr = 'auth', + + + keyXMLDebuggingAttr = 'xdbg', + + kAERPCClass = 'rpc ', + kAEXMLRPCScheme = 'RPC2', + kAESOAPScheme = 'SOAP', + kAESharedScriptHandler = 'wscp', + + keyRPCMethodName = 'meth', + keyRPCMethodParam = 'parm', + keyRPCMethodParamOrder = '/ord', + + keyAEPOSTHeaderData = 'phed', + keyAEReplyHeaderData = 'rhed', + keyAEXMLRequestData = 'xreq', + keyAEXMLReplyData = 'xrep', + + keyAdditionalHTTPHeaders = 'ahed', + keySOAPAction = 'sact', + keySOAPMethodNameSpace = 'mspc', + keySOAPMethodNameSpaceURI = 'mspu', + keySOAPSchemaVersion = 'ssch' +}; +enum { + keySOAPStructureMetaData = '/smd', + keySOAPSMDNamespace = 'ssns', + keySOAPSMDNamespaceURI = 'ssnu', + keySOAPSMDType = 'sstp' +}; + + + + + + +enum { + + kAEUseHTTPProxyAttr = 'xupr', + + kAEHTTPProxyPortAttr = 'xhtp', + kAEHTTPProxyHostAttr = 'xhth' +}; + + + + + + +enum { + kAESocks4Protocol = 4, + kAESocks5Protocol = 5 +}; + +enum { + kAEUseSocksAttr = 'xscs', + + kAESocksProxyAttr = 'xsok', + + kAESocksHostAttr = 'xshs', + kAESocksPortAttr = 'xshp', + kAESocksUserAttr = 'xshu', + + kAESocksPasswordAttr = 'xshw' +}; + + + +enum { + kAEDescListFactorNone = 0, + kAEDescListFactorType = 4, + kAEDescListFactorTypeAndSize = 8 +}; + + +enum { + + kAutoGenerateReturnID = -1, + + kAnyTransactionID = 0 +}; + + +typedef struct OpaqueAEDataStorageType* AEDataStorageType; + + + + +typedef AEDataStorageType * AEDataStorage; +struct AEDesc { + DescType descriptorType; + AEDataStorage dataHandle; +}; +typedef struct AEDesc AEDesc; +typedef AEDesc * AEDescPtr; +struct AEKeyDesc { + AEKeyword descKey; + AEDesc descContent; +}; +typedef struct AEKeyDesc AEKeyDesc; + + +typedef AEDesc AEDescList; + +typedef AEDescList AERecord; + +typedef AEDesc AEAddressDesc; + +typedef AERecord AppleEvent; +typedef AppleEvent * AppleEventPtr; +typedef SInt16 AEReturnID; +typedef SInt32 AETransactionID; +typedef FourCharCode AEEventClass; +typedef FourCharCode AEEventID; +typedef SInt8 AEArrayType; +enum { + kAEDataArray = 0, + kAEPackedArray = 1, + kAEDescArray = 3, + kAEKeyDescArray = 4 +}; + + +enum { + kAEHandleArray = 2 +}; + +union AEArrayData { + SInt16 kAEDataArray[1]; + char kAEPackedArray[1]; + Handle kAEHandleArray[1]; + AEDesc kAEDescArray[1]; + AEKeyDesc kAEKeyDescArray[1]; +}; +typedef union AEArrayData AEArrayData; +typedef AEArrayData * AEArrayDataPointer; + + + + +typedef SInt16 AESendPriority; +enum { + kAENormalPriority = 0x00000000, + kAEHighPriority = 0x00000001 +}; + + +typedef SInt32 AESendMode; +enum { + kAENoReply = 0x00000001, + kAEQueueReply = 0x00000002, + kAEWaitReply = 0x00000003, + kAEDontReconnect = 0x00000080, + kAEWantReceipt = 0x00000200, + kAENeverInteract = 0x00000010, + kAECanInteract = 0x00000020, + kAEAlwaysInteract = 0x00000030, + kAECanSwitchLayer = 0x00000040, + kAEDontRecord = 0x00001000, + kAEDontExecute = 0x00002000, + kAEProcessNonReplyEvents = 0x00008000, + kAEDoNotAutomaticallyAddAnnotationsToEvent = 0x00010000 +}; + + + +enum { + kAEDefaultTimeout = -1, + kNoTimeOut = -2 +}; + + + + + +typedef OSErr ( * AECoerceDescProcPtr)(const AEDesc *fromDesc, DescType toType, SRefCon handlerRefcon, AEDesc *toDesc); +typedef OSErr ( * AECoercePtrProcPtr)(DescType typeCode, const void *dataPtr, Size dataSize, DescType toType, SRefCon handlerRefcon, AEDesc *result); +typedef AECoerceDescProcPtr AECoerceDescUPP; +typedef AECoercePtrProcPtr AECoercePtrUPP; +extern AECoerceDescUPP +NewAECoerceDescUPP(AECoerceDescProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0))); +extern AECoercePtrUPP +NewAECoercePtrUPP(AECoercePtrProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0))); +extern void +DisposeAECoerceDescUPP(AECoerceDescUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern void +DisposeAECoercePtrUPP(AECoercePtrUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +InvokeAECoerceDescUPP( + const AEDesc * fromDesc, + DescType toType, + SRefCon handlerRefcon, + AEDesc * toDesc, + AECoerceDescUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +InvokeAECoercePtrUPP( + DescType typeCode, + const void * dataPtr, + Size dataSize, + DescType toType, + SRefCon handlerRefcon, + AEDesc * result, + AECoercePtrUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +typedef AECoerceDescUPP AECoercionHandlerUPP; +extern OSErr +AEInstallCoercionHandler( + DescType fromType, + DescType toType, + AECoercionHandlerUPP handler, + SRefCon handlerRefcon, + Boolean fromTypeIsDesc, + Boolean isSysHandler) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AERemoveCoercionHandler( + DescType fromType, + DescType toType, + AECoercionHandlerUPP handler, + Boolean isSysHandler) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEGetCoercionHandler( + DescType fromType, + DescType toType, + AECoercionHandlerUPP * handler, + SRefCon * handlerRefcon, + Boolean * fromTypeIsDesc, + Boolean isSysHandler) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AECoercePtr( + DescType typeCode, + const void * dataPtr, + Size dataSize, + DescType toType, + AEDesc * result) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AECoerceDesc( + const AEDesc * theAEDesc, + DescType toType, + AEDesc * result) __attribute__((availability(macosx,introduced=10.0))); +extern void +AEInitializeDesc(AEDesc * desc) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AECreateDesc( + DescType typeCode, + const void * dataPtr, + Size dataSize, + AEDesc * result) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEDisposeDesc(AEDesc * theAEDesc) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEDuplicateDesc( + const AEDesc * theAEDesc, + AEDesc * result) __attribute__((availability(macosx,introduced=10.0))); + + + +typedef void ( * AEDisposeExternalProcPtr)(const void *dataPtr, Size dataLength, SRefCon refcon); +typedef AEDisposeExternalProcPtr AEDisposeExternalUPP; +extern OSStatus +AECreateDescFromExternalPtr( + OSType descriptorType, + const void * dataPtr, + Size dataLength, + AEDisposeExternalUPP disposeCallback, + SRefCon disposeRefcon, + AEDesc * theDesc) __attribute__((availability(macosx,introduced=10.2))); + extern OSStatus + AECompareDesc( const AEDesc * desc1, const AEDesc* desc2, Boolean* resultP ) __attribute__((availability(macosx,introduced=10.8))); +extern OSErr +AECreateList( + const void * factoringPtr, + Size factoredSize, + Boolean isRecord, + AEDescList * resultList) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AECountItems( + const AEDescList * theAEDescList, + long * theCount) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEPutPtr( + AEDescList * theAEDescList, + long index, + DescType typeCode, + const void * dataPtr, + Size dataSize) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEPutDesc( + AEDescList * theAEDescList, + long index, + const AEDesc * theAEDesc) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEGetNthPtr( + const AEDescList * theAEDescList, + long index, + DescType desiredType, + AEKeyword * theAEKeyword, + DescType * typeCode, + void * dataPtr, + Size maximumSize, + Size * actualSize) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEGetNthDesc( + const AEDescList * theAEDescList, + long index, + DescType desiredType, + AEKeyword * theAEKeyword, + AEDesc * result) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AESizeOfNthItem( + const AEDescList * theAEDescList, + long index, + DescType * typeCode, + Size * dataSize) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEGetArray( + const AEDescList * theAEDescList, + AEArrayType arrayType, + AEArrayDataPointer arrayPtr, + Size maximumSize, + DescType * itemType, + Size * itemSize, + long * itemCount) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEPutArray( + AEDescList * theAEDescList, + AEArrayType arrayType, + const AEArrayData * arrayPtr, + DescType itemType, + Size itemSize, + long itemCount) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEDeleteItem( + AEDescList * theAEDescList, + long index) __attribute__((availability(macosx,introduced=10.0))); +extern Boolean +AECheckIsRecord(const AEDesc * theDesc) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AECreateAppleEvent( + AEEventClass theAEEventClass, + AEEventID theAEEventID, + const AEAddressDesc * target, + AEReturnID returnID, + AETransactionID transactionID, + AppleEvent * result) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEPutParamPtr( + AppleEvent * theAppleEvent, + AEKeyword theAEKeyword, + DescType typeCode, + const void * dataPtr, + Size dataSize) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEPutParamDesc( + AppleEvent * theAppleEvent, + AEKeyword theAEKeyword, + const AEDesc * theAEDesc) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEGetParamPtr( + const AppleEvent * theAppleEvent, + AEKeyword theAEKeyword, + DescType desiredType, + DescType * actualType, + void * dataPtr, + Size maximumSize, + Size * actualSize) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEGetParamDesc( + const AppleEvent * theAppleEvent, + AEKeyword theAEKeyword, + DescType desiredType, + AEDesc * result) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AESizeOfParam( + const AppleEvent * theAppleEvent, + AEKeyword theAEKeyword, + DescType * typeCode, + Size * dataSize) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEDeleteParam( + AppleEvent * theAppleEvent, + AEKeyword theAEKeyword) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEGetAttributePtr( + const AppleEvent * theAppleEvent, + AEKeyword theAEKeyword, + DescType desiredType, + DescType * typeCode, + void * dataPtr, + Size maximumSize, + Size * actualSize) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEGetAttributeDesc( + const AppleEvent * theAppleEvent, + AEKeyword theAEKeyword, + DescType desiredType, + AEDesc * result) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AESizeOfAttribute( + const AppleEvent * theAppleEvent, + AEKeyword theAEKeyword, + DescType * typeCode, + Size * dataSize) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEPutAttributePtr( + AppleEvent * theAppleEvent, + AEKeyword theAEKeyword, + DescType typeCode, + const void * dataPtr, + Size dataSize) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEPutAttributeDesc( + AppleEvent * theAppleEvent, + AEKeyword theAEKeyword, + const AEDesc * theAEDesc) __attribute__((availability(macosx,introduced=10.0))); +extern Size +AESizeOfFlattenedDesc(const AEDesc * theAEDesc) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEFlattenDesc( + const AEDesc * theAEDesc, + Ptr buffer, + Size bufferSize, + Size * actualSize) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEUnflattenDesc( + const void * buffer, + AEDesc * result) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEGetDescData( + const AEDesc * theAEDesc, + void * dataPtr, + Size maximumSize) __attribute__((availability(macosx,introduced=10.0))); +extern Size +AEGetDescDataSize(const AEDesc * theAEDesc) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEReplaceDescData( + DescType typeCode, + const void * dataPtr, + Size dataSize, + AEDesc * theAEDesc) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEGetDescDataRange( + const AEDesc * dataDesc, + void * buffer, + Size offset, + Size length) __attribute__((availability(macosx,introduced=10.2))); + + + + + +typedef OSErr ( * AEEventHandlerProcPtr)(const AppleEvent *theAppleEvent, AppleEvent *reply, SRefCon handlerRefcon); +typedef AEEventHandlerProcPtr AEEventHandlerUPP; +extern AEDisposeExternalUPP +NewAEDisposeExternalUPP(AEDisposeExternalProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.2))); +extern AEEventHandlerUPP +NewAEEventHandlerUPP(AEEventHandlerProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0))); +extern void +DisposeAEDisposeExternalUPP(AEDisposeExternalUPP userUPP) __attribute__((availability(macosx,introduced=10.2))); +extern void +DisposeAEEventHandlerUPP(AEEventHandlerUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern void +InvokeAEDisposeExternalUPP( + const void * dataPtr, + Size dataLength, + SRefCon refcon, + AEDisposeExternalUPP userUPP) __attribute__((availability(macosx,introduced=10.2))); +extern OSErr +InvokeAEEventHandlerUPP( + const AppleEvent * theAppleEvent, + AppleEvent * reply, + SRefCon handlerRefcon, + AEEventHandlerUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); + + + + +enum { + + keyDirectObject = '----', + keyErrorNumber = 'errn', + keyErrorString = 'errs', + keyProcessSerialNumber = 'psn ', + keyPreDispatch = 'phac', + keySelectProc = 'selh', + + keyAERecorderCount = 'recr', + + keyAEVersion = 'vers' +}; + + +enum { + kCoreEventClass = 'aevt' +}; + + +enum { + kAEOpenApplication = 'oapp', + kAEOpenDocuments = 'odoc', + kAEPrintDocuments = 'pdoc', + kAEOpenContents = 'ocon', + kAEQuitApplication = 'quit', + kAEAnswer = 'ansr', + kAEApplicationDied = 'obit', + kAEShowPreferences = 'pref' +}; + + +enum { + kAEStartRecording = 'reca', + kAEStopRecording = 'recc', + kAENotifyStartRecording = 'rec1', + kAENotifyStopRecording = 'rec0', + kAENotifyRecording = 'recr' +}; +typedef SInt8 AEEventSource; +enum { + kAEUnknownSource = 0, + kAEDirectCall = 1, + kAESameProcess = 2, + kAELocalProcess = 3, + kAERemoteProcess = 4 +}; + + + + enum { + errAETargetAddressNotPermitted = -1742, + errAEEventNotPermitted = -1743, + }; +extern OSErr +AEInstallEventHandler( + AEEventClass theAEEventClass, + AEEventID theAEEventID, + AEEventHandlerUPP handler, + SRefCon handlerRefcon, + Boolean isSysHandler) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AERemoveEventHandler( + AEEventClass theAEEventClass, + AEEventID theAEEventID, + AEEventHandlerUPP handler, + Boolean isSysHandler) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEGetEventHandler( + AEEventClass theAEEventClass, + AEEventID theAEEventID, + AEEventHandlerUPP * handler, + SRefCon * handlerRefcon, + Boolean isSysHandler) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEInstallSpecialHandler( + AEKeyword functionClass, + AEEventHandlerUPP handler, + Boolean isSysHandler) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AERemoveSpecialHandler( + AEKeyword functionClass, + AEEventHandlerUPP handler, + Boolean isSysHandler) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEGetSpecialHandler( + AEKeyword functionClass, + AEEventHandlerUPP * handler, + Boolean isSysHandler) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEManagerInfo( + AEKeyword keyWord, + long * result) __attribute__((availability(macosx,introduced=10.0))); +extern const CFStringRef kAERemoteProcessURLKey __attribute__((availability(macosx,introduced=10.3))); +extern const CFStringRef kAERemoteProcessNameKey __attribute__((availability(macosx,introduced=10.3))); +extern const CFStringRef kAERemoteProcessUserIDKey __attribute__((availability(macosx,introduced=10.3))); +extern const CFStringRef kAERemoteProcessProcessIDKey __attribute__((availability(macosx,introduced=10.3))); +struct AERemoteProcessResolverContext { + + + + + CFIndex version; + + + + + void * info; + + + + + CFAllocatorRetainCallBack retain; + + + + + CFAllocatorReleaseCallBack release; + + + + + CFAllocatorCopyDescriptionCallBack copyDescription; +}; +typedef struct AERemoteProcessResolverContext AERemoteProcessResolverContext; +typedef struct AERemoteProcessResolver* AERemoteProcessResolverRef; +extern AERemoteProcessResolverRef +AECreateRemoteProcessResolver( + CFAllocatorRef allocator, + CFURLRef url) __attribute__((availability(macosx,introduced=10.3))); +extern void +AEDisposeRemoteProcessResolver(AERemoteProcessResolverRef ref) __attribute__((availability(macosx,introduced=10.3))); +extern CFArrayRef +AERemoteProcessResolverGetProcesses( + AERemoteProcessResolverRef ref, + CFStreamError * outError) __attribute__((availability(macosx,introduced=10.3))); +typedef void ( * AERemoteProcessResolverCallback)(AERemoteProcessResolverRef ref, void *info); +extern void +AERemoteProcessResolverScheduleWithRunLoop( + AERemoteProcessResolverRef ref, + CFRunLoopRef runLoop, + CFStringRef runLoopMode, + AERemoteProcessResolverCallback callback, + const AERemoteProcessResolverContext * ctx) __attribute__((availability(macosx,introduced=10.3))); + + + + + + + + + +extern OSErr +CreateOffsetDescriptor( + long theOffset, + AEDesc * theDescriptor) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +CreateCompDescriptor( + DescType comparisonOperator, + AEDesc * operand1, + AEDesc * operand2, + Boolean disposeInputs, + AEDesc * theDescriptor) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +CreateLogicalDescriptor( + AEDescList * theLogicalTerms, + DescType theLogicOperator, + Boolean disposeInputs, + AEDesc * theDescriptor) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +CreateObjSpecifier( + DescType desiredClass, + AEDesc * theContainer, + DescType keyForm, + AEDesc * keyData, + Boolean disposeInputs, + AEDesc * objSpecifier) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +CreateRangeDescriptor( + AEDesc * rangeStart, + AEDesc * rangeStop, + Boolean disposeInputs, + AEDesc * theDescriptor) __attribute__((availability(macosx,introduced=10.0))); + + + + +enum { + + kAEAND = 'AND ', + kAEOR = 'OR ', + kAENOT = 'NOT ', + + kAEFirst = 'firs', + kAELast = 'last', + kAEMiddle = 'midd', + kAEAny = 'any ', + kAEAll = 'all ', + + kAENext = 'next', + kAEPrevious = 'prev', + + keyAECompOperator = 'relo', + keyAELogicalTerms = 'term', + keyAELogicalOperator = 'logc', + keyAEObject1 = 'obj1', + keyAEObject2 = 'obj2', + + keyAEDesiredClass = 'want', + keyAEContainer = 'from', + keyAEKeyForm = 'form', + keyAEKeyData = 'seld' +}; + +enum { + + keyAERangeStart = 'star', + keyAERangeStop = 'stop', + + keyDisposeTokenProc = 'xtok', + keyAECompareProc = 'cmpr', + keyAECountProc = 'cont', + keyAEMarkTokenProc = 'mkid', + keyAEMarkProc = 'mark', + keyAEAdjustMarksProc = 'adjm', + keyAEGetErrDescProc = 'indc' +}; + + +enum { + + formAbsolutePosition = 'indx', + formRelativePosition = 'rele', + formTest = 'test', + formRange = 'rang', + formPropertyID = 'prop', + formName = 'name', + formUniqueID = 'ID ', +} + ; +enum { + + typeObjectSpecifier = 'obj ', + typeObjectBeingExamined = 'exmn', + typeCurrentContainer = 'ccnt', + typeToken = 'toke', + typeRelativeDescriptor = 'rel ', + typeAbsoluteOrdinal = 'abso', + typeIndexDescriptor = 'inde', + typeRangeDescriptor = 'rang', + typeLogicalDescriptor = 'logi', + typeCompDescriptor = 'cmpd', + typeOSLTokenList = 'ostl' +}; + + +enum { + kAEIDoMinimum = 0x0000, + kAEIDoWhose = 0x0001, + kAEIDoMarking = 0x0004, + kAEPassSubDescs = 0x0008, + kAEResolveNestedLists = 0x0010, + kAEHandleSimpleRanges = 0x0020, + kAEUseRelativeIterators = 0x0040 +}; + + +enum { + typeWhoseDescriptor = 'whos', + formWhose = 'whos', + typeWhoseRange = 'wrng', + keyAEWhoseRangeStart = 'wstr', + keyAEWhoseRangeStop = 'wstp', + keyAEIndex = 'kidx', + keyAETest = 'ktst' +}; + + + + + + + +struct ccntTokenRecord { + DescType tokenClass; + AEDesc token; +}; +typedef struct ccntTokenRecord ccntTokenRecord; +typedef ccntTokenRecord * ccntTokenRecPtr; +typedef ccntTokenRecPtr * ccntTokenRecHandle; + + + + + + +typedef OSErr ( * OSLAccessorProcPtr)(DescType desiredClass, const AEDesc *container, DescType containerClass, DescType form, const AEDesc *selectionData, AEDesc *value, SRefCon accessorRefcon); +typedef OSErr ( * OSLCompareProcPtr)(DescType oper, const AEDesc *obj1, const AEDesc *obj2, Boolean *result); +typedef OSErr ( * OSLCountProcPtr)(DescType desiredType, DescType containerClass, const AEDesc *container, long *result); +typedef OSErr ( * OSLDisposeTokenProcPtr)(AEDesc * unneededToken); +typedef OSErr ( * OSLGetMarkTokenProcPtr)(const AEDesc *dContainerToken, DescType containerClass, AEDesc *result); +typedef OSErr ( * OSLGetErrDescProcPtr)(AEDesc ** appDescPtr); +typedef OSErr ( * OSLMarkProcPtr)(const AEDesc *dToken, const AEDesc *markToken, long index); +typedef OSErr ( * OSLAdjustMarksProcPtr)(long newStart, long newStop, const AEDesc *markToken); +typedef OSLAccessorProcPtr OSLAccessorUPP; +typedef OSLCompareProcPtr OSLCompareUPP; +typedef OSLCountProcPtr OSLCountUPP; +typedef OSLDisposeTokenProcPtr OSLDisposeTokenUPP; +typedef OSLGetMarkTokenProcPtr OSLGetMarkTokenUPP; +typedef OSLGetErrDescProcPtr OSLGetErrDescUPP; +typedef OSLMarkProcPtr OSLMarkUPP; +typedef OSLAdjustMarksProcPtr OSLAdjustMarksUPP; +extern OSLAccessorUPP +NewOSLAccessorUPP(OSLAccessorProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0))); +extern OSLCompareUPP +NewOSLCompareUPP(OSLCompareProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0))); +extern OSLCountUPP +NewOSLCountUPP(OSLCountProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0))); +extern OSLDisposeTokenUPP +NewOSLDisposeTokenUPP(OSLDisposeTokenProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0))); +extern OSLGetMarkTokenUPP +NewOSLGetMarkTokenUPP(OSLGetMarkTokenProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0))); +extern OSLGetErrDescUPP +NewOSLGetErrDescUPP(OSLGetErrDescProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0))); +extern OSLMarkUPP +NewOSLMarkUPP(OSLMarkProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0))); +extern OSLAdjustMarksUPP +NewOSLAdjustMarksUPP(OSLAdjustMarksProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0))); +extern void +DisposeOSLAccessorUPP(OSLAccessorUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern void +DisposeOSLCompareUPP(OSLCompareUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern void +DisposeOSLCountUPP(OSLCountUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern void +DisposeOSLDisposeTokenUPP(OSLDisposeTokenUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern void +DisposeOSLGetMarkTokenUPP(OSLGetMarkTokenUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern void +DisposeOSLGetErrDescUPP(OSLGetErrDescUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern void +DisposeOSLMarkUPP(OSLMarkUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern void +DisposeOSLAdjustMarksUPP(OSLAdjustMarksUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +InvokeOSLAccessorUPP( + DescType desiredClass, + const AEDesc * container, + DescType containerClass, + DescType form, + const AEDesc * selectionData, + AEDesc * value, + SRefCon accessorRefcon, + OSLAccessorUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +InvokeOSLCompareUPP( + DescType oper, + const AEDesc * obj1, + const AEDesc * obj2, + Boolean * result, + OSLCompareUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +InvokeOSLCountUPP( + DescType desiredType, + DescType containerClass, + const AEDesc * container, + long * result, + OSLCountUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +InvokeOSLDisposeTokenUPP( + AEDesc * unneededToken, + OSLDisposeTokenUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +InvokeOSLGetMarkTokenUPP( + const AEDesc * dContainerToken, + DescType containerClass, + AEDesc * result, + OSLGetMarkTokenUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +InvokeOSLGetErrDescUPP( + AEDesc ** appDescPtr, + OSLGetErrDescUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +InvokeOSLMarkUPP( + const AEDesc * dToken, + const AEDesc * markToken, + long index, + OSLMarkUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +InvokeOSLAdjustMarksUPP( + long newStart, + long newStop, + const AEDesc * markToken, + OSLAdjustMarksUPP userUPP) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEObjectInit(void) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AESetObjectCallbacks( + OSLCompareUPP myCompareProc, + OSLCountUPP myCountProc, + OSLDisposeTokenUPP myDisposeTokenProc, + OSLGetMarkTokenUPP myGetMarkTokenProc, + OSLMarkUPP myMarkProc, + OSLAdjustMarksUPP myAdjustMarksProc, + OSLGetErrDescUPP myGetErrDescProcPtr) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEResolve( + const AEDesc * objectSpecifier, + short callbackFlags, + AEDesc * theToken) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEInstallObjectAccessor( + DescType desiredClass, + DescType containerType, + OSLAccessorUPP theAccessor, + SRefCon accessorRefcon, + Boolean isSysHandler) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AERemoveObjectAccessor( + DescType desiredClass, + DescType containerType, + OSLAccessorUPP theAccessor, + Boolean isSysHandler) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEGetObjectAccessor( + DescType desiredClass, + DescType containerType, + OSLAccessorUPP * accessor, + SRefCon * accessorRefcon, + Boolean isSysHandler) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AEDisposeToken(AEDesc * theToken) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AECallObjectAccessor( + DescType desiredClass, + const AEDesc * containerToken, + DescType containerClass, + DescType keyForm, + const AEDesc * keyData, + AEDesc * token) __attribute__((availability(macosx,introduced=10.0))); + + + + + + + +enum { + cAEList = 'list', + cApplication = 'capp', + cArc = 'carc', + cBoolean = 'bool', + cCell = 'ccel', + cChar = 'cha ', + cColorTable = 'clrt', + cColumn = 'ccol', + cDocument = 'docu', + cDrawingArea = 'cdrw', + cEnumeration = 'enum', + cFile = 'file', + cFixed = 'fixd', + cFixedPoint = 'fpnt', + cFixedRectangle = 'frct', + cGraphicLine = 'glin', + cGraphicObject = 'cgob', + cGraphicShape = 'cgsh', + cGraphicText = 'cgtx', + cGroupedGraphic = 'cpic' +}; + +enum { + cInsertionLoc = 'insl', + cInsertionPoint = 'cins', + cIntlText = 'itxt', + cIntlWritingCode = 'intl', + cItem = 'citm', + cLine = 'clin', + cLongDateTime = 'ldt ', + cLongFixed = 'lfxd', + cLongFixedPoint = 'lfpt', + cLongFixedRectangle = 'lfrc', + cLongInteger = 'long', + cLongPoint = 'lpnt', + cLongRectangle = 'lrct', + cMachineLoc = 'mLoc', + cMenu = 'cmnu', + cMenuItem = 'cmen', + cObject = 'cobj', + cObjectSpecifier = 'obj ', + cOpenableObject = 'coob', + cOval = 'covl' +}; + +enum { + cParagraph = 'cpar', + cPICT = 'PICT', + cPixel = 'cpxl', + cPixelMap = 'cpix', + cPolygon = 'cpgn', + cProperty = 'prop', + cQDPoint = 'QDpt', + cQDRectangle = 'qdrt', + cRectangle = 'crec', + cRGBColor = 'cRGB', + cRotation = 'trot', + cRoundedRectangle = 'crrc', + cRow = 'crow', + cSelection = 'csel', + cShortInteger = 'shor', + cTable = 'ctbl', + cText = 'ctxt', + cTextFlow = 'cflo', + cTextStyles = 'tsty', + cType = 'type' +}; + +enum { + cVersion = 'vers', + cWindow = 'cwin', + cWord = 'cwor', + enumArrows = 'arro', + enumJustification = 'just', + enumKeyForm = 'kfrm', + enumPosition = 'posi', + enumProtection = 'prtn', + enumQuality = 'qual', + enumSaveOptions = 'savo', + enumStyle = 'styl', + enumTransferMode = 'tran', + kAEAbout = 'abou', + kAEAfter = 'afte', + kAEAliasSelection = 'sali', + kAEAllCaps = 'alcp', + kAEArrowAtEnd = 'aren', + kAEArrowAtStart = 'arst', + kAEArrowBothEnds = 'arbo' +}; + +enum { + kAEAsk = 'ask ', + kAEBefore = 'befo', + kAEBeginning = 'bgng', + kAEBeginsWith = 'bgwt', + kAEBeginTransaction = 'begi', + kAEBold = 'bold', + kAECaseSensEquals = 'cseq', + kAECentered = 'cent', + kAEChangeView = 'view', + kAEClone = 'clon', + kAEClose = 'clos', + kAECondensed = 'cond', + kAEContains = 'cont', + kAECopy = 'copy', + kAECoreSuite = 'core', + kAECountElements = 'cnte', + kAECreateElement = 'crel', + kAECreatePublisher = 'cpub', + kAECut = 'cut ', + kAEDelete = 'delo' +}; + +enum { + kAEDoObjectsExist = 'doex', + kAEDoScript = 'dosc', + kAEDrag = 'drag', + kAEDuplicateSelection = 'sdup', + kAEEditGraphic = 'edit', + kAEEmptyTrash = 'empt', + kAEEnd = 'end ', + kAEEndsWith = 'ends', + kAEEndTransaction = 'endt', + kAEEquals = '= ', + kAEExpanded = 'pexp', + kAEFast = 'fast', + kAEFinderEvents = 'FNDR', + kAEFormulaProtect = 'fpro', + kAEFullyJustified = 'full', + kAEGetClassInfo = 'qobj', + kAEGetData = 'getd', + kAEGetDataSize = 'dsiz', + kAEGetEventInfo = 'gtei', + kAEGetInfoSelection = 'sinf' +}; + +enum { + kAEGetPrivilegeSelection = 'sprv', + kAEGetSuiteInfo = 'gtsi', + kAEGreaterThan = '> ', + kAEGreaterThanEquals = '>= ', + kAEGrow = 'grow', + kAEHidden = 'hidn', + kAEHiQuality = 'hiqu', + kAEImageGraphic = 'imgr', + kAEIsUniform = 'isun', + kAEItalic = 'ital', + kAELeftJustified = 'left', + kAELessThan = '< ', + kAELessThanEquals = '<= ', + kAELowercase = 'lowc', + kAEMakeObjectsVisible = 'mvis', + kAEMiscStandards = 'misc', + kAEModifiable = 'modf', + kAEMove = 'move', + kAENo = 'no ', + kAENoArrow = 'arno' +}; + +enum { + kAENonmodifiable = 'nmod', + kAEOpen = 'odoc', + kAEOpenSelection = 'sope', + kAEOutline = 'outl', + kAEPageSetup = 'pgsu', + kAEPaste = 'past', + kAEPlain = 'plan', + kAEPrint = 'pdoc', + kAEPrintSelection = 'spri', + kAEPrintWindow = 'pwin', + kAEPutAwaySelection = 'sput', + kAEQDAddOver = 'addo', + kAEQDAddPin = 'addp', + kAEQDAdMax = 'admx', + kAEQDAdMin = 'admn', + kAEQDBic = 'bic ', + kAEQDBlend = 'blnd', + kAEQDCopy = 'cpy ', + kAEQDNotBic = 'nbic', + kAEQDNotCopy = 'ncpy' +}; + +enum { + kAEQDNotOr = 'ntor', + kAEQDNotXor = 'nxor', + kAEQDOr = 'or ', + kAEQDSubOver = 'subo', + kAEQDSubPin = 'subp', + kAEQDSupplementalSuite = 'qdsp', + kAEQDXor = 'xor ', + kAEQuickdrawSuite = 'qdrw', + kAEQuitAll = 'quia', + kAERedo = 'redo', + kAERegular = 'regl', + kAEReopenApplication = 'rapp', + kAEReplace = 'rplc', + kAERequiredSuite = 'reqd', + kAERestart = 'rest', + kAERevealSelection = 'srev', + kAERevert = 'rvrt', + kAERightJustified = 'rght', + kAESave = 'save', + kAESelect = 'slct', + kAESetData = 'setd' +}; + +enum { + kAESetPosition = 'posn', + kAEShadow = 'shad', + kAEShowClipboard = 'shcl', + kAEShutDown = 'shut', + kAESleep = 'slep', + kAESmallCaps = 'smcp', + kAESpecialClassProperties = 'c@#!', + kAEStrikethrough = 'strk', + kAESubscript = 'sbsc', + kAESuperscript = 'spsc', + kAETableSuite = 'tbls', + kAETextSuite = 'TEXT', + kAETransactionTerminated = 'ttrm', + kAEUnderline = 'undl', + kAEUndo = 'undo', + kAEWholeWordEquals = 'wweq', + kAEYes = 'yes ', + kAEZoom = 'zoom' +}; + + +enum { + kAELogOut = 'logo', + kAEReallyLogOut = 'rlgo', + kAEShowRestartDialog = 'rrst', + kAEShowShutdownDialog = 'rsdn' +}; + + +enum { + kAEMouseClass = 'mous', + kAEDown = 'down', + kAEUp = 'up ', + kAEMoved = 'move', + kAEStoppedMoving = 'stop', + kAEWindowClass = 'wind', + kAEUpdate = 'updt', + kAEActivate = 'actv', + kAEDeactivate = 'dact', + kAECommandClass = 'cmnd', + kAEKeyClass = 'keyc', + kAERawKey = 'rkey', + kAEVirtualKey = 'keyc', + kAENavigationKey = 'nave', + kAEAutoDown = 'auto', + kAEApplicationClass = 'appl', + kAESuspend = 'susp', + kAEResume = 'rsme', + kAEDiskEvent = 'disk', + kAENullEvent = 'null', + kAEWakeUpEvent = 'wake', + kAEScrapEvent = 'scrp', + kAEHighLevel = 'high' +}; + +enum { + keyAEAngle = 'kang', + keyAEArcAngle = 'parc' +}; + +enum { + keyAEBaseAddr = 'badd', + keyAEBestType = 'pbst', + keyAEBgndColor = 'kbcl', + keyAEBgndPattern = 'kbpt', + keyAEBounds = 'pbnd', + keyAECellList = 'kclt', + keyAEClassID = 'clID', + keyAEColor = 'colr', + keyAEColorTable = 'cltb', + keyAECurveHeight = 'kchd', + keyAECurveWidth = 'kcwd', + keyAEDashStyle = 'pdst', + keyAEData = 'data', + keyAEDefaultType = 'deft', + keyAEDefinitionRect = 'pdrt', + keyAEDescType = 'dstp', + keyAEDestination = 'dest', + keyAEDoAntiAlias = 'anta', + keyAEDoDithered = 'gdit', + keyAEDoRotate = 'kdrt' +}; + +enum { + keyAEDoScale = 'ksca', + keyAEDoTranslate = 'ktra', + keyAEEditionFileLoc = 'eloc', + keyAEElements = 'elms', + keyAEEndPoint = 'pend', + keyAEEventClass = 'evcl', + keyAEEventID = 'evti', + keyAEFile = 'kfil', + keyAEFileType = 'fltp', + keyAEFillColor = 'flcl', + keyAEFillPattern = 'flpt', + keyAEFlipHorizontal = 'kfho', + keyAEFlipVertical = 'kfvt', + keyAEFont = 'font', + keyAEFormula = 'pfor', + keyAEGraphicObjects = 'gobs', + keyAEID = 'ID ', + keyAEImageQuality = 'gqua', + keyAEInsertHere = 'insh', + keyAEKeyForms = 'keyf' +}; + +enum { + keyAEKeyword = 'kywd', + keyAELevel = 'levl', + keyAELineArrow = 'arro', + keyAEName = 'pnam', + keyAENewElementLoc = 'pnel', + keyAEObject = 'kobj', + keyAEObjectClass = 'kocl', + keyAEOffStyles = 'ofst', + keyAEOnStyles = 'onst', + keyAEParameters = 'prms', + keyAEParamFlags = 'pmfg', + keyAEPenColor = 'ppcl', + keyAEPenPattern = 'pppa', + keyAEPenWidth = 'ppwd', + keyAEPixelDepth = 'pdpt', + keyAEPixMapMinus = 'kpmm', + keyAEPMTable = 'kpmt', + keyAEPointList = 'ptlt', + keyAEPointSize = 'ptsz', + keyAEPosition = 'kpos' +}; + +enum { + keyAEPropData = 'prdt', + keyAEProperties = 'qpro', + keyAEProperty = 'kprp', + keyAEPropFlags = 'prfg', + keyAEPropID = 'prop', + keyAEProtection = 'ppro', + keyAERenderAs = 'kren', + keyAERequestedType = 'rtyp', + keyAEResult = '----', + keyAEResultInfo = 'rsin', + keyAERotation = 'prot', + keyAERotPoint = 'krtp', + keyAERowList = 'krls', + keyAESaveOptions = 'savo', + keyAEScale = 'pscl', + keyAEScriptTag = 'psct', + keyAESearchText = 'stxt', + keyAEShowWhere = 'show', + keyAEStartAngle = 'pang', + keyAEStartPoint = 'pstp', + keyAEStyles = 'ksty' +}; + +enum { + keyAESuiteID = 'suit', + keyAEText = 'ktxt', + keyAETextColor = 'ptxc', + keyAETextFont = 'ptxf', + keyAETextPointSize = 'ptps', + keyAETextStyles = 'txst', + keyAETextLineHeight = 'ktlh', + keyAETextLineAscent = 'ktas', + keyAETheText = 'thtx', + keyAETransferMode = 'pptm', + keyAETranslation = 'ptrs', + keyAETryAsStructGraf = 'toog', + keyAEUniformStyles = 'ustl', + keyAEUpdateOn = 'pupd', + keyAEUserTerm = 'utrm', + keyAEWindow = 'wndw', + keyAEWritingCode = 'wrcd' +}; + +enum { + keyMiscellaneous = 'fmsc', + keySelection = 'fsel', + keyWindow = 'kwnd', + + keyWhen = 'when', + keyWhere = 'wher', + keyModifiers = 'mods', + keyKey = 'key ', + keyKeyCode = 'code', + keyKeyboard = 'keyb', + keyDriveNumber = 'drv#', + keyErrorCode = 'err#', + keyHighLevelClass = 'hcls', + keyHighLevelID = 'hid ' +}; + +enum { + pArcAngle = 'parc', + pBackgroundColor = 'pbcl', + pBackgroundPattern = 'pbpt', + pBestType = 'pbst', + pBounds = 'pbnd', + pClass = 'pcls', + pClipboard = 'pcli', + pColor = 'colr', + pColorTable = 'cltb', + pContents = 'pcnt', + pCornerCurveHeight = 'pchd', + pCornerCurveWidth = 'pcwd', + pDashStyle = 'pdst', + pDefaultType = 'deft', + pDefinitionRect = 'pdrt', + pEnabled = 'enbl', + pEndPoint = 'pend', + pFillColor = 'flcl', + pFillPattern = 'flpt', + pFont = 'font' +}; + +enum { + pFormula = 'pfor', + pGraphicObjects = 'gobs', + pHasCloseBox = 'hclb', + pHasTitleBar = 'ptit', + pID = 'ID ', + pIndex = 'pidx', + pInsertionLoc = 'pins', + pIsFloating = 'isfl', + pIsFrontProcess = 'pisf', + pIsModal = 'pmod', + pIsModified = 'imod', + pIsResizable = 'prsz', + pIsStationeryPad = 'pspd', + pIsZoomable = 'iszm', + pIsZoomed = 'pzum', + pItemNumber = 'itmn', + pJustification = 'pjst', + pLineArrow = 'arro', + pMenuID = 'mnid', + pName = 'pnam' +}; + +enum { + pNewElementLoc = 'pnel', + pPenColor = 'ppcl', + pPenPattern = 'pppa', + pPenWidth = 'ppwd', + pPixelDepth = 'pdpt', + pPointList = 'ptlt', + pPointSize = 'ptsz', + pProtection = 'ppro', + pRotation = 'prot', + pScale = 'pscl', + pScript = 'scpt', + pScriptTag = 'psct', + pSelected = 'selc', + pSelection = 'sele', + pStartAngle = 'pang', + pStartPoint = 'pstp', + pTextColor = 'ptxc', + pTextFont = 'ptxf', + pTextItemDelimiters = 'txdl', + pTextPointSize = 'ptps' +}; + +enum { + pTextStyles = 'txst', + pTransferMode = 'pptm', + pTranslation = 'ptrs', + pUniformStyles = 'ustl', + pUpdateOn = 'pupd', + pUserSelection = 'pusl', + pVersion = 'vers', + pVisible = 'pvis' +}; + +enum { + typeAEText = 'tTXT', + typeArc = 'carc', + typeBest = 'best', + typeCell = 'ccel', + typeClassInfo = 'gcli', + typeColorTable = 'clrt', + typeColumn = 'ccol', + typeDashStyle = 'tdas', + typeData = 'tdta', + typeDrawingArea = 'cdrw', + typeElemInfo = 'elin', + typeEnumeration = 'enum', + typeEPS = 'EPS ', + typeEventInfo = 'evin' +}; + +enum { + typeFinderWindow = 'fwin', + typeFixedPoint = 'fpnt', + typeFixedRectangle = 'frct', + typeGraphicLine = 'glin', + typeGraphicText = 'cgtx', + typeGroupedGraphic = 'cpic', + typeInsertionLoc = 'insl', + typeIntlText = 'itxt', + typeIntlWritingCode = 'intl', + typeLongDateTime = 'ldt ', + typeCFAbsoluteTime = 'cfat', + typeISO8601DateTime = 'isot', + typeLongFixed = 'lfxd', + typeLongFixedPoint = 'lfpt', + typeLongFixedRectangle = 'lfrc', + typeLongPoint = 'lpnt', + typeLongRectangle = 'lrct', + typeMachineLoc = 'mLoc', + typeOval = 'covl', + typeParamInfo = 'pmin', + typePict = 'PICT' +}; + +enum { + typePixelMap = 'cpix', + typePixMapMinus = 'tpmm', + typePolygon = 'cpgn', + typePropInfo = 'pinf', + typePtr = 'ptr ', + typeQDPoint = 'QDpt', + typeQDRegion = 'Qrgn', + typeRectangle = 'crec', + typeRGB16 = 'tr16', + typeRGB96 = 'tr96', + typeRGBColor = 'cRGB', + typeRotation = 'trot', + typeRoundedRectangle = 'crrc', + typeRow = 'crow', + typeScrapStyles = 'styl', + typeScript = 'scpt', + typeStyledText = 'STXT', + typeSuiteInfo = 'suin', + typeTable = 'ctbl', + typeTextStyles = 'tsty' +}; + +enum { + typeTIFF = 'TIFF', + typeJPEG = 'JPEG', + typeGIF = 'GIFf', + typeVersion = 'vers' +}; + +enum { + kAEMenuClass = 'menu', + kAEMenuSelect = 'mhit', + kAEMouseDown = 'mdwn', + kAEMouseDownInBack = 'mdbk', + kAEKeyDown = 'kdwn', + kAEResized = 'rsiz', + kAEPromise = 'prom' +}; + +enum { + keyMenuID = 'mid ', + keyMenuItem = 'mitm', + keyCloseAllWindows = 'caw ', + keyOriginalBounds = 'obnd', + keyNewBounds = 'nbnd', + keyLocalWhere = 'lwhr' +}; + +enum { + typeHIMenu = 'mobj', + typeHIWindow = 'wobj' +}; + +enum { + kAEQuitPreserveState = 'stat', + + kAEQuitReason = 'why?' +}; + +enum { + kBySmallIcon = 0, + kByIconView = 1, + kByNameView = 2, + kByDateView = 3, + kBySizeView = 4, + kByKindView = 5, + kByCommentView = 6, + kByLabelView = 7, + kByVersionView = 8 +}; + +enum { + kAEInfo = 11, + kAEMain = 0, + kAESharing = 13 +}; + +enum { + kAEZoomIn = 7, + kAEZoomOut = 8 +}; + +enum { + kTextServiceClass = 'tsvc', + kUpdateActiveInputArea = 'updt', + kShowHideInputWindow = 'shiw', + kPos2Offset = 'p2st', + kOffset2Pos = 'st2p', + kUnicodeNotFromInputMethod = 'unim', + kGetSelectedText = 'gtxt', + keyAETSMDocumentRefcon = 'refc', + keyAEServerInstance = 'srvi', + keyAETheData = 'kdat', + keyAEFixLength = 'fixl', + keyAEUpdateRange = 'udng', + keyAECurrentPoint = 'cpos', + keyAEBufferSize = 'buff', + keyAEMoveView = 'mvvw', + keyAENextBody = 'nxbd', + keyAETSMScriptTag = 'sclg', + keyAETSMTextFont = 'ktxf', + keyAETSMTextFMFont = 'ktxm', + keyAETSMTextPointSize = 'ktps', + keyAETSMEventRecord = 'tevt', + keyAETSMEventRef = 'tevr', + keyAETextServiceEncoding = 'tsen', + keyAETextServiceMacEncoding = 'tmen', + keyAETSMGlyphInfoArray = 'tgia', + typeTextRange = 'txrn', + typeComponentInstance = 'cmpi', + typeOffsetArray = 'ofay', + typeTextRangeArray = 'tray', + typeLowLevelEventRecord = 'evtr', + typeGlyphInfoArray = 'glia', + typeEventRef = 'evrf', + typeText = typeChar +}; + + + +enum { + kTSMOutsideOfBody = 1, + kTSMInsideOfBody = 2, + kTSMInsideOfActiveInputArea = 3 +}; + +enum { + kNextBody = 1, + kPreviousBody = 2 +}; + +struct TextRange { + SInt32 fStart; + SInt32 fEnd; + SInt16 fHiliteStyle; +}; +typedef struct TextRange TextRange; +typedef TextRange * TextRangePtr; +typedef TextRangePtr * TextRangeHandle; +struct TextRangeArray { + SInt16 fNumOfRanges; + TextRange fRange[1]; +}; +typedef struct TextRangeArray TextRangeArray; +typedef TextRangeArray * TextRangeArrayPtr; +typedef TextRangeArrayPtr * TextRangeArrayHandle; +struct OffsetArray { + SInt16 fNumOfOffsets; + SInt32 fOffset[1]; +}; +typedef struct OffsetArray OffsetArray; +typedef OffsetArray * OffsetArrayPtr; +typedef OffsetArrayPtr * OffsetArrayHandle; +struct WritingCode { + ScriptCode theScriptCode; + LangCode theLangCode; +}; +typedef struct WritingCode WritingCode; +struct IntlText { + ScriptCode theScriptCode; + LangCode theLangCode; + char theText[1]; +}; +typedef struct IntlText IntlText; + + +enum { + kTSMHiliteCaretPosition = 1, + kTSMHiliteRawText = 2, + kTSMHiliteSelectedRawText = 3, + kTSMHiliteConvertedText = 4, + kTSMHiliteSelectedConvertedText = 5, + kTSMHiliteBlockFillText = 6, + kTSMHiliteOutlineText = 7, + kTSMHiliteSelectedText = 8, + kTSMHiliteNoHilite = 9 +}; +enum { + keyAEHiliteRange = 'hrng', + keyAEPinRange = 'pnrg', + keyAEClauseOffsets = 'clau', + keyAEOffset = 'ofst', + keyAEPoint = 'gpos', + keyAELeftSide = 'klef', + keyAERegionClass = 'rgnc', + keyAEDragging = 'bool' +}; +enum { + + typeMeters = 'metr', + typeInches = 'inch', + typeFeet = 'feet', + typeYards = 'yard', + typeMiles = 'mile', + typeKilometers = 'kmtr', + typeCentimeters = 'cmtr', + typeSquareMeters = 'sqrm', + typeSquareFeet = 'sqft', + typeSquareYards = 'sqyd', + typeSquareMiles = 'sqmi', + typeSquareKilometers = 'sqkm', + typeLiters = 'litr', + typeQuarts = 'qrts', + typeGallons = 'galn', + typeCubicMeters = 'cmet', + typeCubicFeet = 'cfet', + typeCubicInches = 'cuin', + typeCubicCentimeter = 'ccmt', + typeCubicYards = 'cyrd', + typeKilograms = 'kgrm', + typeGrams = 'gram', + typeOunces = 'ozs ', + typePounds = 'lbs ', + typeDegreesC = 'degc', + typeDegreesF = 'degf', + typeDegreesK = 'degk' +}; + +enum { + + kFAServerApp = 'ssrv', + kDoFolderActionEvent = 'fola', + kFolderActionCode = 'actn', + kFolderOpenedEvent = 'fopn', + kFolderClosedEvent = 'fclo', + kFolderWindowMovedEvent = 'fsiz', + kFolderItemsAddedEvent = 'fget', + kFolderItemsRemovedEvent = 'flos', + kItemList = 'flst', + kNewSizeParameter = 'fnsz', + kFASuiteCode = 'faco', + kFAAttachCommand = 'atfa', + kFARemoveCommand = 'rmfa', + kFAEditCommand = 'edfa', + kFAFileParam = 'faal', + kFAIndexParam = 'indx' +}; + + +enum { + + kAEInternetSuite = 'gurl', + kAEISWebStarSuite = 0x575757BD +}; + +enum { + + kAEISGetURL = 'gurl', + KAEISHandleCGI = 'sdoc' +}; + +enum { + + cURL = 'url ', + cInternetAddress = 'IPAD', + cHTML = 'html', + cFTPItem = 'ftp ' +}; + +enum { + + kAEISHTTPSearchArgs = 'kfor', + kAEISPostArgs = 'post', + kAEISMethod = 'meth', + kAEISClientAddress = 'addr', + kAEISUserName = 'user', + kAEISPassword = 'pass', + kAEISFromUser = 'frmu', + kAEISServerName = 'svnm', + kAEISServerPort = 'svpt', + kAEISScriptName = 'scnm', + kAEISContentType = 'ctyp', + kAEISReferrer = 'refr', + kAEISUserAgent = 'Agnt', + kAEISAction = 'Kact', + kAEISActionPath = 'Kapt', + kAEISClientIP = 'Kcip', + kAEISFullRequest = 'Kfrq' +}; + +enum { + + pScheme = 'pusc', + pHost = 'HOST', + pPath = 'FTPc', + pUserName = 'RAun', + pUserPassword = 'RApw', + pDNSForm = 'pDNS', + pURL = 'pURL', + pTextEncoding = 'ptxe', + pFTPKind = 'kind' +}; + +enum { + + eScheme = 'esch', + eurlHTTP = 'http', + eurlHTTPS = 'htps', + eurlFTP = 'ftp ', + eurlMail = 'mail', + eurlFile = 'file', + eurlGopher = 'gphr', + eurlTelnet = 'tlnt', + eurlNews = 'news', + eurlSNews = 'snws', + eurlNNTP = 'nntp', + eurlMessage = 'mess', + eurlMailbox = 'mbox', + eurlMulti = 'mult', + eurlLaunch = 'laun', + eurlAFP = 'afp ', + eurlAT = 'at ', + eurlEPPC = 'eppc', + eurlRTSP = 'rtsp', + eurlIMAP = 'imap', + eurlNFS = 'unfs', + eurlPOP = 'upop', + eurlLDAP = 'uldp', + eurlUnknown = 'url?' +}; + +enum { + + kConnSuite = 'macc', + cDevSpec = 'cdev', + cAddressSpec = 'cadr', + cADBAddress = 'cadb', + cAppleTalkAddress = 'cat ', + cBusAddress = 'cbus', + cEthernetAddress = 'cen ', + cFireWireAddress = 'cfw ', + cIPAddress = 'cip ', + cLocalTalkAddress = 'clt ', + cSCSIAddress = 'cscs', + cTokenRingAddress = 'ctok', + cUSBAddress = 'cusb', + + pDeviceType = 'pdvt', + pDeviceAddress = 'pdva', + pConduit = 'pcon', + pProtocol = 'pprt', + pATMachine = 'patm', + pATZone = 'patz', + pATType = 'patt', + pDottedDecimal = 'pipd', + pDNS = 'pdns', + pPort = 'ppor', + pNetwork = 'pnet', + pNode = 'pnod', + pSocket = 'psoc', + pSCSIBus = 'pscb', + pSCSILUN = 'pslu', + + eDeviceType = 'edvt', + eAddressSpec = 'eads', + eConduit = 'econ', + eProtocol = 'epro', + eADB = 'eadb', + eAnalogAudio = 'epau', + eAppleTalk = 'epat', + eAudioLineIn = 'ecai', + eAudioLineOut = 'ecal', + eAudioOut = 'ecao', + eBus = 'ebus', + eCDROM = 'ecd ', + eCommSlot = 'eccm', + eDigitalAudio = 'epda', + eDisplay = 'edds', + eDVD = 'edvd', + eEthernet = 'ecen', + eFireWire = 'ecfw', + eFloppy = 'efd ', + eHD = 'ehd ', + eInfrared = 'ecir', + eIP = 'epip', + eIrDA = 'epir', + eIRTalk = 'epit', + eKeyboard = 'ekbd', + eLCD = 'edlc', + eLocalTalk = 'eclt', + eMacIP = 'epmi', + eMacVideo = 'epmv', + eMicrophone = 'ecmi', + eModemPort = 'ecmp', + eModemPrinterPort = 'empp', + eModem = 'edmm', + eMonitorOut = 'ecmn', + eMouse = 'emou', + eNuBusCard = 'ednb', + eNuBus = 'enub', + ePCcard = 'ecpc', + ePCIbus = 'ecpi', + ePCIcard = 'edpi', + ePDSslot = 'ecpd', + ePDScard = 'epds', + ePointingDevice = 'edpd', + ePostScript = 'epps', + ePPP = 'eppp', + ePrinterPort = 'ecpp', + ePrinter = 'edpr', + eSvideo = 'epsv', + eSCSI = 'ecsc', + eSerial = 'epsr', + eSpeakers = 'edsp', + eStorageDevice = 'edst', + eSVGA = 'epsg', + eTokenRing = 'etok', + eTrackball = 'etrk', + eTrackpad = 'edtp', + eUSB = 'ecus', + eVideoIn = 'ecvi', + eVideoMonitor = 'edvm', + eVideoOut = 'ecvo' +}; + +enum { + + cKeystroke = 'kprs', + pKeystrokeKey = 'kMsg', + pModifiers = 'kMod', + pKeyKind = 'kknd', + eModifiers = 'eMds', + eOptionDown = 'Kopt', + eCommandDown = 'Kcmd', + eControlDown = 'Kctl', + eShiftDown = 'Ksft', + eCapsLockDown = 'Kclk', + eKeyKind = 'ekst', + + eEscapeKey = 0x6B733500, + eDeleteKey = 0x6B733300, + eTabKey = 0x6B733000, + eReturnKey = 0x6B732400, + eClearKey = 0x6B734700, + eEnterKey = 0x6B734C00, + eUpArrowKey = 0x6B737E00, + eDownArrowKey = 0x6B737D00, + eLeftArrowKey = 0x6B737B00, + eRightArrowKey = 0x6B737C00, + eHelpKey = 0x6B737200, + eHomeKey = 0x6B737300, + ePageUpKey = 0x6B737400, + ePageDownKey = 0x6B737900, + eForwardDelKey = 0x6B737500, + eEndKey = 0x6B737700, + eF1Key = 0x6B737A00, + eF2Key = 0x6B737800, + eF3Key = 0x6B736300, + eF4Key = 0x6B737600, + eF5Key = 0x6B736000, + eF6Key = 0x6B736100, + eF7Key = 0x6B736200, + eF8Key = 0x6B736400, + eF9Key = 0x6B736500, + eF10Key = 0x6B736D00, + eF11Key = 0x6B736700, + eF12Key = 0x6B736F00, + eF13Key = 0x6B736900, + eF14Key = 0x6B736B00, + eF15Key = 0x6B737100 +}; + +enum { + keyAELaunchedAsLogInItem = 'lgit', + keyAELaunchedAsServiceItem = 'svit' +}; + + + + + + +enum { + kAEUserTerminology = 'aeut', + kAETerminologyExtension = 'aete', + kAEScriptingSizeResource = 'scsz', + kAEOSAXSizeResource = 'osiz' +}; + +enum { + kAEUTHasReturningParam = 31, + kAEUTOptional = 15, + kAEUTlistOfItems = 14, + kAEUTEnumerated = 13, + kAEUTReadWrite = 12, + kAEUTChangesState = 12, + kAEUTTightBindingFunction = 12, + + kAEUTEnumsAreTypes = 11, + kAEUTEnumListIsExclusive = 10, + kAEUTReplyIsReference = 9, + kAEUTDirectParamIsReference = 9, + kAEUTParamIsReference = 9, + kAEUTPropertyIsReference = 9, + kAEUTNotDirectParamIsTarget = 8, + kAEUTParamIsTarget = 8, + kAEUTApostrophe = 3, + kAEUTFeminine = 2, + kAEUTMasculine = 1, + kAEUTPlural = 0 +}; + +struct TScriptingSizeResource { + SInt16 scriptingSizeFlags; + UInt32 minStackSize; + UInt32 preferredStackSize; + UInt32 maxStackSize; + UInt32 minHeapSize; + UInt32 preferredHeapSize; + UInt32 maxHeapSize; +}; +typedef struct TScriptingSizeResource TScriptingSizeResource; +enum { + kLaunchToGetTerminology = (1 << 15), + kDontFindAppBySignature = (1 << 14), + kAlwaysSendSubject = (1 << 13) +}; + + +enum { + kReadExtensionTermsMask = (1 << 15) +}; + +enum { + + + kOSIZDontOpenResourceFile = 15, + kOSIZdontAcceptRemoteEvents = 14, + kOSIZOpenWithReadPermission = 13, + kOSIZCodeInSharedLibraries = 11 +}; + + + + + +typedef UInt32 AEBuildErrorCode; +enum { + aeBuildSyntaxNoErr = 0, + aeBuildSyntaxBadToken = 1, + aeBuildSyntaxBadEOF = 2, + aeBuildSyntaxNoEOF = 3, + aeBuildSyntaxBadNegative = 4, + aeBuildSyntaxMissingQuote = 5, + aeBuildSyntaxBadHex = 6, + aeBuildSyntaxOddHex = 7, + aeBuildSyntaxNoCloseHex = 8, + aeBuildSyntaxUncoercedHex = 9, + aeBuildSyntaxNoCloseString = 10, + aeBuildSyntaxBadDesc = 11, + aeBuildSyntaxBadData = 12, + aeBuildSyntaxNoCloseParen = 13, + aeBuildSyntaxNoCloseBracket = 14, + aeBuildSyntaxNoCloseBrace = 15, + aeBuildSyntaxNoKey = 16, + aeBuildSyntaxNoColon = 17, + aeBuildSyntaxCoercedList = 18, + aeBuildSyntaxUncoercedDoubleAt = 19 +}; + + + +struct AEBuildError { + AEBuildErrorCode fError; + UInt32 fErrorPos; +}; +typedef struct AEBuildError AEBuildError; +extern OSStatus +AEBuildDesc( + AEDesc * dst, + AEBuildError * error, + const char * src, + ...) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +vAEBuildDesc( + AEDesc * dst, + AEBuildError * error, + const char * src, + va_list args) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEBuildParameters( + AppleEvent * event, + AEBuildError * error, + const char * format, + ...) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +vAEBuildParameters( + AppleEvent * event, + AEBuildError * error, + const char * format, + va_list args) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEBuildAppleEvent( + AEEventClass theClass, + AEEventID theID, + DescType addressType, + const void * addressData, + Size addressLength, + SInt16 returnID, + SInt32 transactionID, + AppleEvent * result, + AEBuildError * error, + const char * paramsFmt, + ...) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +vAEBuildAppleEvent( + AEEventClass theClass, + AEEventID theID, + DescType addressType, + const void * addressData, + Size addressLength, + SInt16 returnID, + SInt32 transactionID, + AppleEvent * resultEvt, + AEBuildError * error, + const char * paramsFmt, + va_list args) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEPrintDescToHandle( + const AEDesc * desc, + Handle * result) __attribute__((availability(macosx,introduced=10.0))); +typedef struct OpaqueAEStreamRef* AEStreamRef; +extern AEStreamRef +AEStreamOpen(void) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEStreamClose( + AEStreamRef ref, + AEDesc * desc) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEStreamOpenDesc( + AEStreamRef ref, + DescType newType) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEStreamWriteData( + AEStreamRef ref, + const void * data, + Size length) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEStreamCloseDesc(AEStreamRef ref) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEStreamWriteDesc( + AEStreamRef ref, + DescType newType, + const void * data, + Size length) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEStreamWriteAEDesc( + AEStreamRef ref, + const AEDesc * desc) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEStreamOpenList(AEStreamRef ref) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEStreamCloseList(AEStreamRef ref) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEStreamOpenRecord( + AEStreamRef ref, + DescType newType) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEStreamSetRecordType( + AEStreamRef ref, + DescType newType) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEStreamCloseRecord(AEStreamRef ref) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEStreamWriteKeyDesc( + AEStreamRef ref, + AEKeyword key, + DescType newType, + const void * data, + Size length) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEStreamOpenKeyDesc( + AEStreamRef ref, + AEKeyword key, + DescType newType) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEStreamWriteKey( + AEStreamRef ref, + AEKeyword key) __attribute__((availability(macosx,introduced=10.0))); +extern AEStreamRef +AEStreamCreateEvent( + AEEventClass clazz, + AEEventID id, + DescType targetType, + const void * targetData, + Size targetLength, + SInt16 returnID, + SInt32 transactionID) __attribute__((availability(macosx,introduced=10.0))); +extern AEStreamRef +AEStreamOpenEvent(AppleEvent * event) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEStreamOptionalParam( + AEStreamRef ref, + AEKeyword key) __attribute__((availability(macosx,introduced=10.0))); + + + + + + +enum { + keyReplyPortAttr = 'repp' +}; + + +enum { + typeReplyPortAttr = keyReplyPortAttr +}; +extern mach_port_t +AEGetRegisteredMachPort(void) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEDecodeMessage( + mach_msg_header_t * header, + AppleEvent * event, + AppleEvent * reply) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AEProcessMessage(mach_msg_header_t * header) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +AESendMessage( + const AppleEvent * event, + AppleEvent * reply, + AESendMode sendMode, + long timeOutInTicks) __attribute__((availability(macosx,introduced=10.0))); + + + + + + + + + + +extern const CFStringRef kCFErrorDomainCFNetwork __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFErrorDomainWinSock __attribute__((availability(macosx,introduced=10_5))); +typedef int CFNetworkErrors; enum { + + kCFHostErrorHostNotFound = 1, + kCFHostErrorUnknown = 2, + + kCFSOCKSErrorUnknownClientVersion = 100, + kCFSOCKSErrorUnsupportedServerVersion = 101, + + kCFSOCKS4ErrorRequestFailed = 110, + kCFSOCKS4ErrorIdentdFailed = 111, + kCFSOCKS4ErrorIdConflict = 112, + kCFSOCKS4ErrorUnknownStatusCode = 113, + + kCFSOCKS5ErrorBadState = 120, + kCFSOCKS5ErrorBadResponseAddr = 121, + kCFSOCKS5ErrorBadCredentials = 122, + kCFSOCKS5ErrorUnsupportedNegotiationMethod = 123, + kCFSOCKS5ErrorNoAcceptableMethod = 124, + + kCFFTPErrorUnexpectedStatusCode = 200, + + kCFErrorHTTPAuthenticationTypeUnsupported = 300, + kCFErrorHTTPBadCredentials = 301, + kCFErrorHTTPConnectionLost = 302, + kCFErrorHTTPParseFailure = 303, + kCFErrorHTTPRedirectionLoopDetected = 304, + kCFErrorHTTPBadURL = 305, + kCFErrorHTTPProxyConnectionFailure = 306, + kCFErrorHTTPBadProxyCredentials = 307, + kCFErrorPACFileError = 308, + kCFErrorPACFileAuth = 309, + kCFErrorHTTPSProxyConnectionFailure = 310, + kCFStreamErrorHTTPSProxyFailureUnexpectedResponseToCONNECTMethod = 311, + + + kCFURLErrorBackgroundSessionInUseByAnotherProcess = -996, + kCFURLErrorBackgroundSessionWasDisconnected = -997, + kCFURLErrorUnknown = -998, + kCFURLErrorCancelled = -999, + kCFURLErrorBadURL = -1000, + kCFURLErrorTimedOut = -1001, + kCFURLErrorUnsupportedURL = -1002, + kCFURLErrorCannotFindHost = -1003, + kCFURLErrorCannotConnectToHost = -1004, + kCFURLErrorNetworkConnectionLost = -1005, + kCFURLErrorDNSLookupFailed = -1006, + kCFURLErrorHTTPTooManyRedirects = -1007, + kCFURLErrorResourceUnavailable = -1008, + kCFURLErrorNotConnectedToInternet = -1009, + kCFURLErrorRedirectToNonExistentLocation = -1010, + kCFURLErrorBadServerResponse = -1011, + kCFURLErrorUserCancelledAuthentication = -1012, + kCFURLErrorUserAuthenticationRequired = -1013, + kCFURLErrorZeroByteResource = -1014, + kCFURLErrorCannotDecodeRawData = -1015, + kCFURLErrorCannotDecodeContentData = -1016, + kCFURLErrorCannotParseResponse = -1017, + kCFURLErrorInternationalRoamingOff = -1018, + kCFURLErrorCallIsActive = -1019, + kCFURLErrorDataNotAllowed = -1020, + kCFURLErrorRequestBodyStreamExhausted = -1021, + kCFURLErrorAppTransportSecurityRequiresSecureConnection = -1022, + kCFURLErrorFileDoesNotExist = -1100, + kCFURLErrorFileIsDirectory = -1101, + kCFURLErrorNoPermissionsToReadFile = -1102, + kCFURLErrorDataLengthExceedsMaximum = -1103, + + kCFURLErrorSecureConnectionFailed = -1200, + kCFURLErrorServerCertificateHasBadDate = -1201, + kCFURLErrorServerCertificateUntrusted = -1202, + kCFURLErrorServerCertificateHasUnknownRoot = -1203, + kCFURLErrorServerCertificateNotYetValid = -1204, + kCFURLErrorClientCertificateRejected = -1205, + kCFURLErrorClientCertificateRequired = -1206, + kCFURLErrorCannotLoadFromNetwork = -2000, + + kCFURLErrorCannotCreateFile = -3000, + kCFURLErrorCannotOpenFile = -3001, + kCFURLErrorCannotCloseFile = -3002, + kCFURLErrorCannotWriteToFile = -3003, + kCFURLErrorCannotRemoveFile = -3004, + kCFURLErrorCannotMoveFile = -3005, + kCFURLErrorDownloadDecodingFailedMidStream = -3006, + kCFURLErrorDownloadDecodingFailedToComplete = -3007, + + + kCFHTTPCookieCannotParseCookieFile = -4000, + + + kCFNetServiceErrorUnknown = -72000L, + kCFNetServiceErrorCollision = -72001L, + kCFNetServiceErrorNotFound = -72002L, + kCFNetServiceErrorInProgress = -72003L, + kCFNetServiceErrorBadArgument = -72004L, + kCFNetServiceErrorCancel = -72005L, + kCFNetServiceErrorInvalid = -72006L, + kCFNetServiceErrorTimeout = -72007L, + kCFNetServiceErrorDNSServiceFailure = -73000L +}; +extern const CFStringRef kCFURLErrorFailingURLErrorKey __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFURLErrorFailingURLStringErrorKey __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFGetAddrInfoFailureKey __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFSOCKSStatusCodeKey __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFSOCKSVersionKey __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFSOCKSNegotiationMethodKey __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFDNSServiceFailureKey __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFFTPStatusCodeKey __attribute__((availability(macosx,introduced=10_5))); + + + + + + + + + + + +typedef struct __CFHost* CFHostRef; +extern const SInt32 kCFStreamErrorDomainNetDB __attribute__((availability(macosx,introduced=10_3))); +extern const SInt32 kCFStreamErrorDomainSystemConfiguration __attribute__((availability(macosx,introduced=10_3))); +typedef int CFHostInfoType; enum { + + + + + + kCFHostAddresses = 0, + + + + + kCFHostNames = 1, + + + + + + kCFHostReachability = 2 +}; +struct CFHostClientContext { + + + + + + + CFIndex version; + + + + + + void * _Nullable info; + CFAllocatorRetainCallBack _Nullable retain; + + + + + + CFAllocatorReleaseCallBack _Nullable release; + + + + + + + + CFAllocatorCopyDescriptionCallBack _Nullable copyDescription; +}; +typedef struct CFHostClientContext CFHostClientContext; +typedef void ( * CFHostClientCallBack)(CFHostRef theHost, CFHostInfoType typeInfo, const CFStreamError * _Nullable error, void * _Nullable info); +extern CFTypeID +CFHostGetTypeID(void) __attribute__((availability(macosx,introduced=10_3))); +extern CFHostRef +CFHostCreateWithName(CFAllocatorRef _Nullable allocator, CFStringRef hostname) __attribute__((availability(macosx,introduced=10_3))); +extern CFHostRef +CFHostCreateWithAddress(CFAllocatorRef _Nullable allocator, CFDataRef addr) __attribute__((availability(macosx,introduced=10_3))); +extern CFHostRef +CFHostCreateCopy(CFAllocatorRef _Nullable alloc, CFHostRef host) __attribute__((availability(macosx,introduced=10_3))); +extern Boolean +CFHostStartInfoResolution(CFHostRef theHost, CFHostInfoType info, CFStreamError * _Nullable error) __attribute__((availability(macosx,introduced=10_3))); +extern _Nullable CFArrayRef +CFHostGetAddressing(CFHostRef theHost, Boolean * _Nullable hasBeenResolved) __attribute__((availability(macosx,introduced=10_3))); +extern _Nullable CFArrayRef +CFHostGetNames(CFHostRef theHost, Boolean * _Nullable hasBeenResolved) __attribute__((availability(macosx,introduced=10_3))); +extern _Nullable CFDataRef +CFHostGetReachability(CFHostRef theHost, Boolean * _Nullable hasBeenResolved) __attribute__((availability(macosx,introduced=10_3))); +extern void +CFHostCancelInfoResolution(CFHostRef theHost, CFHostInfoType info) __attribute__((availability(macosx,introduced=10_3))); +extern Boolean +CFHostSetClient(CFHostRef theHost, CFHostClientCallBack _Nullable clientCB, CFHostClientContext * _Nullable clientContext) __attribute__((availability(macosx,introduced=10_3))); +extern void +CFHostScheduleWithRunLoop(CFHostRef theHost, CFRunLoopRef runLoop, CFStringRef runLoopMode) __attribute__((availability(macosx,introduced=10_3))); +extern void +CFHostUnscheduleFromRunLoop(CFHostRef theHost, CFRunLoopRef runLoop, CFStringRef runLoopMode) __attribute__((availability(macosx,introduced=10_3))); + + + + + + +typedef struct __CFNetService* CFNetServiceRef; +typedef struct __CFNetServiceMonitor* CFNetServiceMonitorRef; +typedef struct __CFNetServiceBrowser* CFNetServiceBrowserRef; +extern const SInt32 kCFStreamErrorDomainMach __attribute__((availability(macosx,introduced=10_2))); +extern const SInt32 kCFStreamErrorDomainNetServices __attribute__((availability(macosx,introduced=10_2))); +typedef int CFNetServicesError; enum { + + + + + kCFNetServicesErrorUnknown = -72000L, + + + + + + + kCFNetServicesErrorCollision = -72001L, + + + + + kCFNetServicesErrorNotFound = -72002L, + + + + + + kCFNetServicesErrorInProgress = -72003L, + + + + + kCFNetServicesErrorBadArgument = -72004L, + + + + + kCFNetServicesErrorCancel = -72005L, + + + + + + kCFNetServicesErrorInvalid = -72006L, + + + + + + kCFNetServicesErrorTimeout = -72007L +}; +typedef int CFNetServiceMonitorType; enum { + + + + + kCFNetServiceMonitorTXT = 1 +}; +typedef CFOptionFlags CFNetServiceRegisterFlags; enum { + + + + + kCFNetServiceFlagNoAutoRename = 1 +}; +typedef CFOptionFlags CFNetServiceBrowserFlags; enum { + + + + + kCFNetServiceFlagMoreComing = 1, + + + + + kCFNetServiceFlagIsDomain = 2, + + + + + kCFNetServiceFlagIsDefault = 4, + + + + + kCFNetServiceFlagIsRegistrationDomain __attribute__((availability(macosx,introduced=10_2,deprecated=10_4,message="" ))) = 4, + + + + + kCFNetServiceFlagRemove = 8 +}; +struct CFNetServiceClientContext { + + + + + + + CFIndex version; + + + + + + void * _Nullable info; + CFAllocatorRetainCallBack _Nullable retain; + + + + + + CFAllocatorReleaseCallBack _Nullable release; + + + + + + + + CFAllocatorCopyDescriptionCallBack _Nullable copyDescription; +}; +typedef struct CFNetServiceClientContext CFNetServiceClientContext; +typedef void ( * CFNetServiceClientCallBack)(CFNetServiceRef theService, CFStreamError * _Nullable error, void * _Nullable info); +typedef void ( * CFNetServiceMonitorClientCallBack)(CFNetServiceMonitorRef theMonitor, CFNetServiceRef _Nullable theService, CFNetServiceMonitorType typeInfo, CFDataRef _Nullable rdata, CFStreamError * _Nullable error, void * _Nullable info); +typedef void ( * CFNetServiceBrowserClientCallBack)(CFNetServiceBrowserRef browser, CFOptionFlags flags, CFTypeRef _Nullable domainOrService, CFStreamError * _Nullable error, void * _Nullable info); +extern CFTypeID +CFNetServiceGetTypeID(void) __attribute__((availability(macosx,introduced=10_2))); +extern CFTypeID +CFNetServiceMonitorGetTypeID(void) __attribute__((availability(macosx,introduced=10_4))); +extern CFTypeID +CFNetServiceBrowserGetTypeID(void) __attribute__((availability(macosx,introduced=10_2))); +extern CFNetServiceRef +CFNetServiceCreate(CFAllocatorRef _Nullable alloc, CFStringRef domain, CFStringRef serviceType, CFStringRef name, SInt32 port) __attribute__((availability(macosx,introduced=10_2))); +extern CFNetServiceRef +CFNetServiceCreateCopy(CFAllocatorRef _Nullable alloc, CFNetServiceRef service) __attribute__((availability(macosx,introduced=10_3))); +extern CFStringRef +CFNetServiceGetDomain(CFNetServiceRef theService) __attribute__((availability(macosx,introduced=10_2))); +extern CFStringRef +CFNetServiceGetType(CFNetServiceRef theService) __attribute__((availability(macosx,introduced=10_2))); +extern CFStringRef +CFNetServiceGetName(CFNetServiceRef theService) __attribute__((availability(macosx,introduced=10_2))); +extern Boolean +CFNetServiceRegisterWithOptions(CFNetServiceRef theService, CFOptionFlags options, CFStreamError * _Nullable error) __attribute__((availability(macosx,introduced=10_4))); +extern Boolean +CFNetServiceResolveWithTimeout(CFNetServiceRef theService, CFTimeInterval timeout, CFStreamError * _Nullable error) __attribute__((availability(macosx,introduced=10_4))); +extern void +CFNetServiceCancel(CFNetServiceRef theService) __attribute__((availability(macosx,introduced=10_2))); +extern _Nullable CFStringRef +CFNetServiceGetTargetHost(CFNetServiceRef theService) __attribute__((availability(macosx,introduced=10_4))); +extern SInt32 +CFNetServiceGetPortNumber(CFNetServiceRef theService) __attribute__((availability(macosx,introduced=10_5))); +extern _Nullable CFArrayRef +CFNetServiceGetAddressing(CFNetServiceRef theService) __attribute__((availability(macosx,introduced=10_2))); +extern _Nullable CFDataRef +CFNetServiceGetTXTData(CFNetServiceRef theService) __attribute__((availability(macosx,introduced=10_4))); +extern Boolean +CFNetServiceSetTXTData(CFNetServiceRef theService, CFDataRef txtRecord) __attribute__((availability(macosx,introduced=10_4))); +extern _Nullable CFDictionaryRef +CFNetServiceCreateDictionaryWithTXTData(CFAllocatorRef _Nullable alloc, CFDataRef txtRecord) __attribute__((availability(macosx,introduced=10_4))); +extern _Nullable CFDataRef +CFNetServiceCreateTXTDataWithDictionary(CFAllocatorRef _Nullable alloc, CFDictionaryRef keyValuePairs) __attribute__((availability(macosx,introduced=10_4))); +extern Boolean +CFNetServiceSetClient(CFNetServiceRef theService, CFNetServiceClientCallBack _Nullable clientCB, CFNetServiceClientContext * _Nullable clientContext) __attribute__((availability(macosx,introduced=10_2))); +extern void +CFNetServiceScheduleWithRunLoop(CFNetServiceRef theService, CFRunLoopRef runLoop, CFStringRef runLoopMode) __attribute__((availability(macosx,introduced=10_2))); +extern void +CFNetServiceUnscheduleFromRunLoop(CFNetServiceRef theService, CFRunLoopRef runLoop, CFStringRef runLoopMode) __attribute__((availability(macosx,introduced=10_2))); +extern CFNetServiceMonitorRef +CFNetServiceMonitorCreate( + CFAllocatorRef _Nullable alloc, + CFNetServiceRef theService, + CFNetServiceMonitorClientCallBack clientCB, + CFNetServiceClientContext * clientContext) __attribute__((availability(macosx,introduced=10_4))); +extern void +CFNetServiceMonitorInvalidate(CFNetServiceMonitorRef monitor) __attribute__((availability(macosx,introduced=10_4))); +extern Boolean +CFNetServiceMonitorStart(CFNetServiceMonitorRef monitor, CFNetServiceMonitorType recordType, CFStreamError * _Nullable error) __attribute__((availability(macosx,introduced=10_4))); +extern void +CFNetServiceMonitorStop(CFNetServiceMonitorRef monitor, CFStreamError * _Nullable error) __attribute__((availability(macosx,introduced=10_4))); +extern void +CFNetServiceMonitorScheduleWithRunLoop(CFNetServiceMonitorRef monitor, CFRunLoopRef runLoop, CFStringRef runLoopMode) __attribute__((availability(macosx,introduced=10_4))); +extern void +CFNetServiceMonitorUnscheduleFromRunLoop(CFNetServiceMonitorRef monitor, CFRunLoopRef runLoop, CFStringRef runLoopMode) __attribute__((availability(macosx,introduced=10_4))); +extern CFNetServiceBrowserRef +CFNetServiceBrowserCreate(CFAllocatorRef _Nullable alloc, CFNetServiceBrowserClientCallBack clientCB, CFNetServiceClientContext *clientContext) __attribute__((availability(macosx,introduced=10_2))); +extern void +CFNetServiceBrowserInvalidate(CFNetServiceBrowserRef browser) __attribute__((availability(macosx,introduced=10_2))); +extern Boolean +CFNetServiceBrowserSearchForDomains(CFNetServiceBrowserRef browser, Boolean registrationDomains, CFStreamError * _Nullable error) __attribute__((availability(macosx,introduced=10_2))); +extern Boolean +CFNetServiceBrowserSearchForServices(CFNetServiceBrowserRef browser, CFStringRef domain, CFStringRef serviceType, CFStreamError * _Nullable error) __attribute__((availability(macosx,introduced=10_2))); +extern void +CFNetServiceBrowserStopSearch(CFNetServiceBrowserRef browser, CFStreamError * _Nullable error) __attribute__((availability(macosx,introduced=10_2))); +extern void +CFNetServiceBrowserScheduleWithRunLoop(CFNetServiceBrowserRef browser, CFRunLoopRef runLoop, CFStringRef runLoopMode) __attribute__((availability(macosx,introduced=10_2))); +extern void +CFNetServiceBrowserUnscheduleFromRunLoop(CFNetServiceBrowserRef browser, CFRunLoopRef runLoop, CFStringRef runLoopMode) __attribute__((availability(macosx,introduced=10_2))); +extern Boolean +CFNetServiceRegister(CFNetServiceRef theService, CFStreamError * _Nullable error) __attribute__((availability(macosx,introduced=10_2,deprecated=10_4,message="" ))); +extern Boolean +CFNetServiceResolve(CFNetServiceRef theService, CFStreamError * _Nullable error) __attribute__((availability(macosx,introduced=10_2,deprecated=10_4,message="" ))); +extern _Nullable CFStringRef +CFNetServiceGetProtocolSpecificInformation(CFNetServiceRef theService) __attribute__((availability(macosx,introduced=10_2,deprecated=10_4,message="" ))); +extern void +CFNetServiceSetProtocolSpecificInformation(CFNetServiceRef theService, CFStringRef _Nullable theInfo) __attribute__((availability(macosx,introduced=10_2,deprecated=10_4,message="" ))); + + + + + +extern const CFStringRef kCFStreamPropertySSLContext __attribute__((availability(macosx,introduced=10_9))); +extern const CFStringRef kCFStreamPropertySSLPeerTrust __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFStreamSSLValidatesCertificateChain __attribute__((availability(macosx,introduced=10_4))); +extern const CFStringRef kCFStreamPropertySSLSettings __attribute__((availability(macosx,introduced=10_4))); +extern const CFStringRef kCFStreamSSLLevel __attribute__((availability(macosx,introduced=10_4))); +extern const CFStringRef kCFStreamSSLPeerName __attribute__((availability(macosx,introduced=10_4))); +extern const CFStringRef kCFStreamSSLCertificates __attribute__((availability(macosx,introduced=10_4))); +extern const CFStringRef kCFStreamSSLIsServer __attribute__((availability(macosx,introduced=10_4))); +extern const CFStringRef kCFStreamNetworkServiceType __attribute__((availability(macosx,introduced=10_7))); + + +extern const CFStringRef kCFStreamNetworkServiceTypeVideo __attribute__((availability(macosx,introduced=10_7))); +extern const CFStringRef kCFStreamNetworkServiceTypeVoice __attribute__((availability(macosx,introduced=10_7))); +extern const CFStringRef kCFStreamNetworkServiceTypeBackground __attribute__((availability(macosx,introduced=10_7))); +extern const CFStringRef kCFStreamNetworkServiceTypeCallSignaling __attribute__((availability(macosx,introduced=10_12))); + + +extern const CFStringRef kCFStreamNetworkServiceTypeVoIP __attribute__((availability(macosx,introduced=10_7,deprecated=10_11,message="" "use PushKit for VoIP control purposes"))); +extern const CFStringRef kCFStreamPropertyNoCellular __attribute__((availability(macosx,introduced=10_8))); +extern const CFStringRef kCFStreamPropertyConnectionIsCellular __attribute__((availability(macosx,introduced=10_8))); +extern const CFIndex kCFStreamErrorDomainWinSock __attribute__((availability(macosx,introduced=10_5))); +extern const int kCFStreamErrorDomainSOCKS __attribute__((availability(macosx,introduced=10_0))); + + + +static __inline__ __attribute__((always_inline)) +SInt32 CFSocketStreamSOCKSGetErrorSubdomain(const CFStreamError* error) { + return ((error->error >> 16) & 0x0000FFFF); +} + +static __inline__ __attribute__((always_inline)) +SInt32 CFSocketStreamSOCKSGetError(const CFStreamError* error) { + return (error->error & 0x0000FFFF); +} + +enum { + kCFStreamErrorSOCKSSubDomainNone = 0, + kCFStreamErrorSOCKSSubDomainVersionCode = 1, + kCFStreamErrorSOCKS4SubDomainResponse = 2, + kCFStreamErrorSOCKS5SubDomainUserPass = 3, + kCFStreamErrorSOCKS5SubDomainMethod = 4, + kCFStreamErrorSOCKS5SubDomainResponse = 5 +}; + + + +enum { + kCFStreamErrorSOCKS5BadResponseAddr = 1, + kCFStreamErrorSOCKS5BadState = 2, + kCFStreamErrorSOCKSUnknownClientVersion = 3 +}; + + +enum { + kCFStreamErrorSOCKS4RequestFailed = 91, + kCFStreamErrorSOCKS4IdentdFailed = 92, + kCFStreamErrorSOCKS4IdConflict = 93 +}; + + +enum { + kSOCKS5NoAcceptableMethod = 0xFF +}; +extern const CFStringRef kCFStreamPropertySOCKSProxy __attribute__((availability(macosx,introduced=10_2))); +extern const CFStringRef kCFStreamPropertySOCKSProxyHost __attribute__((availability(macosx,introduced=10_2))); +extern const CFStringRef kCFStreamPropertySOCKSProxyPort __attribute__((availability(macosx,introduced=10_2))); +extern const CFStringRef kCFStreamPropertySOCKSVersion __attribute__((availability(macosx,introduced=10_2))); +extern const CFStringRef kCFStreamSocketSOCKSVersion4 __attribute__((availability(macosx,introduced=10_2))); +extern const CFStringRef kCFStreamSocketSOCKSVersion5 __attribute__((availability(macosx,introduced=10_2))); +extern const CFStringRef kCFStreamPropertySOCKSUser __attribute__((availability(macosx,introduced=10_2))); +extern const CFStringRef kCFStreamPropertySOCKSPassword __attribute__((availability(macosx,introduced=10_2))); +extern const CFStringRef kCFStreamPropertyProxyLocalBypass __attribute__((availability(macosx,introduced=10_4))); +extern const int kCFStreamErrorDomainSSL __attribute__((availability(macosx,introduced=10_2))); +extern const CFStringRef kCFStreamPropertySocketSecurityLevel __attribute__((availability(macosx,introduced=10_2))); +extern const CFStringRef kCFStreamSocketSecurityLevelNone __attribute__((availability(macosx,introduced=10_2))); +extern const CFStringRef kCFStreamSocketSecurityLevelSSLv2 __attribute__((availability(macosx,introduced=10_2))); +extern const CFStringRef kCFStreamSocketSecurityLevelSSLv3 __attribute__((availability(macosx,introduced=10_2))); +extern const CFStringRef kCFStreamSocketSecurityLevelTLSv1 __attribute__((availability(macosx,introduced=10_2))); +extern const CFStringRef kCFStreamSocketSecurityLevelNegotiatedSSL __attribute__((availability(macosx,introduced=10_2))); +extern const CFStringRef kCFStreamPropertyShouldCloseNativeSocket __attribute__((availability(macosx,introduced=10_2))); +extern const CFStringRef kCFStreamPropertySocketRemoteHost __attribute__((availability(macosx,introduced=10_3))); +extern const CFStringRef kCFStreamPropertySocketRemoteNetService __attribute__((availability(macosx,introduced=10_3))); +extern const CFStringRef kCFStreamPropertySocketExtendedBackgroundIdleMode __attribute__((availability(macosx,introduced=10_11))); +extern void +CFStreamCreatePairWithSocketToCFHost( + CFAllocatorRef _Nullable alloc, + CFHostRef host, + SInt32 port, + CFReadStreamRef _Nullable * _Nullable readStream, + CFWriteStreamRef _Nullable * _Nullable writeStream) __attribute__((availability(macosx,introduced=10_3))); +extern void +CFStreamCreatePairWithSocketToNetService( + CFAllocatorRef _Nullable alloc, + CFNetServiceRef service, + CFReadStreamRef _Nullable * _Nullable readStream, + CFWriteStreamRef _Nullable * _Nullable writeStream) __attribute__((availability(macosx,introduced=10_3))); +extern const CFStringRef kCFStreamPropertySSLPeerCertificates __attribute__((availability(macosx,introduced=10_4,deprecated=10_6,message="" ))); +extern const CFStringRef kCFStreamSSLAllowsExpiredCertificates __attribute__((availability(macosx,introduced=10_4,deprecated=10_6,message="" ))); +extern const CFStringRef kCFStreamSSLAllowsExpiredRoots __attribute__((availability(macosx,introduced=10_4,deprecated=10_6,message="" ))); +extern const CFStringRef kCFStreamSSLAllowsAnyRoot __attribute__((availability(macosx,introduced=10_4,deprecated=10_6,message="" ))); + + + +extern const SInt32 kCFStreamErrorDomainFTP __attribute__((availability(macosx,introduced=10_3))); +extern const CFStringRef kCFStreamPropertyFTPUserName __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); +extern const CFStringRef kCFStreamPropertyFTPPassword __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); +extern const CFStringRef kCFStreamPropertyFTPUsePassiveMode __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); +extern const CFStringRef kCFStreamPropertyFTPResourceSize __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); +extern const CFStringRef kCFStreamPropertyFTPFetchResourceInfo __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); +extern const CFStringRef kCFStreamPropertyFTPFileTransferOffset __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); +extern const CFStringRef kCFStreamPropertyFTPAttemptPersistentConnection __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); +extern const CFStringRef kCFStreamPropertyFTPProxy __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); +extern const CFStringRef kCFStreamPropertyFTPProxyHost __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); +extern const CFStringRef kCFStreamPropertyFTPProxyPort __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); + + + + + +extern const CFStringRef kCFStreamPropertyFTPProxyUser __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); + + + + + +extern const CFStringRef kCFStreamPropertyFTPProxyPassword __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); +extern const CFStringRef kCFFTPResourceMode __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); +extern const CFStringRef kCFFTPResourceName __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); +extern const CFStringRef kCFFTPResourceOwner __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); +extern const CFStringRef kCFFTPResourceGroup __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); +extern const CFStringRef kCFFTPResourceLink __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); +extern const CFStringRef kCFFTPResourceSize __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); +extern const CFStringRef kCFFTPResourceType __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); +extern const CFStringRef kCFFTPResourceModDate __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); +extern CFReadStreamRef +CFReadStreamCreateWithFTPURL(CFAllocatorRef _Nullable alloc, CFURLRef ftpURL) __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); +extern CFIndex +CFFTPCreateParsedResourceListing(CFAllocatorRef _Nullable alloc, const UInt8 *buffer, CFIndex bufferLength, CFDictionaryRef _Nullable * _Nullable parsed) __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); +extern CFWriteStreamRef +CFWriteStreamCreateWithFTPURL(CFAllocatorRef _Nullable alloc, CFURLRef ftpURL) __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSessionAPI for ftp requests"))); + + + + + + + +extern const CFStringRef kCFHTTPVersion1_0 __attribute__((availability(macosx,introduced=10_1))); +extern const CFStringRef kCFHTTPVersion1_1 __attribute__((availability(macosx,introduced=10_1))); +extern const CFStringRef kCFHTTPVersion2_0 __attribute__((availability(macosx,introduced=10_10))); +extern const CFStringRef kCFHTTPAuthenticationSchemeBasic __attribute__((availability(macosx,introduced=10_2))); +extern const CFStringRef kCFHTTPAuthenticationSchemeDigest __attribute__((availability(macosx,introduced=10_2))); +extern const CFStringRef kCFHTTPAuthenticationSchemeNTLM __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFHTTPAuthenticationSchemeKerberos __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFHTTPAuthenticationSchemeNegotiate __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFHTTPAuthenticationSchemeNegotiate2 __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFHTTPAuthenticationSchemeXMobileMeAuthToken __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFHTTPAuthenticationSchemeOAuth1 __attribute__((availability(macosx,introduced=10_9))); +typedef struct __CFHTTPMessage* CFHTTPMessageRef; +extern CFTypeID +CFHTTPMessageGetTypeID(void) __attribute__((availability(macosx,introduced=10_1))); +extern CFHTTPMessageRef +CFHTTPMessageCreateRequest(CFAllocatorRef _Nullable alloc, CFStringRef requestMethod, CFURLRef url, CFStringRef httpVersion) __attribute__((availability(macosx,introduced=10_1))); +extern CFHTTPMessageRef +CFHTTPMessageCreateResponse( + CFAllocatorRef _Nullable alloc, + CFIndex statusCode, + CFStringRef _Nullable statusDescription, + CFStringRef httpVersion) __attribute__((availability(macosx,introduced=10_1))); +extern CFHTTPMessageRef +CFHTTPMessageCreateEmpty(CFAllocatorRef _Nullable alloc, Boolean isRequest) __attribute__((availability(macosx,introduced=10_1))); +extern CFHTTPMessageRef +CFHTTPMessageCreateCopy(CFAllocatorRef _Nullable alloc, CFHTTPMessageRef message) __attribute__((availability(macosx,introduced=10_1))); +extern Boolean +CFHTTPMessageIsRequest(CFHTTPMessageRef message) __attribute__((availability(macosx,introduced=10_1))); +extern CFStringRef +CFHTTPMessageCopyVersion(CFHTTPMessageRef message) __attribute__((availability(macosx,introduced=10_1))); +extern _Nullable CFDataRef +CFHTTPMessageCopyBody(CFHTTPMessageRef message) __attribute__((availability(macosx,introduced=10_1))); +extern void +CFHTTPMessageSetBody(CFHTTPMessageRef message, CFDataRef bodyData) __attribute__((availability(macosx,introduced=10_1))); +extern _Nullable CFStringRef +CFHTTPMessageCopyHeaderFieldValue(CFHTTPMessageRef message, CFStringRef headerField) __attribute__((availability(macosx,introduced=10_1))); +extern _Nullable CFDictionaryRef +CFHTTPMessageCopyAllHeaderFields(CFHTTPMessageRef message) __attribute__((availability(macosx,introduced=10_1))); +extern void +CFHTTPMessageSetHeaderFieldValue(CFHTTPMessageRef message, CFStringRef headerField, CFStringRef _Nullable value) __attribute__((availability(macosx,introduced=10_1))); +extern Boolean +CFHTTPMessageAppendBytes(CFHTTPMessageRef message, const UInt8 *newBytes, CFIndex numBytes) __attribute__((availability(macosx,introduced=10_1))); +extern Boolean +CFHTTPMessageIsHeaderComplete(CFHTTPMessageRef message) __attribute__((availability(macosx,introduced=10_1))); +extern _Nullable CFDataRef +CFHTTPMessageCopySerializedMessage(CFHTTPMessageRef message) __attribute__((availability(macosx,introduced=10_1))); +extern _Nullable CFURLRef +CFHTTPMessageCopyRequestURL(CFHTTPMessageRef request) __attribute__((availability(macosx,introduced=10_1))); +extern _Nullable CFStringRef +CFHTTPMessageCopyRequestMethod(CFHTTPMessageRef request) __attribute__((availability(macosx,introduced=10_1))); +extern Boolean +CFHTTPMessageAddAuthentication( + CFHTTPMessageRef request, + CFHTTPMessageRef _Nullable authenticationFailureResponse, + CFStringRef username, + CFStringRef password, + CFStringRef _Nullable authenticationScheme, + Boolean forProxy) __attribute__((availability(macosx,introduced=10_1))); +extern CFIndex +CFHTTPMessageGetResponseStatusCode(CFHTTPMessageRef response) __attribute__((availability(macosx,introduced=10_1))); +extern _Nullable CFStringRef +CFHTTPMessageCopyResponseStatusLine(CFHTTPMessageRef response) __attribute__((availability(macosx,introduced=10_1))); + + + +extern const SInt32 kCFStreamErrorDomainHTTP __attribute__((availability(macosx,introduced=10_1))); + + + + + + + +typedef int CFStreamErrorHTTP; enum { + + + + + kCFStreamErrorHTTPParseFailure = -1, + + + + + kCFStreamErrorHTTPRedirectionLoop = -2, + + + + + kCFStreamErrorHTTPBadURL = -3 +}; +extern const CFStringRef kCFStreamPropertyHTTPResponseHeader __attribute__((availability(macosx,introduced=10_1,deprecated=10_11,message="" "Use NSURLSession API for http requests"))); +extern const CFStringRef kCFStreamPropertyHTTPFinalURL __attribute__((availability(macosx,introduced=10_2,deprecated=10_11,message="" "Use NSURLSession API for http requests"))); +extern const CFStringRef kCFStreamPropertyHTTPFinalRequest __attribute__((availability(macosx,introduced=10_5,deprecated=10_11,message="" "Use NSURLSession API for http requests"))); +extern const CFStringRef kCFStreamPropertyHTTPProxy __attribute__((availability(macosx,introduced=10_2,deprecated=10_11,message="" "Use NSURLSession API for http requests"))); +extern const CFStringRef kCFStreamPropertyHTTPProxyHost __attribute__((availability(macosx,introduced=10_2,deprecated=10_11,message="" "Use NSURLSession API for http requests"))); +extern const CFStringRef kCFStreamPropertyHTTPProxyPort __attribute__((availability(macosx,introduced=10_2,deprecated=10_11,message="" "Use NSURLSession API for http requests"))); +extern const CFStringRef kCFStreamPropertyHTTPSProxyHost __attribute__((availability(macosx,introduced=10_2,deprecated=10_11,message="" "Use NSURLSession API for http requests"))); +extern const CFStringRef kCFStreamPropertyHTTPSProxyPort __attribute__((availability(macosx,introduced=10_2,deprecated=10_11,message="" "Use NSURLSession API for http requests"))); +extern const CFStringRef kCFStreamPropertyHTTPShouldAutoredirect __attribute__((availability(macosx,introduced=10_2,deprecated=10_11,message="" "Use NSURLSession API for http requests"))); +extern const CFStringRef kCFStreamPropertyHTTPAttemptPersistentConnection __attribute__((availability(macosx,introduced=10_2,deprecated=10_11,message="" "Use NSURLSession API for http requests"))); +extern const CFStringRef kCFStreamPropertyHTTPRequestBytesWrittenCount __attribute__((availability(macosx,introduced=10_3,deprecated=10_11,message="" "Use NSURLSession API for http requests"))); +extern CFReadStreamRef +CFReadStreamCreateForHTTPRequest(CFAllocatorRef _Nullable alloc, CFHTTPMessageRef request) __attribute__((availability(macosx,introduced=10_2,deprecated=10_11,message="" "Use NSURLSession API for http requests"))); +extern CFReadStreamRef +CFReadStreamCreateForStreamedHTTPRequest(CFAllocatorRef _Nullable alloc, CFHTTPMessageRef requestHeaders, CFReadStreamRef requestBody) __attribute__((availability(macosx,introduced=10_2,deprecated=10_11,message="" "Use NSURLSession API for http requests"))); +extern void +CFHTTPReadStreamSetRedirectsAutomatically(CFReadStreamRef httpStream, Boolean shouldAutoRedirect) __attribute__((availability(macosx,introduced=10_1,deprecated=10_3,message="" ))); + + + +typedef struct _CFHTTPAuthentication* CFHTTPAuthenticationRef; +typedef int CFStreamErrorHTTPAuthentication; enum { + + + + + + kCFStreamErrorHTTPAuthenticationTypeUnsupported = -1000, + + + + + + kCFStreamErrorHTTPAuthenticationBadUserName = -1001, + + + + + + kCFStreamErrorHTTPAuthenticationBadPassword = -1002 +}; +extern const CFStringRef kCFHTTPAuthenticationUsername __attribute__((availability(macosx,introduced=10_4))); +extern const CFStringRef kCFHTTPAuthenticationPassword __attribute__((availability(macosx,introduced=10_4))); +extern const CFStringRef kCFHTTPAuthenticationAccountDomain __attribute__((availability(macosx,introduced=10_4))); +extern CFTypeID +CFHTTPAuthenticationGetTypeID(void) __attribute__((availability(macosx,introduced=10_2))); +extern CFHTTPAuthenticationRef +CFHTTPAuthenticationCreateFromResponse(CFAllocatorRef _Nullable alloc, CFHTTPMessageRef response) __attribute__((availability(macosx,introduced=10_2))); +extern Boolean +CFHTTPAuthenticationIsValid(CFHTTPAuthenticationRef auth, CFStreamError * _Nullable error) __attribute__((availability(macosx,introduced=10_2))); +extern Boolean +CFHTTPAuthenticationAppliesToRequest(CFHTTPAuthenticationRef auth, CFHTTPMessageRef request) __attribute__((availability(macosx,introduced=10_2))); +extern Boolean +CFHTTPAuthenticationRequiresOrderedRequests(CFHTTPAuthenticationRef auth) __attribute__((availability(macosx,introduced=10_2))); +extern Boolean +CFHTTPMessageApplyCredentials( + CFHTTPMessageRef request, + CFHTTPAuthenticationRef auth, + CFStringRef _Nullable username, + CFStringRef _Nullable password, + CFStreamError * _Nullable error) __attribute__((availability(macosx,introduced=10_2))); +extern Boolean +CFHTTPMessageApplyCredentialDictionary( + CFHTTPMessageRef request, + CFHTTPAuthenticationRef auth, + CFDictionaryRef dict, + CFStreamError * _Nullable error) __attribute__((availability(macosx,introduced=10_4))); +extern CFStringRef +CFHTTPAuthenticationCopyRealm(CFHTTPAuthenticationRef auth) __attribute__((availability(macosx,introduced=10_2))); +extern CFArrayRef +CFHTTPAuthenticationCopyDomains(CFHTTPAuthenticationRef auth) __attribute__((availability(macosx,introduced=10_2))); +extern CFStringRef +CFHTTPAuthenticationCopyMethod(CFHTTPAuthenticationRef auth) __attribute__((availability(macosx,introduced=10_2))); +extern Boolean +CFHTTPAuthenticationRequiresUserNameAndPassword(CFHTTPAuthenticationRef auth) __attribute__((availability(macosx,introduced=10_3))); +extern Boolean +CFHTTPAuthenticationRequiresAccountDomain(CFHTTPAuthenticationRef auth) __attribute__((availability(macosx,introduced=10_4))); + + + +typedef struct __CFNetDiagnostic* CFNetDiagnosticRef; + + + + + + + +typedef int CFNetDiagnosticStatusValues; enum { + + + + + kCFNetDiagnosticNoErr = 0, + + + + + kCFNetDiagnosticErr = -66560L, + + + + + kCFNetDiagnosticConnectionUp = -66559L, + kCFNetDiagnosticConnectionIndeterminate = -66558L, + + + + + kCFNetDiagnosticConnectionDown = -66557L +}; +typedef CFIndex CFNetDiagnosticStatus; +extern CFNetDiagnosticRef +CFNetDiagnosticCreateWithStreams(CFAllocatorRef _Nullable alloc, CFReadStreamRef _Nullable readStream, CFWriteStreamRef _Nullable writeStream) __attribute__((availability(macosx,introduced=10_4))); +extern CFNetDiagnosticRef +CFNetDiagnosticCreateWithURL(CFAllocatorRef alloc, CFURLRef url) __attribute__((availability(macosx,introduced=10_4))); +extern void +CFNetDiagnosticSetName(CFNetDiagnosticRef details, CFStringRef name) __attribute__((availability(macosx,introduced=10_4))); +extern CFNetDiagnosticStatus +CFNetDiagnosticDiagnoseProblemInteractively(CFNetDiagnosticRef details) __attribute__((availability(macosx,introduced=10_4))); +extern CFNetDiagnosticStatus +CFNetDiagnosticCopyNetworkStatusPassively(CFNetDiagnosticRef details, CFStringRef _Nullable * _Nullable description) __attribute__((availability(macosx,introduced=10_4))); + + + + + + + +extern _Nullable CFDictionaryRef +CFNetworkCopySystemProxySettings(void) __attribute__((availability(macosx,introduced=10_6))); +extern CFArrayRef +CFNetworkCopyProxiesForURL(CFURLRef url, CFDictionaryRef proxySettings) __attribute__((availability(macosx,introduced=10_5))); +typedef void ( * CFProxyAutoConfigurationResultCallback)(void *client, CFArrayRef proxyList, CFErrorRef _Nullable error); +extern _Nullable CFArrayRef +CFNetworkCopyProxiesForAutoConfigurationScript(CFStringRef proxyAutoConfigurationScript, CFURLRef targetURL, CFErrorRef * _Nullable error) __attribute__((availability(macosx,introduced=10_5))); +extern CFRunLoopSourceRef +CFNetworkExecuteProxyAutoConfigurationScript( + CFStringRef proxyAutoConfigurationScript, + CFURLRef targetURL, + CFProxyAutoConfigurationResultCallback cb, + CFStreamClientContext * clientContext) __attribute__((availability(macosx,introduced=10_5))); +extern CFRunLoopSourceRef +CFNetworkExecuteProxyAutoConfigurationURL( + CFURLRef proxyAutoConfigURL, + CFURLRef targetURL, + CFProxyAutoConfigurationResultCallback cb, + CFStreamClientContext * clientContext) __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFProxyTypeKey __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFProxyHostNameKey __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFProxyPortNumberKey __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFProxyAutoConfigurationURLKey __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFProxyAutoConfigurationJavaScriptKey __attribute__((availability(macosx,introduced=10_7))); +extern const CFStringRef kCFProxyUsernameKey __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFProxyPasswordKey __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFProxyTypeNone __attribute__((availability(macosx,introduced=10_5))); + + + + + +extern const CFStringRef kCFProxyTypeHTTP __attribute__((availability(macosx,introduced=10_5))); + + + + + +extern const CFStringRef kCFProxyTypeHTTPS __attribute__((availability(macosx,introduced=10_5))); + + + + + +extern const CFStringRef kCFProxyTypeSOCKS __attribute__((availability(macosx,introduced=10_5))); + + + + + +extern const CFStringRef kCFProxyTypeFTP __attribute__((availability(macosx,introduced=10_5))); + + + + + +extern const CFStringRef kCFProxyTypeAutoConfigurationURL __attribute__((availability(macosx,introduced=10_5))); + + + + + +extern const CFStringRef kCFProxyTypeAutoConfigurationJavaScript __attribute__((availability(macosx,introduced=10_7))); + + + + + +extern const CFStringRef kCFProxyAutoConfigurationHTTPResponseKey __attribute__((availability(macosx,introduced=10_5))); +extern const CFStringRef kCFNetworkProxiesExceptionsList __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesExcludeSimpleHostnames __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesFTPEnable __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesFTPPassive __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesFTPPort __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesFTPProxy __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesGopherEnable __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesGopherPort __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesGopherProxy __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesHTTPEnable __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesHTTPPort __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesHTTPProxy __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesHTTPSEnable __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesHTTPSPort __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesHTTPSProxy __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesRTSPEnable __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesRTSPPort __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesRTSPProxy __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesSOCKSEnable __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesSOCKSPort __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesSOCKSProxy __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesProxyAutoConfigEnable __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesProxyAutoConfigURLString __attribute__((availability(macosx,introduced=10_6))); +extern const CFStringRef kCFNetworkProxiesProxyAutoConfigJavaScript __attribute__((availability(macosx,introduced=10_7))); +extern const CFStringRef kCFNetworkProxiesProxyAutoDiscoveryEnable __attribute__((availability(macosx,introduced=10_6))); + + + +typedef const struct __attribute__((objc_bridge(id))) __DCSDictionary* DCSDictionaryRef; +extern CFRange DCSGetTermRangeInString( DCSDictionaryRef _Nullable dictionary, CFStringRef textString, CFIndex offset ) + __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef _Nullable DCSCopyTextDefinition( DCSDictionaryRef _Nullable dictionary, CFStringRef textString, CFRange range ) + __attribute__((availability(macosx,introduced=10.5))); + + + +typedef struct __attribute__((objc_bridge(id))) OpaqueSecKeychainRef *SecKeychainRef; + + + + + +typedef struct __attribute__((objc_bridge(id))) OpaqueSecKeychainItemRef *SecKeychainItemRef; + + + + + +typedef struct __attribute__((objc_bridge(id))) OpaqueSecKeychainSearchRef *SecKeychainSearchRef; + + + + + +typedef OSType SecKeychainAttrType; +struct SecKeychainAttribute +{ + SecKeychainAttrType tag; + UInt32 length; + void *data; +}; +typedef struct SecKeychainAttribute SecKeychainAttribute; + + + + + +typedef SecKeychainAttribute *SecKeychainAttributePtr; + + + + + + + +struct SecKeychainAttributeList +{ + UInt32 count; + SecKeychainAttribute *attr; +}; +typedef struct SecKeychainAttributeList SecKeychainAttributeList; + + + + + +typedef UInt32 SecKeychainStatus; + + + + + + +typedef struct __attribute__((objc_bridge(id))) OpaqueSecTrustedApplicationRef *SecTrustedApplicationRef; + + + + + +typedef struct __attribute__((objc_bridge(id))) OpaqueSecPolicyRef *SecPolicyRef; + + + + + +typedef struct __attribute__((objc_bridge(id))) OpaqueSecCertificateRef *SecCertificateRef; + + + + + +typedef struct __attribute__((objc_bridge(id))) OpaqueSecAccessRef *SecAccessRef; + + + + + +typedef struct __attribute__((objc_bridge(id))) OpaqueSecIdentityRef *SecIdentityRef; + + + + + +typedef struct __attribute__((objc_bridge(id))) OpaqueSecKeyRef *SecKeyRef; + + + + + +typedef struct __attribute__((objc_bridge(id))) OpaqueSecTrustRef *SecACLRef; + + + + + +typedef struct __attribute__((objc_bridge(id))) OpaqueSecAccessControl *SecAccessControlRef; + + + + + +typedef struct __attribute__((objc_bridge(id))) OpaqueSecPasswordRef *SecPasswordRef; +struct SecKeychainAttributeInfo +{ + UInt32 count; + UInt32 *tag; + UInt32 *format; +}; +typedef struct SecKeychainAttributeInfo SecKeychainAttributeInfo; +_Nullable +CFStringRef SecCopyErrorMessageString(OSStatus status, void * _Nullable reserved) + __attribute__((availability(macosx,introduced=10.3))); +enum +{ + errSecSuccess = 0, + errSecUnimplemented = -4, + errSecDskFull = -34, + errSecIO = -36, + + errSecParam = -50, + errSecWrPerm = -61, + errSecAllocate = -108, + errSecUserCanceled = -128, + errSecBadReq = -909, + + errSecInternalComponent = -2070, + errSecCoreFoundationUnknown = -4960, + + errSecNotAvailable = -25291, + errSecReadOnly = -25292, + errSecAuthFailed = -25293, + errSecNoSuchKeychain = -25294, + errSecInvalidKeychain = -25295, + errSecDuplicateKeychain = -25296, + errSecDuplicateCallback = -25297, + errSecInvalidCallback = -25298, + errSecDuplicateItem = -25299, + errSecItemNotFound = -25300, + errSecBufferTooSmall = -25301, + errSecDataTooLarge = -25302, + errSecNoSuchAttr = -25303, + errSecInvalidItemRef = -25304, + errSecInvalidSearchRef = -25305, + errSecNoSuchClass = -25306, + errSecNoDefaultKeychain = -25307, + errSecInteractionNotAllowed = -25308, + errSecReadOnlyAttr = -25309, + errSecWrongSecVersion = -25310, + errSecKeySizeNotAllowed = -25311, + errSecNoStorageModule = -25312, + errSecNoCertificateModule = -25313, + errSecNoPolicyModule = -25314, + errSecInteractionRequired = -25315, + errSecDataNotAvailable = -25316, + errSecDataNotModifiable = -25317, + errSecCreateChainFailed = -25318, + errSecInvalidPrefsDomain = -25319, + errSecInDarkWake = -25320, + + errSecACLNotSimple = -25240, + errSecPolicyNotFound = -25241, + errSecInvalidTrustSetting = -25242, + errSecNoAccessForItem = -25243, + errSecInvalidOwnerEdit = -25244, + errSecTrustNotAvailable = -25245, + errSecUnsupportedFormat = -25256, + errSecUnknownFormat = -25257, + errSecKeyIsSensitive = -25258, + errSecMultiplePrivKeys = -25259, + errSecPassphraseRequired = -25260, + errSecInvalidPasswordRef = -25261, + errSecInvalidTrustSettings = -25262, + errSecNoTrustSettings = -25263, + errSecPkcs12VerifyFailure = -25264, + errSecNotSigner = -26267, + + errSecDecode = -26275, + + errSecServiceNotAvailable = -67585, + errSecInsufficientClientID = -67586, + errSecDeviceReset = -67587, + errSecDeviceFailed = -67588, + errSecAppleAddAppACLSubject = -67589, + errSecApplePublicKeyIncomplete = -67590, + errSecAppleSignatureMismatch = -67591, + errSecAppleInvalidKeyStartDate = -67592, + errSecAppleInvalidKeyEndDate = -67593, + errSecConversionError = -67594, + errSecAppleSSLv2Rollback = -67595, + errSecDiskFull = -34, + errSecQuotaExceeded = -67596, + errSecFileTooBig = -67597, + errSecInvalidDatabaseBlob = -67598, + errSecInvalidKeyBlob = -67599, + errSecIncompatibleDatabaseBlob = -67600, + errSecIncompatibleKeyBlob = -67601, + errSecHostNameMismatch = -67602, + errSecUnknownCriticalExtensionFlag = -67603, + errSecNoBasicConstraints = -67604, + errSecNoBasicConstraintsCA = -67605, + errSecInvalidAuthorityKeyID = -67606, + errSecInvalidSubjectKeyID = -67607, + errSecInvalidKeyUsageForPolicy = -67608, + errSecInvalidExtendedKeyUsage = -67609, + errSecInvalidIDLinkage = -67610, + errSecPathLengthConstraintExceeded = -67611, + errSecInvalidRoot = -67612, + errSecCRLExpired = -67613, + errSecCRLNotValidYet = -67614, + errSecCRLNotFound = -67615, + errSecCRLServerDown = -67616, + errSecCRLBadURI = -67617, + errSecUnknownCertExtension = -67618, + errSecUnknownCRLExtension = -67619, + errSecCRLNotTrusted = -67620, + errSecCRLPolicyFailed = -67621, + errSecIDPFailure = -67622, + errSecSMIMEEmailAddressesNotFound = -67623, + errSecSMIMEBadExtendedKeyUsage = -67624, + errSecSMIMEBadKeyUsage = -67625, + errSecSMIMEKeyUsageNotCritical = -67626, + errSecSMIMENoEmailAddress = -67627, + errSecSMIMESubjAltNameNotCritical = -67628, + errSecSSLBadExtendedKeyUsage = -67629, + errSecOCSPBadResponse = -67630, + errSecOCSPBadRequest = -67631, + errSecOCSPUnavailable = -67632, + errSecOCSPStatusUnrecognized = -67633, + errSecEndOfData = -67634, + errSecIncompleteCertRevocationCheck = -67635, + errSecNetworkFailure = -67636, + errSecOCSPNotTrustedToAnchor = -67637, + errSecRecordModified = -67638, + errSecOCSPSignatureError = -67639, + errSecOCSPNoSigner = -67640, + errSecOCSPResponderMalformedReq = -67641, + errSecOCSPResponderInternalError = -67642, + errSecOCSPResponderTryLater = -67643, + errSecOCSPResponderSignatureRequired = -67644, + errSecOCSPResponderUnauthorized = -67645, + errSecOCSPResponseNonceMismatch = -67646, + errSecCodeSigningBadCertChainLength = -67647, + errSecCodeSigningNoBasicConstraints = -67648, + errSecCodeSigningBadPathLengthConstraint= -67649, + errSecCodeSigningNoExtendedKeyUsage = -67650, + errSecCodeSigningDevelopment = -67651, + errSecResourceSignBadCertChainLength = -67652, + errSecResourceSignBadExtKeyUsage = -67653, + errSecTrustSettingDeny = -67654, + errSecInvalidSubjectName = -67655, + errSecUnknownQualifiedCertStatement = -67656, + errSecMobileMeRequestQueued = -67657, + errSecMobileMeRequestRedirected = -67658, + errSecMobileMeServerError = -67659, + errSecMobileMeServerNotAvailable = -67660, + errSecMobileMeServerAlreadyExists = -67661, + errSecMobileMeServerServiceErr = -67662, + errSecMobileMeRequestAlreadyPending = -67663, + errSecMobileMeNoRequestPending = -67664, + errSecMobileMeCSRVerifyFailure = -67665, + errSecMobileMeFailedConsistencyCheck = -67666, + errSecNotInitialized = -67667, + errSecInvalidHandleUsage = -67668, + errSecPVCReferentNotFound = -67669, + errSecFunctionIntegrityFail = -67670, + errSecInternalError = -67671, + errSecMemoryError = -67672, + errSecInvalidData = -67673, + errSecMDSError = -67674, + errSecInvalidPointer = -67675, + errSecSelfCheckFailed = -67676, + errSecFunctionFailed = -67677, + errSecModuleManifestVerifyFailed = -67678, + errSecInvalidGUID = -67679, + errSecInvalidHandle = -67680, + errSecInvalidDBList = -67681, + errSecInvalidPassthroughID = -67682, + errSecInvalidNetworkAddress = -67683, + errSecCRLAlreadySigned = -67684, + errSecInvalidNumberOfFields = -67685, + errSecVerificationFailure = -67686, + errSecUnknownTag = -67687, + errSecInvalidSignature = -67688, + errSecInvalidName = -67689, + errSecInvalidCertificateRef = -67690, + errSecInvalidCertificateGroup = -67691, + errSecTagNotFound = -67692, + errSecInvalidQuery = -67693, + errSecInvalidValue = -67694, + errSecCallbackFailed = -67695, + errSecACLDeleteFailed = -67696, + errSecACLReplaceFailed = -67697, + errSecACLAddFailed = -67698, + errSecACLChangeFailed = -67699, + errSecInvalidAccessCredentials = -67700, + errSecInvalidRecord = -67701, + errSecInvalidACL = -67702, + errSecInvalidSampleValue = -67703, + errSecIncompatibleVersion = -67704, + errSecPrivilegeNotGranted = -67705, + errSecInvalidScope = -67706, + errSecPVCAlreadyConfigured = -67707, + errSecInvalidPVC = -67708, + errSecEMMLoadFailed = -67709, + errSecEMMUnloadFailed = -67710, + errSecAddinLoadFailed = -67711, + errSecInvalidKeyRef = -67712, + errSecInvalidKeyHierarchy = -67713, + errSecAddinUnloadFailed = -67714, + errSecLibraryReferenceNotFound = -67715, + errSecInvalidAddinFunctionTable = -67716, + errSecInvalidServiceMask = -67717, + errSecModuleNotLoaded = -67718, + errSecInvalidSubServiceID = -67719, + errSecAttributeNotInContext = -67720, + errSecModuleManagerInitializeFailed = -67721, + errSecModuleManagerNotFound = -67722, + errSecEventNotificationCallbackNotFound = -67723, + errSecInputLengthError = -67724, + errSecOutputLengthError = -67725, + errSecPrivilegeNotSupported = -67726, + errSecDeviceError = -67727, + errSecAttachHandleBusy = -67728, + errSecNotLoggedIn = -67729, + errSecAlgorithmMismatch = -67730, + errSecKeyUsageIncorrect = -67731, + errSecKeyBlobTypeIncorrect = -67732, + errSecKeyHeaderInconsistent = -67733, + errSecUnsupportedKeyFormat = -67734, + errSecUnsupportedKeySize = -67735, + errSecInvalidKeyUsageMask = -67736, + errSecUnsupportedKeyUsageMask = -67737, + errSecInvalidKeyAttributeMask = -67738, + errSecUnsupportedKeyAttributeMask = -67739, + errSecInvalidKeyLabel = -67740, + errSecUnsupportedKeyLabel = -67741, + errSecInvalidKeyFormat = -67742, + errSecUnsupportedVectorOfBuffers = -67743, + errSecInvalidInputVector = -67744, + errSecInvalidOutputVector = -67745, + errSecInvalidContext = -67746, + errSecInvalidAlgorithm = -67747, + errSecInvalidAttributeKey = -67748, + errSecMissingAttributeKey = -67749, + errSecInvalidAttributeInitVector = -67750, + errSecMissingAttributeInitVector = -67751, + errSecInvalidAttributeSalt = -67752, + errSecMissingAttributeSalt = -67753, + errSecInvalidAttributePadding = -67754, + errSecMissingAttributePadding = -67755, + errSecInvalidAttributeRandom = -67756, + errSecMissingAttributeRandom = -67757, + errSecInvalidAttributeSeed = -67758, + errSecMissingAttributeSeed = -67759, + errSecInvalidAttributePassphrase = -67760, + errSecMissingAttributePassphrase = -67761, + errSecInvalidAttributeKeyLength = -67762, + errSecMissingAttributeKeyLength = -67763, + errSecInvalidAttributeBlockSize = -67764, + errSecMissingAttributeBlockSize = -67765, + errSecInvalidAttributeOutputSize = -67766, + errSecMissingAttributeOutputSize = -67767, + errSecInvalidAttributeRounds = -67768, + errSecMissingAttributeRounds = -67769, + errSecInvalidAlgorithmParms = -67770, + errSecMissingAlgorithmParms = -67771, + errSecInvalidAttributeLabel = -67772, + errSecMissingAttributeLabel = -67773, + errSecInvalidAttributeKeyType = -67774, + errSecMissingAttributeKeyType = -67775, + errSecInvalidAttributeMode = -67776, + errSecMissingAttributeMode = -67777, + errSecInvalidAttributeEffectiveBits = -67778, + errSecMissingAttributeEffectiveBits = -67779, + errSecInvalidAttributeStartDate = -67780, + errSecMissingAttributeStartDate = -67781, + errSecInvalidAttributeEndDate = -67782, + errSecMissingAttributeEndDate = -67783, + errSecInvalidAttributeVersion = -67784, + errSecMissingAttributeVersion = -67785, + errSecInvalidAttributePrime = -67786, + errSecMissingAttributePrime = -67787, + errSecInvalidAttributeBase = -67788, + errSecMissingAttributeBase = -67789, + errSecInvalidAttributeSubprime = -67790, + errSecMissingAttributeSubprime = -67791, + errSecInvalidAttributeIterationCount = -67792, + errSecMissingAttributeIterationCount = -67793, + errSecInvalidAttributeDLDBHandle = -67794, + errSecMissingAttributeDLDBHandle = -67795, + errSecInvalidAttributeAccessCredentials = -67796, + errSecMissingAttributeAccessCredentials = -67797, + errSecInvalidAttributePublicKeyFormat = -67798, + errSecMissingAttributePublicKeyFormat = -67799, + errSecInvalidAttributePrivateKeyFormat = -67800, + errSecMissingAttributePrivateKeyFormat = -67801, + errSecInvalidAttributeSymmetricKeyFormat = -67802, + errSecMissingAttributeSymmetricKeyFormat = -67803, + errSecInvalidAttributeWrappedKeyFormat = -67804, + errSecMissingAttributeWrappedKeyFormat = -67805, + errSecStagedOperationInProgress = -67806, + errSecStagedOperationNotStarted = -67807, + errSecVerifyFailed = -67808, + errSecQuerySizeUnknown = -67809, + errSecBlockSizeMismatch = -67810, + errSecPublicKeyInconsistent = -67811, + errSecDeviceVerifyFailed = -67812, + errSecInvalidLoginName = -67813, + errSecAlreadyLoggedIn = -67814, + errSecInvalidDigestAlgorithm = -67815, + errSecInvalidCRLGroup = -67816, + errSecCertificateCannotOperate = -67817, + errSecCertificateExpired = -67818, + errSecCertificateNotValidYet = -67819, + errSecCertificateRevoked = -67820, + errSecCertificateSuspended = -67821, + errSecInsufficientCredentials = -67822, + errSecInvalidAction = -67823, + errSecInvalidAuthority = -67824, + errSecVerifyActionFailed = -67825, + errSecInvalidCertAuthority = -67826, + errSecInvaldCRLAuthority = -67827, + errSecInvalidCRLEncoding = -67828, + errSecInvalidCRLType = -67829, + errSecInvalidCRL = -67830, + errSecInvalidFormType = -67831, + errSecInvalidID = -67832, + errSecInvalidIdentifier = -67833, + errSecInvalidIndex = -67834, + errSecInvalidPolicyIdentifiers = -67835, + errSecInvalidTimeString = -67836, + errSecInvalidReason = -67837, + errSecInvalidRequestInputs = -67838, + errSecInvalidResponseVector = -67839, + errSecInvalidStopOnPolicy = -67840, + errSecInvalidTuple = -67841, + errSecMultipleValuesUnsupported = -67842, + errSecNotTrusted = -67843, + errSecNoDefaultAuthority = -67844, + errSecRejectedForm = -67845, + errSecRequestLost = -67846, + errSecRequestRejected = -67847, + errSecUnsupportedAddressType = -67848, + errSecUnsupportedService = -67849, + errSecInvalidTupleGroup = -67850, + errSecInvalidBaseACLs = -67851, + errSecInvalidTupleCredendtials = -67852, + errSecInvalidEncoding = -67853, + errSecInvalidValidityPeriod = -67854, + errSecInvalidRequestor = -67855, + errSecRequestDescriptor = -67856, + errSecInvalidBundleInfo = -67857, + errSecInvalidCRLIndex = -67858, + errSecNoFieldValues = -67859, + errSecUnsupportedFieldFormat = -67860, + errSecUnsupportedIndexInfo = -67861, + errSecUnsupportedLocality = -67862, + errSecUnsupportedNumAttributes = -67863, + errSecUnsupportedNumIndexes = -67864, + errSecUnsupportedNumRecordTypes = -67865, + errSecFieldSpecifiedMultiple = -67866, + errSecIncompatibleFieldFormat = -67867, + errSecInvalidParsingModule = -67868, + errSecDatabaseLocked = -67869, + errSecDatastoreIsOpen = -67870, + errSecMissingValue = -67871, + errSecUnsupportedQueryLimits = -67872, + errSecUnsupportedNumSelectionPreds = -67873, + errSecUnsupportedOperator = -67874, + errSecInvalidDBLocation = -67875, + errSecInvalidAccessRequest = -67876, + errSecInvalidIndexInfo = -67877, + errSecInvalidNewOwner = -67878, + errSecInvalidModifyMode = -67879, + errSecMissingRequiredExtension = -67880, + errSecExtendedKeyUsageNotCritical = -67881, + errSecTimestampMissing = -67882, + errSecTimestampInvalid = -67883, + errSecTimestampNotTrusted = -67884, + errSecTimestampServiceNotAvailable = -67885, + errSecTimestampBadAlg = -67886, + errSecTimestampBadRequest = -67887, + errSecTimestampBadDataFormat = -67888, + errSecTimestampTimeNotAvailable = -67889, + errSecTimestampUnacceptedPolicy = -67890, + errSecTimestampUnacceptedExtension = -67891, + errSecTimestampAddInfoNotAvailable = -67892, + errSecTimestampSystemFailure = -67893, + errSecSigningTimeMissing = -67894, + errSecTimestampRejection = -67895, + errSecTimestampWaiting = -67896, + errSecTimestampRevocationWarning = -67897, + errSecTimestampRevocationNotification = -67898, +}; +extern const CFStringRef kCSIdentityErrorDomain __attribute__((availability(macosx,introduced=10.5))); + + + + + + + +enum { + + + + + kCSIdentityUnknownAuthorityErr = -1, + + + + + kCSIdentityAuthorityNotAccessibleErr = -2, + + + + + kCSIdentityPermissionErr = -3, + + + + + kCSIdentityDeletedErr = -4, + + + + + kCSIdentityInvalidFullNameErr = -5, + + + + + kCSIdentityDuplicateFullNameErr = -6, + + + + + + kCSIdentityInvalidPosixNameErr = -7, + + + + + kCSIdentityDuplicatePosixNameErr = -8, +}; + + + + + + + + +typedef struct __CSIdentityAuthority* CSIdentityAuthorityRef; +extern CFTypeID +CSIdentityAuthorityGetTypeID(void) __attribute__((availability(macosx,introduced=10.5))); +extern CSIdentityAuthorityRef +CSGetDefaultIdentityAuthority(void) __attribute__((availability(macosx,introduced=10.5))); +extern CSIdentityAuthorityRef +CSGetLocalIdentityAuthority(void) __attribute__((availability(macosx,introduced=10.5))); +extern CSIdentityAuthorityRef +CSGetManagedIdentityAuthority(void) __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef +CSIdentityAuthorityCopyLocalizedName(CSIdentityAuthorityRef authority) __attribute__((availability(macosx,introduced=10.5))); + + + + + + + + +typedef int64_t sint64; + + + +typedef uint64_t uint64; + + + +typedef int32_t sint32; + + + +typedef int16_t sint16; + + + +typedef int8_t sint8; + + + +typedef uint32_t uint32; + + + +typedef uint16_t uint16; + + + +typedef uint8_t uint8; + + + +typedef intptr_t CSSM_INTPTR; +typedef size_t CSSM_SIZE; +enum { + CSSM_BASE_ERROR = -0x7FFF0000 +}; + +enum { + CSSM_ERRORCODE_MODULE_EXTENT = 0x00000800, + CSSM_ERRORCODE_CUSTOM_OFFSET = 0x00000400, + CSSM_ERRORCODE_COMMON_EXTENT = 0x100 +}; +enum { + CSSM_CSSM_BASE_ERROR = CSSM_BASE_ERROR, + CSSM_CSSM_PRIVATE_ERROR = CSSM_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET, + CSSM_CSP_BASE_ERROR = CSSM_CSSM_BASE_ERROR + CSSM_ERRORCODE_MODULE_EXTENT, + CSSM_CSP_PRIVATE_ERROR = CSSM_CSP_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET, + CSSM_DL_BASE_ERROR = CSSM_CSP_BASE_ERROR + CSSM_ERRORCODE_MODULE_EXTENT, + CSSM_DL_PRIVATE_ERROR = CSSM_DL_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET, + CSSM_CL_BASE_ERROR = CSSM_DL_BASE_ERROR + CSSM_ERRORCODE_MODULE_EXTENT, + CSSM_CL_PRIVATE_ERROR = CSSM_CL_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET, + CSSM_TP_BASE_ERROR = CSSM_CL_BASE_ERROR + CSSM_ERRORCODE_MODULE_EXTENT, + CSSM_TP_PRIVATE_ERROR = CSSM_TP_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET , + CSSM_KR_BASE_ERROR = CSSM_TP_BASE_ERROR + CSSM_ERRORCODE_MODULE_EXTENT, + CSSM_KR_PRIVATE_ERROR = CSSM_KR_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET, + CSSM_AC_BASE_ERROR = CSSM_KR_BASE_ERROR + CSSM_ERRORCODE_MODULE_EXTENT, + CSSM_AC_PRIVATE_ERROR = CSSM_AC_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET +}; + + +enum { + CSSM_MDS_BASE_ERROR = CSSM_CSP_BASE_ERROR + CSSM_ERRORCODE_MODULE_EXTENT, + CSSM_MDS_PRIVATE_ERROR = CSSM_MDS_BASE_ERROR + CSSM_ERRORCODE_CUSTOM_OFFSET +}; + + +enum { + CSSMERR_CSSM_INVALID_ADDIN_HANDLE = + CSSM_CSSM_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT + 1, + CSSMERR_CSSM_NOT_INITIALIZED = + CSSM_CSSM_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT + 2, + CSSMERR_CSSM_INVALID_HANDLE_USAGE = + CSSM_CSSM_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT + 3, + CSSMERR_CSSM_PVC_REFERENT_NOT_FOUND = + CSSM_CSSM_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT + 4, + CSSMERR_CSSM_FUNCTION_INTEGRITY_FAIL = + CSSM_CSSM_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT + 5 +}; + + +enum { + CSSM_ERRCODE_INTERNAL_ERROR = 0x0001, + CSSM_ERRCODE_MEMORY_ERROR = 0x0002, + CSSM_ERRCODE_MDS_ERROR = 0x0003, + CSSM_ERRCODE_INVALID_POINTER = 0x0004, + CSSM_ERRCODE_INVALID_INPUT_POINTER = 0x0005, + CSSM_ERRCODE_INVALID_OUTPUT_POINTER = 0x0006, + CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED = 0x0007, + CSSM_ERRCODE_SELF_CHECK_FAILED = 0x0008, + CSSM_ERRCODE_OS_ACCESS_DENIED = 0x0009, + CSSM_ERRCODE_FUNCTION_FAILED = 0x000A, + CSSM_ERRCODE_MODULE_MANIFEST_VERIFY_FAILED = 0x000B, + CSSM_ERRCODE_INVALID_GUID = 0x000C +}; + + +enum { + CSSM_ERRCODE_OPERATION_AUTH_DENIED = 0x0020, + CSSM_ERRCODE_OBJECT_USE_AUTH_DENIED = 0x0021, + CSSM_ERRCODE_OBJECT_MANIP_AUTH_DENIED = 0x0022, + CSSM_ERRCODE_OBJECT_ACL_NOT_SUPPORTED = 0x0023, + CSSM_ERRCODE_OBJECT_ACL_REQUIRED = 0x0024, + CSSM_ERRCODE_INVALID_ACCESS_CREDENTIALS = 0x0025, + CSSM_ERRCODE_INVALID_ACL_BASE_CERTS = 0x0026, + CSSM_ERRCODE_ACL_BASE_CERTS_NOT_SUPPORTED = 0x0027, + CSSM_ERRCODE_INVALID_SAMPLE_VALUE = 0x0028, + CSSM_ERRCODE_SAMPLE_VALUE_NOT_SUPPORTED = 0x0029, + CSSM_ERRCODE_INVALID_ACL_SUBJECT_VALUE = 0x002A, + CSSM_ERRCODE_ACL_SUBJECT_TYPE_NOT_SUPPORTED = 0x002B, + CSSM_ERRCODE_INVALID_ACL_CHALLENGE_CALLBACK = 0x002C, + CSSM_ERRCODE_ACL_CHALLENGE_CALLBACK_FAILED = 0x002D, + CSSM_ERRCODE_INVALID_ACL_ENTRY_TAG = 0x002E, + CSSM_ERRCODE_ACL_ENTRY_TAG_NOT_FOUND = 0x002F, + CSSM_ERRCODE_INVALID_ACL_EDIT_MODE = 0x0030, + CSSM_ERRCODE_ACL_CHANGE_FAILED = 0x0031, + CSSM_ERRCODE_INVALID_NEW_ACL_ENTRY = 0x0032, + CSSM_ERRCODE_INVALID_NEW_ACL_OWNER = 0x0033, + CSSM_ERRCODE_ACL_DELETE_FAILED = 0x0034, + CSSM_ERRCODE_ACL_REPLACE_FAILED = 0x0035, + CSSM_ERRCODE_ACL_ADD_FAILED = 0x0036 +}; + + +enum { + CSSM_ERRCODE_INVALID_CONTEXT_HANDLE = 0x0040, + CSSM_ERRCODE_INCOMPATIBLE_VERSION = 0x0041, + CSSM_ERRCODE_INVALID_CERTGROUP_POINTER = 0x0042, + CSSM_ERRCODE_INVALID_CERT_POINTER = 0x0043, + CSSM_ERRCODE_INVALID_CRL_POINTER = 0x0044, + CSSM_ERRCODE_INVALID_FIELD_POINTER = 0x0045, + CSSM_ERRCODE_INVALID_DATA = 0x0046, + CSSM_ERRCODE_CRL_ALREADY_SIGNED = 0x0047, + CSSM_ERRCODE_INVALID_NUMBER_OF_FIELDS = 0x0048, + CSSM_ERRCODE_VERIFICATION_FAILURE = 0x0049, + CSSM_ERRCODE_INVALID_DB_HANDLE = 0x004A, + CSSM_ERRCODE_PRIVILEGE_NOT_GRANTED = 0x004B, + CSSM_ERRCODE_INVALID_DB_LIST = 0x004C, + CSSM_ERRCODE_INVALID_DB_LIST_POINTER = 0x004D, + CSSM_ERRCODE_UNKNOWN_FORMAT = 0x004E, + CSSM_ERRCODE_UNKNOWN_TAG = 0x004F, + CSSM_ERRCODE_INVALID_CSP_HANDLE = 0x0050, + CSSM_ERRCODE_INVALID_DL_HANDLE = 0x0051, + CSSM_ERRCODE_INVALID_CL_HANDLE = 0x0052, + CSSM_ERRCODE_INVALID_TP_HANDLE = 0x0053, + CSSM_ERRCODE_INVALID_KR_HANDLE = 0x0054, + CSSM_ERRCODE_INVALID_AC_HANDLE = 0x0055, + CSSM_ERRCODE_INVALID_PASSTHROUGH_ID = 0x0056, + CSSM_ERRCODE_INVALID_NETWORK_ADDR = 0x0057, + CSSM_ERRCODE_INVALID_CRYPTO_DATA = 0x0058 +}; + + +enum { + CSSMERR_CSSM_INTERNAL_ERROR = + CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_INTERNAL_ERROR, + CSSMERR_CSSM_MEMORY_ERROR = + CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_MEMORY_ERROR, + CSSMERR_CSSM_MDS_ERROR = + CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_MDS_ERROR, + CSSMERR_CSSM_INVALID_POINTER = + CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_INVALID_POINTER, + CSSMERR_CSSM_INVALID_INPUT_POINTER = + CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_INVALID_INPUT_POINTER, + CSSMERR_CSSM_INVALID_OUTPUT_POINTER = + CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_INVALID_OUTPUT_POINTER, + CSSMERR_CSSM_FUNCTION_NOT_IMPLEMENTED = + CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED, + CSSMERR_CSSM_SELF_CHECK_FAILED = + CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_SELF_CHECK_FAILED, + CSSMERR_CSSM_OS_ACCESS_DENIED = + CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_OS_ACCESS_DENIED, + CSSMERR_CSSM_FUNCTION_FAILED = + CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_FUNCTION_FAILED, + CSSMERR_CSSM_MODULE_MANIFEST_VERIFY_FAILED = + CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_MODULE_MANIFEST_VERIFY_FAILED, + CSSMERR_CSSM_INVALID_GUID = + CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_INVALID_GUID +}; + + +enum { + CSSMERR_CSSM_INVALID_CONTEXT_HANDLE = + CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_INVALID_CONTEXT_HANDLE, + CSSMERR_CSSM_INCOMPATIBLE_VERSION = + CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_INCOMPATIBLE_VERSION, + CSSMERR_CSSM_PRIVILEGE_NOT_GRANTED = + CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_PRIVILEGE_NOT_GRANTED +}; + + +enum { + CSSM_CSSM_BASE_CSSM_ERROR = + CSSM_CSSM_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT + 0x10, + CSSMERR_CSSM_SCOPE_NOT_SUPPORTED = CSSM_CSSM_BASE_CSSM_ERROR + 1, + CSSMERR_CSSM_PVC_ALREADY_CONFIGURED = CSSM_CSSM_BASE_CSSM_ERROR + 2, + CSSMERR_CSSM_INVALID_PVC = CSSM_CSSM_BASE_CSSM_ERROR + 3, + CSSMERR_CSSM_EMM_LOAD_FAILED = CSSM_CSSM_BASE_CSSM_ERROR + 4, + CSSMERR_CSSM_EMM_UNLOAD_FAILED = CSSM_CSSM_BASE_CSSM_ERROR + 5, + CSSMERR_CSSM_ADDIN_LOAD_FAILED = CSSM_CSSM_BASE_CSSM_ERROR + 6, + CSSMERR_CSSM_INVALID_KEY_HIERARCHY = CSSM_CSSM_BASE_CSSM_ERROR + 7, + CSSMERR_CSSM_ADDIN_UNLOAD_FAILED = CSSM_CSSM_BASE_CSSM_ERROR + 8, + CSSMERR_CSSM_LIB_REF_NOT_FOUND = CSSM_CSSM_BASE_CSSM_ERROR + 9, + CSSMERR_CSSM_INVALID_ADDIN_FUNCTION_TABLE = CSSM_CSSM_BASE_CSSM_ERROR + 10, + CSSMERR_CSSM_EMM_AUTHENTICATE_FAILED = CSSM_CSSM_BASE_CSSM_ERROR + 11, + CSSMERR_CSSM_ADDIN_AUTHENTICATE_FAILED = CSSM_CSSM_BASE_CSSM_ERROR + 12, + CSSMERR_CSSM_INVALID_SERVICE_MASK = CSSM_CSSM_BASE_CSSM_ERROR + 13, + CSSMERR_CSSM_MODULE_NOT_LOADED = CSSM_CSSM_BASE_CSSM_ERROR + 14, + CSSMERR_CSSM_INVALID_SUBSERVICEID = CSSM_CSSM_BASE_CSSM_ERROR + 15, + CSSMERR_CSSM_BUFFER_TOO_SMALL = CSSM_CSSM_BASE_CSSM_ERROR + 16, + CSSMERR_CSSM_INVALID_ATTRIBUTE = CSSM_CSSM_BASE_CSSM_ERROR + 17, + CSSMERR_CSSM_ATTRIBUTE_NOT_IN_CONTEXT = CSSM_CSSM_BASE_CSSM_ERROR + 18, + CSSMERR_CSSM_MODULE_MANAGER_INITIALIZE_FAIL = CSSM_CSSM_BASE_CSSM_ERROR + 19, + CSSMERR_CSSM_MODULE_MANAGER_NOT_FOUND = CSSM_CSSM_BASE_CSSM_ERROR + 20, + CSSMERR_CSSM_EVENT_NOTIFICATION_CALLBACK_NOT_FOUND = CSSM_CSSM_BASE_CSSM_ERROR + 21 +}; + + +enum { + CSSMERR_CSP_INTERNAL_ERROR = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INTERNAL_ERROR, + CSSMERR_CSP_MEMORY_ERROR = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_MEMORY_ERROR, + CSSMERR_CSP_MDS_ERROR = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_MDS_ERROR, + CSSMERR_CSP_INVALID_POINTER = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_POINTER, + CSSMERR_CSP_INVALID_INPUT_POINTER = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_INPUT_POINTER, + CSSMERR_CSP_INVALID_OUTPUT_POINTER = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_OUTPUT_POINTER, + CSSMERR_CSP_FUNCTION_NOT_IMPLEMENTED = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED, + CSSMERR_CSP_SELF_CHECK_FAILED = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_SELF_CHECK_FAILED, + CSSMERR_CSP_OS_ACCESS_DENIED = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_OS_ACCESS_DENIED, + CSSMERR_CSP_FUNCTION_FAILED = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_FUNCTION_FAILED +}; + + +enum { + CSSMERR_CSP_OPERATION_AUTH_DENIED = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_OPERATION_AUTH_DENIED, + CSSMERR_CSP_OBJECT_USE_AUTH_DENIED = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_OBJECT_USE_AUTH_DENIED, + CSSMERR_CSP_OBJECT_MANIP_AUTH_DENIED = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_OBJECT_MANIP_AUTH_DENIED, + CSSMERR_CSP_OBJECT_ACL_NOT_SUPPORTED = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_OBJECT_ACL_NOT_SUPPORTED, + CSSMERR_CSP_OBJECT_ACL_REQUIRED = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_OBJECT_ACL_REQUIRED, + CSSMERR_CSP_INVALID_ACCESS_CREDENTIALS = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_ACCESS_CREDENTIALS, + CSSMERR_CSP_INVALID_ACL_BASE_CERTS = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_ACL_BASE_CERTS, + CSSMERR_CSP_ACL_BASE_CERTS_NOT_SUPPORTED = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_ACL_BASE_CERTS_NOT_SUPPORTED, + CSSMERR_CSP_INVALID_SAMPLE_VALUE = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_SAMPLE_VALUE, + CSSMERR_CSP_SAMPLE_VALUE_NOT_SUPPORTED = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_SAMPLE_VALUE_NOT_SUPPORTED, + CSSMERR_CSP_INVALID_ACL_SUBJECT_VALUE = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_ACL_SUBJECT_VALUE, + CSSMERR_CSP_ACL_SUBJECT_TYPE_NOT_SUPPORTED = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_ACL_SUBJECT_TYPE_NOT_SUPPORTED, + CSSMERR_CSP_INVALID_ACL_CHALLENGE_CALLBACK = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_ACL_CHALLENGE_CALLBACK, + CSSMERR_CSP_ACL_CHALLENGE_CALLBACK_FAILED = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_ACL_CHALLENGE_CALLBACK_FAILED, + CSSMERR_CSP_INVALID_ACL_ENTRY_TAG = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_ACL_ENTRY_TAG, + CSSMERR_CSP_ACL_ENTRY_TAG_NOT_FOUND = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_ACL_ENTRY_TAG_NOT_FOUND, + CSSMERR_CSP_INVALID_ACL_EDIT_MODE = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_ACL_EDIT_MODE, + CSSMERR_CSP_ACL_CHANGE_FAILED = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_ACL_CHANGE_FAILED, + CSSMERR_CSP_INVALID_NEW_ACL_ENTRY = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_NEW_ACL_ENTRY, + CSSMERR_CSP_INVALID_NEW_ACL_OWNER = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_NEW_ACL_OWNER, + CSSMERR_CSP_ACL_DELETE_FAILED = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_ACL_DELETE_FAILED, + CSSMERR_CSP_ACL_REPLACE_FAILED = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_ACL_REPLACE_FAILED, + CSSMERR_CSP_ACL_ADD_FAILED = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_ACL_ADD_FAILED +}; + + +enum { + CSSMERR_CSP_INVALID_CONTEXT_HANDLE = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_CONTEXT_HANDLE, + CSSMERR_CSP_PRIVILEGE_NOT_GRANTED = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_PRIVILEGE_NOT_GRANTED, + CSSMERR_CSP_INVALID_DATA = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_DATA, + CSSMERR_CSP_INVALID_PASSTHROUGH_ID = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_PASSTHROUGH_ID, + CSSMERR_CSP_INVALID_CRYPTO_DATA = + CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INVALID_CRYPTO_DATA +}; + + +enum { + + CSSM_CSP_BASE_CSP_ERROR = + CSSM_CSP_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT, + CSSMERR_CSP_INPUT_LENGTH_ERROR = CSSM_CSP_BASE_CSP_ERROR + 1, + CSSMERR_CSP_OUTPUT_LENGTH_ERROR = CSSM_CSP_BASE_CSP_ERROR + 2, + CSSMERR_CSP_PRIVILEGE_NOT_SUPPORTED = CSSM_CSP_BASE_CSP_ERROR + 3, + CSSMERR_CSP_DEVICE_ERROR = CSSM_CSP_BASE_CSP_ERROR + 4, + CSSMERR_CSP_DEVICE_MEMORY_ERROR = CSSM_CSP_BASE_CSP_ERROR + 5, + CSSMERR_CSP_ATTACH_HANDLE_BUSY = CSSM_CSP_BASE_CSP_ERROR + 6, + CSSMERR_CSP_NOT_LOGGED_IN = CSSM_CSP_BASE_CSP_ERROR + 7, + CSSMERR_CSP_INVALID_KEY = CSSM_CSP_BASE_CSP_ERROR + 16, + CSSMERR_CSP_INVALID_KEY_REFERENCE = CSSM_CSP_BASE_CSP_ERROR + 17, + CSSMERR_CSP_INVALID_KEY_CLASS = CSSM_CSP_BASE_CSP_ERROR + 18, + CSSMERR_CSP_ALGID_MISMATCH = CSSM_CSP_BASE_CSP_ERROR + 19, + CSSMERR_CSP_KEY_USAGE_INCORRECT = CSSM_CSP_BASE_CSP_ERROR + 20, + CSSMERR_CSP_KEY_BLOB_TYPE_INCORRECT = CSSM_CSP_BASE_CSP_ERROR + 21, + CSSMERR_CSP_KEY_HEADER_INCONSISTENT = CSSM_CSP_BASE_CSP_ERROR + 22, + CSSMERR_CSP_UNSUPPORTED_KEY_FORMAT = CSSM_CSP_BASE_CSP_ERROR + 23, + CSSMERR_CSP_UNSUPPORTED_KEY_SIZE = CSSM_CSP_BASE_CSP_ERROR + 24, + CSSMERR_CSP_INVALID_KEY_POINTER = CSSM_CSP_BASE_CSP_ERROR + 25, + CSSMERR_CSP_INVALID_KEYUSAGE_MASK = CSSM_CSP_BASE_CSP_ERROR + 26, + CSSMERR_CSP_UNSUPPORTED_KEYUSAGE_MASK = CSSM_CSP_BASE_CSP_ERROR + 27, + CSSMERR_CSP_INVALID_KEYATTR_MASK = CSSM_CSP_BASE_CSP_ERROR + 28, + CSSMERR_CSP_UNSUPPORTED_KEYATTR_MASK = CSSM_CSP_BASE_CSP_ERROR + 29, + CSSMERR_CSP_INVALID_KEY_LABEL = CSSM_CSP_BASE_CSP_ERROR + 30, + CSSMERR_CSP_UNSUPPORTED_KEY_LABEL = CSSM_CSP_BASE_CSP_ERROR + 31, + CSSMERR_CSP_INVALID_KEY_FORMAT = CSSM_CSP_BASE_CSP_ERROR + 32, + + + CSSMERR_CSP_INVALID_DATA_COUNT = CSSM_CSP_BASE_CSP_ERROR + 40, + CSSMERR_CSP_VECTOR_OF_BUFS_UNSUPPORTED = CSSM_CSP_BASE_CSP_ERROR + 41, + CSSMERR_CSP_INVALID_INPUT_VECTOR = CSSM_CSP_BASE_CSP_ERROR + 42, + CSSMERR_CSP_INVALID_OUTPUT_VECTOR = CSSM_CSP_BASE_CSP_ERROR + 43, + + + CSSMERR_CSP_INVALID_CONTEXT = CSSM_CSP_BASE_CSP_ERROR + 48, + CSSMERR_CSP_INVALID_ALGORITHM = CSSM_CSP_BASE_CSP_ERROR + 49, + CSSMERR_CSP_INVALID_ATTR_KEY = CSSM_CSP_BASE_CSP_ERROR + 54, + CSSMERR_CSP_MISSING_ATTR_KEY = CSSM_CSP_BASE_CSP_ERROR + 55, + CSSMERR_CSP_INVALID_ATTR_INIT_VECTOR = CSSM_CSP_BASE_CSP_ERROR + 56, + CSSMERR_CSP_MISSING_ATTR_INIT_VECTOR = CSSM_CSP_BASE_CSP_ERROR + 57, + CSSMERR_CSP_INVALID_ATTR_SALT = CSSM_CSP_BASE_CSP_ERROR + 58, + CSSMERR_CSP_MISSING_ATTR_SALT = CSSM_CSP_BASE_CSP_ERROR + 59, + CSSMERR_CSP_INVALID_ATTR_PADDING = CSSM_CSP_BASE_CSP_ERROR + 60, + CSSMERR_CSP_MISSING_ATTR_PADDING = CSSM_CSP_BASE_CSP_ERROR + 61, + CSSMERR_CSP_INVALID_ATTR_RANDOM = CSSM_CSP_BASE_CSP_ERROR + 62, + CSSMERR_CSP_MISSING_ATTR_RANDOM = CSSM_CSP_BASE_CSP_ERROR + 63, + CSSMERR_CSP_INVALID_ATTR_SEED = CSSM_CSP_BASE_CSP_ERROR + 64, + CSSMERR_CSP_MISSING_ATTR_SEED = CSSM_CSP_BASE_CSP_ERROR + 65, + CSSMERR_CSP_INVALID_ATTR_PASSPHRASE = CSSM_CSP_BASE_CSP_ERROR + 66, + CSSMERR_CSP_MISSING_ATTR_PASSPHRASE = CSSM_CSP_BASE_CSP_ERROR + 67, + CSSMERR_CSP_INVALID_ATTR_KEY_LENGTH = CSSM_CSP_BASE_CSP_ERROR + 68, + CSSMERR_CSP_MISSING_ATTR_KEY_LENGTH = CSSM_CSP_BASE_CSP_ERROR + 69, + CSSMERR_CSP_INVALID_ATTR_BLOCK_SIZE = CSSM_CSP_BASE_CSP_ERROR + 70, + CSSMERR_CSP_MISSING_ATTR_BLOCK_SIZE = CSSM_CSP_BASE_CSP_ERROR + 71, + CSSMERR_CSP_INVALID_ATTR_OUTPUT_SIZE = CSSM_CSP_BASE_CSP_ERROR + 100, + CSSMERR_CSP_MISSING_ATTR_OUTPUT_SIZE = CSSM_CSP_BASE_CSP_ERROR + 101, + CSSMERR_CSP_INVALID_ATTR_ROUNDS = CSSM_CSP_BASE_CSP_ERROR + 102, + CSSMERR_CSP_MISSING_ATTR_ROUNDS = CSSM_CSP_BASE_CSP_ERROR + 103, + CSSMERR_CSP_INVALID_ATTR_ALG_PARAMS = CSSM_CSP_BASE_CSP_ERROR + 104, + CSSMERR_CSP_MISSING_ATTR_ALG_PARAMS = CSSM_CSP_BASE_CSP_ERROR + 105, + CSSMERR_CSP_INVALID_ATTR_LABEL = CSSM_CSP_BASE_CSP_ERROR + 106, + CSSMERR_CSP_MISSING_ATTR_LABEL = CSSM_CSP_BASE_CSP_ERROR + 107, + CSSMERR_CSP_INVALID_ATTR_KEY_TYPE = CSSM_CSP_BASE_CSP_ERROR + 108, + CSSMERR_CSP_MISSING_ATTR_KEY_TYPE = CSSM_CSP_BASE_CSP_ERROR + 109, + CSSMERR_CSP_INVALID_ATTR_MODE = CSSM_CSP_BASE_CSP_ERROR + 110, + CSSMERR_CSP_MISSING_ATTR_MODE = CSSM_CSP_BASE_CSP_ERROR + 111, + CSSMERR_CSP_INVALID_ATTR_EFFECTIVE_BITS = CSSM_CSP_BASE_CSP_ERROR + 112, + CSSMERR_CSP_MISSING_ATTR_EFFECTIVE_BITS = CSSM_CSP_BASE_CSP_ERROR + 113, + CSSMERR_CSP_INVALID_ATTR_START_DATE = CSSM_CSP_BASE_CSP_ERROR + 114, + CSSMERR_CSP_MISSING_ATTR_START_DATE = CSSM_CSP_BASE_CSP_ERROR + 115, + CSSMERR_CSP_INVALID_ATTR_END_DATE = CSSM_CSP_BASE_CSP_ERROR + 116, + CSSMERR_CSP_MISSING_ATTR_END_DATE = CSSM_CSP_BASE_CSP_ERROR + 117, + CSSMERR_CSP_INVALID_ATTR_VERSION = CSSM_CSP_BASE_CSP_ERROR + 118, + CSSMERR_CSP_MISSING_ATTR_VERSION = CSSM_CSP_BASE_CSP_ERROR + 119, + CSSMERR_CSP_INVALID_ATTR_PRIME = CSSM_CSP_BASE_CSP_ERROR + 120, + CSSMERR_CSP_MISSING_ATTR_PRIME = CSSM_CSP_BASE_CSP_ERROR + 121, + CSSMERR_CSP_INVALID_ATTR_BASE = CSSM_CSP_BASE_CSP_ERROR + 122, + CSSMERR_CSP_MISSING_ATTR_BASE = CSSM_CSP_BASE_CSP_ERROR + 123, + CSSMERR_CSP_INVALID_ATTR_SUBPRIME = CSSM_CSP_BASE_CSP_ERROR + 124, + CSSMERR_CSP_MISSING_ATTR_SUBPRIME = CSSM_CSP_BASE_CSP_ERROR + 125, + CSSMERR_CSP_INVALID_ATTR_ITERATION_COUNT = CSSM_CSP_BASE_CSP_ERROR + 126, + CSSMERR_CSP_MISSING_ATTR_ITERATION_COUNT = CSSM_CSP_BASE_CSP_ERROR + 127, + CSSMERR_CSP_INVALID_ATTR_DL_DB_HANDLE = CSSM_CSP_BASE_CSP_ERROR + 128, + CSSMERR_CSP_MISSING_ATTR_DL_DB_HANDLE = CSSM_CSP_BASE_CSP_ERROR + 129, + CSSMERR_CSP_INVALID_ATTR_ACCESS_CREDENTIALS = CSSM_CSP_BASE_CSP_ERROR + 130, + CSSMERR_CSP_MISSING_ATTR_ACCESS_CREDENTIALS = CSSM_CSP_BASE_CSP_ERROR + 131, + CSSMERR_CSP_INVALID_ATTR_PUBLIC_KEY_FORMAT = CSSM_CSP_BASE_CSP_ERROR + 132, + CSSMERR_CSP_MISSING_ATTR_PUBLIC_KEY_FORMAT = CSSM_CSP_BASE_CSP_ERROR + 133, + CSSMERR_CSP_INVALID_ATTR_PRIVATE_KEY_FORMAT = CSSM_CSP_BASE_CSP_ERROR + 134, + CSSMERR_CSP_MISSING_ATTR_PRIVATE_KEY_FORMAT = CSSM_CSP_BASE_CSP_ERROR + 135, + CSSMERR_CSP_INVALID_ATTR_SYMMETRIC_KEY_FORMAT = CSSM_CSP_BASE_CSP_ERROR + 136, + CSSMERR_CSP_MISSING_ATTR_SYMMETRIC_KEY_FORMAT = CSSM_CSP_BASE_CSP_ERROR + 137, + CSSMERR_CSP_INVALID_ATTR_WRAPPED_KEY_FORMAT = CSSM_CSP_BASE_CSP_ERROR + 138, + CSSMERR_CSP_MISSING_ATTR_WRAPPED_KEY_FORMAT = CSSM_CSP_BASE_CSP_ERROR + 139, + + + CSSMERR_CSP_STAGED_OPERATION_IN_PROGRESS = CSSM_CSP_BASE_CSP_ERROR + 72, + CSSMERR_CSP_STAGED_OPERATION_NOT_STARTED = CSSM_CSP_BASE_CSP_ERROR + 73, + CSSMERR_CSP_VERIFY_FAILED = CSSM_CSP_BASE_CSP_ERROR + 74, + CSSMERR_CSP_INVALID_SIGNATURE = CSSM_CSP_BASE_CSP_ERROR + 75, + CSSMERR_CSP_QUERY_SIZE_UNKNOWN = CSSM_CSP_BASE_CSP_ERROR + 76, + CSSMERR_CSP_BLOCK_SIZE_MISMATCH = CSSM_CSP_BASE_CSP_ERROR + 77, + CSSMERR_CSP_PRIVATE_KEY_NOT_FOUND = CSSM_CSP_BASE_CSP_ERROR + 78, + CSSMERR_CSP_PUBLIC_KEY_INCONSISTENT = CSSM_CSP_BASE_CSP_ERROR + 79, + CSSMERR_CSP_DEVICE_VERIFY_FAILED = CSSM_CSP_BASE_CSP_ERROR + 80, + CSSMERR_CSP_INVALID_LOGIN_NAME = CSSM_CSP_BASE_CSP_ERROR + 81, + CSSMERR_CSP_ALREADY_LOGGED_IN = CSSM_CSP_BASE_CSP_ERROR + 82, + CSSMERR_CSP_PRIVATE_KEY_ALREADY_EXISTS = CSSM_CSP_BASE_CSP_ERROR + 83, + CSSMERR_CSP_KEY_LABEL_ALREADY_EXISTS = CSSM_CSP_BASE_CSP_ERROR + 84, + CSSMERR_CSP_INVALID_DIGEST_ALGORITHM = CSSM_CSP_BASE_CSP_ERROR + 85, + CSSMERR_CSP_CRYPTO_DATA_CALLBACK_FAILED = CSSM_CSP_BASE_CSP_ERROR + 86 +}; + + + +enum { + CSSMERR_TP_INTERNAL_ERROR = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INTERNAL_ERROR, + CSSMERR_TP_MEMORY_ERROR = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_MEMORY_ERROR, + CSSMERR_TP_MDS_ERROR = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_MDS_ERROR, + CSSMERR_TP_INVALID_POINTER = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_POINTER, + CSSMERR_TP_INVALID_INPUT_POINTER = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_INPUT_POINTER, + CSSMERR_TP_INVALID_OUTPUT_POINTER = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_OUTPUT_POINTER, + CSSMERR_TP_FUNCTION_NOT_IMPLEMENTED = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED, + CSSMERR_TP_SELF_CHECK_FAILED = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_SELF_CHECK_FAILED, + CSSMERR_TP_OS_ACCESS_DENIED = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_OS_ACCESS_DENIED, + CSSMERR_TP_FUNCTION_FAILED = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_FUNCTION_FAILED, + CSSMERR_TP_INVALID_CONTEXT_HANDLE = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_CONTEXT_HANDLE, + CSSMERR_TP_INVALID_DATA = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_DATA, + CSSMERR_TP_INVALID_DB_LIST = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_DB_LIST, + CSSMERR_TP_INVALID_CERTGROUP_POINTER = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_CERTGROUP_POINTER, + CSSMERR_TP_INVALID_CERT_POINTER = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_CERT_POINTER, + CSSMERR_TP_INVALID_CRL_POINTER = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_CRL_POINTER, + CSSMERR_TP_INVALID_FIELD_POINTER = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_FIELD_POINTER, + CSSMERR_TP_INVALID_NETWORK_ADDR = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_NETWORK_ADDR, + CSSMERR_TP_CRL_ALREADY_SIGNED = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_CRL_ALREADY_SIGNED, + CSSMERR_TP_INVALID_NUMBER_OF_FIELDS = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_NUMBER_OF_FIELDS, + CSSMERR_TP_VERIFICATION_FAILURE = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_VERIFICATION_FAILURE, + CSSMERR_TP_INVALID_DB_HANDLE = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_DB_HANDLE, + CSSMERR_TP_UNKNOWN_FORMAT = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_UNKNOWN_FORMAT, + CSSMERR_TP_UNKNOWN_TAG = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_UNKNOWN_TAG, + CSSMERR_TP_INVALID_PASSTHROUGH_ID = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_PASSTHROUGH_ID, + CSSMERR_TP_INVALID_CSP_HANDLE = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_CSP_HANDLE, + CSSMERR_TP_INVALID_DL_HANDLE = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_DL_HANDLE, + CSSMERR_TP_INVALID_CL_HANDLE = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_CL_HANDLE, + CSSMERR_TP_INVALID_DB_LIST_POINTER = + CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INVALID_DB_LIST_POINTER +}; + + +enum { + CSSM_TP_BASE_TP_ERROR = + CSSM_TP_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT, + CSSMERR_TP_INVALID_CALLERAUTH_CONTEXT_POINTER = CSSM_TP_BASE_TP_ERROR + 1, + CSSMERR_TP_INVALID_IDENTIFIER_POINTER = CSSM_TP_BASE_TP_ERROR + 2, + CSSMERR_TP_INVALID_KEYCACHE_HANDLE = CSSM_TP_BASE_TP_ERROR + 3, + CSSMERR_TP_INVALID_CERTGROUP = CSSM_TP_BASE_TP_ERROR + 4, + CSSMERR_TP_INVALID_CRLGROUP = CSSM_TP_BASE_TP_ERROR + 5, + CSSMERR_TP_INVALID_CRLGROUP_POINTER = CSSM_TP_BASE_TP_ERROR + 6, + CSSMERR_TP_AUTHENTICATION_FAILED = CSSM_TP_BASE_TP_ERROR + 7, + CSSMERR_TP_CERTGROUP_INCOMPLETE = CSSM_TP_BASE_TP_ERROR + 8, + CSSMERR_TP_CERTIFICATE_CANT_OPERATE = CSSM_TP_BASE_TP_ERROR + 9, + CSSMERR_TP_CERT_EXPIRED = CSSM_TP_BASE_TP_ERROR + 10, + CSSMERR_TP_CERT_NOT_VALID_YET = CSSM_TP_BASE_TP_ERROR + 11, + CSSMERR_TP_CERT_REVOKED = CSSM_TP_BASE_TP_ERROR + 12, + CSSMERR_TP_CERT_SUSPENDED = CSSM_TP_BASE_TP_ERROR + 13, + CSSMERR_TP_INSUFFICIENT_CREDENTIALS = CSSM_TP_BASE_TP_ERROR + 14, + CSSMERR_TP_INVALID_ACTION = CSSM_TP_BASE_TP_ERROR + 15, + CSSMERR_TP_INVALID_ACTION_DATA = CSSM_TP_BASE_TP_ERROR + 16, + CSSMERR_TP_INVALID_ANCHOR_CERT = CSSM_TP_BASE_TP_ERROR + 18, + CSSMERR_TP_INVALID_AUTHORITY = CSSM_TP_BASE_TP_ERROR + 19, + CSSMERR_TP_VERIFY_ACTION_FAILED = CSSM_TP_BASE_TP_ERROR + 20, + CSSMERR_TP_INVALID_CERTIFICATE = CSSM_TP_BASE_TP_ERROR + 21, + CSSMERR_TP_INVALID_CERT_AUTHORITY = CSSM_TP_BASE_TP_ERROR + 22, + CSSMERR_TP_INVALID_CRL_AUTHORITY = CSSM_TP_BASE_TP_ERROR + 23, + CSSMERR_TP_INVALID_CRL_ENCODING = CSSM_TP_BASE_TP_ERROR + 24, + CSSMERR_TP_INVALID_CRL_TYPE = CSSM_TP_BASE_TP_ERROR + 25, + CSSMERR_TP_INVALID_CRL = CSSM_TP_BASE_TP_ERROR + 26, + CSSMERR_TP_INVALID_FORM_TYPE = CSSM_TP_BASE_TP_ERROR + 27, + CSSMERR_TP_INVALID_ID = CSSM_TP_BASE_TP_ERROR + 28, + CSSMERR_TP_INVALID_IDENTIFIER = CSSM_TP_BASE_TP_ERROR + 29, + CSSMERR_TP_INVALID_INDEX = CSSM_TP_BASE_TP_ERROR + 30, + CSSMERR_TP_INVALID_NAME = CSSM_TP_BASE_TP_ERROR + 31, + CSSMERR_TP_INVALID_POLICY_IDENTIFIERS = CSSM_TP_BASE_TP_ERROR + 32, + CSSMERR_TP_INVALID_TIMESTRING = CSSM_TP_BASE_TP_ERROR + 33, + CSSMERR_TP_INVALID_REASON = CSSM_TP_BASE_TP_ERROR + 34, + CSSMERR_TP_INVALID_REQUEST_INPUTS = CSSM_TP_BASE_TP_ERROR + 35, + CSSMERR_TP_INVALID_RESPONSE_VECTOR = CSSM_TP_BASE_TP_ERROR + 36, + CSSMERR_TP_INVALID_SIGNATURE = CSSM_TP_BASE_TP_ERROR + 37, + CSSMERR_TP_INVALID_STOP_ON_POLICY = CSSM_TP_BASE_TP_ERROR + 38, + CSSMERR_TP_INVALID_CALLBACK = CSSM_TP_BASE_TP_ERROR + 39, + CSSMERR_TP_INVALID_TUPLE = CSSM_TP_BASE_TP_ERROR + 40, + CSSMERR_TP_NOT_SIGNER = CSSM_TP_BASE_TP_ERROR + 41, + CSSMERR_TP_NOT_TRUSTED = CSSM_TP_BASE_TP_ERROR + 42, + CSSMERR_TP_NO_DEFAULT_AUTHORITY = CSSM_TP_BASE_TP_ERROR + 43, + CSSMERR_TP_REJECTED_FORM = CSSM_TP_BASE_TP_ERROR + 44, + CSSMERR_TP_REQUEST_LOST = CSSM_TP_BASE_TP_ERROR + 45, + CSSMERR_TP_REQUEST_REJECTED = CSSM_TP_BASE_TP_ERROR + 46, + CSSMERR_TP_UNSUPPORTED_ADDR_TYPE = CSSM_TP_BASE_TP_ERROR + 47, + CSSMERR_TP_UNSUPPORTED_SERVICE = CSSM_TP_BASE_TP_ERROR + 48, + CSSMERR_TP_INVALID_TUPLEGROUP_POINTER = CSSM_TP_BASE_TP_ERROR + 49, + CSSMERR_TP_INVALID_TUPLEGROUP = CSSM_TP_BASE_TP_ERROR + 50 +}; + + +enum { + CSSMERR_AC_INTERNAL_ERROR = + CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INTERNAL_ERROR, + CSSMERR_AC_MEMORY_ERROR = + CSSM_AC_BASE_ERROR + CSSM_ERRCODE_MEMORY_ERROR, + CSSMERR_AC_MDS_ERROR = + CSSM_AC_BASE_ERROR + CSSM_ERRCODE_MDS_ERROR, + CSSMERR_AC_INVALID_POINTER = + CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_POINTER, + CSSMERR_AC_INVALID_INPUT_POINTER = + CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_INPUT_POINTER, + CSSMERR_AC_INVALID_OUTPUT_POINTER = + CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_OUTPUT_POINTER, + CSSMERR_AC_FUNCTION_NOT_IMPLEMENTED = + CSSM_AC_BASE_ERROR + CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED, + CSSMERR_AC_SELF_CHECK_FAILED = + CSSM_AC_BASE_ERROR + CSSM_ERRCODE_SELF_CHECK_FAILED, + CSSMERR_AC_OS_ACCESS_DENIED = + CSSM_AC_BASE_ERROR + CSSM_ERRCODE_OS_ACCESS_DENIED, + CSSMERR_AC_FUNCTION_FAILED = + CSSM_AC_BASE_ERROR + CSSM_ERRCODE_FUNCTION_FAILED, + CSSMERR_AC_INVALID_CONTEXT_HANDLE = + CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_CONTEXT_HANDLE, + CSSMERR_AC_INVALID_DATA = + CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_DATA, + CSSMERR_AC_INVALID_DB_LIST = + CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_DB_LIST, + CSSMERR_AC_INVALID_PASSTHROUGH_ID = + CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_PASSTHROUGH_ID, + CSSMERR_AC_INVALID_DL_HANDLE = + CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_DL_HANDLE, + CSSMERR_AC_INVALID_CL_HANDLE = + CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_CL_HANDLE, + CSSMERR_AC_INVALID_TP_HANDLE = + CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_TP_HANDLE, + CSSMERR_AC_INVALID_DB_HANDLE = + CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_DB_HANDLE, + CSSMERR_AC_INVALID_DB_LIST_POINTER = + CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INVALID_DB_LIST_POINTER +}; + + +enum { + CSSM_AC_BASE_AC_ERROR = + CSSM_AC_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT, + CSSMERR_AC_INVALID_BASE_ACLS = CSSM_AC_BASE_AC_ERROR + 1, + CSSMERR_AC_INVALID_TUPLE_CREDENTIALS = CSSM_AC_BASE_AC_ERROR + 2, + CSSMERR_AC_INVALID_ENCODING = CSSM_AC_BASE_AC_ERROR + 3, + CSSMERR_AC_INVALID_VALIDITY_PERIOD = CSSM_AC_BASE_AC_ERROR + 4, + CSSMERR_AC_INVALID_REQUESTOR = CSSM_AC_BASE_AC_ERROR + 5, + CSSMERR_AC_INVALID_REQUEST_DESCRIPTOR = CSSM_AC_BASE_AC_ERROR + 6 +}; + + +enum { + CSSMERR_CL_INTERNAL_ERROR = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INTERNAL_ERROR, + CSSMERR_CL_MEMORY_ERROR = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_MEMORY_ERROR, + CSSMERR_CL_MDS_ERROR = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_MDS_ERROR, + CSSMERR_CL_INVALID_POINTER = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_POINTER, + CSSMERR_CL_INVALID_INPUT_POINTER = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_INPUT_POINTER, + CSSMERR_CL_INVALID_OUTPUT_POINTER = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_OUTPUT_POINTER, + CSSMERR_CL_FUNCTION_NOT_IMPLEMENTED = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED, + CSSMERR_CL_SELF_CHECK_FAILED = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_SELF_CHECK_FAILED, + CSSMERR_CL_OS_ACCESS_DENIED = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_OS_ACCESS_DENIED, + CSSMERR_CL_FUNCTION_FAILED = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_FUNCTION_FAILED, + CSSMERR_CL_INVALID_CONTEXT_HANDLE = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_CONTEXT_HANDLE, + CSSMERR_CL_INVALID_CERTGROUP_POINTER = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_CERTGROUP_POINTER, + CSSMERR_CL_INVALID_CERT_POINTER = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_CERT_POINTER, + CSSMERR_CL_INVALID_CRL_POINTER = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_CRL_POINTER, + CSSMERR_CL_INVALID_FIELD_POINTER = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_FIELD_POINTER, + CSSMERR_CL_INVALID_DATA = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_DATA, + CSSMERR_CL_CRL_ALREADY_SIGNED = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_CRL_ALREADY_SIGNED, + CSSMERR_CL_INVALID_NUMBER_OF_FIELDS = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_NUMBER_OF_FIELDS, + CSSMERR_CL_VERIFICATION_FAILURE = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_VERIFICATION_FAILURE, + CSSMERR_CL_UNKNOWN_FORMAT = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_UNKNOWN_FORMAT, + CSSMERR_CL_UNKNOWN_TAG = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_UNKNOWN_TAG, + CSSMERR_CL_INVALID_PASSTHROUGH_ID = + CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INVALID_PASSTHROUGH_ID +}; + + +enum { + CSSM_CL_BASE_CL_ERROR = + CSSM_CL_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT, + CSSMERR_CL_INVALID_BUNDLE_POINTER = CSSM_CL_BASE_CL_ERROR + 1, + CSSMERR_CL_INVALID_CACHE_HANDLE = CSSM_CL_BASE_CL_ERROR + 2, + CSSMERR_CL_INVALID_RESULTS_HANDLE = CSSM_CL_BASE_CL_ERROR + 3, + CSSMERR_CL_INVALID_BUNDLE_INFO = CSSM_CL_BASE_CL_ERROR + 4, + CSSMERR_CL_INVALID_CRL_INDEX = CSSM_CL_BASE_CL_ERROR + 5, + CSSMERR_CL_INVALID_SCOPE = CSSM_CL_BASE_CL_ERROR + 6, + CSSMERR_CL_NO_FIELD_VALUES = CSSM_CL_BASE_CL_ERROR + 7, + CSSMERR_CL_SCOPE_NOT_SUPPORTED = CSSM_CL_BASE_CL_ERROR + 8 +}; + + +enum { + CSSMERR_DL_INTERNAL_ERROR = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INTERNAL_ERROR, + CSSMERR_DL_MEMORY_ERROR = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_MEMORY_ERROR, + CSSMERR_DL_MDS_ERROR = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_MDS_ERROR, + CSSMERR_DL_INVALID_POINTER = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_POINTER, + CSSMERR_DL_INVALID_INPUT_POINTER = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_INPUT_POINTER, + CSSMERR_DL_INVALID_OUTPUT_POINTER = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_OUTPUT_POINTER, + CSSMERR_DL_FUNCTION_NOT_IMPLEMENTED = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED, + CSSMERR_DL_SELF_CHECK_FAILED = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_SELF_CHECK_FAILED, + CSSMERR_DL_OS_ACCESS_DENIED = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_OS_ACCESS_DENIED, + CSSMERR_DL_FUNCTION_FAILED = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_FUNCTION_FAILED, + CSSMERR_DL_INVALID_CSP_HANDLE = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_CSP_HANDLE, + CSSMERR_DL_INVALID_DL_HANDLE = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_DL_HANDLE, + CSSMERR_DL_INVALID_CL_HANDLE = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_CL_HANDLE, + CSSMERR_DL_INVALID_DB_LIST_POINTER = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_DB_LIST_POINTER +}; + + +enum { + CSSMERR_DL_OPERATION_AUTH_DENIED = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_OPERATION_AUTH_DENIED, + CSSMERR_DL_OBJECT_USE_AUTH_DENIED = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_OBJECT_USE_AUTH_DENIED, + CSSMERR_DL_OBJECT_MANIP_AUTH_DENIED = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_OBJECT_MANIP_AUTH_DENIED, + CSSMERR_DL_OBJECT_ACL_NOT_SUPPORTED = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_OBJECT_ACL_NOT_SUPPORTED, + CSSMERR_DL_OBJECT_ACL_REQUIRED = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_OBJECT_ACL_REQUIRED, + CSSMERR_DL_INVALID_ACCESS_CREDENTIALS = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_ACCESS_CREDENTIALS, + CSSMERR_DL_INVALID_ACL_BASE_CERTS = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_ACL_BASE_CERTS, + CSSMERR_DL_ACL_BASE_CERTS_NOT_SUPPORTED = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_ACL_BASE_CERTS_NOT_SUPPORTED, + CSSMERR_DL_INVALID_SAMPLE_VALUE = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_SAMPLE_VALUE, + CSSMERR_DL_SAMPLE_VALUE_NOT_SUPPORTED = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_SAMPLE_VALUE_NOT_SUPPORTED, + CSSMERR_DL_INVALID_ACL_SUBJECT_VALUE = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_ACL_SUBJECT_VALUE, + CSSMERR_DL_ACL_SUBJECT_TYPE_NOT_SUPPORTED = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_ACL_SUBJECT_TYPE_NOT_SUPPORTED, + CSSMERR_DL_INVALID_ACL_CHALLENGE_CALLBACK = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_ACL_CHALLENGE_CALLBACK, + CSSMERR_DL_ACL_CHALLENGE_CALLBACK_FAILED = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_ACL_CHALLENGE_CALLBACK_FAILED, + CSSMERR_DL_INVALID_ACL_ENTRY_TAG = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_ACL_ENTRY_TAG, + CSSMERR_DL_ACL_ENTRY_TAG_NOT_FOUND = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_ACL_ENTRY_TAG_NOT_FOUND, + CSSMERR_DL_INVALID_ACL_EDIT_MODE = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_ACL_EDIT_MODE, + CSSMERR_DL_ACL_CHANGE_FAILED = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_ACL_CHANGE_FAILED, + CSSMERR_DL_INVALID_NEW_ACL_ENTRY = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_NEW_ACL_ENTRY, + CSSMERR_DL_INVALID_NEW_ACL_OWNER = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_NEW_ACL_OWNER, + CSSMERR_DL_ACL_DELETE_FAILED = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_ACL_DELETE_FAILED, + CSSMERR_DL_ACL_REPLACE_FAILED = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_ACL_REPLACE_FAILED, + CSSMERR_DL_ACL_ADD_FAILED = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_ACL_ADD_FAILED +}; + + +enum { + CSSMERR_DL_INVALID_DB_HANDLE = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_DB_HANDLE, + CSSMERR_DL_INVALID_PASSTHROUGH_ID = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_PASSTHROUGH_ID, + CSSMERR_DL_INVALID_NETWORK_ADDR = + CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INVALID_NETWORK_ADDR +}; + + +enum { + CSSM_DL_BASE_DL_ERROR = + CSSM_DL_BASE_ERROR + CSSM_ERRORCODE_COMMON_EXTENT, + CSSMERR_DL_DATABASE_CORRUPT = CSSM_DL_BASE_DL_ERROR + 1, + CSSMERR_DL_INVALID_RECORD_INDEX = CSSM_DL_BASE_DL_ERROR + 8, + CSSMERR_DL_INVALID_RECORDTYPE = CSSM_DL_BASE_DL_ERROR + 9, + CSSMERR_DL_INVALID_FIELD_NAME = CSSM_DL_BASE_DL_ERROR + 10, + CSSMERR_DL_UNSUPPORTED_FIELD_FORMAT = CSSM_DL_BASE_DL_ERROR + 11, + CSSMERR_DL_UNSUPPORTED_INDEX_INFO = CSSM_DL_BASE_DL_ERROR + 12, + CSSMERR_DL_UNSUPPORTED_LOCALITY = CSSM_DL_BASE_DL_ERROR + 13, + CSSMERR_DL_UNSUPPORTED_NUM_ATTRIBUTES = CSSM_DL_BASE_DL_ERROR + 14, + CSSMERR_DL_UNSUPPORTED_NUM_INDEXES = CSSM_DL_BASE_DL_ERROR + 15, + CSSMERR_DL_UNSUPPORTED_NUM_RECORDTYPES = CSSM_DL_BASE_DL_ERROR + 16, + CSSMERR_DL_UNSUPPORTED_RECORDTYPE = CSSM_DL_BASE_DL_ERROR + 17, + CSSMERR_DL_FIELD_SPECIFIED_MULTIPLE = CSSM_DL_BASE_DL_ERROR + 18, + CSSMERR_DL_INCOMPATIBLE_FIELD_FORMAT = CSSM_DL_BASE_DL_ERROR + 19, + CSSMERR_DL_INVALID_PARSING_MODULE = CSSM_DL_BASE_DL_ERROR + 20, + CSSMERR_DL_INVALID_DB_NAME = CSSM_DL_BASE_DL_ERROR + 22, + CSSMERR_DL_DATASTORE_DOESNOT_EXIST = CSSM_DL_BASE_DL_ERROR + 23, + CSSMERR_DL_DATASTORE_ALREADY_EXISTS = CSSM_DL_BASE_DL_ERROR + 24, + CSSMERR_DL_DB_LOCKED = CSSM_DL_BASE_DL_ERROR + 25, + CSSMERR_DL_DATASTORE_IS_OPEN = CSSM_DL_BASE_DL_ERROR + 26, + CSSMERR_DL_RECORD_NOT_FOUND = CSSM_DL_BASE_DL_ERROR + 27, + CSSMERR_DL_MISSING_VALUE = CSSM_DL_BASE_DL_ERROR + 28, + CSSMERR_DL_UNSUPPORTED_QUERY = CSSM_DL_BASE_DL_ERROR + 29, + CSSMERR_DL_UNSUPPORTED_QUERY_LIMITS = CSSM_DL_BASE_DL_ERROR + 30, + CSSMERR_DL_UNSUPPORTED_NUM_SELECTION_PREDS = CSSM_DL_BASE_DL_ERROR + 31, + CSSMERR_DL_UNSUPPORTED_OPERATOR = CSSM_DL_BASE_DL_ERROR + 33, + CSSMERR_DL_INVALID_RESULTS_HANDLE = CSSM_DL_BASE_DL_ERROR + 34, + CSSMERR_DL_INVALID_DB_LOCATION = CSSM_DL_BASE_DL_ERROR + 35, + CSSMERR_DL_INVALID_ACCESS_REQUEST = CSSM_DL_BASE_DL_ERROR + 36, + CSSMERR_DL_INVALID_INDEX_INFO = CSSM_DL_BASE_DL_ERROR + 37, + CSSMERR_DL_INVALID_SELECTION_TAG = CSSM_DL_BASE_DL_ERROR + 38, + CSSMERR_DL_INVALID_NEW_OWNER = CSSM_DL_BASE_DL_ERROR + 39, + CSSMERR_DL_INVALID_RECORD_UID = CSSM_DL_BASE_DL_ERROR + 40, + CSSMERR_DL_INVALID_UNIQUE_INDEX_DATA = CSSM_DL_BASE_DL_ERROR + 41, + CSSMERR_DL_INVALID_MODIFY_MODE = CSSM_DL_BASE_DL_ERROR + 42, + CSSMERR_DL_INVALID_OPEN_PARAMETERS = CSSM_DL_BASE_DL_ERROR + 43, + CSSMERR_DL_RECORD_MODIFIED = CSSM_DL_BASE_DL_ERROR + 44, + CSSMERR_DL_ENDOFDATA = CSSM_DL_BASE_DL_ERROR + 45, + CSSMERR_DL_INVALID_QUERY = CSSM_DL_BASE_DL_ERROR + 46, + CSSMERR_DL_INVALID_VALUE = CSSM_DL_BASE_DL_ERROR + 47, + CSSMERR_DL_MULTIPLE_VALUES_UNSUPPORTED = CSSM_DL_BASE_DL_ERROR + 48, + CSSMERR_DL_STALE_UNIQUE_RECORD = CSSM_DL_BASE_DL_ERROR + 49 +}; + + + +typedef CSSM_INTPTR CSSM_HANDLE, *CSSM_HANDLE_PTR; + +typedef uint64 CSSM_LONG_HANDLE, *CSSM_LONG_HANDLE_PTR; + +typedef CSSM_HANDLE CSSM_MODULE_HANDLE, *CSSM_MODULE_HANDLE_PTR; + +typedef CSSM_LONG_HANDLE CSSM_CC_HANDLE; + +typedef CSSM_MODULE_HANDLE CSSM_CSP_HANDLE; + +typedef CSSM_MODULE_HANDLE CSSM_TP_HANDLE; + +typedef CSSM_MODULE_HANDLE CSSM_AC_HANDLE; + +typedef CSSM_MODULE_HANDLE CSSM_CL_HANDLE; + +typedef CSSM_MODULE_HANDLE CSSM_DL_HANDLE; + +typedef CSSM_MODULE_HANDLE CSSM_DB_HANDLE; + + + +enum { + CSSM_INVALID_HANDLE = 0 +}; + + + + +typedef sint32 CSSM_BOOL; +enum { + CSSM_FALSE = 0, + CSSM_TRUE = !CSSM_FALSE +}; + + +typedef sint32 CSSM_RETURN; +enum { + CSSM_OK = 0 +}; + +enum { + CSSM_MODULE_STRING_SIZE = 64 +}; +typedef char CSSM_STRING [CSSM_MODULE_STRING_SIZE + 4]; + +typedef struct cssm_data { + CSSM_SIZE Length; + uint8 *Data; +} CSSM_DATA __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_DATA_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_guid { + uint32 Data1; + uint16 Data2; + uint16 Data3; + uint8 Data4[8]; +} CSSM_GUID __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_GUID_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_BITMASK; +typedef CSSM_BITMASK CSSM_KEY_HIERARCHY; +enum { + CSSM_KEY_HIERARCHY_NONE = 0, + CSSM_KEY_HIERARCHY_INTEG = 1, + CSSM_KEY_HIERARCHY_EXPORT = 2 +}; + +typedef CSSM_BITMASK CSSM_PVC_MODE; +enum { + CSSM_PVC_NONE = 0, + CSSM_PVC_APP = 1, + CSSM_PVC_SP = 2 +}; + +typedef uint32 CSSM_PRIVILEGE_SCOPE; +enum { + CSSM_PRIVILEGE_SCOPE_NONE = 0, + CSSM_PRIVILEGE_SCOPE_PROCESS = 1, + CSSM_PRIVILEGE_SCOPE_THREAD = 2 +}; + +typedef struct cssm_version { + uint32 Major; + uint32 Minor; +} CSSM_VERSION __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_VERSION_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_SERVICE_MASK; +enum { + CSSM_SERVICE_CSSM = 0x1, + CSSM_SERVICE_CSP = 0x2, + CSSM_SERVICE_DL = 0x4, + CSSM_SERVICE_CL = 0x8, + CSSM_SERVICE_TP = 0x10, + CSSM_SERVICE_AC = 0x20, + CSSM_SERVICE_KR = 0x40 +}; + +typedef CSSM_SERVICE_MASK CSSM_SERVICE_TYPE; + +typedef struct cssm_subservice_uid { + CSSM_GUID Guid; + CSSM_VERSION Version; + uint32 SubserviceId; + CSSM_SERVICE_TYPE SubserviceType; +} CSSM_SUBSERVICE_UID __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_SUBSERVICE_UID_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_MODULE_EVENT, *CSSM_MODULE_EVENT_PTR; +enum { + CSSM_NOTIFY_INSERT = 1, + CSSM_NOTIFY_REMOVE = 2, + CSSM_NOTIFY_FAULT = 3 +}; + +typedef CSSM_RETURN ( *CSSM_API_ModuleEventHandler) + (const CSSM_GUID *ModuleGuid, + void* AppNotifyCallbackCtx, + uint32 SubserviceId, + CSSM_SERVICE_TYPE ServiceType, + CSSM_MODULE_EVENT EventType); + +typedef uint32 CSSM_ATTACH_FLAGS; +enum { + CSSM_ATTACH_READ_ONLY = 0x00000001 +}; + + + +typedef uint64 CSSM_PRIVILEGE; +typedef CSSM_PRIVILEGE CSSM_USEE_TAG; +enum { + CSSM_USEE_LAST = 0xFF, + CSSM_USEE_NONE = 0, + CSSM_USEE_DOMESTIC = 1, + CSSM_USEE_FINANCIAL = 2, + CSSM_USEE_KRLE = 3, + CSSM_USEE_KRENT = 4, + CSSM_USEE_SSL = 5, + CSSM_USEE_AUTHENTICATION = 6, + CSSM_USEE_KEYEXCH = 7, + CSSM_USEE_MEDICAL = 8, + CSSM_USEE_INSURANCE = 9, + CSSM_USEE_WEAK = 10 +}; + +typedef uint32 CSSM_NET_ADDRESS_TYPE; +enum { + CSSM_ADDR_NONE = 0, + CSSM_ADDR_CUSTOM = 1, + CSSM_ADDR_URL = 2, + CSSM_ADDR_SOCKADDR = 3, + CSSM_ADDR_NAME = 4 +}; + +typedef struct cssm_net_address { + CSSM_NET_ADDRESS_TYPE AddressType; + CSSM_DATA Address; +} CSSM_NET_ADDRESS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_NET_ADDRESS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_NET_PROTOCOL; +enum { + CSSM_NET_PROTO_NONE = 0, + CSSM_NET_PROTO_CUSTOM = 1, + CSSM_NET_PROTO_UNSPECIFIED = 2, + CSSM_NET_PROTO_LDAP = 3, + CSSM_NET_PROTO_LDAPS = 4, + CSSM_NET_PROTO_LDAPNS = 5, + CSSM_NET_PROTO_X500DAP = 6, + CSSM_NET_PROTO_FTP = 7, + CSSM_NET_PROTO_FTPS = 8, + CSSM_NET_PROTO_OCSP = 9, + CSSM_NET_PROTO_CMP = 10, + CSSM_NET_PROTO_CMPS = 11 +}; + +typedef CSSM_RETURN ( *CSSM_CALLBACK) + (CSSM_DATA_PTR OutData, void *CallerCtx); + +typedef struct cssm_crypto_data { + CSSM_DATA Param; + CSSM_CALLBACK Callback; + void *CallerCtx; +} CSSM_CRYPTO_DATA __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_CRYPTO_DATA_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef sint32 CSSM_WORDID_TYPE; +enum { + CSSM_WORDID__UNK_ = -1, + CSSM_WORDID__NLU_ = 0, + CSSM_WORDID__STAR_ = 1, + CSSM_WORDID_A = 2, + CSSM_WORDID_ACL = 3, + CSSM_WORDID_ALPHA = 4, + CSSM_WORDID_B = 5, + CSSM_WORDID_BER = 6, + CSSM_WORDID_BINARY = 7, + CSSM_WORDID_BIOMETRIC = 8, + CSSM_WORDID_C = 9, + CSSM_WORDID_CANCELED = 10, + CSSM_WORDID_CERT = 11, + CSSM_WORDID_COMMENT = 12, + CSSM_WORDID_CRL = 13, + CSSM_WORDID_CUSTOM = 14, + CSSM_WORDID_D = 15, + CSSM_WORDID_DATE = 16, + CSSM_WORDID_DB_DELETE = 17, + CSSM_WORDID_DB_EXEC_STORED_QUERY = 18, + CSSM_WORDID_DB_INSERT = 19, + CSSM_WORDID_DB_MODIFY = 20, + CSSM_WORDID_DB_READ = 21, + CSSM_WORDID_DBS_CREATE = 22, + CSSM_WORDID_DBS_DELETE = 23, + CSSM_WORDID_DECRYPT = 24, + CSSM_WORDID_DELETE = 25, + CSSM_WORDID_DELTA_CRL = 26, + CSSM_WORDID_DER = 27, + CSSM_WORDID_DERIVE = 28, + CSSM_WORDID_DISPLAY = 29, + CSSM_WORDID_DO = 30, + CSSM_WORDID_DSA = 31, + CSSM_WORDID_DSA_SHA1 = 32, + CSSM_WORDID_E = 33, + CSSM_WORDID_ELGAMAL = 34, + CSSM_WORDID_ENCRYPT = 35, + CSSM_WORDID_ENTRY = 36, + CSSM_WORDID_EXPORT_CLEAR = 37, + CSSM_WORDID_EXPORT_WRAPPED = 38, + CSSM_WORDID_G = 39, + CSSM_WORDID_GE = 40, + CSSM_WORDID_GENKEY = 41, + CSSM_WORDID_HASH = 42, + CSSM_WORDID_HASHED_PASSWORD = 43, + CSSM_WORDID_HASHED_SUBJECT = 44, + CSSM_WORDID_HAVAL = 45, + CSSM_WORDID_IBCHASH = 46, + CSSM_WORDID_IMPORT_CLEAR = 47, + CSSM_WORDID_IMPORT_WRAPPED = 48, + CSSM_WORDID_INTEL = 49, + CSSM_WORDID_ISSUER = 50, + CSSM_WORDID_ISSUER_INFO = 51, + CSSM_WORDID_K_OF_N = 52, + CSSM_WORDID_KEA = 53, + CSSM_WORDID_KEYHOLDER = 54, + CSSM_WORDID_L = 55, + CSSM_WORDID_LE = 56, + CSSM_WORDID_LOGIN = 57, + CSSM_WORDID_LOGIN_NAME = 58, + CSSM_WORDID_MAC = 59, + CSSM_WORDID_MD2 = 60, + CSSM_WORDID_MD2WITHRSA = 61, + CSSM_WORDID_MD4 = 62, + CSSM_WORDID_MD5 = 63, + CSSM_WORDID_MD5WITHRSA = 64, + CSSM_WORDID_N = 65, + CSSM_WORDID_NAME = 66, + CSSM_WORDID_NDR = 67, + CSSM_WORDID_NHASH = 68, + CSSM_WORDID_NOT_AFTER = 69, + CSSM_WORDID_NOT_BEFORE = 70, + CSSM_WORDID_NULL = 71, + CSSM_WORDID_NUMERIC = 72, + CSSM_WORDID_OBJECT_HASH = 73, + CSSM_WORDID_ONE_TIME = 74, + CSSM_WORDID_ONLINE = 75, + CSSM_WORDID_OWNER = 76, + CSSM_WORDID_P = 77, + CSSM_WORDID_PAM_NAME = 78, + CSSM_WORDID_PASSWORD = 79, + CSSM_WORDID_PGP = 80, + CSSM_WORDID_PREFIX = 81, + CSSM_WORDID_PRIVATE_KEY = 82, + CSSM_WORDID_PROMPTED_BIOMETRIC = 83, + CSSM_WORDID_PROMPTED_PASSWORD = 84, + CSSM_WORDID_PROPAGATE = 85, + CSSM_WORDID_PROTECTED_BIOMETRIC = 86, + CSSM_WORDID_PROTECTED_PASSWORD = 87, + CSSM_WORDID_PROTECTED_PIN = 88, + CSSM_WORDID_PUBLIC_KEY = 89, + CSSM_WORDID_PUBLIC_KEY_FROM_CERT = 90, + CSSM_WORDID_Q = 91, + CSSM_WORDID_RANGE = 92, + CSSM_WORDID_REVAL = 93, + CSSM_WORDID_RIPEMAC = 94, + CSSM_WORDID_RIPEMD = 95, + CSSM_WORDID_RIPEMD160 = 96, + CSSM_WORDID_RSA = 97, + CSSM_WORDID_RSA_ISO9796 = 98, + CSSM_WORDID_RSA_PKCS = 99, + CSSM_WORDID_RSA_PKCS_MD5 = 100, + CSSM_WORDID_RSA_PKCS_SHA1 = 101, + CSSM_WORDID_RSA_PKCS1 = 102, + CSSM_WORDID_RSA_PKCS1_MD5 = 103, + CSSM_WORDID_RSA_PKCS1_SHA1 = 104, + CSSM_WORDID_RSA_PKCS1_SIG = 105, + CSSM_WORDID_RSA_RAW = 106, + CSSM_WORDID_SDSIV1 = 107, + CSSM_WORDID_SEQUENCE = 108, + CSSM_WORDID_SET = 109, + CSSM_WORDID_SEXPR = 110, + CSSM_WORDID_SHA1 = 111, + CSSM_WORDID_SHA1WITHDSA = 112, + CSSM_WORDID_SHA1WITHECDSA = 113, + CSSM_WORDID_SHA1WITHRSA = 114, + CSSM_WORDID_SIGN = 115, + CSSM_WORDID_SIGNATURE = 116, + CSSM_WORDID_SIGNED_NONCE = 117, + CSSM_WORDID_SIGNED_SECRET = 118, + CSSM_WORDID_SPKI = 119, + CSSM_WORDID_SUBJECT = 120, + CSSM_WORDID_SUBJECT_INFO = 121, + CSSM_WORDID_TAG = 122, + CSSM_WORDID_THRESHOLD = 123, + CSSM_WORDID_TIME = 124, + CSSM_WORDID_URI = 125, + CSSM_WORDID_VERSION = 126, + CSSM_WORDID_X509_ATTRIBUTE = 127, + CSSM_WORDID_X509V1 = 128, + CSSM_WORDID_X509V2 = 129, + CSSM_WORDID_X509V3 = 130, + CSSM_WORDID_X9_ATTRIBUTE = 131, + CSSM_WORDID_VENDOR_START = 0x00010000, + CSSM_WORDID_VENDOR_END = 0x7FFF0000 +}; + +typedef uint32 CSSM_LIST_ELEMENT_TYPE, *CSSM_LIST_ELEMENT_TYPE_PTR; +enum { + CSSM_LIST_ELEMENT_DATUM = 0x00, + CSSM_LIST_ELEMENT_SUBLIST = 0x01, + CSSM_LIST_ELEMENT_WORDID = 0x02 +}; + +typedef uint32 CSSM_LIST_TYPE, *CSSM_LIST_TYPE_PTR; +enum { + CSSM_LIST_TYPE_UNKNOWN = 0, + CSSM_LIST_TYPE_CUSTOM = 1, + CSSM_LIST_TYPE_SEXPR = 2 +}; + +typedef struct cssm_list_element *CSSM_LIST_ELEMENT_PTR; + +typedef struct cssm_list { + CSSM_LIST_TYPE ListType; + CSSM_LIST_ELEMENT_PTR Head; + CSSM_LIST_ELEMENT_PTR Tail; +} CSSM_LIST __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_LIST_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_list_element { + struct cssm_list_element *NextElement; + CSSM_WORDID_TYPE WordID; + + CSSM_LIST_ELEMENT_TYPE ElementType; + union { + CSSM_LIST Sublist; + CSSM_DATA Word; + } Element; +} CSSM_LIST_ELEMENT; + +typedef struct { + CSSM_LIST Issuer; + CSSM_LIST Subject; + CSSM_BOOL Delegate; + CSSM_LIST AuthorizationTag; + CSSM_LIST ValidityPeriod; +} CSSM_TUPLE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TUPLE_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_tuplegroup { + uint32 NumberOfTuples; + CSSM_TUPLE_PTR Tuples; +} CSSM_TUPLEGROUP __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TUPLEGROUP_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef CSSM_WORDID_TYPE CSSM_SAMPLE_TYPE; +enum { + CSSM_SAMPLE_TYPE_PASSWORD = CSSM_WORDID_PASSWORD, + CSSM_SAMPLE_TYPE_HASHED_PASSWORD = CSSM_WORDID_HASHED_PASSWORD, + CSSM_SAMPLE_TYPE_PROTECTED_PASSWORD = CSSM_WORDID_PROTECTED_PASSWORD, + CSSM_SAMPLE_TYPE_PROMPTED_PASSWORD = CSSM_WORDID_PROMPTED_PASSWORD, + CSSM_SAMPLE_TYPE_SIGNED_NONCE = CSSM_WORDID_SIGNED_NONCE, + CSSM_SAMPLE_TYPE_SIGNED_SECRET = CSSM_WORDID_SIGNED_SECRET, + CSSM_SAMPLE_TYPE_BIOMETRIC = CSSM_WORDID_BIOMETRIC, + CSSM_SAMPLE_TYPE_PROTECTED_BIOMETRIC = CSSM_WORDID_PROTECTED_BIOMETRIC, + CSSM_SAMPLE_TYPE_PROMPTED_BIOMETRIC = CSSM_WORDID_PROMPTED_BIOMETRIC, + CSSM_SAMPLE_TYPE_THRESHOLD = CSSM_WORDID_THRESHOLD +}; + +typedef struct cssm_sample { + CSSM_LIST TypedSample; + const CSSM_SUBSERVICE_UID *Verifier; +} CSSM_SAMPLE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_SAMPLE_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_samplegroup { + uint32 NumberOfSamples; + const CSSM_SAMPLE *Samples; +} CSSM_SAMPLEGROUP __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_SAMPLEGROUP_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef void *( *CSSM_MALLOC) + (CSSM_SIZE size, + void *allocref); + +typedef void ( *CSSM_FREE) + (void *memblock, + void *allocref); + +typedef void *( *CSSM_REALLOC) + (void *memblock, + CSSM_SIZE size, + void *allocref); + +typedef void *( *CSSM_CALLOC) + (uint32 num, + CSSM_SIZE size, + void *allocref); + +typedef struct cssm_memory_funcs { + CSSM_MALLOC malloc_func; + CSSM_FREE free_func; + CSSM_REALLOC realloc_func; + CSSM_CALLOC calloc_func; + void *AllocRef; +} CSSM_MEMORY_FUNCS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_MEMORY_FUNCS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef CSSM_MEMORY_FUNCS CSSM_API_MEMORY_FUNCS; +typedef CSSM_API_MEMORY_FUNCS *CSSM_API_MEMORY_FUNCS_PTR; + +typedef CSSM_RETURN ( * CSSM_CHALLENGE_CALLBACK) + (const CSSM_LIST *Challenge, + CSSM_SAMPLEGROUP_PTR Response, + void *CallerCtx, + const CSSM_MEMORY_FUNCS *MemFuncs); + +typedef uint32 CSSM_CERT_TYPE, *CSSM_CERT_TYPE_PTR; +enum { + CSSM_CERT_UNKNOWN = 0x00, + CSSM_CERT_X_509v1 = 0x01, + CSSM_CERT_X_509v2 = 0x02, + CSSM_CERT_X_509v3 = 0x03, + CSSM_CERT_PGP = 0x04, + CSSM_CERT_SPKI = 0x05, + CSSM_CERT_SDSIv1 = 0x06, + CSSM_CERT_Intel = 0x08, + CSSM_CERT_X_509_ATTRIBUTE = 0x09, + CSSM_CERT_X9_ATTRIBUTE = 0x0A, + CSSM_CERT_TUPLE = 0x0B, + CSSM_CERT_ACL_ENTRY = 0x0C, + CSSM_CERT_MULTIPLE = 0x7FFE, + CSSM_CERT_LAST = 0x7FFF, + + + + CSSM_CL_CUSTOM_CERT_TYPE = 0x08000 +}; + +typedef uint32 CSSM_CERT_ENCODING, *CSSM_CERT_ENCODING_PTR; +enum { + CSSM_CERT_ENCODING_UNKNOWN = 0x00, + CSSM_CERT_ENCODING_CUSTOM = 0x01, + CSSM_CERT_ENCODING_BER = 0x02, + CSSM_CERT_ENCODING_DER = 0x03, + CSSM_CERT_ENCODING_NDR = 0x04, + CSSM_CERT_ENCODING_SEXPR = 0x05, + CSSM_CERT_ENCODING_PGP = 0x06, + CSSM_CERT_ENCODING_MULTIPLE = 0x7FFE, + CSSM_CERT_ENCODING_LAST = 0x7FFF, + + + + CSSM_CL_CUSTOM_CERT_ENCODING = 0x8000 +}; + +typedef struct cssm_encoded_cert { + CSSM_CERT_TYPE CertType; + CSSM_CERT_ENCODING CertEncoding; + CSSM_DATA CertBlob; +} CSSM_ENCODED_CERT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_ENCODED_CERT_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_CERT_PARSE_FORMAT, *CSSM_CERT_PARSE_FORMAT_PTR; +enum { + CSSM_CERT_PARSE_FORMAT_NONE = 0x00, + CSSM_CERT_PARSE_FORMAT_CUSTOM = 0x01, + CSSM_CERT_PARSE_FORMAT_SEXPR = 0x02, + CSSM_CERT_PARSE_FORMAT_COMPLEX = 0x03, + CSSM_CERT_PARSE_FORMAT_OID_NAMED = 0x04, + CSSM_CERT_PARSE_FORMAT_TUPLE = 0x05, + CSSM_CERT_PARSE_FORMAT_MULTIPLE = 0x7FFE, + + + CSSM_CERT_PARSE_FORMAT_LAST = 0x7FFF, + + + + + CSSM_CL_CUSTOM_CERT_PARSE_FORMAT = 0x8000 +}; + +typedef struct cssm_parsed_cert { + CSSM_CERT_TYPE CertType; + CSSM_CERT_PARSE_FORMAT ParsedCertFormat; + + void *ParsedCert; +} CSSM_PARSED_CERT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_PARSED_CERT_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_cert_pair { + CSSM_ENCODED_CERT EncodedCert; + CSSM_PARSED_CERT ParsedCert; +} CSSM_CERT_PAIR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_CERT_PAIR_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_CERTGROUP_TYPE, *CSSM_CERTGROUP_TYPE_PTR; +enum { + CSSM_CERTGROUP_DATA = 0x00, + CSSM_CERTGROUP_ENCODED_CERT = 0x01, + CSSM_CERTGROUP_PARSED_CERT = 0x02, + CSSM_CERTGROUP_CERT_PAIR = 0x03 +}; + +typedef struct cssm_certgroup { + CSSM_CERT_TYPE CertType; + CSSM_CERT_ENCODING CertEncoding; + uint32 NumCerts; + union { + CSSM_DATA_PTR CertList; + CSSM_ENCODED_CERT_PTR EncodedCertList; + + CSSM_PARSED_CERT_PTR ParsedCertList; + + CSSM_CERT_PAIR_PTR PairCertList; + + } GroupList; + CSSM_CERTGROUP_TYPE CertGroupType; + + void *Reserved; +} CSSM_CERTGROUP, *CSSM_CERTGROUP_PTR; + +typedef struct cssm_base_certs { + CSSM_TP_HANDLE TPHandle; + CSSM_CL_HANDLE CLHandle; + CSSM_CERTGROUP Certs; +} CSSM_BASE_CERTS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_BASE_CERTS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_access_credentials { + CSSM_STRING EntryTag; + CSSM_BASE_CERTS BaseCerts; + CSSM_SAMPLEGROUP Samples; + CSSM_CHALLENGE_CALLBACK Callback; + void *CallerCtx; +} CSSM_ACCESS_CREDENTIALS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_ACCESS_CREDENTIALS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef sint32 CSSM_ACL_SUBJECT_TYPE; +enum { + CSSM_ACL_SUBJECT_TYPE_ANY = CSSM_WORDID__STAR_, + CSSM_ACL_SUBJECT_TYPE_THRESHOLD = CSSM_WORDID_THRESHOLD, + CSSM_ACL_SUBJECT_TYPE_PASSWORD = CSSM_WORDID_PASSWORD, + CSSM_ACL_SUBJECT_TYPE_PROTECTED_PASSWORD = CSSM_WORDID_PROTECTED_PASSWORD, + CSSM_ACL_SUBJECT_TYPE_PROMPTED_PASSWORD = CSSM_WORDID_PROMPTED_PASSWORD, + CSSM_ACL_SUBJECT_TYPE_PUBLIC_KEY = CSSM_WORDID_PUBLIC_KEY, + CSSM_ACL_SUBJECT_TYPE_HASHED_SUBJECT = CSSM_WORDID_HASHED_SUBJECT, + CSSM_ACL_SUBJECT_TYPE_BIOMETRIC = CSSM_WORDID_BIOMETRIC, + CSSM_ACL_SUBJECT_TYPE_PROTECTED_BIOMETRIC = CSSM_WORDID_PROTECTED_BIOMETRIC, + CSSM_ACL_SUBJECT_TYPE_PROMPTED_BIOMETRIC = CSSM_WORDID_PROMPTED_BIOMETRIC, + CSSM_ACL_SUBJECT_TYPE_LOGIN_NAME = CSSM_WORDID_LOGIN_NAME, + CSSM_ACL_SUBJECT_TYPE_EXT_PAM_NAME = CSSM_WORDID_PAM_NAME +}; + + +typedef sint32 CSSM_ACL_AUTHORIZATION_TAG; +enum { + + + CSSM_ACL_AUTHORIZATION_TAG_VENDOR_DEFINED_START = 0x00010000, + + + CSSM_ACL_AUTHORIZATION_ANY = CSSM_WORDID__STAR_, + + CSSM_ACL_AUTHORIZATION_LOGIN = CSSM_WORDID_LOGIN, + CSSM_ACL_AUTHORIZATION_GENKEY = CSSM_WORDID_GENKEY, + CSSM_ACL_AUTHORIZATION_DELETE = CSSM_WORDID_DELETE, + CSSM_ACL_AUTHORIZATION_EXPORT_WRAPPED = CSSM_WORDID_EXPORT_WRAPPED, + CSSM_ACL_AUTHORIZATION_EXPORT_CLEAR = CSSM_WORDID_EXPORT_CLEAR, + CSSM_ACL_AUTHORIZATION_IMPORT_WRAPPED = CSSM_WORDID_IMPORT_WRAPPED, + CSSM_ACL_AUTHORIZATION_IMPORT_CLEAR = CSSM_WORDID_IMPORT_CLEAR, + CSSM_ACL_AUTHORIZATION_SIGN = CSSM_WORDID_SIGN, + CSSM_ACL_AUTHORIZATION_ENCRYPT = CSSM_WORDID_ENCRYPT, + CSSM_ACL_AUTHORIZATION_DECRYPT = CSSM_WORDID_DECRYPT, + CSSM_ACL_AUTHORIZATION_MAC = CSSM_WORDID_MAC, + CSSM_ACL_AUTHORIZATION_DERIVE = CSSM_WORDID_DERIVE, + + CSSM_ACL_AUTHORIZATION_DBS_CREATE = CSSM_WORDID_DBS_CREATE, + CSSM_ACL_AUTHORIZATION_DBS_DELETE = CSSM_WORDID_DBS_DELETE, + CSSM_ACL_AUTHORIZATION_DB_READ = CSSM_WORDID_DB_READ, + CSSM_ACL_AUTHORIZATION_DB_INSERT = CSSM_WORDID_DB_INSERT, + CSSM_ACL_AUTHORIZATION_DB_MODIFY = CSSM_WORDID_DB_MODIFY, + CSSM_ACL_AUTHORIZATION_DB_DELETE = CSSM_WORDID_DB_DELETE +}; + +typedef struct cssm_authorizationgroup { + uint32 NumberOfAuthTags; + CSSM_ACL_AUTHORIZATION_TAG *AuthTags; +} CSSM_AUTHORIZATIONGROUP __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_AUTHORIZATIONGROUP_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_acl_validity_period { + CSSM_DATA StartDate; + CSSM_DATA EndDate; +} CSSM_ACL_VALIDITY_PERIOD __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_ACL_VALIDITY_PERIOD_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_acl_entry_prototype { + CSSM_LIST TypedSubject; + CSSM_BOOL Delegate; + CSSM_AUTHORIZATIONGROUP Authorization; + CSSM_ACL_VALIDITY_PERIOD TimeRange; + CSSM_STRING EntryTag; +} CSSM_ACL_ENTRY_PROTOTYPE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_ACL_ENTRY_PROTOTYPE_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_acl_owner_prototype { + CSSM_LIST TypedSubject; + CSSM_BOOL Delegate; +} CSSM_ACL_OWNER_PROTOTYPE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_ACL_OWNER_PROTOTYPE_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef CSSM_RETURN ( * CSSM_ACL_SUBJECT_CALLBACK) + (const CSSM_LIST *SubjectRequest, + CSSM_LIST_PTR SubjectResponse, + void *CallerContext, + const CSSM_MEMORY_FUNCS *MemFuncs); + +typedef struct cssm_acl_entry_input { + CSSM_ACL_ENTRY_PROTOTYPE Prototype; + CSSM_ACL_SUBJECT_CALLBACK Callback; + void *CallerContext; +} CSSM_ACL_ENTRY_INPUT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_ACL_ENTRY_INPUT_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_resource_control_context { + CSSM_ACCESS_CREDENTIALS_PTR AccessCred; + CSSM_ACL_ENTRY_INPUT InitialAclEntry; +} CSSM_RESOURCE_CONTROL_CONTEXT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_RESOURCE_CONTROL_CONTEXT_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef CSSM_HANDLE CSSM_ACL_HANDLE; + +typedef struct cssm_acl_entry_info { + CSSM_ACL_ENTRY_PROTOTYPE EntryPublicInfo; + CSSM_ACL_HANDLE EntryHandle; +} CSSM_ACL_ENTRY_INFO __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_ACL_ENTRY_INFO_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_ACL_EDIT_MODE; +enum { + CSSM_ACL_EDIT_MODE_ADD = 1, + CSSM_ACL_EDIT_MODE_DELETE = 2, + CSSM_ACL_EDIT_MODE_REPLACE = 3 +}; + +typedef struct cssm_acl_edit { + CSSM_ACL_EDIT_MODE EditMode; + CSSM_ACL_HANDLE OldEntryHandle; + const CSSM_ACL_ENTRY_INPUT *NewEntry; +} CSSM_ACL_EDIT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_ACL_EDIT_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + +typedef void ( *CSSM_PROC_ADDR) (); + +typedef CSSM_PROC_ADDR *CSSM_PROC_ADDR_PTR; + +typedef struct cssm_func_name_addr { + CSSM_STRING Name; + CSSM_PROC_ADDR Address; +} CSSM_FUNC_NAME_ADDR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_FUNC_NAME_ADDR_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + +typedef struct cssm_date { + uint8 Year[4]; + uint8 Month[2]; + uint8 Day[2]; +} CSSM_DATE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_DATE_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_range { + uint32 Min; + uint32 Max; +} CSSM_RANGE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_RANGE_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_query_size_data { + uint32 SizeInputBlock; + uint32 SizeOutputBlock; +} CSSM_QUERY_SIZE_DATA __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_QUERY_SIZE_DATA_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_HEADERVERSION; +enum { + CSSM_KEYHEADER_VERSION = 2 +}; + +typedef struct cssm_key_size { + uint32 LogicalKeySizeInBits; + uint32 EffectiveKeySizeInBits; +} CSSM_KEY_SIZE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_KEY_SIZE_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_KEYBLOB_TYPE; +enum { + CSSM_KEYBLOB_RAW = 0, + CSSM_KEYBLOB_REFERENCE = 2, + CSSM_KEYBLOB_WRAPPED = 3, + CSSM_KEYBLOB_OTHER = 0xFFFFFFFF +}; + +typedef uint32 CSSM_KEYBLOB_FORMAT; +enum { + + CSSM_KEYBLOB_RAW_FORMAT_NONE = 0, + + CSSM_KEYBLOB_RAW_FORMAT_PKCS1 = 1, + CSSM_KEYBLOB_RAW_FORMAT_PKCS3 = 2, + CSSM_KEYBLOB_RAW_FORMAT_MSCAPI = 3, + CSSM_KEYBLOB_RAW_FORMAT_PGP = 4, + CSSM_KEYBLOB_RAW_FORMAT_FIPS186 = 5, + CSSM_KEYBLOB_RAW_FORMAT_BSAFE = 6, + CSSM_KEYBLOB_RAW_FORMAT_CCA = 9, + CSSM_KEYBLOB_RAW_FORMAT_PKCS8 = 10, + CSSM_KEYBLOB_RAW_FORMAT_SPKI = 11, + CSSM_KEYBLOB_RAW_FORMAT_OCTET_STRING = 12, + CSSM_KEYBLOB_RAW_FORMAT_OTHER = 0xFFFFFFFF +}; +enum { + + CSSM_KEYBLOB_WRAPPED_FORMAT_NONE = 0, + + CSSM_KEYBLOB_WRAPPED_FORMAT_PKCS8 = 1, + CSSM_KEYBLOB_WRAPPED_FORMAT_PKCS7 = 2, + CSSM_KEYBLOB_WRAPPED_FORMAT_MSCAPI = 3, + CSSM_KEYBLOB_WRAPPED_FORMAT_OTHER = 0xFFFFFFFF +}; +enum { + + CSSM_KEYBLOB_REF_FORMAT_INTEGER = 0, + CSSM_KEYBLOB_REF_FORMAT_STRING = 1, + CSSM_KEYBLOB_REF_FORMAT_SPKI = 2, + + CSSM_KEYBLOB_REF_FORMAT_OTHER = 0xFFFFFFFF +}; + +typedef uint32 CSSM_KEYCLASS; +enum { + CSSM_KEYCLASS_PUBLIC_KEY = 0, + CSSM_KEYCLASS_PRIVATE_KEY = 1, + CSSM_KEYCLASS_SESSION_KEY = 2, + CSSM_KEYCLASS_SECRET_PART = 3, + CSSM_KEYCLASS_OTHER = 0xFFFFFFFF +}; + +typedef uint32 CSSM_KEYATTR_FLAGS; +enum { + + CSSM_KEYATTR_RETURN_DEFAULT = 0x00000000, + CSSM_KEYATTR_RETURN_DATA = 0x10000000, + CSSM_KEYATTR_RETURN_REF = 0x20000000, + CSSM_KEYATTR_RETURN_NONE = 0x40000000, + + CSSM_KEYATTR_PERMANENT = 0x00000001, + CSSM_KEYATTR_PRIVATE = 0x00000002, + CSSM_KEYATTR_MODIFIABLE = 0x00000004, + CSSM_KEYATTR_SENSITIVE = 0x00000008, + CSSM_KEYATTR_EXTRACTABLE = 0x00000020, + + CSSM_KEYATTR_ALWAYS_SENSITIVE = 0x00000010, + CSSM_KEYATTR_NEVER_EXTRACTABLE = 0x00000040 +}; + +typedef uint32 CSSM_KEYUSE; +enum { + CSSM_KEYUSE_ANY = 0x80000000, + CSSM_KEYUSE_ENCRYPT = 0x00000001, + CSSM_KEYUSE_DECRYPT = 0x00000002, + CSSM_KEYUSE_SIGN = 0x00000004, + CSSM_KEYUSE_VERIFY = 0x00000008, + CSSM_KEYUSE_SIGN_RECOVER = 0x00000010, + CSSM_KEYUSE_VERIFY_RECOVER = 0x00000020, + CSSM_KEYUSE_WRAP = 0x00000040, + CSSM_KEYUSE_UNWRAP = 0x00000080, + CSSM_KEYUSE_DERIVE = 0x00000100 +}; + +typedef uint32 CSSM_ALGORITHMS; +enum { + CSSM_ALGID_NONE = 0, + CSSM_ALGID_CUSTOM = CSSM_ALGID_NONE + 1, + CSSM_ALGID_DH = CSSM_ALGID_NONE + 2, + CSSM_ALGID_PH = CSSM_ALGID_NONE + 3, + CSSM_ALGID_KEA = CSSM_ALGID_NONE + 4, + CSSM_ALGID_MD2 = CSSM_ALGID_NONE + 5, + CSSM_ALGID_MD4 = CSSM_ALGID_NONE + 6, + CSSM_ALGID_MD5 = CSSM_ALGID_NONE + 7, + CSSM_ALGID_SHA1 = CSSM_ALGID_NONE + 8, + CSSM_ALGID_NHASH = CSSM_ALGID_NONE + 9, + CSSM_ALGID_HAVAL = CSSM_ALGID_NONE + 10, + CSSM_ALGID_RIPEMD = CSSM_ALGID_NONE + 11, + CSSM_ALGID_IBCHASH = CSSM_ALGID_NONE + 12, + CSSM_ALGID_RIPEMAC = CSSM_ALGID_NONE + 13, + CSSM_ALGID_DES = CSSM_ALGID_NONE + 14, + CSSM_ALGID_DESX = CSSM_ALGID_NONE + 15, + CSSM_ALGID_RDES = CSSM_ALGID_NONE + 16, + CSSM_ALGID_3DES_3KEY_EDE = CSSM_ALGID_NONE + 17, + CSSM_ALGID_3DES_2KEY_EDE = CSSM_ALGID_NONE + 18, + CSSM_ALGID_3DES_1KEY_EEE = CSSM_ALGID_NONE + 19, + CSSM_ALGID_3DES_3KEY = CSSM_ALGID_3DES_3KEY_EDE, + CSSM_ALGID_3DES_3KEY_EEE = CSSM_ALGID_NONE + 20, + CSSM_ALGID_3DES_2KEY = CSSM_ALGID_3DES_2KEY_EDE, + CSSM_ALGID_3DES_2KEY_EEE = CSSM_ALGID_NONE + 21, + CSSM_ALGID_3DES_1KEY = CSSM_ALGID_3DES_3KEY_EEE, + CSSM_ALGID_IDEA = CSSM_ALGID_NONE + 22, + CSSM_ALGID_RC2 = CSSM_ALGID_NONE + 23, + CSSM_ALGID_RC5 = CSSM_ALGID_NONE + 24, + CSSM_ALGID_RC4 = CSSM_ALGID_NONE + 25, + CSSM_ALGID_SEAL = CSSM_ALGID_NONE + 26, + CSSM_ALGID_CAST = CSSM_ALGID_NONE + 27, + CSSM_ALGID_BLOWFISH = CSSM_ALGID_NONE + 28, + CSSM_ALGID_SKIPJACK = CSSM_ALGID_NONE + 29, + CSSM_ALGID_LUCIFER = CSSM_ALGID_NONE + 30, + CSSM_ALGID_MADRYGA = CSSM_ALGID_NONE + 31, + CSSM_ALGID_FEAL = CSSM_ALGID_NONE + 32, + CSSM_ALGID_REDOC = CSSM_ALGID_NONE + 33, + CSSM_ALGID_REDOC3 = CSSM_ALGID_NONE + 34, + CSSM_ALGID_LOKI = CSSM_ALGID_NONE + 35, + CSSM_ALGID_KHUFU = CSSM_ALGID_NONE + 36, + CSSM_ALGID_KHAFRE = CSSM_ALGID_NONE + 37, + CSSM_ALGID_MMB = CSSM_ALGID_NONE + 38, + CSSM_ALGID_GOST = CSSM_ALGID_NONE + 39, + CSSM_ALGID_SAFER = CSSM_ALGID_NONE + 40, + CSSM_ALGID_CRAB = CSSM_ALGID_NONE + 41, + CSSM_ALGID_RSA = CSSM_ALGID_NONE + 42, + CSSM_ALGID_DSA = CSSM_ALGID_NONE + 43, + CSSM_ALGID_MD5WithRSA = CSSM_ALGID_NONE + 44, + CSSM_ALGID_MD2WithRSA = CSSM_ALGID_NONE + 45, + CSSM_ALGID_ElGamal = CSSM_ALGID_NONE + 46, + CSSM_ALGID_MD2Random = CSSM_ALGID_NONE + 47, + CSSM_ALGID_MD5Random = CSSM_ALGID_NONE + 48, + CSSM_ALGID_SHARandom = CSSM_ALGID_NONE + 49, + CSSM_ALGID_DESRandom = CSSM_ALGID_NONE + 50, + CSSM_ALGID_SHA1WithRSA = CSSM_ALGID_NONE + 51, + CSSM_ALGID_CDMF = CSSM_ALGID_NONE + 52, + CSSM_ALGID_CAST3 = CSSM_ALGID_NONE + 53, + CSSM_ALGID_CAST5 = CSSM_ALGID_NONE + 54, + CSSM_ALGID_GenericSecret = CSSM_ALGID_NONE + 55, + CSSM_ALGID_ConcatBaseAndKey = CSSM_ALGID_NONE + 56, + CSSM_ALGID_ConcatKeyAndBase = CSSM_ALGID_NONE + 57, + CSSM_ALGID_ConcatBaseAndData = CSSM_ALGID_NONE + 58, + CSSM_ALGID_ConcatDataAndBase = CSSM_ALGID_NONE + 59, + CSSM_ALGID_XORBaseAndData = CSSM_ALGID_NONE + 60, + CSSM_ALGID_ExtractFromKey = CSSM_ALGID_NONE + 61, + CSSM_ALGID_SSL3PreMasterGen = CSSM_ALGID_NONE + 62, + CSSM_ALGID_SSL3MasterDerive = CSSM_ALGID_NONE + 63, + CSSM_ALGID_SSL3KeyAndMacDerive = CSSM_ALGID_NONE + 64, + CSSM_ALGID_SSL3MD5_MAC = CSSM_ALGID_NONE + 65, + CSSM_ALGID_SSL3SHA1_MAC = CSSM_ALGID_NONE + 66, + CSSM_ALGID_PKCS5_PBKDF1_MD5 = CSSM_ALGID_NONE + 67, + CSSM_ALGID_PKCS5_PBKDF1_MD2 = CSSM_ALGID_NONE + 68, + CSSM_ALGID_PKCS5_PBKDF1_SHA1 = CSSM_ALGID_NONE + 69, + CSSM_ALGID_WrapLynks = CSSM_ALGID_NONE + 70, + CSSM_ALGID_WrapSET_OAEP = CSSM_ALGID_NONE + 71, + CSSM_ALGID_BATON = CSSM_ALGID_NONE + 72, + CSSM_ALGID_ECDSA = CSSM_ALGID_NONE + 73, + CSSM_ALGID_MAYFLY = CSSM_ALGID_NONE + 74, + CSSM_ALGID_JUNIPER = CSSM_ALGID_NONE + 75, + CSSM_ALGID_FASTHASH = CSSM_ALGID_NONE + 76, + CSSM_ALGID_3DES = CSSM_ALGID_NONE + 77, + CSSM_ALGID_SSL3MD5 = CSSM_ALGID_NONE + 78, + CSSM_ALGID_SSL3SHA1 = CSSM_ALGID_NONE + 79, + CSSM_ALGID_FortezzaTimestamp = CSSM_ALGID_NONE + 80, + CSSM_ALGID_SHA1WithDSA = CSSM_ALGID_NONE + 81, + CSSM_ALGID_SHA1WithECDSA = CSSM_ALGID_NONE + 82, + CSSM_ALGID_DSA_BSAFE = CSSM_ALGID_NONE + 83, + CSSM_ALGID_ECDH = CSSM_ALGID_NONE + 84, + CSSM_ALGID_ECMQV = CSSM_ALGID_NONE + 85, + CSSM_ALGID_PKCS12_SHA1_PBE = CSSM_ALGID_NONE + 86, + CSSM_ALGID_ECNRA = CSSM_ALGID_NONE + 87, + CSSM_ALGID_SHA1WithECNRA = CSSM_ALGID_NONE + 88, + CSSM_ALGID_ECES = CSSM_ALGID_NONE + 89, + CSSM_ALGID_ECAES = CSSM_ALGID_NONE + 90, + CSSM_ALGID_SHA1HMAC = CSSM_ALGID_NONE + 91, + CSSM_ALGID_FIPS186Random = CSSM_ALGID_NONE + 92, + CSSM_ALGID_ECC = CSSM_ALGID_NONE + 93, + CSSM_ALGID_MQV = CSSM_ALGID_NONE + 94, + CSSM_ALGID_NRA = CSSM_ALGID_NONE + 95, + CSSM_ALGID_IntelPlatformRandom = CSSM_ALGID_NONE + 96, + CSSM_ALGID_UTC = CSSM_ALGID_NONE + 97, + CSSM_ALGID_HAVAL3 = CSSM_ALGID_NONE + 98, + CSSM_ALGID_HAVAL4 = CSSM_ALGID_NONE + 99, + CSSM_ALGID_HAVAL5 = CSSM_ALGID_NONE + 100, + CSSM_ALGID_TIGER = CSSM_ALGID_NONE + 101, + CSSM_ALGID_MD5HMAC = CSSM_ALGID_NONE + 102, + CSSM_ALGID_PKCS5_PBKDF2 = CSSM_ALGID_NONE + 103, + CSSM_ALGID_RUNNING_COUNTER = CSSM_ALGID_NONE + 104, + CSSM_ALGID_LAST = CSSM_ALGID_NONE + 0x7FFFFFFF, + + + + CSSM_ALGID_VENDOR_DEFINED = CSSM_ALGID_NONE + 0x80000000 +}; + +typedef uint32 CSSM_ENCRYPT_MODE; +enum { + CSSM_ALGMODE_NONE = 0, + CSSM_ALGMODE_CUSTOM = CSSM_ALGMODE_NONE + 1, + CSSM_ALGMODE_ECB = CSSM_ALGMODE_NONE + 2, + CSSM_ALGMODE_ECBPad = CSSM_ALGMODE_NONE + 3, + CSSM_ALGMODE_CBC = CSSM_ALGMODE_NONE + 4, + CSSM_ALGMODE_CBC_IV8 = CSSM_ALGMODE_NONE + 5, + CSSM_ALGMODE_CBCPadIV8 = CSSM_ALGMODE_NONE + 6, + CSSM_ALGMODE_CFB = CSSM_ALGMODE_NONE + 7, + CSSM_ALGMODE_CFB_IV8 = CSSM_ALGMODE_NONE + 8, + CSSM_ALGMODE_CFBPadIV8 = CSSM_ALGMODE_NONE + 9, + CSSM_ALGMODE_OFB = CSSM_ALGMODE_NONE + 10, + CSSM_ALGMODE_OFB_IV8 = CSSM_ALGMODE_NONE + 11, + CSSM_ALGMODE_OFBPadIV8 = CSSM_ALGMODE_NONE + 12, + CSSM_ALGMODE_COUNTER = CSSM_ALGMODE_NONE + 13, + CSSM_ALGMODE_BC = CSSM_ALGMODE_NONE + 14, + CSSM_ALGMODE_PCBC = CSSM_ALGMODE_NONE + 15, + CSSM_ALGMODE_CBCC = CSSM_ALGMODE_NONE + 16, + CSSM_ALGMODE_OFBNLF = CSSM_ALGMODE_NONE + 17, + CSSM_ALGMODE_PBC = CSSM_ALGMODE_NONE + 18, + CSSM_ALGMODE_PFB = CSSM_ALGMODE_NONE + 19, + CSSM_ALGMODE_CBCPD = CSSM_ALGMODE_NONE + 20, + CSSM_ALGMODE_PUBLIC_KEY = CSSM_ALGMODE_NONE + 21, + CSSM_ALGMODE_PRIVATE_KEY = CSSM_ALGMODE_NONE + 22, + CSSM_ALGMODE_SHUFFLE = CSSM_ALGMODE_NONE + 23, + CSSM_ALGMODE_ECB64 = CSSM_ALGMODE_NONE + 24, + CSSM_ALGMODE_CBC64 = CSSM_ALGMODE_NONE + 25, + CSSM_ALGMODE_OFB64 = CSSM_ALGMODE_NONE + 26, + CSSM_ALGMODE_CFB32 = CSSM_ALGMODE_NONE + 28, + CSSM_ALGMODE_CFB16 = CSSM_ALGMODE_NONE + 29, + CSSM_ALGMODE_CFB8 = CSSM_ALGMODE_NONE + 30, + CSSM_ALGMODE_WRAP = CSSM_ALGMODE_NONE + 31, + CSSM_ALGMODE_PRIVATE_WRAP = CSSM_ALGMODE_NONE + 32, + CSSM_ALGMODE_RELAYX = CSSM_ALGMODE_NONE + 33, + CSSM_ALGMODE_ECB128 = CSSM_ALGMODE_NONE + 34, + CSSM_ALGMODE_ECB96 = CSSM_ALGMODE_NONE + 35, + CSSM_ALGMODE_CBC128 = CSSM_ALGMODE_NONE + 36, + CSSM_ALGMODE_OAEP_HASH = CSSM_ALGMODE_NONE + 37, + CSSM_ALGMODE_PKCS1_EME_V15 = CSSM_ALGMODE_NONE + 38, + CSSM_ALGMODE_PKCS1_EME_OAEP = CSSM_ALGMODE_NONE + 39, + CSSM_ALGMODE_PKCS1_EMSA_V15 = CSSM_ALGMODE_NONE + 40, + CSSM_ALGMODE_ISO_9796 = CSSM_ALGMODE_NONE + 41, + CSSM_ALGMODE_X9_31 = CSSM_ALGMODE_NONE + 42, + CSSM_ALGMODE_LAST = CSSM_ALGMODE_NONE + 0x7FFFFFFF, + + + + CSSM_ALGMODE_VENDOR_DEFINED = CSSM_ALGMODE_NONE + 0x80000000 +}; + +typedef struct cssm_keyheader { + CSSM_HEADERVERSION HeaderVersion; + CSSM_GUID CspId; + CSSM_KEYBLOB_TYPE BlobType; + CSSM_KEYBLOB_FORMAT Format; + CSSM_ALGORITHMS AlgorithmId; + CSSM_KEYCLASS KeyClass; + uint32 LogicalKeySizeInBits; + CSSM_KEYATTR_FLAGS KeyAttr; + CSSM_KEYUSE KeyUsage; + CSSM_DATE StartDate; + CSSM_DATE EndDate; + CSSM_ALGORITHMS WrapAlgorithmId; + CSSM_ENCRYPT_MODE WrapMode; + uint32 Reserved; +} CSSM_KEYHEADER __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_KEYHEADER_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_key { + CSSM_KEYHEADER KeyHeader; + CSSM_DATA KeyData; +} CSSM_KEY __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_KEY_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef CSSM_KEY CSSM_WRAP_KEY, *CSSM_WRAP_KEY_PTR; + +typedef uint32 CSSM_CSPTYPE; +enum { + CSSM_CSP_SOFTWARE = 1, + CSSM_CSP_HARDWARE = CSSM_CSP_SOFTWARE + 1, + CSSM_CSP_HYBRID = CSSM_CSP_SOFTWARE + 2 +}; + + +typedef struct cssm_dl_db_handle { + CSSM_DL_HANDLE DLHandle; + CSSM_DB_HANDLE DBHandle; +} CSSM_DL_DB_HANDLE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_DL_DB_HANDLE_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_CONTEXT_TYPE; +enum { + CSSM_ALGCLASS_NONE = 0, + CSSM_ALGCLASS_CUSTOM = CSSM_ALGCLASS_NONE + 1, + CSSM_ALGCLASS_SIGNATURE = CSSM_ALGCLASS_NONE + 2, + CSSM_ALGCLASS_SYMMETRIC = CSSM_ALGCLASS_NONE + 3, + CSSM_ALGCLASS_DIGEST = CSSM_ALGCLASS_NONE + 4, + CSSM_ALGCLASS_RANDOMGEN = CSSM_ALGCLASS_NONE + 5, + CSSM_ALGCLASS_UNIQUEGEN = CSSM_ALGCLASS_NONE + 6, + CSSM_ALGCLASS_MAC = CSSM_ALGCLASS_NONE + 7, + CSSM_ALGCLASS_ASYMMETRIC = CSSM_ALGCLASS_NONE + 8, + CSSM_ALGCLASS_KEYGEN = CSSM_ALGCLASS_NONE + 9, + CSSM_ALGCLASS_DERIVEKEY = CSSM_ALGCLASS_NONE + 10 +}; + + +enum { + CSSM_ATTRIBUTE_DATA_NONE = 0x00000000, + CSSM_ATTRIBUTE_DATA_UINT32 = 0x10000000, + CSSM_ATTRIBUTE_DATA_CSSM_DATA = 0x20000000, + CSSM_ATTRIBUTE_DATA_CRYPTO_DATA = 0x30000000, + CSSM_ATTRIBUTE_DATA_KEY = 0x40000000, + CSSM_ATTRIBUTE_DATA_STRING = 0x50000000, + CSSM_ATTRIBUTE_DATA_DATE = 0x60000000, + CSSM_ATTRIBUTE_DATA_RANGE = 0x70000000, + CSSM_ATTRIBUTE_DATA_ACCESS_CREDENTIALS = 0x80000000, + CSSM_ATTRIBUTE_DATA_VERSION = 0x01000000, + CSSM_ATTRIBUTE_DATA_DL_DB_HANDLE = 0x02000000, + CSSM_ATTRIBUTE_DATA_KR_PROFILE = 0x03000000, + CSSM_ATTRIBUTE_TYPE_MASK = 0xFF000000 +}; + +typedef uint32 CSSM_ATTRIBUTE_TYPE; +enum { + CSSM_ATTRIBUTE_NONE = 0, + CSSM_ATTRIBUTE_CUSTOM = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 1, + CSSM_ATTRIBUTE_DESCRIPTION = CSSM_ATTRIBUTE_DATA_STRING | 2, + CSSM_ATTRIBUTE_KEY = CSSM_ATTRIBUTE_DATA_KEY | 3, + CSSM_ATTRIBUTE_INIT_VECTOR = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 4, + CSSM_ATTRIBUTE_SALT = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 5, + CSSM_ATTRIBUTE_PADDING = CSSM_ATTRIBUTE_DATA_UINT32 | 6, + CSSM_ATTRIBUTE_RANDOM = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 7, + CSSM_ATTRIBUTE_SEED = CSSM_ATTRIBUTE_DATA_CRYPTO_DATA | 8, + CSSM_ATTRIBUTE_PASSPHRASE = CSSM_ATTRIBUTE_DATA_CRYPTO_DATA | 9, + CSSM_ATTRIBUTE_KEY_LENGTH = CSSM_ATTRIBUTE_DATA_UINT32 | 10, + CSSM_ATTRIBUTE_KEY_LENGTH_RANGE = CSSM_ATTRIBUTE_DATA_RANGE | 11, + CSSM_ATTRIBUTE_BLOCK_SIZE = CSSM_ATTRIBUTE_DATA_UINT32 | 12, + CSSM_ATTRIBUTE_OUTPUT_SIZE = CSSM_ATTRIBUTE_DATA_UINT32 | 13, + CSSM_ATTRIBUTE_ROUNDS = CSSM_ATTRIBUTE_DATA_UINT32 | 14, + CSSM_ATTRIBUTE_IV_SIZE = CSSM_ATTRIBUTE_DATA_UINT32 | 15, + CSSM_ATTRIBUTE_ALG_PARAMS = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 16, + CSSM_ATTRIBUTE_LABEL = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 17, + CSSM_ATTRIBUTE_KEY_TYPE = CSSM_ATTRIBUTE_DATA_UINT32 | 18, + CSSM_ATTRIBUTE_MODE = CSSM_ATTRIBUTE_DATA_UINT32 | 19, + CSSM_ATTRIBUTE_EFFECTIVE_BITS = CSSM_ATTRIBUTE_DATA_UINT32 | 20, + CSSM_ATTRIBUTE_START_DATE = CSSM_ATTRIBUTE_DATA_DATE | 21, + CSSM_ATTRIBUTE_END_DATE = CSSM_ATTRIBUTE_DATA_DATE | 22, + CSSM_ATTRIBUTE_KEYUSAGE = CSSM_ATTRIBUTE_DATA_UINT32 | 23, + CSSM_ATTRIBUTE_KEYATTR = CSSM_ATTRIBUTE_DATA_UINT32 | 24, + CSSM_ATTRIBUTE_VERSION = CSSM_ATTRIBUTE_DATA_VERSION | 25, + CSSM_ATTRIBUTE_PRIME = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 26, + CSSM_ATTRIBUTE_BASE = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 27, + CSSM_ATTRIBUTE_SUBPRIME = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 28, + CSSM_ATTRIBUTE_ALG_ID = CSSM_ATTRIBUTE_DATA_UINT32 | 29, + CSSM_ATTRIBUTE_ITERATION_COUNT = CSSM_ATTRIBUTE_DATA_UINT32 | 30, + CSSM_ATTRIBUTE_ROUNDS_RANGE = CSSM_ATTRIBUTE_DATA_RANGE | 31, + CSSM_ATTRIBUTE_KRPROFILE_LOCAL = CSSM_ATTRIBUTE_DATA_KR_PROFILE | 32, + CSSM_ATTRIBUTE_KRPROFILE_REMOTE = CSSM_ATTRIBUTE_DATA_KR_PROFILE | 33, + CSSM_ATTRIBUTE_CSP_HANDLE = CSSM_ATTRIBUTE_DATA_UINT32 | 34, + CSSM_ATTRIBUTE_DL_DB_HANDLE = CSSM_ATTRIBUTE_DATA_DL_DB_HANDLE | 35, + CSSM_ATTRIBUTE_ACCESS_CREDENTIALS = CSSM_ATTRIBUTE_DATA_ACCESS_CREDENTIALS | 36, + CSSM_ATTRIBUTE_PUBLIC_KEY_FORMAT = CSSM_ATTRIBUTE_DATA_UINT32 | 37, + CSSM_ATTRIBUTE_PRIVATE_KEY_FORMAT = CSSM_ATTRIBUTE_DATA_UINT32 | 38, + CSSM_ATTRIBUTE_SYMMETRIC_KEY_FORMAT=CSSM_ATTRIBUTE_DATA_UINT32 | 39, + CSSM_ATTRIBUTE_WRAPPED_KEY_FORMAT = CSSM_ATTRIBUTE_DATA_UINT32 | 40 +}; + +typedef uint32 CSSM_PADDING; +enum { + CSSM_PADDING_NONE = 0, + CSSM_PADDING_CUSTOM = CSSM_PADDING_NONE + 1, + CSSM_PADDING_ZERO = CSSM_PADDING_NONE + 2, + CSSM_PADDING_ONE = CSSM_PADDING_NONE + 3, + CSSM_PADDING_ALTERNATE = CSSM_PADDING_NONE + 4, + CSSM_PADDING_FF = CSSM_PADDING_NONE + 5, + CSSM_PADDING_PKCS5 = CSSM_PADDING_NONE + 6, + CSSM_PADDING_PKCS7 = CSSM_PADDING_NONE + 7, + CSSM_PADDING_CIPHERSTEALING = CSSM_PADDING_NONE + 8, + CSSM_PADDING_RANDOM = CSSM_PADDING_NONE + 9, + CSSM_PADDING_PKCS1 = CSSM_PADDING_NONE + 10, + CSSM_PADDING_SIGRAW = CSSM_PADDING_NONE + 11, + + + + CSSM_PADDING_VENDOR_DEFINED = CSSM_PADDING_NONE + 0x80000000 +}; + +typedef CSSM_ALGORITHMS CSSM_KEY_TYPE; + +typedef struct cssm_context_attribute { + CSSM_ATTRIBUTE_TYPE AttributeType; + uint32 AttributeLength; + union cssm_context_attribute_value { + char *String; + uint32 Uint32; + CSSM_ACCESS_CREDENTIALS_PTR AccessCredentials; + CSSM_KEY_PTR Key; + CSSM_DATA_PTR Data; + CSSM_PADDING Padding; + CSSM_DATE_PTR Date; + CSSM_RANGE_PTR Range; + CSSM_CRYPTO_DATA_PTR CryptoData; + CSSM_VERSION_PTR Version; + CSSM_DL_DB_HANDLE_PTR DLDBHandle; + struct cssm_kr_profile *KRProfile; + } Attribute; +} CSSM_CONTEXT_ATTRIBUTE, *CSSM_CONTEXT_ATTRIBUTE_PTR; + +typedef struct cssm_context { + CSSM_CONTEXT_TYPE ContextType; + CSSM_ALGORITHMS AlgorithmType; + uint32 NumberOfAttributes; + CSSM_CONTEXT_ATTRIBUTE_PTR ContextAttributes; + CSSM_CSP_HANDLE CSPHandle; + CSSM_BOOL Privileged; + uint32 EncryptionProhibited; + uint32 WorkFactor; + uint32 Reserved; +} CSSM_CONTEXT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_CONTEXT_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_SC_FLAGS; +enum { + CSSM_CSP_TOK_RNG = 0x00000001, + CSSM_CSP_TOK_CLOCK_EXISTS = 0x00000040 +}; + +typedef uint32 CSSM_CSP_READER_FLAGS; +enum { + CSSM_CSP_RDR_TOKENPRESENT = 0x00000001, + + CSSM_CSP_RDR_EXISTS = 0x00000002, + + + CSSM_CSP_RDR_HW = 0x00000004 + +}; + +typedef uint32 CSSM_CSP_FLAGS; +enum { + CSSM_CSP_TOK_WRITE_PROTECTED = 0x00000002, + CSSM_CSP_TOK_LOGIN_REQUIRED = 0x00000004, + CSSM_CSP_TOK_USER_PIN_INITIALIZED = 0x00000008, + CSSM_CSP_TOK_PROT_AUTHENTICATION = 0x00000100, + CSSM_CSP_TOK_USER_PIN_EXPIRED = 0x00100000, + CSSM_CSP_TOK_SESSION_KEY_PASSWORD = 0x00200000, + CSSM_CSP_TOK_PRIVATE_KEY_PASSWORD = 0x00400000, + CSSM_CSP_STORES_PRIVATE_KEYS = 0x01000000, + CSSM_CSP_STORES_PUBLIC_KEYS = 0x02000000, + CSSM_CSP_STORES_SESSION_KEYS = 0x04000000, + CSSM_CSP_STORES_CERTIFICATES = 0x08000000, + CSSM_CSP_STORES_GENERIC = 0x10000000 +}; + +typedef uint32 CSSM_PKCS_OAEP_MGF; +enum { + CSSM_PKCS_OAEP_MGF_NONE = 0, + CSSM_PKCS_OAEP_MGF1_SHA1 = CSSM_PKCS_OAEP_MGF_NONE + 1, + CSSM_PKCS_OAEP_MGF1_MD5 = CSSM_PKCS_OAEP_MGF_NONE + 2 +}; + +typedef uint32 CSSM_PKCS_OAEP_PSOURCE; +enum { + CSSM_PKCS_OAEP_PSOURCE_NONE = 0, + CSSM_PKCS_OAEP_PSOURCE_Pspecified = CSSM_PKCS_OAEP_PSOURCE_NONE + 1 +}; + +typedef struct cssm_pkcs1_oaep_params { + uint32 HashAlgorithm; + CSSM_DATA HashParams; + CSSM_PKCS_OAEP_MGF MGF; + CSSM_DATA MGFParams; + CSSM_PKCS_OAEP_PSOURCE PSource; + CSSM_DATA PSourceParams; +} CSSM_PKCS1_OAEP_PARAMS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_PKCS1_OAEP_PARAMS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_csp_operational_statistics { + CSSM_BOOL UserAuthenticated; + + CSSM_CSP_FLAGS DeviceFlags; + uint32 TokenMaxSessionCount; + uint32 TokenOpenedSessionCount; + uint32 TokenMaxRWSessionCount; + uint32 TokenOpenedRWSessionCount; + uint32 TokenTotalPublicMem; + uint32 TokenFreePublicMem; + uint32 TokenTotalPrivateMem; + uint32 TokenFreePrivateMem; +} CSSM_CSP_OPERATIONAL_STATISTICS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_CSP_OPERATIONAL_STATISTICS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + +enum { + CSSM_VALUE_NOT_AVAILABLE = -1 +}; + +typedef struct cssm_pkcs5_pbkdf1_params { + CSSM_DATA Passphrase; + CSSM_DATA InitVector; +} CSSM_PKCS5_PBKDF1_PARAMS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_PKCS5_PBKDF1_PARAMS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_PKCS5_PBKDF2_PRF; +enum { + CSSM_PKCS5_PBKDF2_PRF_HMAC_SHA1 = 0 +}; + +typedef struct cssm_pkcs5_pbkdf2_params { + CSSM_DATA Passphrase; + CSSM_PKCS5_PBKDF2_PRF PseudoRandomFunction; +} CSSM_PKCS5_PBKDF2_PARAMS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_PKCS5_PBKDF2_PARAMS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_kea_derive_params { + CSSM_DATA Rb; + CSSM_DATA Yb; +} CSSM_KEA_DERIVE_PARAMS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_KEA_DERIVE_PARAMS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + +typedef struct cssm_tp_authority_id { + CSSM_DATA *AuthorityCert; + CSSM_NET_ADDRESS_PTR AuthorityLocation; +} CSSM_TP_AUTHORITY_ID __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TP_AUTHORITY_ID_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_TP_AUTHORITY_REQUEST_TYPE, *CSSM_TP_AUTHORITY_REQUEST_TYPE_PTR; +enum { + CSSM_TP_AUTHORITY_REQUEST_CERTISSUE = 0x01, + CSSM_TP_AUTHORITY_REQUEST_CERTREVOKE = 0x02, + CSSM_TP_AUTHORITY_REQUEST_CERTSUSPEND = 0x03, + CSSM_TP_AUTHORITY_REQUEST_CERTRESUME = 0x04, + CSSM_TP_AUTHORITY_REQUEST_CERTVERIFY = 0x05, + CSSM_TP_AUTHORITY_REQUEST_CERTNOTARIZE = 0x06, + CSSM_TP_AUTHORITY_REQUEST_CERTUSERECOVER = 0x07, + CSSM_TP_AUTHORITY_REQUEST_CRLISSUE = 0x100 +}; + +typedef CSSM_RETURN ( * CSSM_TP_VERIFICATION_RESULTS_CALLBACK) + (CSSM_MODULE_HANDLE ModuleHandle, + void *CallerCtx, + CSSM_DATA_PTR VerifiedCert); + + +typedef CSSM_DATA CSSM_OID, *CSSM_OID_PTR; + +typedef struct cssm_field { + CSSM_OID FieldOid; + CSSM_DATA FieldValue; +} CSSM_FIELD __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_FIELD_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + +typedef struct cssm_tp_policyinfo { + uint32 NumberOfPolicyIds; + CSSM_FIELD_PTR PolicyIds; + void *PolicyControl; +} CSSM_TP_POLICYINFO __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TP_POLICYINFO_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_TP_SERVICES; +enum { + + CSSM_TP_KEY_ARCHIVE = 0x0001, + CSSM_TP_CERT_PUBLISH = 0x0002, + CSSM_TP_CERT_NOTIFY_RENEW = 0x0004, + CSSM_TP_CERT_DIR_UPDATE = 0x0008, + CSSM_TP_CRL_DISTRIBUTE = 0x0010 +}; + +typedef uint32 CSSM_TP_ACTION; +enum { + CSSM_TP_ACTION_DEFAULT = 0 +}; + +typedef uint32 CSSM_TP_STOP_ON; +enum { + CSSM_TP_STOP_ON_POLICY = 0, + CSSM_TP_STOP_ON_NONE = 1, + CSSM_TP_STOP_ON_FIRST_PASS = 2, + CSSM_TP_STOP_ON_FIRST_FAIL = 3 +}; + +typedef char *CSSM_TIMESTRING; + + +typedef struct cssm_dl_db_list { + uint32 NumHandles; + CSSM_DL_DB_HANDLE_PTR DLDBHandle; +} CSSM_DL_DB_LIST __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_DL_DB_LIST_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + +typedef struct cssm_tp_callerauth_context { + CSSM_TP_POLICYINFO Policy; + CSSM_TIMESTRING VerifyTime; + CSSM_TP_STOP_ON VerificationAbortOn; + CSSM_TP_VERIFICATION_RESULTS_CALLBACK CallbackWithVerifiedCert; + uint32 NumberOfAnchorCerts; + CSSM_DATA_PTR AnchorCerts; + CSSM_DL_DB_LIST_PTR DBList; + CSSM_ACCESS_CREDENTIALS_PTR CallerCredentials; +} CSSM_TP_CALLERAUTH_CONTEXT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TP_CALLERAUTH_CONTEXT_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_CRL_PARSE_FORMAT, * CSSM_CRL_PARSE_FORMAT_PTR; +enum { + CSSM_CRL_PARSE_FORMAT_NONE = 0x00, + CSSM_CRL_PARSE_FORMAT_CUSTOM = 0x01, + CSSM_CRL_PARSE_FORMAT_SEXPR = 0x02, + CSSM_CRL_PARSE_FORMAT_COMPLEX = 0x03, + CSSM_CRL_PARSE_FORMAT_OID_NAMED = 0x04, + CSSM_CRL_PARSE_FORMAT_TUPLE = 0x05, + CSSM_CRL_PARSE_FORMAT_MULTIPLE = 0x7FFE, + CSSM_CRL_PARSE_FORMAT_LAST = 0x7FFF, + + + + CSSM_CL_CUSTOM_CRL_PARSE_FORMAT = 0x8000 +}; + + +typedef uint32 CSSM_CRL_TYPE, *CSSM_CRL_TYPE_PTR; +enum { + CSSM_CRL_TYPE_UNKNOWN = 0x00, + CSSM_CRL_TYPE_X_509v1 = 0x01, + CSSM_CRL_TYPE_X_509v2 = 0x02, + CSSM_CRL_TYPE_SPKI = 0x03, + CSSM_CRL_TYPE_MULTIPLE = 0x7FFE +}; + +typedef uint32 CSSM_CRL_ENCODING, *CSSM_CRL_ENCODING_PTR; +enum { + CSSM_CRL_ENCODING_UNKNOWN = 0x00, + CSSM_CRL_ENCODING_CUSTOM = 0x01, + CSSM_CRL_ENCODING_BER = 0x02, + CSSM_CRL_ENCODING_DER = 0x03, + CSSM_CRL_ENCODING_BLOOM = 0x04, + CSSM_CRL_ENCODING_SEXPR = 0x05, + CSSM_CRL_ENCODING_MULTIPLE = 0x7FFE +}; + +typedef struct cssm_encoded_crl { + CSSM_CRL_TYPE CrlType; + CSSM_CRL_ENCODING CrlEncoding; + CSSM_DATA CrlBlob; +} CSSM_ENCODED_CRL __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_ENCODED_CRL_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + +typedef struct cssm_parsed_crl { + CSSM_CRL_TYPE CrlType; + CSSM_CRL_PARSE_FORMAT ParsedCrlFormat; + + void *ParsedCrl; +} CSSM_PARSED_CRL __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_PARSED_CRL_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_crl_pair { + CSSM_ENCODED_CRL EncodedCrl; + CSSM_PARSED_CRL ParsedCrl; +} CSSM_CRL_PAIR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_CRL_PAIR_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_CRLGROUP_TYPE, * CSSM_CRLGROUP_TYPE_PTR; +enum { + CSSM_CRLGROUP_DATA = 0x00, + CSSM_CRLGROUP_ENCODED_CRL = 0x01, + CSSM_CRLGROUP_PARSED_CRL = 0x02, + CSSM_CRLGROUP_CRL_PAIR = 0x03 +}; + +typedef struct cssm_crlgroup { + CSSM_CRL_TYPE CrlType; + CSSM_CRL_ENCODING CrlEncoding; + uint32 NumberOfCrls; + union { + CSSM_DATA_PTR CrlList; + CSSM_ENCODED_CRL_PTR EncodedCrlList; + CSSM_PARSED_CRL_PTR ParsedCrlList; + CSSM_CRL_PAIR_PTR PairCrlList; + } GroupCrlList; + CSSM_CRLGROUP_TYPE CrlGroupType; +} CSSM_CRLGROUP, *CSSM_CRLGROUP_PTR; + +typedef struct cssm_fieldgroup { + int NumberOfFields; + CSSM_FIELD_PTR Fields; +} CSSM_FIELDGROUP __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_FIELDGROUP_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_EVIDENCE_FORM; +enum { + CSSM_EVIDENCE_FORM_UNSPECIFIC = 0x0, + CSSM_EVIDENCE_FORM_CERT = 0x1, + CSSM_EVIDENCE_FORM_CRL = 0x2, + CSSM_EVIDENCE_FORM_CERT_ID = 0x3, + CSSM_EVIDENCE_FORM_CRL_ID = 0x4, + CSSM_EVIDENCE_FORM_VERIFIER_TIME = 0x5, + CSSM_EVIDENCE_FORM_CRL_THISTIME = 0x6, + CSSM_EVIDENCE_FORM_CRL_NEXTTIME = 0x7, + CSSM_EVIDENCE_FORM_POLICYINFO = 0x8, + CSSM_EVIDENCE_FORM_TUPLEGROUP = 0x9 +}; + +typedef struct cssm_evidence { + CSSM_EVIDENCE_FORM EvidenceForm; + void *Evidence; +} CSSM_EVIDENCE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_EVIDENCE_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_tp_verify_context { + CSSM_TP_ACTION Action; + CSSM_DATA ActionData; + CSSM_CRLGROUP Crls; + CSSM_TP_CALLERAUTH_CONTEXT_PTR Cred; +} CSSM_TP_VERIFY_CONTEXT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TP_VERIFY_CONTEXT_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_tp_verify_context_result { + uint32 NumberOfEvidences; + CSSM_EVIDENCE_PTR Evidence; +} CSSM_TP_VERIFY_CONTEXT_RESULT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TP_VERIFY_CONTEXT_RESULT_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_tp_request_set { + uint32 NumberOfRequests; + void *Requests; +} CSSM_TP_REQUEST_SET __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TP_REQUEST_SET_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_tp_result_set { + uint32 NumberOfResults; + void *Results; +} CSSM_TP_RESULT_SET __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TP_RESULT_SET_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_TP_CONFIRM_STATUS, *CSSM_TP_CONFIRM_STATUS_PTR; +enum { + CSSM_TP_CONFIRM_STATUS_UNKNOWN = 0x0, + + CSSM_TP_CONFIRM_ACCEPT = 0x1, + + + CSSM_TP_CONFIRM_REJECT = 0x2 + + +}; + +typedef struct cssm_tp_confirm_response { + uint32 NumberOfResponses; + CSSM_TP_CONFIRM_STATUS_PTR Responses; +} CSSM_TP_CONFIRM_RESPONSE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TP_CONFIRM_RESPONSE_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +enum { + CSSM_ESTIMATED_TIME_UNKNOWN = -1 +}; + +enum { + CSSM_ELAPSED_TIME_UNKNOWN = -1, + CSSM_ELAPSED_TIME_COMPLETE = -2 +}; + +typedef struct cssm_tp_certissue_input { + CSSM_SUBSERVICE_UID CSPSubserviceUid; + CSSM_CL_HANDLE CLHandle; + uint32 NumberOfTemplateFields; + CSSM_FIELD_PTR SubjectCertFields; + CSSM_TP_SERVICES MoreServiceRequests; + uint32 NumberOfServiceControls; + CSSM_FIELD_PTR ServiceControls; + CSSM_ACCESS_CREDENTIALS_PTR UserCredentials; +} CSSM_TP_CERTISSUE_INPUT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TP_CERTISSUE_INPUT_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_TP_CERTISSUE_STATUS; +enum { + CSSM_TP_CERTISSUE_STATUS_UNKNOWN = 0x0, + + CSSM_TP_CERTISSUE_OK = 0x1, + + CSSM_TP_CERTISSUE_OKWITHCERTMODS = 0x2, + + + CSSM_TP_CERTISSUE_OKWITHSERVICEMODS = 0x3, + + + + CSSM_TP_CERTISSUE_REJECTED = 0x4, + + + CSSM_TP_CERTISSUE_NOT_AUTHORIZED = 0x5, + + + CSSM_TP_CERTISSUE_WILL_BE_REVOKED = 0x6 + + +}; + +typedef struct cssm_tp_certissue_output { + CSSM_TP_CERTISSUE_STATUS IssueStatus; + CSSM_CERTGROUP_PTR CertGroup; + CSSM_TP_SERVICES PerformedServiceRequests; +} CSSM_TP_CERTISSUE_OUTPUT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TP_CERTISSUE_OUTPUT_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_TP_CERTCHANGE_ACTION; +enum { + CSSM_TP_CERTCHANGE_NONE = 0x0, + CSSM_TP_CERTCHANGE_REVOKE = 0x1, + + + + + CSSM_TP_CERTCHANGE_HOLD = 0x2, + CSSM_TP_CERTCHANGE_RELEASE = 0x3 + + + + + +}; + +typedef uint32 CSSM_TP_CERTCHANGE_REASON; +enum { + CSSM_TP_CERTCHANGE_REASON_UNKNOWN = 0x0, + + CSSM_TP_CERTCHANGE_REASON_KEYCOMPROMISE = 0x1, + + CSSM_TP_CERTCHANGE_REASON_CACOMPROMISE = 0x2, + + CSSM_TP_CERTCHANGE_REASON_CEASEOPERATION = 0x3, + + + CSSM_TP_CERTCHANGE_REASON_AFFILIATIONCHANGE = 0x4, + + + CSSM_TP_CERTCHANGE_REASON_SUPERCEDED = 0x5, + + + CSSM_TP_CERTCHANGE_REASON_SUSPECTEDCOMPROMISE = 0x6, + + CSSM_TP_CERTCHANGE_REASON_HOLDRELEASE = 0x7 + + +}; + +typedef struct cssm_tp_certchange_input { + CSSM_TP_CERTCHANGE_ACTION Action; + CSSM_TP_CERTCHANGE_REASON Reason; + CSSM_CL_HANDLE CLHandle; + CSSM_DATA_PTR Cert; + CSSM_FIELD_PTR ChangeInfo; + CSSM_TIMESTRING StartTime; + CSSM_ACCESS_CREDENTIALS_PTR CallerCredentials; +} CSSM_TP_CERTCHANGE_INPUT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TP_CERTCHANGE_INPUT_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_TP_CERTCHANGE_STATUS; +enum { + CSSM_TP_CERTCHANGE_STATUS_UNKNOWN = 0x0, + + CSSM_TP_CERTCHANGE_OK = 0x1, + + + CSSM_TP_CERTCHANGE_OKWITHNEWTIME = 0x2, + + + CSSM_TP_CERTCHANGE_WRONGCA = 0x3, + + + + CSSM_TP_CERTCHANGE_REJECTED = 0x4, + + + CSSM_TP_CERTCHANGE_NOT_AUTHORIZED = 0x5 + + + +}; + +typedef struct cssm_tp_certchange_output { + CSSM_TP_CERTCHANGE_STATUS ActionStatus; + CSSM_FIELD RevokeInfo; +} CSSM_TP_CERTCHANGE_OUTPUT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TP_CERTCHANGE_OUTPUT_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_tp_certverify_input { + CSSM_CL_HANDLE CLHandle; + CSSM_DATA_PTR Cert; + CSSM_TP_VERIFY_CONTEXT_PTR VerifyContext; +} CSSM_TP_CERTVERIFY_INPUT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TP_CERTVERIFY_INPUT_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_TP_CERTVERIFY_STATUS; +enum { + CSSM_TP_CERTVERIFY_UNKNOWN = 0x0, + CSSM_TP_CERTVERIFY_VALID = 0x1, + CSSM_TP_CERTVERIFY_INVALID = 0x2, + CSSM_TP_CERTVERIFY_REVOKED = 0x3, + CSSM_TP_CERTVERIFY_SUSPENDED = 0x4, + CSSM_TP_CERTVERIFY_EXPIRED = 0x5, + CSSM_TP_CERTVERIFY_NOT_VALID_YET = 0x6, + CSSM_TP_CERTVERIFY_INVALID_AUTHORITY = 0x7, + CSSM_TP_CERTVERIFY_INVALID_SIGNATURE = 0x8, + CSSM_TP_CERTVERIFY_INVALID_CERT_VALUE = 0x9, + CSSM_TP_CERTVERIFY_INVALID_CERTGROUP = 0xA, + CSSM_TP_CERTVERIFY_INVALID_POLICY = 0xB, + CSSM_TP_CERTVERIFY_INVALID_POLICY_IDS = 0xC, + CSSM_TP_CERTVERIFY_INVALID_BASIC_CONSTRAINTS = 0xD, + CSSM_TP_CERTVERIFY_INVALID_CRL_DIST_PT = 0xE, + CSSM_TP_CERTVERIFY_INVALID_NAME_TREE = 0xF, + CSSM_TP_CERTVERIFY_UNKNOWN_CRITICAL_EXT = 0x10 +}; + +typedef struct cssm_tp_certverify_output { + CSSM_TP_CERTVERIFY_STATUS VerifyStatus; + uint32 NumberOfEvidence; + CSSM_EVIDENCE_PTR Evidence; +} CSSM_TP_CERTVERIFY_OUTPUT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TP_CERTVERIFY_OUTPUT_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_tp_certnotarize_input { + CSSM_CL_HANDLE CLHandle; + uint32 NumberOfFields; + CSSM_FIELD_PTR MoreFields; + CSSM_FIELD_PTR SignScope; + uint32 ScopeSize; + CSSM_TP_SERVICES MoreServiceRequests; + uint32 NumberOfServiceControls; + CSSM_FIELD_PTR ServiceControls; + CSSM_ACCESS_CREDENTIALS_PTR UserCredentials; +} CSSM_TP_CERTNOTARIZE_INPUT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TP_CERTNOTARIZE_INPUT_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_TP_CERTNOTARIZE_STATUS; +enum { + CSSM_TP_CERTNOTARIZE_STATUS_UNKNOWN = 0x0, + + CSSM_TP_CERTNOTARIZE_OK = 0x1, + + + CSSM_TP_CERTNOTARIZE_OKWITHOUTFIELDS = 0x2, + + + + CSSM_TP_CERTNOTARIZE_OKWITHSERVICEMODS = 0x3, + + + + + CSSM_TP_CERTNOTARIZE_REJECTED = 0x4, + + + CSSM_TP_CERTNOTARIZE_NOT_AUTHORIZED = 0x5 + + +}; + +typedef struct cssm_tp_certnotarize_output { + CSSM_TP_CERTNOTARIZE_STATUS NotarizeStatus; + CSSM_CERTGROUP_PTR NotarizedCertGroup; + CSSM_TP_SERVICES PerformedServiceRequests; +} CSSM_TP_CERTNOTARIZE_OUTPUT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TP_CERTNOTARIZE_OUTPUT_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_tp_certreclaim_input { + CSSM_CL_HANDLE CLHandle; + uint32 NumberOfSelectionFields; + CSSM_FIELD_PTR SelectionFields; + CSSM_ACCESS_CREDENTIALS_PTR UserCredentials; +} CSSM_TP_CERTRECLAIM_INPUT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TP_CERTRECLAIM_INPUT_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_TP_CERTRECLAIM_STATUS; +enum { + CSSM_TP_CERTRECLAIM_STATUS_UNKNOWN = 0x0, + + CSSM_TP_CERTRECLAIM_OK = 0x1, + + + + CSSM_TP_CERTRECLAIM_NOMATCH = 0x2, + + + + CSSM_TP_CERTRECLAIM_REJECTED = 0x3, + + + CSSM_TP_CERTRECLAIM_NOT_AUTHORIZED = 0x4 + + + +}; + +typedef struct cssm_tp_certreclaim_output { + CSSM_TP_CERTRECLAIM_STATUS ReclaimStatus; + CSSM_CERTGROUP_PTR ReclaimedCertGroup; + CSSM_LONG_HANDLE KeyCacheHandle; +} CSSM_TP_CERTRECLAIM_OUTPUT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TP_CERTRECLAIM_OUTPUT_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_tp_crlissue_input { + CSSM_CL_HANDLE CLHandle; + uint32 CrlIdentifier; + CSSM_TIMESTRING CrlThisTime; + CSSM_FIELD_PTR PolicyIdentifier; + CSSM_ACCESS_CREDENTIALS_PTR CallerCredentials; +} CSSM_TP_CRLISSUE_INPUT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TP_CRLISSUE_INPUT_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_TP_CRLISSUE_STATUS; +enum { + CSSM_TP_CRLISSUE_STATUS_UNKNOWN = 0x0, + + CSSM_TP_CRLISSUE_OK = 0x1, + + + + CSSM_TP_CRLISSUE_NOT_CURRENT = 0x2, + + + + + + + CSSM_TP_CRLISSUE_INVALID_DOMAIN = 0x3, + + + + + CSSM_TP_CRLISSUE_UNKNOWN_IDENTIFIER = 0x4, + + + + CSSM_TP_CRLISSUE_REJECTED = 0x5, + + + + CSSM_TP_CRLISSUE_NOT_AUTHORIZED = 0x6 + + + +}; + +typedef struct cssm_tp_crlissue_output { + CSSM_TP_CRLISSUE_STATUS IssueStatus; + CSSM_ENCODED_CRL_PTR Crl; + CSSM_TIMESTRING CrlNextTime; +} CSSM_TP_CRLISSUE_OUTPUT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_TP_CRLISSUE_OUTPUT_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_TP_FORM_TYPE; +enum { + CSSM_TP_FORM_TYPE_GENERIC = 0x0, + CSSM_TP_FORM_TYPE_REGISTRATION = 0x1 +}; + + + +typedef uint32 CSSM_CL_TEMPLATE_TYPE; +enum { + CSSM_CL_TEMPLATE_INTERMEDIATE_CERT = 1, + + + CSSM_CL_TEMPLATE_PKIX_CERTTEMPLATE = 2 + +}; + +typedef uint32 CSSM_CERT_BUNDLE_TYPE; +enum { + CSSM_CERT_BUNDLE_UNKNOWN = 0x00, + CSSM_CERT_BUNDLE_CUSTOM = 0x01, + CSSM_CERT_BUNDLE_PKCS7_SIGNED_DATA = 0x02, + CSSM_CERT_BUNDLE_PKCS7_SIGNED_ENVELOPED_DATA = 0x03, + CSSM_CERT_BUNDLE_PKCS12 = 0x04, + CSSM_CERT_BUNDLE_PFX = 0x05, + CSSM_CERT_BUNDLE_SPKI_SEQUENCE = 0x06, + CSSM_CERT_BUNDLE_PGP_KEYRING = 0x07, + CSSM_CERT_BUNDLE_LAST = 0x7FFF, + + + + CSSM_CL_CUSTOM_CERT_BUNDLE_TYPE = 0x8000 +}; + +typedef uint32 CSSM_CERT_BUNDLE_ENCODING; +enum { + CSSM_CERT_BUNDLE_ENCODING_UNKNOWN = 0x00, + CSSM_CERT_BUNDLE_ENCODING_CUSTOM = 0x01, + CSSM_CERT_BUNDLE_ENCODING_BER = 0x02, + CSSM_CERT_BUNDLE_ENCODING_DER = 0x03, + CSSM_CERT_BUNDLE_ENCODING_SEXPR = 0x04, + CSSM_CERT_BUNDLE_ENCODING_PGP = 0x05 +}; + +typedef struct cssm_cert_bundle_header { + CSSM_CERT_BUNDLE_TYPE BundleType; + CSSM_CERT_BUNDLE_ENCODING BundleEncoding; +} CSSM_CERT_BUNDLE_HEADER __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_CERT_BUNDLE_HEADER_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_cert_bundle { + CSSM_CERT_BUNDLE_HEADER BundleHeader; + CSSM_DATA Bundle; +} CSSM_CERT_BUNDLE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_CERT_BUNDLE_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +enum { + CSSM_FIELDVALUE_COMPLEX_DATA_TYPE = 0xFFFFFFFF +}; + + + +typedef uint32 CSSM_DB_ATTRIBUTE_NAME_FORMAT, *CSSM_DB_ATTRIBUTE_NAME_FORMAT_PTR; +enum { + CSSM_DB_ATTRIBUTE_NAME_AS_STRING = 0, + CSSM_DB_ATTRIBUTE_NAME_AS_OID = 1, + CSSM_DB_ATTRIBUTE_NAME_AS_INTEGER = 2 +}; + +typedef uint32 CSSM_DB_ATTRIBUTE_FORMAT, *CSSM_DB_ATTRIBUTE_FORMAT_PTR; +enum { + CSSM_DB_ATTRIBUTE_FORMAT_STRING = 0, + CSSM_DB_ATTRIBUTE_FORMAT_SINT32 = 1, + CSSM_DB_ATTRIBUTE_FORMAT_UINT32 = 2, + CSSM_DB_ATTRIBUTE_FORMAT_BIG_NUM = 3, + CSSM_DB_ATTRIBUTE_FORMAT_REAL = 4, + CSSM_DB_ATTRIBUTE_FORMAT_TIME_DATE = 5, + CSSM_DB_ATTRIBUTE_FORMAT_BLOB = 6, + CSSM_DB_ATTRIBUTE_FORMAT_MULTI_UINT32 = 7, + CSSM_DB_ATTRIBUTE_FORMAT_COMPLEX = 8 +}; + +typedef struct cssm_db_attribute_info { + CSSM_DB_ATTRIBUTE_NAME_FORMAT AttributeNameFormat; + union cssm_db_attribute_label { + char *AttributeName; + CSSM_OID AttributeOID; + uint32 AttributeID; + } Label; + CSSM_DB_ATTRIBUTE_FORMAT AttributeFormat; +} CSSM_DB_ATTRIBUTE_INFO, *CSSM_DB_ATTRIBUTE_INFO_PTR; + +typedef struct cssm_db_attribute_data { + CSSM_DB_ATTRIBUTE_INFO Info; + uint32 NumberOfValues; + CSSM_DATA_PTR Value; +} CSSM_DB_ATTRIBUTE_DATA __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_DB_ATTRIBUTE_DATA_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_DB_RECORDTYPE; +enum { + + CSSM_DB_RECORDTYPE_SCHEMA_START = 0x00000000, + CSSM_DB_RECORDTYPE_SCHEMA_END = CSSM_DB_RECORDTYPE_SCHEMA_START + 4, + + CSSM_DB_RECORDTYPE_OPEN_GROUP_START = 0x0000000A, + CSSM_DB_RECORDTYPE_OPEN_GROUP_END = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 8, + + CSSM_DB_RECORDTYPE_APP_DEFINED_START = 0x80000000, + CSSM_DB_RECORDTYPE_APP_DEFINED_END = 0xffffffff, + + CSSM_DL_DB_SCHEMA_INFO = CSSM_DB_RECORDTYPE_SCHEMA_START + 0, + CSSM_DL_DB_SCHEMA_INDEXES = CSSM_DB_RECORDTYPE_SCHEMA_START + 1, + CSSM_DL_DB_SCHEMA_ATTRIBUTES = CSSM_DB_RECORDTYPE_SCHEMA_START + 2, + CSSM_DL_DB_SCHEMA_PARSING_MODULE = CSSM_DB_RECORDTYPE_SCHEMA_START + 3, + + CSSM_DL_DB_RECORD_ANY = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 0, + CSSM_DL_DB_RECORD_CERT = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 1, + CSSM_DL_DB_RECORD_CRL = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 2, + CSSM_DL_DB_RECORD_POLICY = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 3, + CSSM_DL_DB_RECORD_GENERIC = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 4, + CSSM_DL_DB_RECORD_PUBLIC_KEY = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 5, + CSSM_DL_DB_RECORD_PRIVATE_KEY = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 6, + CSSM_DL_DB_RECORD_SYMMETRIC_KEY = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 7, + CSSM_DL_DB_RECORD_ALL_KEYS = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 8 +}; + +enum { + CSSM_DB_CERT_USE_TRUSTED = 0x00000001, + CSSM_DB_CERT_USE_SYSTEM = 0x00000002, + CSSM_DB_CERT_USE_OWNER = 0x00000004, + CSSM_DB_CERT_USE_REVOKED = 0x00000008, + CSSM_DB_CERT_USE_SIGNING = 0x00000010, + CSSM_DB_CERT_USE_PRIVACY = 0x00000020 +}; + +typedef struct cssm_db_record_attribute_info { + CSSM_DB_RECORDTYPE DataRecordType; + uint32 NumberOfAttributes; + CSSM_DB_ATTRIBUTE_INFO_PTR AttributeInfo; +} CSSM_DB_RECORD_ATTRIBUTE_INFO __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_DB_RECORD_ATTRIBUTE_INFO_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_db_record_attribute_data { + CSSM_DB_RECORDTYPE DataRecordType; + uint32 SemanticInformation; + uint32 NumberOfAttributes; + CSSM_DB_ATTRIBUTE_DATA_PTR AttributeData; +} CSSM_DB_RECORD_ATTRIBUTE_DATA __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_db_parsing_module_info { + CSSM_DB_RECORDTYPE RecordType; + CSSM_SUBSERVICE_UID ModuleSubserviceUid; +} CSSM_DB_PARSING_MODULE_INFO __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_DB_PARSING_MODULE_INFO_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_DB_INDEX_TYPE; +enum { + CSSM_DB_INDEX_UNIQUE = 0, + CSSM_DB_INDEX_NONUNIQUE = 1 +}; + +typedef uint32 CSSM_DB_INDEXED_DATA_LOCATION; +enum { + CSSM_DB_INDEX_ON_UNKNOWN = 0, + CSSM_DB_INDEX_ON_ATTRIBUTE = 1, + CSSM_DB_INDEX_ON_RECORD = 2 +}; + +typedef struct cssm_db_index_info { + CSSM_DB_INDEX_TYPE IndexType; + CSSM_DB_INDEXED_DATA_LOCATION IndexedDataLocation; + CSSM_DB_ATTRIBUTE_INFO Info; +} CSSM_DB_INDEX_INFO __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_DB_INDEX_INFO_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_db_unique_record { + CSSM_DB_INDEX_INFO RecordLocator; + CSSM_DATA RecordIdentifier; +} CSSM_DB_UNIQUE_RECORD __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_DB_UNIQUE_RECORD_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_db_record_index_info { + CSSM_DB_RECORDTYPE DataRecordType; + uint32 NumberOfIndexes; + CSSM_DB_INDEX_INFO_PTR IndexInfo; +} CSSM_DB_RECORD_INDEX_INFO __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_DB_RECORD_INDEX_INFO_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_DB_ACCESS_TYPE, *CSSM_DB_ACCESS_TYPE_PTR; +enum { + CSSM_DB_ACCESS_READ = 0x00001, + CSSM_DB_ACCESS_WRITE = 0x00002, + CSSM_DB_ACCESS_PRIVILEGED = 0x00004 +}; + +typedef uint32 CSSM_DB_MODIFY_MODE; +enum { + CSSM_DB_MODIFY_ATTRIBUTE_NONE = 0, + CSSM_DB_MODIFY_ATTRIBUTE_ADD = CSSM_DB_MODIFY_ATTRIBUTE_NONE + 1, + CSSM_DB_MODIFY_ATTRIBUTE_DELETE = CSSM_DB_MODIFY_ATTRIBUTE_NONE + 2, + CSSM_DB_MODIFY_ATTRIBUTE_REPLACE = CSSM_DB_MODIFY_ATTRIBUTE_NONE + 3 +}; + +typedef struct cssm_dbinfo { + + + + uint32 NumberOfRecordTypes; + CSSM_DB_PARSING_MODULE_INFO_PTR DefaultParsingModules; + CSSM_DB_RECORD_ATTRIBUTE_INFO_PTR RecordAttributeNames; + CSSM_DB_RECORD_INDEX_INFO_PTR RecordIndexes; + + CSSM_BOOL IsLocal; + char *AccessPath; + void *Reserved; +} CSSM_DBINFO __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_DBINFO_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_DB_OPERATOR, *CSSM_DB_OPERATOR_PTR; +enum { + CSSM_DB_EQUAL = 0, + CSSM_DB_NOT_EQUAL = 1, + CSSM_DB_LESS_THAN = 2, + CSSM_DB_GREATER_THAN = 3, + CSSM_DB_CONTAINS = 4, + CSSM_DB_CONTAINS_INITIAL_SUBSTRING = 5, + CSSM_DB_CONTAINS_FINAL_SUBSTRING = 6 +}; + +typedef uint32 CSSM_DB_CONJUNCTIVE, *CSSM_DB_CONJUNCTIVE_PTR; +enum { + CSSM_DB_NONE = 0, + CSSM_DB_AND = 1, + CSSM_DB_OR = 2 +}; + +typedef struct cssm_selection_predicate { + CSSM_DB_OPERATOR DbOperator; + CSSM_DB_ATTRIBUTE_DATA Attribute; +} CSSM_SELECTION_PREDICATE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_SELECTION_PREDICATE_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +enum { + CSSM_QUERY_TIMELIMIT_NONE = 0 +}; + +enum { + CSSM_QUERY_SIZELIMIT_NONE = 0 +}; + +typedef struct cssm_query_limits { + uint32 TimeLimit; + uint32 SizeLimit; +} CSSM_QUERY_LIMITS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_QUERY_LIMITS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_QUERY_FLAGS; +enum { + CSSM_QUERY_RETURN_DATA = 0x01 +}; + +typedef struct cssm_query { + CSSM_DB_RECORDTYPE RecordType; + CSSM_DB_CONJUNCTIVE Conjunctive; + uint32 NumSelectionPredicates; + CSSM_SELECTION_PREDICATE_PTR SelectionPredicate; + CSSM_QUERY_LIMITS QueryLimits; + CSSM_QUERY_FLAGS QueryFlags; +} CSSM_QUERY __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_QUERY_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_DLTYPE, *CSSM_DLTYPE_PTR; +enum { + CSSM_DL_UNKNOWN = 0, + CSSM_DL_CUSTOM = 1, + CSSM_DL_LDAP = 2, + CSSM_DL_ODBC = 3, + CSSM_DL_PKCS11 = 4, + CSSM_DL_FFS = 5, + CSSM_DL_MEMORY = 6, + CSSM_DL_REMOTEDIR = 7 +}; + +typedef void *CSSM_DL_CUSTOM_ATTRIBUTES; +typedef void *CSSM_DL_LDAP_ATTRIBUTES; +typedef void *CSSM_DL_ODBC_ATTRIBUTES; +typedef void *CSSM_DL_FFS_ATTRIBUTES; + +typedef struct cssm_dl_pkcs11_attributes { + uint32 DeviceAccessFlags; +} *CSSM_DL_PKCS11_ATTRIBUTE, *CSSM_DL_PKCS11_ATTRIBUTE_PTR; + +enum { + CSSM_DB_DATASTORES_UNKNOWN = 0xFFFFFFFF +}; + +typedef struct cssm_name_list { + uint32 NumStrings; + char **String; +} CSSM_NAME_LIST __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_NAME_LIST_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef uint32 CSSM_DB_RETRIEVAL_MODES; +enum { + CSSM_DB_TRANSACTIONAL_MODE = 0, + CSSM_DB_FILESYSTEMSCAN_MODE = 1 +}; + +typedef struct cssm_db_schema_attribute_info { + uint32 AttributeId; + char *AttributeName; + CSSM_OID AttributeNameID; + CSSM_DB_ATTRIBUTE_FORMAT DataType; +} CSSM_DB_SCHEMA_ATTRIBUTE_INFO __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_DB_SCHEMA_ATTRIBUTE_INFO_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_db_schema_index_info { + uint32 AttributeId; + uint32 IndexId; + CSSM_DB_INDEX_TYPE IndexType; + CSSM_DB_INDEXED_DATA_LOCATION IndexedDataLocation; +} CSSM_DB_SCHEMA_INDEX_INFO __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_DB_SCHEMA_INDEX_INFO_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + +typedef uint8 CSSM_BER_TAG; +typedef struct cssm_x509_algorithm_identifier { + CSSM_OID algorithm; + CSSM_DATA parameters; +} CSSM_X509_ALGORITHM_IDENTIFIER __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509_ALGORITHM_IDENTIFIER_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + +typedef struct cssm_x509_type_value_pair { + CSSM_OID type; + CSSM_BER_TAG valueType; + + CSSM_DATA value; +} CSSM_X509_TYPE_VALUE_PAIR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509_TYPE_VALUE_PAIR_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_x509_rdn { + uint32 numberOfPairs; + CSSM_X509_TYPE_VALUE_PAIR_PTR AttributeTypeAndValue; +} CSSM_X509_RDN __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509_RDN_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_x509_name { + uint32 numberOfRDNs; + CSSM_X509_RDN_PTR RelativeDistinguishedName; +} CSSM_X509_NAME __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509_NAME_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + +typedef struct cssm_x509_subject_public_key_info { + CSSM_X509_ALGORITHM_IDENTIFIER algorithm; + CSSM_DATA subjectPublicKey; +} CSSM_X509_SUBJECT_PUBLIC_KEY_INFO __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509_SUBJECT_PUBLIC_KEY_INFO_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_x509_time { + CSSM_BER_TAG timeType; + CSSM_DATA time; +} CSSM_X509_TIME __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509_TIME_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + +typedef struct x509_validity { + CSSM_X509_TIME notBefore; + CSSM_X509_TIME notAfter; +} CSSM_X509_VALIDITY __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509_VALIDITY_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + +typedef CSSM_BOOL CSSM_X509_OPTION; + +typedef struct cssm_x509ext_basicConstraints { + CSSM_BOOL cA; + CSSM_X509_OPTION pathLenConstraintPresent; + uint32 pathLenConstraint; +} CSSM_X509EXT_BASICCONSTRAINTS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509EXT_BASICCONSTRAINTS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef enum extension_data_format { + CSSM_X509_DATAFORMAT_ENCODED = 0, + CSSM_X509_DATAFORMAT_PARSED, + CSSM_X509_DATAFORMAT_PAIR +} CSSM_X509EXT_DATA_FORMAT; + +typedef struct cssm_x509_extensionTagAndValue { + CSSM_BER_TAG type; + CSSM_DATA value; +} CSSM_X509EXT_TAGandVALUE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509EXT_TAGandVALUE_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_x509ext_pair { + CSSM_X509EXT_TAGandVALUE tagAndValue; + void *parsedValue; +} CSSM_X509EXT_PAIR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509EXT_PAIR_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + +typedef struct cssm_x509_extension { + CSSM_OID extnId; + CSSM_BOOL critical; + CSSM_X509EXT_DATA_FORMAT format; + union cssm_x509ext_value { + CSSM_X509EXT_TAGandVALUE *tagAndValue; + void *parsedValue; + CSSM_X509EXT_PAIR *valuePair; + } value; + CSSM_DATA BERvalue; +} CSSM_X509_EXTENSION __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509_EXTENSION_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_x509_extensions { + uint32 numberOfExtensions; + CSSM_X509_EXTENSION_PTR extensions; +} CSSM_X509_EXTENSIONS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509_EXTENSIONS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + +typedef struct cssm_x509_tbs_certificate { + CSSM_DATA version; + CSSM_DATA serialNumber; + CSSM_X509_ALGORITHM_IDENTIFIER signature; + CSSM_X509_NAME issuer; + CSSM_X509_VALIDITY validity; + CSSM_X509_NAME subject; + CSSM_X509_SUBJECT_PUBLIC_KEY_INFO subjectPublicKeyInfo; + CSSM_DATA issuerUniqueIdentifier; + CSSM_DATA subjectUniqueIdentifier; + CSSM_X509_EXTENSIONS extensions; +} CSSM_X509_TBS_CERTIFICATE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509_TBS_CERTIFICATE_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + +typedef struct cssm_x509_signature { + CSSM_X509_ALGORITHM_IDENTIFIER algorithmIdentifier; + CSSM_DATA encrypted; +} CSSM_X509_SIGNATURE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509_SIGNATURE_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + +typedef struct cssm_x509_signed_certificate { + CSSM_X509_TBS_CERTIFICATE certificate; + CSSM_X509_SIGNATURE signature; +} CSSM_X509_SIGNED_CERTIFICATE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509_SIGNED_CERTIFICATE_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_x509ext_policyQualifierInfo { + CSSM_OID policyQualifierId; + CSSM_DATA value; +} CSSM_X509EXT_POLICYQUALIFIERINFO __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509EXT_POLICYQUALIFIERINFO_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_x509ext_policyQualifiers { + uint32 numberOfPolicyQualifiers; + CSSM_X509EXT_POLICYQUALIFIERINFO *policyQualifier; +} CSSM_X509EXT_POLICYQUALIFIERS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509EXT_POLICYQUALIFIERS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_x509ext_policyInfo { + CSSM_OID policyIdentifier; + CSSM_X509EXT_POLICYQUALIFIERS policyQualifiers; +} CSSM_X509EXT_POLICYINFO __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509EXT_POLICYINFO_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +typedef struct cssm_x509_revoked_cert_entry { + CSSM_DATA certificateSerialNumber; + CSSM_X509_TIME revocationDate; + CSSM_X509_EXTENSIONS extensions; +} CSSM_X509_REVOKED_CERT_ENTRY __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509_REVOKED_CERT_ENTRY_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_x509_revoked_cert_list { + uint32 numberOfRevokedCertEntries; + CSSM_X509_REVOKED_CERT_ENTRY_PTR revokedCertEntry; +} CSSM_X509_REVOKED_CERT_LIST __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509_REVOKED_CERT_LIST_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + +typedef struct cssm_x509_tbs_certlist { + CSSM_DATA version; + CSSM_X509_ALGORITHM_IDENTIFIER signature; + CSSM_X509_NAME issuer; + CSSM_X509_TIME thisUpdate; + CSSM_X509_TIME nextUpdate; + CSSM_X509_REVOKED_CERT_LIST_PTR revokedCertificates; + CSSM_X509_EXTENSIONS extensions; +} CSSM_X509_TBS_CERTLIST __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509_TBS_CERTLIST_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_x509_signed_crl { + CSSM_X509_TBS_CERTLIST tbsCertList; + CSSM_X509_SIGNATURE signature; +} CSSM_X509_SIGNED_CRL __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_X509_SIGNED_CRL_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef enum __CE_GeneralNameType { + GNT_OtherName = 0, + GNT_RFC822Name, + GNT_DNSName, + GNT_X400Address, + GNT_DirectoryName, + GNT_EdiPartyName, + GNT_URI, + GNT_IPAddress, + GNT_RegisteredID +} CE_GeneralNameType; + +typedef struct __CE_OtherName { + CSSM_OID typeId; + CSSM_DATA value; +} CE_OtherName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct __CE_GeneralName { + CE_GeneralNameType nameType; + CSSM_BOOL berEncoded; + CSSM_DATA name; +} CE_GeneralName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct __CE_GeneralNames { + uint32 numNames; + CE_GeneralName *generalName; +} CE_GeneralNames __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +typedef struct __CE_AuthorityKeyID { + CSSM_BOOL keyIdentifierPresent; + CSSM_DATA keyIdentifier; + CSSM_BOOL generalNamesPresent; + CE_GeneralNames *generalNames; + CSSM_BOOL serialNumberPresent; + CSSM_DATA serialNumber; +} CE_AuthorityKeyID __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + + +typedef CSSM_DATA CE_SubjectKeyID __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +typedef uint16 CE_KeyUsage __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +typedef uint32 CE_CrlReason __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +typedef struct __CE_ExtendedKeyUsage { + uint32 numPurposes; + CSSM_OID_PTR purposes; +} CE_ExtendedKeyUsage; +typedef struct __CE_BasicConstraints { + CSSM_BOOL cA; + CSSM_BOOL pathLenConstraintPresent; + uint32 pathLenConstraint; +} CE_BasicConstraints __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +typedef struct __CE_PolicyQualifierInfo { + CSSM_OID policyQualifierId; + CSSM_DATA qualifier; + +} CE_PolicyQualifierInfo __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct __CE_PolicyInformation { + CSSM_OID certPolicyId; + uint32 numPolicyQualifiers; + CE_PolicyQualifierInfo *policyQualifiers; +} CE_PolicyInformation __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct __CE_CertPolicies { + uint32 numPolicies; + CE_PolicyInformation *policies; +} CE_CertPolicies __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +typedef uint16 CE_NetscapeCertType __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +typedef uint8 CE_CrlDistReasonFlags __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +typedef enum __CE_CrlDistributionPointNameType { + CE_CDNT_FullName, + CE_CDNT_NameRelativeToCrlIssuer +} CE_CrlDistributionPointNameType __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct __CE_DistributionPointName { + CE_CrlDistributionPointNameType nameType; + union { + CE_GeneralNames *fullName; + CSSM_X509_RDN_PTR rdn; + } dpn; +} CE_DistributionPointName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +typedef struct __CE_CRLDistributionPoint { + CE_DistributionPointName *distPointName; + CSSM_BOOL reasonsPresent; + CE_CrlDistReasonFlags reasons; + CE_GeneralNames *crlIssuer; +} CE_CRLDistributionPoint __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct __CE_CRLDistPointsSyntax { + uint32 numDistPoints; + CE_CRLDistributionPoint *distPoints; +} CE_CRLDistPointsSyntax __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +typedef struct __CE_AccessDescription { + CSSM_OID accessMethod; + CE_GeneralName accessLocation; +} CE_AccessDescription __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct __CE_AuthorityInfoAccess { + uint32 numAccessDescriptions; + CE_AccessDescription *accessDescriptions; +} CE_AuthorityInfoAccess __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +typedef CE_GeneralNames CE_NameRegistrationAuthorities __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +typedef struct __CE_SemanticsInformation { + CSSM_OID *semanticsIdentifier; + CE_NameRegistrationAuthorities *nameRegistrationAuthorities; +} CE_SemanticsInformation __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +typedef struct __CE_QC_Statement { + CSSM_OID statementId; + CE_SemanticsInformation *semanticsInfo; + CSSM_DATA *otherInfo; +} CE_QC_Statement __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + +typedef struct __CE_QC_Statements { + uint32 numQCStatements; + CE_QC_Statement *qcStatements; +} CE_QC_Statements __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +typedef uint32 CE_CrlNumber; + + + + + + +typedef uint32 CE_DeltaCrl; +typedef struct __CE_IssuingDistributionPoint { + CE_DistributionPointName *distPointName; + CSSM_BOOL onlyUserCertsPresent; + CSSM_BOOL onlyUserCerts; + CSSM_BOOL onlyCACertsPresent; + CSSM_BOOL onlyCACerts; + CSSM_BOOL onlySomeReasonsPresent; + CE_CrlDistReasonFlags onlySomeReasons; + CSSM_BOOL indirectCrlPresent; + CSSM_BOOL indirectCrl; +} CE_IssuingDistributionPoint __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +typedef struct __CE_GeneralSubtree { + CE_GeneralNames *base; + uint32 minimum; + CSSM_BOOL maximumPresent; + uint32 maximum; +} CE_GeneralSubtree __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct __CE_GeneralSubtrees { + uint32 numSubtrees; + CE_GeneralSubtree *subtrees; +} CE_GeneralSubtrees __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct __CE_NameConstraints { + CE_GeneralSubtrees *permitted; + CE_GeneralSubtrees *excluded; +} CE_NameConstraints __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +typedef struct __CE_PolicyMapping { + CSSM_OID issuerDomainPolicy; + CSSM_OID subjectDomainPolicy; +} CE_PolicyMapping __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct __CE_PolicyMappings { + uint32 numPolicyMappings; + CE_PolicyMapping *policyMappings; +} CE_PolicyMappings __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +typedef struct __CE_PolicyConstraints { + CSSM_BOOL requireExplicitPolicyPresent; + uint32 requireExplicitPolicy; + CSSM_BOOL inhibitPolicyMappingPresent; + uint32 inhibitPolicyMapping; +} CE_PolicyConstraints __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +typedef uint32 CE_InhibitAnyPolicy __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +typedef enum __CE_DataType { + DT_AuthorityKeyID, + DT_SubjectKeyID, + DT_KeyUsage, + DT_SubjectAltName, + DT_IssuerAltName, + DT_ExtendedKeyUsage, + DT_BasicConstraints, + DT_CertPolicies, + DT_NetscapeCertType, + DT_CrlNumber, + DT_DeltaCrl, + DT_CrlReason, + DT_CrlDistributionPoints, + DT_IssuingDistributionPoint, + DT_AuthorityInfoAccess, + DT_Other, + DT_QC_Statements, + DT_NameConstraints, + DT_PolicyMappings, + DT_PolicyConstraints, + DT_InhibitAnyPolicy +} CE_DataType; + + + + +typedef union { + CE_AuthorityKeyID authorityKeyID; + CE_SubjectKeyID subjectKeyID; + CE_KeyUsage keyUsage; + CE_GeneralNames subjectAltName; + CE_GeneralNames issuerAltName; + CE_ExtendedKeyUsage extendedKeyUsage; + CE_BasicConstraints basicConstraints; + CE_CertPolicies certPolicies; + CE_NetscapeCertType netscapeCertType; + CE_CrlNumber crlNumber; + CE_DeltaCrl deltaCrl; + CE_CrlReason crlReason; + CE_CRLDistPointsSyntax crlDistPoints; + CE_IssuingDistributionPoint issuingDistPoint; + CE_AuthorityInfoAccess authorityInfoAccess; + CE_QC_Statements qualifiedCertStatements; + CE_NameConstraints nameConstraints; + CE_PolicyMappings policyMappings; + CE_PolicyConstraints policyConstraints; + CE_InhibitAnyPolicy inhibitAnyPolicy; + CSSM_DATA rawData; +} CE_Data __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct __CE_DataAndType { + CE_DataType type; + CE_Data extension; + CSSM_BOOL critical; +} CE_DataAndType __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + + + + + + + +extern const CSSM_GUID gGuidCssm; + + +extern const CSSM_GUID gGuidAppleFileDL; + + +extern const CSSM_GUID gGuidAppleCSP; + + +extern const CSSM_GUID gGuidAppleCSPDL; + + +extern const CSSM_GUID gGuidAppleX509CL; + + +extern const CSSM_GUID gGuidAppleX509TP; + + +extern const CSSM_GUID gGuidAppleLDAPDL; + + +extern const CSSM_GUID gGuidAppleDotMacTP; + + +extern const CSSM_GUID gGuidAppleSdCSPDL; + + +extern const CSSM_GUID gGuidAppleDotMacDL; + + + +enum +{ + CSSM_WORDID_KEYCHAIN_PROMPT = CSSM_WORDID_VENDOR_START, + CSSM_WORDID_KEYCHAIN_LOCK, + CSSM_WORDID_KEYCHAIN_CHANGE_LOCK, + CSSM_WORDID_PROCESS, + CSSM_WORDID__RESERVED_1, + CSSM_WORDID_SYMMETRIC_KEY, + CSSM_WORDID_SYSTEM, + CSSM_WORDID_KEY, + CSSM_WORDID_PIN, + CSSM_WORDID_PREAUTH, + CSSM_WORDID_PREAUTH_SOURCE, + CSSM_WORDID_ASYMMETRIC_KEY, + CSSM_WORDID_PARTITION, + CSSM_WORDID__FIRST_UNUSED +}; + + +enum +{ + CSSM_ACL_SUBJECT_TYPE_KEYCHAIN_PROMPT = CSSM_WORDID_KEYCHAIN_PROMPT, + CSSM_ACL_SUBJECT_TYPE_PROCESS = CSSM_WORDID_PROCESS, + CSSM_ACL_SUBJECT_TYPE_CODE_SIGNATURE = CSSM_WORDID_SIGNATURE, + CSSM_ACL_SUBJECT_TYPE_COMMENT = CSSM_WORDID_COMMENT, + CSSM_ACL_SUBJECT_TYPE_SYMMETRIC_KEY = CSSM_WORDID_SYMMETRIC_KEY, + CSSM_ACL_SUBJECT_TYPE_PREAUTH = CSSM_WORDID_PREAUTH, + CSSM_ACL_SUBJECT_TYPE_PREAUTH_SOURCE = CSSM_WORDID_PREAUTH_SOURCE, + CSSM_ACL_SUBJECT_TYPE_ASYMMETRIC_KEY = CSSM_WORDID_ASYMMETRIC_KEY, + CSSM_ACL_SUBJECT_TYPE_PARTITION = CSSM_WORDID_PARTITION, +}; + +enum +{ + CSSM_SAMPLE_TYPE_KEYCHAIN_PROMPT = CSSM_WORDID_KEYCHAIN_PROMPT, + CSSM_SAMPLE_TYPE_KEYCHAIN_LOCK = CSSM_WORDID_KEYCHAIN_LOCK, + CSSM_SAMPLE_TYPE_KEYCHAIN_CHANGE_LOCK = CSSM_WORDID_KEYCHAIN_CHANGE_LOCK, + CSSM_SAMPLE_TYPE_PROCESS = CSSM_WORDID_PROCESS, + CSSM_SAMPLE_TYPE_COMMENT = CSSM_WORDID_COMMENT, + CSSM_SAMPLE_TYPE_RETRY_ID = CSSM_WORDID_PROPAGATE, + CSSM_SAMPLE_TYPE_SYMMETRIC_KEY = CSSM_WORDID_SYMMETRIC_KEY, + CSSM_SAMPLE_TYPE_PREAUTH = CSSM_WORDID_PREAUTH, + CSSM_SAMPLE_TYPE_ASYMMETRIC_KEY = CSSM_WORDID_ASYMMETRIC_KEY + +}; + + + +enum { + CSSM_ACL_AUTHORIZATION_CHANGE_ACL = CSSM_ACL_AUTHORIZATION_TAG_VENDOR_DEFINED_START, + CSSM_ACL_AUTHORIZATION_CHANGE_OWNER, + CSSM_ACL_AUTHORIZATION_PARTITION_ID, + CSSM_ACL_AUTHORIZATION_INTEGRITY, + + + CSSM_ACL_AUTHORIZATION_PREAUTH_BASE = + CSSM_ACL_AUTHORIZATION_TAG_VENDOR_DEFINED_START + 0x1000000, + CSSM_ACL_AUTHORIZATION_PREAUTH_END = CSSM_ACL_AUTHORIZATION_PREAUTH_BASE + 0x10000 +}; +enum { + CSSM_ACL_CODE_SIGNATURE_INVALID = 0, + CSSM_ACL_CODE_SIGNATURE_OSX = 1 +}; + + + +enum { + CSSM_ACL_MATCH_UID = 0x01, + CSSM_ACL_MATCH_GID = 0x02, + CSSM_ACL_MATCH_HONOR_ROOT = 0x100, + CSSM_ACL_MATCH_BITS = CSSM_ACL_MATCH_UID | CSSM_ACL_MATCH_GID +}; + +enum { + CSSM_ACL_PROCESS_SELECTOR_CURRENT_VERSION = 0x101 +}; + +typedef struct cssm_acl_process_subject_selector { + uint16 version; + uint16 mask; + uint32 uid; + uint32 gid; +} CSSM_ACL_PROCESS_SUBJECT_SELECTOR; + + + +enum { + CSSM_ACL_KEYCHAIN_PROMPT_CURRENT_VERSION = 0x101 +}; + +enum { + CSSM_ACL_KEYCHAIN_PROMPT_REQUIRE_PASSPHRASE = 0x0001, + + CSSM_ACL_KEYCHAIN_PROMPT_UNSIGNED = 0x0010, + CSSM_ACL_KEYCHAIN_PROMPT_UNSIGNED_ACT = 0x0020, + CSSM_ACL_KEYCHAIN_PROMPT_INVALID = 0x0040, + CSSM_ACL_KEYCHAIN_PROMPT_INVALID_ACT = 0x0080, +}; + +typedef struct cssm_acl_keychain_prompt_selector { + uint16 version; + uint16 flags; +} CSSM_ACL_KEYCHAIN_PROMPT_SELECTOR; + + +typedef uint32 CSSM_ACL_PREAUTH_TRACKING_STATE; +enum { + CSSM_ACL_PREAUTH_TRACKING_COUNT_MASK = 0xff, + CSSM_ACL_PREAUTH_TRACKING_BLOCKED = 0, + + + + CSSM_ACL_PREAUTH_TRACKING_UNKNOWN = 0x40000000, + CSSM_ACL_PREAUTH_TRACKING_AUTHORIZED = 0x80000000 +}; + + + +enum { + CSSM_DB_ACCESS_RESET = 0x10000 +}; + + + +enum +{ + CSSM_ALGID_APPLE_YARROW = CSSM_ALGID_VENDOR_DEFINED, + CSSM_ALGID_AES, + CSSM_ALGID_FEE, + CSSM_ALGID_FEE_MD5, + CSSM_ALGID_FEE_SHA1, + CSSM_ALGID_FEED, + CSSM_ALGID_FEEDEXP, + CSSM_ALGID_ASC, + CSSM_ALGID_SHA1HMAC_LEGACY, + CSSM_ALGID_KEYCHAIN_KEY, + CSSM_ALGID_PKCS12_PBE_ENCR, + CSSM_ALGID_PKCS12_PBE_MAC, + CSSM_ALGID_SECURE_PASSPHRASE, + CSSM_ALGID_PBE_OPENSSL_MD5, + CSSM_ALGID_SHA256, + CSSM_ALGID_SHA384, + CSSM_ALGID_SHA512, + CSSM_ALGID_ENTROPY_DEFAULT, + CSSM_ALGID_SHA224, + CSSM_ALGID_SHA224WithRSA, + CSSM_ALGID_SHA256WithRSA, + CSSM_ALGID_SHA384WithRSA, + CSSM_ALGID_SHA512WithRSA, + CSSM_ALGID_OPENSSH1, + CSSM_ALGID_SHA224WithECDSA, + CSSM_ALGID_SHA256WithECDSA, + CSSM_ALGID_SHA384WithECDSA, + CSSM_ALGID_SHA512WithECDSA, + CSSM_ALGID_ECDSA_SPECIFIED, + CSSM_ALGID_ECDH_X963_KDF, + CSSM_ALGID__FIRST_UNUSED +}; + + +enum +{ + + CSSM_PADDING_APPLE_SSLv2 = CSSM_PADDING_VENDOR_DEFINED +}; + + + +enum { + CSSM_KEYBLOB_RAW_FORMAT_VENDOR_DEFINED = 0x80000000 +}; +enum { + + CSSM_KEYBLOB_RAW_FORMAT_X509 = CSSM_KEYBLOB_RAW_FORMAT_VENDOR_DEFINED, + + CSSM_KEYBLOB_RAW_FORMAT_OPENSSH, + + CSSM_KEYBLOB_RAW_FORMAT_OPENSSL, + + CSSM_KEYBLOB_RAW_FORMAT_OPENSSH2 +}; + + +enum +{ + CSSM_CUSTOM_COMMON_ERROR_EXTENT = 0x00e0, + + CSSM_ERRCODE_NO_USER_INTERACTION = 0x00e0, + CSSM_ERRCODE_USER_CANCELED = 0x00e1, + CSSM_ERRCODE_SERVICE_NOT_AVAILABLE = 0x00e2, + CSSM_ERRCODE_INSUFFICIENT_CLIENT_IDENTIFICATION = 0x00e3, + CSSM_ERRCODE_DEVICE_RESET = 0x00e4, + CSSM_ERRCODE_DEVICE_FAILED = 0x00e5, + CSSM_ERRCODE_IN_DARK_WAKE = 0x00e6 +}; + +enum { + CSSMERR_CSSM_NO_USER_INTERACTION = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_NO_USER_INTERACTION, + CSSMERR_AC_NO_USER_INTERACTION = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_NO_USER_INTERACTION, + CSSMERR_CSP_NO_USER_INTERACTION = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_NO_USER_INTERACTION, + CSSMERR_CL_NO_USER_INTERACTION = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_NO_USER_INTERACTION, + CSSMERR_DL_NO_USER_INTERACTION = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_NO_USER_INTERACTION, + CSSMERR_TP_NO_USER_INTERACTION = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_NO_USER_INTERACTION, + + CSSMERR_CSSM_USER_CANCELED = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_USER_CANCELED, + CSSMERR_AC_USER_CANCELED = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_USER_CANCELED, + CSSMERR_CSP_USER_CANCELED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_USER_CANCELED, + CSSMERR_CL_USER_CANCELED = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_USER_CANCELED, + CSSMERR_DL_USER_CANCELED = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_USER_CANCELED, + CSSMERR_TP_USER_CANCELED = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_USER_CANCELED, + + CSSMERR_CSSM_SERVICE_NOT_AVAILABLE = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_SERVICE_NOT_AVAILABLE, + CSSMERR_AC_SERVICE_NOT_AVAILABLE = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_SERVICE_NOT_AVAILABLE, + CSSMERR_CSP_SERVICE_NOT_AVAILABLE = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_SERVICE_NOT_AVAILABLE, + CSSMERR_CL_SERVICE_NOT_AVAILABLE = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_SERVICE_NOT_AVAILABLE, + CSSMERR_DL_SERVICE_NOT_AVAILABLE = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_SERVICE_NOT_AVAILABLE, + CSSMERR_TP_SERVICE_NOT_AVAILABLE = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_SERVICE_NOT_AVAILABLE, + + CSSMERR_CSSM_INSUFFICIENT_CLIENT_IDENTIFICATION = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_INSUFFICIENT_CLIENT_IDENTIFICATION, + CSSMERR_AC_INSUFFICIENT_CLIENT_IDENTIFICATION = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_INSUFFICIENT_CLIENT_IDENTIFICATION, + CSSMERR_CSP_INSUFFICIENT_CLIENT_IDENTIFICATION = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_INSUFFICIENT_CLIENT_IDENTIFICATION, + CSSMERR_CL_INSUFFICIENT_CLIENT_IDENTIFICATION = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_INSUFFICIENT_CLIENT_IDENTIFICATION, + CSSMERR_DL_INSUFFICIENT_CLIENT_IDENTIFICATION = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_INSUFFICIENT_CLIENT_IDENTIFICATION, + CSSMERR_TP_INSUFFICIENT_CLIENT_IDENTIFICATION = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_INSUFFICIENT_CLIENT_IDENTIFICATION, + + CSSMERR_CSSM_DEVICE_RESET = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_DEVICE_RESET, + CSSMERR_AC_DEVICE_RESET = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_DEVICE_RESET, + CSSMERR_CSP_DEVICE_RESET = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_DEVICE_RESET, + CSSMERR_CL_DEVICE_RESET = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_DEVICE_RESET, + CSSMERR_DL_DEVICE_RESET = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_DEVICE_RESET, + CSSMERR_TP_DEVICE_RESET = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_DEVICE_RESET, + + CSSMERR_CSSM_DEVICE_FAILED = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_DEVICE_FAILED, + CSSMERR_AC_DEVICE_FAILED = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_DEVICE_FAILED, + CSSMERR_CSP_DEVICE_FAILED = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_DEVICE_FAILED, + CSSMERR_CL_DEVICE_FAILED = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_DEVICE_FAILED, + CSSMERR_DL_DEVICE_FAILED = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_DEVICE_FAILED, + CSSMERR_TP_DEVICE_FAILED = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_DEVICE_FAILED, + + CSSMERR_CSSM_IN_DARK_WAKE = CSSM_CSSM_BASE_ERROR + CSSM_ERRCODE_IN_DARK_WAKE, + CSSMERR_AC_IN_DARK_WAKE = CSSM_AC_BASE_ERROR + CSSM_ERRCODE_IN_DARK_WAKE, + CSSMERR_CSP_IN_DARK_WAKE = CSSM_CSP_BASE_ERROR + CSSM_ERRCODE_IN_DARK_WAKE, + CSSMERR_CL_IN_DARK_WAKE = CSSM_CL_BASE_ERROR + CSSM_ERRCODE_IN_DARK_WAKE, + CSSMERR_DL_IN_DARK_WAKE = CSSM_DL_BASE_ERROR + CSSM_ERRCODE_IN_DARK_WAKE, + CSSMERR_TP_IN_DARK_WAKE = CSSM_TP_BASE_ERROR + CSSM_ERRCODE_IN_DARK_WAKE +}; + + +enum { + CSSMERR_CSP_APPLE_ADD_APPLICATION_ACL_SUBJECT = CSSM_CSP_PRIVATE_ERROR + 0, + + + + + CSSMERR_CSP_APPLE_PUBLIC_KEY_INCOMPLETE = CSSM_CSP_PRIVATE_ERROR + 1, + + + CSSMERR_CSP_APPLE_SIGNATURE_MISMATCH = CSSM_CSP_PRIVATE_ERROR + 2, + + + CSSMERR_CSP_APPLE_INVALID_KEY_START_DATE = CSSM_CSP_PRIVATE_ERROR + 3, + CSSMERR_CSP_APPLE_INVALID_KEY_END_DATE = CSSM_CSP_PRIVATE_ERROR + 4, + + + CSSMERR_CSPDL_APPLE_DL_CONVERSION_ERROR = CSSM_CSP_PRIVATE_ERROR + 5, + + + CSSMERR_CSP_APPLE_SSLv2_ROLLBACK = CSSM_CSP_PRIVATE_ERROR + 6 +}; + + + +enum +{ + CSSM_DL_DB_RECORD_GENERIC_PASSWORD = CSSM_DB_RECORDTYPE_APP_DEFINED_START + 0, + CSSM_DL_DB_RECORD_INTERNET_PASSWORD = CSSM_DB_RECORDTYPE_APP_DEFINED_START + 1, + CSSM_DL_DB_RECORD_APPLESHARE_PASSWORD = CSSM_DB_RECORDTYPE_APP_DEFINED_START + 2, + + CSSM_DL_DB_RECORD_X509_CERTIFICATE = CSSM_DB_RECORDTYPE_APP_DEFINED_START + 0x1000, + CSSM_DL_DB_RECORD_USER_TRUST, + CSSM_DL_DB_RECORD_X509_CRL, + CSSM_DL_DB_RECORD_UNLOCK_REFERRAL, + CSSM_DL_DB_RECORD_EXTENDED_ATTRIBUTE, + CSSM_DL_DB_RECORD_METADATA = CSSM_DB_RECORDTYPE_APP_DEFINED_START + 0x8000 +}; + + +enum { + + + + CSSM_APPLEFILEDL_TOGGLE_AUTOCOMMIT, + + + CSSM_APPLEFILEDL_COMMIT, + + + CSSM_APPLEFILEDL_ROLLBACK, + + + + CSSM_APPLEFILEDL_TAKE_FILE_LOCK, + + + CSSM_APPLEFILEDL_MAKE_BACKUP, + + + CSSM_APPLEFILEDL_MAKE_COPY, + + + CSSM_APPLEFILEDL_DELETE_FILE, +}; + + +enum { + CSSM_APPLE_UNLOCK_TYPE_KEY_DIRECT = 1, + CSSM_APPLE_UNLOCK_TYPE_WRAPPED_PRIVATE = 2 +}; + + +enum +{ + + + + CSSMERR_APPLEDL_INVALID_OPEN_PARAMETERS = CSSM_DL_PRIVATE_ERROR + 0, + + + CSSMERR_APPLEDL_DISK_FULL = CSSM_DL_PRIVATE_ERROR + 1, + + + CSSMERR_APPLEDL_QUOTA_EXCEEDED = CSSM_DL_PRIVATE_ERROR + 2, + + + CSSMERR_APPLEDL_FILE_TOO_BIG = CSSM_DL_PRIVATE_ERROR + 3, + + + CSSMERR_APPLEDL_INVALID_DATABASE_BLOB = CSSM_DL_PRIVATE_ERROR + 4, + CSSMERR_APPLEDL_INVALID_KEY_BLOB = CSSM_DL_PRIVATE_ERROR + 5, + + + CSSMERR_APPLEDL_INCOMPATIBLE_DATABASE_BLOB = CSSM_DL_PRIVATE_ERROR + 6, + CSSMERR_APPLEDL_INCOMPATIBLE_KEY_BLOB = CSSM_DL_PRIVATE_ERROR + 7, +}; + + +enum +{ + + CSSMERR_APPLETP_HOSTNAME_MISMATCH = CSSM_TP_PRIVATE_ERROR + 0, + + CSSMERR_APPLETP_UNKNOWN_CRITICAL_EXTEN = CSSM_TP_PRIVATE_ERROR + 1, + + CSSMERR_APPLETP_NO_BASIC_CONSTRAINTS = CSSM_TP_PRIVATE_ERROR + 2, + + CSSMERR_APPLETP_INVALID_CA = CSSM_TP_PRIVATE_ERROR + 3, + + CSSMERR_APPLETP_INVALID_AUTHORITY_ID = CSSM_TP_PRIVATE_ERROR + 4, + + CSSMERR_APPLETP_INVALID_SUBJECT_ID = CSSM_TP_PRIVATE_ERROR + 5, + + CSSMERR_APPLETP_INVALID_KEY_USAGE = CSSM_TP_PRIVATE_ERROR + 6, + + CSSMERR_APPLETP_INVALID_EXTENDED_KEY_USAGE = CSSM_TP_PRIVATE_ERROR + 7, + + CSSMERR_APPLETP_INVALID_ID_LINKAGE = CSSM_TP_PRIVATE_ERROR + 8, + + CSSMERR_APPLETP_PATH_LEN_CONSTRAINT = CSSM_TP_PRIVATE_ERROR + 9, + + CSSMERR_APPLETP_INVALID_ROOT = CSSM_TP_PRIVATE_ERROR + 10, + + CSSMERR_APPLETP_CRL_EXPIRED = CSSM_TP_PRIVATE_ERROR + 11, + CSSMERR_APPLETP_CRL_NOT_VALID_YET = CSSM_TP_PRIVATE_ERROR + 12, + + CSSMERR_APPLETP_CRL_NOT_FOUND = CSSM_TP_PRIVATE_ERROR + 13, + + CSSMERR_APPLETP_CRL_SERVER_DOWN = CSSM_TP_PRIVATE_ERROR + 14, + + CSSMERR_APPLETP_CRL_BAD_URI = CSSM_TP_PRIVATE_ERROR + 15, + + CSSMERR_APPLETP_UNKNOWN_CERT_EXTEN = CSSM_TP_PRIVATE_ERROR + 16, + CSSMERR_APPLETP_UNKNOWN_CRL_EXTEN = CSSM_TP_PRIVATE_ERROR + 17, + + CSSMERR_APPLETP_CRL_NOT_TRUSTED = CSSM_TP_PRIVATE_ERROR + 18, + + CSSMERR_APPLETP_CRL_INVALID_ANCHOR_CERT = CSSM_TP_PRIVATE_ERROR + 19, + + CSSMERR_APPLETP_CRL_POLICY_FAIL = CSSM_TP_PRIVATE_ERROR + 20, + + CSSMERR_APPLETP_IDP_FAIL = CSSM_TP_PRIVATE_ERROR + 21, + + CSSMERR_APPLETP_CERT_NOT_FOUND_FROM_ISSUER = CSSM_TP_PRIVATE_ERROR + 22, + + CSSMERR_APPLETP_BAD_CERT_FROM_ISSUER = CSSM_TP_PRIVATE_ERROR + 23, + + CSSMERR_APPLETP_SMIME_EMAIL_ADDRS_NOT_FOUND = CSSM_TP_PRIVATE_ERROR + 24, + + CSSMERR_APPLETP_SMIME_BAD_EXT_KEY_USE = CSSM_TP_PRIVATE_ERROR + 25, + + CSSMERR_APPLETP_SMIME_BAD_KEY_USE = CSSM_TP_PRIVATE_ERROR + 26, + + CSSMERR_APPLETP_SMIME_KEYUSAGE_NOT_CRITICAL = CSSM_TP_PRIVATE_ERROR + 27, + + + CSSMERR_APPLETP_SMIME_NO_EMAIL_ADDRS = CSSM_TP_PRIVATE_ERROR + 28, + + + CSSMERR_APPLETP_SMIME_SUBJ_ALT_NAME_NOT_CRIT = CSSM_TP_PRIVATE_ERROR + 29, + + CSSMERR_APPLETP_SSL_BAD_EXT_KEY_USE = CSSM_TP_PRIVATE_ERROR + 30, + + CSSMERR_APPLETP_OCSP_BAD_RESPONSE = CSSM_TP_PRIVATE_ERROR + 31, + + CSSMERR_APPLETP_OCSP_BAD_REQUEST = CSSM_TP_PRIVATE_ERROR + 32, + + CSSMERR_APPLETP_OCSP_UNAVAILABLE = CSSM_TP_PRIVATE_ERROR + 33, + + CSSMERR_APPLETP_OCSP_STATUS_UNRECOGNIZED = CSSM_TP_PRIVATE_ERROR + 34, + + CSSMERR_APPLETP_INCOMPLETE_REVOCATION_CHECK = CSSM_TP_PRIVATE_ERROR + 35, + + CSSMERR_APPLETP_NETWORK_FAILURE = CSSM_TP_PRIVATE_ERROR + 36, + + CSSMERR_APPLETP_OCSP_NOT_TRUSTED = CSSM_TP_PRIVATE_ERROR + 37, + + CSSMERR_APPLETP_OCSP_INVALID_ANCHOR_CERT = CSSM_TP_PRIVATE_ERROR + 38, + + CSSMERR_APPLETP_OCSP_SIG_ERROR = CSSM_TP_PRIVATE_ERROR + 39, + + CSSMERR_APPLETP_OCSP_NO_SIGNER = CSSM_TP_PRIVATE_ERROR + 40, + + CSSMERR_APPLETP_OCSP_RESP_MALFORMED_REQ = CSSM_TP_PRIVATE_ERROR + 41, + + CSSMERR_APPLETP_OCSP_RESP_INTERNAL_ERR = CSSM_TP_PRIVATE_ERROR + 42, + + CSSMERR_APPLETP_OCSP_RESP_TRY_LATER = CSSM_TP_PRIVATE_ERROR + 43, + + CSSMERR_APPLETP_OCSP_RESP_SIG_REQUIRED = CSSM_TP_PRIVATE_ERROR + 44, + + CSSMERR_APPLETP_OCSP_RESP_UNAUTHORIZED = CSSM_TP_PRIVATE_ERROR + 45, + + CSSMERR_APPLETP_OCSP_NONCE_MISMATCH = CSSM_TP_PRIVATE_ERROR + 46, + + CSSMERR_APPLETP_CS_BAD_CERT_CHAIN_LENGTH = CSSM_TP_PRIVATE_ERROR + 47, + + CSSMERR_APPLETP_CS_NO_BASIC_CONSTRAINTS = CSSM_TP_PRIVATE_ERROR + 48, + + CSSMERR_APPLETP_CS_BAD_PATH_LENGTH = CSSM_TP_PRIVATE_ERROR + 49, + + CSSMERR_APPLETP_CS_NO_EXTENDED_KEY_USAGE = CSSM_TP_PRIVATE_ERROR + 50, + + CSSMERR_APPLETP_CODE_SIGN_DEVELOPMENT = CSSM_TP_PRIVATE_ERROR + 51, + + CSSMERR_APPLETP_RS_BAD_CERT_CHAIN_LENGTH = CSSM_TP_PRIVATE_ERROR + 52, + + CSSMERR_APPLETP_RS_BAD_EXTENDED_KEY_USAGE = CSSM_TP_PRIVATE_ERROR + 53, + + CSSMERR_APPLETP_TRUST_SETTING_DENY = CSSM_TP_PRIVATE_ERROR + 54, + + CSSMERR_APPLETP_INVALID_EMPTY_SUBJECT = CSSM_TP_PRIVATE_ERROR + 55, + + CSSMERR_APPLETP_UNKNOWN_QUAL_CERT_STATEMENT = CSSM_TP_PRIVATE_ERROR + 56, + + CSSMERR_APPLETP_MISSING_REQUIRED_EXTENSION = CSSM_TP_PRIVATE_ERROR + 57, + + CSSMERR_APPLETP_EXT_KEYUSAGE_NOT_CRITICAL = CSSM_TP_PRIVATE_ERROR + 58, + + CSSMERR_APPLETP_IDENTIFIER_MISSING = CSSM_TP_PRIVATE_ERROR + 59, + + CSSMERR_APPLETP_CA_PIN_MISMATCH = CSSM_TP_PRIVATE_ERROR + 60 +}; + + +enum +{ + + CSSMERR_APPLE_DOTMAC_REQ_QUEUED = CSSM_TP_PRIVATE_ERROR + 100, + + CSSMERR_APPLE_DOTMAC_REQ_REDIRECT = CSSM_TP_PRIVATE_ERROR + 101, + + CSSMERR_APPLE_DOTMAC_REQ_SERVER_ERR = CSSM_TP_PRIVATE_ERROR + 102, + + CSSMERR_APPLE_DOTMAC_REQ_SERVER_PARAM = CSSM_TP_PRIVATE_ERROR + 103, + + CSSMERR_APPLE_DOTMAC_REQ_SERVER_AUTH = CSSM_TP_PRIVATE_ERROR + 104, + + CSSMERR_APPLE_DOTMAC_REQ_SERVER_UNIMPL = CSSM_TP_PRIVATE_ERROR + 105, + + CSSMERR_APPLE_DOTMAC_REQ_SERVER_NOT_AVAIL = CSSM_TP_PRIVATE_ERROR + 106, + + CSSMERR_APPLE_DOTMAC_REQ_SERVER_ALREADY_EXIST = CSSM_TP_PRIVATE_ERROR + 107, + + CSSMERR_APPLE_DOTMAC_REQ_SERVER_SERVICE_ERROR = CSSM_TP_PRIVATE_ERROR + 108, + + CSSMERR_APPLE_DOTMAC_REQ_IS_PENDING = CSSM_TP_PRIVATE_ERROR + 109, + + CSSMERR_APPLE_DOTMAC_NO_REQ_PENDING = CSSM_TP_PRIVATE_ERROR + 110, + + CSSMERR_APPLE_DOTMAC_CSR_VERIFY_FAIL = CSSM_TP_PRIVATE_ERROR + 111, + + CSSMERR_APPLE_DOTMAC_FAILED_CONSISTENCY_CHECK = CSSM_TP_PRIVATE_ERROR + 112 +}; + +enum +{ + CSSM_APPLEDL_OPEN_PARAMETERS_VERSION = 1 +}; + +enum cssm_appledl_open_parameters_mask +{ + kCSSM_APPLEDL_MASK_MODE = (1 << 0) +}; + + + + + +typedef struct cssm_appledl_open_parameters +{ + uint32 length; + uint32 version; + CSSM_BOOL autoCommit; + + + uint32 mask; + + + mode_t mode; +} CSSM_APPLEDL_OPEN_PARAMETERS, *CSSM_APPLEDL_OPEN_PARAMETERS_PTR; + + + +enum +{ + + + CSSM_APPLECSPDL_DB_LOCK = 0, + + + + + + + + CSSM_APPLECSPDL_DB_UNLOCK = 1, + CSSM_APPLECSPDL_DB_GET_SETTINGS = 2, + + + + + + + + CSSM_APPLECSPDL_DB_SET_SETTINGS = 3, + CSSM_APPLECSPDL_DB_IS_LOCKED = 4, + CSSM_APPLECSPDL_DB_CHANGE_PASSWORD =5, + + + CSSM_APPLECSPDL_DB_GET_HANDLE = 6, + + + CSSM_APPLESCPDL_CSP_GET_KEYHANDLE = 7, + + CSSM_APPLE_PRIVATE_CSPDL_CODE_8 = 8, + CSSM_APPLE_PRIVATE_CSPDL_CODE_9 = 9, + CSSM_APPLE_PRIVATE_CSPDL_CODE_10 = 10, + CSSM_APPLE_PRIVATE_CSPDL_CODE_11 = 11, + CSSM_APPLE_PRIVATE_CSPDL_CODE_12 = 12, + CSSM_APPLE_PRIVATE_CSPDL_CODE_13 = 13, + CSSM_APPLE_PRIVATE_CSPDL_CODE_14 = 14, + CSSM_APPLE_PRIVATE_CSPDL_CODE_15 = 15, + CSSM_APPLE_PRIVATE_CSPDL_CODE_16 = 16, + CSSM_APPLE_PRIVATE_CSPDL_CODE_17 = 17, + CSSM_APPLE_PRIVATE_CSPDL_CODE_18 = 18, + CSSM_APPLE_PRIVATE_CSPDL_CODE_19 = 19, + CSSM_APPLE_PRIVATE_CSPDL_CODE_20 = 20, + CSSM_APPLE_PRIVATE_CSPDL_CODE_21 = 21, + CSSM_APPLE_PRIVATE_CSPDL_CODE_22 = 22, + CSSM_APPLE_PRIVATE_CSPDL_CODE_23 = 23, + CSSM_APPLE_PRIVATE_CSPDL_CODE_24 = 24, + CSSM_APPLE_PRIVATE_CSPDL_CODE_25 = 25, + CSSM_APPLE_PRIVATE_CSPDL_CODE_26 = 26, + CSSM_APPLE_PRIVATE_CSPDL_CODE_27 = 27, + + + + + + + CSSM_APPLECSP_KEYDIGEST = 0x100 +}; + + + + +typedef struct cssm_applecspdl_db_settings_parameters +{ + uint32 idleTimeout; + uint8 lockOnSleep; +} CSSM_APPLECSPDL_DB_SETTINGS_PARAMETERS, *CSSM_APPLECSPDL_DB_SETTINGS_PARAMETERS_PTR; + + +typedef struct cssm_applecspdl_db_is_locked_parameters +{ + uint8 isLocked; +} CSSM_APPLECSPDL_DB_IS_LOCKED_PARAMETERS, *CSSM_APPLECSPDL_DB_IS_LOCKED_PARAMETERS_PTR; + + +typedef struct cssm_applecspdl_db_change_password_parameters +{ + CSSM_ACCESS_CREDENTIALS *accessCredentials; +} CSSM_APPLECSPDL_DB_CHANGE_PASSWORD_PARAMETERS, *CSSM_APPLECSPDL_DB_CHANGE_PASSWORD_PARAMETERS_PTR; + + +enum { + CSSM_KEYBLOB_WRAPPED_FORMAT_APPLE_CUSTOM = 100, + CSSM_KEYBLOB_WRAPPED_FORMAT_OPENSSL, + CSSM_KEYBLOB_WRAPPED_FORMAT_OPENSSH1 +}; + + + + +enum { + CSSM_ATTRIBUTE_VENDOR_DEFINED = 0x800000 +}; + +enum { + + + + CSSM_ATTRIBUTE_PUBLIC_KEY = + (CSSM_ATTRIBUTE_DATA_KEY | (CSSM_ATTRIBUTE_VENDOR_DEFINED + 0)), + + + + + + CSSM_ATTRIBUTE_FEE_PRIME_TYPE = + (CSSM_ATTRIBUTE_DATA_UINT32 | (CSSM_ATTRIBUTE_VENDOR_DEFINED + 1)), + CSSM_ATTRIBUTE_FEE_CURVE_TYPE = + (CSSM_ATTRIBUTE_DATA_UINT32 | (CSSM_ATTRIBUTE_VENDOR_DEFINED + 2)), + + + + + + CSSM_ATTRIBUTE_ASC_OPTIMIZATION = + (CSSM_ATTRIBUTE_DATA_UINT32 | (CSSM_ATTRIBUTE_VENDOR_DEFINED + 3)), + + + + + CSSM_ATTRIBUTE_RSA_BLINDING = + (CSSM_ATTRIBUTE_DATA_UINT32 | (CSSM_ATTRIBUTE_VENDOR_DEFINED + 4)), + + + + + + CSSM_ATTRIBUTE_PARAM_KEY = + (CSSM_ATTRIBUTE_DATA_KEY | (CSSM_ATTRIBUTE_VENDOR_DEFINED + 5)), + + + + + + CSSM_ATTRIBUTE_PROMPT = + (CSSM_ATTRIBUTE_DATA_CSSM_DATA | (CSSM_ATTRIBUTE_VENDOR_DEFINED + 6)), + + + + + + CSSM_ATTRIBUTE_ALERT_TITLE = + (CSSM_ATTRIBUTE_DATA_CSSM_DATA | (CSSM_ATTRIBUTE_VENDOR_DEFINED + 7)), + + + + + + + CSSM_ATTRIBUTE_VERIFY_PASSPHRASE = + (CSSM_ATTRIBUTE_DATA_UINT32 | (CSSM_ATTRIBUTE_VENDOR_DEFINED + 8)) + +}; + + + + +enum { + CSSM_FEE_PRIME_TYPE_DEFAULT = 0, + CSSM_FEE_PRIME_TYPE_MERSENNE, + CSSM_FEE_PRIME_TYPE_FEE, + CSSM_FEE_PRIME_TYPE_GENERAL +}; + + + + + + +enum { + CSSM_FEE_CURVE_TYPE_DEFAULT = 0, + CSSM_FEE_CURVE_TYPE_MONTGOMERY, + CSSM_FEE_CURVE_TYPE_WEIERSTRASS, + CSSM_FEE_CURVE_TYPE_ANSI_X9_62 +}; + + + + +enum { + CSSM_ASC_OPTIMIZE_DEFAULT = 0, + CSSM_ASC_OPTIMIZE_SIZE, + CSSM_ASC_OPTIMIZE_SECURITY, + CSSM_ASC_OPTIMIZE_TIME, + CSSM_ASC_OPTIMIZE_TIME_SIZE, + CSSM_ASC_OPTIMIZE_ASCII, +}; + + + + +enum { + + + + + CSSM_KEYATTR_PARTIAL = 0x00010000, + + + + + + CSSM_KEYATTR_PUBLIC_KEY_ENCRYPT = 0x00020000 +}; + + + + +typedef struct { + const char *string; + const CSSM_OID *oid; +} CSSM_APPLE_TP_NAME_OID; + + + + + + + +typedef struct { + CSSM_CSP_HANDLE cspHand; + CSSM_CL_HANDLE clHand; + uint32 serialNumber; + uint32 numSubjectNames; + CSSM_APPLE_TP_NAME_OID *subjectNames; + + + + + + + + uint32 numIssuerNames; + CSSM_APPLE_TP_NAME_OID *issuerNames; + + CSSM_X509_NAME_PTR issuerNameX509; + const CSSM_KEY *certPublicKey; + const CSSM_KEY *issuerPrivateKey; + + + + CSSM_ALGORITHMS signatureAlg; + CSSM_OID signatureOid; + uint32 notBefore; + uint32 notAfter; + uint32 numExtensions; + CE_DataAndType *extensions; + + + + + const char *challengeString; +} CSSM_APPLE_TP_CERT_REQUEST; +typedef struct { + uint32 Version; + + + + + + + + uint32 ServerNameLen; + const char *ServerName; + + + uint32 Flags; +} CSSM_APPLE_TP_SSL_OPTIONS; +typedef uint32 CSSM_APPLE_TP_CRL_OPT_FLAGS; +enum { + + CSSM_TP_ACTION_REQUIRE_CRL_PER_CERT = 0x00000001, + + CSSM_TP_ACTION_FETCH_CRL_FROM_NET = 0x00000002, + + + CSSM_TP_ACTION_CRL_SUFFICIENT = 0x00000004, + + CSSM_TP_ACTION_REQUIRE_CRL_IF_PRESENT = 0x00000008 +}; + +typedef struct { + uint32 Version; + CSSM_APPLE_TP_CRL_OPT_FLAGS CrlFlags; + + + + + + + + CSSM_DL_DB_HANDLE_PTR crlStore; +} CSSM_APPLE_TP_CRL_OPTIONS; +typedef struct { + uint32 Version; + + + + + + CE_KeyUsage IntendedUsage; + uint32 SenderEmailLen; + const char *SenderEmail; +} CSSM_APPLE_TP_SMIME_OPTIONS; + + + + + + + +typedef uint32 CSSM_APPLE_TP_ACTION_FLAGS; +enum { + CSSM_TP_ACTION_ALLOW_EXPIRED = 0x00000001, + CSSM_TP_ACTION_LEAF_IS_CA = 0x00000002, + CSSM_TP_ACTION_FETCH_CERT_FROM_NET = 0x00000004, + CSSM_TP_ACTION_ALLOW_EXPIRED_ROOT = 0x00000008, + CSSM_TP_ACTION_REQUIRE_REV_PER_CERT = 0x00000010, + + CSSM_TP_ACTION_TRUST_SETTINGS = 0x00000020, + + CSSM_TP_ACTION_IMPLICIT_ANCHORS = 0x00000040 + +}; + + +typedef struct { + uint32 Version; + CSSM_APPLE_TP_ACTION_FLAGS ActionFlags; +} CSSM_APPLE_TP_ACTION_DATA; +typedef uint32 CSSM_TP_APPLE_CERT_STATUS; +enum +{ + CSSM_CERT_STATUS_EXPIRED = 0x00000001, + CSSM_CERT_STATUS_NOT_VALID_YET = 0x00000002, + CSSM_CERT_STATUS_IS_IN_INPUT_CERTS = 0x00000004, + CSSM_CERT_STATUS_IS_IN_ANCHORS = 0x00000008, + CSSM_CERT_STATUS_IS_ROOT = 0x00000010, + CSSM_CERT_STATUS_IS_FROM_NET = 0x00000020, + + CSSM_CERT_STATUS_TRUST_SETTINGS_FOUND_USER = 0x00000040, + + CSSM_CERT_STATUS_TRUST_SETTINGS_FOUND_ADMIN = 0x00000080, + + CSSM_CERT_STATUS_TRUST_SETTINGS_FOUND_SYSTEM = 0x00000100, + + CSSM_CERT_STATUS_TRUST_SETTINGS_TRUST = 0x00000200, + + CSSM_CERT_STATUS_TRUST_SETTINGS_DENY = 0x00000400, + + CSSM_CERT_STATUS_TRUST_SETTINGS_IGNORED_ERROR = 0x00000800 +}; + +typedef struct { + CSSM_TP_APPLE_CERT_STATUS StatusBits; + uint32 NumStatusCodes; + CSSM_RETURN *StatusCodes; + + + uint32 Index; + + + CSSM_DL_DB_HANDLE DlDbHandle; + CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord; + +} CSSM_TP_APPLE_EVIDENCE_INFO; + + + + + + +typedef struct +{ + uint32 Version; +} CSSM_TP_APPLE_EVIDENCE_HEADER; +enum +{ + CSSM_EVIDENCE_FORM_APPLE_HEADER = 0x80000000 + 0, + CSSM_EVIDENCE_FORM_APPLE_CERTGROUP = 0x80000000 + 1, + CSSM_EVIDENCE_FORM_APPLE_CERT_INFO = 0x80000000 + 2 +}; + + +enum { + + + + + + CSSM_APPLEX509CL_OBTAIN_CSR, + + + + + + + + CSSM_APPLEX509CL_VERIFY_CSR +}; + + + + + + +typedef struct { + CSSM_X509_NAME_PTR subjectNameX509; + + + + CSSM_ALGORITHMS signatureAlg; + CSSM_OID signatureOid; + + CSSM_CSP_HANDLE cspHand; + const CSSM_KEY *subjectPublicKey; + const CSSM_KEY *subjectPrivateKey; + + + + + const char *challengeString; +} CSSM_APPLE_CL_CSR_REQUEST; +void cssmPerror(const char *how, CSSM_RETURN error); + + +_Bool cssmOidToAlg(const CSSM_OID *oid, CSSM_ALGORITHMS *alg); +const CSSM_OID *cssmAlgToOid(CSSM_ALGORITHMS algId); + + + + +typedef uint32 CSSM_MANAGER_EVENT_TYPES; + + + +typedef struct cssm_manager_event_notification { + CSSM_SERVICE_MASK DestinationModuleManagerType; + CSSM_SERVICE_MASK SourceModuleManagerType; + CSSM_MANAGER_EVENT_TYPES Event; + uint32 EventId; + CSSM_DATA EventData; +} CSSM_MANAGER_EVENT_NOTIFICATION __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_MANAGER_EVENT_NOTIFICATION_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +CSSM_RETURN +CSSM_Init (const CSSM_VERSION *Version, + CSSM_PRIVILEGE_SCOPE Scope, + const CSSM_GUID *CallerGuid, + CSSM_KEY_HIERARCHY KeyHierarchy, + CSSM_PVC_MODE *PvcPolicy, + const void *Reserved) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_Terminate (void) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_ModuleLoad (const CSSM_GUID *ModuleGuid, + CSSM_KEY_HIERARCHY KeyHierarchy, + CSSM_API_ModuleEventHandler AppNotifyCallback, + void *AppNotifyCallbackCtx) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_ModuleUnload (const CSSM_GUID *ModuleGuid, + CSSM_API_ModuleEventHandler AppNotifyCallback, + void *AppNotifyCallbackCtx) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_Introduce (const CSSM_GUID *ModuleID, + CSSM_KEY_HIERARCHY KeyHierarchy) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_Unintroduce (const CSSM_GUID *ModuleID) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_ModuleAttach (const CSSM_GUID *ModuleGuid, + const CSSM_VERSION *Version, + const CSSM_API_MEMORY_FUNCS *MemoryFuncs, + uint32 SubserviceID, + CSSM_SERVICE_TYPE SubServiceType, + CSSM_ATTACH_FLAGS AttachFlags, + CSSM_KEY_HIERARCHY KeyHierarchy, + CSSM_FUNC_NAME_ADDR *FunctionTable, + uint32 NumFunctionTable, + const void *Reserved, + CSSM_MODULE_HANDLE_PTR NewModuleHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_ModuleDetach (CSSM_MODULE_HANDLE ModuleHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_SetPrivilege (CSSM_PRIVILEGE Privilege) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_GetPrivilege (CSSM_PRIVILEGE *Privilege) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_GetModuleGUIDFromHandle (CSSM_MODULE_HANDLE ModuleHandle, + CSSM_GUID_PTR ModuleGUID) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_GetSubserviceUIDFromHandle (CSSM_MODULE_HANDLE ModuleHandle, + CSSM_SUBSERVICE_UID_PTR SubserviceUID) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_ListAttachedModuleManagers (uint32 *NumberOfModuleManagers, + CSSM_GUID_PTR ModuleManagerGuids) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_GetAPIMemoryFunctions (CSSM_MODULE_HANDLE AddInHandle, + CSSM_API_MEMORY_FUNCS_PTR AppMemoryFuncs) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +CSSM_RETURN +CSSM_CSP_CreateSignatureContext (CSSM_CSP_HANDLE CSPHandle, + CSSM_ALGORITHMS AlgorithmID, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const CSSM_KEY *Key, + CSSM_CC_HANDLE *NewContextHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CSP_CreateSymmetricContext (CSSM_CSP_HANDLE CSPHandle, + CSSM_ALGORITHMS AlgorithmID, + CSSM_ENCRYPT_MODE Mode, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const CSSM_KEY *Key, + const CSSM_DATA *InitVector, + CSSM_PADDING Padding, + void *Reserved, + CSSM_CC_HANDLE *NewContextHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CSP_CreateDigestContext (CSSM_CSP_HANDLE CSPHandle, + CSSM_ALGORITHMS AlgorithmID, + CSSM_CC_HANDLE *NewContextHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CSP_CreateMacContext (CSSM_CSP_HANDLE CSPHandle, + CSSM_ALGORITHMS AlgorithmID, + const CSSM_KEY *Key, + CSSM_CC_HANDLE *NewContextHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CSP_CreateRandomGenContext (CSSM_CSP_HANDLE CSPHandle, + CSSM_ALGORITHMS AlgorithmID, + const CSSM_CRYPTO_DATA *Seed, + CSSM_SIZE Length, + CSSM_CC_HANDLE *NewContextHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + + +CSSM_RETURN +CSSM_CSP_CreateAsymmetricContext (CSSM_CSP_HANDLE CSPHandle, + CSSM_ALGORITHMS AlgorithmID, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const CSSM_KEY *Key, + CSSM_PADDING Padding, + CSSM_CC_HANDLE *NewContextHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CSP_CreateDeriveKeyContext (CSSM_CSP_HANDLE CSPHandle, + CSSM_ALGORITHMS AlgorithmID, + CSSM_KEY_TYPE DeriveKeyType, + uint32 DeriveKeyLengthInBits, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const CSSM_KEY *BaseKey, + uint32 IterationCount, + const CSSM_DATA *Salt, + const CSSM_CRYPTO_DATA *Seed, + CSSM_CC_HANDLE *NewContextHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CSP_CreateKeyGenContext (CSSM_CSP_HANDLE CSPHandle, + CSSM_ALGORITHMS AlgorithmID, + uint32 KeySizeInBits, + const CSSM_CRYPTO_DATA *Seed, + const CSSM_DATA *Salt, + const CSSM_DATE *StartDate, + const CSSM_DATE *EndDate, + const CSSM_DATA *Params, + CSSM_CC_HANDLE *NewContextHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CSP_CreatePassThroughContext (CSSM_CSP_HANDLE CSPHandle, + const CSSM_KEY *Key, + CSSM_CC_HANDLE *NewContextHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_GetContext (CSSM_CC_HANDLE CCHandle, + CSSM_CONTEXT_PTR *Context) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_FreeContext (CSSM_CONTEXT_PTR Context) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_SetContext (CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DeleteContext (CSSM_CC_HANDLE CCHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_GetContextAttribute (const CSSM_CONTEXT *Context, + uint32 AttributeType, + CSSM_CONTEXT_ATTRIBUTE_PTR *ContextAttribute) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_UpdateContextAttributes (CSSM_CC_HANDLE CCHandle, + uint32 NumberOfAttributes, + const CSSM_CONTEXT_ATTRIBUTE *ContextAttributes) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DeleteContextAttributes (CSSM_CC_HANDLE CCHandle, + uint32 NumberOfAttributes, + const CSSM_CONTEXT_ATTRIBUTE *ContextAttributes) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +CSSM_RETURN +CSSM_CSP_Login (CSSM_CSP_HANDLE CSPHandle, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const CSSM_DATA *LoginName, + const void *Reserved) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CSP_Logout (CSSM_CSP_HANDLE CSPHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CSP_GetLoginAcl (CSSM_CSP_HANDLE CSPHandle, + const CSSM_STRING *SelectionTag, + uint32 *NumberOfAclInfos, + CSSM_ACL_ENTRY_INFO_PTR *AclInfos) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CSP_ChangeLoginAcl (CSSM_CSP_HANDLE CSPHandle, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const CSSM_ACL_EDIT *AclEdit) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +CSSM_RETURN +CSSM_GetKeyAcl (CSSM_CSP_HANDLE CSPHandle, + const CSSM_KEY *Key, + const CSSM_STRING *SelectionTag, + uint32 *NumberOfAclInfos, + CSSM_ACL_ENTRY_INFO_PTR *AclInfos) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_ChangeKeyAcl (CSSM_CSP_HANDLE CSPHandle, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const CSSM_ACL_EDIT *AclEdit, + const CSSM_KEY *Key) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +CSSM_RETURN +CSSM_GetKeyOwner (CSSM_CSP_HANDLE CSPHandle, + const CSSM_KEY *Key, + CSSM_ACL_OWNER_PROTOTYPE_PTR Owner) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_ChangeKeyOwner (CSSM_CSP_HANDLE CSPHandle, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const CSSM_KEY *Key, + const CSSM_ACL_OWNER_PROTOTYPE *NewOwner) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CSP_GetLoginOwner (CSSM_CSP_HANDLE CSPHandle, + CSSM_ACL_OWNER_PROTOTYPE_PTR Owner) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CSP_ChangeLoginOwner (CSSM_CSP_HANDLE CSPHandle, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const CSSM_ACL_OWNER_PROTOTYPE *NewOwner) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_SignData (CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *DataBufs, + uint32 DataBufCount, + CSSM_ALGORITHMS DigestAlgorithm, + CSSM_DATA_PTR Signature) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_SignDataInit (CSSM_CC_HANDLE CCHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_SignDataUpdate (CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *DataBufs, + uint32 DataBufCount) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_SignDataFinal (CSSM_CC_HANDLE CCHandle, + CSSM_DATA_PTR Signature) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_VerifyData (CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *DataBufs, + uint32 DataBufCount, + CSSM_ALGORITHMS DigestAlgorithm, + const CSSM_DATA *Signature) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_VerifyDataInit (CSSM_CC_HANDLE CCHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_VerifyDataUpdate (CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *DataBufs, + uint32 DataBufCount) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_VerifyDataFinal (CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *Signature) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DigestData (CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *DataBufs, + uint32 DataBufCount, + CSSM_DATA_PTR Digest) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DigestDataInit (CSSM_CC_HANDLE CCHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DigestDataUpdate (CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *DataBufs, + uint32 DataBufCount) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DigestDataClone (CSSM_CC_HANDLE CCHandle, + CSSM_CC_HANDLE *ClonednewCCHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DigestDataFinal (CSSM_CC_HANDLE CCHandle, + CSSM_DATA_PTR Digest) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_GenerateMac (CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *DataBufs, + uint32 DataBufCount, + CSSM_DATA_PTR Mac) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_GenerateMacInit (CSSM_CC_HANDLE CCHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_GenerateMacUpdate (CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *DataBufs, + uint32 DataBufCount) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_GenerateMacFinal (CSSM_CC_HANDLE CCHandle, + CSSM_DATA_PTR Mac) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_VerifyMac (CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *DataBufs, + uint32 DataBufCount, + const CSSM_DATA *Mac) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_VerifyMacInit (CSSM_CC_HANDLE CCHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_VerifyMacUpdate (CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *DataBufs, + uint32 DataBufCount) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_VerifyMacFinal (CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *Mac) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_QuerySize (CSSM_CC_HANDLE CCHandle, + CSSM_BOOL Encrypt, + uint32 QuerySizeCount, + CSSM_QUERY_SIZE_DATA_PTR DataBlockSizes) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + + +CSSM_RETURN +CSSM_EncryptData (CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *ClearBufs, + uint32 ClearBufCount, + CSSM_DATA_PTR CipherBufs, + uint32 CipherBufCount, + CSSM_SIZE *bytesEncrypted, + CSSM_DATA_PTR RemData) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_EncryptDataP (CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *ClearBufs, + uint32 ClearBufCount, + CSSM_DATA_PTR CipherBufs, + uint32 CipherBufCount, + CSSM_SIZE *bytesEncrypted, + CSSM_DATA_PTR RemData, + CSSM_PRIVILEGE Privilege) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_EncryptDataInit (CSSM_CC_HANDLE CCHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_EncryptDataInitP (CSSM_CC_HANDLE CCHandle, + CSSM_PRIVILEGE Privilege) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_EncryptDataUpdate (CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *ClearBufs, + uint32 ClearBufCount, + CSSM_DATA_PTR CipherBufs, + uint32 CipherBufCount, + CSSM_SIZE *bytesEncrypted) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_EncryptDataFinal (CSSM_CC_HANDLE CCHandle, + CSSM_DATA_PTR RemData) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DecryptData (CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *CipherBufs, + uint32 CipherBufCount, + CSSM_DATA_PTR ClearBufs, + uint32 ClearBufCount, + CSSM_SIZE *bytesDecrypted, + CSSM_DATA_PTR RemData) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DecryptDataP (CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *CipherBufs, + uint32 CipherBufCount, + CSSM_DATA_PTR ClearBufs, + uint32 ClearBufCount, + CSSM_SIZE *bytesDecrypted, + CSSM_DATA_PTR RemData, + CSSM_PRIVILEGE Privilege) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DecryptDataInit (CSSM_CC_HANDLE CCHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DecryptDataInitP (CSSM_CC_HANDLE CCHandle, + CSSM_PRIVILEGE Privilege) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DecryptDataUpdate (CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *CipherBufs, + uint32 CipherBufCount, + CSSM_DATA_PTR ClearBufs, + uint32 ClearBufCount, + CSSM_SIZE *bytesDecrypted) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DecryptDataFinal (CSSM_CC_HANDLE CCHandle, + CSSM_DATA_PTR RemData) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_QueryKeySizeInBits (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_KEY *Key, + CSSM_KEY_SIZE_PTR KeySize) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_GenerateKey (CSSM_CC_HANDLE CCHandle, + uint32 KeyUsage, + uint32 KeyAttr, + const CSSM_DATA *KeyLabel, + const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry, + CSSM_KEY_PTR Key) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_GenerateKeyP (CSSM_CC_HANDLE CCHandle, + uint32 KeyUsage, + uint32 KeyAttr, + const CSSM_DATA *KeyLabel, + const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry, + CSSM_KEY_PTR Key, + CSSM_PRIVILEGE Privilege) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_GenerateKeyPair (CSSM_CC_HANDLE CCHandle, + uint32 PublicKeyUsage, + uint32 PublicKeyAttr, + const CSSM_DATA *PublicKeyLabel, + CSSM_KEY_PTR PublicKey, + uint32 PrivateKeyUsage, + uint32 PrivateKeyAttr, + const CSSM_DATA *PrivateKeyLabel, + const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry, + CSSM_KEY_PTR PrivateKey) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_GenerateKeyPairP (CSSM_CC_HANDLE CCHandle, + uint32 PublicKeyUsage, + uint32 PublicKeyAttr, + const CSSM_DATA *PublicKeyLabel, + CSSM_KEY_PTR PublicKey, + uint32 PrivateKeyUsage, + uint32 PrivateKeyAttr, + const CSSM_DATA *PrivateKeyLabel, + const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry, + CSSM_KEY_PTR PrivateKey, + CSSM_PRIVILEGE Privilege) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_GenerateRandom (CSSM_CC_HANDLE CCHandle, + CSSM_DATA_PTR RandomNumber) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CSP_ObtainPrivateKeyFromPublicKey (CSSM_CSP_HANDLE CSPHandle, + const CSSM_KEY *PublicKey, + CSSM_KEY_PTR PrivateKey) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_WrapKey (CSSM_CC_HANDLE CCHandle, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const CSSM_KEY *Key, + const CSSM_DATA *DescriptiveData, + CSSM_WRAP_KEY_PTR WrappedKey) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_UnwrapKey (CSSM_CC_HANDLE CCHandle, + const CSSM_KEY *PublicKey, + const CSSM_WRAP_KEY *WrappedKey, + uint32 KeyUsage, + uint32 KeyAttr, + const CSSM_DATA *KeyLabel, + const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry, + CSSM_KEY_PTR UnwrappedKey, + CSSM_DATA_PTR DescriptiveData) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_WrapKeyP (CSSM_CC_HANDLE CCHandle, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const CSSM_KEY *Key, + const CSSM_DATA *DescriptiveData, + CSSM_WRAP_KEY_PTR WrappedKey, + CSSM_PRIVILEGE Privilege) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_UnwrapKeyP (CSSM_CC_HANDLE CCHandle, + const CSSM_KEY *PublicKey, + const CSSM_WRAP_KEY *WrappedKey, + uint32 KeyUsage, + uint32 KeyAttr, + const CSSM_DATA *KeyLabel, + const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry, + CSSM_KEY_PTR UnwrappedKey, + CSSM_DATA_PTR DescriptiveData, + CSSM_PRIVILEGE Privilege) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_DeriveKey (CSSM_CC_HANDLE CCHandle, + CSSM_DATA_PTR Param, + uint32 KeyUsage, + uint32 KeyAttr, + const CSSM_DATA *KeyLabel, + const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry, + CSSM_KEY_PTR DerivedKey) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + + +CSSM_RETURN +CSSM_FreeKey (CSSM_CSP_HANDLE CSPHandle, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + CSSM_KEY_PTR KeyPtr, + CSSM_BOOL Delete) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_GenerateAlgorithmParams (CSSM_CC_HANDLE CCHandle, + uint32 ParamBits, + CSSM_DATA_PTR Param) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +CSSM_RETURN +CSSM_CSP_GetOperationalStatistics (CSSM_CSP_HANDLE CSPHandle, + CSSM_CSP_OPERATIONAL_STATISTICS *Statistics) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + + +CSSM_RETURN +CSSM_GetTimeValue (CSSM_CSP_HANDLE CSPHandle, + CSSM_ALGORITHMS TimeAlgorithm, + CSSM_DATA *TimeData) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_RetrieveUniqueId (CSSM_CSP_HANDLE CSPHandle, + CSSM_DATA_PTR UniqueID) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_RetrieveCounter (CSSM_CSP_HANDLE CSPHandle, + CSSM_DATA_PTR Counter) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_VerifyDevice (CSSM_CSP_HANDLE CSPHandle, + const CSSM_DATA *DeviceCert) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +CSSM_RETURN +CSSM_CSP_PassThrough (CSSM_CC_HANDLE CCHandle, + uint32 PassThroughId, + const void *InData, + void **OutData) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +CSSM_RETURN +CSSM_TP_SubmitCredRequest (CSSM_TP_HANDLE TPHandle, + const CSSM_TP_AUTHORITY_ID *PreferredAuthority, + CSSM_TP_AUTHORITY_REQUEST_TYPE RequestType, + const CSSM_TP_REQUEST_SET *RequestInput, + const CSSM_TP_CALLERAUTH_CONTEXT *CallerAuthContext, + sint32 *EstimatedTime, + CSSM_DATA_PTR ReferenceIdentifier) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_TP_RetrieveCredResult (CSSM_TP_HANDLE TPHandle, + const CSSM_DATA *ReferenceIdentifier, + const CSSM_TP_CALLERAUTH_CONTEXT *CallerAuthCredentials, + sint32 *EstimatedTime, + CSSM_BOOL *ConfirmationRequired, + CSSM_TP_RESULT_SET_PTR *RetrieveOutput) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_TP_ConfirmCredResult (CSSM_TP_HANDLE TPHandle, + const CSSM_DATA *ReferenceIdentifier, + const CSSM_TP_CALLERAUTH_CONTEXT *CallerAuthCredentials, + const CSSM_TP_CONFIRM_RESPONSE *Responses, + const CSSM_TP_AUTHORITY_ID *PreferredAuthority) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_TP_ReceiveConfirmation (CSSM_TP_HANDLE TPHandle, + const CSSM_DATA *ReferenceIdentifier, + CSSM_TP_CONFIRM_RESPONSE_PTR *Responses, + sint32 *ElapsedTime) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_TP_CertReclaimKey (CSSM_TP_HANDLE TPHandle, + const CSSM_CERTGROUP *CertGroup, + uint32 CertIndex, + CSSM_LONG_HANDLE KeyCacheHandle, + CSSM_CSP_HANDLE CSPHandle, + const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_TP_CertReclaimAbort (CSSM_TP_HANDLE TPHandle, + CSSM_LONG_HANDLE KeyCacheHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_TP_FormRequest (CSSM_TP_HANDLE TPHandle, + const CSSM_TP_AUTHORITY_ID *PreferredAuthority, + CSSM_TP_FORM_TYPE FormType, + CSSM_DATA_PTR BlankForm) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_TP_FormSubmit (CSSM_TP_HANDLE TPHandle, + CSSM_TP_FORM_TYPE FormType, + const CSSM_DATA *Form, + const CSSM_TP_AUTHORITY_ID *ClearanceAuthority, + const CSSM_TP_AUTHORITY_ID *RepresentedAuthority, + CSSM_ACCESS_CREDENTIALS_PTR Credentials) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_TP_CertGroupVerify (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + CSSM_CSP_HANDLE CSPHandle, + const CSSM_CERTGROUP *CertGroupToBeVerified, + const CSSM_TP_VERIFY_CONTEXT *VerifyContext, + CSSM_TP_VERIFY_CONTEXT_RESULT_PTR VerifyContextResult) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_TP_CertCreateTemplate (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + uint32 NumberOfFields, + const CSSM_FIELD *CertFields, + CSSM_DATA_PTR CertTemplate) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_TP_CertGetAllTemplateFields (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *CertTemplate, + uint32 *NumberOfFields, + CSSM_FIELD_PTR *CertFields) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_TP_CertSign (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *CertTemplateToBeSigned, + const CSSM_CERTGROUP *SignerCertGroup, + const CSSM_TP_VERIFY_CONTEXT *SignerVerifyContext, + CSSM_TP_VERIFY_CONTEXT_RESULT_PTR SignerVerifyResult, + CSSM_DATA_PTR SignedCert) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_TP_CrlVerify (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + CSSM_CSP_HANDLE CSPHandle, + const CSSM_ENCODED_CRL *CrlToBeVerified, + const CSSM_CERTGROUP *SignerCertGroup, + const CSSM_TP_VERIFY_CONTEXT *VerifyContext, + CSSM_TP_VERIFY_CONTEXT_RESULT_PTR RevokerVerifyResult) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_TP_CrlCreateTemplate (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + uint32 NumberOfFields, + const CSSM_FIELD *CrlFields, + CSSM_DATA_PTR NewCrlTemplate) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_TP_CertRevoke (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + CSSM_CSP_HANDLE CSPHandle, + const CSSM_DATA *OldCrlTemplate, + const CSSM_CERTGROUP *CertGroupToBeRevoked, + const CSSM_CERTGROUP *RevokerCertGroup, + const CSSM_TP_VERIFY_CONTEXT *RevokerVerifyContext, + CSSM_TP_VERIFY_CONTEXT_RESULT_PTR RevokerVerifyResult, + CSSM_TP_CERTCHANGE_REASON Reason, + CSSM_DATA_PTR NewCrlTemplate) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_TP_CertRemoveFromCrlTemplate (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + CSSM_CSP_HANDLE CSPHandle, + const CSSM_DATA *OldCrlTemplate, + const CSSM_CERTGROUP *CertGroupToBeRemoved, + const CSSM_CERTGROUP *RevokerCertGroup, + const CSSM_TP_VERIFY_CONTEXT *RevokerVerifyContext, + CSSM_TP_VERIFY_CONTEXT_RESULT_PTR RevokerVerifyResult, + CSSM_DATA_PTR NewCrlTemplate) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_TP_CrlSign (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_ENCODED_CRL *CrlToBeSigned, + const CSSM_CERTGROUP *SignerCertGroup, + const CSSM_TP_VERIFY_CONTEXT *SignerVerifyContext, + CSSM_TP_VERIFY_CONTEXT_RESULT_PTR SignerVerifyResult, + CSSM_DATA_PTR SignedCrl) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_TP_ApplyCrlToDb (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + CSSM_CSP_HANDLE CSPHandle, + const CSSM_ENCODED_CRL *CrlToBeApplied, + const CSSM_CERTGROUP *SignerCertGroup, + const CSSM_TP_VERIFY_CONTEXT *ApplyCrlVerifyContext, + CSSM_TP_VERIFY_CONTEXT_RESULT_PTR ApplyCrlVerifyResult) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_TP_CertGroupConstruct (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + CSSM_CSP_HANDLE CSPHandle, + const CSSM_DL_DB_LIST *DBList, + const void *ConstructParams, + const CSSM_CERTGROUP *CertGroupFrag, + CSSM_CERTGROUP_PTR *CertGroup) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_TP_CertGroupPrune (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + const CSSM_DL_DB_LIST *DBList, + const CSSM_CERTGROUP *OrderedCertGroup, + CSSM_CERTGROUP_PTR *PrunedCertGroup) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_TP_CertGroupToTupleGroup (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + const CSSM_CERTGROUP *CertGroup, + CSSM_TUPLEGROUP_PTR *TupleGroup) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_TP_TupleGroupToCertGroup (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + const CSSM_TUPLEGROUP *TupleGroup, + CSSM_CERTGROUP_PTR *CertTemplates) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_TP_PassThrough (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DL_DB_LIST *DBList, + uint32 PassThroughId, + const void *InputParams, + void **OutputParams) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +CSSM_RETURN +CSSM_AC_AuthCompute (CSSM_AC_HANDLE ACHandle, + const CSSM_TUPLEGROUP *BaseAuthorizations, + const CSSM_TUPLEGROUP *Credentials, + uint32 NumberOfRequestors, + const CSSM_LIST *Requestors, + const CSSM_LIST *RequestedAuthorizationPeriod, + const CSSM_LIST *RequestedAuthorization, + CSSM_TUPLEGROUP_PTR AuthorizationResult) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_AC_PassThrough (CSSM_AC_HANDLE ACHandle, + CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DL_DB_LIST *DBList, + uint32 PassThroughId, + const void *InputParams, + void **OutputParams) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +CSSM_RETURN +CSSM_CL_CertCreateTemplate (CSSM_CL_HANDLE CLHandle, + uint32 NumberOfFields, + const CSSM_FIELD *CertFields, + CSSM_DATA_PTR CertTemplate) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CL_CertGetAllTemplateFields (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *CertTemplate, + uint32 *NumberOfFields, + CSSM_FIELD_PTR *CertFields) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CL_CertSign (CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *CertTemplate, + const CSSM_FIELD *SignScope, + uint32 ScopeSize, + CSSM_DATA_PTR SignedCert) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CL_CertVerify (CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *CertToBeVerified, + const CSSM_DATA *SignerCert, + const CSSM_FIELD *VerifyScope, + uint32 ScopeSize) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CL_CertVerifyWithKey (CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *CertToBeVerified) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CL_CertGetFirstFieldValue (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *Cert, + const CSSM_OID *CertField, + CSSM_HANDLE_PTR ResultsHandle, + uint32 *NumberOfMatchedFields, + CSSM_DATA_PTR *Value) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CL_CertGetNextFieldValue (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE ResultsHandle, + CSSM_DATA_PTR *Value) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CL_CertAbortQuery (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE ResultsHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CL_CertGetKeyInfo (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *Cert, + CSSM_KEY_PTR *Key) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CL_CertGetAllFields (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *Cert, + uint32 *NumberOfFields, + CSSM_FIELD_PTR *CertFields) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CL_FreeFields (CSSM_CL_HANDLE CLHandle, + uint32 NumberOfFields, + CSSM_FIELD_PTR *Fields) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CL_FreeFieldValue (CSSM_CL_HANDLE CLHandle, + const CSSM_OID *CertOrCrlOid, + CSSM_DATA_PTR Value) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CL_CertCache (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *Cert, + CSSM_HANDLE_PTR CertHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CL_CertGetFirstCachedFieldValue (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE CertHandle, + const CSSM_OID *CertField, + CSSM_HANDLE_PTR ResultsHandle, + uint32 *NumberOfMatchedFields, + CSSM_DATA_PTR *Value) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CL_CertGetNextCachedFieldValue (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE ResultsHandle, + CSSM_DATA_PTR *Value) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CL_CertAbortCache (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE CertHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CL_CertGroupToSignedBundle (CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CERTGROUP *CertGroupToBundle, + const CSSM_CERT_BUNDLE_HEADER *BundleInfo, + CSSM_DATA_PTR SignedBundle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CL_CertGroupFromVerifiedBundle (CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CERT_BUNDLE *CertBundle, + const CSSM_DATA *SignerCert, + CSSM_CERTGROUP_PTR *CertGroup) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CL_CertDescribeFormat (CSSM_CL_HANDLE CLHandle, + uint32 *NumberOfFields, + CSSM_OID_PTR *OidList) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CL_CrlCreateTemplate (CSSM_CL_HANDLE CLHandle, + uint32 NumberOfFields, + const CSSM_FIELD *CrlTemplate, + CSSM_DATA_PTR NewCrl) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CL_CrlSetFields (CSSM_CL_HANDLE CLHandle, + uint32 NumberOfFields, + const CSSM_FIELD *CrlTemplate, + const CSSM_DATA *OldCrl, + CSSM_DATA_PTR ModifiedCrl) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CL_CrlAddCert (CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *Cert, + uint32 NumberOfFields, + const CSSM_FIELD *CrlEntryFields, + const CSSM_DATA *OldCrl, + CSSM_DATA_PTR NewCrl) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CL_CrlRemoveCert (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *Cert, + const CSSM_DATA *OldCrl, + CSSM_DATA_PTR NewCrl) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CL_CrlSign (CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *UnsignedCrl, + const CSSM_FIELD *SignScope, + uint32 ScopeSize, + CSSM_DATA_PTR SignedCrl) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CL_CrlVerify (CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *CrlToBeVerified, + const CSSM_DATA *SignerCert, + const CSSM_FIELD *VerifyScope, + uint32 ScopeSize) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CL_CrlVerifyWithKey (CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *CrlToBeVerified) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CL_IsCertInCrl (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *Cert, + const CSSM_DATA *Crl, + CSSM_BOOL *CertFound) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CL_CrlGetFirstFieldValue (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *Crl, + const CSSM_OID *CrlField, + CSSM_HANDLE_PTR ResultsHandle, + uint32 *NumberOfMatchedFields, + CSSM_DATA_PTR *Value) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CL_CrlGetNextFieldValue (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE ResultsHandle, + CSSM_DATA_PTR *Value) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CL_CrlAbortQuery (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE ResultsHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CL_CrlGetAllFields (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *Crl, + uint32 *NumberOfCrlFields, + CSSM_FIELD_PTR *CrlFields) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CL_CrlCache (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *Crl, + CSSM_HANDLE_PTR CrlHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CL_IsCertInCachedCrl (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *Cert, + CSSM_HANDLE CrlHandle, + CSSM_BOOL *CertFound, + CSSM_DATA_PTR CrlRecordIndex) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CL_CrlGetFirstCachedFieldValue (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE CrlHandle, + const CSSM_DATA *CrlRecordIndex, + const CSSM_OID *CrlField, + CSSM_HANDLE_PTR ResultsHandle, + uint32 *NumberOfMatchedFields, + CSSM_DATA_PTR *Value) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CL_CrlGetNextCachedFieldValue (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE ResultsHandle, + CSSM_DATA_PTR *Value) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_CL_CrlGetAllCachedRecordFields (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE CrlHandle, + const CSSM_DATA *CrlRecordIndex, + uint32 *NumberOfFields, + CSSM_FIELD_PTR *CrlFields) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CL_CrlAbortCache (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE CrlHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CL_CrlDescribeFormat (CSSM_CL_HANDLE CLHandle, + uint32 *NumberOfFields, + CSSM_OID_PTR *OidList) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_CL_PassThrough (CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + uint32 PassThroughId, + const void *InputParams, + void **OutputParams) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +CSSM_RETURN +CSSM_DL_DbOpen (CSSM_DL_HANDLE DLHandle, + const char *DbName, + const CSSM_NET_ADDRESS *DbLocation, + CSSM_DB_ACCESS_TYPE AccessRequest, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const void *OpenParameters, + CSSM_DB_HANDLE *DbHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_DL_DbClose (CSSM_DL_DB_HANDLE DLDBHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_DL_DbCreate (CSSM_DL_HANDLE DLHandle, + const char *DbName, + const CSSM_NET_ADDRESS *DbLocation, + const CSSM_DBINFO *DBInfo, + CSSM_DB_ACCESS_TYPE AccessRequest, + const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry, + const void *OpenParameters, + CSSM_DB_HANDLE *DbHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_DL_DbDelete (CSSM_DL_HANDLE DLHandle, + const char *DbName, + const CSSM_NET_ADDRESS *DbLocation, + const CSSM_ACCESS_CREDENTIALS *AccessCred) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DL_CreateRelation (CSSM_DL_DB_HANDLE DLDBHandle, + CSSM_DB_RECORDTYPE RelationID, + const char *RelationName, + uint32 NumberOfAttributes, + const CSSM_DB_SCHEMA_ATTRIBUTE_INFO *pAttributeInfo, + uint32 NumberOfIndexes, + const CSSM_DB_SCHEMA_INDEX_INFO *pIndexInfo) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DL_DestroyRelation (CSSM_DL_DB_HANDLE DLDBHandle, + CSSM_DB_RECORDTYPE RelationID) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_DL_Authenticate (CSSM_DL_DB_HANDLE DLDBHandle, + CSSM_DB_ACCESS_TYPE AccessRequest, + const CSSM_ACCESS_CREDENTIALS *AccessCred) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DL_GetDbAcl (CSSM_DL_DB_HANDLE DLDBHandle, + const CSSM_STRING *SelectionTag, + uint32 *NumberOfAclInfos, + CSSM_ACL_ENTRY_INFO_PTR *AclInfos) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DL_ChangeDbAcl (CSSM_DL_DB_HANDLE DLDBHandle, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const CSSM_ACL_EDIT *AclEdit) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DL_GetDbOwner (CSSM_DL_DB_HANDLE DLDBHandle, + CSSM_ACL_OWNER_PROTOTYPE_PTR Owner) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DL_ChangeDbOwner (CSSM_DL_DB_HANDLE DLDBHandle, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const CSSM_ACL_OWNER_PROTOTYPE *NewOwner) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DL_GetDbNames (CSSM_DL_HANDLE DLHandle, + CSSM_NAME_LIST_PTR *NameList) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DL_GetDbNameFromHandle (CSSM_DL_DB_HANDLE DLDBHandle, + char **DbName) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DL_FreeNameList (CSSM_DL_HANDLE DLHandle, + CSSM_NAME_LIST_PTR NameList) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DL_DataInsert (CSSM_DL_DB_HANDLE DLDBHandle, + CSSM_DB_RECORDTYPE RecordType, + const CSSM_DB_RECORD_ATTRIBUTE_DATA *Attributes, + const CSSM_DATA *Data, + CSSM_DB_UNIQUE_RECORD_PTR *UniqueId) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_DL_DataDelete (CSSM_DL_DB_HANDLE DLDBHandle, + const CSSM_DB_UNIQUE_RECORD *UniqueRecordIdentifier) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + +CSSM_RETURN +CSSM_DL_DataModify (CSSM_DL_DB_HANDLE DLDBHandle, + CSSM_DB_RECORDTYPE RecordType, + CSSM_DB_UNIQUE_RECORD_PTR UniqueRecordIdentifier, + const CSSM_DB_RECORD_ATTRIBUTE_DATA *AttributesToBeModified, + const CSSM_DATA *DataToBeModified, + CSSM_DB_MODIFY_MODE ModifyMode) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + + +CSSM_RETURN +CSSM_DL_DataGetFirst (CSSM_DL_DB_HANDLE DLDBHandle, + const CSSM_QUERY *Query, + CSSM_HANDLE_PTR ResultsHandle, + CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes, + CSSM_DATA_PTR Data, + CSSM_DB_UNIQUE_RECORD_PTR *UniqueId) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + + +CSSM_RETURN +CSSM_DL_DataGetNext (CSSM_DL_DB_HANDLE DLDBHandle, + CSSM_HANDLE ResultsHandle, + CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes, + CSSM_DATA_PTR Data, + CSSM_DB_UNIQUE_RECORD_PTR *UniqueId) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DL_DataAbortQuery (CSSM_DL_DB_HANDLE DLDBHandle, + CSSM_HANDLE ResultsHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DL_DataGetFromUniqueRecordId (CSSM_DL_DB_HANDLE DLDBHandle, + const CSSM_DB_UNIQUE_RECORD *UniqueRecord, + CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes, + CSSM_DATA_PTR Data) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DL_FreeUniqueRecord (CSSM_DL_DB_HANDLE DLDBHandle, + CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + +CSSM_RETURN +CSSM_DL_PassThrough (CSSM_DL_DB_HANDLE DLDBHandle, + uint32 PassThroughId, + const void *InputParams, + void **OutputParams) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_spi_ac_funcs { + CSSM_RETURN ( *AuthCompute) + (CSSM_AC_HANDLE ACHandle, + const CSSM_TUPLEGROUP *BaseAuthorizations, + const CSSM_TUPLEGROUP *Credentials, + uint32 NumberOfRequestors, + const CSSM_LIST *Requestors, + const CSSM_LIST *RequestedAuthorizationPeriod, + const CSSM_LIST *RequestedAuthorization, + CSSM_TUPLEGROUP_PTR AuthorizationResult); + CSSM_RETURN ( *PassThrough) + (CSSM_AC_HANDLE ACHandle, + CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DL_DB_LIST *DBList, + uint32 PassThroughId, + const void *InputParams, + void **OutputParams); +} CSSM_SPI_AC_FUNCS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_SPI_AC_FUNCS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + +typedef struct cssm_spi_cl_funcs { + CSSM_RETURN ( *CertCreateTemplate) + (CSSM_CL_HANDLE CLHandle, + uint32 NumberOfFields, + const CSSM_FIELD *CertFields, + CSSM_DATA_PTR CertTemplate); + CSSM_RETURN ( *CertGetAllTemplateFields) + (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *CertTemplate, + uint32 *NumberOfFields, + CSSM_FIELD_PTR *CertFields); + CSSM_RETURN ( *CertSign) + (CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *CertTemplate, + const CSSM_FIELD *SignScope, + uint32 ScopeSize, + CSSM_DATA_PTR SignedCert); + CSSM_RETURN ( *CertVerify) + (CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *CertToBeVerified, + const CSSM_DATA *SignerCert, + const CSSM_FIELD *VerifyScope, + uint32 ScopeSize); + CSSM_RETURN ( *CertVerifyWithKey) + (CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *CertToBeVerified); + CSSM_RETURN ( *CertGetFirstFieldValue) + (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *Cert, + const CSSM_OID *CertField, + CSSM_HANDLE_PTR ResultsHandle, + uint32 *NumberOfMatchedFields, + CSSM_DATA_PTR *Value); + CSSM_RETURN ( *CertGetNextFieldValue) + (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE ResultsHandle, + CSSM_DATA_PTR *Value); + CSSM_RETURN ( *CertAbortQuery) + (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE ResultsHandle); + CSSM_RETURN ( *CertGetKeyInfo) + (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *Cert, + CSSM_KEY_PTR *Key); + CSSM_RETURN ( *CertGetAllFields) + (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *Cert, + uint32 *NumberOfFields, + CSSM_FIELD_PTR *CertFields); + CSSM_RETURN ( *FreeFields) + (CSSM_CL_HANDLE CLHandle, + uint32 NumberOfFields, + CSSM_FIELD_PTR *FieldArray); + CSSM_RETURN ( *FreeFieldValue) + (CSSM_CL_HANDLE CLHandle, + const CSSM_OID *CertOrCrlOid, + CSSM_DATA_PTR Value); + CSSM_RETURN ( *CertCache) + (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *Cert, + CSSM_HANDLE_PTR CertHandle); + CSSM_RETURN ( *CertGetFirstCachedFieldValue) + (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE CertHandle, + const CSSM_OID *CertField, + CSSM_HANDLE_PTR ResultsHandle, + uint32 *NumberOfMatchedFields, + CSSM_DATA_PTR *Value); + CSSM_RETURN ( *CertGetNextCachedFieldValue) + (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE ResultsHandle, + CSSM_DATA_PTR *Value); + CSSM_RETURN ( *CertAbortCache) + (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE CertHandle); + CSSM_RETURN ( *CertGroupToSignedBundle) + (CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CERTGROUP *CertGroupToBundle, + const CSSM_CERT_BUNDLE_HEADER *BundleInfo, + CSSM_DATA_PTR SignedBundle); + CSSM_RETURN ( *CertGroupFromVerifiedBundle) + (CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CERT_BUNDLE *CertBundle, + const CSSM_DATA *SignerCert, + CSSM_CERTGROUP_PTR *CertGroup); + CSSM_RETURN ( *CertDescribeFormat) + (CSSM_CL_HANDLE CLHandle, + uint32 *NumberOfFields, + CSSM_OID_PTR *OidList); + CSSM_RETURN ( *CrlCreateTemplate) + (CSSM_CL_HANDLE CLHandle, + uint32 NumberOfFields, + const CSSM_FIELD *CrlTemplate, + CSSM_DATA_PTR NewCrl); + CSSM_RETURN ( *CrlSetFields) + (CSSM_CL_HANDLE CLHandle, + uint32 NumberOfFields, + const CSSM_FIELD *CrlTemplate, + const CSSM_DATA *OldCrl, + CSSM_DATA_PTR ModifiedCrl); + CSSM_RETURN ( *CrlAddCert) + (CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *Cert, + uint32 NumberOfFields, + const CSSM_FIELD *CrlEntryFields, + const CSSM_DATA *OldCrl, + CSSM_DATA_PTR NewCrl); + CSSM_RETURN ( *CrlRemoveCert) + (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *Cert, + const CSSM_DATA *OldCrl, + CSSM_DATA_PTR NewCrl); + CSSM_RETURN ( *CrlSign) + (CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *UnsignedCrl, + const CSSM_FIELD *SignScope, + uint32 ScopeSize, + CSSM_DATA_PTR SignedCrl); + CSSM_RETURN ( *CrlVerify) + (CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *CrlToBeVerified, + const CSSM_DATA *SignerCert, + const CSSM_FIELD *VerifyScope, + uint32 ScopeSize); + CSSM_RETURN ( *CrlVerifyWithKey) + (CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *CrlToBeVerified); + CSSM_RETURN ( *IsCertInCrl) + (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *Cert, + const CSSM_DATA *Crl, + CSSM_BOOL *CertFound); + CSSM_RETURN ( *CrlGetFirstFieldValue) + (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *Crl, + const CSSM_OID *CrlField, + CSSM_HANDLE_PTR ResultsHandle, + uint32 *NumberOfMatchedFields, + CSSM_DATA_PTR *Value); + CSSM_RETURN ( *CrlGetNextFieldValue) + (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE ResultsHandle, + CSSM_DATA_PTR *Value); + CSSM_RETURN ( *CrlAbortQuery) + (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE ResultsHandle); + CSSM_RETURN ( *CrlGetAllFields) + (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *Crl, + uint32 *NumberOfCrlFields, + CSSM_FIELD_PTR *CrlFields); + CSSM_RETURN ( *CrlCache) + (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *Crl, + CSSM_HANDLE_PTR CrlHandle); + CSSM_RETURN ( *IsCertInCachedCrl) + (CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *Cert, + CSSM_HANDLE CrlHandle, + CSSM_BOOL *CertFound, + CSSM_DATA_PTR CrlRecordIndex); + CSSM_RETURN ( *CrlGetFirstCachedFieldValue) + (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE CrlHandle, + const CSSM_DATA *CrlRecordIndex, + const CSSM_OID *CrlField, + CSSM_HANDLE_PTR ResultsHandle, + uint32 *NumberOfMatchedFields, + CSSM_DATA_PTR *Value); + CSSM_RETURN ( *CrlGetNextCachedFieldValue) + (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE ResultsHandle, + CSSM_DATA_PTR *Value); + CSSM_RETURN ( *CrlGetAllCachedRecordFields) + (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE CrlHandle, + const CSSM_DATA *CrlRecordIndex, + uint32 *NumberOfFields, + CSSM_FIELD_PTR *CrlFields); + CSSM_RETURN ( *CrlAbortCache) + (CSSM_CL_HANDLE CLHandle, + CSSM_HANDLE CrlHandle); + CSSM_RETURN ( *CrlDescribeFormat) + (CSSM_CL_HANDLE CLHandle, + uint32 *NumberOfFields, + CSSM_OID_PTR *OidList); + CSSM_RETURN ( *PassThrough) + (CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + uint32 PassThroughId, + const void *InputParams, + void **OutputParams); +} CSSM_SPI_CL_FUNCS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_SPI_CL_FUNCS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + +typedef CSSM_RETURN ( *CSSM_SPI_ModuleEventHandler) + (const CSSM_GUID *ModuleGuid, + void *CssmNotifyCallbackCtx, + uint32 SubserviceId, + CSSM_SERVICE_TYPE ServiceType, + CSSM_MODULE_EVENT EventType); + +typedef uint32 CSSM_CONTEXT_EVENT; +enum { + CSSM_CONTEXT_EVENT_CREATE = 1, + CSSM_CONTEXT_EVENT_DELETE = 2, + CSSM_CONTEXT_EVENT_UPDATE = 3 +}; + +typedef struct cssm_module_funcs { + CSSM_SERVICE_TYPE ServiceType; + uint32 NumberOfServiceFuncs; + const CSSM_PROC_ADDR *ServiceFuncs; +} CSSM_MODULE_FUNCS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_MODULE_FUNCS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef void *( *CSSM_UPCALLS_MALLOC) + (CSSM_HANDLE AddInHandle, + size_t size) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef void ( *CSSM_UPCALLS_FREE) + (CSSM_HANDLE AddInHandle, + void *memblock) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef void *( *CSSM_UPCALLS_REALLOC) + (CSSM_HANDLE AddInHandle, + void *memblock, + size_t size) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef void *( *CSSM_UPCALLS_CALLOC) + (CSSM_HANDLE AddInHandle, + size_t num, + size_t size) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_upcalls { + CSSM_UPCALLS_MALLOC malloc_func; + CSSM_UPCALLS_FREE free_func; + CSSM_UPCALLS_REALLOC realloc_func; + CSSM_UPCALLS_CALLOC calloc_func; + CSSM_RETURN ( *CcToHandle_func) + (CSSM_CC_HANDLE Cc, + CSSM_MODULE_HANDLE_PTR ModuleHandle); + CSSM_RETURN ( *GetModuleInfo_func) + (CSSM_MODULE_HANDLE Module, + CSSM_GUID_PTR Guid, + CSSM_VERSION_PTR Version, + uint32 *SubServiceId, + CSSM_SERVICE_TYPE *SubServiceType, + CSSM_ATTACH_FLAGS *AttachFlags, + CSSM_KEY_HIERARCHY *KeyHierarchy, + CSSM_API_MEMORY_FUNCS_PTR AttachedMemFuncs, + CSSM_FUNC_NAME_ADDR_PTR FunctionTable, + uint32 NumFunctions); +} CSSM_UPCALLS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_UPCALLS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +CSSM_RETURN +CSSM_SPI_ModuleLoad (const CSSM_GUID *CssmGuid, + const CSSM_GUID *ModuleGuid, + CSSM_SPI_ModuleEventHandler CssmNotifyCallback, + void *CssmNotifyCallbackCtx) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +CSSM_RETURN +CSSM_SPI_ModuleUnload (const CSSM_GUID *CssmGuid, + const CSSM_GUID *ModuleGuid, + CSSM_SPI_ModuleEventHandler CssmNotifyCallback, + void *CssmNotifyCallbackCtx) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +CSSM_RETURN +CSSM_SPI_ModuleAttach (const CSSM_GUID *ModuleGuid, + const CSSM_VERSION *Version, + uint32 SubserviceID, + CSSM_SERVICE_TYPE SubServiceType, + CSSM_ATTACH_FLAGS AttachFlags, + CSSM_MODULE_HANDLE ModuleHandle, + CSSM_KEY_HIERARCHY KeyHierarchy, + const CSSM_GUID *CssmGuid, + const CSSM_GUID *ModuleManagerGuid, + const CSSM_GUID *CallerGuid, + const CSSM_UPCALLS *Upcalls, + CSSM_MODULE_FUNCS_PTR *FuncTbl) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +CSSM_RETURN +CSSM_SPI_ModuleDetach (CSSM_MODULE_HANDLE ModuleHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + + +typedef struct cssm_spi_csp_funcs { + CSSM_RETURN ( *EventNotify) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CONTEXT_EVENT Event, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context); + CSSM_RETURN ( *QuerySize) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context, + CSSM_BOOL Encrypt, + uint32 QuerySizeCount, + CSSM_QUERY_SIZE_DATA_PTR DataBlock); + CSSM_RETURN ( *SignData) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context, + const CSSM_DATA *DataBufs, + uint32 DataBufCount, + CSSM_ALGORITHMS DigestAlgorithm, + CSSM_DATA_PTR Signature); + CSSM_RETURN ( *SignDataInit) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context); + CSSM_RETURN ( *SignDataUpdate) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *DataBufs, + uint32 DataBufCount); + CSSM_RETURN ( *SignDataFinal) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + CSSM_DATA_PTR Signature); + CSSM_RETURN ( *VerifyData) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context, + const CSSM_DATA *DataBufs, + uint32 DataBufCount, + CSSM_ALGORITHMS DigestAlgorithm, + const CSSM_DATA *Signature); + CSSM_RETURN ( *VerifyDataInit) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context); + CSSM_RETURN ( *VerifyDataUpdate) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *DataBufs, + uint32 DataBufCount); + CSSM_RETURN ( *VerifyDataFinal) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *Signature); + CSSM_RETURN ( *DigestData) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context, + const CSSM_DATA *DataBufs, + uint32 DataBufCount, + CSSM_DATA_PTR Digest); + CSSM_RETURN ( *DigestDataInit) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context); + CSSM_RETURN ( *DigestDataUpdate) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *DataBufs, + uint32 DataBufCount); + CSSM_RETURN ( *DigestDataClone) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + CSSM_CC_HANDLE ClonedCCHandle); + CSSM_RETURN ( *DigestDataFinal) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + CSSM_DATA_PTR Digest); + CSSM_RETURN ( *GenerateMac) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context, + const CSSM_DATA *DataBufs, + uint32 DataBufCount, + CSSM_DATA_PTR Mac); + CSSM_RETURN ( *GenerateMacInit) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context); + CSSM_RETURN ( *GenerateMacUpdate) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *DataBufs, + uint32 DataBufCount); + CSSM_RETURN ( *GenerateMacFinal) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + CSSM_DATA_PTR Mac); + CSSM_RETURN ( *VerifyMac) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context, + const CSSM_DATA *DataBufs, + uint32 DataBufCount, + const CSSM_DATA *Mac); + CSSM_RETURN ( *VerifyMacInit) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context); + CSSM_RETURN ( *VerifyMacUpdate) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *DataBufs, + uint32 DataBufCount); + CSSM_RETURN ( *VerifyMacFinal) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *Mac); + CSSM_RETURN ( *EncryptData) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context, + const CSSM_DATA *ClearBufs, + uint32 ClearBufCount, + CSSM_DATA_PTR CipherBufs, + uint32 CipherBufCount, + CSSM_SIZE *bytesEncrypted, + CSSM_DATA_PTR RemData, + CSSM_PRIVILEGE Privilege); + CSSM_RETURN ( *EncryptDataInit) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context, + CSSM_PRIVILEGE Privilege); + CSSM_RETURN ( *EncryptDataUpdate) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *ClearBufs, + uint32 ClearBufCount, + CSSM_DATA_PTR CipherBufs, + uint32 CipherBufCount, + CSSM_SIZE *bytesEncrypted); + CSSM_RETURN ( *EncryptDataFinal) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + CSSM_DATA_PTR RemData); + CSSM_RETURN ( *DecryptData) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context, + const CSSM_DATA *CipherBufs, + uint32 CipherBufCount, + CSSM_DATA_PTR ClearBufs, + uint32 ClearBufCount, + CSSM_SIZE *bytesDecrypted, + CSSM_DATA_PTR RemData, + CSSM_PRIVILEGE Privilege); + CSSM_RETURN ( *DecryptDataInit) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context, + CSSM_PRIVILEGE Privilege); + CSSM_RETURN ( *DecryptDataUpdate) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *CipherBufs, + uint32 CipherBufCount, + CSSM_DATA_PTR ClearBufs, + uint32 ClearBufCount, + CSSM_SIZE *bytesDecrypted); + CSSM_RETURN ( *DecryptDataFinal) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + CSSM_DATA_PTR RemData); + CSSM_RETURN ( *QueryKeySizeInBits) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context, + const CSSM_KEY *Key, + CSSM_KEY_SIZE_PTR KeySize); + CSSM_RETURN ( *GenerateKey) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context, + uint32 KeyUsage, + uint32 KeyAttr, + const CSSM_DATA *KeyLabel, + const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry, + CSSM_KEY_PTR Key, + CSSM_PRIVILEGE Privilege); + CSSM_RETURN ( *GenerateKeyPair) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context, + uint32 PublicKeyUsage, + uint32 PublicKeyAttr, + const CSSM_DATA *PublicKeyLabel, + CSSM_KEY_PTR PublicKey, + uint32 PrivateKeyUsage, + uint32 PrivateKeyAttr, + const CSSM_DATA *PrivateKeyLabel, + const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry, + CSSM_KEY_PTR PrivateKey, + CSSM_PRIVILEGE Privilege); + CSSM_RETURN ( *GenerateRandom) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context, + CSSM_DATA_PTR RandomNumber); + CSSM_RETURN ( *GenerateAlgorithmParams) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context, + uint32 ParamBits, + CSSM_DATA_PTR Param, + uint32 *NumberOfUpdatedAttibutes, + CSSM_CONTEXT_ATTRIBUTE_PTR *UpdatedAttributes); + CSSM_RETURN ( *WrapKey) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const CSSM_KEY *Key, + const CSSM_DATA *DescriptiveData, + CSSM_WRAP_KEY_PTR WrappedKey, + CSSM_PRIVILEGE Privilege); + CSSM_RETURN ( *UnwrapKey) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context, + const CSSM_KEY *PublicKey, + const CSSM_WRAP_KEY *WrappedKey, + uint32 KeyUsage, + uint32 KeyAttr, + const CSSM_DATA *KeyLabel, + const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry, + CSSM_KEY_PTR UnwrappedKey, + CSSM_DATA_PTR DescriptiveData, + CSSM_PRIVILEGE Privilege); + CSSM_RETURN ( *DeriveKey) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context, + CSSM_DATA_PTR Param, + uint32 KeyUsage, + uint32 KeyAttr, + const CSSM_DATA *KeyLabel, + const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry, + CSSM_KEY_PTR DerivedKey); + CSSM_RETURN ( *FreeKey) + (CSSM_CSP_HANDLE CSPHandle, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + CSSM_KEY_PTR KeyPtr, + CSSM_BOOL Delete); + CSSM_RETURN ( *PassThrough) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_CONTEXT *Context, + uint32 PassThroughId, + const void *InData, + void **OutData); + CSSM_RETURN ( *Login) + (CSSM_CSP_HANDLE CSPHandle, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const CSSM_DATA *LoginName, + const void *Reserved); + CSSM_RETURN ( *Logout) + (CSSM_CSP_HANDLE CSPHandle); + CSSM_RETURN ( *ChangeLoginAcl) + (CSSM_CSP_HANDLE CSPHandle, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const CSSM_ACL_EDIT *AclEdit); + CSSM_RETURN ( *ObtainPrivateKeyFromPublicKey) + (CSSM_CSP_HANDLE CSPHandle, + const CSSM_KEY *PublicKey, + CSSM_KEY_PTR PrivateKey); + CSSM_RETURN ( *RetrieveUniqueId) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_DATA_PTR UniqueID); + CSSM_RETURN ( *RetrieveCounter) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_DATA_PTR Counter); + CSSM_RETURN ( *VerifyDevice) + (CSSM_CSP_HANDLE CSPHandle, + const CSSM_DATA *DeviceCert); + CSSM_RETURN ( *GetTimeValue) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_ALGORITHMS TimeAlgorithm, + CSSM_DATA *TimeData); + CSSM_RETURN ( *GetOperationalStatistics) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_CSP_OPERATIONAL_STATISTICS *Statistics); + CSSM_RETURN ( *GetLoginAcl) + (CSSM_CSP_HANDLE CSPHandle, + const CSSM_STRING *SelectionTag, + uint32 *NumberOfAclInfos, + CSSM_ACL_ENTRY_INFO_PTR *AclInfos); + CSSM_RETURN ( *GetKeyAcl) + (CSSM_CSP_HANDLE CSPHandle, + const CSSM_KEY *Key, + const CSSM_STRING *SelectionTag, + uint32 *NumberOfAclInfos, + CSSM_ACL_ENTRY_INFO_PTR *AclInfos); + CSSM_RETURN ( *ChangeKeyAcl) + (CSSM_CSP_HANDLE CSPHandle, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const CSSM_ACL_EDIT *AclEdit, + const CSSM_KEY *Key); + CSSM_RETURN ( *GetKeyOwner) + (CSSM_CSP_HANDLE CSPHandle, + const CSSM_KEY *Key, + CSSM_ACL_OWNER_PROTOTYPE_PTR Owner); + CSSM_RETURN ( *ChangeKeyOwner) + (CSSM_CSP_HANDLE CSPHandle, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const CSSM_KEY *Key, + const CSSM_ACL_OWNER_PROTOTYPE *NewOwner); + CSSM_RETURN ( *GetLoginOwner) + (CSSM_CSP_HANDLE CSPHandle, + CSSM_ACL_OWNER_PROTOTYPE_PTR Owner); + CSSM_RETURN ( *ChangeLoginOwner) + (CSSM_CSP_HANDLE CSPHandle, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const CSSM_ACL_OWNER_PROTOTYPE *NewOwner); +} CSSM_SPI_CSP_FUNCS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_SPI_CSP_FUNCS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + +typedef struct cssm_spi_dl_funcs { + CSSM_RETURN ( *DbOpen) + (CSSM_DL_HANDLE DLHandle, + const char *DbName, + const CSSM_NET_ADDRESS *DbLocation, + CSSM_DB_ACCESS_TYPE AccessRequest, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const void *OpenParameters, + CSSM_DB_HANDLE *DbHandle); + CSSM_RETURN ( *DbClose) + (CSSM_DL_DB_HANDLE DLDBHandle); + CSSM_RETURN ( *DbCreate) + (CSSM_DL_HANDLE DLHandle, + const char *DbName, + const CSSM_NET_ADDRESS *DbLocation, + const CSSM_DBINFO *DBInfo, + CSSM_DB_ACCESS_TYPE AccessRequest, + const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry, + const void *OpenParameters, + CSSM_DB_HANDLE *DbHandle); + CSSM_RETURN ( *DbDelete) + (CSSM_DL_HANDLE DLHandle, + const char *DbName, + const CSSM_NET_ADDRESS *DbLocation, + const CSSM_ACCESS_CREDENTIALS *AccessCred); + CSSM_RETURN ( *CreateRelation) + (CSSM_DL_DB_HANDLE DLDBHandle, + CSSM_DB_RECORDTYPE RelationID, + const char *RelationName, + uint32 NumberOfAttributes, + const CSSM_DB_SCHEMA_ATTRIBUTE_INFO *pAttributeInfo, + uint32 NumberOfIndexes, + const CSSM_DB_SCHEMA_INDEX_INFO *pIndexInfo); + CSSM_RETURN ( *DestroyRelation) + (CSSM_DL_DB_HANDLE DLDBHandle, + CSSM_DB_RECORDTYPE RelationID); + CSSM_RETURN ( *Authenticate) + (CSSM_DL_DB_HANDLE DLDBHandle, + CSSM_DB_ACCESS_TYPE AccessRequest, + const CSSM_ACCESS_CREDENTIALS *AccessCred); + CSSM_RETURN ( *GetDbAcl) + (CSSM_DL_DB_HANDLE DLDBHandle, + const CSSM_STRING *SelectionTag, + uint32 *NumberOfAclInfos, + CSSM_ACL_ENTRY_INFO_PTR *AclInfos); + CSSM_RETURN ( *ChangeDbAcl) + (CSSM_DL_DB_HANDLE DLDBHandle, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const CSSM_ACL_EDIT *AclEdit); + CSSM_RETURN ( *GetDbOwner) + (CSSM_DL_DB_HANDLE DLDBHandle, + CSSM_ACL_OWNER_PROTOTYPE_PTR Owner); + CSSM_RETURN ( *ChangeDbOwner) + (CSSM_DL_DB_HANDLE DLDBHandle, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const CSSM_ACL_OWNER_PROTOTYPE *NewOwner); + CSSM_RETURN ( *GetDbNames) + (CSSM_DL_HANDLE DLHandle, + CSSM_NAME_LIST_PTR *NameList); + CSSM_RETURN ( *GetDbNameFromHandle) + (CSSM_DL_DB_HANDLE DLDBHandle, + char **DbName); + CSSM_RETURN ( *FreeNameList) + (CSSM_DL_HANDLE DLHandle, + CSSM_NAME_LIST_PTR NameList); + CSSM_RETURN ( *DataInsert) + (CSSM_DL_DB_HANDLE DLDBHandle, + CSSM_DB_RECORDTYPE RecordType, + const CSSM_DB_RECORD_ATTRIBUTE_DATA *Attributes, + const CSSM_DATA *Data, + CSSM_DB_UNIQUE_RECORD_PTR *UniqueId); + CSSM_RETURN ( *DataDelete) + (CSSM_DL_DB_HANDLE DLDBHandle, + const CSSM_DB_UNIQUE_RECORD *UniqueRecordIdentifier); + CSSM_RETURN ( *DataModify) + (CSSM_DL_DB_HANDLE DLDBHandle, + CSSM_DB_RECORDTYPE RecordType, + CSSM_DB_UNIQUE_RECORD_PTR UniqueRecordIdentifier, + const CSSM_DB_RECORD_ATTRIBUTE_DATA *AttributesToBeModified, + const CSSM_DATA *DataToBeModified, + CSSM_DB_MODIFY_MODE ModifyMode); + CSSM_RETURN ( *DataGetFirst) + (CSSM_DL_DB_HANDLE DLDBHandle, + const CSSM_QUERY *Query, + CSSM_HANDLE_PTR ResultsHandle, + CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes, + CSSM_DATA_PTR Data, + CSSM_DB_UNIQUE_RECORD_PTR *UniqueId); + CSSM_RETURN ( *DataGetNext) + (CSSM_DL_DB_HANDLE DLDBHandle, + CSSM_HANDLE ResultsHandle, + CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes, + CSSM_DATA_PTR Data, + CSSM_DB_UNIQUE_RECORD_PTR *UniqueId); + CSSM_RETURN ( *DataAbortQuery) + (CSSM_DL_DB_HANDLE DLDBHandle, + CSSM_HANDLE ResultsHandle); + CSSM_RETURN ( *DataGetFromUniqueRecordId) + (CSSM_DL_DB_HANDLE DLDBHandle, + const CSSM_DB_UNIQUE_RECORD *UniqueRecord, + CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes, + CSSM_DATA_PTR Data); + CSSM_RETURN ( *FreeUniqueRecord) + (CSSM_DL_DB_HANDLE DLDBHandle, + CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord); + CSSM_RETURN ( *PassThrough) + (CSSM_DL_DB_HANDLE DLDBHandle, + uint32 PassThroughId, + const void *InputParams, + void **OutputParams); +} CSSM_SPI_DL_FUNCS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_SPI_DL_FUNCS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + +typedef uint32 CSSM_KRSP_HANDLE; + +typedef struct cssm_kr_name { + uint8 Type; + uint8 Length; + char *Name; +} CSSM_KR_NAME __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_kr_profile { + CSSM_KR_NAME UserName; + CSSM_CERTGROUP_PTR UserCertificate; + CSSM_CERTGROUP_PTR KRSCertChain; + uint8 LE_KRANum; + CSSM_CERTGROUP_PTR LE_KRACertChainList; + uint8 ENT_KRANum; + CSSM_CERTGROUP_PTR ENT_KRACertChainList; + uint8 INDIV_KRANum; + CSSM_CERTGROUP_PTR INDIV_KRACertChainList; + CSSM_DATA_PTR INDIV_AuthenticationInfo; + uint32 KRSPFlags; + CSSM_DATA_PTR KRSPExtensions; +} CSSM_KR_PROFILE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_KR_PROFILE_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_kr_wrappedproductinfo { + CSSM_VERSION StandardVersion; + CSSM_STRING StandardDescription; + CSSM_VERSION ProductVersion; + CSSM_STRING ProductDescription; + CSSM_STRING ProductVendor; + uint32 ProductFlags; +} CSSM_KR_WRAPPEDPRODUCT_INFO __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_KR_WRAPPEDPRODUCT_INFO_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_krsubservice { + uint32 SubServiceId; + char *Description; + CSSM_KR_WRAPPEDPRODUCT_INFO WrappedProduct; +} CSSM_KRSUBSERVICE, *CSSM_KRSUBSERVICE_PTR; + +typedef uint32 CSSM_KR_POLICY_TYPE; + + + + + +typedef uint32 CSSM_KR_POLICY_FLAGS; +typedef struct cssm_kr_policy_list_item { + struct kr_policy_list_item *next; + CSSM_ALGORITHMS AlgorithmId; + CSSM_ENCRYPT_MODE Mode; + uint32 MaxKeyLength; + uint32 MaxRounds; + uint8 WorkFactor; + CSSM_KR_POLICY_FLAGS PolicyFlags; + CSSM_CONTEXT_TYPE AlgClass; +} CSSM_KR_POLICY_LIST_ITEM __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_KR_POLICY_LIST_ITEM_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_kr_policy_info { + CSSM_BOOL krbNotAllowed; + uint32 numberOfEntries; + CSSM_KR_POLICY_LIST_ITEM *policyEntry; +} CSSM_KR_POLICY_INFO __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_KR_POLICY_INFO_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + +CSSM_RETURN +CSSM_KR_SetEnterpriseRecoveryPolicy (const CSSM_DATA *RecoveryPolicyFileName, + const CSSM_ACCESS_CREDENTIALS *OldPassPhrase, + const CSSM_ACCESS_CREDENTIALS *NewPassPhrase) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + +CSSM_RETURN +CSSM_KR_CreateRecoveryRegistrationContext (CSSM_KRSP_HANDLE KRSPHandle, + CSSM_CC_HANDLE *NewContext) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +CSSM_RETURN +CSSM_KR_CreateRecoveryEnablementContext (CSSM_KRSP_HANDLE KRSPHandle, + const CSSM_KR_PROFILE *LocalProfile, + const CSSM_KR_PROFILE *RemoteProfile, + CSSM_CC_HANDLE *NewContext) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +CSSM_RETURN +CSSM_KR_CreateRecoveryRequestContext (CSSM_KRSP_HANDLE KRSPHandle, + const CSSM_KR_PROFILE *LocalProfile, + CSSM_CC_HANDLE *NewContext) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +CSSM_RETURN +CSSM_KR_GetPolicyInfo (CSSM_CC_HANDLE CCHandle, + CSSM_KR_POLICY_FLAGS *EncryptionProhibited, + uint32 *WorkFactor) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + +CSSM_RETURN +CSSM_KR_RegistrationRequest (CSSM_CC_HANDLE RecoveryRegistrationContext, + const CSSM_DATA *KRInData, + const CSSM_ACCESS_CREDENTIALS *AccessCredentials, + CSSM_KR_POLICY_FLAGS KRFlags, + sint32 *EstimatedTime, + CSSM_HANDLE_PTR ReferenceHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +CSSM_RETURN +CSSM_KR_RegistrationRetrieve (CSSM_KRSP_HANDLE KRSPHandle, + CSSM_HANDLE ReferenceHandle, + const CSSM_ACCESS_CREDENTIALS *AccessCredentials, + sint32 *EstimatedTime, + CSSM_KR_PROFILE_PTR KRProfile) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + +CSSM_RETURN +CSSM_KR_GenerateRecoveryFields (CSSM_CC_HANDLE KeyRecoveryContext, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *KRSPOptions, + CSSM_KR_POLICY_FLAGS KRFlags, + CSSM_DATA_PTR KRFields, + CSSM_CC_HANDLE *NewCCHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +CSSM_RETURN +CSSM_KR_ProcessRecoveryFields (CSSM_CC_HANDLE KeyRecoveryContext, + CSSM_CC_HANDLE CryptoContext, + const CSSM_DATA *KRSPOptions, + CSSM_KR_POLICY_FLAGS KRFlags, + const CSSM_DATA *KRFields, + CSSM_CC_HANDLE *NewCryptoContext) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + +CSSM_RETURN +CSSM_KR_RecoveryRequest (CSSM_CC_HANDLE RecoveryRequestContext, + const CSSM_DATA *KRInData, + const CSSM_ACCESS_CREDENTIALS *AccessCredentials, + sint32 *EstimatedTime, + CSSM_HANDLE_PTR ReferenceHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +CSSM_RETURN +CSSM_KR_RecoveryRetrieve (CSSM_KRSP_HANDLE KRSPHandle, + CSSM_HANDLE ReferenceHandle, + const CSSM_ACCESS_CREDENTIALS *AccessCredentials, + sint32 *EstimatedTime, + CSSM_HANDLE_PTR CacheHandle, + uint32 *NumberOfRecoveredKeys) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +CSSM_RETURN +CSSM_KR_GetRecoveredObject (CSSM_KRSP_HANDLE KRSPHandle, + CSSM_HANDLE CacheHandle, + uint32 IndexInResults, + CSSM_CSP_HANDLE CSPHandle, + const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry, + uint32 Flags, + CSSM_KEY_PTR RecoveredKey, + CSSM_DATA_PTR OtherInfo) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +CSSM_RETURN +CSSM_KR_RecoveryRequestAbort (CSSM_KRSP_HANDLE KRSPHandle, + CSSM_HANDLE CacheHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +CSSM_RETURN +CSSM_KR_QueryPolicyInfo (CSSM_KRSP_HANDLE KRSPHandle, + CSSM_ALGORITHMS AlgorithmID, + CSSM_ENCRYPT_MODE Mode, + CSSM_CONTEXT_TYPE Class, + CSSM_KR_POLICY_INFO_PTR *PolicyInfoData) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + +CSSM_RETURN +CSSM_KR_PassThrough (CSSM_KRSP_HANDLE KRSPHandle, + CSSM_CC_HANDLE KeyRecoveryContext, + CSSM_CC_HANDLE CryptoContext, + uint32 PassThroughId, + const void *InputParams, + void **OutputParams) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + +typedef struct cssm_spi_kr_funcs { + CSSM_RETURN ( *RegistrationRequest) + (CSSM_KRSP_HANDLE KRSPHandle, + CSSM_CC_HANDLE KRRegistrationContextHandle, + const CSSM_CONTEXT *KRRegistrationContext, + const CSSM_DATA *KRInData, + const CSSM_ACCESS_CREDENTIALS *AccessCredentials, + CSSM_KR_POLICY_FLAGS KRFlags, + sint32 *EstimatedTime, + CSSM_HANDLE_PTR ReferenceHandle); + CSSM_RETURN ( *RegistrationRetrieve) + (CSSM_KRSP_HANDLE KRSPHandle, + CSSM_HANDLE ReferenceHandle, + sint32 *EstimatedTime, + CSSM_KR_PROFILE_PTR KRProfile); + CSSM_RETURN ( *GenerateRecoveryFields) + (CSSM_KRSP_HANDLE KRSPHandle, + CSSM_CC_HANDLE KREnablementContextHandle, + const CSSM_CONTEXT *KREnablementContext, + CSSM_CC_HANDLE CryptoContextHandle, + const CSSM_CONTEXT *CryptoContext, + const CSSM_DATA *KRSPOptions, + CSSM_KR_POLICY_FLAGS KRFlags, + CSSM_DATA_PTR KRFields); + CSSM_RETURN ( *ProcessRecoveryFields) + (CSSM_KRSP_HANDLE KRSPHandle, + CSSM_CC_HANDLE KREnablementContextHandle, + const CSSM_CONTEXT *KREnablementContext, + CSSM_CC_HANDLE CryptoContextHandle, + const CSSM_CONTEXT *CryptoContext, + const CSSM_DATA *KRSPOptions, + CSSM_KR_POLICY_FLAGS KRFlags, + const CSSM_DATA *KRFields); + CSSM_RETURN ( *RecoveryRequest) + (CSSM_KRSP_HANDLE KRSPHandle, + CSSM_CC_HANDLE KRRequestContextHandle, + const CSSM_CONTEXT *KRRequestContext, + const CSSM_DATA *KRInData, + const CSSM_ACCESS_CREDENTIALS *AccessCredentials, + sint32 *EstimatedTime, + CSSM_HANDLE_PTR ReferenceHandle); + CSSM_RETURN ( *RecoveryRetrieve) + (CSSM_KRSP_HANDLE KRSPHandle, + CSSM_HANDLE ReferenceHandle, + sint32 *EstimatedTime, + CSSM_HANDLE_PTR CacheHandle, + uint32 *NumberOfRecoveredKeys); + CSSM_RETURN ( *GetRecoveredObject) + (CSSM_KRSP_HANDLE KRSPHandle, + CSSM_HANDLE CacheHandle, + uint32 IndexInResults, + CSSM_CSP_HANDLE CSPHandle, + const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry, + uint32 Flags, + CSSM_KEY_PTR RecoveredKey, + CSSM_DATA_PTR OtherInfo); + CSSM_RETURN ( *RecoveryRequestAbort) + (CSSM_KRSP_HANDLE KRSPHandle, + CSSM_HANDLE ResultsHandle); + CSSM_RETURN ( *PassThrough) + (CSSM_KRSP_HANDLE KRSPHandle, + CSSM_CC_HANDLE KeyRecoveryContextHandle, + const CSSM_CONTEXT *KeyRecoveryContext, + CSSM_CC_HANDLE CryptoContextHandle, + const CSSM_CONTEXT *CryptoContext, + uint32 PassThroughId, + const void *InputParams, + void **OutputParams); +} CSSM_SPI_KR_FUNCS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_SPI_KR_FUNCS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + +typedef struct cssm_spi_tp_funcs { + CSSM_RETURN ( *SubmitCredRequest) + (CSSM_TP_HANDLE TPHandle, + const CSSM_TP_AUTHORITY_ID *PreferredAuthority, + CSSM_TP_AUTHORITY_REQUEST_TYPE RequestType, + const CSSM_TP_REQUEST_SET *RequestInput, + const CSSM_TP_CALLERAUTH_CONTEXT *CallerAuthContext, + sint32 *EstimatedTime, + CSSM_DATA_PTR ReferenceIdentifier); + CSSM_RETURN ( *RetrieveCredResult) + (CSSM_TP_HANDLE TPHandle, + const CSSM_DATA *ReferenceIdentifier, + const CSSM_TP_CALLERAUTH_CONTEXT *CallerAuthCredentials, + sint32 *EstimatedTime, + CSSM_BOOL *ConfirmationRequired, + CSSM_TP_RESULT_SET_PTR *RetrieveOutput); + CSSM_RETURN ( *ConfirmCredResult) + (CSSM_TP_HANDLE TPHandle, + const CSSM_DATA *ReferenceIdentifier, + const CSSM_TP_CALLERAUTH_CONTEXT *CallerAuthCredentials, + const CSSM_TP_CONFIRM_RESPONSE *Responses, + const CSSM_TP_AUTHORITY_ID *PreferredAuthority); + CSSM_RETURN ( *ReceiveConfirmation) + (CSSM_TP_HANDLE TPHandle, + const CSSM_DATA *ReferenceIdentifier, + CSSM_TP_CONFIRM_RESPONSE_PTR *Responses, + sint32 *ElapsedTime); + CSSM_RETURN ( *CertReclaimKey) + (CSSM_TP_HANDLE TPHandle, + const CSSM_CERTGROUP *CertGroup, + uint32 CertIndex, + CSSM_LONG_HANDLE KeyCacheHandle, + CSSM_CSP_HANDLE CSPHandle, + const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry); + CSSM_RETURN ( *CertReclaimAbort) + (CSSM_TP_HANDLE TPHandle, + CSSM_LONG_HANDLE KeyCacheHandle); + CSSM_RETURN ( *FormRequest) + (CSSM_TP_HANDLE TPHandle, + const CSSM_TP_AUTHORITY_ID *PreferredAuthority, + CSSM_TP_FORM_TYPE FormType, + CSSM_DATA_PTR BlankForm); + CSSM_RETURN ( *FormSubmit) + (CSSM_TP_HANDLE TPHandle, + CSSM_TP_FORM_TYPE FormType, + const CSSM_DATA *Form, + const CSSM_TP_AUTHORITY_ID *ClearanceAuthority, + const CSSM_TP_AUTHORITY_ID *RepresentedAuthority, + CSSM_ACCESS_CREDENTIALS_PTR Credentials); + CSSM_RETURN ( *CertGroupVerify) + (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + CSSM_CSP_HANDLE CSPHandle, + const CSSM_CERTGROUP *CertGroupToBeVerified, + const CSSM_TP_VERIFY_CONTEXT *VerifyContext, + CSSM_TP_VERIFY_CONTEXT_RESULT_PTR VerifyContextResult); + CSSM_RETURN ( *CertCreateTemplate) + (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + uint32 NumberOfFields, + const CSSM_FIELD *CertFields, + CSSM_DATA_PTR CertTemplate); + CSSM_RETURN ( *CertGetAllTemplateFields) + (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + const CSSM_DATA *CertTemplate, + uint32 *NumberOfFields, + CSSM_FIELD_PTR *CertFields); + CSSM_RETURN ( *CertSign) + (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DATA *CertTemplateToBeSigned, + const CSSM_CERTGROUP *SignerCertGroup, + const CSSM_TP_VERIFY_CONTEXT *SignerVerifyContext, + CSSM_TP_VERIFY_CONTEXT_RESULT_PTR SignerVerifyResult, + CSSM_DATA_PTR SignedCert); + CSSM_RETURN ( *CrlVerify) + (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + CSSM_CSP_HANDLE CSPHandle, + const CSSM_ENCODED_CRL *CrlToBeVerified, + const CSSM_CERTGROUP *SignerCertGroup, + const CSSM_TP_VERIFY_CONTEXT *VerifyContext, + CSSM_TP_VERIFY_CONTEXT_RESULT_PTR RevokerVerifyResult); + CSSM_RETURN ( *CrlCreateTemplate) + (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + uint32 NumberOfFields, + const CSSM_FIELD *CrlFields, + CSSM_DATA_PTR NewCrlTemplate); + CSSM_RETURN ( *CertRevoke) + (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + CSSM_CSP_HANDLE CSPHandle, + const CSSM_DATA *OldCrlTemplate, + const CSSM_CERTGROUP *CertGroupToBeRevoked, + const CSSM_CERTGROUP *RevokerCertGroup, + const CSSM_TP_VERIFY_CONTEXT *RevokerVerifyContext, + CSSM_TP_VERIFY_CONTEXT_RESULT_PTR RevokerVerifyResult, + CSSM_TP_CERTCHANGE_REASON Reason, + CSSM_DATA_PTR NewCrlTemplate); + CSSM_RETURN ( *CertRemoveFromCrlTemplate) + (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + CSSM_CSP_HANDLE CSPHandle, + const CSSM_DATA *OldCrlTemplate, + const CSSM_CERTGROUP *CertGroupToBeRemoved, + const CSSM_CERTGROUP *RevokerCertGroup, + const CSSM_TP_VERIFY_CONTEXT *RevokerVerifyContext, + CSSM_TP_VERIFY_CONTEXT_RESULT_PTR RevokerVerifyResult, + CSSM_DATA_PTR NewCrlTemplate); + CSSM_RETURN ( *CrlSign) + (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_ENCODED_CRL *CrlToBeSigned, + const CSSM_CERTGROUP *SignerCertGroup, + const CSSM_TP_VERIFY_CONTEXT *SignerVerifyContext, + CSSM_TP_VERIFY_CONTEXT_RESULT_PTR SignerVerifyResult, + CSSM_DATA_PTR SignedCrl); + CSSM_RETURN ( *ApplyCrlToDb) + (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + CSSM_CSP_HANDLE CSPHandle, + const CSSM_ENCODED_CRL *CrlToBeApplied, + const CSSM_CERTGROUP *SignerCertGroup, + const CSSM_TP_VERIFY_CONTEXT *ApplyCrlVerifyContext, + CSSM_TP_VERIFY_CONTEXT_RESULT_PTR ApplyCrlVerifyResult); + CSSM_RETURN ( *CertGroupConstruct) + (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + CSSM_CSP_HANDLE CSPHandle, + const CSSM_DL_DB_LIST *DBList, + const void *ConstructParams, + const CSSM_CERTGROUP *CertGroupFrag, + CSSM_CERTGROUP_PTR *CertGroup); + CSSM_RETURN ( *CertGroupPrune) + (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + const CSSM_DL_DB_LIST *DBList, + const CSSM_CERTGROUP *OrderedCertGroup, + CSSM_CERTGROUP_PTR *PrunedCertGroup); + CSSM_RETURN ( *CertGroupToTupleGroup) + (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + const CSSM_CERTGROUP *CertGroup, + CSSM_TUPLEGROUP_PTR *TupleGroup); + CSSM_RETURN ( *TupleGroupToCertGroup) + (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + const CSSM_TUPLEGROUP *TupleGroup, + CSSM_CERTGROUP_PTR *CertTemplates); + CSSM_RETURN ( *PassThrough) + (CSSM_TP_HANDLE TPHandle, + CSSM_CL_HANDLE CLHandle, + CSSM_CC_HANDLE CCHandle, + const CSSM_DL_DB_LIST *DBList, + uint32 PassThroughId, + const void *InputParams, + void **OutputParams); +} CSSM_SPI_TP_FUNCS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_SPI_TP_FUNCS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + +typedef struct cssm_state_funcs { + CSSM_RETURN ( *cssm_GetAttachFunctions) + (CSSM_MODULE_HANDLE hAddIn, + CSSM_SERVICE_MASK AddinType, + void **SPFunctions, + CSSM_GUID_PTR Guid, + CSSM_BOOL *Serialized); + CSSM_RETURN ( *cssm_ReleaseAttachFunctions) + (CSSM_MODULE_HANDLE hAddIn); + CSSM_RETURN ( *cssm_GetAppMemoryFunctions) + (CSSM_MODULE_HANDLE hAddIn, + CSSM_UPCALLS_PTR UpcallTable); + CSSM_RETURN ( *cssm_IsFuncCallValid) + (CSSM_MODULE_HANDLE hAddin, + CSSM_PROC_ADDR SrcAddress, + CSSM_PROC_ADDR DestAddress, + CSSM_PRIVILEGE InPriv, + CSSM_PRIVILEGE *OutPriv, + CSSM_BITMASK Hints, + CSSM_BOOL *IsOK); + CSSM_RETURN ( *cssm_DeregisterManagerServices) + (const CSSM_GUID *GUID); + CSSM_RETURN ( *cssm_DeliverModuleManagerEvent) + (const CSSM_MANAGER_EVENT_NOTIFICATION *EventDescription); +} CSSM_STATE_FUNCS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_STATE_FUNCS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef struct cssm_manager_registration_info { + + CSSM_RETURN ( *Initialize) + (uint32 VerMajor, + uint32 VerMinor); + CSSM_RETURN ( *Terminate) (void); + CSSM_RETURN ( *RegisterDispatchTable) + (CSSM_STATE_FUNCS_PTR CssmStateCallTable); + CSSM_RETURN ( *DeregisterDispatchTable) (void); + CSSM_RETURN ( *EventNotifyManager) + (const CSSM_MANAGER_EVENT_NOTIFICATION *EventDescription); + CSSM_RETURN ( *RefreshFunctionTable) + (CSSM_FUNC_NAME_ADDR_PTR FuncNameAddrPtr, + uint32 NumOfFuncNameAddr); +} CSSM_MANAGER_REGISTRATION_INFO __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *CSSM_MANAGER_REGISTRATION_INFO_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +enum { + CSSM_HINT_NONE = 0, + CSSM_HINT_ADDRESS_APP = 1 << 0, + CSSM_HINT_ADDRESS_SP = 1 << 1 +}; + +CSSM_RETURN +ModuleManagerAuthenticate (CSSM_KEY_HIERARCHY KeyHierarchy, + const CSSM_GUID *CssmGuid, + const CSSM_GUID *AppGuid, + CSSM_MANAGER_REGISTRATION_INFO_PTR FunctionTable) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + +typedef CSSM_DL_HANDLE MDS_HANDLE; + +typedef CSSM_DL_DB_HANDLE MDS_DB_HANDLE; + +typedef struct mds_funcs { + CSSM_RETURN ( *DbOpen) + (MDS_HANDLE MdsHandle, + const char *DbName, + const CSSM_NET_ADDRESS *DbLocation, + CSSM_DB_ACCESS_TYPE AccessRequest, + const CSSM_ACCESS_CREDENTIALS *AccessCred, + const void *OpenParameters, + CSSM_DB_HANDLE *hMds); + + CSSM_RETURN ( *DbClose) + (MDS_DB_HANDLE MdsDbHandle); + + CSSM_RETURN ( *GetDbNames) + (MDS_HANDLE MdsHandle, + CSSM_NAME_LIST_PTR *NameList); + + CSSM_RETURN ( *GetDbNameFromHandle) + (MDS_DB_HANDLE MdsDbHandle, + char **DbName); + + CSSM_RETURN ( *FreeNameList) + (MDS_HANDLE MdsHandle, + CSSM_NAME_LIST_PTR NameList); + + CSSM_RETURN ( *DataInsert) + (MDS_DB_HANDLE MdsDbHandle, + CSSM_DB_RECORDTYPE RecordType, + const CSSM_DB_RECORD_ATTRIBUTE_DATA *Attributes, + const CSSM_DATA *Data, + CSSM_DB_UNIQUE_RECORD_PTR *UniqueId); + + CSSM_RETURN ( *DataDelete) + (MDS_DB_HANDLE MdsDbHandle, + const CSSM_DB_UNIQUE_RECORD *UniqueRecordIdentifier); + + CSSM_RETURN ( *DataModify) + (MDS_DB_HANDLE MdsDbHandle, + CSSM_DB_RECORDTYPE RecordType, + CSSM_DB_UNIQUE_RECORD_PTR UniqueRecordIdentifier, + const CSSM_DB_RECORD_ATTRIBUTE_DATA *AttributesToBeModified, + const CSSM_DATA *DataToBeModified, + CSSM_DB_MODIFY_MODE ModifyMode); + + CSSM_RETURN ( *DataGetFirst) + (MDS_DB_HANDLE MdsDbHandle, + const CSSM_QUERY *Query, + CSSM_HANDLE_PTR ResultsHandle, + CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes, + CSSM_DATA_PTR Data, + CSSM_DB_UNIQUE_RECORD_PTR *UniqueId); + + CSSM_RETURN ( *DataGetNext) + (MDS_DB_HANDLE MdsDbHandle, + CSSM_HANDLE ResultsHandle, + CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes, + CSSM_DATA_PTR Data, + CSSM_DB_UNIQUE_RECORD_PTR *UniqueId); + + CSSM_RETURN ( *DataAbortQuery) + (MDS_DB_HANDLE MdsDbHandle, + CSSM_HANDLE ResultsHandle); + + CSSM_RETURN ( *DataGetFromUniqueRecordId) + (MDS_DB_HANDLE MdsDbHandle, + const CSSM_DB_UNIQUE_RECORD *UniqueRecord, + CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes, + CSSM_DATA_PTR Data); + + CSSM_RETURN ( *FreeUniqueRecord) + (MDS_DB_HANDLE MdsDbHandle, + CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord); + + CSSM_RETURN ( *CreateRelation) + (MDS_DB_HANDLE MdsDbHandle, + CSSM_DB_RECORDTYPE RelationID, + const char *RelationName, + uint32 NumberOfAttributes, + const CSSM_DB_SCHEMA_ATTRIBUTE_INFO *pAttributeInfo, + uint32 NumberOfIndexes, + const CSSM_DB_SCHEMA_INDEX_INFO *pIndexInfo); + + CSSM_RETURN ( *DestroyRelation) + (MDS_DB_HANDLE MdsDbHandle, + CSSM_DB_RECORDTYPE RelationID); +} MDS_FUNCS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), *MDS_FUNCS_PTR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + +CSSM_RETURN +MDS_Initialize (const CSSM_GUID *pCallerGuid, + const CSSM_MEMORY_FUNCS *pMemoryFunctions, + MDS_FUNCS_PTR pDlFunctions, + MDS_HANDLE *hMds) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +CSSM_RETURN +MDS_Terminate (MDS_HANDLE MdsHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +CSSM_RETURN +MDS_Install (MDS_HANDLE MdsHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +CSSM_RETURN +MDS_Uninstall (MDS_HANDLE MdsHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +typedef CSSM_DATA SecAsn1Item; +typedef CSSM_OID SecAsn1Oid; +typedef CSSM_X509_ALGORITHM_IDENTIFIER SecAsn1AlgId; +typedef CSSM_X509_SUBJECT_PUBLIC_KEY_INFO SecAsn1PubKeyInfo; +typedef struct SecAsn1Template_struct { + + + + uint32_t kind; + + + + + + + + uint32_t offset; + const void *sub; + + + + + + + + uint32_t size; +} SecAsn1Template; +typedef const SecAsn1Template * SecAsn1TemplateChooser( + void *arg, + Boolean enc, + const char *buf, + size_t len, + void *dest); + +typedef SecAsn1TemplateChooser * SecAsn1TemplateChooserPtr; + + + + + + + + +extern const SecAsn1Oid + CSSMOID_MD2 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_MD4 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_MD5 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_RSA __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_MD2WithRSA __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_MD4WithRSA __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_MD5WithRSA __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SHA1WithRSA __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SHA224WithRSA __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SHA256WithRSA __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SHA384WithRSA __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SHA512WithRSA __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SHA1WithRSA_OIW __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_RSAWithOAEP __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_OAEP_MGF1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_OAEP_ID_PSPECIFIED __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DES_CBC __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ANSI_DH_PUB_NUMBER __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ANSI_DH_STATIC __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ANSI_DH_ONE_FLOW __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ANSI_DH_EPHEM __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ANSI_DH_HYBRID1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ANSI_DH_HYBRID2 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ANSI_DH_HYBRID_ONEFLOW __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ANSI_MQV1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ANSI_MQV2 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ANSI_DH_STATIC_SHA1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ANSI_DH_ONE_FLOW_SHA1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ANSI_DH_EPHEM_SHA1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ANSI_DH_HYBRID1_SHA1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ANSI_DH_HYBRID2_SHA1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ANSI_MQV1_SHA1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ANSI_MQV2_SHA1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS3 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DH __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DSA __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DSA_CMS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DSA_JDK __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SHA1WithDSA __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SHA1WithDSA_CMS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SHA1WithDSA_JDK __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SHA1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SHA224 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SHA256 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SHA384 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SHA512 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ecPublicKey __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ECDSA_WithSHA1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ECDSA_WithSHA224 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ECDSA_WithSHA256 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ECDSA_WithSHA384 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ECDSA_WithSHA512 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ECDSA_WithSpecified __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_ISIGN __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_X509_BASIC __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_SSL __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_LOCAL_CERT_GEN __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_CSR_GEN __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_REVOCATION_CRL __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_REVOCATION_OCSP __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_SMIME __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_EAP __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_CODE_SIGN __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_SW_UPDATE_SIGNING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_IP_SEC __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_ICHAT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_RESOURCE_SIGN __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_PKINIT_CLIENT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_PKINIT_SERVER __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_CODE_SIGNING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_PACKAGE_SIGNING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_MACAPPSTORE_RECEIPT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_APPLEID_SHARING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_TIMESTAMPING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_REVOCATION __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_PASSBOOK_SIGNING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_MOBILE_STORE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_ESCROW_SERVICE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_PROFILE_SIGNING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_QA_PROFILE_SIGNING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_TEST_MOBILE_STORE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_PCS_ESCROW_SERVICE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_TP_PROVISIONING_PROFILE_SIGNING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_FEE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_ASC __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_FEE_MD5 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_FEE_SHA1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_FEED __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_FEEDEXP __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_ECDSA __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DOTMAC_CERT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DOTMAC_CERT_REQ __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DOTMAC_CERT_REQ_IDENTITY __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DOTMAC_CERT_REQ_EMAIL_SIGN __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DOTMAC_CERT_REQ_EMAIL_ENCRYPT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DOTMAC_CERT_REQ_ARCHIVE_LIST __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DOTMAC_CERT_REQ_ARCHIVE_STORE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DOTMAC_CERT_REQ_ARCHIVE_FETCH __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DOTMAC_CERT_REQ_ARCHIVE_REMOVE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DOTMAC_CERT_REQ_SHARED_SERVICES __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DOTMAC_CERT_REQ_VALUE_USERNAME __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DOTMAC_CERT_REQ_VALUE_PASSWORD __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DOTMAC_CERT_REQ_VALUE_HOSTNAME __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DOTMAC_CERT_REQ_VALUE_RENEW __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DOTMAC_CERT_REQ_VALUE_ASYNC __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DOTMAC_CERT_REQ_VALUE_IS_PENDING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS5_DIGEST_ALG __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS5_ENCRYPT_ALG __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS5_HMAC_SHA1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS5_pbeWithMD2AndDES __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS5_pbeWithMD2AndRC2 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS5_pbeWithMD5AndDES __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS5_pbeWithMD5AndRC2 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS5_pbeWithSHA1AndDES __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS5_pbeWithSHA1AndRC2 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS5_PBKDF2 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS5_PBES2 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS5_PBMAC1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS5_RC2_CBC __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS5_DES_EDE3_CBC __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS5_RC5_CBC __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS12_pbeWithSHAAnd128BitRC4 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS12_pbeWithSHAAnd40BitRC4 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS12_pbeWithSHAAnd3Key3DESCBC __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS12_pbeWithSHAAnd2Key3DESCBC __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS12_pbeWithSHAAnd128BitRC2CBC __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS12_pbewithSHAAnd40BitRC2CBC __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + + +extern const SecAsn1Oid + CSSMOID_ObjectClass __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_AliasedEntryName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_KnowledgeInformation __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CommonName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_Surname __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SerialNumber __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CountryName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_LocalityName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_StateProvinceName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CollectiveStateProvinceName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_StreetAddress __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CollectiveStreetAddress __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_OrganizationName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CollectiveOrganizationName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_OrganizationalUnitName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CollectiveOrganizationalUnitName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_Title __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_Description __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SearchGuide __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_BusinessCategory __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PostalAddress __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CollectivePostalAddress __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PostalCode __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CollectivePostalCode __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PostOfficeBox __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CollectivePostOfficeBox __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PhysicalDeliveryOfficeName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CollectivePhysicalDeliveryOfficeName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_TelephoneNumber __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CollectiveTelephoneNumber __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_TelexNumber __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CollectiveTelexNumber __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_TelexTerminalIdentifier __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CollectiveTelexTerminalIdentifier __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_FacsimileTelephoneNumber __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CollectiveFacsimileTelephoneNumber __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X_121Address __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_InternationalISDNNumber __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CollectiveInternationalISDNNumber __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_RegisteredAddress __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DestinationIndicator __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PreferredDeliveryMethod __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PresentationAddress __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SupportedApplicationContext __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_Member __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_Owner __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_RoleOccupant __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SeeAlso __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_UserPassword __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_UserCertificate __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CACertificate __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_AuthorityRevocationList __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CertificateRevocationList __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CrossCertificatePair __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_Name __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_GivenName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_Initials __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_GenerationQualifier __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_UniqueIdentifier __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DNQualifier __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_EnhancedSearchGuide __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ProtocolInformation __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DistinguishedName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_UniqueMember __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_HouseIdentifier __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + +extern const SecAsn1Oid + CSSMOID_EmailAddress __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_UnstructuredName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ContentType __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_MessageDigest __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SigningTime __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CounterSignature __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ChallengePassword __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_UnstructuredAddress __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ExtendedCertificateAttributes __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +extern const SecAsn1Oid + CSSMOID_PKCS9_Id_Ct_TSTInfo __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS9_TimeStampToken __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + +extern const SecAsn1Oid + CSSMOID_QT_CPS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_QT_UNOTICE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_AD_OCSP __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_AD_CA_ISSUERS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_AD_TIME_STAMPING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_AD_CA_REPOSITORY __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PDA_DATE_OF_BIRTH __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PDA_PLACE_OF_BIRTH __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PDA_GENDER __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PDA_COUNTRY_CITIZEN __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PDA_COUNTRY_RESIDENCE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_OID_QCS_SYNTAX_V1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_OID_QCS_SYNTAX_V2 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + +extern const SecAsn1Oid + CSSMOID_ETSI_QCS_QC_COMPLIANCE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ETSI_QCS_QC_LIMIT_VALUE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ETSI_QCS_QC_RETENTION __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ETSI_QCS_QC_SSCD __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + +extern const SecAsn1Oid + CSSMOID_PKCS7_Data __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS7_SignedData __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS7_EnvelopedData __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS7_SignedAndEnvelopedData __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS7_DigestedData __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS7_EncryptedData __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS7_DataWithAttributes __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS7_EncryptedPrivateKeyInfo __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + + + CSSMOID_PKCS9_FriendlyName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS9_LocalKeyId __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS9_CertTypes __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS9_CrlTypes __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS9_X509Certificate __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS9_SdsiCertificate __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS9_X509Crl __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + + + CSSMOID_PKCS12_keyBag __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS12_shroudedKeyBag __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS12_certBag __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS12_crlBag __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS12_secretBag __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKCS12_safeContentsBag __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + + + CSSMOID_UserID __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + + + CSSMOID_DomainComponent __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + + + CSSMOID_KERBv5_PKINIT_AUTH_DATA __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_KERBv5_PKINIT_DH_KEY_DATA __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_KERBv5_PKINIT_RKEY_DATA __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + +extern const SecAsn1Oid + CSSMOID_X9_62 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X9_62_FieldType __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X9_62_PubKeyType __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X9_62_EllCurve __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X9_62_C_TwoCurve __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X9_62_PrimeCurve __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X9_62_SigType __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_secp192r1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_secp256r1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_Certicom __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CerticomEllCurve __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_secp112r1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_secp112r2 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_secp128r1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_secp128r2 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_secp160k1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_secp160r1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_secp160r2 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_secp192k1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_secp224k1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_secp224r1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_secp256k1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_secp384r1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_secp521r1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_sect113r1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_sect113r2 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_sect131r1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_sect131r2 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_sect163k1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_sect163r1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_sect163r2 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_sect193r1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_sect193r2 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_sect233k1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_sect233r1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_sect239k1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_sect283k1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_sect283r1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_sect409k1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_sect409r1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_sect571k1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_sect571r1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +extern const CSSM_OID + + CSSMOID_X509V3SignedCertificate __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V3SignedCertificateCStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V3Certificate __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V3CertificateCStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1Version __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1SerialNumber __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1IssuerName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1IssuerNameStd __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1IssuerNameCStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1IssuerNameLDAP __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1ValidityNotBefore __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1ValidityNotAfter __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1SubjectName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1SubjectNameStd __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1SubjectNameCStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1SubjectNameLDAP __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CSSMKeyStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1SubjectPublicKeyCStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1SubjectPublicKeyAlgorithm __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1SubjectPublicKeyAlgorithmParameters __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1SubjectPublicKey __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1CertificateIssuerUniqueId __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1CertificateSubjectUniqueId __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V3CertificateExtensionsStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V3CertificateExtensionsCStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V3CertificateNumberOfExtensions __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V3CertificateExtensionStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V3CertificateExtensionCStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V3CertificateExtensionId __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V3CertificateExtensionCritical __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V3CertificateExtensionType __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V3CertificateExtensionValue __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + + + CSSMOID_X509V1SignatureStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1SignatureCStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1SignatureAlgorithm __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1SignatureAlgorithmTBS __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1SignatureAlgorithmParameters __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1Signature __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + + + CSSMOID_SubjectSignatureBitmap __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SubjectPicture __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SubjectEmailAddress __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_UseExemptions __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern const CSSM_OID + CSSMOID_SubjectDirectoryAttributes __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SubjectKeyIdentifier __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_KeyUsage __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PrivateKeyUsagePeriod __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SubjectAltName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_IssuerAltName __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_BasicConstraints __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CrlNumber __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CrlReason __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_HoldInstructionCode __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_InvalidityDate __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DeltaCrlIndicator __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_IssuingDistributionPoint __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_IssuingDistributionPoints __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CertIssuer __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_NameConstraints __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CrlDistributionPoints __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_CertificatePolicies __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PolicyMappings __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PolicyConstraints __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_AuthorityKeyIdentifier __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ExtendedKeyUsage __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_InhibitAnyPolicy __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_AuthorityInfoAccess __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_BiometricInfo __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_QC_Statements __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_SubjectInfoAccess __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ExtendedKeyUsageAny __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ServerAuth __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ClientAuth __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ExtendedUseCodeSigning __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_EmailProtection __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_TimeStamping __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_OCSPSigning __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_KERBv5_PKINIT_KP_CLIENT_AUTH __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_KERBv5_PKINIT_KP_KDC __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_EKU_IPSec __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DOTMAC_CERT_EXTENSION __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DOTMAC_CERT_IDENTITY __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DOTMAC_CERT_EMAIL_SIGN __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DOTMAC_CERT_EMAIL_ENCRYPT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_CERT_POLICY __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_DOTMAC_CERT_POLICY __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_ADC_CERT_POLICY __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_MACAPPSTORE_CERT_POLICY __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_MACAPPSTORE_RECEIPT_CERT_POLICY __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLEID_CERT_POLICY __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLEID_SHARING_CERT_POLICY __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_MOBILE_STORE_SIGNING_POLICY __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_TEST_MOBILE_STORE_SIGNING_POLICY __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EKU_CODE_SIGNING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EKU_CODE_SIGNING_DEV __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EKU_RESOURCE_SIGNING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EKU_ICHAT_SIGNING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EKU_ICHAT_ENCRYPTION __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EKU_SYSTEM_IDENTITY __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EKU_PASSBOOK_SIGNING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EKU_PROFILE_SIGNING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EKU_QA_PROFILE_SIGNING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EXTENSION __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EXTENSION_CODE_SIGNING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EXTENSION_APPLE_SIGNING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EXTENSION_ADC_DEV_SIGNING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EXTENSION_ADC_APPLE_SIGNING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EXTENSION_PASSBOOK_SIGNING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EXTENSION_MACAPPSTORE_RECEIPT __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EXTENSION_INTERMEDIATE_MARKER __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EXTENSION_WWDR_INTERMEDIATE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EXTENSION_ITMS_INTERMEDIATE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EXTENSION_AAI_INTERMEDIATE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EXTENSION_APPLEID_INTERMEDIATE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EXTENSION_APPLEID_SHARING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EXTENSION_SYSINT2_INTERMEDIATE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EXTENSION_DEVELOPER_AUTHENTICATION __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EXTENSION_SERVER_AUTHENTICATION __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EXTENSION_ESCROW_SERVICE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_APPLE_EXTENSION_PROVISIONING_PROFILE_SIGNING __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))) +; + + + + +extern const CSSM_OID + CSSMOID_NetscapeCertType __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_NetscapeCertSequence __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_NetscapeSGC __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + +extern const CSSM_OID CSSMOID_MicrosoftSGC __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern const CSSM_OID + + CSSMOID_X509V2CRLSignedCrlStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V2CRLSignedCrlCStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V2CRLTbsCertListStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V2CRLTbsCertListCStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V2CRLVersion __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1CRLIssuerStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1CRLIssuerNameCStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1CRLIssuerNameLDAP __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1CRLThisUpdate __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1CRLNextUpdate __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + + + CSSMOID_X509V1CRLRevokedCertificatesStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1CRLRevokedCertificatesCStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1CRLNumberOfRevokedCertEntries __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1CRLRevokedEntryStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1CRLRevokedEntryCStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1CRLRevokedEntrySerialNumber __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V1CRLRevokedEntryRevocationDate __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + + + CSSMOID_X509V2CRLRevokedEntryAllExtensionsStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V2CRLRevokedEntryAllExtensionsCStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V2CRLRevokedEntryNumberOfExtensions __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V2CRLRevokedEntrySingleExtensionStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V2CRLRevokedEntrySingleExtensionCStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V2CRLRevokedEntryExtensionId __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V2CRLRevokedEntryExtensionCritical __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V2CRLRevokedEntryExtensionType __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V2CRLRevokedEntryExtensionValue __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + + + CSSMOID_X509V2CRLAllExtensionsStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V2CRLAllExtensionsCStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V2CRLNumberOfExtensions __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V2CRLSingleExtensionStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V2CRLSingleExtensionCStruct __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V2CRLExtensionId __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V2CRLExtensionCritical __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_X509V2CRLExtensionType __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + + + CSSMOID_PKIX_OCSP __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKIX_OCSP_BASIC __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKIX_OCSP_NONCE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKIX_OCSP_CRL __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKIX_OCSP_RESPONSE __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKIX_OCSP_NOCHECK __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKIX_OCSP_ARCHIVE_CUTOFF __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))), + CSSMOID_PKIX_OCSP_SERVICE_LOCATOR __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + +typedef UInt32 SecAccessOwnerType; +enum +{ + kSecUseOnlyUID = 1, + kSecUseOnlyGID = 2, + kSecHonorRoot = 0x100, + kSecMatchBits = (kSecUseOnlyUID | kSecUseOnlyGID) +}; + + + +extern const CFStringRef kSecACLAuthorizationAny + __attribute__((availability(macosx,introduced=10.7))); + +extern const CFStringRef kSecACLAuthorizationLogin + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecACLAuthorizationGenKey + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecACLAuthorizationDelete + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecACLAuthorizationExportWrapped + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecACLAuthorizationExportClear + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecACLAuthorizationImportWrapped + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecACLAuthorizationImportClear + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecACLAuthorizationSign + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecACLAuthorizationEncrypt + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecACLAuthorizationDecrypt + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecACLAuthorizationMAC + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecACLAuthorizationDerive + __attribute__((availability(macosx,introduced=10.7))); + + +extern const CFStringRef kSecACLAuthorizationKeychainCreate + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecACLAuthorizationKeychainDelete + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecACLAuthorizationKeychainItemRead + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecACLAuthorizationKeychainItemInsert + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecACLAuthorizationKeychainItemModify + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecACLAuthorizationKeychainItemDelete + __attribute__((availability(macosx,introduced=10.7))); + +extern const CFStringRef kSecACLAuthorizationChangeACL + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecACLAuthorizationChangeOwner + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecACLAuthorizationPartitionID + __attribute__((availability(macosx,introduced=10.11))); +extern const CFStringRef kSecACLAuthorizationIntegrity + __attribute__((availability(macosx,introduced=10.11))); + + + + + + +CFTypeID SecAccessGetTypeID(void); +OSStatus SecAccessCreate(CFStringRef descriptor, CFArrayRef _Nullable trustedlist, SecAccessRef * _Nonnull __attribute__((cf_returns_retained)) accessRef); +OSStatus SecAccessCreateFromOwnerAndACL(const CSSM_ACL_OWNER_PROTOTYPE *owner, uint32 aclCount, const CSSM_ACL_ENTRY_INFO *acls, SecAccessRef * _Nonnull __attribute__((cf_returns_retained)) accessRef) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +_Nullable +SecAccessRef SecAccessCreateWithOwnerAndACL(uid_t userId, gid_t groupId, SecAccessOwnerType ownerType, CFArrayRef _Nullable acls, CFErrorRef *error) + __attribute__((availability(macosx,introduced=10.7))); +OSStatus SecAccessGetOwnerAndACL(SecAccessRef accessRef, CSSM_ACL_OWNER_PROTOTYPE_PTR _Nullable * _Nonnull owner, uint32 *aclCount, CSSM_ACL_ENTRY_INFO_PTR _Nullable * _Nonnull acls) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecAccessCopyOwnerAndACL(SecAccessRef accessRef, uid_t * _Nullable userId, gid_t * _Nullable groupId, SecAccessOwnerType * _Nullable ownerType, CFArrayRef * _Nullable __attribute__((cf_returns_retained)) aclList) + __attribute__((availability(macosx,introduced=10.7))); +OSStatus SecAccessCopyACLList(SecAccessRef accessRef, CFArrayRef * _Nonnull __attribute__((cf_returns_retained)) aclList); +OSStatus SecAccessCopySelectedACLList(SecAccessRef accessRef, CSSM_ACL_AUTHORIZATION_TAG action, CFArrayRef * _Nonnull __attribute__((cf_returns_retained)) aclList) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +_Nullable +CFArrayRef SecAccessCopyMatchingACLList(SecAccessRef accessRef, CFTypeRef authorizationTag) + __attribute__((availability(macosx,introduced=10.7))); +CFTypeID SecAccessControlGetTypeID(void) +__attribute__((availability(macosx,introduced=10.10))); + +typedef CFOptionFlags SecAccessControlCreateFlags; enum { + kSecAccessControlUserPresence = 1 << 0, + kSecAccessControlTouchIDAny __attribute__((availability(macosx,introduced=10_12))) = 1u << 1, + kSecAccessControlTouchIDCurrentSet __attribute__((availability(macosx,introduced=10_12))) = 1u << 3, + kSecAccessControlDevicePasscode __attribute__((availability(macosx,introduced=10_11))) = 1u << 4, + kSecAccessControlOr __attribute__((availability(macosx,introduced=10_12))) = 1u << 14, + kSecAccessControlAnd __attribute__((availability(macosx,introduced=10_12))) = 1u << 15, + kSecAccessControlPrivateKeyUsage __attribute__((availability(macosx,introduced=10_12))) = 1u << 30, + kSecAccessControlApplicationPassword __attribute__((availability(macosx,introduced=10_12))) = 1u << 31, +} __attribute__((availability(macosx,introduced=10.10))); +_Nullable +SecAccessControlRef SecAccessControlCreateWithFlags(CFAllocatorRef _Nullable allocator, CFTypeRef protection, + SecAccessControlCreateFlags flags, CFErrorRef *error) +__attribute__((availability(macosx,introduced=10.10))); + typedef uint16 SecKeychainPromptSelector; enum + { + kSecKeychainPromptRequirePassphase = 0x0001, + + kSecKeychainPromptUnsigned = 0x0010, + kSecKeychainPromptUnsignedAct = 0x0020, + kSecKeychainPromptInvalid = 0x0040, + kSecKeychainPromptInvalidAct = 0x0080, + }; + + + + + + + + CFTypeID SecACLGetTypeID(void) + __attribute__((availability(macosx,introduced=10.3))); + OSStatus SecACLCreateFromSimpleContents(SecAccessRef access, + CFArrayRef _Nullable applicationList, + CFStringRef description, + const CSSM_ACL_KEYCHAIN_PROMPT_SELECTOR *promptSelector, + SecACLRef * _Nonnull __attribute__((cf_returns_retained)) newAcl) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + OSStatus SecACLCreateWithSimpleContents(SecAccessRef access, + CFArrayRef _Nullable applicationList, + CFStringRef description, + SecKeychainPromptSelector promptSelector, + SecACLRef * _Nonnull __attribute__((cf_returns_retained)) newAcl) + __attribute__((availability(macosx,introduced=10.7))); + + + + + + + + OSStatus SecACLRemove(SecACLRef aclRef) + __attribute__((availability(macosx,introduced=10.3))); + OSStatus SecACLCopySimpleContents(SecACLRef acl, + CFArrayRef * _Nonnull __attribute__((cf_returns_retained)) applicationList, + CFStringRef * _Nonnull __attribute__((cf_returns_retained)) description, + CSSM_ACL_KEYCHAIN_PROMPT_SELECTOR *promptSelector) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + OSStatus SecACLCopyContents(SecACLRef acl, + CFArrayRef * _Nonnull __attribute__((cf_returns_retained)) applicationList, + CFStringRef * _Nonnull __attribute__((cf_returns_retained)) description, + SecKeychainPromptSelector *promptSelector) + __attribute__((availability(macosx,introduced=10.7))); + OSStatus SecACLSetSimpleContents(SecACLRef acl, + CFArrayRef _Nullable applicationList, + CFStringRef description, + const CSSM_ACL_KEYCHAIN_PROMPT_SELECTOR *promptSelector) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + OSStatus SecACLSetContents(SecACLRef acl, + CFArrayRef _Nullable applicationList, + CFStringRef description, + SecKeychainPromptSelector promptSelector) + __attribute__((availability(macosx,introduced=10.7))); + OSStatus SecACLGetAuthorizations(SecACLRef acl, + CSSM_ACL_AUTHORIZATION_TAG *tags, uint32 *tagCount) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + + + CFArrayRef SecACLCopyAuthorizations(SecACLRef acl) + __attribute__((availability(macosx,introduced=10.7))); + OSStatus SecACLSetAuthorizations(SecACLRef acl, + CSSM_ACL_AUTHORIZATION_TAG *tags, uint32 tagCount) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + OSStatus SecACLUpdateAuthorizations(SecACLRef acl, CFArrayRef authorizations) + __attribute__((availability(macosx,introduced=10.7))); +enum +{ + kSecSubjectItemAttr = 'subj', + kSecIssuerItemAttr = 'issu', + kSecSerialNumberItemAttr = 'snbr', + kSecPublicKeyHashItemAttr = 'hpky', + kSecSubjectKeyIdentifierItemAttr = 'skid', + kSecCertTypeItemAttr = 'ctyp', + kSecCertEncodingItemAttr = 'cenc' +} ; + + + + + + +CFTypeID SecCertificateGetTypeID(void) + __attribute__((availability(macosx,introduced=10.3))); +OSStatus SecCertificateCreateFromData(const CSSM_DATA *data, CSSM_CERT_TYPE type, CSSM_CERT_ENCODING encoding, SecCertificateRef * _Nonnull __attribute__((cf_returns_retained)) certificate) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +_Nullable +SecCertificateRef SecCertificateCreateWithData(CFAllocatorRef _Nullable allocator, CFDataRef data) + __attribute__((availability(macosx,introduced=10.6))); +OSStatus SecCertificateAddToKeychain(SecCertificateRef certificate, SecKeychainRef _Nullable keychain) + __attribute__((availability(macosx,introduced=10.3))); +OSStatus SecCertificateGetData(SecCertificateRef certificate, CSSM_DATA_PTR data) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + + +CFDataRef SecCertificateCopyData(SecCertificateRef certificate) + __attribute__((availability(macosx,introduced=10.6))); +OSStatus SecCertificateGetType(SecCertificateRef certificate, CSSM_CERT_TYPE *certificateType) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecCertificateGetSubject(SecCertificateRef certificate, const CSSM_X509_NAME * _Nullable * _Nonnull subject) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecCertificateGetIssuer(SecCertificateRef certificate, const CSSM_X509_NAME * _Nullable * _Nonnull issuer) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecCertificateGetCLHandle(SecCertificateRef certificate, CSSM_CL_HANDLE *clHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecCertificateGetAlgorithmID(SecCertificateRef certificate, const CSSM_X509_ALGORITHM_IDENTIFIER * _Nullable * _Nonnull algid) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecCertificateCopyPublicKey(SecCertificateRef certificate, SecKeyRef * _Nonnull __attribute__((cf_returns_retained)) key) + __attribute__((availability(macosx,introduced=10.3))); +OSStatus SecCertificateCopyCommonName(SecCertificateRef certificate, CFStringRef * _Nonnull __attribute__((cf_returns_retained)) commonName) + __attribute__((availability(macosx,introduced=10.5))); +CFStringRef SecCertificateCopySubjectSummary(SecCertificateRef certificate) + __attribute__((availability(macosx,introduced=10.6))); +OSStatus SecCertificateCopyEmailAddresses(SecCertificateRef certificate, CFArrayRef * _Nonnull __attribute__((cf_returns_retained)) emailAddresses) + __attribute__((availability(macosx,introduced=10.5))); +OSStatus SecCertificateCopyPreference(CFStringRef name, uint32 keyUsage, SecCertificateRef * _Nonnull __attribute__((cf_returns_retained)) certificate) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +_Nullable +SecCertificateRef SecCertificateCopyPreferred(CFStringRef name, CFArrayRef _Nullable keyUsage) + __attribute__((availability(macosx,introduced=10.7))); +OSStatus SecCertificateSetPreference(SecCertificateRef certificate, CFStringRef name, uint32 keyUsage, CFDateRef _Nullable date) + __attribute__((availability(macosx,introduced=10.5))); +OSStatus SecCertificateSetPreferred(SecCertificateRef _Nullable certificate, CFStringRef name, CFArrayRef _Nullable keyUsage) + __attribute__((availability(macosx,introduced=10.7))); +typedef uint32_t SecKeyUsage; enum { + kSecKeyUsageUnspecified = 0, + kSecKeyUsageDigitalSignature = 1 << 0, + kSecKeyUsageNonRepudiation = 1 << 1, + kSecKeyUsageContentCommitment= 1 << 1, + kSecKeyUsageKeyEncipherment = 1 << 2, + kSecKeyUsageDataEncipherment = 1 << 3, + kSecKeyUsageKeyAgreement = 1 << 4, + kSecKeyUsageKeyCertSign = 1 << 5, + kSecKeyUsageCRLSign = 1 << 6, + kSecKeyUsageEncipherOnly = 1 << 7, + kSecKeyUsageDecipherOnly = 1 << 8, + kSecKeyUsageCritical = 1 << 31, + kSecKeyUsageAll = 0x7FFFFFFF +}; +extern const CFStringRef kSecPropertyKeyType __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPropertyKeyLabel __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPropertyKeyLocalizedLabel __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPropertyKeyValue __attribute__((availability(macosx,introduced=10.7))); + + + + + + +extern const CFStringRef kSecPropertyTypeWarning __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPropertyTypeSuccess __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPropertyTypeSection __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPropertyTypeData __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPropertyTypeString __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPropertyTypeURL __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPropertyTypeDate __attribute__((availability(macosx,introduced=10.7))); +_Nullable +CFDictionaryRef SecCertificateCopyValues(SecCertificateRef certificate, CFArrayRef _Nullable keys, CFErrorRef *error) + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecCertificateUsageSigning __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecCertificateUsageSigningAndEncrypting __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecCertificateUsageDeriveAndSign __attribute__((availability(macosx,introduced=10.7))); +_Nullable +CFStringRef SecCertificateCopyLongDescription(CFAllocatorRef _Nullable alloc, SecCertificateRef certificate, CFErrorRef *error) + __attribute__((availability(macosx,introduced=10.7))); +_Nullable +CFStringRef SecCertificateCopyShortDescription(CFAllocatorRef _Nullable alloc, SecCertificateRef certificate, CFErrorRef *error) + __attribute__((availability(macosx,introduced=10.7))); +_Nullable +CFDataRef SecCertificateCopySerialNumber(SecCertificateRef certificate, CFErrorRef *error) + __attribute__((availability(macosx,introduced=10.7))); +_Nullable +CFDataRef SecCertificateCopyNormalizedIssuerContent(SecCertificateRef certificate, CFErrorRef *error) + __attribute__((availability(macosx,introduced=10.7))); +_Nullable +CFDataRef SecCertificateCopyNormalizedSubjectContent(SecCertificateRef certificate, CFErrorRef *error) + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDADC_CERT_POLICY __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDAPPLE_CERT_POLICY __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDAPPLE_EKU_CODE_SIGNING __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDAPPLE_EKU_CODE_SIGNING_DEV __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDAPPLE_EKU_ICHAT_ENCRYPTION __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDAPPLE_EKU_ICHAT_SIGNING __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDAPPLE_EKU_RESOURCE_SIGNING __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDAPPLE_EKU_SYSTEM_IDENTITY __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDAPPLE_EXTENSION __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDAPPLE_EXTENSION_ADC_APPLE_SIGNING __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDAPPLE_EXTENSION_ADC_DEV_SIGNING __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDAPPLE_EXTENSION_APPLE_SIGNING __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDAPPLE_EXTENSION_CODE_SIGNING __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDAPPLE_EXTENSION_INTERMEDIATE_MARKER __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDAPPLE_EXTENSION_WWDR_INTERMEDIATE __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDAPPLE_EXTENSION_ITMS_INTERMEDIATE __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDAPPLE_EXTENSION_AAI_INTERMEDIATE __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDAPPLE_EXTENSION_APPLEID_INTERMEDIATE __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDAuthorityInfoAccess __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDAuthorityKeyIdentifier __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDBasicConstraints __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDBiometricInfo __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDCSSMKeyStruct __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDCertIssuer __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDCertificatePolicies __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDClientAuth __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDCollectiveStateProvinceName __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDCollectiveStreetAddress __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDCommonName __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDCountryName __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDCrlDistributionPoints __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDCrlNumber __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDCrlReason __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDDOTMAC_CERT_EMAIL_ENCRYPT __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDDOTMAC_CERT_EMAIL_SIGN __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDDOTMAC_CERT_EXTENSION __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDDOTMAC_CERT_IDENTITY __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDDOTMAC_CERT_POLICY __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDDeltaCrlIndicator __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDDescription __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDEKU_IPSec __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDEmailAddress __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDEmailProtection __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDExtendedKeyUsage __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDExtendedKeyUsageAny __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDExtendedUseCodeSigning __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDGivenName __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDHoldInstructionCode __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDInvalidityDate __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDIssuerAltName __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDIssuingDistributionPoint __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDIssuingDistributionPoints __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDKERBv5_PKINIT_KP_CLIENT_AUTH __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDKERBv5_PKINIT_KP_KDC __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDKeyUsage __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDLocalityName __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDMS_NTPrincipalName __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDMicrosoftSGC __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDNameConstraints __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDNetscapeCertSequence __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDNetscapeCertType __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDNetscapeSGC __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDOCSPSigning __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDOrganizationName __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDOrganizationalUnitName __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDPolicyConstraints __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDPolicyMappings __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDPrivateKeyUsagePeriod __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDQC_Statements __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDSerialNumber __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDServerAuth __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDStateProvinceName __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDStreetAddress __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDSubjectAltName __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDSubjectDirectoryAttributes __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDSubjectEmailAddress __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDSubjectInfoAccess __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDSubjectKeyIdentifier __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDSubjectPicture __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDSubjectSignatureBitmap __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDSurname __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDTimeStamping __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDTitle __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDUseExemptions __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1CertificateIssuerUniqueId __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1CertificateSubjectUniqueId __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1IssuerName __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1IssuerNameCStruct __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1IssuerNameLDAP __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1IssuerNameStd __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1SerialNumber __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1Signature __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1SignatureAlgorithm __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1SignatureAlgorithmParameters __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1SignatureAlgorithmTBS __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1SignatureCStruct __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1SignatureStruct __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1SubjectName __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1SubjectNameCStruct __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1SubjectNameLDAP __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1SubjectNameStd __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1SubjectPublicKey __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1SubjectPublicKeyAlgorithm __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1SubjectPublicKeyAlgorithmParameters __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1SubjectPublicKeyCStruct __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1ValidityNotAfter __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1ValidityNotBefore __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V1Version __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V3Certificate __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V3CertificateCStruct __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V3CertificateExtensionCStruct __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V3CertificateExtensionCritical __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V3CertificateExtensionId __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V3CertificateExtensionStruct __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V3CertificateExtensionType __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V3CertificateExtensionValue __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V3CertificateExtensionsCStruct __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V3CertificateExtensionsStruct __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V3CertificateNumberOfExtensions __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V3SignedCertificate __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDX509V3SignedCertificateCStruct __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecOIDSRVName __attribute__((availability(macosx,introduced=10.8))); +CFTypeID SecIdentityGetTypeID(void) + __attribute__((availability(macosx,introduced=10.3))); +OSStatus SecIdentityCreateWithCertificate( + CFTypeRef _Nullable keychainOrArray, + SecCertificateRef certificateRef, + SecIdentityRef * _Nonnull __attribute__((cf_returns_retained)) identityRef) + __attribute__((availability(macosx,introduced=10.5))); +OSStatus SecIdentityCopyCertificate( + SecIdentityRef identityRef, + SecCertificateRef * _Nonnull __attribute__((cf_returns_retained)) certificateRef) + __attribute__((availability(macosx,introduced=10.3))); +OSStatus SecIdentityCopyPrivateKey( + SecIdentityRef identityRef, + SecKeyRef * _Nonnull __attribute__((cf_returns_retained)) privateKeyRef) + __attribute__((availability(macosx,introduced=10.3))); +OSStatus SecIdentityCopyPreference(CFStringRef name, CSSM_KEYUSE keyUsage, CFArrayRef _Nullable validIssuers, SecIdentityRef * _Nonnull __attribute__((cf_returns_retained)) identity) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +_Nullable +SecIdentityRef SecIdentityCopyPreferred(CFStringRef name, CFArrayRef _Nullable keyUsage, CFArrayRef _Nullable validIssuers) + __attribute__((availability(macosx,introduced=10.7))); +OSStatus SecIdentitySetPreference(SecIdentityRef identity, CFStringRef name, CSSM_KEYUSE keyUsage) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecIdentitySetPreferred(SecIdentityRef _Nullable identity, CFStringRef name, CFArrayRef _Nullable keyUsage) + __attribute__((availability(macosx,introduced=10.7))); +OSStatus SecIdentityCopySystemIdentity( + CFStringRef domain, + SecIdentityRef * _Nonnull __attribute__((cf_returns_retained)) idRef, + CFStringRef * _Nullable __attribute__((cf_returns_retained)) actualDomain) + __attribute__((availability(macosx,introduced=10.5))); +OSStatus SecIdentitySetSystemIdentity( + CFStringRef domain, + SecIdentityRef _Nullable idRef) + __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kSecIdentityDomainDefault __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kSecIdentityDomainKerberosKDC __attribute__((availability(macosx,introduced=10.5))); +typedef struct __attribute__((objc_bridge(id))) OpaqueSecIdentitySearchRef *SecIdentitySearchRef; + + + + + + + +CFTypeID SecIdentitySearchGetTypeID(void) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecIdentitySearchCreate(CFTypeRef _Nullable keychainOrArray, CSSM_KEYUSE keyUsage, SecIdentitySearchRef * _Nullable __attribute__((cf_returns_retained)) searchRef) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecIdentitySearchCopyNext(SecIdentitySearchRef searchRef, SecIdentityRef * _Nullable __attribute__((cf_returns_retained)) identity) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern const CFStringRef kSecClass + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecClassInternetPassword + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecClassGenericPassword + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecClassCertificate + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecClassKey + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecClassIdentity + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecAttrAccessible + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecAttrAccess + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecAttrAccessControl + __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kSecAttrAccessGroup + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecAttrSynchronizable + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecAttrSynchronizableAny + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecAttrCreationDate + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrModificationDate + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrDescription + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrComment + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrCreator + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrType + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrLabel + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrIsInvisible + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrIsNegative + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrAccount + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrService + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrGeneric + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrSecurityDomain + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrServer + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocol + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrAuthenticationType + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrPort + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrPath + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrSubject + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrIssuer + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrSerialNumber + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrSubjectKeyID + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrPublicKeyHash + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrCertificateType + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrCertificateEncoding + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrKeyClass + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrApplicationLabel + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrIsPermanent + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrIsSensitive + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrIsExtractable + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrApplicationTag + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrKeyType + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrPRF + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecAttrSalt + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecAttrRounds + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecAttrKeySizeInBits + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrEffectiveKeySize + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrCanEncrypt + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrCanDecrypt + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrCanDerive + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrCanSign + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrCanVerify + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrCanWrap + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrCanUnwrap + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrTokenID + __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kSecAttrAccessibleWhenUnlocked + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecAttrAccessibleAfterFirstUnlock + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecAttrAccessibleAlways + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly + __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kSecAttrAccessibleWhenUnlockedThisDeviceOnly + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecAttrAccessibleAlwaysThisDeviceOnly + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecAttrProtocolFTP + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolFTPAccount + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolHTTP + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolIRC + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolNNTP + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolPOP3 + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolSMTP + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolSOCKS + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolIMAP + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolLDAP + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolAppleTalk + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolAFP + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolTelnet + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolSSH + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolFTPS + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolHTTPS + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolHTTPProxy + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolHTTPSProxy + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolFTPProxy + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolSMB + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolRTSP + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolRTSPProxy + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolDAAP + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolEPPC + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolIPP + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolNNTPS + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolLDAPS + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolTelnetS + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolIMAPS + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolIRCS + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrProtocolPOP3S + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrAuthenticationTypeNTLM + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrAuthenticationTypeMSN + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrAuthenticationTypeDPA + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrAuthenticationTypeRPA + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrAuthenticationTypeHTTPBasic + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrAuthenticationTypeHTTPDigest + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrAuthenticationTypeHTMLForm + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrAuthenticationTypeDefault + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecAttrKeyClassPublic + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecAttrKeyClassPrivate + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecAttrKeyClassSymmetric + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecAttrKeyTypeRSA + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecAttrKeyTypeDSA + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecAttrKeyTypeAES + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecAttrKeyTypeDES + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecAttrKeyType3DES + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecAttrKeyTypeRC4 + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecAttrKeyTypeRC2 + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecAttrKeyTypeCAST + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecAttrKeyTypeECDSA + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecAttrKeyTypeEC + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecAttrKeyTypeECSECPrimeRandom + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecAttrPRFHmacAlgSHA1 + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecAttrPRFHmacAlgSHA224 + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecAttrPRFHmacAlgSHA256 + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecAttrPRFHmacAlgSHA384 + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecAttrPRFHmacAlgSHA512 + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecMatchPolicy + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecMatchItemList + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecMatchSearchList + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecMatchIssuers + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecMatchEmailAddressIfPresent + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecMatchSubjectContains + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecMatchSubjectStartsWith + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecMatchSubjectEndsWith + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecMatchSubjectWholeString + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecMatchCaseInsensitive + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecMatchDiacriticInsensitive + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecMatchWidthInsensitive + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecMatchTrustedOnly + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecMatchValidOnDate + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecMatchLimit + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecMatchLimitOne + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecMatchLimitAll + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecReturnData + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecReturnAttributes + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecReturnRef + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecReturnPersistentRef + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecValueData + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecValueRef + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecValuePersistentRef + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecUseItemList + __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kSecUseKeychain + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecUseOperationPrompt + __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kSecUseAuthenticationUI + __attribute__((availability(macosx,introduced=10.11))); +extern const CFStringRef kSecUseAuthenticationContext + __attribute__((availability(macosx,introduced=10.11))); +extern const CFStringRef kSecUseAuthenticationUIAllow + __attribute__((availability(macosx,introduced=10.11))); +extern const CFStringRef kSecUseAuthenticationUIFail + __attribute__((availability(macosx,introduced=10.11))); +extern const CFStringRef kSecUseAuthenticationUISkip + __attribute__((availability(macosx,introduced=10.11))); +extern const CFStringRef kSecAttrTokenIDSecureEnclave + __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kSecAttrAccessGroupToken + __attribute__((availability(macosx,introduced=10.12))); +OSStatus SecItemCopyMatching(CFDictionaryRef query, CFTypeRef * _Nullable __attribute__((cf_returns_retained)) result) + __attribute__((availability(macosx,introduced=10.6))); +OSStatus SecItemAdd(CFDictionaryRef attributes, CFTypeRef * _Nullable __attribute__((cf_returns_retained)) result) + __attribute__((availability(macosx,introduced=10.6))); +OSStatus SecItemUpdate(CFDictionaryRef query, CFDictionaryRef attributesToUpdate) + __attribute__((availability(macosx,introduced=10.6))); +OSStatus SecItemDelete(CFDictionaryRef query) + __attribute__((availability(macosx,introduced=10.6))); +enum +{ + kSecKeyKeyClass = 0, + kSecKeyPrintName = 1, + kSecKeyAlias = 2, + kSecKeyPermanent = 3, + kSecKeyPrivate = 4, + kSecKeyModifiable = 5, + kSecKeyLabel = 6, + kSecKeyApplicationTag = 7, + kSecKeyKeyCreator = 8, + kSecKeyKeyType = 9, + kSecKeyKeySizeInBits = 10, + kSecKeyEffectiveKeySize = 11, + kSecKeyStartDate = 12, + kSecKeyEndDate = 13, + kSecKeySensitive = 14, + kSecKeyAlwaysSensitive = 15, + kSecKeyExtractable = 16, + kSecKeyNeverExtractable = 17, + kSecKeyEncrypt = 18, + kSecKeyDecrypt = 19, + kSecKeyDerive = 20, + kSecKeySign = 21, + kSecKeyVerify = 22, + kSecKeySignRecover = 23, + kSecKeyVerifyRecover = 24, + kSecKeyWrap = 25, + kSecKeyUnwrap = 26 +}; +typedef uint32 SecCredentialType; enum +{ + kSecCredentialTypeDefault = 0, + kSecCredentialTypeWithUI, + kSecCredentialTypeNoUI +}; + + + + + +typedef uint32_t SecPadding; enum +{ + kSecPaddingNone = 0, + kSecPaddingPKCS1 = 1, + + + + + kSecPaddingSigRaw = 0x4000, + + + + + kSecPaddingPKCS1MD2 = 0x8000, + + + + + kSecPaddingPKCS1MD5 = 0x8001, + + + + + kSecPaddingPKCS1SHA1 = 0x8002, +}; + + + + + +typedef uint32_t SecKeySizes; enum +{ + kSecDefaultKeySize = 0, + + + kSec3DES192 = 192, + kSecAES128 = 128, + kSecAES192 = 192, + kSecAES256 = 256, + + + + kSecp192r1 = 192, + kSecp256r1 = 256, + kSecp384r1 = 384, + kSecp521r1 = 521, + + + + kSecRSAMin = 1024, + kSecRSAMax = 4096 +}; +extern const CFStringRef kSecPrivateKeyAttrs + __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kSecPublicKeyAttrs + __attribute__((availability(macosx,introduced=10.8))); + + + + + + + +CFTypeID SecKeyGetTypeID(void) + __attribute__((availability(macosx,introduced=10.3))); +OSStatus SecKeyCreatePair( + SecKeychainRef _Nullable keychainRef, + CSSM_ALGORITHMS algorithm, + uint32 keySizeInBits, + CSSM_CC_HANDLE contextHandle, + CSSM_KEYUSE publicKeyUsage, + uint32 publicKeyAttr, + CSSM_KEYUSE privateKeyUsage, + uint32 privateKeyAttr, + SecAccessRef _Nullable initialAccess, + SecKeyRef* _Nullable __attribute__((cf_returns_retained)) publicKey, + SecKeyRef* _Nullable __attribute__((cf_returns_retained)) privateKey) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecKeyGenerate( + SecKeychainRef _Nullable keychainRef, + CSSM_ALGORITHMS algorithm, + uint32 keySizeInBits, + CSSM_CC_HANDLE contextHandle, + CSSM_KEYUSE keyUsage, + uint32 keyAttr, + SecAccessRef _Nullable initialAccess, + SecKeyRef* _Nullable __attribute__((cf_returns_retained)) keyRef) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecKeyGetCSSMKey(SecKeyRef key, const CSSM_KEY * _Nullable * _Nonnull cssmKey) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7)));; +OSStatus SecKeyGetCSPHandle(SecKeyRef keyRef, CSSM_CSP_HANDLE *cspHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecKeyGetCredentials( + SecKeyRef keyRef, + CSSM_ACL_AUTHORIZATION_TAG operation, + SecCredentialType credentialType, + const CSSM_ACCESS_CREDENTIALS * _Nullable * _Nonnull outCredentials) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +size_t SecKeyGetBlockSize(SecKeyRef key) + __attribute__((availability(macosx,introduced=10.6))); +_Nullable +SecKeyRef SecKeyGenerateSymmetric(CFDictionaryRef parameters, CFErrorRef *error) + __attribute__((availability(macosx,introduced=10.7))); +_Nullable +SecKeyRef SecKeyCreateFromData(CFDictionaryRef parameters, + CFDataRef keyData, CFErrorRef *error) + __attribute__((availability(macosx,introduced=10.7))); +OSStatus SecKeyGeneratePair(CFDictionaryRef parameters, + SecKeyRef * _Nullable __attribute__((cf_returns_retained)) publicKey, SecKeyRef * _Nullable __attribute__((cf_returns_retained)) privateKey) + __attribute__((availability(macosx,introduced=10.7))); +typedef void (^SecKeyGeneratePairBlock)(SecKeyRef publicKey, SecKeyRef privateKey, CFErrorRef error); +void SecKeyGeneratePairAsync(CFDictionaryRef parameters, + dispatch_queue_t deliveryQueue, SecKeyGeneratePairBlock result) + __attribute__((availability(macosx,introduced=10.7))); +_Nullable __attribute__((cf_returns_retained)) +SecKeyRef SecKeyDeriveFromPassword(CFStringRef password, + CFDictionaryRef parameters, CFErrorRef *error) + __attribute__((availability(macosx,introduced=10.7))); +_Nullable +CFDataRef SecKeyWrapSymmetric(SecKeyRef keyToWrap, + SecKeyRef wrappingKey, CFDictionaryRef parameters, CFErrorRef *error) + __attribute__((availability(macosx,introduced=10.7))); +_Nullable +SecKeyRef SecKeyUnwrapSymmetric(CFDataRef _Nullable * _Nonnull keyToUnwrap, + SecKeyRef unwrappingKey, CFDictionaryRef parameters, CFErrorRef *error) + __attribute__((availability(macosx,introduced=10.7))); +SecKeyRef _Nullable SecKeyCreateRandomKey(CFDictionaryRef parameters, CFErrorRef *error) +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +SecKeyRef _Nullable SecKeyCreateWithData(CFDataRef keyData, CFDictionaryRef attributes, CFErrorRef *error) +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +CFDataRef _Nullable SecKeyCopyExternalRepresentation(SecKeyRef key, CFErrorRef *error) +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +CFDictionaryRef _Nullable SecKeyCopyAttributes(SecKeyRef key) +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +SecKeyRef _Nullable SecKeyCopyPublicKey(SecKeyRef key) +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +typedef CFStringRef SecKeyAlgorithm __attribute__((swift_wrapper(enum))) +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); + +extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureRaw +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); + +extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPKCS1v15Raw +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); + +extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA1 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA224 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA256 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA384 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA512 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); + +extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA1 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA224 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA256 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA384 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA512 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); + +extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureRFC4754 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); + +extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureDigestX962 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureDigestX962SHA1 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureDigestX962SHA224 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureDigestX962SHA256 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureDigestX962SHA384 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureDigestX962SHA512 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); + +extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureMessageX962SHA1 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureMessageX962SHA224 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureMessageX962SHA256 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureMessageX962SHA384 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureMessageX962SHA512 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); + +extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionRaw +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionPKCS1 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionOAEPSHA1 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionOAEPSHA224 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionOAEPSHA256 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionOAEPSHA384 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionOAEPSHA512 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); + +extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionOAEPSHA1AESGCM +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionOAEPSHA224AESGCM +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionOAEPSHA256AESGCM +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionOAEPSHA384AESGCM +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionOAEPSHA512AESGCM +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); + +extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionStandardX963SHA1AESGCM +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionStandardX963SHA224AESGCM +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionStandardX963SHA256AESGCM +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionStandardX963SHA384AESGCM +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionStandardX963SHA512AESGCM +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); + +extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionCofactorX963SHA1AESGCM +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionCofactorX963SHA224AESGCM +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionCofactorX963SHA256AESGCM +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionCofactorX963SHA384AESGCM +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionCofactorX963SHA512AESGCM +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); + +extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeStandard +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA1 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA224 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA256 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA384 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA512 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); + +extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeCofactor +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA1 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA224 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA256 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA384 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA512 +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +CFDataRef _Nullable SecKeyCreateSignature(SecKeyRef key, SecKeyAlgorithm algorithm, CFDataRef dataToSign, CFErrorRef *error) +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +Boolean SecKeyVerifySignature(SecKeyRef key, SecKeyAlgorithm algorithm, CFDataRef signedData, CFDataRef signature, CFErrorRef *error) +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +CFDataRef _Nullable SecKeyCreateEncryptedData(SecKeyRef key, SecKeyAlgorithm algorithm, CFDataRef plaintext, + CFErrorRef *error) +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +CFDataRef _Nullable SecKeyCreateDecryptedData(SecKeyRef key, SecKeyAlgorithm algorithm, CFDataRef ciphertext, + CFErrorRef *error) +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); + + + + + + + +typedef CFStringRef SecKeyKeyExchangeParameter __attribute__((swift_wrapper(enum))) +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyKeyExchangeParameter kSecKeyKeyExchangeParameterRequestedSize +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +extern const SecKeyKeyExchangeParameter kSecKeyKeyExchangeParameterSharedInfo +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +CFDataRef _Nullable SecKeyCopyKeyExchangeResult(SecKeyRef privateKey, SecKeyAlgorithm algorithm, SecKeyRef publicKey, CFDictionaryRef parameters, CFErrorRef *error) +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +typedef CFIndex SecKeyOperationType; enum { + kSecKeyOperationTypeSign = 0, + kSecKeyOperationTypeVerify = 1, + kSecKeyOperationTypeEncrypt = 2, + kSecKeyOperationTypeDecrypt = 3, + kSecKeyOperationTypeKeyExchange = 4, +} __attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +Boolean SecKeyIsAlgorithmSupported(SecKeyRef key, SecKeyOperationType operation, SecKeyAlgorithm algorithm) +__attribute__((availability(macosx,introduced=10.12))) __attribute__((availability(ios,introduced=10.0))) __attribute__((availability(tvos,introduced=10.0))) __attribute__((availability(watchos,introduced=3.0))); +enum +{ + kSecUnlockStateStatus = 1, + kSecReadPermStatus = 2, + kSecWritePermStatus = 4 +}; +struct SecKeychainSettings +{ + UInt32 version; + Boolean lockOnSleep; + Boolean useLockInterval; + UInt32 lockInterval; +}; +typedef struct SecKeychainSettings SecKeychainSettings; +typedef FourCharCode SecAuthenticationType; enum +{ + kSecAuthenticationTypeNTLM = ((__uint32_t)((((__uint32_t)('ntlm') & 0xff000000) >> 24) | (((__uint32_t)('ntlm') & 0x00ff0000) >> 8) | (((__uint32_t)('ntlm') & 0x0000ff00) << 8) | (((__uint32_t)('ntlm') & 0x000000ff) << 24))), + kSecAuthenticationTypeMSN = ((__uint32_t)((((__uint32_t)('msna') & 0xff000000) >> 24) | (((__uint32_t)('msna') & 0x00ff0000) >> 8) | (((__uint32_t)('msna') & 0x0000ff00) << 8) | (((__uint32_t)('msna') & 0x000000ff) << 24))), + kSecAuthenticationTypeDPA = ((__uint32_t)((((__uint32_t)('dpaa') & 0xff000000) >> 24) | (((__uint32_t)('dpaa') & 0x00ff0000) >> 8) | (((__uint32_t)('dpaa') & 0x0000ff00) << 8) | (((__uint32_t)('dpaa') & 0x000000ff) << 24))), + kSecAuthenticationTypeRPA = ((__uint32_t)((((__uint32_t)('rpaa') & 0xff000000) >> 24) | (((__uint32_t)('rpaa') & 0x00ff0000) >> 8) | (((__uint32_t)('rpaa') & 0x0000ff00) << 8) | (((__uint32_t)('rpaa') & 0x000000ff) << 24))), + kSecAuthenticationTypeHTTPBasic = ((__uint32_t)((((__uint32_t)('http') & 0xff000000) >> 24) | (((__uint32_t)('http') & 0x00ff0000) >> 8) | (((__uint32_t)('http') & 0x0000ff00) << 8) | (((__uint32_t)('http') & 0x000000ff) << 24))), + kSecAuthenticationTypeHTTPDigest = ((__uint32_t)((((__uint32_t)('httd') & 0xff000000) >> 24) | (((__uint32_t)('httd') & 0x00ff0000) >> 8) | (((__uint32_t)('httd') & 0x0000ff00) << 8) | (((__uint32_t)('httd') & 0x000000ff) << 24))), + kSecAuthenticationTypeHTMLForm = ((__uint32_t)((((__uint32_t)('form') & 0xff000000) >> 24) | (((__uint32_t)('form') & 0x00ff0000) >> 8) | (((__uint32_t)('form') & 0x0000ff00) << 8) | (((__uint32_t)('form') & 0x000000ff) << 24))), + kSecAuthenticationTypeDefault = ((__uint32_t)((((__uint32_t)('dflt') & 0xff000000) >> 24) | (((__uint32_t)('dflt') & 0x00ff0000) >> 8) | (((__uint32_t)('dflt') & 0x0000ff00) << 8) | (((__uint32_t)('dflt') & 0x000000ff) << 24))), + kSecAuthenticationTypeAny = ((__uint32_t)((((__uint32_t)(0) & 0xff000000) >> 24) | (((__uint32_t)(0) & 0x00ff0000) >> 8) | (((__uint32_t)(0) & 0x0000ff00) << 8) | (((__uint32_t)(0) & 0x000000ff) << 24))) +}; +typedef FourCharCode SecProtocolType; enum +{ + kSecProtocolTypeFTP = 'ftp ', + kSecProtocolTypeFTPAccount = 'ftpa', + kSecProtocolTypeHTTP = 'http', + kSecProtocolTypeIRC = 'irc ', + kSecProtocolTypeNNTP = 'nntp', + kSecProtocolTypePOP3 = 'pop3', + kSecProtocolTypeSMTP = 'smtp', + kSecProtocolTypeSOCKS = 'sox ', + kSecProtocolTypeIMAP = 'imap', + kSecProtocolTypeLDAP = 'ldap', + kSecProtocolTypeAppleTalk = 'atlk', + kSecProtocolTypeAFP = 'afp ', + kSecProtocolTypeTelnet = 'teln', + kSecProtocolTypeSSH = 'ssh ', + kSecProtocolTypeFTPS = 'ftps', + kSecProtocolTypeHTTPS = 'htps', + kSecProtocolTypeHTTPProxy = 'htpx', + kSecProtocolTypeHTTPSProxy = 'htsx', + kSecProtocolTypeFTPProxy = 'ftpx', + kSecProtocolTypeCIFS = 'cifs', + kSecProtocolTypeSMB = 'smb ', + kSecProtocolTypeRTSP = 'rtsp', + kSecProtocolTypeRTSPProxy = 'rtsx', + kSecProtocolTypeDAAP = 'daap', + kSecProtocolTypeEPPC = 'eppc', + kSecProtocolTypeIPP = 'ipp ', + kSecProtocolTypeNNTPS = 'ntps', + kSecProtocolTypeLDAPS = 'ldps', + kSecProtocolTypeTelnetS = 'tels', + kSecProtocolTypeIMAPS = 'imps', + kSecProtocolTypeIRCS = 'ircs', + kSecProtocolTypePOP3S = 'pops', + kSecProtocolTypeCVSpserver = 'cvsp', + kSecProtocolTypeSVN = 'svn ', + kSecProtocolTypeAny = 0 +}; +typedef UInt32 SecKeychainEvent; enum +{ + kSecLockEvent = 1, + kSecUnlockEvent = 2, + kSecAddEvent = 3, + kSecDeleteEvent = 4, + kSecUpdateEvent = 5, + kSecPasswordChangedEvent = 6, + kSecDefaultChangedEvent = 9, + kSecDataAccessEvent = 10, + kSecKeychainListChangedEvent = 11, + kSecTrustSettingsChangedEvent = 12 +}; +typedef UInt32 SecKeychainEventMask; enum +{ + kSecLockEventMask = 1 << kSecLockEvent, + kSecUnlockEventMask = 1 << kSecUnlockEvent, + kSecAddEventMask = 1 << kSecAddEvent, + kSecDeleteEventMask = 1 << kSecDeleteEvent, + kSecUpdateEventMask = 1 << kSecUpdateEvent, + kSecPasswordChangedEventMask = 1 << kSecPasswordChangedEvent, + kSecDefaultChangedEventMask = 1 << kSecDefaultChangedEvent, + kSecDataAccessEventMask = 1 << kSecDataAccessEvent, + kSecKeychainListChangedMask = 1 << kSecKeychainListChangedEvent, + kSecTrustSettingsChangedEventMask = 1 << kSecTrustSettingsChangedEvent, + kSecEveryEventMask = 0xffffffff +}; +struct SecKeychainCallbackInfo +{ + UInt32 version; + SecKeychainItemRef _Nonnull item; + SecKeychainRef _Nonnull keychain; + pid_t pid; +}; +typedef struct SecKeychainCallbackInfo SecKeychainCallbackInfo; + + + + + + +CFTypeID SecKeychainGetTypeID(void); + + + + + + + +OSStatus SecKeychainGetVersion(UInt32 * _Nonnull returnVers); +OSStatus SecKeychainOpen(const char *pathName, SecKeychainRef * _Nonnull __attribute__((cf_returns_retained)) keychain); +OSStatus SecKeychainCreate(const char *pathName, UInt32 passwordLength, const void * _Nullable password, Boolean promptUser, SecAccessRef _Nullable initialAccess, SecKeychainRef * _Nonnull __attribute__((cf_returns_retained)) keychain); + + + + + + + +OSStatus SecKeychainDelete(SecKeychainRef _Nullable keychainOrArray); +OSStatus SecKeychainSetSettings(SecKeychainRef _Nullable keychain, const SecKeychainSettings *newSettings); +OSStatus SecKeychainCopySettings(SecKeychainRef _Nullable keychain, SecKeychainSettings *outSettings); +OSStatus SecKeychainUnlock(SecKeychainRef _Nullable keychain, UInt32 passwordLength, const void * _Nullable password, Boolean usePassword); + + + + + + + +OSStatus SecKeychainLock(SecKeychainRef _Nullable keychain); + + + + + + +OSStatus SecKeychainLockAll(void); + + + + + + + +OSStatus SecKeychainCopyDefault(SecKeychainRef * _Nonnull __attribute__((cf_returns_retained)) keychain); + + + + + + + +OSStatus SecKeychainSetDefault(SecKeychainRef _Nullable keychain); + + + + + + + +OSStatus SecKeychainCopySearchList(CFArrayRef * _Nonnull __attribute__((cf_returns_retained)) searchList); + + + + + + + +OSStatus SecKeychainSetSearchList(CFArrayRef searchList); + + + + + + +typedef int SecPreferencesDomain; enum { + kSecPreferencesDomainUser, + kSecPreferencesDomainSystem, + kSecPreferencesDomainCommon, + kSecPreferencesDomainDynamic +}; + +OSStatus SecKeychainCopyDomainDefault(SecPreferencesDomain domain, SecKeychainRef * _Nonnull __attribute__((cf_returns_retained)) keychain); +OSStatus SecKeychainSetDomainDefault(SecPreferencesDomain domain, SecKeychainRef _Nullable keychain); +OSStatus SecKeychainCopyDomainSearchList(SecPreferencesDomain domain, CFArrayRef * _Nonnull __attribute__((cf_returns_retained)) searchList); +OSStatus SecKeychainSetDomainSearchList(SecPreferencesDomain domain, CFArrayRef searchList); +OSStatus SecKeychainSetPreferenceDomain(SecPreferencesDomain domain); +OSStatus SecKeychainGetPreferenceDomain(SecPreferencesDomain *domain); +OSStatus SecKeychainGetStatus(SecKeychainRef _Nullable keychain, SecKeychainStatus *keychainStatus); +OSStatus SecKeychainGetPath(SecKeychainRef _Nullable keychain, UInt32 *ioPathLength, char *pathName); +OSStatus SecKeychainAttributeInfoForItemID(SecKeychainRef _Nullable keychain, UInt32 itemID, SecKeychainAttributeInfo * _Nullable * _Nonnull info); + + + + + + + +OSStatus SecKeychainFreeAttributeInfo(SecKeychainAttributeInfo *info); +typedef OSStatus (*SecKeychainCallback)(SecKeychainEvent keychainEvent, SecKeychainCallbackInfo *info, void * _Nullable context); +OSStatus SecKeychainAddCallback(SecKeychainCallback callbackFunction, SecKeychainEventMask eventMask, void * _Nullable userContext); + + + + + + + +OSStatus SecKeychainRemoveCallback(SecKeychainCallback callbackFunction); +OSStatus SecKeychainAddInternetPassword(SecKeychainRef _Nullable keychain, UInt32 serverNameLength, const char * _Nullable serverName, UInt32 securityDomainLength, const char * _Nullable securityDomain, UInt32 accountNameLength, const char * _Nullable accountName, UInt32 pathLength, const char * _Nullable path, UInt16 port, SecProtocolType protocol, SecAuthenticationType authenticationType, UInt32 passwordLength, const void *passwordData, SecKeychainItemRef * _Nullable __attribute__((cf_returns_retained)) itemRef); +OSStatus SecKeychainFindInternetPassword(CFTypeRef _Nullable keychainOrArray, UInt32 serverNameLength, const char * _Nullable serverName, UInt32 securityDomainLength, const char * _Nullable securityDomain, UInt32 accountNameLength, const char * _Nullable accountName, UInt32 pathLength, const char * _Nullable path, UInt16 port, SecProtocolType protocol, SecAuthenticationType authenticationType, UInt32 * _Nullable passwordLength, void * _Nullable * _Nullable passwordData, SecKeychainItemRef * _Nullable __attribute__((cf_returns_retained)) itemRef); +OSStatus SecKeychainAddGenericPassword(SecKeychainRef _Nullable keychain, UInt32 serviceNameLength, const char * _Nullable serviceName, UInt32 accountNameLength, const char * _Nullable accountName, UInt32 passwordLength, const void *passwordData, SecKeychainItemRef * _Nullable __attribute__((cf_returns_retained)) itemRef); +OSStatus SecKeychainFindGenericPassword(CFTypeRef _Nullable keychainOrArray, UInt32 serviceNameLength, const char * _Nullable serviceName, UInt32 accountNameLength, const char * _Nullable accountName, UInt32 * _Nullable passwordLength, void * _Nullable * _Nullable passwordData, SecKeychainItemRef * _Nullable __attribute__((cf_returns_retained)) itemRef); +OSStatus SecKeychainSetUserInteractionAllowed(Boolean state); + + + + + + + +OSStatus SecKeychainGetUserInteractionAllowed(Boolean *state); +OSStatus SecKeychainGetCSPHandle(SecKeychainRef _Nullable keychain, CSSM_CSP_HANDLE *cspHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecKeychainGetDLDBHandle(SecKeychainRef _Nullable keychain, CSSM_DL_DB_HANDLE *dldbHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecKeychainCopyAccess(SecKeychainRef _Nullable keychain, SecAccessRef * _Nonnull __attribute__((cf_returns_retained)) access); +OSStatus SecKeychainSetAccess(SecKeychainRef _Nullable keychain, SecAccessRef access); +typedef FourCharCode SecItemClass; enum +{ + kSecInternetPasswordItemClass = 'inet', + kSecGenericPasswordItemClass = 'genp', + kSecAppleSharePasswordItemClass __attribute__((availability(macosx,introduced=10_0,deprecated=10_9,message="" ))) = 'ashp', + kSecCertificateItemClass = 0x80001000, + kSecPublicKeyItemClass = 0x0000000F, + kSecPrivateKeyItemClass = 0x00000010, + kSecSymmetricKeyItemClass = 0x00000011 +}; +typedef FourCharCode SecItemAttr; enum +{ + kSecCreationDateItemAttr = 'cdat', + kSecModDateItemAttr = 'mdat', + kSecDescriptionItemAttr = 'desc', + kSecCommentItemAttr = 'icmt', + kSecCreatorItemAttr = 'crtr', + kSecTypeItemAttr = 'type', + kSecScriptCodeItemAttr = 'scrp', + kSecLabelItemAttr = 'labl', + kSecInvisibleItemAttr = 'invi', + kSecNegativeItemAttr = 'nega', + kSecCustomIconItemAttr = 'cusi', + kSecAccountItemAttr = 'acct', + kSecServiceItemAttr = 'svce', + kSecGenericItemAttr = 'gena', + kSecSecurityDomainItemAttr = 'sdmn', + kSecServerItemAttr = 'srvr', + kSecAuthenticationTypeItemAttr = 'atyp', + kSecPortItemAttr = 'port', + kSecPathItemAttr = 'path', + kSecVolumeItemAttr = 'vlme', + kSecAddressItemAttr = 'addr', + kSecSignatureItemAttr = 'ssig', + kSecProtocolItemAttr = 'ptcl', + kSecCertificateType = 'ctyp', + kSecCertificateEncoding = 'cenc', + kSecCrlType = 'crtp', + kSecCrlEncoding = 'crnc', + kSecAlias = 'alis' +}; + + + + + +typedef UInt8 SecAFPServerSignature[16]; + + + + + +typedef UInt8 SecPublicKeyHash[20]; + + + + + + + +CFTypeID SecKeychainItemGetTypeID(void); +OSStatus SecKeychainItemModifyAttributesAndData(SecKeychainItemRef itemRef, const SecKeychainAttributeList * _Nullable attrList, UInt32 length, const void * _Nullable data); +OSStatus SecKeychainItemCreateFromContent(SecItemClass itemClass, SecKeychainAttributeList *attrList, + UInt32 length, const void * _Nullable data, SecKeychainRef _Nullable keychainRef, + SecAccessRef _Nullable initialAccess, SecKeychainItemRef * _Nullable __attribute__((cf_returns_retained)) itemRef); +OSStatus SecKeychainItemModifyContent(SecKeychainItemRef itemRef, const SecKeychainAttributeList * _Nullable attrList, UInt32 length, const void * _Nullable data); +OSStatus SecKeychainItemCopyContent(SecKeychainItemRef itemRef, SecItemClass * _Nullable itemClass, SecKeychainAttributeList * _Nullable attrList, UInt32 * _Nullable length, void * _Nullable * _Nullable outData); + + + + + + + +OSStatus SecKeychainItemFreeContent(SecKeychainAttributeList * _Nullable attrList, void * _Nullable data); +OSStatus SecKeychainItemCopyAttributesAndData(SecKeychainItemRef itemRef, SecKeychainAttributeInfo * _Nullable info, SecItemClass * _Nullable itemClass, SecKeychainAttributeList * _Nullable * _Nullable attrList, UInt32 * _Nullable length, void * _Nullable * _Nullable outData); +OSStatus SecKeychainItemFreeAttributesAndData(SecKeychainAttributeList * _Nullable attrList, void * _Nullable data); +OSStatus SecKeychainItemDelete(SecKeychainItemRef itemRef); +OSStatus SecKeychainItemCopyKeychain(SecKeychainItemRef itemRef, SecKeychainRef * _Nonnull __attribute__((cf_returns_retained)) keychainRef); +OSStatus SecKeychainItemCreateCopy(SecKeychainItemRef itemRef, SecKeychainRef _Nullable destKeychainRef, + SecAccessRef _Nullable initialAccess, SecKeychainItemRef * _Nonnull __attribute__((cf_returns_retained)) itemCopy); +OSStatus SecKeychainItemCreatePersistentReference(SecKeychainItemRef itemRef, CFDataRef * _Nonnull __attribute__((cf_returns_retained)) persistentItemRef); +OSStatus SecKeychainItemCopyFromPersistentReference(CFDataRef persistentItemRef, SecKeychainItemRef * _Nonnull __attribute__((cf_returns_retained)) itemRef); +OSStatus SecKeychainItemGetDLDBHandle(SecKeychainItemRef keyItemRef, CSSM_DL_DB_HANDLE * _Nonnull dldbHandle) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecKeychainItemGetUniqueRecordID(SecKeychainItemRef itemRef, const CSSM_DB_UNIQUE_RECORD * _Nullable * _Nonnull uniqueRecordID) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecKeychainItemCopyAccess(SecKeychainItemRef itemRef, SecAccessRef * _Nonnull __attribute__((cf_returns_retained)) access); +OSStatus SecKeychainItemSetAccess(SecKeychainItemRef itemRef, SecAccessRef access); +CFTypeID SecKeychainSearchGetTypeID(void) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecKeychainSearchCreateFromAttributes(CFTypeRef _Nullable keychainOrArray, SecItemClass itemClass, const SecKeychainAttributeList * _Nullable attrList, SecKeychainSearchRef * _Nonnull __attribute__((cf_returns_retained)) searchRef) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecKeychainSearchCopyNext(SecKeychainSearchRef searchRef, SecKeychainItemRef * _Nonnull __attribute__((cf_returns_retained)) itemRef) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern const CFStringRef kSecPolicyAppleX509Basic + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPolicyAppleSSL + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPolicyAppleSMIME + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPolicyAppleEAP + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPolicyAppleIPsec + __attribute__((availability(macosx,introduced=10.7))); + +extern const CFStringRef kSecPolicyAppleiChat + __attribute__((availability(macosx,introduced=10.7,deprecated=10.9))); + +extern const CFStringRef kSecPolicyApplePKINITClient + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPolicyApplePKINITServer + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPolicyAppleCodeSigning + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPolicyMacAppStoreReceipt + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPolicyAppleIDValidation + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPolicyAppleTimeStamping + __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kSecPolicyAppleRevocation + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecPolicyApplePassbookSigning + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecPolicyApplePayIssuerEncryption + __attribute__((availability(macosx,introduced=10.11))); +extern const CFStringRef kSecPolicyOid + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPolicyName + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPolicyClient + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPolicyRevocationFlags + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecPolicyTeamIdentifier + __attribute__((availability(macosx,introduced=10.9))); + + + + + + + +CFTypeID SecPolicyGetTypeID(void) + __attribute__((availability(macosx,introduced=10.3))); +_Nullable +CFDictionaryRef SecPolicyCopyProperties(SecPolicyRef policyRef) + __attribute__((availability(macosx,introduced=10.7))); + + + + + + + +SecPolicyRef SecPolicyCreateBasicX509(void) + __attribute__((availability(macosx,introduced=10.6))); +SecPolicyRef SecPolicyCreateSSL(Boolean server, CFStringRef _Nullable hostname) + __attribute__((availability(macosx,introduced=10.6))); +enum { + kSecRevocationOCSPMethod = (1 << 0), + kSecRevocationCRLMethod = (1 << 1), + kSecRevocationPreferCRL = (1 << 2), + kSecRevocationRequirePositiveResponse = (1 << 3), + kSecRevocationNetworkAccessDisabled = (1 << 4), + kSecRevocationUseAnyAvailableMethod = (kSecRevocationOCSPMethod | + kSecRevocationCRLMethod) +}; +_Nullable +SecPolicyRef SecPolicyCreateRevocation(CFOptionFlags revocationFlags) + __attribute__((availability(macosx,introduced=10.9))); +_Nullable +SecPolicyRef SecPolicyCreateWithProperties(CFTypeRef policyIdentifier, + CFDictionaryRef _Nullable properties) + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecPolicyKU_DigitalSignature + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPolicyKU_NonRepudiation + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPolicyKU_KeyEncipherment + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPolicyKU_DataEncipherment + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPolicyKU_KeyAgreement + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPolicyKU_KeyCertSign + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPolicyKU_CRLSign + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPolicyKU_EncipherOnly + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPolicyKU_DecipherOnly + __attribute__((availability(macosx,introduced=10.7))); +_Nullable +SecPolicyRef SecPolicyCreateWithOID(CFTypeRef policyOID) + __attribute__((availability(macosx,introduced=10.7,deprecated=10.9))); +OSStatus SecPolicyGetOID(SecPolicyRef policyRef, CSSM_OID *oid) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.7))); +OSStatus SecPolicyGetValue(SecPolicyRef policyRef, CSSM_DATA *value) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.7))); +OSStatus SecPolicySetValue(SecPolicyRef policyRef, const CSSM_DATA *value) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.7))); +OSStatus SecPolicySetProperties(SecPolicyRef policyRef, + CFDictionaryRef properties) + __attribute__((availability(macosx,introduced=10.7,deprecated=10.9))); +OSStatus SecPolicyGetTPHandle(SecPolicyRef policyRef, CSSM_TP_HANDLE *tpHandle) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.7))); +typedef struct __attribute__((objc_bridge(id))) OpaquePolicySearchRef *SecPolicySearchRef; + + + + + + + +CFTypeID SecPolicySearchGetTypeID(void) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecPolicySearchCreate(CSSM_CERT_TYPE certType, const CSSM_OID *policyOID, const CSSM_DATA * _Nullable value, SecPolicySearchRef * _Nonnull __attribute__((cf_returns_retained)) searchRef) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecPolicySearchCopyNext(SecPolicySearchRef searchRef, SecPolicyRef * _Nonnull __attribute__((cf_returns_retained)) policyRef) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +typedef uint32_t SecTrustResultType; enum { + kSecTrustResultInvalid __attribute__((availability(macosx,introduced=10_3))) = 0, + kSecTrustResultProceed __attribute__((availability(macosx,introduced=10_3))) = 1, + kSecTrustResultConfirm __attribute__((availability(macosx,introduced=10_3,deprecated=10_9,message="" ))) = 2, + kSecTrustResultDeny __attribute__((availability(macosx,introduced=10_3))) = 3, + kSecTrustResultUnspecified __attribute__((availability(macosx,introduced=10_3))) = 4, + kSecTrustResultRecoverableTrustFailure __attribute__((availability(macosx,introduced=10_3))) = 5, + kSecTrustResultFatalTrustFailure __attribute__((availability(macosx,introduced=10_3))) = 6, + kSecTrustResultOtherError __attribute__((availability(macosx,introduced=10_3))) = 7 +}; + + + + + +typedef struct __attribute__((objc_bridge(id))) __SecTrust *SecTrustRef; +extern const CFStringRef kSecPropertyTypeTitle + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecPropertyTypeError + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecTrustEvaluationDate + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecTrustExtendedValidation + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecTrustOrganizationName + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecTrustResultValue + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecTrustRevocationChecked + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecTrustRevocationValidUntilDate + __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kSecTrustCertificateTransparency + __attribute__((availability(macosx,introduced=10.11))); +extern const CFStringRef kSecTrustCertificateTransparencyWhiteList + __attribute__((availability(macosx,introduced=10.12))); +typedef void (^SecTrustCallback)(SecTrustRef trustRef, SecTrustResultType trustResult); +CFTypeID SecTrustGetTypeID(void) + __attribute__((availability(macosx,introduced=10.3))); +OSStatus SecTrustCreateWithCertificates(CFTypeRef certificates, + CFTypeRef _Nullable policies, SecTrustRef * _Nonnull __attribute__((cf_returns_retained)) trust) + __attribute__((availability(macosx,introduced=10.3))); +OSStatus SecTrustSetPolicies(SecTrustRef trust, CFTypeRef policies) + __attribute__((availability(macosx,introduced=10.3))); +OSStatus SecTrustCopyPolicies(SecTrustRef trust, CFArrayRef * _Nonnull __attribute__((cf_returns_retained)) policies) + __attribute__((availability(macosx,introduced=10.3))); +OSStatus SecTrustSetNetworkFetchAllowed(SecTrustRef trust, + Boolean allowFetch) + __attribute__((availability(macosx,introduced=10.9))); +OSStatus SecTrustGetNetworkFetchAllowed(SecTrustRef trust, + Boolean *allowFetch) + __attribute__((availability(macosx,introduced=10.9))); +OSStatus SecTrustSetAnchorCertificates(SecTrustRef trust, + CFArrayRef anchorCertificates) + __attribute__((availability(macosx,introduced=10.3))); +OSStatus SecTrustSetAnchorCertificatesOnly(SecTrustRef trust, + Boolean anchorCertificatesOnly) + __attribute__((availability(macosx,introduced=10.6))); +OSStatus SecTrustCopyCustomAnchorCertificates(SecTrustRef trust, + CFArrayRef * _Nonnull __attribute__((cf_returns_retained)) anchors) + __attribute__((availability(macosx,introduced=10.5))); +OSStatus SecTrustSetVerifyDate(SecTrustRef trust, CFDateRef verifyDate) + __attribute__((availability(macosx,introduced=10.3))); +CFAbsoluteTime SecTrustGetVerifyTime(SecTrustRef trust) + __attribute__((availability(macosx,introduced=10.6))); +OSStatus SecTrustEvaluate(SecTrustRef trust, SecTrustResultType * _Nullable result) + __attribute__((availability(macosx,introduced=10.3))); +OSStatus SecTrustEvaluateAsync(SecTrustRef trust, + dispatch_queue_t _Nullable queue, SecTrustCallback result) + __attribute__((availability(macosx,introduced=10.7))); +OSStatus SecTrustGetTrustResult(SecTrustRef trust, + SecTrustResultType *result) + __attribute__((availability(macosx,introduced=10.7))); +_Nullable +SecKeyRef SecTrustCopyPublicKey(SecTrustRef trust) + __attribute__((availability(macosx,introduced=10.7))); +CFIndex SecTrustGetCertificateCount(SecTrustRef trust) + __attribute__((availability(macosx,introduced=10.7))); +_Nullable +SecCertificateRef SecTrustGetCertificateAtIndex(SecTrustRef trust, CFIndex ix) + __attribute__((availability(macosx,introduced=10.7))); +CFDataRef SecTrustCopyExceptions(SecTrustRef trust) + __attribute__((availability(macosx,introduced=10.9))); +_Bool SecTrustSetExceptions(SecTrustRef trust, CFDataRef _Nullable exceptions) + __attribute__((availability(macosx,introduced=10.9))); +_Nullable +CFArrayRef SecTrustCopyProperties(SecTrustRef trust) + __attribute__((availability(macosx,introduced=10.7))); +_Nullable +CFDictionaryRef SecTrustCopyResult(SecTrustRef trust) + __attribute__((availability(macosx,introduced=10.9))); +OSStatus SecTrustSetOCSPResponse(SecTrustRef trust, CFTypeRef _Nullable responseData) + __attribute__((availability(macosx,introduced=10.9))); +typedef SecTrustResultType SecTrustUserSetting + __attribute__((availability(macosx,introduced=10.2,deprecated=10.9))); +typedef uint32_t SecTrustOptionFlags; enum +{ + kSecTrustOptionAllowExpired = 0x00000001, + kSecTrustOptionLeafIsCA = 0x00000002, + kSecTrustOptionFetchIssuerFromNet = 0x00000004, + kSecTrustOptionAllowExpiredRoot = 0x00000008, + kSecTrustOptionRequireRevPerCert = 0x00000010, + kSecTrustOptionUseTrustSettings = 0x00000020, + kSecTrustOptionImplicitAnchors = 0x00000040 +}; +OSStatus SecTrustSetOptions(SecTrustRef trustRef, SecTrustOptionFlags options) + __attribute__((availability(macosx,introduced=10.7))); +OSStatus SecTrustSetParameters(SecTrustRef trustRef, + CSSM_TP_ACTION action, CFDataRef actionData) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.7))); +OSStatus SecTrustSetKeychains(SecTrustRef trust, CFTypeRef _Nullable keychainOrArray) + __attribute__((availability(macosx,introduced=10.3))); +OSStatus SecTrustGetResult(SecTrustRef trustRef, SecTrustResultType * _Nullable result, + CFArrayRef * _Nullable __attribute__((cf_returns_retained)) certChain, CSSM_TP_APPLE_EVIDENCE_INFO * _Nullable * _Nullable statusChain) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.7))); +OSStatus SecTrustGetCssmResult(SecTrustRef trust, + CSSM_TP_VERIFY_CONTEXT_RESULT_PTR _Nullable * _Nonnull result) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.7))); +OSStatus SecTrustGetCssmResultCode(SecTrustRef trust, OSStatus *resultCode) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.7))); +OSStatus SecTrustGetTPHandle(SecTrustRef trust, CSSM_TP_HANDLE *handle) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.7))); +OSStatus SecTrustCopyAnchorCertificates(CFArrayRef * _Nonnull __attribute__((cf_returns_retained)) anchors) + __attribute__((availability(macosx,introduced=10.3))); +CFTypeID SecTrustedApplicationGetTypeID(void); +OSStatus SecTrustedApplicationCreateFromPath(const char * _Nullable path, SecTrustedApplicationRef * _Nonnull __attribute__((cf_returns_retained)) app); +OSStatus SecTrustedApplicationCopyData(SecTrustedApplicationRef appRef, CFDataRef * _Nonnull __attribute__((cf_returns_retained)) data); +OSStatus SecTrustedApplicationSetData(SecTrustedApplicationRef appRef, CFDataRef data); +typedef uint32 SecTrustSettingsKeyUsage; enum { + + kSecTrustSettingsKeyUseSignature = 0x00000001, + + kSecTrustSettingsKeyUseEnDecryptData = 0x00000002, + + kSecTrustSettingsKeyUseEnDecryptKey = 0x00000004, + + kSecTrustSettingsKeyUseSignCert = 0x00000008, + + kSecTrustSettingsKeyUseSignRevocation = 0x00000010, + + kSecTrustSettingsKeyUseKeyExchange = 0x00000020, + + kSecTrustSettingsKeyUseAny = 0xffffffff +}; + + + + +typedef uint32 SecTrustSettingsResult; enum { + kSecTrustSettingsResultInvalid = 0, + + kSecTrustSettingsResultTrustRoot, + kSecTrustSettingsResultTrustAsRoot, + kSecTrustSettingsResultDeny, + kSecTrustSettingsResultUnspecified + +}; + + + + + + +typedef uint32 SecTrustSettingsDomain; enum { + kSecTrustSettingsDomainUser = 0, + kSecTrustSettingsDomainAdmin, + kSecTrustSettingsDomainSystem +}; +OSStatus SecTrustSettingsCopyTrustSettings( + SecCertificateRef certRef, + SecTrustSettingsDomain domain, + CFArrayRef * _Nonnull __attribute__((cf_returns_retained)) trustSettings); +OSStatus SecTrustSettingsSetTrustSettings( + SecCertificateRef certRef, + SecTrustSettingsDomain domain, + CFTypeRef _Nullable trustSettingsDictOrArray); + + + + + +OSStatus SecTrustSettingsRemoveTrustSettings( + SecCertificateRef certRef, + SecTrustSettingsDomain domain); +OSStatus SecTrustSettingsCopyCertificates( + SecTrustSettingsDomain domain, + CFArrayRef * _Nullable __attribute__((cf_returns_retained)) certArray); + + + + + + + +OSStatus SecTrustSettingsCopyModificationDate( + SecCertificateRef certRef, + SecTrustSettingsDomain domain, + CFDateRef * _Nonnull __attribute__((cf_returns_retained)) modificationDate); + + + + + + + +OSStatus SecTrustSettingsCreateExternalRepresentation( + SecTrustSettingsDomain domain, + CFDataRef * _Nonnull __attribute__((cf_returns_retained)) trustSettings); + + + + + +OSStatus SecTrustSettingsImportExternalRepresentation( + SecTrustSettingsDomain domain, + CFDataRef trustSettings); +typedef uint32_t SecExternalFormat; enum +{ + + + + + kSecFormatUnknown = 0, + + + + + + kSecFormatOpenSSL, + kSecFormatSSH, + kSecFormatBSAFE, + + + kSecFormatRawKey, + + + kSecFormatWrappedPKCS8, + kSecFormatWrappedOpenSSL, + kSecFormatWrappedSSH, + kSecFormatWrappedLSH, + + + kSecFormatX509Cert, + + + kSecFormatPEMSequence, + + kSecFormatPKCS7, + kSecFormatPKCS12, + kSecFormatNetscapeCertSequence, + + + kSecFormatSSHv2 + + +}; + + + + +typedef uint32_t SecExternalItemType; enum { + kSecItemTypeUnknown, + kSecItemTypePrivateKey, + kSecItemTypePublicKey, + kSecItemTypeSessionKey, + kSecItemTypeCertificate, + kSecItemTypeAggregate +}; + + + + +typedef uint32_t SecItemImportExportFlags; enum +{ + kSecItemPemArmour = 0x00000001, +}; + + + + +typedef uint32_t SecKeyImportExportFlags; enum +{ + + + + + kSecKeyImportOnlyOne = 0x00000001, + kSecKeySecurePassphrase = 0x00000002, + + + + + + + + kSecKeyNoAccessControl = 0x00000004 +}; +typedef struct +{ + + uint32_t version; + SecKeyImportExportFlags flags; + CFTypeRef passphrase; + + + CFStringRef alertTitle; + CFStringRef alertPrompt; + + + SecAccessRef _Nullable accessRef; + + CSSM_KEYUSE keyUsage; + + CSSM_KEYATTR_FLAGS keyAttributes; +} SecKeyImportExportParameters; + + +typedef struct +{ + + uint32_t version; + SecKeyImportExportFlags flags; + CFTypeRef passphrase; + + + CFStringRef alertTitle; + CFStringRef alertPrompt; + + + SecAccessRef _Nullable accessRef; + + CFArrayRef _Nullable keyUsage; + + + + CFArrayRef _Nullable keyAttributes; + + + + + + + +} SecItemImportExportKeyParameters; +OSStatus SecKeychainItemExport( + CFTypeRef keychainItemOrArray, + SecExternalFormat outputFormat, + SecItemImportExportFlags flags, + const SecKeyImportExportParameters * _Nullable keyParams, + CFDataRef * _Nonnull __attribute__((cf_returns_retained)) exportedData) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecItemExport( + CFTypeRef secItemOrArray, + SecExternalFormat outputFormat, + SecItemImportExportFlags flags, + const SecItemImportExportKeyParameters * _Nullable keyParams, + CFDataRef * _Nonnull __attribute__((cf_returns_retained)) exportedData) + __attribute__((availability(macosx,introduced=10.7))); +OSStatus SecKeychainItemImport( + CFDataRef importedData, + CFStringRef _Nullable fileNameOrExtension, + SecExternalFormat * _Nullable inputFormat, + SecExternalItemType * _Nullable itemType, + SecItemImportExportFlags flags, + const SecKeyImportExportParameters * _Nullable keyParams, + SecKeychainRef _Nullable importKeychain, + CFArrayRef * _Nullable __attribute__((cf_returns_retained)) outItems) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +OSStatus SecItemImport( + CFDataRef importedData, + CFStringRef _Nullable fileNameOrExtension, + SecExternalFormat * _Nullable inputFormat, + SecExternalItemType * _Nullable itemType, + SecItemImportExportFlags flags, + const SecItemImportExportKeyParameters * _Nullable keyParams, + SecKeychainRef _Nullable importKeychain, + CFArrayRef * _Nullable __attribute__((cf_returns_retained)) outItems) + __attribute__((availability(macosx,introduced=10.7))); + + + + + + + +extern const CFStringRef kSecImportExportPassphrase; +extern const CFStringRef kSecImportExportKeychain; +extern const CFStringRef kSecImportExportAccess; +extern const CFStringRef kSecImportItemLabel; +extern const CFStringRef kSecImportItemKeyID; +extern const CFStringRef kSecImportItemTrust; +extern const CFStringRef kSecImportItemCertChain; +extern const CFStringRef kSecImportItemIdentity; +OSStatus SecPKCS12Import(CFDataRef pkcs12_data, CFDictionaryRef options, CFArrayRef * _Nonnull __attribute__((cf_returns_retained)) items); +typedef const struct __SecRandom * SecRandomRef; + + + +extern const SecRandomRef kSecRandomDefault + __attribute__((availability(macosx,introduced=10.7))); +int SecRandomCopyBytes(SecRandomRef _Nullable rnd, size_t count, uint8_t *bytes) + __attribute__ ((warn_unused_result)) + __attribute__((availability(macosx,introduced=10.7))); + + +enum { + errSecCSUnimplemented = -67072, + errSecCSInvalidObjectRef = -67071, + errSecCSInvalidFlags = -67070, + errSecCSObjectRequired = -67069, + errSecCSStaticCodeNotFound = -67068, + errSecCSUnsupportedGuestAttributes = -67067, + errSecCSInvalidAttributeValues = -67066, + errSecCSNoSuchCode = -67065, + errSecCSMultipleGuests = -67064, + errSecCSGuestInvalid = -67063, + errSecCSUnsigned = -67062, + errSecCSSignatureFailed = -67061, + errSecCSSignatureNotVerifiable = -67060, + errSecCSSignatureUnsupported = -67059, + errSecCSBadDictionaryFormat = -67058, + errSecCSResourcesNotSealed = -67057, + errSecCSResourcesNotFound = -67056, + errSecCSResourcesInvalid = -67055, + errSecCSBadResource = -67054, + errSecCSResourceRulesInvalid = -67053, + errSecCSReqInvalid = -67052, + errSecCSReqUnsupported = -67051, + errSecCSReqFailed = -67050, + errSecCSBadObjectFormat = -67049, + errSecCSInternalError = -67048, + errSecCSHostReject = -67047, + errSecCSNotAHost = -67046, + errSecCSSignatureInvalid = -67045, + errSecCSHostProtocolRelativePath = -67044, + errSecCSHostProtocolContradiction = -67043, + errSecCSHostProtocolDedicationError = -67042, + errSecCSHostProtocolNotProxy = -67041, + errSecCSHostProtocolStateError = -67040, + errSecCSHostProtocolUnrelated = -67039, + + errSecCSNotSupported = -67037, + errSecCSCMSTooLarge = -67036, + errSecCSHostProtocolInvalidHash = -67035, + errSecCSStaticCodeChanged = -67034, + errSecCSDBDenied = -67033, + errSecCSDBAccess = -67032, + errSecCSSigDBDenied = errSecCSDBDenied, + errSecCSSigDBAccess = errSecCSDBAccess, + errSecCSHostProtocolInvalidAttribute = -67031, + errSecCSInfoPlistFailed = -67030, + errSecCSNoMainExecutable = -67029, + errSecCSBadBundleFormat = -67028, + errSecCSNoMatches = -67027, + errSecCSFileHardQuarantined = -67026, + errSecCSOutdated = -67025, + errSecCSDbCorrupt = -67024, + errSecCSResourceDirectoryFailed = -67023, + errSecCSUnsignedNestedCode = -67022, + errSecCSBadNestedCode = -67021, + errSecCSBadCallbackValue = -67020, + errSecCSHelperFailed = -67019, + errSecCSVetoed = -67018, + errSecCSBadLVArch = -67017, + errSecCSResourceNotSupported = -67016, + errSecCSRegularFile = -67015, + errSecCSUnsealedAppRoot = -67014, + errSecCSWeakResourceRules = -67013, + errSecCSDSStoreSymlink = -67012, + errSecCSAmbiguousBundleFormat = -67011, + errSecCSBadMainExecutable = -67010, + errSecCSBadFrameworkVersion = -67009, + errSecCSUnsealedFrameworkRoot = -67008, + errSecCSWeakResourceEnvelope = -67007, + errSecCSCancelled = -67006, + errSecCSInvalidPlatform = -67005, + errSecCSTooBig = -67004, + errSecCSInvalidSymlink = -67003, + errSecCSNotAppLike = -67002, + errSecCSBadDiskImageFormat = -67001, + errSecCSUnsupportedDigestAlgorithm = -67000, + errSecCSInvalidAssociatedFileData = -66999, + errSecCSInvalidTeamIdentifier = -66998, + errSecCSBadTeamIdentifier = -66997, +}; +extern const CFStringRef kSecCFErrorArchitecture; +extern const CFStringRef kSecCFErrorPattern; +extern const CFStringRef kSecCFErrorResourceSeal; +extern const CFStringRef kSecCFErrorResourceAdded; +extern const CFStringRef kSecCFErrorResourceAltered; +extern const CFStringRef kSecCFErrorResourceMissing; +extern const CFStringRef kSecCFErrorResourceSideband; +extern const CFStringRef kSecCFErrorInfoPlist; +extern const CFStringRef kSecCFErrorGuestAttributes; +extern const CFStringRef kSecCFErrorRequirementSyntax; +extern const CFStringRef kSecCFErrorPath; +typedef struct __attribute__((objc_bridge(id))) __SecCode *SecCodeRef; + + + + + +typedef struct __attribute__((objc_bridge(id))) __SecCode const *SecStaticCodeRef; + + + + + +typedef struct __attribute__((objc_bridge(id))) __SecRequirement *SecRequirementRef; +typedef u_int32_t SecGuestRef; + +enum { + kSecNoGuest = 0, +}; +typedef uint32_t SecCSFlags; enum { + kSecCSDefaultFlags = 0, + + kSecCSConsiderExpiration = 1U << 31, + kSecCSEnforceRevocationChecks = 1 << 30, + kSecCSNoNetworkAccess = 1 << 29, + kSecCSReportProgress = 1 << 28, + kSecCSCheckTrustedAnchors = 1 << 27, + kSecCSQuickCheck = 1 << 26, +}; +typedef uint32_t SecCodeSignatureFlags; enum { + kSecCodeSignatureHost = 0x0001, + kSecCodeSignatureAdhoc = 0x0002, + kSecCodeSignatureForceHard = 0x0100, + kSecCodeSignatureForceKill = 0x0200, + kSecCodeSignatureForceExpiration = 0x0400, + kSecCodeSignatureRestrict = 0x0800, + kSecCodeSignatureEnforcement = 0x1000, + kSecCodeSignatureLibraryValidation = 0x2000, +}; +typedef uint32_t SecCodeStatus; enum { + kSecCodeStatusValid = 0x0001, + kSecCodeStatusHard = 0x0100, + kSecCodeStatusKill = 0x0200, +}; + + + + + + +typedef uint32_t SecRequirementType; enum { + kSecHostRequirementType = 1, + kSecGuestRequirementType = 2, + kSecDesignatedRequirementType = 3, + kSecLibraryRequirementType = 4, + kSecPluginRequirementType = 5, + kSecInvalidRequirementType, + kSecRequirementTypeCount = kSecInvalidRequirementType +}; +typedef uint32_t SecCSDigestAlgorithm; enum { + kSecCodeSignatureNoHash = 0, + kSecCodeSignatureHashSHA1 = 1, + kSecCodeSignatureHashSHA256 = 2, + kSecCodeSignatureHashSHA256Truncated = 3, + kSecCodeSignatureHashSHA384 = 4, +}; +CFTypeID SecStaticCodeGetTypeID(void); +OSStatus SecStaticCodeCreateWithPath(CFURLRef path, SecCSFlags flags, SecStaticCodeRef * _Nonnull __attribute__((cf_returns_retained)) staticCode); + +extern const CFStringRef kSecCodeAttributeArchitecture; +extern const CFStringRef kSecCodeAttributeSubarchitecture; +extern const CFStringRef kSecCodeAttributeUniversalFileOffset; +extern const CFStringRef kSecCodeAttributeBundleVersion; +OSStatus SecStaticCodeCreateWithPathAndAttributes(CFURLRef path, SecCSFlags flags, CFDictionaryRef attributes, + SecStaticCodeRef * _Nonnull __attribute__((cf_returns_retained)) staticCode); +enum { + kSecCSCheckAllArchitectures = 1 << 0, + kSecCSDoNotValidateExecutable = 1 << 1, + kSecCSDoNotValidateResources = 1 << 2, + kSecCSBasicValidateOnly = kSecCSDoNotValidateExecutable | kSecCSDoNotValidateResources, + kSecCSCheckNestedCode = 1 << 3, + kSecCSStrictValidate = 1 << 4, + kSecCSFullReport = 1 << 5, + kSecCSCheckGatekeeperArchitectures = (1 << 6) | kSecCSCheckAllArchitectures, + kSecCSRestrictSymlinks = 1 << 7, + kSecCSRestrictToAppLike = 1 << 8, + kSecCSRestrictSidebandData = 1 << 9, +}; + +OSStatus SecStaticCodeCheckValidity(SecStaticCodeRef staticCode, SecCSFlags flags, + SecRequirementRef _Nullable requirement); + +OSStatus SecStaticCodeCheckValidityWithErrors(SecStaticCodeRef staticCode, SecCSFlags flags, + SecRequirementRef _Nullable requirement, CFErrorRef *errors); +CFTypeID SecCodeGetTypeID(void); +OSStatus SecCodeCopySelf(SecCSFlags flags, SecCodeRef * _Nonnull __attribute__((cf_returns_retained)) self); +enum { + kSecCSUseAllArchitectures = 1 << 0, +}; + +OSStatus SecCodeCopyStaticCode(SecCodeRef code, SecCSFlags flags, SecStaticCodeRef * _Nonnull __attribute__((cf_returns_retained)) staticCode); +OSStatus SecCodeCopyHost(SecCodeRef guest, SecCSFlags flags, SecCodeRef * _Nonnull __attribute__((cf_returns_retained)) host); + +extern const CFStringRef kSecGuestAttributeCanonical; +extern const CFStringRef kSecGuestAttributeHash; +extern const CFStringRef kSecGuestAttributeMachPort; +extern const CFStringRef kSecGuestAttributePid; +extern const CFStringRef kSecGuestAttributeAudit; +extern const CFStringRef kSecGuestAttributeDynamicCode; +extern const CFStringRef kSecGuestAttributeDynamicCodeInfoPlist; +extern const CFStringRef kSecGuestAttributeArchitecture; +extern const CFStringRef kSecGuestAttributeSubarchitecture; +OSStatus SecCodeCopyGuestWithAttributes(SecCodeRef _Nullable host, + CFDictionaryRef _Nullable attributes, SecCSFlags flags, SecCodeRef * _Nonnull __attribute__((cf_returns_retained)) guest); +OSStatus SecCodeCheckValidity(SecCodeRef code, SecCSFlags flags, + SecRequirementRef _Nullable requirement); +OSStatus SecCodeCheckValidityWithErrors(SecCodeRef code, SecCSFlags flags, + SecRequirementRef _Nullable requirement, CFErrorRef *errors); +OSStatus SecCodeCopyPath(SecStaticCodeRef staticCode, SecCSFlags flags, + CFURLRef * _Nonnull __attribute__((cf_returns_retained)) path); +OSStatus SecCodeCopyDesignatedRequirement(SecStaticCodeRef code, SecCSFlags flags, + SecRequirementRef * _Nonnull __attribute__((cf_returns_retained)) requirement); +enum { + kSecCSInternalInformation = 1 << 0, + kSecCSSigningInformation = 1 << 1, + kSecCSRequirementInformation = 1 << 2, + kSecCSDynamicInformation = 1 << 3, + kSecCSContentInformation = 1 << 4 +}; + +extern const CFStringRef kSecCodeInfoCertificates; +extern const CFStringRef kSecCodeInfoChangedFiles; +extern const CFStringRef kSecCodeInfoCMS; +extern const CFStringRef kSecCodeInfoDesignatedRequirement; +extern const CFStringRef kSecCodeInfoEntitlements; +extern const CFStringRef kSecCodeInfoEntitlementsDict; +extern const CFStringRef kSecCodeInfoFlags; +extern const CFStringRef kSecCodeInfoFormat; +extern const CFStringRef kSecCodeInfoDigestAlgorithm; +extern const CFStringRef kSecCodeInfoDigestAlgorithms; +extern const CFStringRef kSecCodeInfoPlatformIdentifier; +extern const CFStringRef kSecCodeInfoIdentifier; +extern const CFStringRef kSecCodeInfoImplicitDesignatedRequirement; +extern const CFStringRef kSecCodeInfoMainExecutable; +extern const CFStringRef kSecCodeInfoPList; +extern const CFStringRef kSecCodeInfoRequirements; +extern const CFStringRef kSecCodeInfoRequirementData; +extern const CFStringRef kSecCodeInfoSource; +extern const CFStringRef kSecCodeInfoStatus; +extern const CFStringRef kSecCodeInfoTeamIdentifier; +extern const CFStringRef kSecCodeInfoTime; +extern const CFStringRef kSecCodeInfoTimestamp; +extern const CFStringRef kSecCodeInfoTrust; +extern const CFStringRef kSecCodeInfoUnique; +extern const CFStringRef kSecCodeInfoCdHashes; + +OSStatus SecCodeCopySigningInformation(SecStaticCodeRef code, SecCSFlags flags, + CFDictionaryRef * _Nonnull __attribute__((cf_returns_retained)) information); +OSStatus SecCodeMapMemory(SecStaticCodeRef code, SecCSFlags flags); +enum { + kSecCSDedicatedHost = 1 << 0, + kSecCSGenerateGuestHash = 1 << 1, +}; + +OSStatus SecHostCreateGuest(SecGuestRef host, + uint32_t status, CFURLRef path, CFDictionaryRef _Nullable attributes, + SecCSFlags flags, SecGuestRef * _Nonnull newGuest); +OSStatus SecHostRemoveGuest(SecGuestRef host, SecGuestRef guest, SecCSFlags flags); +OSStatus SecHostSelectGuest(SecGuestRef guestRef, SecCSFlags flags); +OSStatus SecHostSelectedGuest(SecCSFlags flags, SecGuestRef * _Nonnull guestRef); +OSStatus SecHostSetGuestStatus(SecGuestRef guestRef, + uint32_t status, CFDictionaryRef _Nullable attributes, + SecCSFlags flags); +OSStatus SecHostSetHostingPort(mach_port_t hostingPort, SecCSFlags flags); +CFTypeID SecRequirementGetTypeID(void); +OSStatus SecRequirementCreateWithData(CFDataRef data, SecCSFlags flags, + SecRequirementRef * _Nonnull __attribute__((cf_returns_retained)) requirement); +OSStatus SecRequirementCreateWithString(CFStringRef text, SecCSFlags flags, + SecRequirementRef * _Nonnull __attribute__((cf_returns_retained)) requirement); + +OSStatus SecRequirementCreateWithStringAndErrors(CFStringRef text, SecCSFlags flags, + CFErrorRef *errors, SecRequirementRef * _Nonnull __attribute__((cf_returns_retained)) requirement); +OSStatus SecRequirementCopyData(SecRequirementRef requirement, SecCSFlags flags, + CFDataRef * _Nonnull __attribute__((cf_returns_retained)) data); +OSStatus SecRequirementCopyString(SecRequirementRef requirement, SecCSFlags flags, + CFStringRef * _Nonnull __attribute__((cf_returns_retained)) text); +typedef struct __attribute__((objc_bridge(id))) __SecTask *SecTaskRef; + + + + + + +CFTypeID SecTaskGetTypeID(void); +_Nullable +SecTaskRef SecTaskCreateWithAuditToken(CFAllocatorRef _Nullable allocator, audit_token_t token); + + + + + + + +_Nullable +SecTaskRef SecTaskCreateFromSelf(CFAllocatorRef _Nullable allocator); +_Nullable +CFTypeRef SecTaskCopyValueForEntitlement(SecTaskRef task, CFStringRef entitlement, CFErrorRef *error); +_Nullable +CFDictionaryRef SecTaskCopyValuesForEntitlements(SecTaskRef task, CFArrayRef entitlements, CFErrorRef *error); +_Nullable +CFStringRef +SecTaskCopySigningIdentifier(SecTaskRef task, CFErrorRef *error); + + +enum { + errAuthorizationSuccess = 0, + errAuthorizationInvalidSet = -60001, + errAuthorizationInvalidRef = -60002, + errAuthorizationInvalidTag = -60003, + errAuthorizationInvalidPointer = -60004, + errAuthorizationDenied = -60005, + errAuthorizationCanceled = -60006, + errAuthorizationInteractionNotAllowed = -60007, + errAuthorizationInternal = -60008, + errAuthorizationExternalizeNotAllowed = -60009, + errAuthorizationInternalizeNotAllowed = -60010, + errAuthorizationInvalidFlags = -60011, + errAuthorizationToolExecuteFailure = -60031, + errAuthorizationToolEnvironmentError = -60032, + errAuthorizationBadAddress = -60033, +}; + + + + + + + +typedef UInt32 AuthorizationFlags; enum { + kAuthorizationFlagDefaults = 0, + kAuthorizationFlagInteractionAllowed = (1 << 0), + kAuthorizationFlagExtendRights = (1 << 1), + kAuthorizationFlagPartialRights = (1 << 2), + kAuthorizationFlagDestroyRights = (1 << 3), + kAuthorizationFlagPreAuthorize = (1 << 4), + + + kAuthorizationFlagNoData = (1 << 20) +}; + + + + + + +enum { + kAuthorizationFlagCanNotPreAuthorize = (1 << 0) +}; + + + + + + +typedef const struct AuthorizationOpaqueRef *AuthorizationRef; + + + + + + +typedef const char *AuthorizationString; +typedef struct { + AuthorizationString name; + size_t valueLength; + void * _Nullable value; + UInt32 flags; +} AuthorizationItem; +typedef struct { + UInt32 count; + AuthorizationItem * _Nullable items; +} AuthorizationItemSet; +static const size_t kAuthorizationExternalFormLength = 32; + +typedef struct { + char bytes[kAuthorizationExternalFormLength]; +} AuthorizationExternalForm; +typedef AuthorizationItemSet AuthorizationRights; + + + + + + + +typedef AuthorizationItemSet AuthorizationEnvironment; +OSStatus AuthorizationCreate(const AuthorizationRights * _Nullable rights, + const AuthorizationEnvironment * _Nullable environment, + AuthorizationFlags flags, + AuthorizationRef _Nullable * _Nullable authorization); +OSStatus AuthorizationFree(AuthorizationRef authorization, AuthorizationFlags flags); +OSStatus AuthorizationCopyRights(AuthorizationRef authorization, + const AuthorizationRights *rights, + const AuthorizationEnvironment * _Nullable environment, + AuthorizationFlags flags, + AuthorizationRights * _Nullable * _Nullable authorizedRights); +typedef void (^AuthorizationAsyncCallback)(OSStatus err, AuthorizationRights * _Nullable blockAuthorizedRights); + + + + + + + +void AuthorizationCopyRightsAsync(AuthorizationRef authorization, + const AuthorizationRights *rights, + const AuthorizationEnvironment * _Nullable environment, + AuthorizationFlags flags, + AuthorizationAsyncCallback callbackBlock); +OSStatus AuthorizationCopyInfo(AuthorizationRef authorization, + AuthorizationString _Nullable tag, + AuthorizationItemSet * _Nullable * _Nonnull info); +OSStatus AuthorizationMakeExternalForm(AuthorizationRef authorization, + AuthorizationExternalForm * _Nonnull extForm); +OSStatus AuthorizationCreateFromExternalForm(const AuthorizationExternalForm *extForm, + AuthorizationRef _Nullable * _Nonnull authorization); +OSStatus AuthorizationFreeItemSet(AuthorizationItemSet *set); +OSStatus AuthorizationExecuteWithPrivileges(AuthorizationRef authorization, + const char *pathToTool, + AuthorizationFlags options, + char * _Nonnull const * _Nonnull arguments, + FILE * _Nullable * _Nullable communicationsPipe) __attribute__((availability(macosx,introduced=10.1,deprecated=10.7))); +OSStatus AuthorizationCopyPrivilegedReference(AuthorizationRef _Nullable * _Nonnull authorization, + AuthorizationFlags flags) __attribute__((availability(macosx,introduced=10.1,deprecated=10.7))); +OSStatus AuthorizationRightGet(const char *rightName, + CFDictionaryRef * _Nullable __attribute__((cf_returns_retained)) rightDefinition); +OSStatus AuthorizationRightSet(AuthorizationRef authRef, + const char *rightName, + CFTypeRef rightDefinition, + CFStringRef _Nullable descriptionKey, + CFBundleRef _Nullable bundle, + CFStringRef _Nullable localeTableName); +OSStatus AuthorizationRightRemove(AuthorizationRef authRef, + const char *rightName); + + +typedef struct __attribute__((objc_bridge(id))) _CMSDecoder *CMSDecoderRef; + +CFTypeID CMSDecoderGetTypeID(void); + + + + +typedef uint32_t CMSSignerStatus; enum { + kCMSSignerUnsigned = 0, + kCMSSignerValid, + kCMSSignerNeedsDetachedContent, + + kCMSSignerInvalidSignature, + kCMSSignerInvalidCert, + + kCMSSignerInvalidIndex +}; + + + + +OSStatus CMSDecoderCreate( + CMSDecoderRef * _Nonnull __attribute__((cf_returns_retained)) cmsDecoderOut) + __attribute__((availability(macosx,introduced=10.5))); + + + + + + + +OSStatus CMSDecoderUpdateMessage( + CMSDecoderRef cmsDecoder, + const void *msgBytes, + size_t msgBytesLen) + __attribute__((availability(macosx,introduced=10.5))); + + + + + + + +OSStatus CMSDecoderFinalizeMessage( + CMSDecoderRef cmsDecoder) + __attribute__((availability(macosx,introduced=10.5))); +OSStatus CMSDecoderSetDetachedContent( + CMSDecoderRef cmsDecoder, + CFDataRef detachedContent) + __attribute__((availability(macosx,introduced=10.5))); + + + + + + +OSStatus CMSDecoderCopyDetachedContent( + CMSDecoderRef cmsDecoder, + CFDataRef * _Nonnull __attribute__((cf_returns_retained)) detachedContentOut) + __attribute__((availability(macosx,introduced=10.5))); +OSStatus CMSDecoderSetSearchKeychain( + CMSDecoderRef cmsDecoder, + CFTypeRef keychainOrArray) + __attribute__((availability(macosx,introduced=10.5))); + + + + + + +OSStatus CMSDecoderGetNumSigners( + CMSDecoderRef cmsDecoder, + size_t *numSignersOut) + __attribute__((availability(macosx,introduced=10.5))); +OSStatus CMSDecoderCopySignerStatus( + CMSDecoderRef cmsDecoder, + size_t signerIndex, + CFTypeRef policyOrArray, + Boolean evaluateSecTrust, + CMSSignerStatus * _Nullable signerStatusOut, + SecTrustRef * _Nullable __attribute__((cf_returns_retained)) secTrustOut, + OSStatus * _Nullable certVerifyResultCodeOut) + __attribute__((availability(macosx,introduced=10.5))); +OSStatus CMSDecoderCopySignerEmailAddress( + CMSDecoderRef cmsDecoder, + size_t signerIndex, + CFStringRef * _Nonnull __attribute__((cf_returns_retained)) signerEmailAddressOut) + __attribute__((availability(macosx,introduced=10.5))); +OSStatus CMSDecoderCopySignerCert( + CMSDecoderRef cmsDecoder, + size_t signerIndex, + SecCertificateRef * _Nonnull __attribute__((cf_returns_retained)) signerCertOut) + __attribute__((availability(macosx,introduced=10.5))); +OSStatus CMSDecoderIsContentEncrypted( + CMSDecoderRef cmsDecoder, + Boolean *isEncryptedOut) + __attribute__((availability(macosx,introduced=10.5))); +OSStatus CMSDecoderCopyEncapsulatedContentType( + CMSDecoderRef cmsDecoder, + CFDataRef * _Nonnull __attribute__((cf_returns_retained)) eContentTypeOut) + __attribute__((availability(macosx,introduced=10.5))); +OSStatus CMSDecoderCopyAllCerts( + CMSDecoderRef cmsDecoder, + CFArrayRef * _Nonnull __attribute__((cf_returns_retained)) certsOut) + __attribute__((availability(macosx,introduced=10.5))); + + + + + + + +OSStatus CMSDecoderCopyContent( + CMSDecoderRef cmsDecoder, + CFDataRef * _Nonnull __attribute__((cf_returns_retained)) contentOut) + __attribute__((availability(macosx,introduced=10.5))); +OSStatus CMSDecoderCopySignerSigningTime( + CMSDecoderRef cmsDecoder, + size_t signerIndex, + CFAbsoluteTime *signingTime) + __attribute__((availability(macosx,introduced=10.8))); +OSStatus CMSDecoderCopySignerTimestamp( + CMSDecoderRef cmsDecoder, + size_t signerIndex, + CFAbsoluteTime *timestamp) + __attribute__((availability(macosx,introduced=10.8))); +OSStatus CMSDecoderCopySignerTimestampWithPolicy( + CMSDecoderRef cmsDecoder, + CFTypeRef _Nullable timeStampPolicy, + size_t signerIndex, + CFAbsoluteTime *timestamp) + __attribute__((availability(macosx,introduced=10.10))); +OSStatus CMSDecoderCopySignerTimestampCertificates( + CMSDecoderRef cmsDecoder, + size_t signerIndex, + CFArrayRef * _Nonnull __attribute__((cf_returns_retained)) certificateRefs) + __attribute__((availability(macosx,introduced=10.8))); +typedef struct __attribute__((objc_bridge(id))) _CMSEncoder *CMSEncoderRef; + +CFTypeID CMSEncoderGetTypeID(void) + __attribute__((availability(macosx,introduced=10.5))); + + + + +OSStatus CMSEncoderCreate( + CMSEncoderRef * _Nonnull __attribute__((cf_returns_retained)) cmsEncoderOut) + __attribute__((availability(macosx,introduced=10.5))); + +extern const CFStringRef kCMSEncoderDigestAlgorithmSHA1; +extern const CFStringRef kCMSEncoderDigestAlgorithmSHA256; + +OSStatus CMSEncoderSetSignerAlgorithm( + CMSEncoderRef cmsEncoder, + CFStringRef digestAlgorithm) + __attribute__((availability(macosx,introduced=10.11))); +OSStatus CMSEncoderAddSigners( + CMSEncoderRef cmsEncoder, + CFTypeRef signerOrArray) + __attribute__((availability(macosx,introduced=10.5))); + + + + + + +OSStatus CMSEncoderCopySigners( + CMSEncoderRef cmsEncoder, + CFArrayRef * _Nonnull __attribute__((cf_returns_retained)) signersOut) + __attribute__((availability(macosx,introduced=10.5))); +OSStatus CMSEncoderAddRecipients( + CMSEncoderRef cmsEncoder, + CFTypeRef recipientOrArray) + __attribute__((availability(macosx,introduced=10.5))); + + + + + + + +OSStatus CMSEncoderCopyRecipients( + CMSEncoderRef cmsEncoder, + CFArrayRef * _Nonnull __attribute__((cf_returns_retained)) recipientsOut) + __attribute__((availability(macosx,introduced=10.5))); +OSStatus CMSEncoderSetHasDetachedContent( + CMSEncoderRef cmsEncoder, + Boolean detachedContent) + __attribute__((availability(macosx,introduced=10.5))); + + + + + + + +OSStatus CMSEncoderGetHasDetachedContent( + CMSEncoderRef cmsEncoder, + Boolean *detachedContentOut) + __attribute__((availability(macosx,introduced=10.5))); +OSStatus CMSEncoderSetEncapsulatedContentType( + CMSEncoderRef cmsEncoder, + const CSSM_OID *eContentType) + + __attribute__((availability(macosx,introduced=10.5))); +OSStatus CMSEncoderSetEncapsulatedContentTypeOID( + CMSEncoderRef cmsEncoder, + CFTypeRef eContentTypeOID) + __attribute__((availability(macosx,introduced=10.7))); +OSStatus CMSEncoderCopyEncapsulatedContentType( + CMSEncoderRef cmsEncoder, + CFDataRef * _Nonnull __attribute__((cf_returns_retained)) eContentTypeOut) + __attribute__((availability(macosx,introduced=10.5))); +OSStatus CMSEncoderAddSupportingCerts( + CMSEncoderRef cmsEncoder, + CFTypeRef certOrArray) + __attribute__((availability(macosx,introduced=10.5))); + + + + + + + +OSStatus CMSEncoderCopySupportingCerts( + CMSEncoderRef cmsEncoder, + CFArrayRef * _Nonnull __attribute__((cf_returns_retained)) certsOut) + __attribute__((availability(macosx,introduced=10.5))); + + + + + +typedef uint32_t CMSSignedAttributes; enum { + kCMSAttrNone = 0x0000, + + + + + kCMSAttrSmimeCapabilities = 0x0001, + + + + kCMSAttrSmimeEncryptionKeyPrefs = 0x0002, + + + + + kCMSAttrSmimeMSEncryptionKeyPrefs = 0x0004, + + + + kCMSAttrSigningTime = 0x0008, + + + + kCMSAttrAppleCodesigningHashAgility = 0x0010 +}; + + + + + + +OSStatus CMSEncoderAddSignedAttributes( + CMSEncoderRef cmsEncoder, + CMSSignedAttributes signedAttributes) + __attribute__((availability(macosx,introduced=10.5))); + + + + +typedef uint32_t CMSCertificateChainMode; enum { + kCMSCertificateNone = 0, + kCMSCertificateSignerOnly, + kCMSCertificateChain, + + kCMSCertificateChainWithRoot +}; +OSStatus CMSEncoderSetCertificateChainMode( + CMSEncoderRef cmsEncoder, + CMSCertificateChainMode chainMode) + __attribute__((availability(macosx,introduced=10.5))); + + + + + +OSStatus CMSEncoderGetCertificateChainMode( + CMSEncoderRef cmsEncoder, + CMSCertificateChainMode *chainModeOut) + __attribute__((availability(macosx,introduced=10.5))); + + + + + + +OSStatus CMSEncoderUpdateContent( + CMSEncoderRef cmsEncoder, + const void *content, + size_t contentLen) + __attribute__((availability(macosx,introduced=10.5))); + + + + + +OSStatus CMSEncoderCopyEncodedContent( + CMSEncoderRef cmsEncoder, + CFDataRef * _Nonnull __attribute__((cf_returns_retained)) encodedContentOut) + __attribute__((availability(macosx,introduced=10.5))); +OSStatus CMSEncode( + CFTypeRef _Nullable signers, + CFTypeRef _Nullable recipients, + const CSSM_OID * _Nullable eContentType, + Boolean detachedContent, + CMSSignedAttributes signedAttributes, + const void * content, + size_t contentLen, + CFDataRef * _Nonnull __attribute__((cf_returns_retained)) encodedContentOut) + + __attribute__((availability(macosx,introduced=10.5))); +OSStatus CMSEncodeContent( + CFTypeRef _Nullable signers, + CFTypeRef _Nullable recipients, + CFTypeRef _Nullable eContentTypeOID, + Boolean detachedContent, + CMSSignedAttributes signedAttributes, + const void *content, + size_t contentLen, + CFDataRef * _Nullable __attribute__((cf_returns_retained)) encodedContentOut) + __attribute__((availability(macosx,introduced=10.7))); + +OSStatus CMSEncoderCopySignerTimestamp( + CMSEncoderRef cmsEncoder, + size_t signerIndex, + CFAbsoluteTime *timestamp) + __attribute__((availability(macosx,introduced=10.8))); + +OSStatus CMSEncoderCopySignerTimestampWithPolicy( + CMSEncoderRef cmsEncoder, + CFTypeRef _Nullable timeStampPolicy, + size_t signerIndex, + CFAbsoluteTime *timestamp) + __attribute__((availability(macosx,introduced=10.10))); + + +typedef uint32_t SSLCipherSuite; + + + + + +enum +{ SSL_NULL_WITH_NULL_NULL = 0x0000, + SSL_RSA_WITH_NULL_MD5 = 0x0001, + SSL_RSA_WITH_NULL_SHA = 0x0002, + SSL_RSA_EXPORT_WITH_RC4_40_MD5 = 0x0003, + SSL_RSA_WITH_RC4_128_MD5 = 0x0004, + SSL_RSA_WITH_RC4_128_SHA = 0x0005, + SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = 0x0006, + SSL_RSA_WITH_IDEA_CBC_SHA = 0x0007, + SSL_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0008, + SSL_RSA_WITH_DES_CBC_SHA = 0x0009, + SSL_RSA_WITH_3DES_EDE_CBC_SHA = 0x000A, + SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x000B, + SSL_DH_DSS_WITH_DES_CBC_SHA = 0x000C, + SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA = 0x000D, + SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x000E, + SSL_DH_RSA_WITH_DES_CBC_SHA = 0x000F, + SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA = 0x0010, + SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x0011, + SSL_DHE_DSS_WITH_DES_CBC_SHA = 0x0012, + SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 0x0013, + SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0014, + SSL_DHE_RSA_WITH_DES_CBC_SHA = 0x0015, + SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x0016, + SSL_DH_anon_EXPORT_WITH_RC4_40_MD5 = 0x0017, + SSL_DH_anon_WITH_RC4_128_MD5 = 0x0018, + SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA = 0x0019, + SSL_DH_anon_WITH_DES_CBC_SHA = 0x001A, + SSL_DH_anon_WITH_3DES_EDE_CBC_SHA = 0x001B, + SSL_FORTEZZA_DMS_WITH_NULL_SHA = 0x001C, + SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA = 0x001D, + + + TLS_RSA_WITH_AES_128_CBC_SHA = 0x002F, + TLS_DH_DSS_WITH_AES_128_CBC_SHA = 0x0030, + TLS_DH_RSA_WITH_AES_128_CBC_SHA = 0x0031, + TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 0x0032, + TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x0033, + TLS_DH_anon_WITH_AES_128_CBC_SHA = 0x0034, + TLS_RSA_WITH_AES_256_CBC_SHA = 0x0035, + TLS_DH_DSS_WITH_AES_256_CBC_SHA = 0x0036, + TLS_DH_RSA_WITH_AES_256_CBC_SHA = 0x0037, + TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 0x0038, + TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x0039, + TLS_DH_anon_WITH_AES_256_CBC_SHA = 0x003A, + + + TLS_ECDH_ECDSA_WITH_NULL_SHA = 0xC001, + TLS_ECDH_ECDSA_WITH_RC4_128_SHA = 0xC002, + TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA = 0xC003, + TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA = 0xC004, + TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA = 0xC005, + TLS_ECDHE_ECDSA_WITH_NULL_SHA = 0xC006, + TLS_ECDHE_ECDSA_WITH_RC4_128_SHA = 0xC007, + TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA = 0xC008, + TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = 0xC009, + TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = 0xC00A, + TLS_ECDH_RSA_WITH_NULL_SHA = 0xC00B, + TLS_ECDH_RSA_WITH_RC4_128_SHA = 0xC00C, + TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA = 0xC00D, + TLS_ECDH_RSA_WITH_AES_128_CBC_SHA = 0xC00E, + TLS_ECDH_RSA_WITH_AES_256_CBC_SHA = 0xC00F, + TLS_ECDHE_RSA_WITH_NULL_SHA = 0xC010, + TLS_ECDHE_RSA_WITH_RC4_128_SHA = 0xC011, + TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA = 0xC012, + TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = 0xC013, + TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = 0xC014, + TLS_ECDH_anon_WITH_NULL_SHA = 0xC015, + TLS_ECDH_anon_WITH_RC4_128_SHA = 0xC016, + TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA = 0xC017, + TLS_ECDH_anon_WITH_AES_128_CBC_SHA = 0xC018, + TLS_ECDH_anon_WITH_AES_256_CBC_SHA = 0xC019, + + + + + TLS_NULL_WITH_NULL_NULL = 0x0000, + + + TLS_RSA_WITH_NULL_MD5 = 0x0001, + TLS_RSA_WITH_NULL_SHA = 0x0002, + TLS_RSA_WITH_RC4_128_MD5 = 0x0004, + TLS_RSA_WITH_RC4_128_SHA = 0x0005, + TLS_RSA_WITH_3DES_EDE_CBC_SHA = 0x000A, + + + TLS_RSA_WITH_NULL_SHA256 = 0x003B, + TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x003C, + TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x003D, + + + TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = 0x000D, + TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = 0x0010, + TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 0x0013, + TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x0016, + TLS_DH_DSS_WITH_AES_128_CBC_SHA256 = 0x003E, + TLS_DH_RSA_WITH_AES_128_CBC_SHA256 = 0x003F, + TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = 0x0040, + TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x0067, + TLS_DH_DSS_WITH_AES_256_CBC_SHA256 = 0x0068, + TLS_DH_RSA_WITH_AES_256_CBC_SHA256 = 0x0069, + TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = 0x006A, + TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x006B, + + + TLS_DH_anon_WITH_RC4_128_MD5 = 0x0018, + TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = 0x001B, + + + TLS_DH_anon_WITH_AES_128_CBC_SHA256 = 0x006C, + TLS_DH_anon_WITH_AES_256_CBC_SHA256 = 0x006D, + + + + TLS_PSK_WITH_RC4_128_SHA = 0x008A, + TLS_PSK_WITH_3DES_EDE_CBC_SHA = 0x008B, + TLS_PSK_WITH_AES_128_CBC_SHA = 0x008C, + TLS_PSK_WITH_AES_256_CBC_SHA = 0x008D, + TLS_DHE_PSK_WITH_RC4_128_SHA = 0x008E, + TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA = 0x008F, + TLS_DHE_PSK_WITH_AES_128_CBC_SHA = 0x0090, + TLS_DHE_PSK_WITH_AES_256_CBC_SHA = 0x0091, + TLS_RSA_PSK_WITH_RC4_128_SHA = 0x0092, + TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA = 0x0093, + TLS_RSA_PSK_WITH_AES_128_CBC_SHA = 0x0094, + TLS_RSA_PSK_WITH_AES_256_CBC_SHA = 0x0095, + + + + TLS_PSK_WITH_NULL_SHA = 0x002C, + TLS_DHE_PSK_WITH_NULL_SHA = 0x002D, + TLS_RSA_PSK_WITH_NULL_SHA = 0x002E, + + + + TLS_RSA_WITH_AES_128_GCM_SHA256 = 0x009C, + TLS_RSA_WITH_AES_256_GCM_SHA384 = 0x009D, + TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = 0x009E, + TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = 0x009F, + TLS_DH_RSA_WITH_AES_128_GCM_SHA256 = 0x00A0, + TLS_DH_RSA_WITH_AES_256_GCM_SHA384 = 0x00A1, + TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 = 0x00A2, + TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 = 0x00A3, + TLS_DH_DSS_WITH_AES_128_GCM_SHA256 = 0x00A4, + TLS_DH_DSS_WITH_AES_256_GCM_SHA384 = 0x00A5, + TLS_DH_anon_WITH_AES_128_GCM_SHA256 = 0x00A6, + TLS_DH_anon_WITH_AES_256_GCM_SHA384 = 0x00A7, + + + TLS_PSK_WITH_AES_128_GCM_SHA256 = 0x00A8, + TLS_PSK_WITH_AES_256_GCM_SHA384 = 0x00A9, + TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 = 0x00AA, + TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 = 0x00AB, + TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 = 0x00AC, + TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 = 0x00AD, + + TLS_PSK_WITH_AES_128_CBC_SHA256 = 0x00AE, + TLS_PSK_WITH_AES_256_CBC_SHA384 = 0x00AF, + TLS_PSK_WITH_NULL_SHA256 = 0x00B0, + TLS_PSK_WITH_NULL_SHA384 = 0x00B1, + + TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 = 0x00B2, + TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 = 0x00B3, + TLS_DHE_PSK_WITH_NULL_SHA256 = 0x00B4, + TLS_DHE_PSK_WITH_NULL_SHA384 = 0x00B5, + + TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 = 0x00B6, + TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 = 0x00B7, + TLS_RSA_PSK_WITH_NULL_SHA256 = 0x00B8, + TLS_RSA_PSK_WITH_NULL_SHA384 = 0x00B9, + + + + + TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC023, + TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC024, + TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC025, + TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC026, + TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = 0xC027, + TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = 0xC028, + TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 = 0xC029, + TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 = 0xC02A, + + + + TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02B, + TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02C, + TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02D, + TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02E, + TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = 0xC02F, + TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = 0xC030, + TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 = 0xC031, + TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 = 0xC032, + + + TLS_EMPTY_RENEGOTIATION_INFO_SCSV = 0x00FF, + + + + + SSL_RSA_WITH_RC2_CBC_MD5 = 0xFF80, + SSL_RSA_WITH_IDEA_CBC_MD5 = 0xFF81, + SSL_RSA_WITH_DES_CBC_MD5 = 0xFF82, + SSL_RSA_WITH_3DES_EDE_CBC_MD5 = 0xFF83, + SSL_NO_SUCH_CIPHERSUITE = 0xFFFF +}; +struct SSLContext; +typedef struct __attribute__((objc_bridge(id))) SSLContext *SSLContextRef; + + +typedef const void * SSLConnectionRef; + + +typedef int SSLProtocol; enum { + kSSLProtocolUnknown = 0, + kSSLProtocol3 = 2, + kTLSProtocol1 = 4, + kTLSProtocol11 = 7, + kTLSProtocol12 = 8, + kDTLSProtocol1 = 9, + + + kSSLProtocol2 = 1, + kSSLProtocol3Only = 3, + kTLSProtocol1Only = 5, + kSSLProtocolAll = 6, + +}; + + +typedef int SSLSessionOption; enum { + + + + + + + + kSSLSessionOptionBreakOnServerAuth = 0, + + + + + kSSLSessionOptionBreakOnCertRequested = 1, + + + + + + + kSSLSessionOptionBreakOnClientAuth = 2, + + + + + + kSSLSessionOptionFalseStart = 3, + + + + + + kSSLSessionOptionSendOneByteRecord = 4, + + + + + kSSLSessionOptionAllowServerIdentityChange = 5, + + + + + kSSLSessionOptionFallback = 6, + + + + kSSLSessionOptionBreakOnClientHello = 7, + + + + kSSLSessionOptionAllowRenegotiation = 8, + +}; + + +typedef int SSLSessionState; enum { + kSSLIdle, + kSSLHandshake, + kSSLConnected, + kSSLClosed, + kSSLAborted +}; + + + + + +typedef int SSLClientCertificateState; enum { + + kSSLClientCertNone, + + kSSLClientCertRequested, + + + + + + + kSSLClientCertSent, + + + + + kSSLClientCertRejected +} ; +typedef OSStatus +(*SSLReadFunc) (SSLConnectionRef connection, + void *data, + + + size_t *dataLength); +typedef OSStatus +(*SSLWriteFunc) (SSLConnectionRef connection, + const void *data, + size_t *dataLength); +enum { + errSSLProtocol = -9800, + errSSLNegotiation = -9801, + errSSLFatalAlert = -9802, + errSSLWouldBlock = -9803, + errSSLSessionNotFound = -9804, + errSSLClosedGraceful = -9805, + errSSLClosedAbort = -9806, + errSSLXCertChainInvalid = -9807, + errSSLBadCert = -9808, + errSSLCrypto = -9809, + errSSLInternal = -9810, + errSSLModuleAttach = -9811, + errSSLUnknownRootCert = -9812, + errSSLNoRootCert = -9813, + errSSLCertExpired = -9814, + errSSLCertNotYetValid = -9815, + errSSLClosedNoNotify = -9816, + errSSLBufferOverflow = -9817, + errSSLBadCipherSuite = -9818, + + + errSSLPeerUnexpectedMsg = -9819, + errSSLPeerBadRecordMac = -9820, + errSSLPeerDecryptionFail = -9821, + errSSLPeerRecordOverflow = -9822, + errSSLPeerDecompressFail = -9823, + errSSLPeerHandshakeFail = -9824, + errSSLPeerBadCert = -9825, + errSSLPeerUnsupportedCert = -9826, + errSSLPeerCertRevoked = -9827, + errSSLPeerCertExpired = -9828, + errSSLPeerCertUnknown = -9829, + errSSLIllegalParam = -9830, + errSSLPeerUnknownCA = -9831, + errSSLPeerAccessDenied = -9832, + errSSLPeerDecodeError = -9833, + errSSLPeerDecryptError = -9834, + errSSLPeerExportRestriction = -9835, + errSSLPeerProtocolVersion = -9836, + errSSLPeerInsufficientSecurity = -9837, + errSSLPeerInternalError = -9838, + errSSLPeerUserCancelled = -9839, + errSSLPeerNoRenegotiation = -9840, + + + errSSLPeerAuthCompleted = -9841, + errSSLClientCertRequested = -9842, + + + errSSLHostNameMismatch = -9843, + errSSLConnectionRefused = -9844, + errSSLDecryptionFail = -9845, + errSSLBadRecordMac = -9846, + errSSLRecordOverflow = -9847, + errSSLBadConfiguration = -9848, + errSSLUnexpectedRecord = -9849, + errSSLWeakPeerEphemeralDHKey = -9850, + + + errSSLClientHelloReceived = -9851, +}; +typedef int SSLProtocolSide; enum +{ + kSSLServerSide, + kSSLClientSide +}; + +typedef int SSLConnectionType; enum +{ + kSSLStreamType, + kSSLDatagramType +}; + + + + + + +extern const CFStringRef kSSLSessionConfig_default; + +extern const CFStringRef kSSLSessionConfig_ATSv1; + +extern const CFStringRef kSSLSessionConfig_ATSv1_noPFS; + +extern const CFStringRef kSSLSessionConfig_standard; + +extern const CFStringRef kSSLSessionConfig_RC4_fallback; + +extern const CFStringRef kSSLSessionConfig_TLSv1_fallback; + +extern const CFStringRef kSSLSessionConfig_TLSv1_RC4_fallback; + +extern const CFStringRef kSSLSessionConfig_legacy; + +extern const CFStringRef kSSLSessionConfig_legacy_DHE; + +extern const CFStringRef kSSLSessionConfig_anonymous; + +extern const CFStringRef kSSLSessionConfig_3DES_fallback; + +extern const CFStringRef kSSLSessionConfig_TLSv1_3DES_fallback; +CFTypeID +SSLContextGetTypeID(void) + __attribute__((availability(macosx,introduced=10.8))); + + + + +_Nullable +SSLContextRef +SSLCreateContext(CFAllocatorRef _Nullable alloc, SSLProtocolSide protocolSide, SSLConnectionType connectionType) + __attribute__((availability(macosx,introduced=10.8))); +OSStatus +SSLNewContext (Boolean isServer, + SSLContextRef * _Nonnull __attribute__((cf_returns_retained)) contextPtr) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.9))); +OSStatus +SSLDisposeContext (SSLContextRef context) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.9))); + + + + + + +OSStatus +SSLGetSessionState (SSLContextRef context, + SSLSessionState *state) + __attribute__((availability(macosx,introduced=10.2))); + + + + + +OSStatus +SSLSetSessionOption (SSLContextRef context, + SSLSessionOption option, + Boolean value) + __attribute__((availability(macosx,introduced=10.6))); + + + + +OSStatus +SSLGetSessionOption (SSLContextRef context, + SSLSessionOption option, + Boolean *value) + __attribute__((availability(macosx,introduced=10.6))); +OSStatus +SSLSetIOFuncs (SSLContextRef context, + SSLReadFunc readFunc, + SSLWriteFunc writeFunc) + __attribute__((availability(macosx,introduced=10.2))); +OSStatus +SSLSetSessionConfig(SSLContextRef context, + CFStringRef config) + __attribute__((availability(macosx,introduced=10.12))); +OSStatus +SSLSetProtocolVersionMin (SSLContextRef context, + SSLProtocol minVersion) + __attribute__((availability(macosx,introduced=10.8))); + + + + +OSStatus +SSLGetProtocolVersionMin (SSLContextRef context, + SSLProtocol *minVersion) + __attribute__((availability(macosx,introduced=10.8))); +OSStatus +SSLSetProtocolVersionMax (SSLContextRef context, + SSLProtocol maxVersion) + __attribute__((availability(macosx,introduced=10.8))); + + + + +OSStatus +SSLGetProtocolVersionMax (SSLContextRef context, + SSLProtocol *maxVersion) + __attribute__((availability(macosx,introduced=10.8))); +OSStatus +SSLSetProtocolVersionEnabled (SSLContextRef context, + SSLProtocol protocol, + Boolean enable) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.9))); +OSStatus +SSLGetProtocolVersionEnabled(SSLContextRef context, + SSLProtocol protocol, + Boolean *enable) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.9))); +OSStatus +SSLSetProtocolVersion (SSLContextRef context, + SSLProtocol version) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +OSStatus +SSLGetProtocolVersion (SSLContextRef context, + SSLProtocol *protocol) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +OSStatus +SSLSetCertificate (SSLContextRef context, + CFArrayRef _Nullable certRefs) + __attribute__((availability(macosx,introduced=10.2))); +OSStatus +SSLSetConnection (SSLContextRef context, + SSLConnectionRef _Nullable connection) + __attribute__((availability(macosx,introduced=10.2))); + +OSStatus +SSLGetConnection (SSLContextRef context, + SSLConnectionRef * _Nonnull __attribute__((cf_returns_not_retained)) connection) + __attribute__((availability(macosx,introduced=10.2))); +OSStatus +SSLSetPeerDomainName (SSLContextRef context, + const char * _Nullable peerName, + size_t peerNameLen) + __attribute__((availability(macosx,introduced=10.2))); + + + + +OSStatus +SSLGetPeerDomainNameLength (SSLContextRef context, + size_t *peerNameLen) + __attribute__((availability(macosx,introduced=10.2))); + + + + +OSStatus +SSLGetPeerDomainName (SSLContextRef context, + char *peerName, + size_t *peerNameLen) + __attribute__((availability(macosx,introduced=10.2))); + + + + + +OSStatus +SSLCopyRequestedPeerName (SSLContextRef context, + char *peerName, + size_t *peerNameLen) + __attribute__((availability(macosx,introduced=10.11))); + + + + +OSStatus +SSLCopyRequestedPeerNameLength (SSLContextRef ctx, + size_t *peerNameLen) + __attribute__((availability(macosx,introduced=10.11))); + + + + + + + +OSStatus +SSLSetDatagramHelloCookie (SSLContextRef dtlsContext, + const void * _Nullable cookie, + size_t cookieLen) + __attribute__((availability(macosx,introduced=10.8))); +OSStatus +SSLSetMaxDatagramRecordSize (SSLContextRef dtlsContext, + size_t maxSize) + __attribute__((availability(macosx,introduced=10.8))); + + + + + +OSStatus +SSLGetMaxDatagramRecordSize (SSLContextRef dtlsContext, + size_t *maxSize) + __attribute__((availability(macosx,introduced=10.8))); + + + + + + + +OSStatus +SSLGetNegotiatedProtocolVersion (SSLContextRef context, + SSLProtocol *protocol) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + + +OSStatus +SSLGetNumberSupportedCiphers (SSLContextRef context, + size_t *numCiphers) + __attribute__((availability(macosx,introduced=10.2))); + +OSStatus +SSLGetSupportedCiphers (SSLContextRef context, + SSLCipherSuite *ciphers, + size_t *numCiphers) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + + +OSStatus +SSLSetEnabledCiphers (SSLContextRef context, + const SSLCipherSuite *ciphers, + size_t numCiphers) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + + +OSStatus +SSLGetNumberEnabledCiphers (SSLContextRef context, + size_t *numCiphers) + __attribute__((availability(macosx,introduced=10.2))); + +OSStatus +SSLGetEnabledCiphers (SSLContextRef context, + SSLCipherSuite *ciphers, + size_t *numCiphers) + __attribute__((availability(macosx,introduced=10.2))); +OSStatus +SSLSetEnableCertVerify (SSLContextRef context, + Boolean enableVerify) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.9))); +OSStatus +SSLGetEnableCertVerify (SSLContextRef context, + Boolean *enableVerify) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.9))); +OSStatus +SSLSetAllowsExpiredCerts (SSLContextRef context, + Boolean allowsExpired) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.9))); +OSStatus +SSLGetAllowsExpiredCerts (SSLContextRef context, + Boolean *allowsExpired) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.9))); +OSStatus +SSLSetAllowsExpiredRoots (SSLContextRef context, + Boolean allowsExpired) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.9))); +OSStatus +SSLGetAllowsExpiredRoots (SSLContextRef context, + Boolean *allowsExpired) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.9))); +OSStatus +SSLSetAllowsAnyRoot (SSLContextRef context, + Boolean anyRoot) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.9))); +OSStatus +SSLGetAllowsAnyRoot (SSLContextRef context, + Boolean *anyRoot) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.9))); +OSStatus +SSLSetTrustedRoots (SSLContextRef context, + CFArrayRef trustedRoots, + Boolean replaceExisting) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.9))); +OSStatus +SSLCopyTrustedRoots (SSLContextRef context, + CFArrayRef * _Nonnull __attribute__((cf_returns_retained)) trustedRoots) + __attribute__((availability(macosx,introduced=10.5,deprecated=10.9))); +OSStatus +SSLCopyPeerCertificates (SSLContextRef context, + CFArrayRef * _Nonnull __attribute__((cf_returns_retained)) certs) + __attribute__((availability(macosx,introduced=10.5,deprecated=10.9))); +OSStatus +SSLCopyPeerTrust (SSLContextRef context, + SecTrustRef * _Nonnull __attribute__((cf_returns_retained)) trust) + __attribute__((availability(macosx,introduced=10.6))); +OSStatus +SSLSetPeerID (SSLContextRef context, + const void * _Nullable peerID, + size_t peerIDLen) + __attribute__((availability(macosx,introduced=10.2))); + + + + + +OSStatus +SSLGetPeerID (SSLContextRef context, + const void * _Nullable * _Nonnull peerID, + size_t *peerIDLen) + __attribute__((availability(macosx,introduced=10.2))); + + + + + +OSStatus +SSLGetNegotiatedCipher (SSLContextRef context, + SSLCipherSuite *cipherSuite) + __attribute__((availability(macosx,introduced=10.2))); +OSStatus +SSLSetEncryptionCertificate (SSLContextRef context, + CFArrayRef certRefs) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.11))); + + + + + + + +typedef int SSLAuthenticate; enum { + kNeverAuthenticate, + kAlwaysAuthenticate, + kTryAuthenticate + +}; + +OSStatus +SSLSetClientSideAuthenticate (SSLContextRef context, + SSLAuthenticate auth) + __attribute__((availability(macosx,introduced=10.2))); + + + + + +OSStatus +SSLAddDistinguishedName (SSLContextRef context, + const void * _Nullable derDN, + size_t derDNLen) + __attribute__((availability(macosx,introduced=10.4))); +OSStatus +SSLSetCertificateAuthorities(SSLContextRef context, + CFTypeRef certificateOrArray, + Boolean replaceExisting) + __attribute__((availability(macosx,introduced=10.5))); +OSStatus +SSLCopyCertificateAuthorities(SSLContextRef context, + CFArrayRef * _Nonnull __attribute__((cf_returns_retained)) certificates) + __attribute__((availability(macosx,introduced=10.5))); +OSStatus +SSLCopyDistinguishedNames (SSLContextRef context, + CFArrayRef * _Nonnull __attribute__((cf_returns_retained)) names) + __attribute__((availability(macosx,introduced=10.5))); + + + + + + + +OSStatus +SSLGetClientCertificateState (SSLContextRef context, + SSLClientCertificateState *clientState) + __attribute__((availability(macosx,introduced=10.3))); +OSStatus SSLSetDiffieHellmanParams (SSLContextRef context, + const void * _Nullable dhParams, + size_t dhParamsLen) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + + +OSStatus SSLGetDiffieHellmanParams (SSLContextRef context, + const void * _Nullable * _Nonnull dhParams, + size_t *dhParamsLen) + __attribute__((availability(macosx,introduced=10.2))); +OSStatus SSLSetRsaBlinding (SSLContextRef context, + Boolean blinding) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.9))); + +OSStatus SSLGetRsaBlinding (SSLContextRef context, + Boolean *blinding) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.9))); +OSStatus +SSLHandshake (SSLContextRef context) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + + +OSStatus +SSLReHandshake (SSLContextRef context) + __attribute__((availability(macosx,introduced=10.12))); + + + + + + + +OSStatus +SSLWrite (SSLContextRef context, + const void * _Nullable data, + size_t dataLength, + size_t *processed) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + +OSStatus +SSLRead (SSLContextRef context, + void * data, + size_t dataLength, + size_t *processed) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + +OSStatus +SSLGetBufferedReadSize (SSLContextRef context, + size_t *bufSize) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + + +OSStatus +SSLGetDatagramWriteSize (SSLContextRef dtlsContext, + size_t *bufSize) + __attribute__((availability(macosx,introduced=10.8))); + + + + +OSStatus +SSLClose (SSLContextRef context) + __attribute__((availability(macosx,introduced=10.2))); + + +extern const CFStringRef kSecTransformErrorDomain; +extern const CFStringRef kSecTransformPreviousErrorKey; + + + + + + +extern const CFStringRef kSecTransformAbortOriginatorKey; +enum +{ + kSecTransformErrorAttributeNotFound = 1, + kSecTransformErrorInvalidOperation = 2, + kSecTransformErrorNotInitializedCorrectly = 3, + kSecTransformErrorMoreThanOneOutput = 4, + kSecTransformErrorInvalidInputDictionary = 5, + kSecTransformErrorInvalidAlgorithm = 6, + kSecTransformErrorInvalidLength = 7, + kSecTransformErrorInvalidType = 8, + kSecTransformErrorInvalidInput = 10, + kSecTransformErrorNameAlreadyRegistered = 11, + kSecTransformErrorUnsupportedAttribute = 12, + kSecTransformOperationNotSupportedOnGroup = 13, + kSecTransformErrorMissingParameter = 14, + kSecTransformErrorInvalidConnection = 15, + kSecTransformTransformIsExecuting = 16, + kSecTransformInvalidOverride = 17, + kSecTransformTransformIsNotRegistered = 18, + kSecTransformErrorAbortInProgress = 19, + kSecTransformErrorAborted = 20, + kSecTransformInvalidArgument = 21 + +}; + +typedef CFTypeRef SecTransformRef; +typedef CFTypeRef SecGroupTransformRef; + + + + + + + +extern CFTypeID SecTransformGetTypeID(void); +extern CFTypeID SecGroupTransformGetTypeID(void); + + + + + + + +extern const CFStringRef kSecTransformInputAttributeName __attribute__((availability(macosx,introduced=10.7))); + + + + + +extern const CFStringRef kSecTransformOutputAttributeName __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecTransformDebugAttributeName __attribute__((availability(macosx,introduced=10.7))); + + + + + +extern const CFStringRef kSecTransformTransformName __attribute__((availability(macosx,introduced=10.7))); + + + + + +extern const CFStringRef kSecTransformAbortAttributeName __attribute__((availability(macosx,introduced=10.7))); +extern _Nullable +SecTransformRef SecTransformCreateFromExternalRepresentation( + CFDictionaryRef dictionary, + CFErrorRef *error) + __attribute__((availability(macosx,introduced=10.7))); +extern +CFDictionaryRef SecTransformCopyExternalRepresentation( + SecTransformRef transformRef) + __attribute__((availability(macosx,introduced=10.7))); +extern +SecGroupTransformRef SecTransformCreateGroupTransform(void); +extern _Nullable +SecGroupTransformRef SecTransformConnectTransforms(SecTransformRef sourceTransformRef, + CFStringRef sourceAttributeName, + SecTransformRef destinationTransformRef, + CFStringRef destinationAttributeName, + SecGroupTransformRef group, + CFErrorRef *error) + __attribute__((availability(macosx,introduced=10.7))); +extern +Boolean SecTransformSetAttribute(SecTransformRef transformRef, + CFStringRef key, + CFTypeRef value, + CFErrorRef *error) + __attribute__((availability(macosx,introduced=10.7))); +extern _Nullable +CFTypeRef SecTransformGetAttribute(SecTransformRef transformRef, + CFStringRef key) + __attribute__((availability(macosx,introduced=10.7))); +extern _Nullable +SecTransformRef SecTransformFindByName(SecGroupTransformRef transform, + CFStringRef name) + __attribute__((availability(macosx,introduced=10.7))); +extern __attribute__((cf_returns_retained)) +CFTypeRef SecTransformExecute(SecTransformRef transformRef, CFErrorRef* errorRef) + __attribute__((availability(macosx,introduced=10.7))) __attribute__((cf_returns_retained)); +typedef void (^SecMessageBlock)(CFTypeRef _Nullable message, CFErrorRef _Nullable error, + Boolean isFinal); +extern +void SecTransformExecuteAsync(SecTransformRef transformRef, + dispatch_queue_t deliveryQueue, + SecMessageBlock deliveryBlock) + __attribute__((availability(macosx,introduced=10.7))); +typedef CFIndex SecTransformMetaAttributeType; enum +{ + kSecTransformMetaAttributeValue, + kSecTransformMetaAttributeName, + kSecTransformMetaAttributeRef, + kSecTransformMetaAttributeRequired, + kSecTransformMetaAttributeRequiresOutboundConnection, + kSecTransformMetaAttributeDeferred, + kSecTransformMetaAttributeStream, + kSecTransformMetaAttributeCanCycle, + kSecTransformMetaAttributeExternalize, + kSecTransformMetaAttributeHasOutboundConnections, + kSecTransformMetaAttributeHasInboundConnection +}; +typedef CFTypeRef SecTransformAttributeRef; +typedef CFTypeRef SecTransformStringOrAttributeRef; +typedef CFTypeRef _Nullable (^SecTransformActionBlock)(void); +typedef CFTypeRef _Nullable (^SecTransformAttributeActionBlock)( + SecTransformAttributeRef attribute, + CFTypeRef value); +typedef CFTypeRef _Nullable (^SecTransformDataBlock)(CFTypeRef data); +typedef CFErrorRef _Nullable (^SecTransformInstanceBlock)(void); +typedef const struct OpaqueSecTransformImplementation* SecTransformImplementationRef; +extern _Nullable +CFErrorRef SecTransformSetAttributeAction(SecTransformImplementationRef ref, + CFStringRef action, + SecTransformStringOrAttributeRef _Nullable attribute, + SecTransformAttributeActionBlock newAction); +extern _Nullable +CFErrorRef SecTransformSetDataAction(SecTransformImplementationRef ref, + CFStringRef action, + SecTransformDataBlock newAction); +extern _Nullable +CFErrorRef SecTransformSetTransformAction(SecTransformImplementationRef ref, + CFStringRef action, + SecTransformActionBlock newAction); +extern _Nullable +CFTypeRef SecTranformCustomGetAttribute(SecTransformImplementationRef ref, + SecTransformStringOrAttributeRef attribute, + SecTransformMetaAttributeType type) __attribute__((availability(macosx,introduced=10.7,deprecated=10.8))); +extern _Nullable +CFTypeRef SecTransformCustomGetAttribute(SecTransformImplementationRef ref, + SecTransformStringOrAttributeRef attribute, + SecTransformMetaAttributeType type) __asm__("_SecTranformCustomGetAttribute"); +extern _Nullable +CFTypeRef SecTransformCustomSetAttribute(SecTransformImplementationRef ref, + SecTransformStringOrAttributeRef attribute, + SecTransformMetaAttributeType type, + CFTypeRef _Nullable value); +extern _Nullable +CFTypeRef SecTransformPushbackAttribute(SecTransformImplementationRef ref, + SecTransformStringOrAttributeRef attribute, + CFTypeRef value); +typedef SecTransformInstanceBlock _Nonnull (*SecTransformCreateFP)(CFStringRef name, + SecTransformRef newTransform, + SecTransformImplementationRef ref); +extern const CFStringRef kSecTransformActionCanExecute; + + + + + + + +extern const CFStringRef kSecTransformActionStartingExecution; +extern const CFStringRef kSecTransformActionFinalize; +extern const CFStringRef kSecTransformActionExternalizeExtraData; +extern const CFStringRef kSecTransformActionProcessData; +extern const CFStringRef kSecTransformActionInternalizeExtraData; +extern const CFStringRef kSecTransformActionAttributeNotification; +extern const CFStringRef kSecTransformActionAttributeValidation; +extern +Boolean SecTransformRegister(CFStringRef uniqueName, + SecTransformCreateFP createTransformFunction, + CFErrorRef* error) + __attribute__((availability(macosx,introduced=10.7))); +extern _Nullable +SecTransformRef SecTransformCreate(CFStringRef name, CFErrorRef *error) + __attribute__((availability(macosx,introduced=10.7))); +extern +CFTypeRef SecTransformNoData(void); +extern const CFStringRef kSecBase64Encoding; + + + + +extern const CFStringRef kSecBase32Encoding; + + + + +extern const CFStringRef kSecZLibEncoding; + + + + + + + +extern const CFStringRef kSecEncodeTypeAttribute; + + +extern const CFStringRef kSecLineLength64; +extern const CFStringRef kSecLineLength76; +extern const CFStringRef kSecEncodeLineLengthAttribute; + +extern const CFStringRef kSecCompressionRatio; +_Nullable +SecTransformRef SecEncodeTransformCreate(CFTypeRef encodeType, + CFErrorRef* error + ) +__attribute__((availability(macosx,introduced=10.7))); + extern const CFStringRef kSecDecodeTypeAttribute; + _Nullable + SecTransformRef SecDecodeTransformCreate(CFTypeRef DecodeType, + CFErrorRef* error + ) + __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kSecDigestMD2; + + + + + +extern const CFStringRef kSecDigestMD4; + + + + + +extern const CFStringRef kSecDigestMD5; + + + + + +extern const CFStringRef kSecDigestSHA1; + + + + + +extern const CFStringRef kSecDigestSHA2; + + + + + +extern const CFStringRef kSecDigestHMACMD5; + + + + + +extern const CFStringRef kSecDigestHMACSHA1; + + + + + +extern const CFStringRef kSecDigestHMACSHA2; + + + + + + + +extern const CFStringRef kSecDigestTypeAttribute; + + + + + + +extern const CFStringRef kSecDigestLengthAttribute; +extern const CFStringRef kSecDigestHMACKeyAttribute; +SecTransformRef SecDigestTransformCreate(CFTypeRef _Nullable digestType, + CFIndex digestLength, + CFErrorRef* error + ) + __attribute__((availability(macosx,introduced=10.7))); +CFTypeID SecDigestTransformGetTypeID() + __attribute__((availability(macosx,introduced=10.7))); + + extern const CFStringRef kSecPaddingNoneKey; + + extern const CFStringRef kSecPaddingPKCS1Key; + + extern const CFStringRef kSecPaddingPKCS5Key; + + extern const CFStringRef kSecPaddingPKCS7Key; + + extern const CFStringRef kSecPaddingOAEPKey + __attribute__((availability(macosx,introduced=10.8))); + + extern const CFStringRef kSecModeNoneKey; + + extern const CFStringRef kSecModeECBKey; + + extern const CFStringRef kSecModeCBCKey; + + extern const CFStringRef kSecModeCFBKey; + + extern const CFStringRef kSecModeOFBKey; + + + + + + extern const CFStringRef kSecEncryptKey; + extern const CFStringRef kSecPaddingKey; + extern const CFStringRef kSecIVKey; + extern const CFStringRef kSecEncryptionMode; + extern const CFStringRef kSecOAEPMessageLengthAttributeName + __attribute__((availability(macosx,introduced=10.8))); + extern const CFStringRef kSecOAEPEncodingParametersAttributeName + __attribute__((availability(macosx,introduced=10.8))); + + + + + + + + extern const CFStringRef kSecOAEPMGF1DigestAlgorithmAttributeName + __attribute__((availability(macosx,introduced=10.8))); + SecTransformRef SecEncryptTransformCreate(SecKeyRef keyRef, + CFErrorRef* error) + __attribute__((availability(macosx,introduced=10.7))); + SecTransformRef SecDecryptTransformCreate(SecKeyRef keyRef, + CFErrorRef* error) + __attribute__((availability(macosx,introduced=10.7))); + + + + + + + + CFTypeID SecDecryptTransformGetTypeID() + __attribute__((availability(macosx,introduced=10.7))); + + + + + + + + CFTypeID SecEncryptTransformGetTypeID() + __attribute__((availability(macosx,introduced=10.7))); + extern const CFStringRef kSecKeyAttributeName, kSecSignatureAttributeName, kSecInputIsAttributeName; + + extern const CFStringRef kSecInputIsPlainText, kSecInputIsDigest, kSecInputIsRaw; + _Nullable + SecTransformRef SecSignTransformCreate(SecKeyRef key, + CFErrorRef* error + ) + __attribute__((availability(macosx,introduced=10.7))); + _Nullable + SecTransformRef SecVerifyTransformCreate(SecKeyRef key, + CFDataRef _Nullable signature, + CFErrorRef* error + ) + __attribute__((availability(macosx,introduced=10.7))); +SecTransformRef SecTransformCreateReadTransformWithReadStream(CFReadStreamRef inputStream) + __attribute__((availability(macosx,introduced=10.7))); + + + +typedef uint8_t DERByte; +typedef size_t DERSize; + + + + +typedef struct { + DERByte *data; + DERSize length; +} DERItem; + + +extern const DERItem + oidRsa, + oidMd2Rsa, + oidMd4Rsa, + oidMd5Rsa, + oidSha1Rsa, + oidSha256Rsa, + oidSha384Rsa, + oidSha512Rsa, + oidSha224Rsa, + oidEcPubKey, + oidSha1Ecdsa, + oidSha224Ecdsa, + oidSha256Ecdsa, + oidSha384Ecdsa, + oidSha512Ecdsa, + oidSha1Dsa, + oidMd2, + oidMd4, + oidMd5, + oidSha1, + oidSha1DsaOIW, + oidSha1DsaCommonOIW, + oidSha1RsaOIW, + oidSha256, + oidSha384, + oidSha512, + oidSha224, + oidFee, + oidMd5Fee, + oidSha1Fee, + oidEcPrime192v1, + oidEcPrime256v1, + oidAnsip384r1, + oidAnsip521r1; + + +extern const DERItem + oidSubjectKeyIdentifier, + oidKeyUsage, + oidPrivateKeyUsagePeriod, + oidSubjectAltName, + oidIssuerAltName, + oidBasicConstraints, + oidNameConstraints, + oidCrlDistributionPoints, + oidCertificatePolicies, + oidAnyPolicy, + oidPolicyMappings, + oidAuthorityKeyIdentifier, + oidPolicyConstraints, + oidExtendedKeyUsage, + oidAnyExtendedKeyUsage, + oidInhibitAnyPolicy, + oidAuthorityInfoAccess, + oidSubjectInfoAccess, + oidAdOCSP, + oidAdCAIssuer, + oidNetscapeCertType, + oidEntrustVersInfo, + oidMSNTPrincipalName; + + +extern const DERItem + oidQtCps, + oidQtUNotice; + + +extern const DERItem + oidCommonName, + oidCountryName, + oidLocalityName, + oidStateOrProvinceName, + oidOrganizationName, + oidOrganizationalUnitName, + oidDescription, + oidEmailAddress, + oidFriendlyName, + oidLocalKeyId; + + +extern const DERItem + oidExtendedKeyUsageServerAuth, + oidExtendedKeyUsageClientAuth, + oidExtendedKeyUsageCodeSigning, + oidExtendedKeyUsageEmailProtection, + oidExtendedKeyUsageTimeStamping, + oidExtendedKeyUsageOCSPSigning, + oidExtendedKeyUsageIPSec, + oidExtendedKeyUsageMicrosoftSGC, + oidExtendedKeyUsageNetscapeSGC; + + +extern const DERItem + oidGoogleEmbeddedSignedCertificateTimestamp, + oidGoogleOCSPSignedCertificateTimestamp; +typedef struct __CSIdentity* CSIdentityRef; +typedef struct __CSIdentityQuery* CSIdentityQueryRef; +extern const CFStringRef kCSIdentityGeneratePosixName __attribute__((availability(macosx,introduced=10.5))); +enum { + + + + + kCSIdentityClassUser = 1, + + + + + kCSIdentityClassGroup = 2 +}; + +typedef CFIndex CSIdentityClass; + + + + + + + +enum { + + + + + kCSIdentityFlagNone = 0, + kCSIdentityFlagHidden = 1 +}; + +typedef CFOptionFlags CSIdentityFlags; +extern CFTypeID +CSIdentityGetTypeID(void) __attribute__((availability(macosx,introduced=10.5))); +extern CSIdentityRef +CSIdentityCreate( + CFAllocatorRef allocator, + CSIdentityClass identityClass, + CFStringRef fullName, + CFStringRef posixName, + CSIdentityFlags flags, + CSIdentityAuthorityRef authority) __attribute__((availability(macosx,introduced=10.5))); +extern CSIdentityRef +CSIdentityCreateCopy( + CFAllocatorRef allocator, + CSIdentityRef identity) __attribute__((availability(macosx,introduced=10.5))); +extern CSIdentityClass +CSIdentityGetClass(CSIdentityRef identity) __attribute__((availability(macosx,introduced=10.5))); +extern CSIdentityAuthorityRef +CSIdentityGetAuthority(CSIdentityRef identity) __attribute__((availability(macosx,introduced=10.5))); +extern CFUUIDRef +CSIdentityGetUUID(CSIdentityRef identity) __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef +CSIdentityGetFullName(CSIdentityRef identity) __attribute__((availability(macosx,introduced=10.5))); +extern id_t +CSIdentityGetPosixID(CSIdentityRef identity) __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef +CSIdentityGetPosixName(CSIdentityRef identity) __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef +CSIdentityGetEmailAddress(CSIdentityRef identity) __attribute__((availability(macosx,introduced=10.5))); +extern CFURLRef +CSIdentityGetImageURL(CSIdentityRef identity) __attribute__((availability(macosx,introduced=10.5))); +extern CFDataRef +CSIdentityGetImageData(CSIdentityRef identity) __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef +CSIdentityGetImageDataType(CSIdentityRef identity) __attribute__((availability(macosx,introduced=10.5))); +extern CFArrayRef +CSIdentityGetAliases(CSIdentityRef identity) __attribute__((availability(macosx,introduced=10.5))); +extern Boolean +CSIdentityIsMemberOfGroup( + CSIdentityRef identity, + CSIdentityRef group) __attribute__((availability(macosx,introduced=10.5))); +extern Boolean +CSIdentityIsHidden(CSIdentityRef identity) __attribute__((availability(macosx,introduced=10.5))); +extern CFDataRef +CSIdentityCreatePersistentReference( + CFAllocatorRef allocator, + CSIdentityRef identity) __attribute__((availability(macosx,introduced=10.5))); +extern Boolean +CSIdentityIsEnabled(CSIdentityRef user) __attribute__((availability(macosx,introduced=10.5))); +extern Boolean +CSIdentityAuthenticateUsingPassword( + CSIdentityRef user, + CFStringRef password) __attribute__((availability(macosx,introduced=10.5))); +extern SecCertificateRef +CSIdentityGetCertificate(CSIdentityRef user) __attribute__((availability(macosx,introduced=10.5))); +extern CSIdentityQueryRef +CSIdentityCreateGroupMembershipQuery( + CFAllocatorRef allocator, + CSIdentityRef group) __attribute__((availability(macosx,introduced=10.5))); +extern void +CSIdentitySetFullName( + CSIdentityRef identity, + CFStringRef fullName) __attribute__((availability(macosx,introduced=10.5))); +extern void +CSIdentitySetEmailAddress( + CSIdentityRef identity, + CFStringRef emailAddress) __attribute__((availability(macosx,introduced=10.5))); +extern void +CSIdentitySetImageURL( + CSIdentityRef identity, + CFURLRef url) __attribute__((availability(macosx,introduced=10.5))); +extern void +CSIdentitySetImageData( + CSIdentityRef identity, + CFDataRef imageData, + CFStringRef imageDataType) __attribute__((availability(macosx,introduced=10.5))); +extern void +CSIdentityAddAlias( + CSIdentityRef identity, + CFStringRef alias) __attribute__((availability(macosx,introduced=10.5))); +extern void +CSIdentityRemoveAlias( + CSIdentityRef identity, + CFStringRef alias) __attribute__((availability(macosx,introduced=10.5))); +extern void +CSIdentityAddMember( + CSIdentityRef group, + CSIdentityRef member) __attribute__((availability(macosx,introduced=10.5))); +extern void +CSIdentityRemoveMember( + CSIdentityRef group, + CSIdentityRef member) __attribute__((availability(macosx,introduced=10.5))); +extern void +CSIdentitySetIsEnabled( + CSIdentityRef user, + Boolean isEnabled) __attribute__((availability(macosx,introduced=10.5))); +extern void +CSIdentitySetPassword( + CSIdentityRef user, + CFStringRef password) __attribute__((availability(macosx,introduced=10.5))); +extern void +CSIdentitySetCertificate( + CSIdentityRef user, + SecCertificateRef certificate) __attribute__((availability(macosx,introduced=10.5))); +extern void +CSIdentityDelete(CSIdentityRef identity) __attribute__((availability(macosx,introduced=10.5))); +extern Boolean +CSIdentityCommit( + CSIdentityRef identity, + AuthorizationRef authorization, + CFErrorRef * error) __attribute__((availability(macosx,introduced=10.5))); +enum { + + + + + kCSIdentityCommitCompleted = 1 +}; + + +typedef void ( * CSIdentityStatusUpdatedCallback)(CSIdentityRef identity, CFIndex status, CFErrorRef error, void *info); +struct CSIdentityClientContext { + + + + + + CFIndex version; + + + + + + void * info; + CFAllocatorRetainCallBack retain; + + + + + + CFAllocatorReleaseCallBack release; + + + + + + + CFAllocatorCopyDescriptionCallBack copyDescription; + + + + + + CSIdentityStatusUpdatedCallback statusUpdated; +}; +typedef struct CSIdentityClientContext CSIdentityClientContext; +extern Boolean +CSIdentityCommitAsynchronously( + CSIdentityRef identity, + const CSIdentityClientContext * clientContext, + CFRunLoopRef runLoop, + CFStringRef runLoopMode, + AuthorizationRef authorization) __attribute__((availability(macosx,introduced=10.5))); +extern Boolean +CSIdentityIsCommitting(CSIdentityRef identity) __attribute__((availability(macosx,introduced=10.5))); +extern void +CSIdentityRemoveClient(CSIdentityRef identity) __attribute__((availability(macosx,introduced=10.5))); + + + + +extern CFTypeID +CSIdentityQueryGetTypeID(void) __attribute__((availability(macosx,introduced=10.5))); +enum { + + + + + + kCSIdentityQueryGenerateUpdateEvents = 0x0001, + + + + + + kCSIdentityQueryIncludeHiddenIdentities = 0x0002 +}; + +typedef CFOptionFlags CSIdentityQueryFlags; +enum { + + + + + kCSIdentityQueryStringEquals = 1, + + + + + kCSIdentityQueryStringBeginsWith = 2 +}; + +typedef CFIndex CSIdentityQueryStringComparisonMethod; +extern CSIdentityQueryRef +CSIdentityQueryCreate( + CFAllocatorRef allocator, + CSIdentityClass identityClass, + CSIdentityAuthorityRef authority) __attribute__((availability(macosx,introduced=10.5))); +extern CSIdentityQueryRef +CSIdentityQueryCreateForName( + CFAllocatorRef allocator, + CFStringRef name, + CSIdentityQueryStringComparisonMethod comparisonMethod, + CSIdentityClass identityClass, + CSIdentityAuthorityRef authority) __attribute__((availability(macosx,introduced=10.5))); +extern CSIdentityQueryRef +CSIdentityQueryCreateForUUID( + CFAllocatorRef allocator, + CFUUIDRef uuid, + CSIdentityAuthorityRef authority) __attribute__((availability(macosx,introduced=10.5))); +extern CSIdentityQueryRef +CSIdentityQueryCreateForPosixID( + CFAllocatorRef allocator, + id_t posixID, + CSIdentityClass identityClass, + CSIdentityAuthorityRef authority) __attribute__((availability(macosx,introduced=10.5))); +extern CSIdentityQueryRef +CSIdentityQueryCreateForPersistentReference( + CFAllocatorRef allocator, + CFDataRef referenceData) __attribute__((availability(macosx,introduced=10.5))); +extern CSIdentityQueryRef +CSIdentityQueryCreateForCurrentUser(CFAllocatorRef allocator) __attribute__((availability(macosx,introduced=10.5))); +extern CFArrayRef +CSIdentityQueryCopyResults(CSIdentityQueryRef query) __attribute__((availability(macosx,introduced=10.5))); +extern Boolean +CSIdentityQueryExecute( + CSIdentityQueryRef query, + CSIdentityQueryFlags flags, + CFErrorRef * error) __attribute__((availability(macosx,introduced=10.5))); +enum { + + + + + + + kCSIdentityQueryEventSearchPhaseFinished = 1, + + + + + kCSIdentityQueryEventResultsAdded = 2, + + + + + + kCSIdentityQueryEventResultsChanged = 3, + + + + + kCSIdentityQueryEventResultsRemoved = 4, + + + + + + kCSIdentityQueryEventErrorOccurred = 5 +}; + +typedef CFIndex CSIdentityQueryEvent; +typedef void ( * CSIdentityQueryReceiveEventCallback)(CSIdentityQueryRef query, CSIdentityQueryEvent event, CFArrayRef identities, CFErrorRef error, void *info); + + + + + + + +struct CSIdentityQueryClientContext { + CFIndex version; + void * info; + CFAllocatorRetainCallBack retainInfo; + CFAllocatorReleaseCallBack releaseInfo; + CFAllocatorCopyDescriptionCallBack copyInfoDescription; + CSIdentityQueryReceiveEventCallback receiveEvent; +}; +typedef struct CSIdentityQueryClientContext CSIdentityQueryClientContext; +extern Boolean +CSIdentityQueryExecuteAsynchronously( + CSIdentityQueryRef query, + CSIdentityQueryFlags flags, + const CSIdentityQueryClientContext * clientContext, + CFRunLoopRef runLoop, + CFStringRef runLoopMode) __attribute__((availability(macosx,introduced=10.5))); +extern void +CSIdentityQueryStop(CSIdentityQueryRef query) __attribute__((availability(macosx,introduced=10.5))); + + + + + + + + + + +enum { + kIconServices16PixelDataARGB = 'ic04', + kIconServices32PixelDataARGB = 'ic05', + kIconServices48PixelDataARGB = 'ic06', + kIconServices128PixelDataARGB = 'ic07' +}; + + + +enum { + kIconServices256PixelDataARGB = 'ic08', + kIconServices512PixelDataARGB = 'ic09', + kIconServices1024PixelDataARGB = 'ic10', + kThumbnail32BitData = 'it32', + kThumbnail8BitMask = 't8mk' +}; + +enum { + kHuge1BitMask = 'ich#', + kHuge4BitData = 'ich4', + kHuge8BitData = 'ich8', + kHuge32BitData = 'ih32', + kHuge8BitMask = 'h8mk' +}; + + + +enum { + kLarge1BitMask = 'ICN#', + kLarge4BitData = 'icl4', + kLarge8BitData = 'icl8', + kLarge32BitData = 'il32', + kLarge8BitMask = 'l8mk', + kSmall1BitMask = 'ics#', + kSmall4BitData = 'ics4', + kSmall8BitData = 'ics8', + kSmall32BitData = 'is32', + kSmall8BitMask = 's8mk', + kMini1BitMask = 'icm#', + kMini4BitData = 'icm4', + kMini8BitData = 'icm8' +}; + + +enum { + large1BitMask = kLarge1BitMask, + large4BitData = kLarge4BitData, + large8BitData = kLarge8BitData, + small1BitMask = kSmall1BitMask, + small4BitData = kSmall4BitData, + small8BitData = kSmall8BitData, + mini1BitMask = kMini1BitMask, + mini4BitData = kMini4BitData, + mini8BitData = kMini8BitData +}; +enum { + kIconFamilyType = 'icns' +}; + + +struct IconFamilyElement { + OSType elementType; + SInt32 elementSize; + unsigned char elementData[1]; +}; +typedef struct IconFamilyElement IconFamilyElement; +struct IconFamilyResource { + OSType resourceType; + SInt32 resourceSize; + IconFamilyElement elements[1]; + +}; +typedef struct IconFamilyResource IconFamilyResource; +typedef IconFamilyResource* IconFamilyPtr; +typedef IconFamilyPtr* IconFamilyHandle; + + + +enum { + kTileIconVariant = 'tile', + kRolloverIconVariant = 'over', + kDropIconVariant = 'drop', + kOpenIconVariant = 'open', + kOpenDropIconVariant = 'odrp' +}; + + + + + + +enum { + + kSleepRequest = 1, + kSleepDemand = 2, + kSleepWakeUp = 3, + kSleepRevoke = 4, + kSleepUnlock = 4, + kSleepDeny = 5, + kSleepNow = 6, + kDozeDemand = 7, + kDozeWakeUp = 8, + kDozeRequest = 9, + kEnterStandby = 10, + kEnterRun = 11, + kSuspendRequest = 12, + kSuspendDemand = 13, + kSuspendRevoke = 14, + kSuspendWakeUp = 15, + kGetPowerLevel = 16, + kSetPowerLevel = 17, + kDeviceInitiatedWake = 18, + kWakeToDoze = 19, + kDozeToFullWakeUp = 20, + kGetPowerInfo = 21, + kGetWakeOnNetInfo = 22, + kSuspendWakeToDoze = 23, + kEnterIdle = 24, + kStillIdle = 25, + kExitIdle = 26 +}; + +enum { + + noCalls = 1, + noRequest = 2, + slpQType = 16, + sleepQType = 16 +}; + + + + + + + +enum { + OverallAct = 0, + UsrActivity = 1, + NetActivity = 2, + HDActivity = 3, + IdleActivity = 4 +}; + +typedef struct SleepQRec SleepQRec; +typedef SleepQRec * SleepQRecPtr; +typedef long ( * SleepQProcPtr)(long message, SleepQRecPtr qRecPtr); +typedef SleepQProcPtr SleepQUPP; +extern SleepQUPP +NewSleepQUPP(SleepQProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); +extern void +DisposeSleepQUPP(SleepQUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); +extern long +InvokeSleepQUPP( + long message, + SleepQRecPtr qRecPtr, + SleepQUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); +struct SleepQRec { + SleepQRecPtr sleepQLink; + short sleepQType; + SleepQUPP sleepQProc; + short sleepQFlags; +}; +extern long +GetCPUSpeed(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +SleepQInstall(SleepQRecPtr qRecPtr) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +SleepQRemove(SleepQRecPtr qRecPtr) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern short +MaximumProcessorSpeed(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern short +MinimumProcessorSpeed(void) __attribute__((availability(macosx,introduced=10.1,deprecated=10.8))); +extern short +CurrentProcessorSpeed(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern short +BatteryCount(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +UpdateSystemActivity(UInt8 activity) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); + + + + + + +typedef SecKeychainRef KCRef; +typedef SecKeychainItemRef KCItemRef; +typedef SecKeychainSearchRef KCSearchRef; +typedef SecKeychainAttribute KCAttribute; +typedef SecKeychainAttributeList KCAttributeList; +typedef SecKeychainAttrType KCAttrType; +typedef SecKeychainStatus KCStatus; +typedef UInt16 KCEvent; +enum { + kIdleKCEvent = 0, + kLockKCEvent = 1, + kUnlockKCEvent = 2, + kAddKCEvent = 3, + kDeleteKCEvent = 4, + kUpdateKCEvent = 5, + kPasswordChangedKCEvent = 6, + kSystemKCEvent = 8, + kDefaultChangedKCEvent = 9, + kDataAccessKCEvent = 10, + kKeychainListChangedKCEvent = 11 +}; + +typedef UInt16 KCEventMask; +enum { + kIdleKCEventMask = 1 << kIdleKCEvent, + kLockKCEventMask = 1 << kLockKCEvent, + kUnlockKCEventMask = 1 << kUnlockKCEvent, + kAddKCEventMask = 1 << kAddKCEvent, + kDeleteKCEventMask = 1 << kDeleteKCEvent, + kUpdateKCEventMask = 1 << kUpdateKCEvent, + kPasswordChangedKCEventMask = 1 << kPasswordChangedKCEvent, + kSystemEventKCEventMask = 1 << kSystemKCEvent, + kDefaultChangedKCEventMask = 1 << kDefaultChangedKCEvent, + kDataAccessKCEventMask = 1 << kDataAccessKCEvent, + kEveryKCEventMask = 0xFFFF +}; + +typedef UInt8 AFPServerSignature[16]; +typedef UInt8 KCPublicKeyHash[20]; +struct KCCallbackInfo { + UInt32 version; + KCItemRef item; + SInt32 processID[2]; + SInt32 event[4]; + KCRef keychain; +}; +typedef struct KCCallbackInfo KCCallbackInfo; +enum { + kUnlockStateKCStatus = 1, + kRdPermKCStatus = 2, + kWrPermKCStatus = 4 +}; + + +enum { + kCertificateKCItemClass = 'cert', + kAppleSharePasswordKCItemClass = 'ashp', + kInternetPasswordKCItemClass = 'inet', + kGenericPasswordKCItemClass = 'genp' +}; + + +typedef FourCharCode KCItemClass; +enum { + + kClassKCItemAttr = 'clas', + kCreationDateKCItemAttr = 'cdat', + kModDateKCItemAttr = 'mdat', + kDescriptionKCItemAttr = 'desc', + kCommentKCItemAttr = 'icmt', + kCreatorKCItemAttr = 'crtr', + kTypeKCItemAttr = 'type', + kScriptCodeKCItemAttr = 'scrp', + kLabelKCItemAttr = 'labl', + kInvisibleKCItemAttr = 'invi', + kNegativeKCItemAttr = 'nega', + kCustomIconKCItemAttr = 'cusi', + kAccountKCItemAttr = 'acct', + + kServiceKCItemAttr = 'svce', + kGenericKCItemAttr = 'gena', + + kSecurityDomainKCItemAttr = 'sdmn', + kServerKCItemAttr = 'srvr', + kAuthTypeKCItemAttr = 'atyp', + kPortKCItemAttr = 'port', + kPathKCItemAttr = 'path', + + kVolumeKCItemAttr = 'vlme', + kAddressKCItemAttr = 'addr', + kSignatureKCItemAttr = 'ssig', + + kProtocolKCItemAttr = 'ptcl', + + kSubjectKCItemAttr = 'subj', + kCommonNameKCItemAttr = 'cn ', + kIssuerKCItemAttr = 'issu', + kSerialNumberKCItemAttr = 'snbr', + kEMailKCItemAttr = 'mail', + kPublicKeyHashKCItemAttr = 'hpky', + kIssuerURLKCItemAttr = 'iurl', + + kEncryptKCItemAttr = 'encr', + kDecryptKCItemAttr = 'decr', + kSignKCItemAttr = 'sign', + kVerifyKCItemAttr = 'veri', + kWrapKCItemAttr = 'wrap', + kUnwrapKCItemAttr = 'unwr', + kStartDateKCItemAttr = 'sdat', + kEndDateKCItemAttr = 'edat' +}; + +typedef FourCharCode KCItemAttr; +enum { + kKCAuthTypeNTLM = 'ntlm', + kKCAuthTypeMSN = 'msna', + kKCAuthTypeDPA = 'dpaa', + kKCAuthTypeRPA = 'rpaa', + kKCAuthTypeHTTPDigest = 'httd', + kKCAuthTypeDefault = 'dflt' +}; + +typedef FourCharCode KCAuthType; +enum { + kKCProtocolTypeFTP = 'ftp ', + kKCProtocolTypeFTPAccount = 'ftpa', + kKCProtocolTypeHTTP = 'http', + kKCProtocolTypeIRC = 'irc ', + kKCProtocolTypeNNTP = 'nntp', + kKCProtocolTypePOP3 = 'pop3', + kKCProtocolTypeSMTP = 'smtp', + kKCProtocolTypeSOCKS = 'sox ', + kKCProtocolTypeIMAP = 'imap', + kKCProtocolTypeLDAP = 'ldap', + kKCProtocolTypeAppleTalk = 'atlk', + kKCProtocolTypeAFP = 'afp ', + kKCProtocolTypeTelnet = 'teln' +}; + +typedef FourCharCode KCProtocolType; +typedef UInt32 KCCertAddOptions; +enum { + kSecOptionReserved = 0x000000FF, + kCertUsageShift = 8, + kCertUsageSigningAdd = 1 << (kCertUsageShift + 0), + kCertUsageSigningAskAndAdd = 1 << (kCertUsageShift + 1), + kCertUsageVerifyAdd = 1 << (kCertUsageShift + 2), + kCertUsageVerifyAskAndAdd = 1 << (kCertUsageShift + 3), + kCertUsageEncryptAdd = 1 << (kCertUsageShift + 4), + kCertUsageEncryptAskAndAdd = 1 << (kCertUsageShift + 5), + kCertUsageDecryptAdd = 1 << (kCertUsageShift + 6), + kCertUsageDecryptAskAndAdd = 1 << (kCertUsageShift + 7), + kCertUsageKeyExchAdd = 1 << (kCertUsageShift + 8), + kCertUsageKeyExchAskAndAdd = 1 << (kCertUsageShift + 9), + kCertUsageRootAdd = 1 << (kCertUsageShift + 10), + kCertUsageRootAskAndAdd = 1 << (kCertUsageShift + 11), + kCertUsageSSLAdd = 1 << (kCertUsageShift + 12), + kCertUsageSSLAskAndAdd = 1 << (kCertUsageShift + 13), + kCertUsageAllAdd = 0x7FFFFF00 +}; + +typedef UInt16 KCVerifyStopOn; +enum { + kPolicyKCStopOn = 0, + kNoneKCStopOn = 1, + kFirstPassKCStopOn = 2, + kFirstFailKCStopOn = 3 +}; + +typedef UInt32 KCCertSearchOptions; +enum { + kCertSearchShift = 0, + kCertSearchSigningIgnored = 0, + kCertSearchSigningAllowed = 1 << (kCertSearchShift + 0), + kCertSearchSigningDisallowed = 1 << (kCertSearchShift + 1), + kCertSearchSigningMask = ((kCertSearchSigningAllowed) | (kCertSearchSigningDisallowed)), + kCertSearchVerifyIgnored = 0, + kCertSearchVerifyAllowed = 1 << (kCertSearchShift + 2), + kCertSearchVerifyDisallowed = 1 << (kCertSearchShift + 3), + kCertSearchVerifyMask = ((kCertSearchVerifyAllowed) | (kCertSearchVerifyDisallowed)), + kCertSearchEncryptIgnored = 0, + kCertSearchEncryptAllowed = 1 << (kCertSearchShift + 4), + kCertSearchEncryptDisallowed = 1 << (kCertSearchShift + 5), + kCertSearchEncryptMask = ((kCertSearchEncryptAllowed) | (kCertSearchEncryptDisallowed)), + kCertSearchDecryptIgnored = 0, + kCertSearchDecryptAllowed = 1 << (kCertSearchShift + 6), + kCertSearchDecryptDisallowed = 1 << (kCertSearchShift + 7), + kCertSearchDecryptMask = ((kCertSearchDecryptAllowed) | (kCertSearchDecryptDisallowed)), + kCertSearchWrapIgnored = 0, + kCertSearchWrapAllowed = 1 << (kCertSearchShift + 8), + kCertSearchWrapDisallowed = 1 << (kCertSearchShift + 9), + kCertSearchWrapMask = ((kCertSearchWrapAllowed) | (kCertSearchWrapDisallowed)), + kCertSearchUnwrapIgnored = 0, + kCertSearchUnwrapAllowed = 1 << (kCertSearchShift + 10), + kCertSearchUnwrapDisallowed = 1 << (kCertSearchShift + 11), + kCertSearchUnwrapMask = ((kCertSearchUnwrapAllowed) | (kCertSearchUnwrapDisallowed)), + kCertSearchPrivKeyRequired = 1 << (kCertSearchShift + 12), + kCertSearchAny = 0 +}; + + +enum { + kAnyPort = 0 +}; + +enum { + kAnyProtocol = 0, + kAnyAuthType = 0 +}; +extern OSStatus +KCGetKeychainManagerVersion(UInt32 * returnVers) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCSetInteractionAllowed(Boolean state) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern Boolean +KCIsInteractionAllowed(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCMakeKCRefFromFSRef( + FSRef * keychainFSRef, + KCRef * keychain) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCMakeKCRefFromAlias( + AliasHandle keychainAlias, + KCRef * keychain) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCMakeAliasFromKCRef( + KCRef keychain, + AliasHandle * keychainAlias) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCReleaseKeychain(KCRef * keychain) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCGetDefaultKeychain(KCRef * keychain) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCSetDefaultKeychain(KCRef keychain) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCGetStatus( + KCRef keychain, + UInt32 * keychainStatus) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCGetKeychain( + KCItemRef item, + KCRef * keychain) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCGetKeychainName( + KCRef keychain, + StringPtr keychainName) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern UInt16 +KCCountKeychains(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCGetIndKeychain( + UInt16 index, + KCRef * keychain) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + +typedef OSStatus ( * KCCallbackProcPtr)(KCEvent keychainEvent, KCCallbackInfo *info, void *userContext); +typedef KCCallbackProcPtr KCCallbackUPP; +extern KCCallbackUPP +NewKCCallbackUPP(KCCallbackProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern void +DisposeKCCallbackUPP(KCCallbackUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +InvokeKCCallbackUPP( + KCEvent keychainEvent, + KCCallbackInfo * info, + void * userContext, + KCCallbackUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCFindAppleSharePassword( + AFPServerSignature * serverSignature, + ConstStringPtr serverAddress, + ConstStringPtr serverName, + ConstStringPtr volumeName, + ConstStringPtr accountName, + UInt32 maxLength, + void * passwordData, + UInt32 * actualLength, + KCItemRef * item) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCFindInternetPassword( + ConstStringPtr serverName, + ConstStringPtr securityDomain, + ConstStringPtr accountName, + UInt16 port, + OSType protocol, + OSType authType, + UInt32 maxLength, + void * passwordData, + UInt32 * actualLength, + KCItemRef * item) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCFindInternetPasswordWithPath( + ConstStringPtr serverName, + ConstStringPtr securityDomain, + ConstStringPtr accountName, + ConstStringPtr path, + UInt16 port, + OSType protocol, + OSType authType, + UInt32 maxLength, + void * passwordData, + UInt32 * actualLength, + KCItemRef * item) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCFindGenericPassword( + ConstStringPtr serviceName, + ConstStringPtr accountName, + UInt32 maxLength, + void * passwordData, + UInt32 * actualLength, + KCItemRef * item) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCAddCallback( + KCCallbackUPP callbackProc, + KCEventMask eventMask, + void * userContext) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCRemoveCallback(KCCallbackUPP callbackProc) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCNewItem( + KCItemClass itemClass, + OSType itemCreator, + UInt32 length, + const void * data, + KCItemRef * item) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCSetAttribute( + KCItemRef item, + KCAttribute * attr) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCGetAttribute( + KCItemRef item, + KCAttribute * attr, + UInt32 * actualLength) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCSetData( + KCItemRef item, + UInt32 length, + const void * data) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCUpdateItem(KCItemRef item) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCReleaseItem(KCItemRef * item) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCCopyItem( + KCItemRef item, + KCRef destKeychain, + KCItemRef * copy) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCFindFirstItem( + KCRef keychain, + const KCAttributeList * attrList, + KCSearchRef * search, + KCItemRef * item) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCFindNextItem( + KCSearchRef search, + KCItemRef * item) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCReleaseSearch(KCSearchRef * search) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCDeleteItem(KCItemRef item) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCGetData( + KCItemRef item, + UInt32 maxLength, + void * data, + UInt32 * actualLength) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +KCLock(KCRef keychain) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +kcgetkeychainname( + KCRef keychain, + char * keychainName) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +kcfindapplesharepassword( + AFPServerSignature * serverSignature, + const char * serverAddress, + const char * serverName, + const char * volumeName, + const char * accountName, + UInt32 maxLength, + void * passwordData, + UInt32 * actualLength, + KCItemRef * item) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +kcfindinternetpassword( + const char * serverName, + const char * securityDomain, + const char * accountName, + UInt16 port, + OSType protocol, + OSType authType, + UInt32 maxLength, + void * passwordData, + UInt32 * actualLength, + KCItemRef * item) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +kcfindinternetpasswordwithpath( + const char * serverName, + const char * securityDomain, + const char * accountName, + const char * path, + UInt16 port, + OSType protocol, + OSType authType, + UInt32 maxLength, + void * passwordData, + UInt32 * actualLength, + KCItemRef * item) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern OSStatus +kcfindgenericpassword( + const char * serviceName, + const char * accountName, + UInt32 maxLength, + void * passwordData, + UInt32 * actualLength, + KCItemRef * item) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + + + + + + + + + +enum { + errWSInternalError = -65793L, + errWSTransportError = -65794L, + errWSParseError = -65795L, + errWSTimeoutError = -65796L +}; +enum WSTypeID { + + + + + eWSUnknownType = 0, + + + + + eWSNullType = 1, + + + + + eWSBooleanType = 2, + + + + + eWSIntegerType = 3, + + + + + eWSDoubleType = 4, + + + + + eWSStringType = 5, + + + + + eWSDateType = 6, + + + + + eWSDataType = 7, + + + + + eWSArrayType = 8, + + + + + eWSDictionaryType = 9 +}; +typedef enum WSTypeID WSTypeID; + +typedef void * ( * WSClientContextRetainCallBackProcPtr)(void * info); +typedef void ( * WSClientContextReleaseCallBackProcPtr)(void * info); +typedef CFStringRef ( * WSClientContextCopyDescriptionCallBackProcPtr)(void * info); +struct WSClientContext { + + + + + CFIndex version; + + + + + void * info; + + + + + WSClientContextRetainCallBackProcPtr retain; + + + + + WSClientContextReleaseCallBackProcPtr release; + + + + + WSClientContextCopyDescriptionCallBackProcPtr copyDescription; +}; +typedef struct WSClientContext WSClientContext; +extern CFStringRef kWSXMLRPCProtocol __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSSOAP1999Protocol __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSSOAP2001Protocol __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern WSTypeID +WSGetWSTypeIDFromCFType(CFTypeRef ref) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFTypeID +WSGetCFTypeIDFromWSTypeID(WSTypeID typeID) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); + + + + + + + +extern CFStringRef kWSMethodInvocationResult __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); + + + +extern CFStringRef kWSFaultString __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSFaultCode __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSFaultExtra __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSNetworkStreamFaultString __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSStreamErrorMessage __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSStreamErrorDomain __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSStreamErrorError __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSHTTPMessage __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSHTTPResponseMessage __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); + + + + + +extern CFStringRef kWSHTTPExtraHeaders __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSHTTPVersion __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSHTTPProxy __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSHTTPFollowsRedirects __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSDebugOutgoingHeaders __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSDebugOutgoingBody __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSDebugIncomingHeaders __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSDebugIncomingBody __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); + + + + + +extern CFStringRef kWSSOAPBodyEncodingStyle __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSSOAPMethodNamespaceURI __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSSOAPStyleDoc __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSSOAPStyleRPC __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); + + + + + + + +extern CFStringRef kWSSOAPMessageHeaders __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); + + + + + +extern CFStringRef kWSRecordParameterOrder __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSRecordNamespaceURI __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFStringRef kWSRecordType __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); + + + + + +extern CFStringRef kWSMethodInvocationResultParameterName __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); + + + + + + +extern CFStringRef kWSMethodInvocationTimeoutValue __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +typedef struct OpaqueWSMethodInvocationRef* WSMethodInvocationRef; +extern CFTypeID +WSMethodInvocationGetTypeID(void) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern WSMethodInvocationRef +WSMethodInvocationCreate( + CFURLRef url, + CFStringRef methodName, + CFStringRef protocol) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern WSMethodInvocationRef +WSMethodInvocationCreateFromSerialization(CFDataRef contract) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFDataRef +WSMethodInvocationCopySerialization(WSMethodInvocationRef invocation) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern void +WSMethodInvocationSetParameters( + WSMethodInvocationRef invocation, + CFDictionaryRef parameters, + CFArrayRef parameterOrder) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFDictionaryRef +WSMethodInvocationCopyParameters( + WSMethodInvocationRef invocation, + CFArrayRef * parameterOrder) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern void +WSMethodInvocationSetProperty( + WSMethodInvocationRef invocation, + CFStringRef propertyName, + CFTypeRef propertyValue) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern CFTypeRef +WSMethodInvocationCopyProperty( + WSMethodInvocationRef invocation, + CFStringRef propertyName) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern __attribute__((cf_returns_retained)) CFDictionaryRef +WSMethodInvocationInvoke(WSMethodInvocationRef invocation) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +typedef void ( * WSMethodInvocationCallBackProcPtr)(WSMethodInvocationRef invocation, void *info, CFDictionaryRef outRef); +extern void +WSMethodInvocationSetCallBack( + WSMethodInvocationRef invocation, + WSMethodInvocationCallBackProcPtr clientCB, + WSClientContext * context) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern void +WSMethodInvocationScheduleWithRunLoop( + WSMethodInvocationRef invocation, + CFRunLoopRef runLoop, + CFStringRef runLoopMode) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern void +WSMethodInvocationUnscheduleFromRunLoop( + WSMethodInvocationRef invocation, + CFRunLoopRef runLoop, + CFStringRef runLoopMode) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +extern Boolean +WSMethodResultIsFault(CFDictionaryRef methodResult) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +typedef CFStringRef ( * WSMethodInvocationSerializationProcPtr)(WSMethodInvocationRef invocation, CFTypeRef obj, void *info); +extern void +WSMethodInvocationAddSerializationOverride( + WSMethodInvocationRef invocation, + CFTypeID objType, + WSMethodInvocationSerializationProcPtr serializationProc, + WSClientContext * context) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); +typedef CFTypeRef ( * WSMethodInvocationDeserializationProcPtr)(WSMethodInvocationRef invocation, CFXMLTreeRef msgRoot, CFXMLTreeRef deserializeRoot, void *info); +extern void +WSMethodInvocationAddDeserializationOverride( + WSMethodInvocationRef invocation, + CFStringRef typeNamespace, + CFStringRef typeName, + WSMethodInvocationDeserializationProcPtr deserializationProc, + WSClientContext * context) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8))); + + + +typedef struct OpaqueWSProtocolHandlerRef* WSProtocolHandlerRef; +extern CFTypeID +WSProtocolHandlerGetTypeID(void) __attribute__((availability(macosx,introduced=10.3,deprecated=10.8))); +extern WSProtocolHandlerRef +WSProtocolHandlerCreate( + CFAllocatorRef allocator, + CFStringRef protocol) __attribute__((availability(macosx,introduced=10.3,deprecated=10.8))); +extern CFDictionaryRef +WSProtocolHandlerCopyRequestDictionary( + WSProtocolHandlerRef ref, + CFDataRef data) __attribute__((availability(macosx,introduced=10.3,deprecated=10.8))); +extern CFDictionaryRef +WSProtocolHandlerCopyReplyDictionary( + WSProtocolHandlerRef ref, + CFStringRef methodName, + CFDataRef data) __attribute__((availability(macosx,introduced=10.3,deprecated=10.8))); +extern CFDataRef +WSProtocolHandlerCopyReplyDocument( + WSProtocolHandlerRef ref, + CFDictionaryRef methodContext, + CFTypeRef resultValue) __attribute__((availability(macosx,introduced=10.3,deprecated=10.8))); +extern CFDataRef +WSProtocolHandlerCopyFaultDocument( + WSProtocolHandlerRef ref, + CFDictionaryRef methodContext, + CFDictionaryRef faultDict) __attribute__((availability(macosx,introduced=10.3,deprecated=10.8))); +extern CFDataRef +WSProtocolHandlerCopyRequestDocument( + WSProtocolHandlerRef ref, + CFStringRef methodName, + CFDictionaryRef methodParams, + CFArrayRef methodParamOrder, + CFDictionaryRef methodExtras) __attribute__((availability(macosx,introduced=10.3,deprecated=10.8))); +extern CFTypeRef +WSProtocolHandlerCopyProperty( + WSProtocolHandlerRef ref, + CFStringRef propertyName) __attribute__((availability(macosx,introduced=10.3,deprecated=10.8))); +extern void +WSProtocolHandlerSetProperty( + WSProtocolHandlerRef ref, + CFStringRef propertyName, + CFTypeRef propertyValue) __attribute__((availability(macosx,introduced=10.3,deprecated=10.8))); +typedef CFStringRef ( * WSProtocolHandlerSerializationProcPtr)(WSProtocolHandlerRef protocol, CFTypeRef obj, void *info); +extern void +WSProtocolHandlerSetSerializationOverride( + WSProtocolHandlerRef protocol, + CFTypeID objType, + WSProtocolHandlerSerializationProcPtr serializationProc, + WSClientContext * context) __attribute__((availability(macosx,introduced=10.3,deprecated=10.8))); +typedef CFTypeRef ( * WSProtocolHandlerDeserializationProcPtr)(WSProtocolHandlerRef protocol, CFXMLTreeRef msgRoot, CFXMLTreeRef deserializeRoot, void *info); +extern void +WSProtocolHandlerSetDeserializationOverride( + WSProtocolHandlerRef protocol, + CFStringRef typeNamespace, + CFStringRef typeName, + WSProtocolHandlerDeserializationProcPtr deserializationProc, + WSClientContext * context) __attribute__((availability(macosx,introduced=10.3,deprecated=10.8))); +enum { + kGenericDocumentIconResource = -4000, + kGenericStationeryIconResource = -3985, + kGenericEditionFileIconResource = -3989, + kGenericApplicationIconResource = -3996, + kGenericDeskAccessoryIconResource = -3991, + kGenericFolderIconResource = -3999, + kPrivateFolderIconResource = -3994, + kFloppyIconResource = -3998, + kTrashIconResource = -3993, + kGenericRAMDiskIconResource = -3988, + kGenericCDROMIconResource = -3987 +}; + + + +enum { + kDesktopIconResource = -3992, + kOpenFolderIconResource = -3997, + kGenericHardDiskIconResource = -3995, + kGenericFileServerIconResource = -3972, + kGenericSuitcaseIconResource = -3970, + kGenericMoverObjectIconResource = -3969 +}; + + + +enum { + kGenericPreferencesIconResource = -3971, + kGenericQueryDocumentIconResource = -16506, + kGenericExtensionIconResource = -16415, + kSystemFolderIconResource = -3983, + kHelpIconResource = -20271, + kAppleMenuFolderIconResource = -3982 +}; + + +enum { + genericDocumentIconResource = kGenericDocumentIconResource, + genericStationeryIconResource = kGenericStationeryIconResource, + genericEditionFileIconResource = kGenericEditionFileIconResource, + genericApplicationIconResource = kGenericApplicationIconResource, + genericDeskAccessoryIconResource = kGenericDeskAccessoryIconResource, + genericFolderIconResource = kGenericFolderIconResource, + privateFolderIconResource = kPrivateFolderIconResource, + floppyIconResource = kFloppyIconResource, + trashIconResource = kTrashIconResource, + genericRAMDiskIconResource = kGenericRAMDiskIconResource, + genericCDROMIconResource = kGenericCDROMIconResource, + desktopIconResource = kDesktopIconResource, + openFolderIconResource = kOpenFolderIconResource, + genericHardDiskIconResource = kGenericHardDiskIconResource, + genericFileServerIconResource = kGenericFileServerIconResource, + genericSuitcaseIconResource = kGenericSuitcaseIconResource, + genericMoverObjectIconResource = kGenericMoverObjectIconResource, + genericPreferencesIconResource = kGenericPreferencesIconResource, + genericQueryDocumentIconResource = kGenericQueryDocumentIconResource, + genericExtensionIconResource = kGenericExtensionIconResource, + systemFolderIconResource = kSystemFolderIconResource, + appleMenuFolderIconResource = kAppleMenuFolderIconResource +}; + + +enum { + kStartupFolderIconResource = -3981, + kOwnedFolderIconResource = -3980, + kDropFolderIconResource = -3979, + kSharedFolderIconResource = -3978, + kMountedFolderIconResource = -3977, + kControlPanelFolderIconResource = -3976, + kPrintMonitorFolderIconResource = -3975, + kPreferencesFolderIconResource = -3974, + kExtensionsFolderIconResource = -3973, + kFontsFolderIconResource = -3968, + kFullTrashIconResource = -3984 +}; + + +enum { + startupFolderIconResource = kStartupFolderIconResource, + ownedFolderIconResource = kOwnedFolderIconResource, + dropFolderIconResource = kDropFolderIconResource, + sharedFolderIconResource = kSharedFolderIconResource, + mountedFolderIconResource = kMountedFolderIconResource, + controlPanelFolderIconResource = kControlPanelFolderIconResource, + printMonitorFolderIconResource = kPrintMonitorFolderIconResource, + preferencesFolderIconResource = kPreferencesFolderIconResource, + extensionsFolderIconResource = kExtensionsFolderIconResource, + fontsFolderIconResource = kFontsFolderIconResource, + fullTrashIconResource = kFullTrashIconResource +}; + + +typedef struct OpaqueIconRef* IconRef; +enum { + kSystemIconsCreator = 'macs' +}; +enum { + kClipboardIcon = 'CLIP', + kClippingUnknownTypeIcon = 'clpu', + kClippingPictureTypeIcon = 'clpp', + kClippingTextTypeIcon = 'clpt', + kClippingSoundTypeIcon = 'clps', + kDesktopIcon = 'desk', + kFinderIcon = 'FNDR', + kComputerIcon = 'root', + kFontSuitcaseIcon = 'FFIL', + kFullTrashIcon = 'ftrh', + kGenericApplicationIcon = 'APPL', + kGenericCDROMIcon = 'cddr', + kGenericControlPanelIcon = 'APPC', + kGenericControlStripModuleIcon = 'sdev', + kGenericComponentIcon = 'thng', + kGenericDeskAccessoryIcon = 'APPD', + kGenericDocumentIcon = 'docu', + kGenericEditionFileIcon = 'edtf', + kGenericExtensionIcon = 'INIT', + kGenericFileServerIcon = 'srvr', + kGenericFontIcon = 'ffil', + kGenericFontScalerIcon = 'sclr', + kGenericFloppyIcon = 'flpy', + kGenericHardDiskIcon = 'hdsk', + kGenericIDiskIcon = 'idsk', + kGenericRemovableMediaIcon = 'rmov', + kGenericMoverObjectIcon = 'movr', + kGenericPCCardIcon = 'pcmc', + kGenericPreferencesIcon = 'pref', + kGenericQueryDocumentIcon = 'qery', + kGenericRAMDiskIcon = 'ramd', + kGenericSharedLibaryIcon = 'shlb', + kGenericStationeryIcon = 'sdoc', + kGenericSuitcaseIcon = 'suit', + kGenericURLIcon = 'gurl', + kGenericWORMIcon = 'worm', + kInternationalResourcesIcon = 'ifil', + kKeyboardLayoutIcon = 'kfil', + kSoundFileIcon = 'sfil', + kSystemSuitcaseIcon = 'zsys', + kTrashIcon = 'trsh', + kTrueTypeFontIcon = 'tfil', + kTrueTypeFlatFontIcon = 'sfnt', + kTrueTypeMultiFlatFontIcon = 'ttcf', + kUserIDiskIcon = 'udsk', + kUnknownFSObjectIcon = 'unfs', + kInternationResourcesIcon = kInternationalResourcesIcon +}; + + +enum { + kInternetLocationHTTPIcon = 'ilht', + kInternetLocationFTPIcon = 'ilft', + kInternetLocationAppleShareIcon = 'ilaf', + kInternetLocationAppleTalkZoneIcon = 'ilat', + kInternetLocationFileIcon = 'ilfi', + kInternetLocationMailIcon = 'ilma', + kInternetLocationNewsIcon = 'ilnw', + kInternetLocationNSLNeighborhoodIcon = 'ilns', + kInternetLocationGenericIcon = 'ilge' +}; + + +enum { + kGenericFolderIcon = 'fldr', + kDropFolderIcon = 'dbox', + kMountedFolderIcon = 'mntd', + kOpenFolderIcon = 'ofld', + kOwnedFolderIcon = 'ownd', + kPrivateFolderIcon = 'prvf', + kSharedFolderIcon = 'shfl' +}; + + +enum { + kSharingPrivsNotApplicableIcon = 'shna', + kSharingPrivsReadOnlyIcon = 'shro', + kSharingPrivsReadWriteIcon = 'shrw', + kSharingPrivsUnknownIcon = 'shuk', + kSharingPrivsWritableIcon = 'writ' +}; + + + +enum { + kUserFolderIcon = 'ufld', + kWorkgroupFolderIcon = 'wfld', + kGuestUserIcon = 'gusr', + kUserIcon = 'user', + kOwnerIcon = 'susr', + kGroupIcon = 'grup' +}; + + +enum { + kAppearanceFolderIcon = 'appr', + kAppleExtrasFolderIcon = 0x616578C4 , + kAppleMenuFolderIcon = 'amnu', + kApplicationsFolderIcon = 'apps', + kApplicationSupportFolderIcon = 'asup', + kAssistantsFolderIcon = 0x617374C4 , + kColorSyncFolderIcon = 'prof', + kContextualMenuItemsFolderIcon = 'cmnu', + kControlPanelDisabledFolderIcon = 'ctrD', + kControlPanelFolderIcon = 'ctrl', + kControlStripModulesFolderIcon = 0x736476C4 , + kDocumentsFolderIcon = 'docs', + kExtensionsDisabledFolderIcon = 'extD', + kExtensionsFolderIcon = 'extn', + kFavoritesFolderIcon = 'favs', + kFontsFolderIcon = 'font', + kHelpFolderIcon = (int)0xC4686C70 , + kInternetFolderIcon = 0x696E74C4 , + kInternetPlugInFolderIcon = (int)0xC46E6574 , + kInternetSearchSitesFolderIcon = 'issf', + kLocalesFolderIcon = (int)0xC46C6F63 , + kMacOSReadMeFolderIcon = 0x6D6F72C4 , + kPublicFolderIcon = 'pubf', + kPreferencesFolderIcon = 0x707266C4 , + kPrinterDescriptionFolderIcon = 'ppdf', + kPrinterDriverFolderIcon = (int)0xC4707264 , + kPrintMonitorFolderIcon = 'prnt', + kRecentApplicationsFolderIcon = 'rapp', + kRecentDocumentsFolderIcon = 'rdoc', + kRecentServersFolderIcon = 'rsrv', + kScriptingAdditionsFolderIcon = (int)0xC4736372 , + kSharedLibrariesFolderIcon = (int)0xC46C6962 , + kScriptsFolderIcon = 0x736372C4 , + kShutdownItemsDisabledFolderIcon = 'shdD', + kShutdownItemsFolderIcon = 'shdf', + kSpeakableItemsFolder = 'spki', + kStartupItemsDisabledFolderIcon = 'strD', + kStartupItemsFolderIcon = 'strt', + kSystemExtensionDisabledFolderIcon = 'macD', + kSystemFolderIcon = 'macs', + kTextEncodingsFolderIcon = (int)0xC4746578 , + kUsersFolderIcon = 0x757372C4 , + kUtilitiesFolderIcon = 0x757469C4 , + kVoicesFolderIcon = 'fvoc' +}; + + +enum { + kAppleScriptBadgeIcon = 'scrp', + kLockedBadgeIcon = 'lbdg', + kMountedBadgeIcon = 'mbdg', + kSharedBadgeIcon = 'sbdg', + kAliasBadgeIcon = 'abdg', + kAlertCautionBadgeIcon = 'cbdg' +}; + + +enum { + kAlertNoteIcon = 'note', + kAlertCautionIcon = 'caut', + kAlertStopIcon = 'stop' +}; + + +enum { + kAppleTalkIcon = 'atlk', + kAppleTalkZoneIcon = 'atzn', + kAFPServerIcon = 'afps', + kFTPServerIcon = 'ftps', + kHTTPServerIcon = 'htps', + kGenericNetworkIcon = 'gnet', + kIPFileServerIcon = 'isrv' +}; + + +enum { + kToolbarCustomizeIcon = 'tcus', + kToolbarDeleteIcon = 'tdel', + kToolbarFavoritesIcon = 'tfav', + kToolbarHomeIcon = 'thom', + kToolbarAdvancedIcon = 'tbav', + kToolbarInfoIcon = 'tbin', + kToolbarLabelsIcon = 'tblb', + kToolbarApplicationsFolderIcon = 'tAps', + kToolbarDocumentsFolderIcon = 'tDoc', + kToolbarMovieFolderIcon = 'tMov', + kToolbarMusicFolderIcon = 'tMus', + kToolbarPicturesFolderIcon = 'tPic', + kToolbarPublicFolderIcon = 'tPub', + kToolbarDesktopFolderIcon = 'tDsk', + kToolbarDownloadsFolderIcon = 'tDwn', + kToolbarLibraryFolderIcon = 'tLib', + kToolbarUtilitiesFolderIcon = 'tUtl', + kToolbarSitesFolderIcon = 'tSts' +}; + + +enum { + kAppleLogoIcon = 'capl', + kAppleMenuIcon = 'sapl', + kBackwardArrowIcon = 'baro', + kFavoriteItemsIcon = 'favr', + kForwardArrowIcon = 'faro', + kGridIcon = 'grid', + kHelpIcon = 'help', + kKeepArrangedIcon = 'arng', + kLockedIcon = 'lock', + kNoFilesIcon = 'nfil', + kNoFolderIcon = 'nfld', + kNoWriteIcon = 'nwrt', + kProtectedApplicationFolderIcon = 'papp', + kProtectedSystemFolderIcon = 'psys', + kRecentItemsIcon = 'rcnt', + kShortcutIcon = 'shrt', + kSortAscendingIcon = 'asnd', + kSortDescendingIcon = 'dsnd', + kUnlockedIcon = 'ulck', + kConnectToIcon = 'cnct', + kGenericWindowIcon = 'gwin', + kQuestionMarkIcon = 'ques', + kDeleteAliasIcon = 'dali', + kEjectMediaIcon = 'ejec', + kBurningIcon = 'burn', + kRightContainerArrowIcon = 'rcar' +}; + + + +typedef UInt32 IconServicesUsageFlags; +enum { + kIconServicesNormalUsageFlag = 0x00000000, + kIconServicesNoBadgeFlag = 0x00000001, + kIconServicesUpdateIfNeededFlag = 0x00000002 +}; +enum { + kIconServicesCatalogInfoMask = (kFSCatInfoNodeID | kFSCatInfoParentDirID | kFSCatInfoVolume | kFSCatInfoNodeFlags | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo | kFSCatInfoUserAccess | kFSCatInfoPermissions | kFSCatInfoContentMod) +}; +extern OSErr +GetIconRefOwners( + IconRef theIconRef, + UInt16 * owners) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +AcquireIconRef(IconRef theIconRef) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +ReleaseIconRef(IconRef theIconRef) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +GetIconRef( + SInt16 vRefNum, + OSType creator, + OSType iconType, + IconRef * theIconRef) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +GetIconRefFromFolder( + SInt16 vRefNum, + SInt32 parentFolderID, + SInt32 folderID, + SInt8 attributes, + SInt8 accessPrivileges, + IconRef * theIconRef) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +GetIconRefFromFileInfo( + const FSRef * inRef, + UniCharCount inFileNameLength, + const UniChar * inFileName, + FSCatalogInfoBitmap inWhichInfo, + const FSCatalogInfo * inCatalogInfo, + IconServicesUsageFlags inUsageFlags, + IconRef * outIconRef, + SInt16 * outLabel) __attribute__((availability(macosx,introduced=10.1))); +extern OSErr +GetIconRefFromTypeInfo( + OSType inCreator, + OSType inType, + CFStringRef inExtension, + CFStringRef inMIMEType, + IconServicesUsageFlags inUsageFlags, + IconRef * outIconRef) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +GetIconRefFromIconFamilyPtr( + const IconFamilyResource * inIconFamilyPtr, + Size inSize, + IconRef * outIconRef) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +GetIconRefFromComponent( + Component inComponent, + IconRef * outIconRef) __attribute__((availability(macosx,introduced=10.5))); +extern OSErr +RegisterIconRefFromIconFamily( + OSType creator, + OSType iconType, + IconFamilyHandle iconFamily, + IconRef * theIconRef) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +RegisterIconRefFromFSRef( + OSType creator, + OSType iconType, + const FSRef * iconFile, + IconRef * theIconRef) __attribute__((availability(macosx,introduced=10.1))); +extern OSErr +UnregisterIconRef( + OSType creator, + OSType iconType) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +UpdateIconRef(IconRef theIconRef) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +OverrideIconRef( + IconRef oldIconRef, + IconRef newIconRef) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +RemoveIconRefOverride(IconRef theIconRef) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +CompositeIconRef( + IconRef backgroundIconRef, + IconRef foregroundIconRef, + IconRef * compositeIconRef) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +IsIconRefComposite( + IconRef compositeIconRef, + IconRef * backgroundIconRef, + IconRef * foregroundIconRef) __attribute__((availability(macosx,introduced=10.0))); +extern Boolean +IsValidIconRef(IconRef theIconRef) __attribute__((availability(macosx,introduced=10.0))); +extern Boolean +IsDataAvailableInIconRef( + OSType inIconKind, + IconRef inIconRef) __attribute__((availability(macosx,introduced=10.3))); +extern OSErr +SetCustomIconsEnabled( + SInt16 vRefNum, + Boolean enableCustomIcons) __attribute__((availability(macosx,introduced=10.0))); +extern OSErr +GetCustomIconsEnabled( + SInt16 vRefNum, + Boolean * customIconsEnabled) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +ReadIconFromFSRef( + const FSRef * ref, + IconFamilyHandle * iconFamily) __attribute__((availability(macosx,introduced=10.1))); + + + + +enum { + kLSAppInTrashErr = -10660, + kLSExecutableIncorrectFormat = -10661, + kLSAttributeNotFoundErr = -10662, + kLSAttributeNotSettableErr = -10663, + kLSIncompatibleApplicationVersionErr = -10664, + kLSNoRosettaEnvironmentErr = -10665, + kLSGarbageCollectionUnsupportedErr = -10666, + kLSUnknownErr = -10810, + kLSNotAnApplicationErr = -10811, + kLSNotInitializedErr = -10812, + kLSDataUnavailableErr = -10813, + kLSApplicationNotFoundErr = -10814, + kLSUnknownTypeErr = -10815, + kLSDataTooOldErr = -10816, + kLSDataErr = -10817, + kLSLaunchInProgressErr = -10818, + kLSNotRegisteredErr = -10819, + kLSAppDoesNotClaimTypeErr = -10820, + kLSAppDoesNotSupportSchemeWarning = -10821, + kLSServerCommunicationErr = -10822, + kLSCannotSetInfoErr = -10823, + kLSNoRegistrationInfoErr = -10824, + kLSIncompatibleSystemVersionErr = -10825, + kLSNoLaunchPermissionErr = -10826, + kLSNoExecutableErr = -10827, + kLSNoClassicEnvironmentErr = -10828, + kLSMultipleSessionsNotSupportedErr = -10829, +}; + +typedef OptionBits LSRolesMask; enum { + kLSRolesNone = 0x00000001, + kLSRolesViewer = 0x00000002, + kLSRolesEditor = 0x00000004, + kLSRolesShell = 0x00000008, + kLSRolesAll = (UInt32)0xFFFFFFFF +}; + +enum { + kLSUnknownType = 0, + kLSUnknownCreator = 0 +}; + +typedef OptionBits LSAcceptanceFlags; enum { + kLSAcceptDefault = 0x00000001, + kLSAcceptAllowLoginUI = 0x00000002 +}; +extern _Nullable CFURLRef +LSCopyDefaultApplicationURLForURL( + CFURLRef inURL, + LSRolesMask inRoleMask, + _Nullable CFErrorRef *_Nullable outError) __attribute__((availability(macosx,introduced=10.10))); +extern _Nullable CFURLRef +LSCopyDefaultApplicationURLForContentType( + CFStringRef inContentType, + LSRolesMask inRoleMask, + _Nullable CFErrorRef *_Nullable outError) __attribute__((availability(macosx,introduced=10.10))); +extern _Nullable CFArrayRef +LSCopyApplicationURLsForBundleIdentifier( + CFStringRef inBundleIdentifier, + _Nullable CFErrorRef *_Nullable outError) __attribute__((availability(macosx,introduced=10.10))); +extern _Nullable CFArrayRef +LSCopyApplicationURLsForURL( + CFURLRef inURL, + LSRolesMask inRoleMask) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +LSCanURLAcceptURL( + CFURLRef inItemURL, + CFURLRef inTargetURL, + LSRolesMask inRoleMask, + LSAcceptanceFlags inFlags, + Boolean * outAcceptsItem) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +LSRegisterURL( + CFURLRef inURL, + Boolean inUpdate) __attribute__((availability(macosx,introduced=10.3))); +extern _Nullable CFStringRef +LSCopyDefaultRoleHandlerForContentType( + CFStringRef inContentType, + LSRolesMask inRole) __attribute__((availability(macosx,introduced=10.4))); +extern _Nullable CFArrayRef +LSCopyAllRoleHandlersForContentType( + CFStringRef inContentType, + LSRolesMask inRole) __attribute__((availability(macosx,introduced=10.4))); +extern OSStatus +LSSetDefaultRoleHandlerForContentType( + CFStringRef inContentType, + LSRolesMask inRole, + CFStringRef inHandlerBundleID) __attribute__((availability(macosx,introduced=10.4))); +extern _Nullable CFStringRef +LSCopyDefaultHandlerForURLScheme(CFStringRef inURLScheme) __attribute__((availability(macosx,introduced=10.4))); +extern _Nullable CFArrayRef +LSCopyAllHandlersForURLScheme(CFStringRef inURLScheme) __attribute__((availability(macosx,introduced=10.4))); +extern OSStatus +LSSetDefaultHandlerForURLScheme( + CFStringRef inURLScheme, + CFStringRef inHandlerBundleID) __attribute__((availability(macosx,introduced=10.4))); + + + + + + + + + + + + + + + + + + +typedef OptionBits LSRequestedInfo; enum { + kLSRequestExtension __attribute__((availability(macosx,deprecated=10.11,message="Use CFURLCopyPathExtension(), -[NSURL pathExtension], or -[NSString pathExtension] instead."))) = 0x00000001, + kLSRequestTypeCreator __attribute__((availability(macosx,deprecated=10.11,message="Creator codes are deprecated on OS X."))) = 0x00000002, + kLSRequestBasicFlagsOnly __attribute__((availability(macosx,deprecated=10.11,message="Use CFURLCopyResourcePropertiesForKeys or -[NSURL resourceValuesForKeys:error:] instead."))) = 0x00000004, + kLSRequestAppTypeFlags __attribute__((availability(macosx,deprecated=10.11,message="Use CFURLCopyResourcePropertiesForKeys or -[NSURL resourceValuesForKeys:error:] instead."))) = 0x00000008, + kLSRequestAllFlags __attribute__((availability(macosx,deprecated=10.11,message="Use CFURLCopyResourcePropertiesForKeys or -[NSURL resourceValuesForKeys:error:] instead."))) = 0x00000010, + kLSRequestIconAndKind __attribute__((availability(macosx,deprecated=10.11,message="Use CFURLCopyResourcePropertiesForKeys or -[NSURL resourceValuesForKeys:error:] instead."))) = 0x00000020, + kLSRequestExtensionFlagsOnly __attribute__((availability(macosx,deprecated=10.11,message="Use CFURLCopyResourcePropertiesForKeys or -[NSURL resourceValuesForKeys:error:] instead."))) = 0x00000040, + kLSRequestAllInfo __attribute__((availability(macosx,deprecated=10.11,message="Use CFURLCopyResourcePropertiesForKeys or -[NSURL resourceValuesForKeys:error:] instead."))) = (UInt32)0xFFFFFFFF +}; + + + +typedef OptionBits LSItemInfoFlags; enum { + kLSItemInfoIsPlainFile __attribute__((availability(macosx,deprecated=10.11,message="Use the URL resource property kCFURLIsRegularFileKey or NSURLIsRegularFileKey instead."))) = 0x00000001, + kLSItemInfoIsPackage __attribute__((availability(macosx,deprecated=10.11,message="Use the URL resource property kCFURLIsPackageKey or NSURLIsPackageKey instead."))) = 0x00000002, + kLSItemInfoIsApplication __attribute__((availability(macosx,deprecated=10.11,message="Use the URL resource property kCFURLIsApplicationKey or NSURLIsApplicationKey instead."))) = 0x00000004, + kLSItemInfoIsContainer __attribute__((availability(macosx,deprecated=10.11,message="Use the URL resource property kCFURLIsDirectoryKey or NSURLIsDirectoryKey instead."))) = 0x00000008, + kLSItemInfoIsAliasFile __attribute__((availability(macosx,deprecated=10.11,message="Use the URL resource property kCFURLIsAliasFileKey or NSURLIsAliasFileKey instead."))) = 0x00000010, + kLSItemInfoIsSymlink __attribute__((availability(macosx,deprecated=10.11,message="Use the URL resource property kCFURLIsSymbolicLinkKey or NSURLIsSymbolicLinkKey."))) = 0x00000020, + kLSItemInfoIsInvisible __attribute__((availability(macosx,deprecated=10.11,message="Use the URL resource property kCFURLIsHiddenKey or NSURLIsHiddenKey instead."))) = 0x00000040, + kLSItemInfoIsNativeApp __attribute__((availability(macosx,deprecated=10.11,message="The Classic environment is no longer supported."))) = 0x00000080, + kLSItemInfoIsClassicApp __attribute__((availability(macosx,deprecated=10.11,message="The Classic environment is no longer supported."))) = 0x00000100, + kLSItemInfoAppPrefersNative __attribute__((availability(macosx,deprecated=10.11,message="The Classic environment is no longer supported."))) = 0x00000200, + kLSItemInfoAppPrefersClassic __attribute__((availability(macosx,deprecated=10.11,message="The Classic environment is no longer supported."))) = 0x00000400, + kLSItemInfoAppIsScriptable __attribute__((availability(macosx,deprecated=10.11,message="Use the URL resource property kCFURLApplicationIsScriptableKey or NSURLApplicationIsScriptableKey instead."))) = 0x00000800, + kLSItemInfoIsVolume __attribute__((availability(macosx,deprecated=10.11,message="Use the URL resource property kCFURLIsVolumeKey or NSURLIsVolumeKey instead."))) = 0x00001000, + kLSItemInfoExtensionIsHidden __attribute__((availability(macosx,deprecated=10.11,message="Use the URL resource property kCFURLHasHiddenExtensionKey or NSURLHasHiddenExtensionKey instead."))) = 0x00100000 +}; +typedef struct LSItemInfoRecord { + LSItemInfoFlags flags; + OSType filetype; + OSType creator; + CFStringRef extension; +} LSItemInfoRecord __attribute__((availability(macosx,deprecated=10.11,message="Use CFURLCopyResourcePropertiesForKeys or -[NSURL resourceValuesForKeys:error:] instead."))); +extern OSStatus +LSCopyItemInfoForURL( + CFURLRef inURL, + LSRequestedInfo inWhichInfo, + LSItemInfoRecord * outItemInfo) __attribute__((availability(macosx,introduced=10.0,deprecated=10.11,message="Use URL resource properties instead."))); +extern OSStatus +LSCopyItemInfoForRef( + const FSRef * inItemRef, + LSRequestedInfo inWhichInfo, + LSItemInfoRecord * outItemInfo) __attribute__((availability(macosx,introduced=10.0,deprecated=10.10,message="Use URL resource properties instead."))); +extern OSStatus +LSGetExtensionInfo( + UniCharCount inNameLen, + const UniChar inNameBuffer[], + UniCharCount * outExtStartIndex) __attribute__((availability(macosx,introduced=10.1,deprecated=10.11,message="Use CFURLCopyPathExtension(), -[NSURL pathExtension], or -[NSString pathExtension] instead."))); +extern OSStatus +LSCopyDisplayNameForRef( + const FSRef * inRef, + CFStringRef * outDisplayName) __attribute__((availability(macosx,introduced=10.1,deprecated=10.10,message="Use the URL resource property kCFURLLocalizedNameKey or NSURLLocalizedNameKey instead."))); +extern OSStatus +LSCopyDisplayNameForURL( + CFURLRef inURL, + CFStringRef * outDisplayName) __attribute__((availability(macosx,introduced=10.1,deprecated=10.11,message="Use the URL resource property kCFURLLocalizedNameKey or NSURLLocalizedNameKey instead."))); +extern OSStatus +LSSetExtensionHiddenForRef( + const FSRef * inRef, + Boolean inHide) __attribute__((availability(macosx,introduced=10.1,deprecated=10.10,message="Use the URL resource property kCFURLHasHiddenExtensionKey or NSURLHasHiddenExtensionKey instead."))); +extern OSStatus +LSSetExtensionHiddenForURL( + CFURLRef inURL, + Boolean inHide) __attribute__((availability(macosx,introduced=10.1,deprecated=10.11,message="Use the URL resource property kCFURLHasHiddenExtensionKey or NSURLHasHiddenExtensionKey instead."))); +extern OSStatus +LSCopyKindStringForRef( + const FSRef * inFSRef, + CFStringRef * outKindString) __attribute__((availability(macosx,introduced=10.0,deprecated=10.10,message="Use the URL resource property kCFURLLocalizedTypeDescriptionKey or NSURLLocalizedTypeDescriptionKey instead."))); +extern OSStatus +LSCopyKindStringForURL( + CFURLRef inURL, + CFStringRef * outKindString) __attribute__((availability(macosx,introduced=10.0,deprecated=10.11,message="Use the URL resource property kCFURLLocalizedTypeDescriptionKey or NSURLLocalizedTypeDescriptionKey instead."))); +extern OSStatus +LSCopyKindStringForTypeInfo( + OSType inType, + OSType inCreator, + CFStringRef inExtension, + CFStringRef * outKindString) __attribute__((availability(macosx,introduced=10.2,deprecated=10.10,message="Use UTTypeCopyDescription instead."))); +extern OSStatus +LSCopyKindStringForMIMEType( + CFStringRef inMIMEType, + CFStringRef * outKindString) __attribute__((availability(macosx,introduced=10.2,deprecated=10.10,message="Use UTTypeCopyDescription instead."))); +extern OSStatus +LSGetApplicationForItem( + const FSRef * inItemRef, + LSRolesMask inRoleMask, + FSRef * outAppRef, + CFURLRef * outAppURL) __attribute__((availability(macosx,introduced=10.0,deprecated=10.10,message="Use LSCopyDefaultApplicationURLForURL instead."))); +extern OSStatus +LSGetApplicationForInfo( + OSType inType, + OSType inCreator, + CFStringRef inExtension, + LSRolesMask inRoleMask, + FSRef * outAppRef, + CFURLRef * outAppURL) __attribute__((availability(macosx,introduced=10.0,deprecated=10.10,message="Use LSCopyDefaultApplicationURLForContentType instead."))); +extern OSStatus +LSCopyApplicationForMIMEType( + CFStringRef inMIMEType, + LSRolesMask inRoleMask, + CFURLRef * outAppURL) __attribute__((availability(macosx,introduced=10.2,deprecated=10.10,message="Use LSCopyDefaultApplicationURLForContentType instead."))); +extern OSStatus +LSGetApplicationForURL( + CFURLRef inURL, + LSRolesMask inRoleMask, + FSRef * outAppRef, + CFURLRef * outAppURL) __attribute__((availability(macosx,introduced=10.0,deprecated=10.10,message="Use LSCopyDefaultApplicationURLForURL instead."))); +extern OSStatus +LSFindApplicationForInfo( + OSType inCreator, + CFStringRef inBundleID, + CFStringRef inName, + FSRef * outAppRef, + CFURLRef * outAppURL) __attribute__((availability(macosx,introduced=10.0,deprecated=10.10,message="Use LSCopyApplicationURLsForBundleIdentifier instead."))); +extern OSStatus +LSCanRefAcceptItem( + const FSRef * inItemFSRef, + const FSRef * inTargetRef, + LSRolesMask inRoleMask, + LSAcceptanceFlags inFlags, + Boolean * outAcceptsItem) __attribute__((availability(macosx,introduced=10.0,deprecated=10.10,message="Use LSCanURLAcceptURL instead."))); +extern OSStatus +LSRegisterFSRef( + const FSRef * inRef, + Boolean inUpdate) __attribute__((availability(macosx,introduced=10.3,deprecated=10.10,message="Use LSRegisterURL instead."))); +extern const CFStringRef kLSItemContentType __attribute__((availability(macosx,introduced=10.4,deprecated=10.10,message="Use the URL resource property kCFURLTypeIdentifierKey or NSURLTypeIdentifierKey instead."))); +extern const CFStringRef kLSItemFileType __attribute__((availability(macosx,introduced=10.4,deprecated=10.10,message="Use the URL resource property kCFURLTypeIdentifierKey or NSURLTypeIdentifierKey to get the file's UTI instead."))); +extern const CFStringRef kLSItemFileCreator __attribute__((availability(macosx,introduced=10.4,deprecated=10.10,message="Use the URL resource property kCFURLTypeIdentifierKey or NSURLTypeIdentifierKey to get the file's UTI instead."))); +extern const CFStringRef kLSItemExtension __attribute__((availability(macosx,introduced=10.4,deprecated=10.10,message="Use CFURLCopyPathExtension or -[NSURL pathExtension] instead."))); +extern const CFStringRef kLSItemDisplayName __attribute__((availability(macosx,introduced=10.4,deprecated=10.10,message="Use the URL resource property kCFURLLocalizedNameKey or NSURLLocalizedNameKey instead."))); +extern const CFStringRef kLSItemDisplayKind __attribute__((availability(macosx,introduced=10.4,deprecated=10.10,message="Use the URL resource property kCFURLLocalizedTypeDescriptionKey or NSURLLocalizedTypeDescriptionKey instead."))); +extern const CFStringRef kLSItemRoleHandlerDisplayName __attribute__((availability(macosx,introduced=10.4,deprecated=10.10,message="Instead, resolve the desired role handler for the file, then use the URL resource property kCFURLLocalizedNameKey or NSURLLocalizedNameKey on the role handler's URL."))); +extern const CFStringRef kLSItemIsInvisible __attribute__((availability(macosx,introduced=10.4,deprecated=10.10,message="Use the URL resource property kCFURLIsHiddenKey or NSURLIsHiddenKey instead."))); +extern const CFStringRef kLSItemExtensionIsHidden __attribute__((availability(macosx,introduced=10.4,deprecated=10.10,message="Use the URL resource property kCFURLHasHiddenExtensionKey or NSURLHasHiddenExtensionKey instead."))); +extern const CFStringRef kLSItemQuarantineProperties __attribute__((availability(macosx,introduced=10.5,deprecated=10.10,message="Use the URL resource property kCFURLQuarantinePropertiesKey or NSURLQuarantinePropertiesKey instead."))); +extern OSStatus +LSCopyItemAttribute( + const FSRef * inItem, + LSRolesMask inRoles, + CFStringRef inAttributeName, + CFTypeRef * outValue) __attribute__((availability(macosx,introduced=10.4,deprecated=10.10,message="Use CFURLCopyResourcePropertyForKey or -[NSURL getResourceValue:forKey:error:] instead."))); +extern OSStatus +LSCopyItemAttributes( + const FSRef * inItem, + LSRolesMask inRoles, + CFArrayRef inAttributeNames, + CFDictionaryRef * outValues) __attribute__((availability(macosx,introduced=10.4,deprecated=10.10,message="Use CFURLCopyResourcePropertiesForKeys or -[NSURL resourceValuesForKeys:error:] instead."))); +extern OSStatus +LSSetItemAttribute( + const FSRef * inItem, + LSRolesMask inRoles, + CFStringRef inAttributeName, + CFTypeRef inValue) __attribute__((availability(macosx,introduced=10.5,deprecated=10.10,message="Use CFURLSetResourcePropertyForKey or -[NSURL setResourceValue:forKey:error:] instead."))); +typedef OptionBits LSHandlerOptions; enum { + kLSHandlerOptionsDefault __attribute__((availability(macosx,introduced=10.4,deprecated=10.11,message="Creator codes are deprecated on OS X."))) = 0, + kLSHandlerOptionsIgnoreCreator __attribute__((availability(macosx,introduced=10.4,deprecated=10.11,message="Creator codes are deprecated on OS X."))) = 1 +}; +extern LSHandlerOptions +LSGetHandlerOptionsForContentType(CFStringRef inContentType) __attribute__((availability(macosx,introduced=10.4,deprecated=10.11,message="Creator codes are deprecated on OS X."))); +extern OSStatus +LSSetHandlerOptionsForContentType( + CFStringRef inContentType, + LSHandlerOptions inOptions) __attribute__((availability(macosx,introduced=10.4,deprecated=10.11,message="Creator codes are deprecated on OS X."))); + + + + + + +typedef OptionBits LSLaunchFlags; enum { + kLSLaunchDefaults = 0x00000001, + kLSLaunchAndPrint = 0x00000002, + kLSLaunchAndDisplayErrors = 0x00000040, + kLSLaunchDontAddToRecents = 0x00000100, + kLSLaunchDontSwitch = 0x00000200, + kLSLaunchAsync = 0x00010000, + kLSLaunchNewInstance = 0x00080000, + kLSLaunchAndHide = 0x00100000, + kLSLaunchAndHideOthers = 0x00200000, +}; + + +typedef struct LSLaunchURLSpec { + _Nullable CFURLRef appURL; + _Nullable CFArrayRef itemURLs; + const AEDesc * _Nullable passThruParams; + LSLaunchFlags launchFlags; + void * _Nullable asyncRefCon; +} LSLaunchURLSpec __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +LSOpenCFURLRef( + CFURLRef inURL, + _Nullable CFURLRef *_Nullable outLaunchedURL) __attribute__((availability(macosx,introduced=10.0))); +extern OSStatus +LSOpenFromURLSpec( + const LSLaunchURLSpec * inLaunchSpec, + _Nullable CFURLRef *_Nullable outLaunchedURL) __attribute__((availability(macosx,introduced=10.0))); + + + + + + + + + + + + + + + + + + + +enum { + kLSLaunchInhibitBGOnly __attribute__((availability(macosx,introduced=10.0,deprecated=10.12,message="This option does nothing."))) = 0x00000080, + kLSLaunchNoParams __attribute__((availability(macosx,introduced=10.0,deprecated=10.12,message="This option does nothing."))) = 0x00000800, + kLSLaunchStartClassic __attribute__((availability(macosx,introduced=10.0,deprecated=10.11,message="The Classic environment is no longer supported."))) = 0x00020000, + kLSLaunchInClassic __attribute__((availability(macosx,introduced=10.0,deprecated=10.11,message="The Classic environment is no longer supported."))) = 0x00040000, + kLSLaunchHasUntrustedContents __attribute__((availability(macosx,introduced=10.4,deprecated=10.12,message="This option does nothing."))) = 0x00400000, +}; + + + + +typedef struct LSLaunchFSRefSpec { + const FSRef * appRef; + ItemCount numDocs; + const FSRef * itemRefs; + const AEDesc * passThruParams; + + LSLaunchFlags launchFlags; + void * asyncRefCon; +} LSLaunchFSRefSpec __attribute__((availability(macosx,introduced=10.0,deprecated=10.10,message="Use LSLaunchURLSpec instead."))); +extern OSStatus +LSOpenFSRef( + const FSRef * inRef, + FSRef * outLaunchedRef) __attribute__((availability(macosx,introduced=10.0,deprecated=10.10,message="Use LSOpenCFURLRef or -[NSWorkspace openURL:] instead."))); +extern OSStatus +LSOpenFromRefSpec( + const LSLaunchFSRefSpec * inLaunchSpec, + FSRef * outLaunchedRef) __attribute__((availability(macosx,introduced=10.0,deprecated=10.10,message="Use LSOpenFromURLSpec or NSWorkspace instead."))); +typedef struct LSApplicationParameters { + CFIndex version; + LSLaunchFlags flags; + const FSRef * application; + void * asyncLaunchRefCon; + CFDictionaryRef environment; + + CFArrayRef argv; + + AppleEvent * initialEvent; +} LSApplicationParameters __attribute__((availability(macosx,introduced=10.4,deprecated=10.10,message="Use NSWorkspace instead."))); +extern OSStatus +LSOpenApplication( + const LSApplicationParameters * appParams, + ProcessSerialNumber * outPSN) __attribute__((availability(macosx,introduced=10.4,deprecated=10.10,message="Use -[NSWorkspace launchApplicationAtURL:options:configuration:error:] instead."))); +extern OSStatus +LSOpenItemsWithRole( + const FSRef * inItems, + CFIndex inItemCount, + LSRolesMask inRole, + const AEKeyDesc * inAEParam, + const LSApplicationParameters * inAppParams, + ProcessSerialNumber * outPSNs, + CFIndex inMaxPSNCount) __attribute__((availability(macosx,introduced=10.4,deprecated=10.10,message="Use NSWorkspace instead."))); +extern OSStatus +LSOpenURLsWithRole( + CFArrayRef inURLs, + LSRolesMask inRole, + const AEKeyDesc * inAEParam, + const LSApplicationParameters * inAppParams, + ProcessSerialNumber * outPSNs, + CFIndex inMaxPSNCount) __attribute__((availability(macosx,introduced=10.4,deprecated=10.10,message="Use NSWorkspace instead."))); + + + + + + + +extern const CFStringRef kLSQuarantineAgentNameKey __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kLSQuarantineAgentBundleIdentifierKey __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kLSQuarantineTimeStampKey __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kLSQuarantineTypeKey __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kLSQuarantineTypeWebDownload __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kLSQuarantineTypeOtherDownload __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kLSQuarantineTypeEmailAttachment __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kLSQuarantineTypeInstantMessageAttachment __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kLSQuarantineTypeCalendarEventAttachment __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kLSQuarantineTypeOtherAttachment __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kLSQuarantineOriginURLKey __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kLSQuarantineDataURLKey __attribute__((availability(macosx,introduced=10.5))); + + + +extern const CFStringRef kUTTypeItem __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeContent __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeCompositeContent __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeMessage __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeContact __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeArchive __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeDiskImage __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeData __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeDirectory __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeResolvable __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeSymLink __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeExecutable __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kUTTypeMountPoint __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeAliasFile __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeAliasRecord __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeURLBookmarkData __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeURL __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeFileURL __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeText __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypePlainText __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeUTF8PlainText __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeUTF16ExternalPlainText __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeUTF16PlainText __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeDelimitedText __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeCommaSeparatedText __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeTabSeparatedText __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeUTF8TabSeparatedText __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeRTF __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeHTML __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeXML __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeSourceCode __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeAssemblyLanguageSource __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeCSource __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeObjectiveCSource __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeSwiftSource __attribute__((availability(macosx,introduced=10.11))); +extern const CFStringRef kUTTypeCPlusPlusSource __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeObjectiveCPlusPlusSource __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeCHeader __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeCPlusPlusHeader __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeJavaSource __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeScript __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeAppleScript __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeOSAScript __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeOSAScriptBundle __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeJavaScript __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeShellScript __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypePerlScript __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypePythonScript __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeRubyScript __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypePHPScript __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeJSON __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypePropertyList __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeXMLPropertyList __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeBinaryPropertyList __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypePDF __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeRTFD __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeFlatRTFD __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeTXNTextAndMultimediaData __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeWebArchive __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeImage __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeJPEG __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeJPEG2000 __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeTIFF __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypePICT __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeGIF __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypePNG __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeQuickTimeImage __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeAppleICNS __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeBMP __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeICO __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeRawImage __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeScalableVectorGraphics __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeLivePhoto __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kUTTypeAudiovisualContent __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeMovie __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeVideo __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeAudio __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeQuickTimeMovie __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeMPEG __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeMPEG2Video __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeMPEG2TransportStream __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeMP3 __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeMPEG4 __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeMPEG4Audio __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeAppleProtectedMPEG4Audio __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeAppleProtectedMPEG4Video __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeAVIMovie __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeAudioInterchangeFileFormat __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeWaveformAudio __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeMIDIAudio __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypePlaylist __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeM3UPlaylist __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeFolder __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeVolume __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypePackage __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeBundle __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypePluginBundle __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeSpotlightImporter __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeQuickLookGenerator __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeXPCService __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeFramework __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeApplication __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeApplicationBundle __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeApplicationFile __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeUnixExecutable __attribute__((availability(macosx,introduced=10.10))); + + +extern const CFStringRef kUTTypeWindowsExecutable __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeJavaClass __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeJavaArchive __attribute__((availability(macosx,introduced=10.10))); + + +extern const CFStringRef kUTTypeSystemPreferencesPane __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeGNUZipArchive __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeBzip2Archive __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeZipArchive __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeSpreadsheet __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypePresentation __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeDatabase __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeVCard __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeToDoItem __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeCalendarEvent __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeEmailMessage __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeInternetLocation __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeInkText __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kUTTypeFont __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeBookmark __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTType3DContent __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypePKCS12 __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeX509Certificate __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeElectronicPublication __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kUTTypeLog __attribute__((availability(macosx,introduced=10.10))); + + + +extern const CFStringRef kUTExportedTypeDeclarationsKey __attribute__((availability(macosx,introduced=10.3))); + + + +extern const CFStringRef kUTImportedTypeDeclarationsKey __attribute__((availability(macosx,introduced=10.3))); + + + +extern const CFStringRef kUTTypeIdentifierKey __attribute__((availability(macosx,introduced=10.3))); + + + +extern const CFStringRef kUTTypeTagSpecificationKey __attribute__((availability(macosx,introduced=10.3))); + + + +extern const CFStringRef kUTTypeConformsToKey __attribute__((availability(macosx,introduced=10.3))); + + + +extern const CFStringRef kUTTypeDescriptionKey __attribute__((availability(macosx,introduced=10.3))); + + + +extern const CFStringRef kUTTypeIconFileKey __attribute__((availability(macosx,introduced=10.3))); + + + +extern const CFStringRef kUTTypeReferenceURLKey __attribute__((availability(macosx,introduced=10.3))); + + + +extern const CFStringRef kUTTypeVersionKey __attribute__((availability(macosx,introduced=10.3))); +extern const CFStringRef kUTTagClassFilenameExtension __attribute__((availability(macosx,introduced=10.3))); + + + +extern const CFStringRef kUTTagClassMIMEType __attribute__((availability(macosx,introduced=10.3))); + + + +extern const CFStringRef kUTTagClassNSPboardType __attribute__((availability(macosx,introduced=10.3))); + + + +extern const CFStringRef kUTTagClassOSType __attribute__((availability(macosx,introduced=10.3))); +extern _Nullable CFStringRef +UTTypeCreatePreferredIdentifierForTag( + CFStringRef inTagClass, + CFStringRef inTag, + _Nullable CFStringRef inConformingToUTI) __attribute__((availability(macosx,introduced=10.3))); +extern _Nullable CFArrayRef +UTTypeCreateAllIdentifiersForTag( + CFStringRef inTagClass, + CFStringRef inTag, + _Nullable CFStringRef inConformingToUTI) __attribute__((availability(macosx,introduced=10.3))); +extern _Nullable CFStringRef +UTTypeCopyPreferredTagWithClass( + CFStringRef inUTI, + CFStringRef inTagClass) __attribute__((availability(macosx,introduced=10.3))); +extern _Nullable CFArrayRef +UTTypeCopyAllTagsWithClass( + CFStringRef inUTI, + CFStringRef inTagClass) __attribute__((availability(macosx,introduced=10.10))); +extern Boolean +UTTypeEqual( + CFStringRef inUTI1, + CFStringRef inUTI2) __attribute__((availability(macosx,introduced=10.3))); +extern Boolean +UTTypeConformsTo( + CFStringRef inUTI, + CFStringRef inConformsToUTI) __attribute__((availability(macosx,introduced=10.3))); +extern _Nullable CFStringRef +UTTypeCopyDescription(CFStringRef inUTI) __attribute__((availability(macosx,introduced=10.3))); +extern Boolean +UTTypeIsDeclared(CFStringRef inUTI) __attribute__((availability(macosx,introduced=10.10))); +extern Boolean +UTTypeIsDynamic(CFStringRef inUTI) __attribute__((availability(macosx,introduced=10.10))); +extern _Nullable CFDictionaryRef +UTTypeCopyDeclaration(CFStringRef inUTI) __attribute__((availability(macosx,introduced=10.3))); +extern _Nullable CFURLRef +UTTypeCopyDeclaringBundleURL(CFStringRef inUTI) __attribute__((availability(macosx,introduced=10.3))); +extern CFStringRef +UTCreateStringForOSType(OSType inOSType) __attribute__((availability(macosx,introduced=10.3))); +extern OSType +UTGetOSTypeFromString(CFStringRef inString) __attribute__((availability(macosx,introduced=10.3))); + + + +typedef struct __attribute__((objc_bridge(id))) __MDItem * MDItemRef; + + + + + +extern CFTypeID MDItemGetTypeID(void) __attribute__((availability(macosx,introduced=10.4))); +extern MDItemRef MDItemCreate(CFAllocatorRef allocator, CFStringRef path) __attribute__((availability(macosx,introduced=10.4))); +extern MDItemRef MDItemCreateWithURL(CFAllocatorRef allocator, CFURLRef url) __attribute__((availability(macosx,introduced=10.6))); +extern CFArrayRef MDItemsCreateWithURLs(CFAllocatorRef allocator, CFArrayRef urls) __attribute__((availability(macosx,introduced=10.7))); +extern CFTypeRef MDItemCopyAttribute(MDItemRef item, CFStringRef name) __attribute__((availability(macosx,introduced=10.4))); +extern CFDictionaryRef MDItemCopyAttributes(MDItemRef item, CFArrayRef names) __attribute__((availability(macosx,introduced=10.4))); +extern CFDictionaryRef MDItemCopyAttributeList(MDItemRef item, ... ) __attribute__((availability(macosx,introduced=10.4))); +extern CFArrayRef MDItemCopyAttributeNames(MDItemRef item) __attribute__((availability(macosx,introduced=10.4))); +extern CFArrayRef MDItemsCopyAttributes(CFArrayRef items, CFArrayRef names) __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kMDItemAttributeChangeDate __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemContentType __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemContentTypeTree __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kMDItemKeywords __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemTitle __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemAuthors __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemEditors __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kMDItemParticipants __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kMDItemProjects __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemDownloadedDate __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kMDItemWhereFroms __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemComment __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemCopyright __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemLastUsedDate __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemContentCreationDate __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemContentModificationDate __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemDateAdded __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kMDItemDurationSeconds __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemContactKeywords __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemVersion __attribute__((availability(macosx,introduced=10.4))); + +extern const CFStringRef kMDItemPixelHeight __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemPixelWidth __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemPixelCount __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kMDItemColorSpace __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemBitsPerSample __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemFlashOnOff __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemFocalLength __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemAcquisitionMake __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemAcquisitionModel __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemISOSpeed __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemOrientation __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemLayerNames __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemWhiteBalance __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemAperture __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemProfileName __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemResolutionWidthDPI __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemResolutionHeightDPI __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemExposureMode __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemExposureTimeSeconds __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemEXIFVersion __attribute__((availability(macosx,introduced=10.4))); + +extern const CFStringRef kMDItemCameraOwner __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kMDItemFocalLength35mm __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kMDItemLensModel __attribute__((availability(macosx,introduced=10.7))); + +extern const CFStringRef kMDItemEXIFGPSVersion __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kMDItemAltitude __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kMDItemLatitude __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kMDItemLongitude __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kMDItemSpeed __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kMDItemTimestamp __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kMDItemGPSTrack __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kMDItemImageDirection __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kMDItemNamedLocation __attribute__((availability(macosx,introduced=10.6))); + +extern const CFStringRef kMDItemGPSStatus __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kMDItemGPSMeasureMode __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kMDItemGPSDOP __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kMDItemGPSMapDatum __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kMDItemGPSDestLatitude __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kMDItemGPSDestLongitude __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kMDItemGPSDestBearing __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kMDItemGPSDestDistance __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kMDItemGPSProcessingMethod __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kMDItemGPSAreaInformation __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kMDItemGPSDateStamp __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kMDItemGPSDifferental __attribute__((availability(macosx,introduced=10.7))); + +extern const CFStringRef kMDItemCodecs __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemMediaTypes __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemStreamable __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemTotalBitRate __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemVideoBitRate __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemAudioBitRate __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemDeliveryType __attribute__((availability(macosx,introduced=10.4))); + +extern const CFStringRef kMDItemAlbum __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemHasAlphaChannel __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemRedEyeOnOff __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemMeteringMode __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemMaxAperture __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemFNumber __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemExposureProgram __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemExposureTimeString __attribute__((availability(macosx,introduced=10.4))); + + +extern const CFStringRef kMDItemHeadline __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemInstructions __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemCity __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemStateOrProvince __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemCountry __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemFSName __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemDisplayName __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemPath __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemFSSize __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemFSCreationDate __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemFSContentChangeDate __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemFSOwnerUserID __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemFSOwnerGroupID __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemFSExists __attribute__((availability(macosx,introduced=10.4,deprecated=10.4))); +extern const CFStringRef kMDItemFSIsReadable __attribute__((availability(macosx,introduced=10.4,deprecated=10.4))); +extern const CFStringRef kMDItemFSIsWriteable __attribute__((availability(macosx,introduced=10.4,deprecated=10.4))); +extern const CFStringRef kMDItemFSHasCustomIcon __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemFSIsExtensionHidden __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemFSIsStationery __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemFSInvisible __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemFSLabel __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemFSNodeCount __attribute__((availability(macosx,introduced=10.4))); + +extern const CFStringRef kMDItemHTMLContent __attribute__((availability(macosx,introduced=10.11))); +extern const CFStringRef kMDItemTextContent __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemAudioSampleRate __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemAudioChannelCount __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemTempo __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemKeySignature __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemTimeSignature __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemAudioEncodingApplication __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemComposer __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemLyricist __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemAudioTrackNumber __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemRecordingDate __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemMusicalGenre __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemIsGeneralMIDISequence __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemRecordingYear __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemOrganizations __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemLanguages __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemRights __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemPublishers __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemContributors __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemCoverage __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemSubject __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemTheme __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemDescription __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemIdentifier __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemAudiences __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemNumberOfPages __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemPageWidth __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemPageHeight __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemSecurityMethod __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemCreator __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemEncodingApplications __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemDueDate __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemStarRating __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemPhoneNumbers __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemEmailAddresses __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemInstantMessageAddresses __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemKind __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemRecipients __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemFinderComment __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemFonts __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemAppleLoopsRootKey __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemAppleLoopsKeyFilterType __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemAppleLoopsLoopMode __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemAppleLoopDescriptors __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemMusicalInstrumentCategory __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDItemMusicalInstrumentName __attribute__((availability(macosx,introduced=10.4))); + +extern const CFStringRef kMDItemCFBundleIdentifier __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kMDItemSupportFileType __attribute__((availability(macosx,introduced=10.5,deprecated=10.5))); +extern const CFStringRef kMDItemInformation __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kMDItemDirector __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kMDItemProducer __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kMDItemGenre __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kMDItemPerformers __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kMDItemOriginalFormat __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kMDItemOriginalSource __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kMDItemAuthorEmailAddresses __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kMDItemRecipientEmailAddresses __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kMDItemAuthorAddresses __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kMDItemRecipientAddresses __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kMDItemURL __attribute__((availability(macosx,introduced=10.5))); + +extern const CFStringRef kMDItemLabelIcon __attribute__((availability(macosx,introduced=10.7,deprecated=10.7))); +extern const CFStringRef kMDItemLabelID __attribute__((availability(macosx,introduced=10.7,deprecated=10.7))); +extern const CFStringRef kMDItemLabelKind __attribute__((availability(macosx,introduced=10.7,deprecated=10.7))); +extern const CFStringRef kMDItemLabelUUID __attribute__((availability(macosx,introduced=10.7,deprecated=10.7))); + +extern const CFStringRef kMDItemIsLikelyJunk __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kMDItemExecutableArchitectures __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kMDItemExecutablePlatform __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kMDItemApplicationCategories __attribute__((availability(macosx,introduced=10.7))); + +extern const CFStringRef kMDItemIsApplicationManaged __attribute__((availability(macosx,introduced=10.7))); +extern CFDictionaryRef __MDItemCopyAttributesEllipsis1(MDItemRef item, ...) __attribute__((availability(macosx,introduced=10.4))); +typedef struct __attribute__((objc_bridge(id))) __MDQuery * MDQueryRef; + +typedef enum { + kMDQuerySynchronous = 1, + kMDQueryWantsUpdates = 4, + kMDQueryAllowFSTranslation = 8 +} MDQueryOptionFlags; +extern CFTypeID MDQueryGetTypeID(void) __attribute__((availability(macosx,introduced=10.4))); +extern MDQueryRef MDQueryCreate(CFAllocatorRef allocator, CFStringRef queryString, CFArrayRef valueListAttrs, CFArrayRef sortingAttrs) __attribute__((availability(macosx,introduced=10.4))); +extern MDQueryRef MDQueryCreateSubset(CFAllocatorRef allocator, MDQueryRef query, CFStringRef queryString, CFArrayRef valueListAttrs, CFArrayRef sortingAttrs) __attribute__((availability(macosx,introduced=10.4))); +extern MDQueryRef MDQueryCreateForItems(CFAllocatorRef allocator, + CFStringRef queryString, + CFArrayRef valueListAttrs, + CFArrayRef sortingAttrs, + CFArrayRef items) __attribute__((availability(macosx,introduced=10.7))); +extern CFStringRef MDQueryCopyQueryString(MDQueryRef query) __attribute__((availability(macosx,introduced=10.4))); +extern CFArrayRef MDQueryCopyValueListAttributes(MDQueryRef query) __attribute__((availability(macosx,introduced=10.4))); +extern CFArrayRef MDQueryCopySortingAttributes(MDQueryRef query) __attribute__((availability(macosx,introduced=10.4))); +typedef struct { + size_t first_max_num; + size_t first_max_ms; + size_t progress_max_num; + size_t progress_max_ms; + size_t update_max_num; + size_t update_max_ms; +} MDQueryBatchingParams; +extern MDQueryBatchingParams MDQueryGetBatchingParameters(MDQueryRef query) __attribute__((availability(macosx,introduced=10.4))); + + + + + + + +extern void MDQuerySetBatchingParameters(MDQueryRef query, MDQueryBatchingParams params) __attribute__((availability(macosx,introduced=10.4))); +typedef const void *(*MDQueryCreateResultFunction)(MDQueryRef query, MDItemRef item, void *context); +extern void MDQuerySetCreateResultFunction(MDQueryRef query, MDQueryCreateResultFunction func, void *context, const CFArrayCallBacks *cb) __attribute__((availability(macosx,introduced=10.4))); +typedef const void *(*MDQueryCreateValueFunction)(MDQueryRef query, CFStringRef attrName, CFTypeRef attrValue, void *context); +extern void MDQuerySetCreateValueFunction(MDQueryRef query, MDQueryCreateValueFunction func, void *context, const CFArrayCallBacks *cb) __attribute__((availability(macosx,introduced=10.4))); +extern void MDQuerySetDispatchQueue(MDQueryRef query, dispatch_queue_t queue) __attribute__((availability(macosx,introduced=10.6))); +extern Boolean MDQueryExecute(MDQueryRef query, CFOptionFlags optionFlags) __attribute__((availability(macosx,introduced=10.4))); +extern void MDQueryStop(MDQueryRef query) __attribute__((availability(macosx,introduced=10.4))); +extern void MDQueryDisableUpdates(MDQueryRef query) __attribute__((availability(macosx,introduced=10.4))); +extern void MDQueryEnableUpdates(MDQueryRef query) __attribute__((availability(macosx,introduced=10.4))); +extern Boolean MDQueryIsGatheringComplete(MDQueryRef query) __attribute__((availability(macosx,introduced=10.4))); +extern CFIndex MDQueryGetResultCount(MDQueryRef query) __attribute__((availability(macosx,introduced=10.4))); +extern const void *MDQueryGetResultAtIndex(MDQueryRef query, CFIndex idx) __attribute__((availability(macosx,introduced=10.4))); +extern CFIndex MDQueryGetIndexOfResult(MDQueryRef query, const void *result) __attribute__((availability(macosx,introduced=10.4))); +extern void *MDQueryGetAttributeValueOfResultAtIndex(MDQueryRef query, CFStringRef name, CFIndex idx) __attribute__((availability(macosx,introduced=10.4))); +extern CFArrayRef MDQueryCopyValuesOfAttribute(MDQueryRef query, CFStringRef name) __attribute__((availability(macosx,introduced=10.4))); +extern CFIndex MDQueryGetCountOfResultsWithAttributeValue(MDQueryRef query, CFStringRef name, CFTypeRef value) __attribute__((availability(macosx,introduced=10.4))); +extern Boolean MDQuerySetSortOrder(MDQueryRef query, CFArrayRef sortingAttrs) __attribute__((availability(macosx,introduced=10.7))); + + + + + +typedef enum { + kMDQueryReverseSortOrderFlag = (1<<0), +} MDQuerySortOptionFlags; +extern Boolean MDQuerySetSortOptionFlagsForAttribute(MDQueryRef query, CFStringRef fieldName, uint32_t flags) __attribute__((availability(macosx,introduced=10.7))); +extern uint32_t MDQueryGetSortOptionFlagsForAttribute(MDQueryRef query, CFStringRef fieldName) __attribute__((availability(macosx,introduced=10.7))); +typedef CFComparisonResult (*MDQuerySortComparatorFunction)(const CFTypeRef attrs1[], const CFTypeRef attrs2[], void *context); +extern void MDQuerySetSortComparator(MDQueryRef query, MDQuerySortComparatorFunction comparator, void *context) __attribute__((availability(macosx,introduced=10.4))); +extern void MDQuerySetSortComparatorBlock(MDQueryRef query, CFComparisonResult (^comparator)(const CFTypeRef attrs1[], const CFTypeRef attrs2[])) __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kMDQueryProgressNotification __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDQueryDidFinishNotification __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDQueryDidUpdateNotification __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDQueryUpdateAddedItems __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDQueryUpdateChangedItems __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDQueryUpdateRemovedItems __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDQueryResultContentRelevance __attribute__((availability(macosx,introduced=10.4))); +extern void MDQuerySetSearchScope(MDQueryRef query, CFArrayRef scopeDirectories, OptionBits scopeOptions) __attribute__((availability(macosx,introduced=10.4))); + + + + + + + +extern const CFStringRef kMDQueryScopeHome __attribute__((availability(macosx,introduced=10.4))); + + + + + + + +extern const CFStringRef kMDQueryScopeComputer __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern const CFStringRef kMDQueryScopeNetwork __attribute__((availability(macosx,introduced=10.4))); + + + + + + + +extern const CFStringRef kMDQueryScopeAllIndexed __attribute__((availability(macosx,introduced=10.6))); + + + + + + + +extern const CFStringRef kMDQueryScopeComputerIndexed __attribute__((availability(macosx,introduced=10.6))); + + + + + + +extern const CFStringRef kMDQueryScopeNetworkIndexed __attribute__((availability(macosx,introduced=10.6))); +extern void MDQuerySetMaxCount(MDQueryRef query, CFIndex size) __attribute__((availability(macosx,introduced=10.5))); +typedef struct __MDLabel * MDLabelRef; + +extern CFTypeID MDLabelGetTypeID(void) +__attribute__((availability(macosx,introduced=10.7))); +extern CFArrayRef MDItemCopyLabels(MDItemRef item) +__attribute__((availability(macosx,introduced=10.7))); +extern Boolean MDItemSetLabel(MDItemRef item, MDLabelRef label) +__attribute__((availability(macosx,introduced=10.7))); +extern Boolean MDItemRemoveLabel(MDItemRef item, MDLabelRef label) +__attribute__((availability(macosx,introduced=10.7))); + + + + + +typedef enum { + kMDLabelUserDomain, + kMDLabelLocalDomain, +} MDLabelDomain; +extern MDLabelRef MDLabelCreate(CFAllocatorRef allocator, + CFStringRef displayName, + CFStringRef kind, + MDLabelDomain domain) +__attribute__((availability(macosx,introduced=10.7))); +extern CFTypeRef MDLabelCopyAttribute(MDLabelRef label, + CFStringRef name) +__attribute__((availability(macosx,introduced=10.7))); + + + + + + + +extern CFStringRef MDLabelCopyAttributeName(MDLabelRef label) +__attribute__((availability(macosx,introduced=10.7))); + + + + + + + +extern Boolean MDLabelDelete(MDLabelRef label) +__attribute__((availability(macosx,introduced=10.7))); +extern Boolean MDLabelSetAttributes(MDLabelRef label, + CFDictionaryRef attrs) +__attribute__((availability(macosx,introduced=10.7))); + + + + + + +extern CFArrayRef MDCopyLabelKinds(void) +__attribute__((availability(macosx,introduced=10.7))); + + + + + + + +extern CFArrayRef MDCopyLabelsMatchingExpression(CFStringRef simpleQueryString) +__attribute__((availability(macosx,introduced=10.7))); + + + + + + + +extern CFArrayRef MDCopyLabelsWithKind(CFStringRef kind) +__attribute__((availability(macosx,introduced=10.7))); + + + + + + + +extern MDLabelRef MDCopyLabelWithUUID(CFUUIDRef labelUUID) +__attribute__((availability(macosx,introduced=10.7))); +extern CFStringRef kMDLabelBundleURL +__attribute__((availability(macosx,introduced=10.7))); + +extern CFStringRef kMDLabelContentChangeDate +__attribute__((availability(macosx,introduced=10.7))); + +extern CFStringRef kMDLabelDisplayName +__attribute__((availability(macosx,introduced=10.7))); + +extern CFStringRef kMDLabelIconData +__attribute__((availability(macosx,introduced=10.7))); + +extern CFStringRef kMDLabelIconUUID +__attribute__((availability(macosx,introduced=10.7))); + +extern CFStringRef kMDLabelIsMutuallyExclusiveSetMember +__attribute__((availability(macosx,introduced=10.7))); + +extern CFStringRef kMDLabelKind +__attribute__((availability(macosx,introduced=10.7))); + +extern CFStringRef kMDLabelSetsFinderColor +__attribute__((availability(macosx,introduced=10.7))); + +extern CFStringRef kMDLabelUUID +__attribute__((availability(macosx,introduced=10.7))); + +extern CFStringRef kMDLabelVisibility +__attribute__((availability(macosx,introduced=10.7))); +extern CFStringRef kMDLabelKindIsMutuallyExclusiveSetKey +__attribute__((availability(macosx,introduced=10.7))); + +extern CFStringRef kMDLabelKindVisibilityKey +__attribute__((availability(macosx,introduced=10.7))); + +extern CFStringRef kMDPrivateVisibility +__attribute__((availability(macosx,introduced=10.7))); + +extern CFStringRef kMDPublicVisibility +__attribute__((availability(macosx,introduced=10.7))); + + + + + +extern const CFStringRef kMDLabelAddedNotification +__attribute__((availability(macosx,introduced=10.7))); + + + + + +extern const CFStringRef kMDLabelChangedNotification +__attribute__((availability(macosx,introduced=10.7))); + + + + + +extern const CFStringRef kMDLabelRemovedNotification +__attribute__((availability(macosx,introduced=10.7))); + +extern CFDictionaryRef MDSchemaCopyAttributesForContentType(CFStringRef contentTypeUTI) __attribute__((availability(macosx,introduced=10.4))); + + + + + + + +extern CFDictionaryRef MDSchemaCopyMetaAttributesForAttribute(CFStringRef name) __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern CFArrayRef MDSchemaCopyAllAttributes(void) __attribute__((availability(macosx,introduced=10.4))); +extern CFStringRef MDSchemaCopyDisplayNameForAttribute(CFStringRef name) __attribute__((availability(macosx,introduced=10.4))); +extern CFStringRef MDSchemaCopyDisplayDescriptionForAttribute(CFStringRef name) __attribute__((availability(macosx,introduced=10.4))); + + +extern const CFStringRef kMDAttributeDisplayValues __attribute__((availability(macosx,introduced=10.4))); + + + +extern const CFStringRef kMDAttributeAllValues __attribute__((availability(macosx,introduced=10.4))); + + + +extern const CFStringRef kMDAttributeReadOnlyValues __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kMDExporterAvaliable __attribute__((availability(macosx,introduced=10.5))); + + + + + + +extern const CFStringRef kMDAttributeName __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDAttributeType __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kMDAttributeMultiValued __attribute__((availability(macosx,introduced=10.4))); + + + + + + + +typedef CFTypeRef SKDocumentRef; +extern CFTypeID +SKDocumentGetTypeID(void) __attribute__((availability(macosx,introduced=10.3))); +extern SKDocumentRef +SKDocumentCreateWithURL(CFURLRef inURL) __attribute__((availability(macosx,introduced=10.3))); +extern CFURLRef +SKDocumentCopyURL(SKDocumentRef inDocument) __attribute__((availability(macosx,introduced=10.3))); +extern SKDocumentRef +SKDocumentCreate( + CFStringRef inScheme, + SKDocumentRef inParent, + CFStringRef inName) __attribute__((availability(macosx,introduced=10.3))); +extern CFStringRef +SKDocumentGetSchemeName(SKDocumentRef inDocument) __attribute__((availability(macosx,introduced=10.3))); +extern CFStringRef +SKDocumentGetName(SKDocumentRef inDocument) __attribute__((availability(macosx,introduced=10.3))); +extern SKDocumentRef +SKDocumentGetParent(SKDocumentRef inDocument) __attribute__((availability(macosx,introduced=10.3))); + + + +extern const CFStringRef kSKMinTermLength __attribute__((availability(macosx,introduced=10.3))); +extern const CFStringRef kSKSubstitutions __attribute__((availability(macosx,introduced=10.3))); +extern const CFStringRef kSKStopWords __attribute__((availability(macosx,introduced=10.3))); +extern const CFStringRef kSKProximityIndexing __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kSKMaximumTerms __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kSKTermChars __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kSKStartTermChars __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kSKEndTermChars __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kSKLanguageTypes __attribute__((availability(macosx,introduced=10.3,deprecated=10.4))); + + + +typedef struct __SKIndex* SKIndexRef; +extern CFTypeID +SKIndexGetTypeID(void) __attribute__((availability(macosx,introduced=10.3))); +typedef struct __SKIndexDocumentIterator* SKIndexDocumentIteratorRef; +extern CFTypeID +SKIndexDocumentIteratorGetTypeID(void) __attribute__((availability(macosx,introduced=10.3))); +enum SKIndexType { + + + + + kSKIndexUnknown = 0, + + + + + kSKIndexInverted = 1, + + + + + kSKIndexVector = 2, + + + + + + kSKIndexInvertedVector = 3 +}; +typedef enum SKIndexType SKIndexType; +enum SKDocumentIndexState { + + + + + kSKDocumentStateNotIndexed = 0, + + + + + kSKDocumentStateIndexed = 1, + + + + + + kSKDocumentStateAddPending = 2, + + + + + + kSKDocumentStateDeletePending = 3 +}; +typedef enum SKDocumentIndexState SKDocumentIndexState; +extern SKIndexRef +SKIndexCreateWithURL( + CFURLRef inURL, + CFStringRef inIndexName, + SKIndexType inIndexType, + CFDictionaryRef inAnalysisProperties) __attribute__((availability(macosx,introduced=10.3))); +extern SKIndexRef +SKIndexOpenWithURL( + CFURLRef inURL, + CFStringRef inIndexName, + Boolean inWriteAccess) __attribute__((availability(macosx,introduced=10.3))); +extern SKIndexRef +SKIndexCreateWithMutableData( + CFMutableDataRef inData, + CFStringRef inIndexName, + SKIndexType inIndexType, + CFDictionaryRef inAnalysisProperties) __attribute__((availability(macosx,introduced=10.3))); +extern SKIndexRef +SKIndexOpenWithData( + CFDataRef inData, + CFStringRef inIndexName) __attribute__((availability(macosx,introduced=10.3))); +extern SKIndexRef +SKIndexOpenWithMutableData( + CFMutableDataRef inData, + CFStringRef inIndexName) __attribute__((availability(macosx,introduced=10.3))); +extern Boolean +SKIndexFlush(SKIndexRef inIndex) __attribute__((availability(macosx,introduced=10.3))); +extern void +SKIndexSetMaximumBytesBeforeFlush( + SKIndexRef inIndex, + CFIndex inBytesForUpdate) __attribute__((availability(macosx,introduced=10.3))); +extern CFIndex +SKIndexGetMaximumBytesBeforeFlush(SKIndexRef inIndex) __attribute__((availability(macosx,introduced=10.3))); +extern Boolean +SKIndexCompact(SKIndexRef inIndex) __attribute__((availability(macosx,introduced=10.3))); +extern SKIndexType +SKIndexGetIndexType(SKIndexRef inIndex) __attribute__((availability(macosx,introduced=10.3))); +extern CFDictionaryRef +SKIndexGetAnalysisProperties(SKIndexRef inIndex) __attribute__((availability(macosx,introduced=10.3))); +extern CFIndex +SKIndexGetDocumentCount(SKIndexRef inIndex) __attribute__((availability(macosx,introduced=10.3))); +extern void +SKIndexClose(SKIndexRef inIndex) __attribute__((availability(macosx,introduced=10.4))); + + + + + +typedef CFIndex SKDocumentID; +extern Boolean +SKIndexAddDocumentWithText( + SKIndexRef inIndex, + SKDocumentRef inDocument, + CFStringRef inDocumentText, + Boolean inCanReplace) __attribute__((availability(macosx,introduced=10.3))); +extern Boolean +SKIndexAddDocument( + SKIndexRef inIndex, + SKDocumentRef inDocument, + CFStringRef inMIMETypeHint, + Boolean inCanReplace) __attribute__((availability(macosx,introduced=10.3))); +extern Boolean +SKIndexRemoveDocument( + SKIndexRef inIndex, + SKDocumentRef inDocument) __attribute__((availability(macosx,introduced=10.3))); +extern CFDictionaryRef +SKIndexCopyDocumentProperties( + SKIndexRef inIndex, + SKDocumentRef inDocument) __attribute__((availability(macosx,introduced=10.3))); +extern void +SKIndexSetDocumentProperties( + SKIndexRef inIndex, + SKDocumentRef inDocument, + CFDictionaryRef inProperties) __attribute__((availability(macosx,introduced=10.3))); +extern SKDocumentIndexState +SKIndexGetDocumentState( + SKIndexRef inIndex, + SKDocumentRef inDocument) __attribute__((availability(macosx,introduced=10.3))); +extern SKDocumentID +SKIndexGetDocumentID( + SKIndexRef inIndex, + SKDocumentRef inDocument) __attribute__((availability(macosx,introduced=10.3))); +extern SKDocumentRef +SKIndexCopyDocumentForDocumentID( + SKIndexRef inIndex, + SKDocumentID inDocumentID) __attribute__((availability(macosx,introduced=10.3))); +extern Boolean +SKIndexRenameDocument( + SKIndexRef inIndex, + SKDocumentRef inDocument, + CFStringRef inNewName) __attribute__((availability(macosx,introduced=10.3))); +extern Boolean +SKIndexMoveDocument( + SKIndexRef inIndex, + SKDocumentRef inDocument, + SKDocumentRef inNewParent) __attribute__((availability(macosx,introduced=10.3))); +extern SKIndexDocumentIteratorRef +SKIndexDocumentIteratorCreate( + SKIndexRef inIndex, + SKDocumentRef inParentDocument) __attribute__((availability(macosx,introduced=10.3))); +extern SKDocumentRef +SKIndexDocumentIteratorCopyNext(SKIndexDocumentIteratorRef inIterator) __attribute__((availability(macosx,introduced=10.3))); +extern SKDocumentID +SKIndexGetMaximumDocumentID(SKIndexRef inIndex) __attribute__((availability(macosx,introduced=10.3))); +extern CFIndex +SKIndexGetDocumentTermCount( + SKIndexRef inIndex, + SKDocumentID inDocumentID) __attribute__((availability(macosx,introduced=10.3))); +extern CFArrayRef +SKIndexCopyTermIDArrayForDocumentID( + SKIndexRef inIndex, + SKDocumentID inDocumentID) __attribute__((availability(macosx,introduced=10.3))); +extern CFIndex +SKIndexGetDocumentTermFrequency( + SKIndexRef inIndex, + SKDocumentID inDocumentID, + CFIndex inTermID) __attribute__((availability(macosx,introduced=10.3))); +extern CFIndex +SKIndexGetMaximumTermID(SKIndexRef inIndex) __attribute__((availability(macosx,introduced=10.3))); +extern CFIndex +SKIndexGetTermDocumentCount( + SKIndexRef inIndex, + CFIndex inTermID) __attribute__((availability(macosx,introduced=10.3))); +extern CFArrayRef +SKIndexCopyDocumentIDArrayForTermID( + SKIndexRef inIndex, + CFIndex inTermID) __attribute__((availability(macosx,introduced=10.3))); +extern CFStringRef +SKIndexCopyTermStringForTermID( + SKIndexRef inIndex, + CFIndex inTermID) __attribute__((availability(macosx,introduced=10.3))); +extern CFIndex +SKIndexGetTermIDForTermString( + SKIndexRef inIndex, + CFStringRef inTermString) __attribute__((availability(macosx,introduced=10.3))); +extern void +SKLoadDefaultExtractorPlugIns(void) __attribute__((availability(macosx,introduced=10.3))); + + + +typedef struct __SKSearch* SKSearchRef; +extern CFTypeID +SKSearchGetTypeID(void) __attribute__((availability(macosx,introduced=10.4))); +typedef UInt32 SKSearchOptions; +enum { + kSKSearchOptionDefault = 0, + kSKSearchOptionNoRelevanceScores = 1L << 0, + kSKSearchOptionSpaceMeansOR = 1L << 1, + kSKSearchOptionFindSimilar = 1L << 2 +}; +extern SKSearchRef +SKSearchCreate( + SKIndexRef inIndex, + CFStringRef inQuery, + SKSearchOptions inSearchOptions) __attribute__((availability(macosx,introduced=10.4))); +extern void +SKSearchCancel(SKSearchRef inSearch) __attribute__((availability(macosx,introduced=10.4))); +extern Boolean +SKSearchFindMatches( + SKSearchRef inSearch, + CFIndex inMaximumCount, + SKDocumentID * outDocumentIDsArray, + float * outScoresArray, + CFTimeInterval maximumTime, + CFIndex * outFoundCount) __attribute__((availability(macosx,introduced=10.4))); +extern void +SKIndexCopyInfoForDocumentIDs( + SKIndexRef inIndex, + CFIndex inCount, + SKDocumentID * inDocumentIDsArray, + CFStringRef * outNamesArray, + SKDocumentID * outParentIDsArray) __attribute__((availability(macosx,introduced=10.4))); +extern void +SKIndexCopyDocumentRefsForDocumentIDs( + SKIndexRef inIndex, + CFIndex inCount, + SKDocumentID * inDocumentIDsArray, + SKDocumentRef * outDocumentRefsArray) __attribute__((availability(macosx,introduced=10.4))); +extern void +SKIndexCopyDocumentURLsForDocumentIDs( + SKIndexRef inIndex, + CFIndex inCount, + SKDocumentID * inDocumentIDsArray, + CFURLRef * outDocumentURLsArray) __attribute__((availability(macosx,introduced=10.4))); +typedef struct __SKSearchGroup* SKSearchGroupRef; +extern CFTypeID +SKSearchGroupGetTypeID(void) __attribute__((availability(macosx,introduced=10.3,deprecated=10.4))); +typedef struct __SKSearchResults* SKSearchResultsRef; +extern CFTypeID +SKSearchResultsGetTypeID(void) __attribute__((availability(macosx,introduced=10.3,deprecated=10.4))); +enum SKSearchType { + + + + + kSKSearchRanked = 0, + + + + + + kSKSearchBooleanRanked = 1, + + + + + kSKSearchRequiredRanked = 2, + + + + + kSKSearchPrefixRanked = 3 +}; +typedef enum SKSearchType SKSearchType; +typedef Boolean ( * SKSearchResultsFilterCallBack)(SKIndexRef inIndex, SKDocumentRef inDocument, void *inContext); +extern SKSearchGroupRef +SKSearchGroupCreate(CFArrayRef inArrayOfInIndexes) __attribute__((availability(macosx,introduced=10.3,deprecated=10.4))); +extern CFArrayRef +SKSearchGroupCopyIndexes(SKSearchGroupRef inSearchGroup) __attribute__((availability(macosx,introduced=10.3,deprecated=10.4))); +extern SKSearchResultsRef +SKSearchResultsCreateWithQuery( + SKSearchGroupRef inSearchGroup, + CFStringRef inQuery, + SKSearchType inSearchType, + CFIndex inMaxFoundDocuments, + void * inContext, + SKSearchResultsFilterCallBack inFilterCallBack) __attribute__((availability(macosx,introduced=10.3,deprecated=10.4))); +extern SKSearchResultsRef +SKSearchResultsCreateWithDocuments( + SKSearchGroupRef inSearchGroup, + CFArrayRef inExampleDocuments, + CFIndex inMaxFoundDocuments, + void * inContext, + SKSearchResultsFilterCallBack inFilterCallBack) __attribute__((availability(macosx,introduced=10.3,deprecated=10.4))); +extern CFIndex +SKSearchResultsGetCount(SKSearchResultsRef inSearchResults) __attribute__((availability(macosx,introduced=10.3,deprecated=10.4))); +extern CFIndex +SKSearchResultsGetInfoInRange( + SKSearchResultsRef inSearchResults, + CFRange inRange, + SKDocumentRef * outDocumentsArray, + SKIndexRef * outIndexesArray, + float * outScoresArray) __attribute__((availability(macosx,introduced=10.3,deprecated=10.4))); +extern CFArrayRef +SKSearchResultsCopyMatchingTerms( + SKSearchResultsRef inSearchResults, + CFIndex inItem) __attribute__((availability(macosx,introduced=10.3,deprecated=10.4))); + + + +typedef struct __SKSummary* SKSummaryRef; +extern CFTypeID +SKSummaryGetTypeID(void) __attribute__((availability(macosx,introduced=10.4))); +extern SKSummaryRef +SKSummaryCreateWithString(CFStringRef inString) __attribute__((availability(macosx,introduced=10.4))); +extern CFIndex +SKSummaryGetSentenceCount(SKSummaryRef summary) __attribute__((availability(macosx,introduced=10.4))); +extern CFIndex +SKSummaryGetParagraphCount(SKSummaryRef summary) __attribute__((availability(macosx,introduced=10.4))); +extern CFStringRef +SKSummaryCopySentenceAtIndex( + SKSummaryRef summary, + CFIndex i) __attribute__((availability(macosx,introduced=10.4))); +extern CFStringRef +SKSummaryCopyParagraphAtIndex( + SKSummaryRef summary, + CFIndex i) __attribute__((availability(macosx,introduced=10.4))); +extern CFStringRef +SKSummaryCopySentenceSummaryString( + SKSummaryRef summary, + CFIndex numSentences) __attribute__((availability(macosx,introduced=10.4))); +extern CFStringRef +SKSummaryCopyParagraphSummaryString( + SKSummaryRef summary, + CFIndex numParagraphs) __attribute__((availability(macosx,introduced=10.4))); +extern CFIndex +SKSummaryGetSentenceSummaryInfo( + SKSummaryRef summary, + CFIndex numSentencesInSummary, + CFIndex * outRankOrderOfSentences, + CFIndex * outSentenceIndexOfSentences, + CFIndex * outParagraphIndexOfSentences) __attribute__((availability(macosx,introduced=10.4))); +extern CFIndex +SKSummaryGetParagraphSummaryInfo( + SKSummaryRef summary, + CFIndex numParagraphsInSummary, + CFIndex * outRankOrderOfParagraphs, + CFIndex * outParagraphIndexOfParagraphs) __attribute__((availability(macosx,introduced=10.4))); + + + +typedef UInt32 FSEventStreamCreateFlags; +enum { + + + + + kFSEventStreamCreateFlagNone = 0x00000000, + + + + + + + + kFSEventStreamCreateFlagUseCFTypes = 0x00000001, + kFSEventStreamCreateFlagNoDefer = 0x00000002, + kFSEventStreamCreateFlagWatchRoot = 0x00000004, + kFSEventStreamCreateFlagIgnoreSelf __attribute__((availability(macosx,introduced=10.6))) = 0x00000008, + + + + + + + + kFSEventStreamCreateFlagFileEvents __attribute__((availability(macosx,introduced=10.7))) = 0x00000010, + kFSEventStreamCreateFlagMarkSelf __attribute__((availability(macosx,introduced=10.9))) = 0x00000020 +}; +typedef UInt32 FSEventStreamEventFlags; +enum { + + + + + + kFSEventStreamEventFlagNone = 0x00000000, + kFSEventStreamEventFlagMustScanSubDirs = 0x00000001, + kFSEventStreamEventFlagUserDropped = 0x00000002, + kFSEventStreamEventFlagKernelDropped = 0x00000004, + + + + + + + + kFSEventStreamEventFlagEventIdsWrapped = 0x00000008, + kFSEventStreamEventFlagHistoryDone = 0x00000010, + kFSEventStreamEventFlagRootChanged = 0x00000020, + kFSEventStreamEventFlagMount = 0x00000040, + kFSEventStreamEventFlagUnmount = 0x00000080, + + + + + + kFSEventStreamEventFlagItemCreated __attribute__((availability(macosx,introduced=10.7))) = 0x00000100, + + + + + + kFSEventStreamEventFlagItemRemoved __attribute__((availability(macosx,introduced=10.7))) = 0x00000200, + + + + + + kFSEventStreamEventFlagItemInodeMetaMod __attribute__((availability(macosx,introduced=10.7))) = 0x00000400, + + + + + + kFSEventStreamEventFlagItemRenamed __attribute__((availability(macosx,introduced=10.7))) = 0x00000800, + + + + + + kFSEventStreamEventFlagItemModified __attribute__((availability(macosx,introduced=10.7))) = 0x00001000, + + + + + + kFSEventStreamEventFlagItemFinderInfoMod __attribute__((availability(macosx,introduced=10.7))) = 0x00002000, + + + + + + kFSEventStreamEventFlagItemChangeOwner __attribute__((availability(macosx,introduced=10.7))) = 0x00004000, + + + + + + kFSEventStreamEventFlagItemXattrMod __attribute__((availability(macosx,introduced=10.7))) = 0x00008000, + + + + + + kFSEventStreamEventFlagItemIsFile __attribute__((availability(macosx,introduced=10.7))) = 0x00010000, + + + + + + kFSEventStreamEventFlagItemIsDir __attribute__((availability(macosx,introduced=10.7))) = 0x00020000, + + + + + + kFSEventStreamEventFlagItemIsSymlink __attribute__((availability(macosx,introduced=10.7))) = 0x00040000, + + + + + + kFSEventStreamEventFlagOwnEvent __attribute__((availability(macosx,introduced=10.9))) = 0x00080000, + + + + + + kFSEventStreamEventFlagItemIsHardlink __attribute__((availability(macosx,introduced=10.10))) = 0x00100000, + + + + + kFSEventStreamEventFlagItemIsLastHardlink __attribute__((availability(macosx,introduced=10.10))) = 0x00200000, + +}; +typedef UInt64 FSEventStreamEventId; + +enum { + kFSEventStreamEventIdSinceNow = 0xFFFFFFFFFFFFFFFFULL +}; +typedef struct __FSEventStream* FSEventStreamRef; + + + + + + + +typedef const struct __FSEventStream* ConstFSEventStreamRef; +struct FSEventStreamContext { + + + + + CFIndex version; + void * _Nullable info; + + + + + CFAllocatorRetainCallBack _Nullable retain; + + + + + + CFAllocatorReleaseCallBack _Nullable release; + + + + + + + CFAllocatorCopyDescriptionCallBack _Nullable copyDescription; +}; +typedef struct FSEventStreamContext FSEventStreamContext; +typedef void ( * FSEventStreamCallback)(ConstFSEventStreamRef streamRef, void * _Nullable clientCallBackInfo, size_t numEvents, void *eventPaths, const FSEventStreamEventFlags eventFlags[], const FSEventStreamEventId eventIds[]); +extern FSEventStreamRef _Nullable +FSEventStreamCreate( + CFAllocatorRef _Nullable allocator, + FSEventStreamCallback callback, + FSEventStreamContext * _Nullable context, + CFArrayRef pathsToWatch, + FSEventStreamEventId sinceWhen, + CFTimeInterval latency, + FSEventStreamCreateFlags flags) __attribute__((availability(macosx,introduced=10.5))); +extern FSEventStreamRef _Nullable +FSEventStreamCreateRelativeToDevice( + CFAllocatorRef _Nullable allocator, + FSEventStreamCallback callback, + FSEventStreamContext * _Nullable context, + dev_t deviceToWatch, + CFArrayRef pathsToWatchRelativeToDevice, + FSEventStreamEventId sinceWhen, + CFTimeInterval latency, + FSEventStreamCreateFlags flags) __attribute__((availability(macosx,introduced=10.5))); +extern FSEventStreamEventId +FSEventStreamGetLatestEventId(ConstFSEventStreamRef streamRef) __attribute__((availability(macosx,introduced=10.5))); +extern dev_t +FSEventStreamGetDeviceBeingWatched(ConstFSEventStreamRef streamRef) __attribute__((availability(macosx,introduced=10.5))); +extern __attribute__((cf_returns_retained)) CFArrayRef +FSEventStreamCopyPathsBeingWatched(ConstFSEventStreamRef streamRef) __attribute__((availability(macosx,introduced=10.5))); +extern FSEventStreamEventId +FSEventsGetCurrentEventId(void) __attribute__((availability(macosx,introduced=10.5))); +extern __attribute__((cf_returns_retained)) CFUUIDRef _Nullable +FSEventsCopyUUIDForDevice(dev_t dev) __attribute__((availability(macosx,introduced=10.5))); +extern FSEventStreamEventId +FSEventsGetLastEventIdForDeviceBeforeTime( + dev_t dev, + CFAbsoluteTime time) __attribute__((availability(macosx,introduced=10.5))); +extern Boolean +FSEventsPurgeEventsForDeviceUpToEventId( + dev_t dev, + FSEventStreamEventId eventId) __attribute__((availability(macosx,introduced=10.5))); +extern void +FSEventStreamRetain(FSEventStreamRef streamRef) __attribute__((availability(macosx,introduced=10.5))); +extern void +FSEventStreamRelease(FSEventStreamRef streamRef) __attribute__((availability(macosx,introduced=10.5))); +extern void +FSEventStreamScheduleWithRunLoop( + FSEventStreamRef streamRef, + CFRunLoopRef runLoop, + CFStringRef runLoopMode) __attribute__((availability(macosx,introduced=10.5))); +extern void +FSEventStreamUnscheduleFromRunLoop( + FSEventStreamRef streamRef, + CFRunLoopRef runLoop, + CFStringRef runLoopMode) __attribute__((availability(macosx,introduced=10.5))); +extern void +FSEventStreamSetDispatchQueue( + FSEventStreamRef streamRef, + dispatch_queue_t _Nullable q) __attribute__((availability(macosx,introduced=10.6))); +extern void +FSEventStreamInvalidate(FSEventStreamRef streamRef) __attribute__((availability(macosx,introduced=10.5))); +extern Boolean +FSEventStreamStart(FSEventStreamRef streamRef) __attribute__((availability(macosx,introduced=10.5))); +extern FSEventStreamEventId +FSEventStreamFlushAsync(FSEventStreamRef streamRef) __attribute__((availability(macosx,introduced=10.5))); +extern void +FSEventStreamFlushSync(FSEventStreamRef streamRef) __attribute__((availability(macosx,introduced=10.5))); +extern void +FSEventStreamStop(FSEventStreamRef streamRef) __attribute__((availability(macosx,introduced=10.5))); +extern void +FSEventStreamShow(ConstFSEventStreamRef streamRef) __attribute__((availability(macosx,introduced=10.5))); +extern __attribute__((cf_returns_retained)) CFStringRef +FSEventStreamCopyDescription(ConstFSEventStreamRef streamRef) __attribute__((availability(macosx,introduced=10.5))); +extern Boolean +FSEventStreamSetExclusionPaths(FSEventStreamRef streamRef, CFArrayRef pathsToExclude) __attribute__((availability(macosx,introduced=10.9))); + + + + + + + + + +typedef struct OpaqueLSSharedFileListRef* LSSharedFileListRef; +typedef struct OpaqueLSSharedFileListItemRef* LSSharedFileListItemRef; +extern CFStringRef kLSSharedFileListFavoriteVolumes __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern CFStringRef kLSSharedFileListFavoriteItems __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern CFStringRef kLSSharedFileListRecentApplicationItems __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern CFStringRef kLSSharedFileListRecentDocumentItems __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern CFStringRef kLSSharedFileListRecentServerItems __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern CFStringRef kLSSharedFileListSessionLoginItems __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="Use a LaunchAgent, XPCService or the ServiceManagement APIs instead."))); +extern CFStringRef kLSSharedFileListGlobalLoginItems __attribute__((availability(macosx,introduced=10.5,deprecated=10.9,message="Use a LaunchAgent instead."))); +extern CFStringRef kLSSharedFileListRecentItemsMaxAmount __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern CFStringRef kLSSharedFileListVolumesComputerVisible __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern CFStringRef kLSSharedFileListVolumesIDiskVisible __attribute__((availability(macosx,introduced=10.5,deprecated=10.8,message="iDisk is no longer available."))); +extern CFStringRef kLSSharedFileListVolumesNetworkVisible __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern LSSharedFileListItemRef kLSSharedFileListItemBeforeFirst __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern LSSharedFileListItemRef kLSSharedFileListItemLast __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern CFStringRef kLSSharedFileListItemHidden __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern CFStringRef kLSSharedFileListLoginItemHidden __attribute__((availability(macosx,introduced=10.6,deprecated=10.11))); + + +typedef UInt32 LSSharedFileListResolutionFlags; +enum { + kLSSharedFileListNoUserInteraction = 1 << 0, + kLSSharedFileListDoNotMountVolumes = 1 << 1 +}; +typedef void ( * LSSharedFileListChangedProcPtr)(LSSharedFileListRef inList, void *context); +extern CFTypeID +LSSharedFileListGetTypeID(void) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern CFTypeID +LSSharedFileListItemGetTypeID(void) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern LSSharedFileListRef +LSSharedFileListCreate( + CFAllocatorRef inAllocator, + CFStringRef inListType, + CFTypeRef listOptions) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern OSStatus +LSSharedFileListSetAuthorization( + LSSharedFileListRef inList, + AuthorizationRef inAuthorization) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern void +LSSharedFileListAddObserver( + LSSharedFileListRef inList, + CFRunLoopRef inRunloop, + CFStringRef inRunloopMode, + LSSharedFileListChangedProcPtr callback, + void * context) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern void +LSSharedFileListRemoveObserver( + LSSharedFileListRef inList, + CFRunLoopRef inRunloop, + CFStringRef inRunloopMode, + LSSharedFileListChangedProcPtr callback, + void * context) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern UInt32 +LSSharedFileListGetSeedValue(LSSharedFileListRef inList) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern CFTypeRef +LSSharedFileListCopyProperty( + LSSharedFileListRef inList, + CFStringRef inPropertyName) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern OSStatus +LSSharedFileListSetProperty( + LSSharedFileListRef inList, + CFStringRef inPropertyName, + CFTypeRef inPropertyData) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern CFArrayRef +LSSharedFileListCopySnapshot( + LSSharedFileListRef inList, + UInt32 * outSnapshotSeed) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern LSSharedFileListItemRef +LSSharedFileListInsertItemURL( + LSSharedFileListRef inList, + LSSharedFileListItemRef insertAfterThisItem, + CFStringRef inDisplayName, + IconRef inIconRef, + CFURLRef inURL, + CFDictionaryRef inPropertiesToSet, + CFArrayRef inPropertiesToClear) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern LSSharedFileListItemRef +LSSharedFileListInsertItemFSRef( + LSSharedFileListRef inList, + LSSharedFileListItemRef insertAfterThisItem, + CFStringRef inDisplayName, + IconRef inIconRef, + const FSRef * inFSRef, + CFDictionaryRef inPropertiesToSet, + CFArrayRef inPropertiesToClear) __attribute__((availability(macosx,introduced=10.5,deprecated=10.10,message="Use LSSharedFileListInsertItemURL instead."))); +extern OSStatus +LSSharedFileListItemMove( + LSSharedFileListRef inList, + LSSharedFileListItemRef inItem, + LSSharedFileListItemRef inMoveAfterItem) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern OSStatus +LSSharedFileListItemRemove( + LSSharedFileListRef inList, + LSSharedFileListItemRef inItem) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern OSStatus +LSSharedFileListRemoveAllItems(LSSharedFileListRef inList) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern UInt32 +LSSharedFileListItemGetID(LSSharedFileListItemRef inItem) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern IconRef +LSSharedFileListItemCopyIconRef(LSSharedFileListItemRef inItem) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern CFStringRef +LSSharedFileListItemCopyDisplayName(LSSharedFileListItemRef inItem) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern OSStatus +LSSharedFileListItemResolve( + LSSharedFileListItemRef inItem, + LSSharedFileListResolutionFlags inFlags, + CFURLRef * outURL, + FSRef * outRef) __attribute__((availability(macosx,introduced=10.5,deprecated=10.10,message="Use LSSharedFileListItemCopyResolvedURL instead."))); +extern CFURLRef +LSSharedFileListItemCopyResolvedURL( + LSSharedFileListItemRef inItem, + LSSharedFileListResolutionFlags inFlags, + CFErrorRef * outError) __attribute__((availability(macosx,introduced=10.10,deprecated=10.11))); +extern CFTypeRef +LSSharedFileListItemCopyProperty( + LSSharedFileListItemRef inItem, + CFStringRef inPropertyName) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); +extern OSStatus +LSSharedFileListItemSetProperty( + LSSharedFileListItemRef inItem, + CFStringRef inPropertyName, + CFTypeRef inPropertyData) __attribute__((availability(macosx,introduced=10.5,deprecated=10.11,message="This functionality is no longer supported on OS X."))); + + + + + + +enum { + kAllTypographicFeaturesType = 0, + kLigaturesType = 1, + kCursiveConnectionType = 2, + kLetterCaseType = 3, + kVerticalSubstitutionType = 4, + kLinguisticRearrangementType = 5, + kNumberSpacingType = 6, + kSmartSwashType = 8, + kDiacriticsType = 9, + kVerticalPositionType = 10, + kFractionsType = 11, + kOverlappingCharactersType = 13, + kTypographicExtrasType = 14, + kMathematicalExtrasType = 15, + kOrnamentSetsType = 16, + kCharacterAlternativesType = 17, + kDesignComplexityType = 18, + kStyleOptionsType = 19, + kCharacterShapeType = 20, + kNumberCaseType = 21, + kTextSpacingType = 22, + kTransliterationType = 23, + kAnnotationType = 24, + kKanaSpacingType = 25, + kIdeographicSpacingType = 26, + kUnicodeDecompositionType = 27, + kRubyKanaType = 28, + kCJKSymbolAlternativesType = 29, + kIdeographicAlternativesType = 30, + kCJKVerticalRomanPlacementType = 31, + kItalicCJKRomanType = 32, + kCaseSensitiveLayoutType = 33, + kAlternateKanaType = 34, + kStylisticAlternativesType = 35, + kContextualAlternatesType = 36, + kLowerCaseType = 37, + kUpperCaseType = 38, + kLanguageTagType = 39, + kCJKRomanSpacingType = 103, + kLastFeatureType = -1 +}; + + + + + + +enum { + kAllTypeFeaturesOnSelector = 0, + kAllTypeFeaturesOffSelector = 1 +}; + + + + + + + +enum { + kRequiredLigaturesOnSelector = 0, + kRequiredLigaturesOffSelector = 1, + kCommonLigaturesOnSelector = 2, + kCommonLigaturesOffSelector = 3, + kRareLigaturesOnSelector = 4, + kRareLigaturesOffSelector = 5, + kLogosOnSelector = 6, + kLogosOffSelector = 7, + kRebusPicturesOnSelector = 8, + kRebusPicturesOffSelector = 9, + kDiphthongLigaturesOnSelector = 10, + kDiphthongLigaturesOffSelector = 11, + kSquaredLigaturesOnSelector = 12, + kSquaredLigaturesOffSelector = 13, + kAbbrevSquaredLigaturesOnSelector = 14, + kAbbrevSquaredLigaturesOffSelector = 15, + kSymbolLigaturesOnSelector = 16, + kSymbolLigaturesOffSelector = 17, + kContextualLigaturesOnSelector = 18, + kContextualLigaturesOffSelector = 19, + kHistoricalLigaturesOnSelector = 20, + kHistoricalLigaturesOffSelector = 21 +}; + + + + + + +enum { + kUnconnectedSelector = 0, + kPartiallyConnectedSelector = 1, + kCursiveSelector = 2 +}; + + + + + + +enum { + kUpperAndLowerCaseSelector = 0, + kAllCapsSelector = 1, + kAllLowerCaseSelector = 2, + kSmallCapsSelector = 3, + kInitialCapsSelector = 4, + kInitialCapsAndSmallCapsSelector = 5 +}; + + + + + + +enum { + kSubstituteVerticalFormsOnSelector = 0, + kSubstituteVerticalFormsOffSelector = 1 +}; + + + + + + +enum { + kLinguisticRearrangementOnSelector = 0, + kLinguisticRearrangementOffSelector = 1 +}; + + + + + + +enum { + kMonospacedNumbersSelector = 0, + kProportionalNumbersSelector = 1, + kThirdWidthNumbersSelector = 2, + kQuarterWidthNumbersSelector = 3 +}; + + + + + + +enum { + kWordInitialSwashesOnSelector = 0, + kWordInitialSwashesOffSelector = 1, + kWordFinalSwashesOnSelector = 2, + kWordFinalSwashesOffSelector = 3, + kLineInitialSwashesOnSelector = 4, + kLineInitialSwashesOffSelector = 5, + kLineFinalSwashesOnSelector = 6, + kLineFinalSwashesOffSelector = 7, + kNonFinalSwashesOnSelector = 8, + kNonFinalSwashesOffSelector = 9 +}; + + + + + + +enum { + kShowDiacriticsSelector = 0, + kHideDiacriticsSelector = 1, + kDecomposeDiacriticsSelector = 2 +}; + + + + + + +enum { + kNormalPositionSelector = 0, + kSuperiorsSelector = 1, + kInferiorsSelector = 2, + kOrdinalsSelector = 3, + kScientificInferiorsSelector = 4 +}; + + + + + + +enum { + kNoFractionsSelector = 0, + kVerticalFractionsSelector = 1, + kDiagonalFractionsSelector = 2 +}; + + + + + + +enum { + kPreventOverlapOnSelector = 0, + kPreventOverlapOffSelector = 1 +}; + + + + + + +enum { + kHyphensToEmDashOnSelector = 0, + kHyphensToEmDashOffSelector = 1, + kHyphenToEnDashOnSelector = 2, + kHyphenToEnDashOffSelector = 3, + kSlashedZeroOnSelector = 4, + kSlashedZeroOffSelector = 5, + kFormInterrobangOnSelector = 6, + kFormInterrobangOffSelector = 7, + kSmartQuotesOnSelector = 8, + kSmartQuotesOffSelector = 9, + kPeriodsToEllipsisOnSelector = 10, + kPeriodsToEllipsisOffSelector = 11 +}; + + + + + + +enum { + kHyphenToMinusOnSelector = 0, + kHyphenToMinusOffSelector = 1, + kAsteriskToMultiplyOnSelector = 2, + kAsteriskToMultiplyOffSelector = 3, + kSlashToDivideOnSelector = 4, + kSlashToDivideOffSelector = 5, + kInequalityLigaturesOnSelector = 6, + kInequalityLigaturesOffSelector = 7, + kExponentsOnSelector = 8, + kExponentsOffSelector = 9, + kMathematicalGreekOnSelector = 10, + kMathematicalGreekOffSelector = 11 +}; + + + + + + +enum { + kNoOrnamentsSelector = 0, + kDingbatsSelector = 1, + kPiCharactersSelector = 2, + kFleuronsSelector = 3, + kDecorativeBordersSelector = 4, + kInternationalSymbolsSelector = 5, + kMathSymbolsSelector = 6 +}; + + + + + + +enum { + kNoAlternatesSelector = 0 +}; + + + + + + +enum { + kDesignLevel1Selector = 0, + kDesignLevel2Selector = 1, + kDesignLevel3Selector = 2, + kDesignLevel4Selector = 3, + kDesignLevel5Selector = 4 +}; + + + + + + +enum { + kNoStyleOptionsSelector = 0, + kDisplayTextSelector = 1, + kEngravedTextSelector = 2, + kIlluminatedCapsSelector = 3, + kTitlingCapsSelector = 4, + kTallCapsSelector = 5 +}; + + + + + + +enum { + kTraditionalCharactersSelector = 0, + kSimplifiedCharactersSelector = 1, + kJIS1978CharactersSelector = 2, + kJIS1983CharactersSelector = 3, + kJIS1990CharactersSelector = 4, + kTraditionalAltOneSelector = 5, + kTraditionalAltTwoSelector = 6, + kTraditionalAltThreeSelector = 7, + kTraditionalAltFourSelector = 8, + kTraditionalAltFiveSelector = 9, + kExpertCharactersSelector = 10, + kJIS2004CharactersSelector = 11, + kHojoCharactersSelector = 12, + kNLCCharactersSelector = 13, + kTraditionalNamesCharactersSelector = 14 +}; + + + + + + +enum { + kLowerCaseNumbersSelector = 0, + kUpperCaseNumbersSelector = 1 +}; + + + + + + +enum { + kProportionalTextSelector = 0, + kMonospacedTextSelector = 1, + kHalfWidthTextSelector = 2, + kThirdWidthTextSelector = 3, + kQuarterWidthTextSelector = 4, + kAltProportionalTextSelector = 5, + kAltHalfWidthTextSelector = 6 +}; + + + + + + +enum { + kNoTransliterationSelector = 0, + kHanjaToHangulSelector = 1, + kHiraganaToKatakanaSelector = 2, + kKatakanaToHiraganaSelector = 3, + kKanaToRomanizationSelector = 4, + kRomanizationToHiraganaSelector = 5, + kRomanizationToKatakanaSelector = 6, + kHanjaToHangulAltOneSelector = 7, + kHanjaToHangulAltTwoSelector = 8, + kHanjaToHangulAltThreeSelector = 9 +}; + + + + + + +enum { + kNoAnnotationSelector = 0, + kBoxAnnotationSelector = 1, + kRoundedBoxAnnotationSelector = 2, + kCircleAnnotationSelector = 3, + kInvertedCircleAnnotationSelector = 4, + kParenthesisAnnotationSelector = 5, + kPeriodAnnotationSelector = 6, + kRomanNumeralAnnotationSelector = 7, + kDiamondAnnotationSelector = 8, + kInvertedBoxAnnotationSelector = 9, + kInvertedRoundedBoxAnnotationSelector = 10 +}; + + + + + + +enum { + kFullWidthKanaSelector = 0, + kProportionalKanaSelector = 1 +}; + + + + + + +enum { + kFullWidthIdeographsSelector = 0, + kProportionalIdeographsSelector = 1, + kHalfWidthIdeographsSelector = 2 +}; + + + + + + +enum { + kCanonicalCompositionOnSelector = 0, + kCanonicalCompositionOffSelector = 1, + kCompatibilityCompositionOnSelector = 2, + kCompatibilityCompositionOffSelector = 3, + kTranscodingCompositionOnSelector = 4, + kTranscodingCompositionOffSelector = 5 +}; + + + + + + +enum { + kNoRubyKanaSelector = 0, + kRubyKanaSelector = 1, + kRubyKanaOnSelector = 2, + kRubyKanaOffSelector = 3 +}; + + + + + + +enum { + kNoCJKSymbolAlternativesSelector = 0, + kCJKSymbolAltOneSelector = 1, + kCJKSymbolAltTwoSelector = 2, + kCJKSymbolAltThreeSelector = 3, + kCJKSymbolAltFourSelector = 4, + kCJKSymbolAltFiveSelector = 5 +}; + + + + + + +enum { + kNoIdeographicAlternativesSelector = 0, + kIdeographicAltOneSelector = 1, + kIdeographicAltTwoSelector = 2, + kIdeographicAltThreeSelector = 3, + kIdeographicAltFourSelector = 4, + kIdeographicAltFiveSelector = 5 +}; + + + + + + +enum { + kCJKVerticalRomanCenteredSelector = 0, + kCJKVerticalRomanHBaselineSelector = 1 +}; + + + + + + +enum { + kNoCJKItalicRomanSelector = 0, + kCJKItalicRomanSelector = 1, + kCJKItalicRomanOnSelector = 2, + kCJKItalicRomanOffSelector = 3 +}; + + + + + + +enum { + kCaseSensitiveLayoutOnSelector = 0, + kCaseSensitiveLayoutOffSelector = 1, + kCaseSensitiveSpacingOnSelector = 2, + kCaseSensitiveSpacingOffSelector = 3 +}; + + + + + + +enum { + kAlternateHorizKanaOnSelector = 0, + kAlternateHorizKanaOffSelector = 1, + kAlternateVertKanaOnSelector = 2, + kAlternateVertKanaOffSelector = 3 +}; + + + + + + +enum { + kNoStylisticAlternatesSelector = 0, + kStylisticAltOneOnSelector = 2, + kStylisticAltOneOffSelector = 3, + kStylisticAltTwoOnSelector = 4, + kStylisticAltTwoOffSelector = 5, + kStylisticAltThreeOnSelector = 6, + kStylisticAltThreeOffSelector = 7, + kStylisticAltFourOnSelector = 8, + kStylisticAltFourOffSelector = 9, + kStylisticAltFiveOnSelector = 10, + kStylisticAltFiveOffSelector = 11, + kStylisticAltSixOnSelector = 12, + kStylisticAltSixOffSelector = 13, + kStylisticAltSevenOnSelector = 14, + kStylisticAltSevenOffSelector = 15, + kStylisticAltEightOnSelector = 16, + kStylisticAltEightOffSelector = 17, + kStylisticAltNineOnSelector = 18, + kStylisticAltNineOffSelector = 19, + kStylisticAltTenOnSelector = 20, + kStylisticAltTenOffSelector = 21, + kStylisticAltElevenOnSelector = 22, + kStylisticAltElevenOffSelector = 23, + kStylisticAltTwelveOnSelector = 24, + kStylisticAltTwelveOffSelector = 25, + kStylisticAltThirteenOnSelector = 26, + kStylisticAltThirteenOffSelector = 27, + kStylisticAltFourteenOnSelector = 28, + kStylisticAltFourteenOffSelector = 29, + kStylisticAltFifteenOnSelector = 30, + kStylisticAltFifteenOffSelector = 31, + kStylisticAltSixteenOnSelector = 32, + kStylisticAltSixteenOffSelector = 33, + kStylisticAltSeventeenOnSelector = 34, + kStylisticAltSeventeenOffSelector = 35, + kStylisticAltEighteenOnSelector = 36, + kStylisticAltEighteenOffSelector = 37, + kStylisticAltNineteenOnSelector = 38, + kStylisticAltNineteenOffSelector = 39, + kStylisticAltTwentyOnSelector = 40, + kStylisticAltTwentyOffSelector = 41 +}; + + + + + + +enum { + kContextualAlternatesOnSelector = 0, + kContextualAlternatesOffSelector = 1, + kSwashAlternatesOnSelector = 2, + kSwashAlternatesOffSelector = 3, + kContextualSwashAlternatesOnSelector = 4, + kContextualSwashAlternatesOffSelector = 5 +}; + + + + + + +enum { + kDefaultLowerCaseSelector = 0, + kLowerCaseSmallCapsSelector = 1, + kLowerCasePetiteCapsSelector = 2 +}; + + + + + + +enum { + kDefaultUpperCaseSelector = 0, + kUpperCaseSmallCapsSelector = 1, + kUpperCasePetiteCapsSelector = 2 +}; + + + + + + +enum { + kHalfWidthCJKRomanSelector = 0, + kProportionalCJKRomanSelector = 1, + kDefaultCJKRomanSelector = 2, + kFullWidthCJKRomanSelector = 3 +}; + + + + + +enum { + kSFNTLookupSimpleArray = 0, + kSFNTLookupSegmentSingle = 2, + kSFNTLookupSegmentArray = 4, + kSFNTLookupSingleTable = 6, + kSFNTLookupTrimmedArray = 8, + kSFNTLookupVector = 10 +}; + +typedef UInt16 SFNTLookupTableFormat; +typedef UInt16 SFNTLookupValue; +typedef UInt16 SFNTLookupOffset; +typedef UInt32 SFNTLookupKind; + + + + + + +struct SFNTLookupBinarySearchHeader { + UInt16 unitSize; + UInt16 nUnits; + UInt16 searchRange; + UInt16 entrySelector; + UInt16 rangeShift; +}; +typedef struct SFNTLookupBinarySearchHeader SFNTLookupBinarySearchHeader; + +struct SFNTLookupArrayHeader { + SFNTLookupValue lookupValues[1]; +}; +typedef struct SFNTLookupArrayHeader SFNTLookupArrayHeader; + +struct SFNTLookupTrimmedArrayHeader { + UInt16 firstGlyph; + UInt16 count; + SFNTLookupValue valueArray[1]; +}; +typedef struct SFNTLookupTrimmedArrayHeader SFNTLookupTrimmedArrayHeader; + +struct SFNTLookupVectorHeader { + UInt16 valueSize; + UInt16 firstGlyph; + UInt16 count; + UInt8 values[1]; +}; +typedef struct SFNTLookupVectorHeader SFNTLookupVectorHeader; + + + + + + +struct SFNTLookupSegment { + UInt16 lastGlyph; + UInt16 firstGlyph; + UInt16 value[1]; +}; +typedef struct SFNTLookupSegment SFNTLookupSegment; +struct SFNTLookupSegmentHeader { + SFNTLookupBinarySearchHeader binSearch; + SFNTLookupSegment segments[1]; +}; +typedef struct SFNTLookupSegmentHeader SFNTLookupSegmentHeader; + +struct SFNTLookupSingle { + UInt16 glyph; + UInt16 value[1]; +}; +typedef struct SFNTLookupSingle SFNTLookupSingle; +struct SFNTLookupSingleHeader { + SFNTLookupBinarySearchHeader binSearch; + SFNTLookupSingle entries[1]; +}; +typedef struct SFNTLookupSingleHeader SFNTLookupSingleHeader; + +union SFNTLookupFormatSpecificHeader { + SFNTLookupArrayHeader theArray; + SFNTLookupSegmentHeader segment; + SFNTLookupSingleHeader single; + SFNTLookupTrimmedArrayHeader trimmedArray; + SFNTLookupVectorHeader vector; +}; +typedef union SFNTLookupFormatSpecificHeader SFNTLookupFormatSpecificHeader; + +struct SFNTLookupTable { + SFNTLookupTableFormat format; + SFNTLookupFormatSpecificHeader fsHeader; +}; +typedef struct SFNTLookupTable SFNTLookupTable; +typedef SFNTLookupTable * SFNTLookupTablePtr; +typedef SFNTLookupTablePtr * SFNTLookupTableHandle; + + +enum { + kSTClassEndOfText = 0, + kSTClassOutOfBounds = 1, + kSTClassDeletedGlyph = 2, + kSTClassEndOfLine = 3, + kSTSetMark = 0x8000, + kSTNoAdvance = 0x4000, + kSTMarkEnd = 0x2000, + kSTLigActionMask = 0x3FFF, + kSTRearrVerbMask = 0x000F +}; + +typedef UInt8 STClass; +typedef UInt8 STEntryIndex; +struct STHeader { + UInt8 filler; + STClass nClasses; + UInt16 classTableOffset; + UInt16 stateArrayOffset; + UInt16 entryTableOffset; +}; +typedef struct STHeader STHeader; +struct STClassTable { + UInt16 firstGlyph; + UInt16 nGlyphs; + STClass classes[1]; +}; +typedef struct STClassTable STClassTable; +struct STEntryZero { + UInt16 newState; + UInt16 flags; +}; +typedef struct STEntryZero STEntryZero; +struct STEntryOne { + UInt16 newState; + UInt16 flags; + UInt16 offset1; +}; +typedef struct STEntryOne STEntryOne; +struct STEntryTwo { + UInt16 newState; + UInt16 flags; + UInt16 offset1; + UInt16 offset2; +}; +typedef struct STEntryTwo STEntryTwo; + + +enum { + kSTXHasLigAction = 0x2000 +}; + + +typedef UInt16 STXClass; +typedef UInt16 STXStateIndex; +typedef UInt16 STXEntryIndex; +struct STXHeader { + UInt32 nClasses; + UInt32 classTableOffset; + UInt32 stateArrayOffset; + UInt32 entryTableOffset; +}; +typedef struct STXHeader STXHeader; + +typedef SFNTLookupTable STXClassTable; +struct STXEntryZero { + STXStateIndex newState; + UInt16 flags; +}; +typedef struct STXEntryZero STXEntryZero; +struct STXEntryOne { + STXStateIndex newState; + UInt16 flags; + UInt16 index1; +}; +typedef struct STXEntryOne STXEntryOne; +struct STXEntryTwo { + STXStateIndex newState; + UInt16 flags; + UInt16 index1; + UInt16 index2; +}; +typedef struct STXEntryTwo STXEntryTwo; + + +enum { + kSTKCrossStreamReset = 0x2000 +}; + + + +enum { + kLCARTag = 0x6C636172, + kLCARCurrentVersion = 0x00010000, + kLCARLinearFormat = 0, + kLCARCtlPointFormat = 1 +}; + + +struct LcarCaretClassEntry { + UInt16 count; + UInt16 partials[1]; +}; +typedef struct LcarCaretClassEntry LcarCaretClassEntry; +struct LcarCaretTable { + Fixed version; + UInt16 format; + SFNTLookupTable lookup; +}; +typedef struct LcarCaretTable LcarCaretTable; +typedef LcarCaretTable * LcarCaretTablePtr; + + + +enum { + kJUSTTag = 0x6A757374, + kJUSTCurrentVersion = 0x00010000, + kJUSTStandardFormat = 0, + kJUSTnoGlyphcode = 0xFFFF, + kJUSTpcDecompositionAction = 0, + kJUSTpcUnconditionalAddAction = 1, + kJUSTpcConditionalAddAction = 2, + kJUSTpcGlyphStretchAction = 3, + kJUSTpcDuctilityAction = 4, + kJUSTpcGlyphRepeatAddAction = 5 +}; + + +enum { + kJUSTKashidaPriority = 0, + kJUSTSpacePriority = 1, + kJUSTLetterPriority = 2, + kJUSTNullPriority = 3, + kJUSTPriorityCount = 4 +}; + + +enum { + kJUSTOverridePriority = 0x8000, + kJUSTOverrideLimits = 0x4000, + kJUSTOverrideUnlimited = 0x2000, + kJUSTUnlimited = 0x1000, + kJUSTPriorityMask = 0x0003 +}; + + +typedef UInt16 JustPCActionType; +typedef UInt16 JustificationFlags; + +struct JustPCDecompositionAction { + Fixed lowerLimit; + Fixed upperLimit; + UInt16 order; + UInt16 count; + UInt16 glyphs[1]; +}; +typedef struct JustPCDecompositionAction JustPCDecompositionAction; + + +typedef UInt16 JustPCUnconditionalAddAction; + + + + + +struct JustPCConditionalAddAction { + Fixed substThreshold; + UInt16 addGlyph; + UInt16 substGlyph; +}; +typedef struct JustPCConditionalAddAction JustPCConditionalAddAction; + +struct JustPCDuctilityAction { + UInt32 ductilityAxis; + Fixed minimumLimit; + Fixed noStretchValue; + Fixed maximumLimit; +}; +typedef struct JustPCDuctilityAction JustPCDuctilityAction; + + + + + +struct JustPCGlyphRepeatAddAction { + UInt16 flags; + UInt16 glyph; +}; +typedef struct JustPCGlyphRepeatAddAction JustPCGlyphRepeatAddAction; + +struct JustPCActionSubrecord { + UInt16 theClass; + JustPCActionType theType; + UInt32 length; + UInt32 data; +}; +typedef struct JustPCActionSubrecord JustPCActionSubrecord; + +struct JustPCAction { + UInt32 actionCount; + JustPCActionSubrecord actions[1]; +}; +typedef struct JustPCAction JustPCAction; + + + + +struct JustWidthDeltaEntry { + UInt32 justClass; + Fixed beforeGrowLimit; + Fixed beforeShrinkLimit; + Fixed afterGrowLimit; + Fixed afterShrinkLimit; + JustificationFlags growFlags; + JustificationFlags shrinkFlags; +}; +typedef struct JustWidthDeltaEntry JustWidthDeltaEntry; +struct JustWidthDeltaGroup { + UInt32 count; + JustWidthDeltaEntry entries[1]; +}; +typedef struct JustWidthDeltaGroup JustWidthDeltaGroup; + +struct JustPostcompTable { + SFNTLookupTable lookupTable; + +}; +typedef struct JustPostcompTable JustPostcompTable; +struct JustDirectionTable { + UInt16 justClass; + UInt16 widthDeltaClusters; + UInt16 postcomp; + SFNTLookupTable lookup; +}; +typedef struct JustDirectionTable JustDirectionTable; +struct JustTable { + Fixed version; + UInt16 format; + UInt16 horizHeaderOffset; + UInt16 vertHeaderOffset; +}; +typedef struct JustTable JustTable; + + + +enum { + kOPBDTag = 0x6F706264, + kOPBDCurrentVersion = 0x00010000, + kOPBDDistanceFormat = 0, + kOPBDControlPointFormat = 1 +}; + + + +typedef UInt16 OpbdTableFormat; + + + + + +struct OpbdSideValues { + SInt16 leftSideShift; + SInt16 topSideShift; + SInt16 rightSideShift; + SInt16 bottomSideShift; +}; +typedef struct OpbdSideValues OpbdSideValues; +struct OpbdTable { + Fixed version; + OpbdTableFormat format; + SFNTLookupTable lookupTable; +}; +typedef struct OpbdTable OpbdTable; + + + +enum { + kMORTTag = 0x6D6F7274, + kMORTCurrentVersion = 0x00010000, + + kMORTCoverVertical = 0x8000, + kMORTCoverDescending = 0x4000, + kMORTCoverIgnoreVertical = 0x2000, + kMORTCoverTypeMask = 0x000F, + kMORTRearrangementType = 0, + kMORTContextualType = 1, + kMORTLigatureType = 2, + kMORTSwashType = 4, + kMORTInsertionType = 5, + kMORTLigLastAction = (int)0x80000000, + kMORTLigStoreLigature = 0x40000000, + kMORTLigFormOffsetMask = 0x3FFFFFFF, + kMORTLigFormOffsetShift = 2, + kMORTraNoAction = 0, + kMORTraxA = 1, + kMORTraDx = 2, + kMORTraDxA = 3, + kMORTraxAB = 4, + kMORTraxBA = 5, + kMORTraCDx = 6, + kMORTraDCx = 7, + kMORTraCDxA = 8, + kMORTraDCxA = 9, + kMORTraDxAB = 10, + kMORTraDxBA = 11, + kMORTraCDxAB = 12, + kMORTraCDxBA = 13, + kMORTraDCxAB = 14, + kMORTraDCxBA = 15, + + kMORTDoInsertionsBefore = 0x80, + kMORTIsSplitVowelPiece = 0x40, + kMORTInsertionsCountMask = 0x3F, + kMORTCurrInsertKashidaLike = 0x2000, + kMORTMarkInsertKashidaLike = 0x1000, + kMORTCurrInsertBefore = 0x0800, + kMORTMarkInsertBefore = 0x0400, + kMORTMarkJustTableCountMask = 0x3F80, + kMORTMarkJustTableCountShift = 7, + kMORTCurrJustTableCountMask = 0x007F, + kMORTCurrJustTableCountShift = 0, + kMORTCurrInsertCountMask = 0x03E0, + kMORTCurrInsertCountShift = 5, + kMORTMarkInsertCountMask = 0x001F, + kMORTMarkInsertCountShift = 0 +}; + + + +typedef UInt32 MortSubtableMaskFlags; +typedef UInt32 MortLigatureActionEntry; +struct MortRearrangementSubtable { + STHeader header; +}; +typedef struct MortRearrangementSubtable MortRearrangementSubtable; +struct MortContextualSubtable { + STHeader header; + UInt16 substitutionTableOffset; +}; +typedef struct MortContextualSubtable MortContextualSubtable; +struct MortLigatureSubtable { + STHeader header; + UInt16 ligatureActionTableOffset; + UInt16 componentTableOffset; + UInt16 ligatureTableOffset; +}; +typedef struct MortLigatureSubtable MortLigatureSubtable; +struct MortSwashSubtable { + SFNTLookupTable lookup; +}; +typedef struct MortSwashSubtable MortSwashSubtable; +struct MortInsertionSubtable { + STHeader header; +}; +typedef struct MortInsertionSubtable MortInsertionSubtable; +union MortSpecificSubtable { + MortRearrangementSubtable rearrangement; + MortContextualSubtable contextual; + MortLigatureSubtable ligature; + MortSwashSubtable swash; + MortInsertionSubtable insertion; +}; +typedef union MortSpecificSubtable MortSpecificSubtable; +struct MortSubtable { + UInt16 length; + UInt16 coverage; + MortSubtableMaskFlags flags; + MortSpecificSubtable u; +}; +typedef struct MortSubtable MortSubtable; +struct MortFeatureEntry { + UInt16 featureType; + UInt16 featureSelector; + MortSubtableMaskFlags enableFlags; + MortSubtableMaskFlags disableFlags; +}; +typedef struct MortFeatureEntry MortFeatureEntry; +struct MortChain { + MortSubtableMaskFlags defaultFlags; + UInt32 length; + UInt16 nFeatures; + UInt16 nSubtables; + MortFeatureEntry featureEntries[1]; + +}; +typedef struct MortChain MortChain; +struct MortTable { + Fixed version; + UInt32 nChains; + MortChain chains[1]; +}; +typedef struct MortTable MortTable; + + + +enum { + kMORXTag = 0x6D6F7278, + kMORXCurrentVersion = 0x00020000, + + kMORXCoverVertical = (int)0x80000000, + kMORXCoverDescending = 0x40000000, + kMORXCoverIgnoreVertical = 0x20000000, + kMORXCoverLogicalOrder = 0x10000000, + kMORXCoverTypeMask = 0x000000FF +}; + + +struct MorxRearrangementSubtable { + STXHeader header; +}; +typedef struct MorxRearrangementSubtable MorxRearrangementSubtable; +struct MorxContextualSubtable { + STXHeader header; + UInt32 substitutionTableOffset; +}; +typedef struct MorxContextualSubtable MorxContextualSubtable; +struct MorxLigatureSubtable { + STXHeader header; + UInt32 ligatureActionTableOffset; + UInt32 componentTableOffset; + UInt32 ligatureTableOffset; +}; +typedef struct MorxLigatureSubtable MorxLigatureSubtable; +struct MorxInsertionSubtable { + STXHeader header; + UInt32 insertionGlyphTableOffset; +}; +typedef struct MorxInsertionSubtable MorxInsertionSubtable; +union MorxSpecificSubtable { + MorxRearrangementSubtable rearrangement; + MorxContextualSubtable contextual; + MorxLigatureSubtable ligature; + MortSwashSubtable swash; + MorxInsertionSubtable insertion; +}; +typedef union MorxSpecificSubtable MorxSpecificSubtable; +struct MorxSubtable { + UInt32 length; + UInt32 coverage; + MortSubtableMaskFlags flags; + MorxSpecificSubtable u; +}; +typedef struct MorxSubtable MorxSubtable; +struct MorxChain { + MortSubtableMaskFlags defaultFlags; + UInt32 length; + UInt32 nFeatures; + UInt32 nSubtables; + MortFeatureEntry featureEntries[1]; + +}; +typedef struct MorxChain MorxChain; +struct MorxTable { + Fixed version; + UInt32 nChains; + MorxChain chains[1]; +}; +typedef struct MorxTable MorxTable; + + + +enum { + kPROPTag = 0x70726F70, + kPROPCurrentVersion = 0x00030000, + kPROPPairOffsetShift = 8, + kPROPPairOffsetSign = 7, + kPROPIsFloaterMask = 0x8000, + kPROPCanHangLTMask = 0x4000, + kPROPCanHangRBMask = 0x2000, + kPROPUseRLPairMask = 0x1000, + kPROPPairOffsetMask = 0x0F00, + kPROPRightConnectMask = 0x0080, + kPROPZeroReserved = 0x0060, + kPROPDirectionMask = 0x001F +}; + + +enum { + kPROPLDirectionClass = 0, + kPROPRDirectionClass = 1, + kPROPALDirectionClass = 2, + kPROPENDirectionClass = 3, + kPROPESDirectionClass = 4, + kPROPETDirectionClass = 5, + kPROPANDirectionClass = 6, + kPROPCSDirectionClass = 7, + kPROPPSDirectionClass = 8, + kPROPSDirectionClass = 9, + kPROPWSDirectionClass = 10, + kPROPONDirectionClass = 11, + kPROPSENDirectionClass = 12, + kPROPLREDirectionClass = 13, + kPROPLRODirectionClass = 14, + kPROPRLEDirectionClass = 15, + kPROPRLODirectionClass = 16, + kPROPPDFDirectionClass = 17, + kPROPNSMDirectionClass = 18, + kPROPBNDirectionClass = 19, + kPROPNumDirectionClasses = 20 +}; + + + +typedef UInt16 PropCharProperties; +struct PropTable { + Fixed version; + UInt16 format; + PropCharProperties defaultProps; + SFNTLookupTable lookup; +}; +typedef struct PropTable PropTable; +struct PropLookupSegment { + UInt16 lastGlyph; + UInt16 firstGlyph; + UInt16 value; +}; +typedef struct PropLookupSegment PropLookupSegment; +struct PropLookupSingle { + UInt16 glyph; + PropCharProperties props; +}; +typedef struct PropLookupSingle PropLookupSingle; + + + +enum { + kTRAKTag = 0x7472616B, + kTRAKCurrentVersion = 0x00010000, + kTRAKUniformFormat = 0 +}; + + + +typedef SInt16 TrakValue; +struct TrakTableEntry { + Fixed track; + UInt16 nameTableIndex; + UInt16 sizesOffset; +}; +typedef struct TrakTableEntry TrakTableEntry; +struct TrakTableData { + UInt16 nTracks; + UInt16 nSizes; + UInt32 sizeTableOffset; + TrakTableEntry trakTable[1]; +}; +typedef struct TrakTableData TrakTableData; +struct TrakTable { + Fixed version; + UInt16 format; + UInt16 horizOffset; + UInt16 vertOffset; +}; +typedef struct TrakTable TrakTable; + + + +enum { + kKERNTag = 0x6B65726E, + kKERNCurrentVersion = 0x00010000, + kKERNVertical = 0x8000, + kKERNResetCrossStream = 0x8000, + kKERNCrossStream = 0x4000, + kKERNVariation = 0x2000, + kKERNUnusedBits = 0x1F00, + kKERNFormatMask = 0x00FF +}; + +enum { + kKERNOrderedList = 0, + kKERNStateTable = 1, + kKERNSimpleArray = 2, + kKERNIndexArray = 3 +}; + + +enum { + kKERNLineStart = 0x00000001, + kKERNLineEndKerning = 0x00000002, + kKERNNoCrossKerning = 0x00000004, + kKERNNotesRequested = 0x00000008, + kKERNNoStakeNote = 1, + kKERNCrossStreamResetNote = 2, + kKERNNotApplied = 0x00000001 +}; + + + +typedef UInt8 KernTableFormat; +typedef UInt16 KernSubtableInfo; +typedef SInt16 KernKerningValue; +typedef UInt16 KernArrayOffset; + +struct KernVersion0Header { + UInt16 version; + UInt16 nTables; + UInt16 firstSubtable[1]; +}; +typedef struct KernVersion0Header KernVersion0Header; + +struct KernTableHeader { + Fixed version; + SInt32 nTables; + UInt16 firstSubtable[1]; +}; +typedef struct KernTableHeader KernTableHeader; +typedef KernTableHeader * KernTableHeaderPtr; +typedef KernTableHeaderPtr * KernTableHeaderHandle; +struct KernKerningPair { + UInt16 left; + UInt16 right; +}; +typedef struct KernKerningPair KernKerningPair; + +struct KernOrderedListEntry { + KernKerningPair pair; + KernKerningValue value; +}; +typedef struct KernOrderedListEntry KernOrderedListEntry; +typedef KernOrderedListEntry * KernOrderedListEntryPtr; + +struct KernOrderedListHeader { + UInt16 nPairs; + UInt16 searchRange; + UInt16 entrySelector; + UInt16 rangeShift; + UInt16 table[1]; +}; +typedef struct KernOrderedListHeader KernOrderedListHeader; + +struct KernStateHeader { + STHeader header; + UInt16 valueTable; + UInt8 firstTable[1]; +}; +typedef struct KernStateHeader KernStateHeader; +struct KernStateEntry { + UInt16 newState; + UInt16 flags; +}; +typedef struct KernStateEntry KernStateEntry; + + + + + + +struct KernOffsetTable { + UInt16 firstGlyph; + UInt16 nGlyphs; + KernArrayOffset offsetTable[1]; +}; +typedef struct KernOffsetTable KernOffsetTable; +typedef KernOffsetTable * KernOffsetTablePtr; +struct KernSimpleArrayHeader { + UInt16 rowWidth; + UInt16 leftOffsetTable; + UInt16 rightOffsetTable; + KernArrayOffset theArray; + UInt16 firstTable[1]; +}; +typedef struct KernSimpleArrayHeader KernSimpleArrayHeader; + +struct KernIndexArrayHeader { + UInt16 glyphCount; + UInt8 kernValueCount; + UInt8 leftClassCount; + UInt8 rightClassCount; + UInt8 flags; + SInt16 kernValue[1]; + UInt8 leftClass[1]; + UInt8 rightClass[1]; + UInt8 kernIndex[1]; +}; +typedef struct KernIndexArrayHeader KernIndexArrayHeader; + +union KernFormatSpecificHeader { + KernOrderedListHeader orderedList; + KernStateHeader stateTable; + KernSimpleArrayHeader simpleArray; + KernIndexArrayHeader indexArray; +}; +typedef union KernFormatSpecificHeader KernFormatSpecificHeader; + +struct KernVersion0SubtableHeader { + UInt16 version; + UInt16 length; + KernSubtableInfo stInfo; + KernFormatSpecificHeader fsHeader; +}; +typedef struct KernVersion0SubtableHeader KernVersion0SubtableHeader; + +struct KernSubtableHeader { + SInt32 length; + KernSubtableInfo stInfo; + SInt16 tupleIndex; + KernFormatSpecificHeader fsHeader; +}; +typedef struct KernSubtableHeader KernSubtableHeader; +typedef KernSubtableHeader * KernSubtableHeaderPtr; + + + +enum { + kKERXTag = 0x6B657278, + kKERXCurrentVersion = 0x00020000, + kKERXVertical = (int)0x80000000, + kKERXResetCrossStream = 0x8000, + kKERXCrossStream = 0x40000000, + kKERXVariation = 0x20000000, + kKERXDescending = 0x10000000, + kKERXUnusedBits = 0x0FFFFF00, + kKERXFormatMask = 0x000000FF +}; + +enum { + kKERXOrderedList = 0, + kKERXStateTable = 1, + kKERXSimpleArray = 2, + kKERXControlPoint = 4, + kKERXIndexArray = 6 +}; + + +enum { + kKERXLineStart = 0x00000001, + kKERXLineEndKerning = 0x00000002, + kKERXNoCrossKerning = 0x00000004, + kKERXNotesRequested = 0x00000008, + kKERXNoStakeNote = 1, + kKERXCrossStreamResetNote = 2, + kKERXNotApplied = 0x00000001 +}; + + +enum { + kKERXActionTypeMask = (3U << 30), + kKERXActionTypeControlPoints = (0U << 30), + kKERXActionTypeAnchorPoints = (1U << 30), + kKERXActionTypeCoordinates = (2U << 30), + kKERXUnusedFlags = 0x3F000000, + kKERXActionOffsetMask = 0x00FFFFFF, +}; + + +enum { + kKERXValuesAreLong = 0x00000001 +}; + + +typedef UInt32 KerxSubtableCoverage; +typedef UInt32 KerxArrayOffset; + +struct KerxTableHeader { + Fixed version; + UInt32 nTables; + UInt32 firstSubtable[1]; +}; +typedef struct KerxTableHeader KerxTableHeader; +typedef KerxTableHeader * KerxTableHeaderPtr; +typedef KerxTableHeaderPtr * KerxTableHeaderHandle; +struct KerxKerningPair { + UInt16 left; + UInt16 right; +}; +typedef struct KerxKerningPair KerxKerningPair; + +struct KerxOrderedListEntry { + KerxKerningPair pair; + KernKerningValue value; +}; +typedef struct KerxOrderedListEntry KerxOrderedListEntry; +typedef KerxOrderedListEntry * KerxOrderedListEntryPtr; + +struct KerxOrderedListHeader { + UInt32 nPairs; + UInt32 searchRange; + UInt32 entrySelector; + UInt32 rangeShift; + UInt32 table[1]; +}; +typedef struct KerxOrderedListHeader KerxOrderedListHeader; + +struct KerxStateHeader { + STXHeader header; + UInt32 valueTable; + UInt8 firstTable[1]; +}; +typedef struct KerxStateHeader KerxStateHeader; +struct KerxStateEntry { + UInt16 newState; + UInt16 flags; + UInt16 valueIndex; +}; +typedef struct KerxStateEntry KerxStateEntry; + +struct KerxControlPointHeader { + STXHeader header; + UInt32 flags; + UInt8 firstTable[1]; +}; +typedef struct KerxControlPointHeader KerxControlPointHeader; +struct KerxControlPointEntry { + UInt16 newState; + UInt16 flags; + UInt16 actionIndex; +}; +typedef struct KerxControlPointEntry KerxControlPointEntry; +struct KerxControlPointAction { + UInt16 markControlPoint; + UInt16 currControlPoint; +}; +typedef struct KerxControlPointAction KerxControlPointAction; +struct KerxAnchorPointAction { + UInt16 markAnchorPoint; + UInt16 currAnchorPoint; +}; +typedef struct KerxAnchorPointAction KerxAnchorPointAction; +struct KerxCoordinateAction { + UInt16 markX; + UInt16 markY; + UInt16 currX; + UInt16 currY; +}; +typedef struct KerxCoordinateAction KerxCoordinateAction; +struct KerxSimpleArrayHeader { + UInt32 rowWidth; + UInt32 leftOffsetTable; + UInt32 rightOffsetTable; + KerxArrayOffset theArray; + UInt32 firstTable[1]; +}; +typedef struct KerxSimpleArrayHeader KerxSimpleArrayHeader; + +struct KerxIndexArrayHeader { + UInt32 flags; + UInt16 rowCount; + UInt16 columnCount; + UInt32 rowIndexTableOffset; + UInt32 columnIndexTableOffset; + UInt32 kerningArrayOffset; + UInt32 kerningVectorOffset; +}; +typedef struct KerxIndexArrayHeader KerxIndexArrayHeader; + +union KerxFormatSpecificHeader { + KerxOrderedListHeader orderedList; + KerxStateHeader stateTable; + KerxSimpleArrayHeader simpleArray; + KerxIndexArrayHeader indexArray; + KerxControlPointHeader controlPoint; +}; +typedef union KerxFormatSpecificHeader KerxFormatSpecificHeader; + +struct KerxSubtableHeader { + UInt32 length; + KerxSubtableCoverage stInfo; + UInt32 tupleCount; + KerxFormatSpecificHeader fsHeader; +}; +typedef struct KerxSubtableHeader KerxSubtableHeader; +typedef KerxSubtableHeader * KerxSubtableHeaderPtr; + + + +enum { + kBSLNTag = 0x62736C6E, + kBSLNCurrentVersion = 0x00010000, + kBSLNDistanceFormatNoMap = 0, + kBSLNDistanceFormatWithMap = 1, + kBSLNControlPointFormatNoMap = 2, + kBSLNControlPointFormatWithMap = 3 +}; + + +enum { + kBSLNRomanBaseline = 0, + kBSLNIdeographicCenterBaseline = 1, + kBSLNIdeographicLowBaseline = 2, + kBSLNHangingBaseline = 3, + kBSLNMathBaseline = 4, + kBSLNIdeographicHighBaseline = 5, + kBSLNLastBaseline = 31, + kBSLNNumBaselineClasses = kBSLNLastBaseline + 1, + kBSLNNoBaseline = 255, + kBSLNNoBaselineOverride = 255 +}; + + +typedef UInt32 BslnBaselineClass; + +typedef Fixed BslnBaselineRecord[32]; + + + + +struct BslnFormat0Part { + SInt16 deltas[32]; +}; +typedef struct BslnFormat0Part BslnFormat0Part; + +struct BslnFormat1Part { + SInt16 deltas[32]; + SFNTLookupTable mappingData; +}; +typedef struct BslnFormat1Part BslnFormat1Part; + + + + + + +struct BslnFormat2Part { + UInt16 stdGlyph; + SInt16 ctlPoints[32]; +}; +typedef struct BslnFormat2Part BslnFormat2Part; + + + + + +struct BslnFormat3Part { + UInt16 stdGlyph; + SInt16 ctlPoints[32]; + SFNTLookupTable mappingData; +}; +typedef struct BslnFormat3Part BslnFormat3Part; + +union BslnFormatUnion { + BslnFormat0Part fmt0Part; + BslnFormat1Part fmt1Part; + BslnFormat2Part fmt2Part; + BslnFormat3Part fmt3Part; +}; +typedef union BslnFormatUnion BslnFormatUnion; + + +typedef UInt16 BslnTableFormat; + +struct BslnTable { + Fixed version; + BslnTableFormat format; + UInt16 defaultBaseline; + BslnFormatUnion parts; +}; +typedef struct BslnTable BslnTable; +typedef BslnTable * BslnTablePtr; + + + +struct ALMXHeader { + Fixed Version; + UInt16 Flags; + UInt16 NMasters; + UInt16 FirstGlyph; + UInt16 LastGlyph; + + SFNTLookupTable lookup; +}; +typedef struct ALMXHeader ALMXHeader; +struct ALMXGlyphEntry { + SInt16 GlyphIndexOffset; + SInt16 HorizontalAdvance; + SInt16 XOffsetToHOrigin; + SInt16 VerticalAdvance; + SInt16 YOffsetToVOrigin; +}; +typedef struct ALMXGlyphEntry ALMXGlyphEntry; + + + +struct ROTAHeader { + Fixed Version; + UInt16 Flags; + UInt16 NMasters; + UInt16 FirstGlyph; + UInt16 LastGlyph; + + SFNTLookupTable lookup; +}; +typedef struct ROTAHeader ROTAHeader; +struct ROTAGlyphEntry { + SInt16 GlyphIndexOffset; + SInt16 HBaselineOffset; + SInt16 VBaselineOffset; +}; +typedef struct ROTAGlyphEntry ROTAGlyphEntry; + + + +enum { + kANKRCurrentVersion = 0 +}; + + +struct AnchorPoint { + SInt16 x; + SInt16 y; +}; +typedef struct AnchorPoint AnchorPoint; + +struct AnchorPointTable { + UInt32 nPoints; + AnchorPoint points[1]; +}; +typedef struct AnchorPointTable AnchorPointTable; + +struct AnkrTable { + UInt16 version; + UInt16 flags; + UInt32 lookupTableOffset; + UInt32 anchorPointTableOffset; +}; +typedef struct AnkrTable AnkrTable; + + + +enum { + kLTAGCurrentVersion = 1 +}; + + +struct LtagStringRange { + UInt16 offset; + UInt16 length; +}; +typedef struct LtagStringRange LtagStringRange; + +struct LtagTable { + UInt32 version; + UInt32 flags; + UInt32 numTags; + LtagStringRange tagRange[1]; +}; +typedef struct LtagTable LtagTable; + + + + + + + + + + + + + + + + + + + + +typedef double CGFloat; +typedef struct __attribute__((objc_bridge(id))) __IOSurface *IOSurfaceRef __attribute__((swift_name("IOSurfaceRef"))); +struct CGPoint { + CGFloat x; + CGFloat y; +}; +typedef struct CGPoint CGPoint; + + + +struct CGSize { + CGFloat width; + CGFloat height; +}; +typedef struct CGSize CGSize; + + + + + +struct CGVector { + CGFloat dx; + CGFloat dy; +}; +typedef struct CGVector CGVector; + + + +struct CGRect { + CGPoint origin; + CGSize size; +}; +typedef struct CGRect CGRect; + + + +typedef uint32_t CGRectEdge; enum { + CGRectMinXEdge, CGRectMinYEdge, CGRectMaxXEdge, CGRectMaxYEdge +}; + + + +extern const CGPoint CGPointZero + __attribute__((availability(macosx,introduced=10.0))); + + + +extern const CGSize CGSizeZero + __attribute__((availability(macosx,introduced=10.0))); + + + +extern const CGRect CGRectZero + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern const CGRect CGRectNull + __attribute__((availability(macosx,introduced=10.0))); + + + +extern const CGRect CGRectInfinite + __attribute__((availability(macosx,introduced=10.4))); + + + +static inline CGPoint CGPointMake(CGFloat x, CGFloat y); + + + +static inline CGSize CGSizeMake(CGFloat width, CGFloat height); + + + +static inline CGVector CGVectorMake(CGFloat dx, CGFloat dy); + + + +static inline CGRect CGRectMake(CGFloat x, CGFloat y, CGFloat width, + CGFloat height); + + + +extern CGFloat CGRectGetMinX(CGRect rect) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGFloat CGRectGetMidX(CGRect rect) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGFloat CGRectGetMaxX(CGRect rect) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGFloat CGRectGetMinY(CGRect rect) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGFloat CGRectGetMidY(CGRect rect) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGFloat CGRectGetMaxY(CGRect rect) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGFloat CGRectGetWidth(CGRect rect) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGFloat CGRectGetHeight(CGRect rect) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern _Bool CGPointEqualToPoint(CGPoint point1, CGPoint point2) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern _Bool CGSizeEqualToSize(CGSize size1, CGSize size2) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern _Bool CGRectEqualToRect(CGRect rect1, CGRect rect2) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGRect CGRectStandardize(CGRect rect) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern _Bool CGRectIsEmpty(CGRect rect) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern _Bool CGRectIsNull(CGRect rect) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern _Bool CGRectIsInfinite(CGRect rect) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CGRect CGRectInset(CGRect rect, CGFloat dx, CGFloat dy) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGRect CGRectIntegral(CGRect rect) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGRect CGRectUnion(CGRect r1, CGRect r2) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGRect CGRectIntersection(CGRect r1, CGRect r2) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGRect CGRectOffset(CGRect rect, CGFloat dx, CGFloat dy) + __attribute__((availability(macosx,introduced=10.0))); + + + + + + + +extern void CGRectDivide(CGRect rect, CGRect * slice, + CGRect * remainder, CGFloat amount, CGRectEdge edge) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern _Bool CGRectContainsPoint(CGRect rect, CGPoint point) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern _Bool CGRectContainsRect(CGRect rect1, CGRect rect2) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern _Bool CGRectIntersectsRect(CGRect rect1, CGRect rect2) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern CFDictionaryRef CGPointCreateDictionaryRepresentation( + CGPoint point) + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern _Bool CGPointMakeWithDictionaryRepresentation( + CFDictionaryRef _Nullable dict, CGPoint * _Nullable point) + __attribute__((availability(macosx,introduced=10.5))); + + + +extern CFDictionaryRef CGSizeCreateDictionaryRepresentation(CGSize size) + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern _Bool CGSizeMakeWithDictionaryRepresentation( + CFDictionaryRef _Nullable dict, CGSize * _Nullable size) + __attribute__((availability(macosx,introduced=10.5))); + + + +extern CFDictionaryRef CGRectCreateDictionaryRepresentation(CGRect) + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern _Bool CGRectMakeWithDictionaryRepresentation( + CFDictionaryRef _Nullable dict, CGRect * _Nullable rect) + __attribute__((availability(macosx,introduced=10.5))); + + + +static inline CGPoint +CGPointMake(CGFloat x, CGFloat y) +{ + CGPoint p; p.x = x; p.y = y; return p; +} + +static inline CGSize +CGSizeMake(CGFloat width, CGFloat height) +{ + CGSize size; size.width = width; size.height = height; return size; +} + +static inline CGVector +CGVectorMake(CGFloat dx, CGFloat dy) +{ + CGVector vector; vector.dx = dx; vector.dy = dy; return vector; +} + +static inline CGRect +CGRectMake(CGFloat x, CGFloat y, CGFloat width, CGFloat height) +{ + CGRect rect; + rect.origin.x = x; rect.origin.y = y; + rect.size.width = width; rect.size.height = height; + return rect; +} + +static inline _Bool +__CGPointEqualToPoint(CGPoint point1, CGPoint point2) +{ + return point1.x == point2.x && point1.y == point2.y; +} + + +static inline _Bool +__CGSizeEqualToSize(CGSize size1, CGSize size2) +{ + return size1.width == size2.width && size1.height == size2.height; +} +typedef CGPoint ATSPoint; +struct ATSFSSpec { + FSVolumeRefNum vRefNum; + SInt32 parID; + StrFileName name; +}; +typedef struct ATSFSSpec ATSFSSpec; + + + + + +typedef UInt32 FMGeneration; + + + + + + + +typedef SInt16 FMFontFamily; +typedef SInt16 FMFontStyle; +typedef SInt16 FMFontSize; + + + + + + + +typedef UInt32 FMFont; +struct FMFontFamilyInstance { + FMFontFamily fontFamily; + FMFontStyle fontStyle; +}; +typedef struct FMFontFamilyInstance FMFontFamilyInstance; +struct FMFontFamilyIterator { + UInt32 reserved[16]; +}; +typedef struct FMFontFamilyIterator FMFontFamilyIterator; +struct FMFontIterator { + UInt32 reserved[16]; +}; +typedef struct FMFontIterator FMFontIterator; +struct FMFontFamilyInstanceIterator { + UInt32 reserved[16]; +}; +typedef struct FMFontFamilyInstanceIterator FMFontFamilyInstanceIterator; +enum { + kInvalidGeneration = 0, + kInvalidFontFamily = -1, + kInvalidFont = 0 +}; + +enum { + kFMCurrentFilterFormat = 0 +}; + +typedef UInt32 FMFilterSelector; +enum { + kFMFontTechnologyFilterSelector = 1, + kFMFontContainerFilterSelector = 2, + kFMGenerationFilterSelector = 3, + kFMFontFamilyCallbackFilterSelector = 4, + kFMFontCallbackFilterSelector = 5, + kFMFontDirectoryFilterSelector = 6, + kFMFontFileRefFilterSelector = 10 +}; + +enum { + kFMTrueTypeFontTechnology = 'true', + kFMPostScriptFontTechnology = 'typ1' +}; + +typedef OSStatus ( * FMFontFamilyCallbackFilterProcPtr)(FMFontFamily iFontFamily, void *iRefCon); +typedef OSStatus ( * FMFontCallbackFilterProcPtr)(FMFont iFont, void *iRefCon); +typedef FMFontFamilyCallbackFilterProcPtr FMFontFamilyCallbackFilterUPP; +typedef FMFontCallbackFilterProcPtr FMFontCallbackFilterUPP; +extern FMFontFamilyCallbackFilterUPP +NewFMFontFamilyCallbackFilterUPP(FMFontFamilyCallbackFilterProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern FMFontCallbackFilterUPP +NewFMFontCallbackFilterUPP(FMFontCallbackFilterProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern void +DisposeFMFontFamilyCallbackFilterUPP(FMFontFamilyCallbackFilterUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern void +DisposeFMFontCallbackFilterUPP(FMFontCallbackFilterUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +InvokeFMFontFamilyCallbackFilterUPP( + FMFontFamily iFontFamily, + void * iRefCon, + FMFontFamilyCallbackFilterUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +InvokeFMFontCallbackFilterUPP( + FMFont iFont, + void * iRefCon, + FMFontCallbackFilterUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +struct FMFontDirectoryFilter { + SInt16 fontFolderDomain; + UInt32 reserved[2]; +}; +typedef struct FMFontDirectoryFilter FMFontDirectoryFilter; + + + + +struct FMFilter { + UInt32 format; + FMFilterSelector selector; + union { + FourCharCode fontTechnologyFilter; + ATSFSSpec fontContainerFilter; + FMGeneration generationFilter; + FMFontFamilyCallbackFilterUPP fontFamilyCallbackFilter; + FMFontCallbackFilterUPP fontCallbackFilter; + FMFontDirectoryFilter fontDirectoryFilter; + const FSRef * fontFileRefFilter; + } filter; +}; +typedef struct FMFilter FMFilter; + +typedef OptionBits ATSOptionFlags; +typedef UInt32 ATSGeneration; +typedef UInt32 ATSFontContainerRef; +typedef UInt32 ATSFontFamilyRef; + +typedef UInt32 ATSFontRef; + + +typedef UInt16 ATSGlyphRef; +typedef CGFloat ATSFontSize; +typedef UInt32 ATSFontFormat; +enum { + kATSFontFormatUnspecified = 0 +}; + +enum { + kATSGenerationUnspecified = 0, + kATSFontContainerRefUnspecified = 0, + kATSFontFamilyRefUnspecified = 0, + kATSFontRefUnspecified = 0 +}; + + + + + +struct ATSFontMetrics { + UInt32 version; + CGFloat ascent; + + CGFloat descent; + + CGFloat leading; + CGFloat avgAdvanceWidth; + CGFloat maxAdvanceWidth; + CGFloat minLeftSideBearing; + CGFloat minRightSideBearing; + CGFloat stemWidth; + CGFloat stemHeight; + CGFloat capHeight; + CGFloat xHeight; + CGFloat italicAngle; + CGFloat underlinePosition; + CGFloat underlineThickness; +}; +typedef struct ATSFontMetrics ATSFontMetrics; +enum { + kATSItalicQDSkew = (1 << 16) / 4, + kATSBoldQDStretch = (1 << 16) * 3 / 2, + kATSRadiansFactor = 1144 +}; + + +typedef UInt16 ATSCurveType; +enum { + kATSCubicCurveType = 0x0001, + kATSQuadCurveType = 0x0002, + kATSOtherCurveType = 0x0003 +}; + + + + + + +enum { + kATSDeletedGlyphcode = 0xFFFF +}; + +struct ATSUCurvePath { + UInt32 vectors; + UInt32 controlBits[1]; + ATSPoint vector[1]; +}; +typedef struct ATSUCurvePath ATSUCurvePath; +struct ATSUCurvePaths { + UInt32 contours; + ATSUCurvePath contour[1]; +}; +typedef struct ATSUCurvePaths ATSUCurvePaths; + +struct ATSGlyphIdealMetrics { + ATSPoint advance; + ATSPoint sideBearing; + ATSPoint otherSideBearing; +}; +typedef struct ATSGlyphIdealMetrics ATSGlyphIdealMetrics; + +struct ATSGlyphScreenMetrics { + ATSPoint deviceAdvance; + ATSPoint topLeft; + UInt32 height; + UInt32 width; + ATSPoint sideBearing; + ATSPoint otherSideBearing; +}; +typedef struct ATSGlyphScreenMetrics ATSGlyphScreenMetrics; + + +typedef ATSGlyphRef GlyphID; + + + + + + + + +enum { + kATSUseGlyphAdvance = 0x7FFFFFFF, + kATSUseLineHeight = 0x7FFFFFFF, + kATSNoTracking = (int)0x80000000 +}; +enum { + + + + + + + kATSUseCaretOrigins = 0, + + + + + + + kATSUseDeviceOrigins = 1, + kATSUseFractionalOrigins = 2, + kATSUseOriginFlags = 3 +}; +typedef UInt32 ATSULayoutOperationSelector; +enum { + + + + + kATSULayoutOperationNone = 0x00000000, + + + + + kATSULayoutOperationJustification = 0x00000001, + + + + + kATSULayoutOperationMorph = 0x00000002, + + + + + kATSULayoutOperationKerningAdjustment = 0x00000004, + + + + + kATSULayoutOperationBaselineAdjustment = 0x00000008, + + + + + kATSULayoutOperationTrackingAdjustment = 0x00000010, + + + + + + kATSULayoutOperationPostLayoutAdjustment = 0x00000020, + kATSULayoutOperationAppleReserved = (UInt32)0xFFFFFFC0 +}; +typedef UInt32 ATSULayoutOperationCallbackStatus; +enum { + + + + + + + kATSULayoutOperationCallbackStatusHandled = 0x00000000, + + + + + + + kATSULayoutOperationCallbackStatusContinue = 0x00000001 +}; +typedef UInt32 ATSLineLayoutOptions; +enum { + + + + + kATSLineNoLayoutOptions = 0x00000000, + + + + + kATSLineIsDisplayOnly = 0x00000001, + + + + + kATSLineHasNoHangers = 0x00000002, + + + + + kATSLineHasNoOpticalAlignment = 0x00000004, + + + + + kATSLineKeepSpacesOutOfMargin = 0x00000008, + + + + + kATSLineNoSpecialJustification = 0x00000010, + + + + + + kATSLineLastNoJustification = 0x00000020, + + + + + + kATSLineFractDisable = 0x00000040, + + + + + + kATSLineImposeNoAngleForEnds = 0x00000080, + + + + + + kATSLineFillOutToWidth = 0x00000100, + + + + + + kATSLineTabAdjustEnabled = 0x00000200, + + + + + + kATSLineIgnoreFontLeading = 0x00000400, + + + + + + kATSLineApplyAntiAliasing = 0x00000800, + + + + + + kATSLineNoAntiAliasing = 0x00001000, + + + + + + + kATSLineDisableNegativeJustification = 0x00002000, + + + + + + + + kATSLineDisableAutoAdjustDisplayPos = 0x00004000, + + + + + + kATSLineUseQDRendering = 0x00008000, + + + + + kATSLineDisableAllJustification = 0x00010000, + + + + + kATSLineDisableAllGlyphMorphing = 0x00020000, + + + + + kATSLineDisableAllKerningAdjustments = 0x00040000, + + + + + kATSLineDisableAllBaselineAdjustments = 0x00080000, + + + + + kATSLineDisableAllTrackingAdjustments = 0x00100000, + + + + + kATSLineDisableAllLayoutOperations = kATSLineDisableAllJustification | kATSLineDisableAllGlyphMorphing | kATSLineDisableAllKerningAdjustments | kATSLineDisableAllBaselineAdjustments | kATSLineDisableAllTrackingAdjustments, + + + + + + kATSLineUseDeviceMetrics = 0x01000000, + + + + + + + kATSLineBreakToNearestCharacter = 0x02000000, + + + + + + kATSLineAppleReserved = (UInt32)0xFCE00000 +}; +typedef UInt32 ATSStyleRenderingOptions; +enum { + + + + + kATSStyleNoOptions = 0x00000000, + + + + + + kATSStyleNoHinting = 0x00000001, + + + + + + + kATSStyleApplyAntiAliasing = 0x00000002, + + + + + + + kATSStyleNoAntiAliasing = 0x00000004, + + + + + + kATSStyleAppleReserved = (UInt32)0xFFFFFFF8, + + + + + + + kATSStyleApplyHints = kATSStyleNoOptions +}; +typedef UInt32 ATSGlyphInfoFlags; +enum { + + + + + + kATSGlyphInfoAppleReserved = 0x1FFBFFE8, + + + + + kATSGlyphInfoIsAttachment = (UInt32)0x80000000, + + + + + kATSGlyphInfoIsLTHanger = 0x40000000, + + + + + kATSGlyphInfoIsRBHanger = 0x20000000, + + + + + + kATSGlyphInfoTerminatorGlyph = 0x00080000, + + + + + kATSGlyphInfoIsWhiteSpace = 0x00040000, + + + + + kATSGlyphInfoHasImposedWidth = 0x00000010, + + + + + + + + kATSGlyphInfoByteSizeMask = 0x00000007 +}; +struct ATSLayoutRecord { + + + + + ATSGlyphRef glyphID; + + + + + ATSGlyphInfoFlags flags; + + + + + ByteCount originalOffset; + + + + + Fixed realPos; +}; +typedef struct ATSLayoutRecord ATSLayoutRecord; +struct ATSTrapezoid { + FixedPoint upperLeft; + FixedPoint upperRight; + FixedPoint lowerRight; + FixedPoint lowerLeft; +}; +typedef struct ATSTrapezoid ATSTrapezoid; +struct ATSJustWidthDeltaEntryOverride { + + + + + Fixed beforeGrowLimit; + + + + + Fixed beforeShrinkLimit; + + + + + Fixed afterGrowLimit; + + + + + Fixed afterShrinkLimit; + + + + + JustificationFlags growFlags; + + + + + JustificationFlags shrinkFlags; +}; +typedef struct ATSJustWidthDeltaEntryOverride ATSJustWidthDeltaEntryOverride; + +typedef ATSJustWidthDeltaEntryOverride ATSJustPriorityWidthDeltaOverrides[4]; +typedef struct ATSGlyphVector* ATSULineRef; +typedef OSStatus ( * ATSUDirectLayoutOperationOverrideProcPtr)(ATSULayoutOperationSelector iCurrentOperation, ATSULineRef iLineRef, URefCon iRefCon, void *iOperationCallbackParameterPtr, ATSULayoutOperationCallbackStatus *oCallbackStatus); +typedef ATSUDirectLayoutOperationOverrideProcPtr ATSUDirectLayoutOperationOverrideUPP; +extern ATSUDirectLayoutOperationOverrideUPP +NewATSUDirectLayoutOperationOverrideUPP(ATSUDirectLayoutOperationOverrideProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.2,deprecated=10.7))); +extern void +DisposeATSUDirectLayoutOperationOverrideUPP(ATSUDirectLayoutOperationOverrideUPP userUPP) __attribute__((availability(macosx,introduced=10.2,deprecated=10.7))); +extern OSStatus +InvokeATSUDirectLayoutOperationOverrideUPP( + ATSULayoutOperationSelector iCurrentOperation, + ATSULineRef iLineRef, + URefCon iRefCon, + void * iOperationCallbackParameterPtr, + ATSULayoutOperationCallbackStatus * oCallbackStatus, + ATSUDirectLayoutOperationOverrideUPP userUPP) __attribute__((availability(macosx,introduced=10.2,deprecated=10.7))); +struct ATSULayoutOperationOverrideSpecifier { + + + + + + + ATSULayoutOperationSelector operationSelector; + ATSUDirectLayoutOperationOverrideUPP overrideUPP; + +}; +typedef struct ATSULayoutOperationOverrideSpecifier ATSULayoutOperationOverrideSpecifier; + + + + + +struct sfntDirectoryEntry { + FourCharCode tableTag; + UInt32 checkSum; + UInt32 offset; + UInt32 length; +}; +typedef struct sfntDirectoryEntry sfntDirectoryEntry; + +struct sfntDirectory { + FourCharCode format; + UInt16 numOffsets; + UInt16 searchRange; + UInt16 entrySelector; + UInt16 rangeShift; + sfntDirectoryEntry table[1]; +}; +typedef struct sfntDirectory sfntDirectory; +enum { + sizeof_sfntDirectory = 12 +}; + + +enum { + cmapFontTableTag = 'cmap' +}; + +enum { + kFontUnicodePlatform = 0, + kFontMacintoshPlatform = 1, + kFontReservedPlatform = 2, + kFontMicrosoftPlatform = 3, + kFontCustomPlatform = 4 +}; + +enum { + kFontUnicodeDefaultSemantics = 0, + kFontUnicodeV1_1Semantics = 1, + kFontISO10646_1993Semantics = 2, + kFontUnicodeV2_0BMPOnlySemantics = 3, + kFontUnicodeV2_0FullCoverageSemantics = 4, + kFontUnicodeV4_0VariationSequenceSemantics = 5, + kFontUnicode_FullRepertoire = 6 +}; + +enum { + kFontRomanScript = 0, + kFontJapaneseScript = 1, + kFontTraditionalChineseScript = 2, + kFontChineseScript = kFontTraditionalChineseScript, + kFontKoreanScript = 3, + kFontArabicScript = 4, + kFontHebrewScript = 5, + kFontGreekScript = 6, + kFontCyrillicScript = 7, + kFontRussian = kFontCyrillicScript, + kFontRSymbolScript = 8, + kFontDevanagariScript = 9, + kFontGurmukhiScript = 10, + kFontGujaratiScript = 11, + kFontOriyaScript = 12, + kFontBengaliScript = 13, + kFontTamilScript = 14, + kFontTeluguScript = 15, + kFontKannadaScript = 16, + kFontMalayalamScript = 17, + kFontSinhaleseScript = 18, + kFontBurmeseScript = 19, + kFontKhmerScript = 20, + kFontThaiScript = 21, + kFontLaotianScript = 22, + kFontGeorgianScript = 23, + kFontArmenianScript = 24, + kFontSimpleChineseScript = 25, + kFontTibetanScript = 26, + kFontMongolianScript = 27, + kFontGeezScript = 28, + kFontEthiopicScript = kFontGeezScript, + kFontAmharicScript = kFontGeezScript, + kFontSlavicScript = 29, + kFontEastEuropeanRomanScript = kFontSlavicScript, + kFontVietnameseScript = 30, + kFontExtendedArabicScript = 31, + kFontSindhiScript = kFontExtendedArabicScript, + kFontUninterpretedScript = 32 +}; + +enum { + kFontMicrosoftSymbolScript = 0, + kFontMicrosoftStandardScript = 1, + kFontMicrosoftUCS4Script = 10 +}; + + +enum { + kFontCustom8BitScript = 0, + kFontCustom816BitScript = 1, + kFontCustom16BitScript = 2 +}; + + +enum { + kFontEnglishLanguage = 0, + kFontFrenchLanguage = 1, + kFontGermanLanguage = 2, + kFontItalianLanguage = 3, + kFontDutchLanguage = 4, + kFontSwedishLanguage = 5, + kFontSpanishLanguage = 6, + kFontDanishLanguage = 7, + kFontPortugueseLanguage = 8, + kFontNorwegianLanguage = 9, + kFontHebrewLanguage = 10, + kFontJapaneseLanguage = 11, + kFontArabicLanguage = 12, + kFontFinnishLanguage = 13, + kFontGreekLanguage = 14, + kFontIcelandicLanguage = 15, + kFontMalteseLanguage = 16, + kFontTurkishLanguage = 17, + kFontCroatianLanguage = 18, + kFontTradChineseLanguage = 19, + kFontUrduLanguage = 20, + kFontHindiLanguage = 21, + kFontThaiLanguage = 22, + kFontKoreanLanguage = 23, + kFontLithuanianLanguage = 24, + kFontPolishLanguage = 25, + kFontHungarianLanguage = 26, + kFontEstonianLanguage = 27, + kFontLettishLanguage = 28, + kFontLatvianLanguage = kFontLettishLanguage, + kFontSaamiskLanguage = 29, + kFontLappishLanguage = kFontSaamiskLanguage, + kFontFaeroeseLanguage = 30, + kFontFarsiLanguage = 31, + kFontPersianLanguage = kFontFarsiLanguage, + kFontRussianLanguage = 32, + kFontSimpChineseLanguage = 33, + kFontFlemishLanguage = 34, + kFontIrishLanguage = 35, + kFontAlbanianLanguage = 36, + kFontRomanianLanguage = 37, + kFontCzechLanguage = 38, + kFontSlovakLanguage = 39, + kFontSlovenianLanguage = 40, + kFontYiddishLanguage = 41, + kFontSerbianLanguage = 42, + kFontMacedonianLanguage = 43, + kFontBulgarianLanguage = 44, + kFontUkrainianLanguage = 45, + kFontByelorussianLanguage = 46, + kFontUzbekLanguage = 47, + kFontKazakhLanguage = 48, + kFontAzerbaijaniLanguage = 49, + kFontAzerbaijanArLanguage = 50, + kFontArmenianLanguage = 51, + kFontGeorgianLanguage = 52, + kFontMoldavianLanguage = 53, + kFontKirghizLanguage = 54, + kFontTajikiLanguage = 55, + kFontTurkmenLanguage = 56, + kFontMongolianLanguage = 57, + kFontMongolianCyrLanguage = 58, + kFontPashtoLanguage = 59, + kFontKurdishLanguage = 60, + kFontKashmiriLanguage = 61, + kFontSindhiLanguage = 62, + kFontTibetanLanguage = 63, + kFontNepaliLanguage = 64, + kFontSanskritLanguage = 65, + kFontMarathiLanguage = 66, + kFontBengaliLanguage = 67, + kFontAssameseLanguage = 68, + kFontGujaratiLanguage = 69, + kFontPunjabiLanguage = 70, + kFontOriyaLanguage = 71, + kFontMalayalamLanguage = 72, + kFontKannadaLanguage = 73, + kFontTamilLanguage = 74, + kFontTeluguLanguage = 75, + kFontSinhaleseLanguage = 76, + kFontBurmeseLanguage = 77, + kFontKhmerLanguage = 78, + kFontLaoLanguage = 79, + kFontVietnameseLanguage = 80, + kFontIndonesianLanguage = 81, + kFontTagalogLanguage = 82, + kFontMalayRomanLanguage = 83, + kFontMalayArabicLanguage = 84, + kFontAmharicLanguage = 85, + kFontTigrinyaLanguage = 86, + kFontGallaLanguage = 87, + kFontOromoLanguage = kFontGallaLanguage, + kFontSomaliLanguage = 88, + kFontSwahiliLanguage = 89, + kFontRuandaLanguage = 90, + kFontRundiLanguage = 91, + kFontChewaLanguage = 92, + kFontMalagasyLanguage = 93, + kFontEsperantoLanguage = 94, + kFontWelshLanguage = 128, + kFontBasqueLanguage = 129, + kFontCatalanLanguage = 130, + kFontLatinLanguage = 131, + kFontQuechuaLanguage = 132, + kFontGuaraniLanguage = 133, + kFontAymaraLanguage = 134, + kFontTatarLanguage = 135, + kFontUighurLanguage = 136, + kFontDzongkhaLanguage = 137, + kFontJavaneseRomLanguage = 138, + kFontSundaneseRomLanguage = 139 +}; + + + +enum { + kFontNoPlatformCode = (unsigned int)(~0), + kFontNoScriptCode = (unsigned int)(~0), + kFontNoLanguageCode = (unsigned int)(~0) +}; + +struct sfntCMapSubHeader { + UInt16 format; + UInt16 length; + UInt16 languageID; +}; +typedef struct sfntCMapSubHeader sfntCMapSubHeader; +enum { + sizeof_sfntCMapSubHeader = 6 +}; + +struct sfntCMapExtendedSubHeader { + UInt16 format; + UInt16 reserved; + UInt32 length; + UInt32 language; +}; +typedef struct sfntCMapExtendedSubHeader sfntCMapExtendedSubHeader; +enum { + sizeof_sfntCMapExtendedSubHeader = 12 +}; + +struct sfntCMapEncoding { + UInt16 platformID; + UInt16 scriptID; + UInt32 offset; +}; +typedef struct sfntCMapEncoding sfntCMapEncoding; +enum { + sizeof_sfntCMapEncoding = 8 +}; + +struct sfntCMapHeader { + UInt16 version; + UInt16 numTables; + sfntCMapEncoding encoding[1]; +}; +typedef struct sfntCMapHeader sfntCMapHeader; +enum { + sizeof_sfntCMapHeader = 4 +}; + + +enum { + nameFontTableTag = 'name' +}; + +enum { + kFontCopyrightName = 0, + kFontFamilyName = 1, + kFontStyleName = 2, + kFontUniqueName = 3, + kFontFullName = 4, + kFontVersionName = 5, + kFontPostscriptName = 6, + kFontTrademarkName = 7, + kFontManufacturerName = 8, + kFontDesignerName = 9, + kFontDescriptionName = 10, + kFontVendorURLName = 11, + kFontDesignerURLName = 12, + kFontLicenseDescriptionName = 13, + kFontLicenseInfoURLName = 14, + kFontPreferredFamilyName = 16, + kFontPreferredSubfamilyName = 17, + kFontMacCompatibleFullName = 18, + kFontSampleTextName = 19, + kFontPostScriptCIDName = 20, + kFontLastReservedName = 255 +}; + + + +enum { + kFontNoNameCode = (unsigned int)(~0) +}; + +struct sfntNameRecord { + UInt16 platformID; + UInt16 scriptID; + UInt16 languageID; + UInt16 nameID; + UInt16 length; + UInt16 offset; +}; +typedef struct sfntNameRecord sfntNameRecord; +enum { + sizeof_sfntNameRecord = 12 +}; + +struct sfntNameHeader { + UInt16 format; + UInt16 count; + UInt16 stringOffset; + sfntNameRecord rec[1]; +}; +typedef struct sfntNameHeader sfntNameHeader; +enum { + sizeof_sfntNameHeader = 6 +}; + + +enum { + variationFontTableTag = 'fvar' +}; + + +struct sfntVariationAxis { + FourCharCode axisTag; + Fixed minValue; + Fixed defaultValue; + Fixed maxValue; + SInt16 flags; + SInt16 nameID; +}; +typedef struct sfntVariationAxis sfntVariationAxis; +enum { + sizeof_sfntVariationAxis = 20 +}; + + +struct sfntInstance { + SInt16 nameID; + SInt16 flags; + Fixed coord[1]; + +}; +typedef struct sfntInstance sfntInstance; +enum { + sizeof_sfntInstance = 4 +}; + +struct sfntVariationHeader { + Fixed version; + UInt16 offsetToData; + UInt16 countSizePairs; + UInt16 axisCount; + UInt16 axisSize; + UInt16 instanceCount; + UInt16 instanceSize; + + sfntVariationAxis axis[1]; + sfntInstance instance[1]; +}; +typedef struct sfntVariationHeader sfntVariationHeader; +enum { + sizeof_sfntVariationHeader = 16 +}; + + +enum { + descriptorFontTableTag = 'fdsc' +}; + +struct sfntFontDescriptor { + FourCharCode name; + Fixed value; +}; +typedef struct sfntFontDescriptor sfntFontDescriptor; +struct sfntDescriptorHeader { + Fixed version; + SInt32 descriptorCount; + sfntFontDescriptor descriptor[1]; +}; +typedef struct sfntDescriptorHeader sfntDescriptorHeader; +enum { + sizeof_sfntDescriptorHeader = 8 +}; + + +enum { + featureFontTableTag = 'feat' +}; + +struct sfntFeatureName { + UInt16 featureType; + UInt16 settingCount; + SInt32 offsetToSettings; + UInt16 featureFlags; + SInt16 nameID; +}; +typedef struct sfntFeatureName sfntFeatureName; +struct sfntFontFeatureSetting { + UInt16 setting; + SInt16 nameID; +}; +typedef struct sfntFontFeatureSetting sfntFontFeatureSetting; +struct sfntFontRunFeature { + UInt16 featureType; + UInt16 setting; +}; +typedef struct sfntFontRunFeature sfntFontRunFeature; +struct sfntFeatureHeader { + SInt32 version; + UInt16 featureNameCount; + UInt16 featureSetCount; + SInt32 reserved; + sfntFeatureName names[1]; + sfntFontFeatureSetting settings[1]; + sfntFontRunFeature runs[1]; +}; +typedef struct sfntFeatureHeader sfntFeatureHeader; + +enum { + os2FontTableTag = 'OS/2' +}; + + +enum { + nonGlyphID = 65535 +}; + + + +typedef UInt32 FontNameCode; + +typedef UInt32 FontPlatformCode; +typedef UInt32 FontScriptCode; +typedef UInt32 FontLanguageCode; + + + + +struct FontVariation { + FourCharCode name; + Fixed value; +}; +typedef struct FontVariation FontVariation; + + + + + +enum { + kFontNoPlatform = (unsigned int)(~0), + kFontNoScript = (unsigned int)(~0), + kFontNoLanguage = (unsigned int)(~0), + kFontNoName = (unsigned int)(~0) +}; + + + + + +enum { + kATSOptionFlagsDefault = kNilOptions, + kATSOptionFlagsComposeFontPostScriptName = 1 << 0, + kATSOptionFlagsUseDataForkAsResourceFork = 1 << 8, + kATSOptionFlagsUseResourceFork = 2 << 8, + kATSOptionFlagsUseDataFork = 3 << 8 +}; + +enum { + kATSIterationCompleted = -980L, + kATSInvalidFontFamilyAccess = -981L, + kATSInvalidFontAccess = -982L, + kATSIterationScopeModified = -983L, + kATSInvalidFontTableAccess = -984L, + kATSInvalidFontContainerAccess = -985L, + kATSInvalidGlyphAccess = -986L +}; + + +typedef UInt32 ATSFontContext; +enum { + kATSFontContextUnspecified = 0, + kATSFontContextGlobal = 1, + kATSFontContextLocal = 2 +}; + +enum { + kATSOptionFlagsActivateDisabled = 0x00000001 << 5, + kATSOptionFlagsProcessSubdirectories = 0x00000001 << 6, + kATSOptionFlagsDoNotNotify = 0x00000001 << 7, + kATSOptionFlagsRecordPersistently = 0x00000001 << 18 +}; + + +enum { + kATSOptionFlagsIterateByPrecedenceMask = 0x00000001 << 5, + kATSOptionFlagsIncludeDisabledMask = 0x00000001 << 7, + kATSOptionFlagsIterationScopeMask = 0x00000007 << 12, + kATSOptionFlagsDefaultScope = 0x00000000 << 12, + kATSOptionFlagsUnRestrictedScope = 0x00000001 << 12, + kATSOptionFlagsRestrictedScope = 0x00000002 << 12 +}; + +typedef OSStatus ( * ATSFontFamilyApplierFunction)(ATSFontFamilyRef iFamily, void *iRefCon); +typedef OSStatus ( * ATSFontApplierFunction)(ATSFontRef iFont, void *iRefCon); +typedef struct ATSFontFamilyIterator_* ATSFontFamilyIterator; +typedef struct ATSFontIterator_* ATSFontIterator; +enum { + kATSFontFilterCurrentVersion = 0 +}; + +enum ATSFontFilterSelector { + kATSFontFilterSelectorUnspecified = 0, + kATSFontFilterSelectorGeneration = 3, + kATSFontFilterSelectorFontFamily = 7, + kATSFontFilterSelectorFontFamilyApplierFunction = 8, + kATSFontFilterSelectorFontApplierFunction = 9, + kATSFileReferenceFilterSelector = 10 +}; +typedef enum ATSFontFilterSelector ATSFontFilterSelector; + +struct ATSFontFilter { + UInt32 version; + ATSFontFilterSelector filterSelector; + union { + ATSGeneration generationFilter; + ATSFontFamilyRef fontFamilyFilter; + ATSFontFamilyApplierFunction fontFamilyApplierFunctionFilter; + ATSFontApplierFunction fontApplierFunctionFilter; + const FSRef * fontFileRefFilter; + } filter; +}; +typedef struct ATSFontFilter ATSFontFilter; + +typedef struct ATSFontNotificationRef_* ATSFontNotificationRef; +typedef struct ATSFontNotificationInfoRef_* ATSFontNotificationInfoRef; +enum ATSFontNotifyOption { + + + + + kATSFontNotifyOptionDefault = 0, + kATSFontNotifyOptionReceiveWhileSuspended = 1L << 0 +}; +typedef enum ATSFontNotifyOption ATSFontNotifyOption; +enum ATSFontNotifyAction { + kATSFontNotifyActionFontsChanged = 1, + kATSFontNotifyActionDirectoriesChanged = 2 +}; +typedef enum ATSFontNotifyAction ATSFontNotifyAction; +typedef void ( * ATSNotificationCallback)(ATSFontNotificationInfoRef info, void *refCon); +extern ATSGeneration +ATSGetGeneration(void) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Register for kCTFontManagerRegisteredFontsChangedNotification notifications"))); +extern OSStatus +ATSFontActivateFromFileReference( + const FSRef * iFile, + ATSFontContext iContext, + ATSFontFormat iFormat, + void * iRefCon, + ATSOptionFlags iOptions, + ATSFontContainerRef * oContainer) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8,message="Use CTFontManagerRegisterFontsForURL() or CTFontManagerRegisterFontsForURLs()"))); +extern OSStatus +ATSFontActivateFromMemory( + LogicalAddress iData, + ByteCount iLength, + ATSFontContext iContext, + ATSFontFormat iFormat, + void * iReserved, + ATSOptionFlags iOptions, + ATSFontContainerRef * oContainer) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Use CTFontManagerRegisterFontForData() or CGFontCreateWithDataProvider() w/ CTFontManagerRegisterGraphicsFont()"))); +extern OSStatus +ATSFontDeactivate( + ATSFontContainerRef iContainer, + void * iRefCon, + ATSOptionFlags iOptions) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Use CTFontManagerUnregisterFontsForURL() or CTFontManagerUnregisterFontsForURLs()"))); +extern OSStatus +ATSFontGetContainerFromFileReference( + const FSRef * iFile, + ATSFontContext iContext, + ATSOptionFlags iOptions, + ATSFontContainerRef * oContainer) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8,message="Use CTFontCopyAttribute() with kCTFontURLAttribute."))); +extern OSStatus +ATSFontGetContainer( + ATSFontRef iFont, + ATSOptionFlags iOptions, + ATSFontContainerRef * oContainer) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8,message="Use CTFontCopyAttribute() with kCTFontURLAttribute."))); +extern OSStatus +ATSFontSetEnabled( + ATSFontRef iFont, + ATSOptionFlags iOptions, + Boolean iEnabled) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8,message="Use CTFontManagerEnableFontDescriptors()"))); +extern Boolean +ATSFontIsEnabled(ATSFontRef iFont) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8,message="Use CTFontCopyAttribute() with kCTFontEnabledAttribute"))); +extern OSStatus +ATSFontFamilyApplyFunction( + ATSFontFamilyApplierFunction iFunction, + void * iRefCon) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Use CTFontManagerCopyAvailableFontFamilyNames()"))); +extern OSStatus +ATSFontFamilyIteratorCreate( + ATSFontContext iContext, + const ATSFontFilter * iFilter, + void * iRefCon, + ATSOptionFlags iOptions, + ATSFontFamilyIterator * ioIterator) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Use CTFontManagerCopyAvailableFontFamilyNames()"))); +extern OSStatus +ATSFontFamilyIteratorRelease(ATSFontFamilyIterator * ioIterator) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus +ATSFontFamilyIteratorReset( + ATSFontContext iContext, + const ATSFontFilter * iFilter, + void * iRefCon, + ATSOptionFlags iOptions, + ATSFontFamilyIterator * ioIterator) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus +ATSFontFamilyIteratorNext( + ATSFontFamilyIterator iIterator, + ATSFontFamilyRef * oFamily) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ATSFontFamilyRef +ATSFontFamilyFindFromName( + CFStringRef iName, + ATSOptionFlags iOptions) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Use CTFontDescriptorCreateMatchingFontDescriptors() with kCTFontFamilyNameAttribute"))); +extern ATSGeneration +ATSFontFamilyGetGeneration(ATSFontFamilyRef iFamily) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Register for kCTFontManagerRegisteredFontsChangedNotification notifications"))); +extern OSStatus +ATSFontFamilyGetName( + ATSFontFamilyRef iFamily, + ATSOptionFlags iOptions, + CFStringRef * oName) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Use CTFontCopyFamilyName()"))); +extern TextEncoding +ATSFontFamilyGetEncoding(ATSFontFamilyRef iFamily) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Use CTFontGetStringEncoding()"))); +extern OSStatus +ATSFontApplyFunction( + ATSFontApplierFunction iFunction, + void * iRefCon) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Use CTFontCollectionCreateFromAvailableFonts()"))); +extern OSStatus +ATSFontIteratorCreate( + ATSFontContext iContext, + const ATSFontFilter * iFilter, + void * iRefCon, + ATSOptionFlags iOptions, + ATSFontIterator * ioIterator) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Use CTFontCollectionCreateFromAvailableFonts()"))); +extern OSStatus +ATSFontIteratorRelease(ATSFontIterator * ioIterator) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus +ATSFontIteratorReset( + ATSFontContext iContext, + const ATSFontFilter * iFilter, + void * iRefCon, + ATSOptionFlags iOptions, + ATSFontIterator * ioIterator) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSStatus +ATSFontIteratorNext( + ATSFontIterator iIterator, + ATSFontRef * oFont) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern ATSFontRef +ATSFontFindFromName( + CFStringRef iName, + ATSOptionFlags iOptions) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Use CTFontCreateWithName()"))); +extern ATSFontRef +ATSFontFindFromPostScriptName( + CFStringRef iName, + ATSOptionFlags iOptions) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Use CTFontCreateWithName()"))); +extern OSStatus +ATSFontFindFromContainer( + ATSFontContainerRef iContainer, + ATSOptionFlags iOptions, + ItemCount iCount, + ATSFontRef ioArray[], + ItemCount * oCount) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Use CTFontDescriptorCreateMatchingFontDescriptors() with kCTFontURLAttribute or use CTFontManagerCreateFontDescriptorsFromURL()"))); +extern ATSGeneration +ATSFontGetGeneration(ATSFontRef iFont) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Register for kCTFontManagerRegisteredFontsChangedNotification notifications"))); +extern OSStatus +ATSFontGetName( + ATSFontRef iFont, + ATSOptionFlags iOptions, + CFStringRef * oName) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Use CTFontCopyFullName()"))); +extern OSStatus +ATSFontGetPostScriptName( + ATSFontRef iFont, + ATSOptionFlags iOptions, + CFStringRef * oName) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Use CTFontCopyPostScriptName()"))); +extern OSStatus +ATSFontGetTableDirectory( + ATSFontRef iFont, + ByteCount iBufferSize, + void * ioBuffer, + ByteCount * oSize) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Use CTFontCopyAvailableTables()"))); +extern OSStatus +ATSFontGetTable( + ATSFontRef iFont, + FourCharCode iTag, + ByteOffset iOffset, + ByteCount iBufferSize, + void * ioBuffer, + ByteCount * oSize) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Use CTFontCopyTable()"))); +extern OSStatus +ATSFontGetHorizontalMetrics( + ATSFontRef iFont, + ATSOptionFlags iOptions, + ATSFontMetrics * oMetrics) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Use CTFontGetXHeight(), CTFontGetAscent(), and friends to find a specific metric."))); +extern OSStatus +ATSFontGetVerticalMetrics( + ATSFontRef iFont, + ATSOptionFlags iOptions, + ATSFontMetrics * oMetrics) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Use CTFontGetXHeight(), CTFontGetAscent(), and friends to find a specific metric."))); +extern ATSFontFamilyRef +ATSFontFamilyFindFromQuickDrawName(ConstStr255Param iName) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Use CTFontCreateWithQuickdrawInstance()"))); +extern OSStatus +ATSFontFamilyGetQuickDrawName( + ATSFontFamilyRef iFamily, + Str255 oName) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="QuickDraw is deprecated"))); +extern OSStatus +ATSFontGetFileReference( + ATSFontRef iFont, + FSRef * oFile) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="Use CTFontCopyAttribute() with kCTFontURLAttribute."))); +extern OSStatus +ATSFontGetFontFamilyResource( + ATSFontRef iFont, + ByteCount iBufferSize, + void * ioBuffer, + ByteCount * oSize) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8,message="QuickDraw is deprecated"))); +extern OSStatus +ATSFontNotify( + ATSFontNotifyAction action, + void * info) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8,message="Register for kCTFontManagerRegisteredFontsChangedNotification notifications"))); +extern OSStatus +ATSFontNotificationSubscribe( + ATSNotificationCallback callback, + ATSFontNotifyOption options, + void * iRefcon, + ATSFontNotificationRef * oNotificationRef) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8,message="Register for kCTFontManagerRegisteredFontsChangedNotification notifications"))); +extern OSStatus +ATSFontNotificationUnsubscribe(ATSFontNotificationRef notificationRef) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8,message="Unregister for kCTFontManagerRegisteredFontsChangedNotification notifications"))); +struct ATSFontQuerySourceContext { + + + + + + UInt32 version; + + + + + + void * refCon; + + + + + CFAllocatorRetainCallBack retain; + + + + + CFAllocatorReleaseCallBack release; +}; +typedef struct ATSFontQuerySourceContext ATSFontQuerySourceContext; + + + + + + + +enum ATSFontQueryMessageID { + + + + + + + + kATSQueryActivateFontMessage = 'atsa' +}; +typedef enum ATSFontQueryMessageID ATSFontQueryMessageID; +typedef CFPropertyListRef ( * ATSFontQueryCallback)(ATSFontQueryMessageID msgid, CFPropertyListRef data, void *refCon); +extern CFRunLoopSourceRef +ATSCreateFontQueryRunLoopSource( + CFIndex queryOrder, + CFIndex sourceOrder, + ATSFontQueryCallback callout, + const ATSFontQuerySourceContext * context) __attribute__((availability(macosx,introduced=10.2,deprecated=10.8,message="Use CTFontManagerCreateFontRequestRunLoopSource()"))); +enum { + + + + + + + kATSFontAutoActivationDefault = 0, + kATSFontAutoActivationDisabled = 1, + kATSFontAutoActivationEnabled = 2, + + + + + + kATSFontAutoActivationAsk = 4 +}; + + +typedef UInt32 ATSFontAutoActivationSetting; +extern OSStatus +ATSFontSetGlobalAutoActivationSetting(ATSFontAutoActivationSetting iSetting) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8,message="Use CTFontManagerSetAutoActivationSetting() with kCTFontManagerBundleIdentifier"))); +extern ATSFontAutoActivationSetting +ATSFontGetGlobalAutoActivationSetting(void) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8,message="Use CTFontManagerGetAutoActivationSetting() with kCTFontManagerBundleIdentifier"))); +extern OSStatus +ATSFontSetAutoActivationSettingForApplication( + ATSFontAutoActivationSetting iSetting, + CFURLRef iApplicationFileURL) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8,message="Use CTFontManagerSetAutoActivationSetting()"))); +extern ATSFontAutoActivationSetting +ATSFontGetAutoActivationSettingForApplication(CFURLRef iApplicationFileURL) __attribute__((availability(macosx,introduced=10.5,deprecated=10.8,message="Use CTFontManagerGetAutoActivationSetting()"))); + + + + + + + + + + +typedef const struct ColorSyncProfile* ColorSyncProfileRef; + +typedef struct ColorSyncProfile* ColorSyncMutableProfileRef; + +__attribute__((visibility("default"))) extern CFStringRef kColorSyncGenericGrayProfile; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncGenericGrayGamma22Profile; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncGenericRGBProfile; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncGenericCMYKProfile; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncDisplayP3Profile; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSRGBProfile; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncAdobeRGB1998Profile; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncGenericLabProfile; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncGenericXYZProfile; + +__attribute__((visibility("default"))) extern CFStringRef kColorSyncACESCGLinearProfile; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncDCIP3Profile; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncITUR709Profile; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncITUR2020Profile; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncROMMRGBProfile; + +__attribute__((visibility("default"))) extern CFStringRef kColorSyncProfileHeader; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncProfileClass; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncProfileColorSpace; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncProfilePCS; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncProfileURL; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncProfileDescription; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncProfileMD5Digest; + +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigAToB0Tag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigAToB1Tag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigAToB2Tag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigBToA0Tag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigBToA1Tag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigBToA2Tag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigCmykData; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigGrayData; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigLabData; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigRgbData; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigXYZData; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigAbstractClass; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigBlueTRCTag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigBlueColorantTag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigMediaBlackPointTag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigCopyrightTag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigProfileDescriptionTag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigDeviceModelDescTag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigDeviceMfgDescTag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigGreenTRCTag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigGreenColorantTag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigGamutTag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigGrayTRCTag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigLinkClass; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigDisplayClass; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigNamedColor2Tag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigNamedColorClass; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigPreview0Tag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigPreview1Tag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigPreview2Tag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigOutputClass; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigProfileSequenceDescTag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigRedTRCTag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigRedColorantTag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigInputClass; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigColorSpaceClass; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigTechnologyTag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigViewingConditionsTag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigViewingCondDescTag; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncSigMediaWhitePointTag; + +__attribute__((visibility("default"))) extern CFStringRef kColorSyncProfileComputerDomain; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncProfileUserDomain; + + + +__attribute__((visibility("default"))) extern CFTypeID ColorSyncProfileGetTypeID(void); + + + + +__attribute__((visibility("default"))) extern ColorSyncProfileRef ColorSyncProfileCreate(CFDataRef data, CFErrorRef* error); + + + + + + + +__attribute__((visibility("default"))) extern ColorSyncProfileRef ColorSyncProfileCreateWithURL(CFURLRef url, CFErrorRef* error); + + + + + + + +__attribute__((visibility("default"))) extern ColorSyncProfileRef ColorSyncProfileCreateWithName(CFStringRef name); + + + + + + +__attribute__((visibility("default"))) extern ColorSyncProfileRef ColorSyncProfileCreateWithDisplayID (uint32_t displayID); + + + + + + +__attribute__((visibility("default"))) extern ColorSyncProfileRef ColorSyncProfileCreateDeviceProfile (CFStringRef deviceClass, CFUUIDRef deviceID, CFTypeRef profileID); +__attribute__((visibility("default"))) extern ColorSyncMutableProfileRef ColorSyncProfileCreateMutable(void); + + + + +__attribute__((visibility("default"))) extern ColorSyncMutableProfileRef ColorSyncProfileCreateMutableCopy(ColorSyncProfileRef prof); + + + + + + +__attribute__((visibility("default"))) extern ColorSyncProfileRef ColorSyncProfileCreateLink (CFArrayRef profileInfo, CFDictionaryRef options); +__attribute__((visibility("default"))) extern _Bool ColorSyncProfileVerify (ColorSyncProfileRef prof, CFErrorRef* errors, CFErrorRef* warnings); +__attribute__((visibility("default"))) extern float ColorSyncProfileEstimateGammaWithDisplayID (const int32_t displayID, CFErrorRef* error); +__attribute__((visibility("default"))) extern float ColorSyncProfileEstimateGamma (ColorSyncProfileRef prof, CFErrorRef* error); +typedef struct { uint8_t digest[16]; } ColorSyncMD5; + +__attribute__((visibility("default"))) extern ColorSyncMD5 ColorSyncProfileGetMD5(ColorSyncProfileRef prof); + + + + + + +__attribute__((visibility("default"))) extern CFDataRef ColorSyncProfileCopyData (ColorSyncProfileRef prof, CFErrorRef* error); + + + + + + + +__attribute__((visibility("default"))) extern CFURLRef ColorSyncProfileGetURL (ColorSyncProfileRef prof, CFErrorRef* error); + + + + + + + +__attribute__((visibility("default"))) extern CFDataRef ColorSyncProfileCopyHeader (ColorSyncProfileRef prof); + + + + + + +__attribute__((visibility("default"))) extern void ColorSyncProfileSetHeader (ColorSyncMutableProfileRef prof, CFDataRef header); + + + + + +__attribute__((visibility("default"))) extern CFStringRef ColorSyncProfileCopyDescriptionString (ColorSyncProfileRef prof); + + + + + + +__attribute__((visibility("default"))) extern CFArrayRef ColorSyncProfileCopyTagSignatures (ColorSyncProfileRef prof); + + + + + + +__attribute__((visibility("default"))) extern _Bool ColorSyncProfileContainsTag (ColorSyncProfileRef prof, CFStringRef signature); + + + + + + + +__attribute__((visibility("default"))) extern CFDataRef ColorSyncProfileCopyTag (ColorSyncProfileRef prof, CFStringRef signature); + + + + + + + +__attribute__((visibility("default"))) extern void ColorSyncProfileSetTag (ColorSyncMutableProfileRef prof, CFStringRef signature, CFDataRef data); + + + + + + +__attribute__((visibility("default"))) extern void ColorSyncProfileRemoveTag (ColorSyncMutableProfileRef prof, CFStringRef signature); + + + + + + + +__attribute__((visibility("default"))) extern _Bool ColorSyncProfileGetDisplayTransferFormulaFromVCGT(ColorSyncProfileRef profile, + float* redMin, float* redMax, float* redGamma, + float* greenMin, float* greenMax, float* greenGamma, + float* blueMin, float* blueMax, float* blueGamma); + + + + + +__attribute__((visibility("default"))) extern CFDataRef ColorSyncProfileCreateDisplayTransferTablesFromVCGT(ColorSyncProfileRef profile, size_t *nSamplesPerChannel); +typedef _Bool (*ColorSyncProfileIterateCallback)(CFDictionaryRef profileInfo, void* userInfo); + + + + + + +__attribute__((visibility("default"))) extern void ColorSyncIterateInstalledProfiles (ColorSyncProfileIterateCallback callBack, + uint32_t * seed, + void* userInfo, + CFErrorRef* error); + + + + + + + +__attribute__((visibility("default"))) extern _Bool ColorSyncProfileInstall(ColorSyncProfileRef profile, CFStringRef domain, CFStringRef subpath, CFErrorRef* error); +__attribute__((visibility("default"))) extern _Bool ColorSyncProfileUninstall(ColorSyncProfileRef profile, CFErrorRef* error); +typedef struct ColorSyncTransform* ColorSyncTransformRef; + +__attribute__((visibility("default"))) extern CFTypeID ColorSyncTransformGetTypeID(void); + + + + +__attribute__((visibility("default"))) extern ColorSyncTransformRef ColorSyncTransformCreate (CFArrayRef profileSequence, CFDictionaryRef options); +__attribute__((visibility("default"))) extern CFTypeRef ColorSyncTransformCopyProperty(ColorSyncTransformRef transform, CFTypeRef key, CFDictionaryRef options); + + + + + + +__attribute__((visibility("default"))) extern void ColorSyncTransformSetProperty(ColorSyncTransformRef transform, CFTypeRef key, CFTypeRef property); + + + + + + +enum ColorSyncDataDepth { + kColorSync1BitGamut = 1, + kColorSync8BitInteger = 2, + kColorSync16BitInteger = 3, + kColorSync16BitFloat = 4, + kColorSync32BitInteger = 5, + kColorSync32BitNamedColorIndex = 6, + kColorSync32BitFloat = 7, + kColorSync10BitInteger = 8 +}; + +typedef enum ColorSyncDataDepth ColorSyncDataDepth; + +enum ColorSyncAlphaInfo { + kColorSyncAlphaNone, + kColorSyncAlphaPremultipliedLast, + kColorSyncAlphaPremultipliedFirst, + kColorSyncAlphaLast, + kColorSyncAlphaFirst, + kColorSyncAlphaNoneSkipLast, + kColorSyncAlphaNoneSkipFirst, +}; + +typedef enum ColorSyncAlphaInfo ColorSyncAlphaInfo; + +enum { + kColorSyncAlphaInfoMask = 0x1F, + + kColorSyncByteOrderMask = 0x7000, + kColorSyncByteOrderDefault = (0 << 12), + kColorSyncByteOrder16Little = (1 << 12), + kColorSyncByteOrder32Little = (2 << 12), + kColorSyncByteOrder16Big = (3 << 12), + kColorSyncByteOrder32Big = (4 << 12) +}; + + +typedef uint32_t ColorSyncDataLayout; + +__attribute__((visibility("default"))) extern _Bool ColorSyncTransformConvert (ColorSyncTransformRef transform, size_t width, size_t height, + void* dst, ColorSyncDataDepth dstDepth, + ColorSyncDataLayout dstLayout, size_t dstBytesPerRow, + const void* src, ColorSyncDataDepth srcDepth, + ColorSyncDataLayout srcLayout, size_t srcBytesPerRow, + CFDictionaryRef options); +__attribute__((visibility("default"))) extern CFStringRef kColorSyncProfile; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncRenderingIntent; + + + __attribute__((visibility("default"))) extern CFStringRef kColorSyncRenderingIntentPerceptual; + __attribute__((visibility("default"))) extern CFStringRef kColorSyncRenderingIntentRelative; + __attribute__((visibility("default"))) extern CFStringRef kColorSyncRenderingIntentSaturation; + __attribute__((visibility("default"))) extern CFStringRef kColorSyncRenderingIntentAbsolute; + __attribute__((visibility("default"))) extern CFStringRef kColorSyncRenderingIntentUseProfileHeader; + +__attribute__((visibility("default"))) extern CFStringRef kColorSyncTransformTag; + + + __attribute__((visibility("default"))) extern CFStringRef kColorSyncTransformDeviceToPCS; + __attribute__((visibility("default"))) extern CFStringRef kColorSyncTransformPCSToPCS; + __attribute__((visibility("default"))) extern CFStringRef kColorSyncTransformPCSToDevice; + __attribute__((visibility("default"))) extern CFStringRef kColorSyncTransformDeviceToDevice; + __attribute__((visibility("default"))) extern CFStringRef kColorSyncTransformGamutCheck; + +__attribute__((visibility("default"))) extern CFStringRef kColorSyncBlackPointCompensation; + + +__attribute__((visibility("default"))) extern CFStringRef kColorSyncPreferredCMM; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncConvertQuality; + + + __attribute__((visibility("default"))) extern CFStringRef kColorSyncBestQuality; + __attribute__((visibility("default"))) extern CFStringRef kColorSyncNormalQuality; + __attribute__((visibility("default"))) extern CFStringRef kColorSyncDraftQuality; + + +__attribute__((visibility("default"))) extern CFStringRef kColorSyncConvertThreadCount; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncConvertUseVectorUnit; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncConvertUseExtendedRange; + + + +__attribute__((visibility("default"))) extern CFStringRef kColorSyncTranformInfo; + __attribute__((visibility("default"))) extern CFStringRef kColorSyncTransformCreator; + __attribute__((visibility("default"))) extern CFStringRef kColorSyncTransformSrcSpace; + __attribute__((visibility("default"))) extern CFStringRef kColorSyncTransformDstSpace; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncTransformCodeFragmentType; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncTransformFullConversionData; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncTransformSimplifiedConversionData; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncTransformParametricConversionData; + + + + + + +__attribute__((visibility("default"))) extern CFStringRef kColorSyncConversionMatrix; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncConversionParamCurve0; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncConversionParamCurve1; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncConversionParamCurve2; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncConversionParamCurve3; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncConversionParamCurve4; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncConversion1DLut; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncConversionGridPoints; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncConversionChannelID; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncConversion3DLut; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncConversionNDLut; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncConversionInpChan; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncConversionOutChan; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncConversionBPC; + +__attribute__((visibility("default"))) extern CFStringRef kColorSyncFixedPointRange; +typedef struct ColorSyncCMM* ColorSyncCMMRef; + +__attribute__((visibility("default"))) extern CFTypeID ColorSyncCMMGetTypeID(void); + + + + +__attribute__((visibility("default"))) extern ColorSyncCMMRef ColorSyncCMMCreate(CFBundleRef cmmBundle); + +__attribute__((visibility("default"))) extern CFBundleRef ColorSyncCMMGetBundle(ColorSyncCMMRef); + +__attribute__((visibility("default"))) extern CFStringRef ColorSyncCMMCopyLocalizedName(ColorSyncCMMRef); + +__attribute__((visibility("default"))) extern CFStringRef ColorSyncCMMCopyCMMIdentifier(ColorSyncCMMRef); + +typedef _Bool (*ColorSyncCMMIterateCallback)(ColorSyncCMMRef cmm, void* userInfo); + + + + + +__attribute__((visibility("default"))) extern void ColorSyncIterateInstalledCMMs (ColorSyncCMMIterateCallback callBack, void* userInfo); +typedef _Bool (*CMMInitializeLinkProfileProc) (ColorSyncMutableProfileRef, CFArrayRef profileInfo, CFDictionaryRef options); + +typedef _Bool (*CMMInitializeTransformProc) (ColorSyncTransformRef, CFArrayRef profileInfo, CFDictionaryRef options); + +typedef _Bool (*CMMApplyTransformProc)(ColorSyncTransformRef transform, size_t width, size_t height, + size_t dstPlanes, void* dst[], ColorSyncDataDepth dstDepth, + ColorSyncDataLayout dstFormat, size_t dstBytesPerRow, + size_t srcPlanes, const void* src[], ColorSyncDataDepth srcDepth, + ColorSyncDataLayout srcFormat, size_t srcBytesPerRow, + CFDictionaryRef options); + +typedef CFTypeRef (*CMMCreateTransformPropertyProc)(ColorSyncTransformRef transform, CFTypeRef key, CFDictionaryRef options); + +__attribute__((visibility("default"))) extern CFStringRef kCMMInitializeLinkProfileProcName; +__attribute__((visibility("default"))) extern CFStringRef kCMMInitializeTransformProcName; +__attribute__((visibility("default"))) extern CFStringRef kCMMApplyTransformProcName; +__attribute__((visibility("default"))) extern CFStringRef kCMMCreateTransformPropertyProcName; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncDeviceID; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncDeviceClass; + __attribute__((visibility("default"))) extern CFStringRef kColorSyncCameraDeviceClass; + __attribute__((visibility("default"))) extern CFStringRef kColorSyncDisplayDeviceClass; + __attribute__((visibility("default"))) extern CFStringRef kColorSyncPrinterDeviceClass; + __attribute__((visibility("default"))) extern CFStringRef kColorSyncScannerDeviceClass; + +__attribute__((visibility("default"))) extern CFStringRef kColorSyncDeviceProfileURL; + +__attribute__((visibility("default"))) extern CFStringRef kColorSyncDeviceDescription; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncDeviceDescriptions; + +__attribute__((visibility("default"))) extern CFStringRef kColorSyncFactoryProfiles; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncCustomProfiles; + +__attribute__((visibility("default"))) extern CFStringRef kColorSyncDeviceModeDescription; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncDeviceModeDescriptions; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncDeviceDefaultProfileID; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncDeviceHostScope; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncDeviceUserScope; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncProfileHostScope; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncProfileUserScope; + +__attribute__((visibility("default"))) extern CFStringRef kColorSyncDeviceProfileIsFactory; + +__attribute__((visibility("default"))) extern CFStringRef kColorSyncDeviceProfileIsDefault; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncDeviceProfileIsCurrent; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncDeviceProfileID; + +__attribute__((visibility("default"))) extern CFStringRef kColorSyncDeviceRegisteredNotification; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncDeviceUnregisteredNotification; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncDeviceProfilesNotification; +__attribute__((visibility("default"))) extern CFStringRef kColorSyncDisplayDeviceProfilesNotification; + +__attribute__((visibility("default"))) extern _Bool ColorSyncRegisterDevice (CFStringRef deviceClass, CFUUIDRef deviceID, CFDictionaryRef deviceInfo); +__attribute__((visibility("default"))) extern _Bool ColorSyncUnregisterDevice (CFStringRef deviceClass, CFUUIDRef deviceID); + + + + + + +__attribute__((visibility("default"))) extern _Bool ColorSyncDeviceSetCustomProfiles (CFStringRef deviceClass, CFUUIDRef deviceID, CFDictionaryRef profileInfo); +__attribute__((visibility("default"))) extern CFDictionaryRef ColorSyncDeviceCopyDeviceInfo (CFStringRef deviceClass, CFUUIDRef devID); +typedef _Bool (*ColorSyncDeviceProfileIterateCallback) (CFDictionaryRef colorSyncDeviceProfileInfo, + void* userInfo); +__attribute__((visibility("default"))) extern void ColorSyncIterateDeviceProfiles(ColorSyncDeviceProfileIterateCallback callBack, + void* userInfo); + + __attribute__((visibility("default"))) extern CFUUIDRef CGDisplayCreateUUIDFromDisplayID (uint32_t displayID); + + + + + __attribute__((visibility("default"))) extern uint32_t CGDisplayGetDisplayIDFromUUID (CFUUIDRef uuid); + + + + + + + + + + +typedef struct CGAffineTransform CGAffineTransform; + + + + + + +struct CGAffineTransform { + CGFloat a, b, c, d; + CGFloat tx, ty; +}; + + + +extern const CGAffineTransform CGAffineTransformIdentity + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGAffineTransform CGAffineTransformMake(CGFloat a, CGFloat b, + CGFloat c, CGFloat d, CGFloat tx, CGFloat ty) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGAffineTransform CGAffineTransformMakeTranslation(CGFloat tx, + CGFloat ty) __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGAffineTransform CGAffineTransformMakeScale(CGFloat sx, CGFloat sy) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGAffineTransform CGAffineTransformMakeRotation(CGFloat angle) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern _Bool CGAffineTransformIsIdentity(CGAffineTransform t) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CGAffineTransform CGAffineTransformTranslate(CGAffineTransform t, + CGFloat tx, CGFloat ty) __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGAffineTransform CGAffineTransformScale(CGAffineTransform t, + CGFloat sx, CGFloat sy) __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGAffineTransform CGAffineTransformRotate(CGAffineTransform t, + CGFloat angle) __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGAffineTransform CGAffineTransformInvert(CGAffineTransform t) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGAffineTransform CGAffineTransformConcat(CGAffineTransform t1, + CGAffineTransform t2) __attribute__((availability(macosx,introduced=10.0))); + + + +extern _Bool CGAffineTransformEqualToTransform(CGAffineTransform t1, + CGAffineTransform t2) __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern CGPoint CGPointApplyAffineTransform(CGPoint point, + CGAffineTransform t) __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern CGSize CGSizeApplyAffineTransform(CGSize size, CGAffineTransform t) + __attribute__((availability(macosx,introduced=10.0))); +extern CGRect CGRectApplyAffineTransform(CGRect rect, CGAffineTransform t) + __attribute__((availability(macosx,introduced=10.4))); + + + +static inline CGAffineTransform +__CGAffineTransformMake(CGFloat a, CGFloat b, CGFloat c, CGFloat d, + CGFloat tx, CGFloat ty) +{ + CGAffineTransform t; + t.a = a; t.b = b; t.c = c; t.d = d; t.tx = tx; t.ty = ty; + return t; +} + + +static inline CGPoint +__CGPointApplyAffineTransform(CGPoint point, CGAffineTransform t) +{ + CGPoint p; + p.x = (CGFloat)((double)t.a * point.x + (double)t.c * point.y + t.tx); + p.y = (CGFloat)((double)t.b * point.x + (double)t.d * point.y + t.ty); + return p; +} + + +static inline CGSize +__CGSizeApplyAffineTransform(CGSize size, CGAffineTransform t) +{ + CGSize s; + s.width = (CGFloat)((double)t.a * size.width + (double)t.c * size.height); + s.height = (CGFloat)((double)t.b * size.width + (double)t.d * size.height); + return s; +} + + + + + + + + +typedef struct CGContext *CGContextRef; + + + + +typedef struct CGColor *CGColorRef; + + + +typedef struct CGColorSpace *CGColorSpaceRef; + + + +typedef struct CGDataProvider *CGDataProviderRef; +typedef size_t (*CGDataProviderGetBytesCallback)(void * _Nullable info, + void * buffer, size_t count); + + + + + +typedef off_t (*CGDataProviderSkipForwardCallback)(void * _Nullable info, + off_t count); + + + + +typedef void (*CGDataProviderRewindCallback)(void * _Nullable info); + + + + +typedef void (*CGDataProviderReleaseInfoCallback)(void * _Nullable info); +struct CGDataProviderSequentialCallbacks { + unsigned int version; + CGDataProviderGetBytesCallback _Nullable getBytes; + CGDataProviderSkipForwardCallback _Nullable skipForward; + CGDataProviderRewindCallback _Nullable rewind; + CGDataProviderReleaseInfoCallback _Nullable releaseInfo; +}; +typedef struct CGDataProviderSequentialCallbacks + CGDataProviderSequentialCallbacks; + + + +typedef const void * _Nullable(*CGDataProviderGetBytePointerCallback)( + void * _Nullable info); + + + + +typedef void (*CGDataProviderReleaseBytePointerCallback)( + void * _Nullable info, const void * pointer); + + + + +typedef size_t (*CGDataProviderGetBytesAtPositionCallback)( + void * _Nullable info, void * buffer, off_t pos, size_t cnt); +struct CGDataProviderDirectCallbacks { + unsigned int version; + CGDataProviderGetBytePointerCallback _Nullable getBytePointer; + CGDataProviderReleaseBytePointerCallback _Nullable releaseBytePointer; + CGDataProviderGetBytesAtPositionCallback _Nullable getBytesAtPosition; + CGDataProviderReleaseInfoCallback _Nullable releaseInfo; +}; +typedef struct CGDataProviderDirectCallbacks CGDataProviderDirectCallbacks; + + + +extern CFTypeID CGDataProviderGetTypeID(void) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern CGDataProviderRef _Nullable CGDataProviderCreateSequential( + void * _Nullable info, + const CGDataProviderSequentialCallbacks * _Nullable callbacks) + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern CGDataProviderRef _Nullable CGDataProviderCreateDirect( + void * _Nullable info, off_t size, + const CGDataProviderDirectCallbacks * _Nullable callbacks) + __attribute__((availability(macosx,introduced=10.5))); + + + +typedef void (*CGDataProviderReleaseDataCallback)(void * _Nullable info, + const void * data, size_t size); + + + + + +extern CGDataProviderRef _Nullable CGDataProviderCreateWithData( + void * _Nullable info, const void * _Nullable data, size_t size, + CGDataProviderReleaseDataCallback _Nullable releaseData) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGDataProviderRef _Nullable CGDataProviderCreateWithCFData( + CFDataRef _Nullable data) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CGDataProviderRef _Nullable CGDataProviderCreateWithURL( + CFURLRef _Nullable url) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGDataProviderRef _Nullable CGDataProviderCreateWithFilename( + const char * _Nullable filename) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGDataProviderRef _Nullable CGDataProviderRetain( + CGDataProviderRef _Nullable provider) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGDataProviderRelease(CGDataProviderRef _Nullable provider) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern CFDataRef _Nullable CGDataProviderCopyData( + CGDataProviderRef _Nullable provider) + __attribute__((availability(macosx,introduced=10.3))); + + + + + +typedef int32_t CGColorRenderingIntent; enum { + kCGRenderingIntentDefault, + kCGRenderingIntentAbsoluteColorimetric, + kCGRenderingIntentRelativeColorimetric, + kCGRenderingIntentPerceptual, + kCGRenderingIntentSaturation +}; + + + +typedef int32_t CGColorSpaceModel; enum { + kCGColorSpaceModelUnknown = -1, + kCGColorSpaceModelMonochrome, + kCGColorSpaceModelRGB, + kCGColorSpaceModelCMYK, + kCGColorSpaceModelLab, + kCGColorSpaceModelDeviceN, + kCGColorSpaceModelIndexed, + kCGColorSpaceModelPattern +}; +extern const CFStringRef kCGColorSpaceGenericGray + __attribute__((availability(macosx,introduced=10.4))); + + + + + + + +extern const CFStringRef kCGColorSpaceGenericRGB + __attribute__((availability(macosx,introduced=10.4))); + + + +extern const CFStringRef kCGColorSpaceGenericCMYK + __attribute__((availability(macosx,introduced=10.4))); + +extern const CFStringRef kCGColorSpaceDisplayP3 + __attribute__((availability(macosx,introduced=10.11.2))); + + + + +extern const CFStringRef kCGColorSpaceGenericRGBLinear + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCGColorSpaceAdobeRGB1998 + __attribute__((availability(macosx,introduced=10.5))); + + + + + + + +extern const CFStringRef kCGColorSpaceSRGB + __attribute__((availability(macosx,introduced=10.5))); + + + +extern const CFStringRef kCGColorSpaceGenericGrayGamma2_2 + __attribute__((availability(macosx,introduced=10.6))); + +extern const CFStringRef kCGColorSpaceGenericXYZ + __attribute__((availability(macosx,introduced=10.11))); + +extern const CFStringRef kCGColorSpaceACESCGLinear +__attribute__((availability(macosx,introduced=10.11))); + +extern const CFStringRef kCGColorSpaceITUR_709 +__attribute__((availability(macosx,introduced=10.11))); + +extern const CFStringRef kCGColorSpaceITUR_2020 +__attribute__((availability(macosx,introduced=10.11))); + +extern const CFStringRef kCGColorSpaceROMMRGB +__attribute__((availability(macosx,introduced=10.11))); + +extern const CFStringRef kCGColorSpaceDCIP3 +__attribute__((availability(macosx,introduced=10.11))); +extern const CFStringRef kCGColorSpaceExtendedSRGB +__attribute__((availability(macosx,introduced=10.12))); + + + +extern const CFStringRef kCGColorSpaceLinearSRGB +__attribute__((availability(macosx,introduced=10.12))); + + + +extern const CFStringRef kCGColorSpaceExtendedLinearSRGB +__attribute__((availability(macosx,introduced=10.12))); + + + + + +extern const CFStringRef kCGColorSpaceExtendedGray +__attribute__((availability(macosx,introduced=10.12))); + + + +extern const CFStringRef kCGColorSpaceLinearGray +__attribute__((availability(macosx,introduced=10.12))); + + + +extern const CFStringRef kCGColorSpaceExtendedLinearGray +__attribute__((availability(macosx,introduced=10.12))); + + + +extern CGColorSpaceRef _Nullable CGColorSpaceCreateDeviceGray(void) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGColorSpaceRef _Nullable CGColorSpaceCreateDeviceRGB(void) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGColorSpaceRef _Nullable CGColorSpaceCreateDeviceCMYK(void) + __attribute__((availability(macosx,introduced=10.0))); + + + + + + + +extern CGColorSpaceRef _Nullable CGColorSpaceCreateCalibratedGray(const CGFloat + whitePoint[3], const CGFloat blackPoint[3], CGFloat gamma) + __attribute__((availability(macosx,introduced=10.0))); +extern CGColorSpaceRef _Nullable CGColorSpaceCreateCalibratedRGB(const CGFloat + whitePoint[3], const CGFloat blackPoint[3], const CGFloat gamma[3], + const CGFloat matrix[9]) __attribute__((availability(macosx,introduced=10.0))); +extern CGColorSpaceRef _Nullable CGColorSpaceCreateLab(const CGFloat whitePoint[3], + const CGFloat blackPoint[3], const CGFloat range[4]) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGColorSpaceRef _Nullable CGColorSpaceCreateWithICCProfile(CFDataRef _Nullable data) + __attribute__((availability(macosx,introduced=10.5))); +extern CGColorSpaceRef _Nullable CGColorSpaceCreateICCBased(size_t nComponents, + const CGFloat * _Nullable range, CGDataProviderRef _Nullable profile, + CGColorSpaceRef _Nullable alternate) + __attribute__((availability(macosx,introduced=10.0))); +extern CGColorSpaceRef _Nullable CGColorSpaceCreateIndexed(CGColorSpaceRef _Nullable baseSpace, + size_t lastIndex, const unsigned char * _Nullable colorTable) + __attribute__((availability(macosx,introduced=10.0))); + + + + + + +extern CGColorSpaceRef _Nullable CGColorSpaceCreatePattern(CGColorSpaceRef _Nullable baseSpace) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGColorSpaceRef _Nullable + CGColorSpaceCreateWithPlatformColorSpace(const void * _Nullable ref) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGColorSpaceRef _Nullable CGColorSpaceCreateWithName(CFStringRef _Nullable name) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern CGColorSpaceRef _Nullable CGColorSpaceRetain(CGColorSpaceRef _Nullable space) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGColorSpaceRelease(CGColorSpaceRef _Nullable space) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CFStringRef _Nullable CGColorSpaceCopyName(CGColorSpaceRef _Nullable space) + __attribute__((availability(macosx,introduced=10.6))); + + + +extern CFTypeID CGColorSpaceGetTypeID(void) + __attribute__((availability(macosx,introduced=10.2))); + + + +extern size_t CGColorSpaceGetNumberOfComponents(CGColorSpaceRef _Nullable space) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGColorSpaceModel CGColorSpaceGetModel(CGColorSpaceRef _Nullable space) + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern CGColorSpaceRef _Nullable CGColorSpaceGetBaseColorSpace(CGColorSpaceRef _Nullable space) + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern size_t CGColorSpaceGetColorTableCount(CGColorSpaceRef _Nullable space) + __attribute__((availability(macosx,introduced=10.5))); +extern void CGColorSpaceGetColorTable(CGColorSpaceRef _Nullable space, + uint8_t * _Nullable table) __attribute__((availability(macosx,introduced=10.5))); + + + + +extern CFDataRef _Nullable CGColorSpaceCopyICCProfile(CGColorSpaceRef _Nullable space); + + + +extern CFDataRef _Nullable CGColorSpaceCopyICCData(CGColorSpaceRef _Nullable space) +__attribute__((availability(macosx,introduced=10.12))); + + + +extern _Bool CGColorSpaceIsWideGamutRGB(CGColorSpaceRef) +__attribute__((availability(macosx,introduced=10.12))); + + + + +extern _Bool CGColorSpaceSupportsOutput(CGColorSpaceRef space) +__attribute__((availability(macosx,introduced=10.12))); + + + + + + + +typedef struct CGPattern *CGPatternRef; + + + +typedef int32_t CGPatternTiling; enum { + kCGPatternTilingNoDistortion, + kCGPatternTilingConstantSpacingMinimalDistortion, + kCGPatternTilingConstantSpacing +}; +typedef void (*CGPatternDrawPatternCallback)(void * _Nullable info, + CGContextRef _Nullable context); +typedef void (*CGPatternReleaseInfoCallback)(void * _Nullable info); + +struct CGPatternCallbacks { + unsigned int version; + CGPatternDrawPatternCallback _Nullable drawPattern; + CGPatternReleaseInfoCallback _Nullable releaseInfo; +}; +typedef struct CGPatternCallbacks CGPatternCallbacks; + + + +extern CFTypeID CGPatternGetTypeID(void) + __attribute__((availability(macosx,introduced=10.2))); + + + +extern CGPatternRef _Nullable CGPatternCreate(void * _Nullable info, + CGRect bounds, CGAffineTransform matrix, CGFloat xStep, CGFloat yStep, + CGPatternTiling tiling, _Bool isColored, + const CGPatternCallbacks * _Nullable callbacks) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGPatternRef _Nullable CGPatternRetain(CGPatternRef _Nullable pattern) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGPatternRelease(CGPatternRef _Nullable pattern) + __attribute__((availability(macosx,introduced=10.0))); +extern CGColorRef _Nullable CGColorCreate(CGColorSpaceRef _Nullable space, + const CGFloat * _Nullable components) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern CGColorRef CGColorCreateGenericGray(CGFloat gray, CGFloat alpha) + __attribute__((availability(macosx,introduced=10.5))); + + + +extern CGColorRef CGColorCreateGenericRGB(CGFloat red, CGFloat green, + CGFloat blue, CGFloat alpha) __attribute__((availability(macosx,introduced=10.5))); + + + +extern CGColorRef CGColorCreateGenericCMYK(CGFloat cyan, CGFloat magenta, + CGFloat yellow, CGFloat black, CGFloat alpha) + __attribute__((availability(macosx,introduced=10.5))); +extern CGColorRef _Nullable CGColorGetConstantColor(CFStringRef _Nullable colorName) + __attribute__((availability(macosx,introduced=10.5))); + + + + +extern CGColorRef _Nullable CGColorCreateWithPattern(CGColorSpaceRef _Nullable space, + CGPatternRef _Nullable pattern, const CGFloat * _Nullable components) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern CGColorRef _Nullable CGColorCreateCopy(CGColorRef _Nullable color) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern CGColorRef _Nullable CGColorCreateCopyWithAlpha(CGColorRef _Nullable color, + CGFloat alpha) __attribute__((availability(macosx,introduced=10.3))); + + + +extern CGColorRef _Nullable CGColorCreateCopyByMatchingToColorSpace(_Nullable CGColorSpaceRef, + CGColorRenderingIntent intent, CGColorRef _Nullable color, _Nullable CFDictionaryRef options) + __attribute__((availability(macosx,introduced=10.11))); + + + + +extern CGColorRef _Nullable CGColorRetain(CGColorRef _Nullable color) + __attribute__((availability(macosx,introduced=10.3))); + + + + +extern void CGColorRelease(CGColorRef _Nullable color) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern _Bool CGColorEqualToColor(CGColorRef _Nullable color1, CGColorRef _Nullable color2) + __attribute__((availability(macosx,introduced=10.3))); + + + + +extern size_t CGColorGetNumberOfComponents(CGColorRef _Nullable color) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern const CGFloat * _Nullable CGColorGetComponents(CGColorRef _Nullable color) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern CGFloat CGColorGetAlpha(CGColorRef _Nullable color) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern CGColorSpaceRef _Nullable CGColorGetColorSpace(CGColorRef _Nullable color) + __attribute__((availability(macosx,introduced=10.3))); + + + + +extern CGPatternRef _Nullable CGColorGetPattern(CGColorRef _Nullable color) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern CFTypeID CGColorGetTypeID(void) + __attribute__((availability(macosx,introduced=10.3))); + + + + + +extern const CFStringRef kCGColorWhite + __attribute__((availability(macosx,introduced=10.5))); + +extern const CFStringRef kCGColorBlack + __attribute__((availability(macosx,introduced=10.5))); + +extern const CFStringRef kCGColorClear + __attribute__((availability(macosx,introduced=10.5))); + +typedef struct CGFont *CGFontRef; + + + +typedef unsigned short CGFontIndex; + + + +typedef CGFontIndex CGGlyph; + + + + + + +typedef int32_t CGFontPostScriptFormat; enum { + kCGFontPostScriptFormatType1 = 1, + kCGFontPostScriptFormatType3 = 3, + kCGFontPostScriptFormatType42 = 42 +}; +static const CGFontIndex kCGFontIndexMax = ((1 << 16) - 2); + + +static const CGFontIndex kCGFontIndexInvalid = ((1 << 16) - 1); + + +static const CGFontIndex kCGGlyphMax = kCGFontIndexMax; + + + +extern CFTypeID CGFontGetTypeID(void) + __attribute__((availability(macosx,introduced=10.2))); + + + + + +extern CGFontRef _Nullable CGFontCreateWithPlatformFont( + void * _Nullable platformFontReference) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + + + +extern CGFontRef _Nullable CGFontCreateWithDataProvider( + CGDataProviderRef _Nullable provider) + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern CGFontRef _Nullable CGFontCreateWithFontName( + CFStringRef _Nullable name) + __attribute__((availability(macosx,introduced=10.5))); +extern CGFontRef _Nullable CGFontCreateCopyWithVariations( + CGFontRef _Nullable font, CFDictionaryRef _Nullable variations) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CGFontRef _Nullable CGFontRetain(CGFontRef _Nullable font) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGFontRelease(CGFontRef _Nullable font) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern size_t CGFontGetNumberOfGlyphs(CGFontRef _Nullable font) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern int CGFontGetUnitsPerEm(CGFontRef _Nullable font) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CFStringRef _Nullable CGFontCopyPostScriptName(CGFontRef _Nullable font) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CFStringRef _Nullable CGFontCopyFullName(CGFontRef _Nullable font) + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern int CGFontGetAscent(CGFontRef _Nullable font) + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern int CGFontGetDescent(CGFontRef _Nullable font) + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern int CGFontGetLeading(CGFontRef _Nullable font) + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern int CGFontGetCapHeight(CGFontRef _Nullable font) + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern int CGFontGetXHeight(CGFontRef _Nullable font) + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern CGRect CGFontGetFontBBox(CGFontRef _Nullable font) + __attribute__((availability(macosx,introduced=10.5))); + + + + +extern CGFloat CGFontGetItalicAngle(CGFontRef _Nullable font) + __attribute__((availability(macosx,introduced=10.5))); + + + + +extern CGFloat CGFontGetStemV(CGFontRef _Nullable font) + __attribute__((availability(macosx,introduced=10.5))); + + + + + + +extern CFArrayRef _Nullable CGFontCopyVariationAxes(CGFontRef _Nullable font) + __attribute__((availability(macosx,introduced=10.4))); +extern CFDictionaryRef _Nullable CGFontCopyVariations(CGFontRef _Nullable font) + __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern _Bool CGFontGetGlyphAdvances(CGFontRef _Nullable font, + const CGGlyph * glyphs, size_t count, int * advances) + __attribute__((availability(macosx,introduced=10.0))); + + + + + + + +extern _Bool CGFontGetGlyphBBoxes(CGFontRef _Nullable font, + const CGGlyph * glyphs, size_t count, CGRect * bboxes) + __attribute__((availability(macosx,introduced=10.5))); + + + + +extern CGGlyph CGFontGetGlyphWithGlyphName( + CGFontRef _Nullable font, CFStringRef _Nullable name) + __attribute__((availability(macosx,introduced=10.5))); + + + + +extern CFStringRef _Nullable CGFontCopyGlyphNameForGlyph( + CGFontRef _Nullable font, CGGlyph glyph) + __attribute__((availability(macosx,introduced=10.5))); + + + + +extern _Bool CGFontCanCreatePostScriptSubset(CGFontRef _Nullable font, + CGFontPostScriptFormat format) + __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern CFDataRef _Nullable CGFontCreatePostScriptSubset( + CGFontRef _Nullable font, CFStringRef _Nullable subsetName, + CGFontPostScriptFormat format, const CGGlyph * _Nullable glyphs, + size_t count, const CGGlyph encoding[256]) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CFDataRef _Nullable CGFontCreatePostScriptEncoding( + CGFontRef _Nullable font, const CGGlyph encoding[256]) + __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern CFArrayRef _Nullable CGFontCopyTableTags(CGFontRef _Nullable font) + __attribute__((availability(macosx,introduced=10.5))); + + + + +extern CFDataRef _Nullable CGFontCopyTableForTag( + CGFontRef _Nullable font, uint32_t tag) + __attribute__((availability(macosx,introduced=10.5))); + + + + + + + +extern const CFStringRef kCGFontVariationAxisName + __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern const CFStringRef kCGFontVariationAxisMinValue + __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern const CFStringRef kCGFontVariationAxisMaxValue + __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern const CFStringRef kCGFontVariationAxisDefaultValue + __attribute__((availability(macosx,introduced=10.4))); + + + +typedef int32_t CGGlyphDeprecatedEnum; enum { + CGGlyphMin __attribute__((deprecated)), + CGGlyphMax __attribute__((deprecated)) +}; + + + + + + + +typedef struct CGGradient *CGGradientRef; + + + + + + +typedef uint32_t CGGradientDrawingOptions; enum { + kCGGradientDrawsBeforeStartLocation = (1 << 0), + kCGGradientDrawsAfterEndLocation = (1 << 1) +}; + + + + +extern CFTypeID CGGradientGetTypeID(void) + __attribute__((availability(macosx,introduced=10.5))); +extern CGGradientRef _Nullable CGGradientCreateWithColorComponents( + CGColorSpaceRef _Nullable space, const CGFloat * _Nullable components, + const CGFloat * _Nullable locations, size_t count) + __attribute__((availability(macosx,introduced=10.5))); +extern CGGradientRef _Nullable CGGradientCreateWithColors( + CGColorSpaceRef _Nullable space, CFArrayRef _Nullable colors, + const CGFloat * _Nullable locations) + __attribute__((availability(macosx,introduced=10.5))); + + + + +extern CGGradientRef _Nullable CGGradientRetain( + CGGradientRef _Nullable gradient) + __attribute__((availability(macosx,introduced=10.5))); + + + + +extern void CGGradientRelease(CGGradientRef _Nullable gradient) + __attribute__((availability(macosx,introduced=10.5))); +typedef struct CGImage *CGImageRef; +typedef uint32_t CGImageAlphaInfo; enum { + kCGImageAlphaNone, + kCGImageAlphaPremultipliedLast, + kCGImageAlphaPremultipliedFirst, + kCGImageAlphaLast, + kCGImageAlphaFirst, + kCGImageAlphaNoneSkipLast, + kCGImageAlphaNoneSkipFirst, + kCGImageAlphaOnly +}; + +typedef uint32_t CGImageByteOrderInfo; enum { + kCGImageByteOrderMask = 0x7000, + kCGImageByteOrder16Little = (1 << 12), + kCGImageByteOrder32Little = (2 << 12), + kCGImageByteOrder16Big = (3 << 12), + kCGImageByteOrder32Big = (4 << 12) +} __attribute__((availability(macosx,introduced=10.12))); + +typedef uint32_t CGBitmapInfo; enum { + kCGBitmapAlphaInfoMask = 0x1F, + + kCGBitmapFloatInfoMask = 0xF00, + kCGBitmapFloatComponents = (1 << 8), + + kCGBitmapByteOrderMask = kCGImageByteOrderMask, + kCGBitmapByteOrderDefault = (0 << 12), + kCGBitmapByteOrder16Little = kCGImageByteOrder16Little, + kCGBitmapByteOrder32Little = kCGImageByteOrder32Little, + kCGBitmapByteOrder16Big = kCGImageByteOrder16Big, + kCGBitmapByteOrder32Big = kCGImageByteOrder32Big +} __attribute__((availability(macosx,introduced=10.0))); +extern CFTypeID CGImageGetTypeID(void) + __attribute__((availability(macosx,introduced=10.2))); + + + +extern CGImageRef _Nullable CGImageCreate(size_t width, size_t height, + size_t bitsPerComponent, size_t bitsPerPixel, size_t bytesPerRow, + CGColorSpaceRef _Nullable space, CGBitmapInfo bitmapInfo, + CGDataProviderRef _Nullable provider, + const CGFloat * _Nullable decode, _Bool shouldInterpolate, + CGColorRenderingIntent intent) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGImageRef _Nullable CGImageMaskCreate(size_t width, size_t height, + size_t bitsPerComponent, size_t bitsPerPixel, size_t bytesPerRow, + CGDataProviderRef _Nullable provider, const CGFloat * _Nullable decode, + _Bool shouldInterpolate) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGImageRef _Nullable CGImageCreateCopy(CGImageRef _Nullable image) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CGImageRef _Nullable CGImageCreateWithJPEGDataProvider( + CGDataProviderRef _Nullable source, const CGFloat * _Nullable decode, + _Bool shouldInterpolate, + CGColorRenderingIntent intent) + __attribute__((availability(macosx,introduced=10.1))); + + + +extern CGImageRef _Nullable CGImageCreateWithPNGDataProvider( + CGDataProviderRef _Nullable source, const CGFloat * _Nullable decode, + _Bool shouldInterpolate, + CGColorRenderingIntent intent) + __attribute__((availability(macosx,introduced=10.2))); +extern CGImageRef _Nullable CGImageCreateWithImageInRect( + CGImageRef _Nullable image, CGRect rect) + __attribute__((availability(macosx,introduced=10.4))); +extern CGImageRef _Nullable CGImageCreateWithMask( + CGImageRef _Nullable image, CGImageRef _Nullable mask) + __attribute__((availability(macosx,introduced=10.4))); +extern CGImageRef _Nullable CGImageCreateWithMaskingColors( + CGImageRef _Nullable image, const CGFloat * _Nullable components) + __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern CGImageRef _Nullable CGImageCreateCopyWithColorSpace( + CGImageRef _Nullable image, CGColorSpaceRef _Nullable space) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern CGImageRef _Nullable CGImageRetain(CGImageRef _Nullable image) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGImageRelease(CGImageRef _Nullable image) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern _Bool CGImageIsMask(CGImageRef _Nullable image) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern size_t CGImageGetWidth(CGImageRef _Nullable image) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern size_t CGImageGetHeight(CGImageRef _Nullable image) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern size_t CGImageGetBitsPerComponent(CGImageRef _Nullable image) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern size_t CGImageGetBitsPerPixel(CGImageRef _Nullable image) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern size_t CGImageGetBytesPerRow(CGImageRef _Nullable image) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGColorSpaceRef _Nullable CGImageGetColorSpace(CGImageRef _Nullable image) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGImageAlphaInfo CGImageGetAlphaInfo(CGImageRef _Nullable image) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGDataProviderRef _Nullable CGImageGetDataProvider(CGImageRef _Nullable image) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern const CGFloat * _Nullable CGImageGetDecode(CGImageRef _Nullable image) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern _Bool CGImageGetShouldInterpolate(CGImageRef _Nullable image) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGColorRenderingIntent CGImageGetRenderingIntent(_Nullable CGImageRef image) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGBitmapInfo CGImageGetBitmapInfo(CGImageRef _Nullable image) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CFStringRef _Nullable CGImageGetUTType(_Nullable CGImageRef image) + __attribute__((availability(macosx,introduced=10.11))); +typedef struct CGPath *CGMutablePathRef; +typedef const struct CGPath *CGPathRef; +typedef int32_t CGLineJoin; enum { + kCGLineJoinMiter, + kCGLineJoinRound, + kCGLineJoinBevel +}; + + + +typedef int32_t CGLineCap; enum { + kCGLineCapButt, + kCGLineCapRound, + kCGLineCapSquare +}; + + + +extern CFTypeID CGPathGetTypeID(void) + __attribute__((availability(macosx,introduced=10.2))); + + + +extern CGMutablePathRef CGPathCreateMutable(void) + __attribute__((availability(macosx,introduced=10.2))); + + + +extern CGPathRef _Nullable CGPathCreateCopy(CGPathRef _Nullable path) + __attribute__((availability(macosx,introduced=10.2))); + + + +extern CGPathRef _Nullable CGPathCreateCopyByTransformingPath( + CGPathRef _Nullable path, const CGAffineTransform * _Nullable transform) + __attribute__((availability(macosx,introduced=10.7))); + + + +extern CGMutablePathRef _Nullable CGPathCreateMutableCopy( + CGPathRef _Nullable path) + __attribute__((availability(macosx,introduced=10.2))); + + + +extern CGMutablePathRef _Nullable CGPathCreateMutableCopyByTransformingPath( + CGPathRef _Nullable path, const CGAffineTransform * _Nullable transform) + __attribute__((availability(macosx,introduced=10.7))); +extern CGPathRef CGPathCreateWithRect(CGRect rect, + const CGAffineTransform * _Nullable transform) + __attribute__((availability(macosx,introduced=10.5))); +extern CGPathRef CGPathCreateWithEllipseInRect(CGRect rect, + const CGAffineTransform * _Nullable transform) + __attribute__((availability(macosx,introduced=10.7))); +extern CGPathRef CGPathCreateWithRoundedRect(CGRect rect, + CGFloat cornerWidth, CGFloat cornerHeight, + const CGAffineTransform * _Nullable transform) + __attribute__((availability(macosx,introduced=10.9))); +extern void CGPathAddRoundedRect(CGMutablePathRef _Nullable path, + const CGAffineTransform * _Nullable transform, CGRect rect, + CGFloat cornerWidth, CGFloat cornerHeight) + __attribute__((availability(macosx,introduced=10.9))); + + + + + + + +extern CGPathRef _Nullable CGPathCreateCopyByDashingPath( + CGPathRef _Nullable path, const CGAffineTransform * _Nullable transform, + CGFloat phase, const CGFloat * _Nullable lengths, size_t count) + __attribute__((availability(macosx,introduced=10.7))); + + + + + + + +extern CGPathRef _Nullable CGPathCreateCopyByStrokingPath( + CGPathRef _Nullable path, const CGAffineTransform * _Nullable transform, + CGFloat lineWidth, CGLineCap lineCap, + CGLineJoin lineJoin, CGFloat miterLimit) + __attribute__((availability(macosx,introduced=10.7))); + + + + +extern CGPathRef _Nullable CGPathRetain(CGPathRef _Nullable path) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern void CGPathRelease(CGPathRef _Nullable path) + __attribute__((availability(macosx,introduced=10.2))); + + + +extern _Bool CGPathEqualToPath(CGPathRef _Nullable path1, + CGPathRef _Nullable path2) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + +extern void CGPathMoveToPoint(CGMutablePathRef _Nullable path, + const CGAffineTransform * _Nullable m, CGFloat x, CGFloat y) + __attribute__((availability(macosx,introduced=10.2))); + + + + + +extern void CGPathAddLineToPoint(CGMutablePathRef _Nullable path, + const CGAffineTransform * _Nullable m, CGFloat x, CGFloat y) + __attribute__((availability(macosx,introduced=10.2))); + + + + + +extern void CGPathAddQuadCurveToPoint(CGMutablePathRef _Nullable path, + const CGAffineTransform *_Nullable m, CGFloat cpx, CGFloat cpy, + CGFloat x, CGFloat y) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + +extern void CGPathAddCurveToPoint(CGMutablePathRef _Nullable path, + const CGAffineTransform * _Nullable m, CGFloat cp1x, CGFloat cp1y, + CGFloat cp2x, CGFloat cp2y, CGFloat x, CGFloat y) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern void CGPathCloseSubpath(CGMutablePathRef _Nullable path) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + +extern void CGPathAddRect(CGMutablePathRef _Nullable path, + const CGAffineTransform * _Nullable m, CGRect rect) + __attribute__((availability(macosx,introduced=10.2))); + + + + + +extern void CGPathAddRects(CGMutablePathRef _Nullable path, + const CGAffineTransform * _Nullable m, const CGRect * _Nullable rects, + size_t count) + __attribute__((availability(macosx,introduced=10.2))); + + + + + +extern void CGPathAddLines(CGMutablePathRef _Nullable path, + const CGAffineTransform * _Nullable m, const CGPoint * _Nullable points, + size_t count) + __attribute__((availability(macosx,introduced=10.2))); +extern void CGPathAddEllipseInRect(CGMutablePathRef _Nullable path, + const CGAffineTransform * _Nullable m, CGRect rect) + __attribute__((availability(macosx,introduced=10.4))); +extern void CGPathAddRelativeArc(CGMutablePathRef _Nullable path, + const CGAffineTransform * _Nullable matrix, CGFloat x, CGFloat y, + CGFloat radius, CGFloat startAngle, CGFloat delta) + __attribute__((availability(macosx,introduced=10.7))); +extern void CGPathAddArc(CGMutablePathRef _Nullable path, + const CGAffineTransform * _Nullable m, + CGFloat x, CGFloat y, CGFloat radius, CGFloat startAngle, CGFloat endAngle, + _Bool clockwise) + __attribute__((availability(macosx,introduced=10.2))); +extern void CGPathAddArcToPoint(CGMutablePathRef _Nullable path, + const CGAffineTransform * _Nullable m, CGFloat x1, CGFloat y1, + CGFloat x2, CGFloat y2, CGFloat radius) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern void CGPathAddPath(CGMutablePathRef _Nullable path1, + const CGAffineTransform * _Nullable m, CGPathRef _Nullable path2) + __attribute__((availability(macosx,introduced=10.2))); + + + + + +extern _Bool CGPathIsEmpty(CGPathRef _Nullable path) + __attribute__((availability(macosx,introduced=10.2))); + + + +extern _Bool CGPathIsRect(CGPathRef _Nullable path, CGRect * _Nullable rect) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern CGPoint CGPathGetCurrentPoint(CGPathRef _Nullable path) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + +extern CGRect CGPathGetBoundingBox(CGPathRef _Nullable path) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + +extern CGRect CGPathGetPathBoundingBox(CGPathRef _Nullable path) + __attribute__((availability(macosx,introduced=10.6))); +extern _Bool CGPathContainsPoint(CGPathRef _Nullable path, + const CGAffineTransform * _Nullable m, CGPoint point, _Bool eoFill) + __attribute__((availability(macosx,introduced=10.4))); + + + +typedef int32_t CGPathElementType; enum { + kCGPathElementMoveToPoint, + kCGPathElementAddLineToPoint, + kCGPathElementAddQuadCurveToPoint, + kCGPathElementAddCurveToPoint, + kCGPathElementCloseSubpath +}; + + + +struct CGPathElement { + CGPathElementType type; + CGPoint * points; +}; +typedef struct CGPathElement CGPathElement; + + + +typedef void (*CGPathApplierFunction)(void * _Nullable info, + const CGPathElement * element); + + + + +extern void CGPathApply(CGPathRef _Nullable path, void * _Nullable info, + CGPathApplierFunction _Nullable function) + __attribute__((availability(macosx,introduced=10.2))); + +typedef struct CGPDFDocument *CGPDFDocumentRef; + + + + +typedef struct CGPDFPage *CGPDFPageRef; + + + +typedef struct CGPDFDictionary *CGPDFDictionaryRef; + + +typedef struct CGPDFArray *CGPDFArrayRef; + + +typedef unsigned char CGPDFBoolean; + + + +typedef long int CGPDFInteger; + + + +typedef CGFloat CGPDFReal; + + + +typedef struct CGPDFObject *CGPDFObjectRef; + + + +typedef int32_t CGPDFObjectType; enum { + kCGPDFObjectTypeNull = 1, + kCGPDFObjectTypeBoolean, + kCGPDFObjectTypeInteger, + kCGPDFObjectTypeReal, + kCGPDFObjectTypeName, + kCGPDFObjectTypeString, + kCGPDFObjectTypeArray, + kCGPDFObjectTypeDictionary, + kCGPDFObjectTypeStream +}; + + + +extern CGPDFObjectType CGPDFObjectGetType(CGPDFObjectRef _Nullable object) + __attribute__((availability(macosx,introduced=10.3))); +extern _Bool CGPDFObjectGetValue(CGPDFObjectRef _Nullable object, + CGPDFObjectType type, void * _Nullable value) + __attribute__((availability(macosx,introduced=10.3))); + + + + + + + +typedef struct CGPDFStream *CGPDFStreamRef; + + + + + +typedef int32_t CGPDFDataFormat; enum { + CGPDFDataFormatRaw, CGPDFDataFormatJPEGEncoded, CGPDFDataFormatJPEG2000 +}; + + + + + + + + + + +extern CGPDFDictionaryRef _Nullable CGPDFStreamGetDictionary( + CGPDFStreamRef _Nullable stream) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern CFDataRef _Nullable CGPDFStreamCopyData( + CGPDFStreamRef _Nullable stream, + CGPDFDataFormat * _Nullable format) + __attribute__((availability(macosx,introduced=10.3))); +typedef struct CGPDFString *CGPDFStringRef; +extern size_t CGPDFStringGetLength(CGPDFStringRef _Nullable string) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern const unsigned char * _Nullable CGPDFStringGetBytePtr( + CGPDFStringRef _Nullable string) + __attribute__((availability(macosx,introduced=10.3))); + + + + + +extern CFStringRef _Nullable CGPDFStringCopyTextString( + CGPDFStringRef _Nullable string) + __attribute__((availability(macosx,introduced=10.3))); + + + + +extern CFDateRef _Nullable CGPDFStringCopyDate( + CGPDFStringRef _Nullable string) + __attribute__((availability(macosx,introduced=10.4))); + + + + + + + +extern size_t CGPDFArrayGetCount(CGPDFArrayRef _Nullable array) + __attribute__((availability(macosx,introduced=10.3))); + + + + +extern _Bool CGPDFArrayGetObject(CGPDFArrayRef _Nullable array, size_t index, + CGPDFObjectRef _Nullable * _Nullable value) + __attribute__((availability(macosx,introduced=10.3))); + + + + +extern _Bool CGPDFArrayGetNull(CGPDFArrayRef _Nullable array, size_t index) + __attribute__((availability(macosx,introduced=10.3))); + + + + +extern _Bool CGPDFArrayGetBoolean(CGPDFArrayRef _Nullable array, + size_t index, CGPDFBoolean * _Nullable value) + __attribute__((availability(macosx,introduced=10.3))); + + + + +extern _Bool CGPDFArrayGetInteger(CGPDFArrayRef _Nullable array, + size_t index, CGPDFInteger * _Nullable value) + __attribute__((availability(macosx,introduced=10.3))); + + + + + +extern _Bool CGPDFArrayGetNumber(CGPDFArrayRef _Nullable array, + size_t index, CGPDFReal * _Nullable value) + __attribute__((availability(macosx,introduced=10.3))); + + + + +extern _Bool CGPDFArrayGetName(CGPDFArrayRef _Nullable array, + size_t index, const char * _Nullable * _Nullable value) + __attribute__((availability(macosx,introduced=10.3))); + + + + +extern _Bool CGPDFArrayGetString(CGPDFArrayRef _Nullable array, + size_t index, CGPDFStringRef _Nullable * _Nullable value) + __attribute__((availability(macosx,introduced=10.3))); + + + + +extern _Bool CGPDFArrayGetArray(CGPDFArrayRef _Nullable array, + size_t index, CGPDFArrayRef _Nullable * _Nullable value) + __attribute__((availability(macosx,introduced=10.3))); + + + + +extern _Bool CGPDFArrayGetDictionary(CGPDFArrayRef _Nullable array, + size_t index, CGPDFDictionaryRef _Nullable * _Nullable value) + __attribute__((availability(macosx,introduced=10.3))); + + + + +extern _Bool CGPDFArrayGetStream(CGPDFArrayRef _Nullable array, + size_t index, CGPDFStreamRef _Nullable * _Nullable value) + __attribute__((availability(macosx,introduced=10.3))); +extern size_t CGPDFDictionaryGetCount(CGPDFDictionaryRef _Nullable dict) + __attribute__((availability(macosx,introduced=10.3))); + + + + +extern _Bool CGPDFDictionaryGetObject(CGPDFDictionaryRef _Nullable dict, + const char * key, CGPDFObjectRef _Nullable * _Nullable value) + __attribute__((availability(macosx,introduced=10.3))); + + + + + +extern _Bool CGPDFDictionaryGetBoolean(CGPDFDictionaryRef _Nullable dict, + const char * key, CGPDFBoolean * _Nullable value) + __attribute__((availability(macosx,introduced=10.3))); + + + + + +extern _Bool CGPDFDictionaryGetInteger(CGPDFDictionaryRef _Nullable dict, + const char * key, CGPDFInteger * _Nullable value) + __attribute__((availability(macosx,introduced=10.3))); + + + + + +extern _Bool CGPDFDictionaryGetNumber(CGPDFDictionaryRef _Nullable dict, + const char * key, CGPDFReal * _Nullable value) + __attribute__((availability(macosx,introduced=10.3))); + + + + +extern _Bool CGPDFDictionaryGetName(CGPDFDictionaryRef _Nullable dict, + const char * key, const char * _Nullable * _Nullable value) + __attribute__((availability(macosx,introduced=10.3))); + + + + +extern _Bool CGPDFDictionaryGetString(CGPDFDictionaryRef _Nullable dict, + const char * key, CGPDFStringRef _Nullable * _Nullable value) + __attribute__((availability(macosx,introduced=10.3))); + + + + +extern _Bool CGPDFDictionaryGetArray(CGPDFDictionaryRef _Nullable dict, + const char * key, CGPDFArrayRef _Nullable * _Nullable value) + __attribute__((availability(macosx,introduced=10.3))); + + + + + +extern _Bool CGPDFDictionaryGetDictionary(CGPDFDictionaryRef _Nullable dict, + const char * key, CGPDFDictionaryRef _Nullable * _Nullable value) + __attribute__((availability(macosx,introduced=10.3))); + + + + +extern _Bool CGPDFDictionaryGetStream(CGPDFDictionaryRef _Nullable dict, + const char * key, CGPDFStreamRef _Nullable * _Nullable value) + __attribute__((availability(macosx,introduced=10.3))); + + + + + +typedef void (*CGPDFDictionaryApplierFunction)(const char * key, + CGPDFObjectRef value, void * _Nullable info); + + + + + +extern void CGPDFDictionaryApplyFunction(CGPDFDictionaryRef _Nullable dict, + CGPDFDictionaryApplierFunction _Nullable function, void * _Nullable info) + __attribute__((availability(macosx,introduced=10.3))); + + + + + +typedef int32_t CGPDFBox; enum { + kCGPDFMediaBox = 0, + kCGPDFCropBox = 1, + kCGPDFBleedBox = 2, + kCGPDFTrimBox = 3, + kCGPDFArtBox = 4 +}; + + + + +extern CGPDFPageRef _Nullable CGPDFPageRetain(CGPDFPageRef _Nullable page) + __attribute__((availability(macosx,introduced=10.3))); + + + + +extern void CGPDFPageRelease(CGPDFPageRef _Nullable page) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern CGPDFDocumentRef _Nullable CGPDFPageGetDocument( + CGPDFPageRef _Nullable page) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern size_t CGPDFPageGetPageNumber(CGPDFPageRef _Nullable page) + __attribute__((availability(macosx,introduced=10.3))); + + + + + + +extern CGRect CGPDFPageGetBoxRect(CGPDFPageRef _Nullable page, CGPDFBox box) + __attribute__((availability(macosx,introduced=10.3))); + + + + + +extern int CGPDFPageGetRotationAngle(CGPDFPageRef _Nullable page) + __attribute__((availability(macosx,introduced=10.3))); +extern CGAffineTransform CGPDFPageGetDrawingTransform( + CGPDFPageRef _Nullable page, CGPDFBox box, CGRect rect, int rotate, + _Bool preserveAspectRatio) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern CGPDFDictionaryRef _Nullable CGPDFPageGetDictionary( + CGPDFPageRef _Nullable page) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern CFTypeID CGPDFPageGetTypeID(void) + __attribute__((availability(macosx,introduced=10.3))); + + + + + + + + +extern CGPDFDocumentRef _Nullable CGPDFDocumentCreateWithProvider( + CGDataProviderRef _Nullable provider) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGPDFDocumentRef _Nullable CGPDFDocumentCreateWithURL( + CFURLRef _Nullable url) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGPDFDocumentRef _Nullable CGPDFDocumentRetain( + CGPDFDocumentRef _Nullable document) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGPDFDocumentRelease(CGPDFDocumentRef _Nullable document) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGPDFDocumentGetVersion(CGPDFDocumentRef _Nullable document, + int * majorVersion, int * minorVersion) + __attribute__((availability(macosx,introduced=10.3))); + + + + + + +extern _Bool CGPDFDocumentIsEncrypted(CGPDFDocumentRef _Nullable document) + __attribute__((availability(macosx,introduced=10.2))); + + + + + +extern _Bool CGPDFDocumentUnlockWithPassword( + CGPDFDocumentRef _Nullable document, const char * password) + __attribute__((availability(macosx,introduced=10.2))); + + + + + +extern _Bool CGPDFDocumentIsUnlocked(CGPDFDocumentRef _Nullable document) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + +extern _Bool CGPDFDocumentAllowsPrinting(CGPDFDocumentRef _Nullable document) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + +extern _Bool CGPDFDocumentAllowsCopying(CGPDFDocumentRef _Nullable document) + __attribute__((availability(macosx,introduced=10.2))); + + + +extern size_t CGPDFDocumentGetNumberOfPages( + CGPDFDocumentRef _Nullable document) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGPDFPageRef _Nullable CGPDFDocumentGetPage( + CGPDFDocumentRef _Nullable document, size_t pageNumber) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern CGPDFDictionaryRef _Nullable CGPDFDocumentGetCatalog( + CGPDFDocumentRef _Nullable document) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern CGPDFDictionaryRef _Nullable CGPDFDocumentGetInfo( + CGPDFDocumentRef _Nullable document) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CGPDFArrayRef _Nullable CGPDFDocumentGetID( + CGPDFDocumentRef _Nullable document) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CFTypeID CGPDFDocumentGetTypeID(void) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + +extern CGRect CGPDFDocumentGetMediaBox(CGPDFDocumentRef _Nullable document, + int page) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); + + + + + + +extern CGRect CGPDFDocumentGetCropBox(CGPDFDocumentRef _Nullable document, + int page) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); + + + + + +extern CGRect CGPDFDocumentGetBleedBox(CGPDFDocumentRef _Nullable document, + int page) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); + + + + + +extern CGRect CGPDFDocumentGetTrimBox(CGPDFDocumentRef _Nullable document, + int page) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); + + + + + +extern CGRect CGPDFDocumentGetArtBox(CGPDFDocumentRef _Nullable document, + int page) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); + + + + + +extern int CGPDFDocumentGetRotationAngle(CGPDFDocumentRef _Nullable document, + int page) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); +typedef struct CGShading *CGShadingRef; + + + + +typedef struct CGFunction *CGFunctionRef; +typedef void (*CGFunctionEvaluateCallback)(void * _Nullable info, + const CGFloat * in, CGFloat * out); + + + + +typedef void (*CGFunctionReleaseInfoCallback)(void * _Nullable info); +struct CGFunctionCallbacks { + unsigned int version; + CGFunctionEvaluateCallback _Nullable evaluate; + CGFunctionReleaseInfoCallback _Nullable releaseInfo; +}; +typedef struct CGFunctionCallbacks CGFunctionCallbacks; + + + +extern CFTypeID CGFunctionGetTypeID(void) + __attribute__((availability(macosx,introduced=10.2))); +extern CGFunctionRef _Nullable CGFunctionCreate(void * _Nullable info, + size_t domainDimension, const CGFloat *_Nullable domain, + size_t rangeDimension, const CGFloat * _Nullable range, + const CGFunctionCallbacks * _Nullable callbacks) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern CGFunctionRef _Nullable CGFunctionRetain( + CGFunctionRef _Nullable function) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern void CGFunctionRelease(CGFunctionRef _Nullable function) + __attribute__((availability(macosx,introduced=10.2))); +extern CFTypeID CGShadingGetTypeID(void) + __attribute__((availability(macosx,introduced=10.2))); +extern CGShadingRef _Nullable CGShadingCreateAxial( + CGColorSpaceRef _Nullable space, CGPoint start, CGPoint end, + CGFunctionRef _Nullable function, _Bool extendStart, _Bool extendEnd) + __attribute__((availability(macosx,introduced=10.2))); +extern CGShadingRef _Nullable CGShadingCreateRadial( + CGColorSpaceRef _Nullable space, + CGPoint start, CGFloat startRadius, CGPoint end, CGFloat endRadius, + CGFunctionRef _Nullable function, _Bool extendStart, _Bool extendEnd) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern CGShadingRef _Nullable CGShadingRetain(CGShadingRef _Nullable shading) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern void CGShadingRelease(CGShadingRef _Nullable shading) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + + +typedef int32_t CGPathDrawingMode; enum { + kCGPathFill, + kCGPathEOFill, + kCGPathStroke, + kCGPathFillStroke, + kCGPathEOFillStroke +}; + + + +typedef int32_t CGTextDrawingMode; enum { + kCGTextFill, + kCGTextStroke, + kCGTextFillStroke, + kCGTextInvisible, + kCGTextFillClip, + kCGTextStrokeClip, + kCGTextFillStrokeClip, + kCGTextClip +}; + + + +typedef int32_t CGTextEncoding; enum { + kCGEncodingFontSpecific, + kCGEncodingMacRoman +} __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); + + + +typedef int32_t CGInterpolationQuality; enum { + kCGInterpolationDefault = 0, + kCGInterpolationNone = 1, + kCGInterpolationLow = 2, + kCGInterpolationMedium = 4, + kCGInterpolationHigh = 3 +}; +typedef int32_t CGBlendMode; enum { + + kCGBlendModeNormal, + kCGBlendModeMultiply, + kCGBlendModeScreen, + kCGBlendModeOverlay, + kCGBlendModeDarken, + kCGBlendModeLighten, + kCGBlendModeColorDodge, + kCGBlendModeColorBurn, + kCGBlendModeSoftLight, + kCGBlendModeHardLight, + kCGBlendModeDifference, + kCGBlendModeExclusion, + kCGBlendModeHue, + kCGBlendModeSaturation, + kCGBlendModeColor, + kCGBlendModeLuminosity, + kCGBlendModeClear, + kCGBlendModeCopy, + kCGBlendModeSourceIn, + kCGBlendModeSourceOut, + kCGBlendModeSourceAtop, + kCGBlendModeDestinationOver, + kCGBlendModeDestinationIn, + kCGBlendModeDestinationOut, + kCGBlendModeDestinationAtop, + kCGBlendModeXOR, + kCGBlendModePlusDarker, + kCGBlendModePlusLighter +}; + + + +extern CFTypeID CGContextGetTypeID(void) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + + +extern void CGContextSaveGState(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGContextRestoreGState(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.0))); + + + + + + +extern void CGContextScaleCTM(CGContextRef _Nullable c, + CGFloat sx, CGFloat sy) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGContextTranslateCTM(CGContextRef _Nullable c, + CGFloat tx, CGFloat ty) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGContextRotateCTM(CGContextRef _Nullable c, CGFloat angle) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGContextConcatCTM(CGContextRef _Nullable c, + CGAffineTransform transform) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGAffineTransform CGContextGetCTM(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern void CGContextSetLineWidth(CGContextRef _Nullable c, CGFloat width) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextSetLineCap(CGContextRef _Nullable c, CGLineCap cap) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextSetLineJoin(CGContextRef _Nullable c, CGLineJoin join) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextSetMiterLimit(CGContextRef _Nullable c, CGFloat limit) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextSetLineDash(CGContextRef _Nullable c, CGFloat phase, + const CGFloat * _Nullable lengths, size_t count) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGContextSetFlatness(CGContextRef _Nullable c, CGFloat flatness) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextSetAlpha(CGContextRef _Nullable c, CGFloat alpha) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextSetBlendMode(CGContextRef _Nullable c, CGBlendMode mode) + __attribute__((availability(macosx,introduced=10.4))); +extern void CGContextBeginPath(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextMoveToPoint(CGContextRef _Nullable c, + CGFloat x, CGFloat y) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextAddLineToPoint(CGContextRef _Nullable c, + CGFloat x, CGFloat y) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGContextAddCurveToPoint(CGContextRef _Nullable c, CGFloat cp1x, + CGFloat cp1y, CGFloat cp2x, CGFloat cp2y, CGFloat x, CGFloat y) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGContextAddQuadCurveToPoint(CGContextRef _Nullable c, + CGFloat cpx, CGFloat cpy, CGFloat x, CGFloat y) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextClosePath(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern void CGContextAddRect(CGContextRef _Nullable c, CGRect rect) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextAddRects(CGContextRef _Nullable c, + const CGRect * _Nullable rects, size_t count) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextAddLines(CGContextRef _Nullable c, + const CGPoint * _Nullable points, size_t count) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern void CGContextAddEllipseInRect(CGContextRef _Nullable c, CGRect rect) + __attribute__((availability(macosx,introduced=10.4))); +extern void CGContextAddArc(CGContextRef _Nullable c, CGFloat x, CGFloat y, + CGFloat radius, CGFloat startAngle, CGFloat endAngle, int clockwise) + __attribute__((availability(macosx,introduced=10.0))); + + + + + + +extern void CGContextAddArcToPoint(CGContextRef _Nullable c, + CGFloat x1, CGFloat y1, CGFloat x2, CGFloat y2, CGFloat radius) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGContextAddPath(CGContextRef _Nullable c, + CGPathRef _Nullable path) + __attribute__((availability(macosx,introduced=10.2))); +extern void CGContextReplacePathWithStrokedPath(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern _Bool CGContextIsPathEmpty(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGPoint CGContextGetPathCurrentPoint(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern CGRect CGContextGetPathBoundingBox(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGPathRef _Nullable CGContextCopyPath(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + +extern _Bool CGContextPathContainsPoint(CGContextRef _Nullable c, + CGPoint point, CGPathDrawingMode mode) + __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern void CGContextDrawPath(CGContextRef _Nullable c, + CGPathDrawingMode mode) + __attribute__((availability(macosx,introduced=10.0))); + + + + + + +extern void CGContextFillPath(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGContextEOFillPath(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextStrokePath(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextFillRect(CGContextRef _Nullable c, CGRect rect) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGContextFillRects(CGContextRef _Nullable c, + const CGRect * _Nullable rects, size_t count) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextStrokeRect(CGContextRef _Nullable c, CGRect rect) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGContextStrokeRectWithWidth(CGContextRef _Nullable c, + CGRect rect, CGFloat width) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextClearRect(CGContextRef _Nullable c, CGRect rect) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextFillEllipseInRect(CGContextRef _Nullable c, + CGRect rect) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern void CGContextStrokeEllipseInRect(CGContextRef _Nullable c, + CGRect rect) + __attribute__((availability(macosx,introduced=10.4))); +extern void CGContextStrokeLineSegments(CGContextRef _Nullable c, + const CGPoint * _Nullable points, size_t count) + __attribute__((availability(macosx,introduced=10.4))); + + + + + + + +extern void CGContextClip(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern void CGContextEOClip(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.0))); +extern void CGContextClipToMask(CGContextRef _Nullable c, CGRect rect, + CGImageRef _Nullable mask) + __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern CGRect CGContextGetClipBoundingBox(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.3))); + + + + + + +extern void CGContextClipToRect(CGContextRef _Nullable c, CGRect rect) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern void CGContextClipToRects(CGContextRef _Nullable c, + const CGRect * rects, size_t count) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern void CGContextSetFillColorWithColor(CGContextRef _Nullable c, + CGColorRef _Nullable color) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern void CGContextSetStrokeColorWithColor(CGContextRef _Nullable c, + CGColorRef _Nullable color) + __attribute__((availability(macosx,introduced=10.3))); + + + + + + + +extern void CGContextSetFillColorSpace(CGContextRef _Nullable c, + CGColorSpaceRef _Nullable space) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern void CGContextSetStrokeColorSpace(CGContextRef _Nullable c, + CGColorSpaceRef _Nullable space) + __attribute__((availability(macosx,introduced=10.0))); +extern void CGContextSetFillColor(CGContextRef _Nullable c, + const CGFloat * _Nullable components) + __attribute__((availability(macosx,introduced=10.0))); + + + + + + + +extern void CGContextSetStrokeColor(CGContextRef _Nullable c, + const CGFloat * _Nullable components) + __attribute__((availability(macosx,introduced=10.0))); +extern void CGContextSetFillPattern(CGContextRef _Nullable c, + CGPatternRef _Nullable pattern, const CGFloat * _Nullable components) + __attribute__((availability(macosx,introduced=10.0))); +extern void CGContextSetStrokePattern(CGContextRef _Nullable c, + CGPatternRef _Nullable pattern, const CGFloat * _Nullable components) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGContextSetPatternPhase(CGContextRef _Nullable c, CGSize phase) + __attribute__((availability(macosx,introduced=10.0))); + + + + + + +extern void CGContextSetGrayFillColor(CGContextRef _Nullable c, + CGFloat gray, CGFloat alpha) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGContextSetGrayStrokeColor(CGContextRef _Nullable c, + CGFloat gray, CGFloat alpha) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGContextSetRGBFillColor(CGContextRef _Nullable c, CGFloat red, + CGFloat green, CGFloat blue, CGFloat alpha) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern void CGContextSetRGBStrokeColor(CGContextRef _Nullable c, + CGFloat red, CGFloat green, CGFloat blue, CGFloat alpha) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern void CGContextSetCMYKFillColor(CGContextRef _Nullable c, + CGFloat cyan, CGFloat magenta, CGFloat yellow, CGFloat black, CGFloat alpha) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern void CGContextSetCMYKStrokeColor(CGContextRef _Nullable c, + CGFloat cyan, CGFloat magenta, CGFloat yellow, CGFloat black, CGFloat alpha) + __attribute__((availability(macosx,introduced=10.0))); + + + + + + +extern void CGContextSetRenderingIntent(CGContextRef _Nullable c, + CGColorRenderingIntent intent) + __attribute__((availability(macosx,introduced=10.0))); + + + + + + +extern void CGContextDrawImage(CGContextRef _Nullable c, CGRect rect, + CGImageRef _Nullable image) + __attribute__((availability(macosx,introduced=10.0))); +extern void CGContextDrawTiledImage(CGContextRef _Nullable c, CGRect rect, + CGImageRef _Nullable image) + __attribute__((availability(macosx,introduced=10.5))); + + + + + + + +extern CGInterpolationQuality + CGContextGetInterpolationQuality(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextSetInterpolationQuality(CGContextRef _Nullable c, + CGInterpolationQuality quality) + __attribute__((availability(macosx,introduced=10.0))); +extern void CGContextSetShadowWithColor(CGContextRef _Nullable c, + CGSize offset, CGFloat blur, CGColorRef _Nullable color) + __attribute__((availability(macosx,introduced=10.3))); + + + + + + +extern void CGContextSetShadow(CGContextRef _Nullable c, CGSize offset, + CGFloat blur) + __attribute__((availability(macosx,introduced=10.3))); +extern void CGContextDrawLinearGradient(CGContextRef _Nullable c, + CGGradientRef _Nullable gradient, CGPoint startPoint, CGPoint endPoint, + CGGradientDrawingOptions options) + __attribute__((availability(macosx,introduced=10.5))); +extern void CGContextDrawRadialGradient(CGContextRef _Nullable c, + CGGradientRef _Nullable gradient, CGPoint startCenter, CGFloat startRadius, + CGPoint endCenter, CGFloat endRadius, CGGradientDrawingOptions options) + __attribute__((availability(macosx,introduced=10.5))); + + + +extern void CGContextDrawShading(CGContextRef _Nullable c, + _Nullable CGShadingRef shading) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + + +extern void CGContextSetCharacterSpacing(CGContextRef _Nullable c, + CGFloat spacing) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGContextSetTextPosition(CGContextRef _Nullable c, + CGFloat x, CGFloat y) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGPoint CGContextGetTextPosition(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextSetTextMatrix(CGContextRef _Nullable c, + CGAffineTransform t) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGAffineTransform CGContextGetTextMatrix(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGContextSetTextDrawingMode(CGContextRef _Nullable c, + CGTextDrawingMode mode) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGContextSetFont(CGContextRef _Nullable c, + CGFontRef _Nullable font) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGContextSetFontSize(CGContextRef _Nullable c, CGFloat size) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern void CGContextShowGlyphsAtPositions(CGContextRef _Nullable c, + const CGGlyph * _Nullable glyphs, const CGPoint * _Nullable Lpositions, + size_t count) + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern void CGContextDrawPDFPage(CGContextRef _Nullable c, + CGPDFPageRef _Nullable page) + __attribute__((availability(macosx,introduced=10.3))); + + + + + +extern void CGContextBeginPage(CGContextRef _Nullable c, + const CGRect * _Nullable mediaBox) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextEndPage(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern CGContextRef _Nullable CGContextRetain(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextRelease(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextFlush(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGContextSynchronize(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.0))); + + + + + + +extern void CGContextSetShouldAntialias(CGContextRef _Nullable c, + _Bool shouldAntialias) + __attribute__((availability(macosx,introduced=10.0))); + + + + + + +extern void CGContextSetAllowsAntialiasing(CGContextRef _Nullable c, + _Bool allowsAntialiasing) + __attribute__((availability(macosx,introduced=10.4))); +extern void CGContextSetShouldSmoothFonts(CGContextRef _Nullable c, + _Bool shouldSmoothFonts) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + + +extern void CGContextSetAllowsFontSmoothing(CGContextRef _Nullable c, + _Bool allowsFontSmoothing) + __attribute__((availability(macosx,introduced=10.2))); + + + + + + +extern void CGContextSetShouldSubpixelPositionFonts( + CGContextRef _Nullable c, _Bool shouldSubpixelPositionFonts) + __attribute__((availability(macosx,introduced=10.5))); +extern void CGContextSetAllowsFontSubpixelPositioning( + CGContextRef _Nullable c, _Bool allowsFontSubpixelPositioning) + __attribute__((availability(macosx,introduced=10.5))); + + + + + + +extern void CGContextSetShouldSubpixelQuantizeFonts( + CGContextRef _Nullable c, _Bool shouldSubpixelQuantizeFonts) + __attribute__((availability(macosx,introduced=10.5))); +extern void CGContextSetAllowsFontSubpixelQuantization( + CGContextRef _Nullable c, _Bool allowsFontSubpixelQuantization) + __attribute__((availability(macosx,introduced=10.5))); +extern void CGContextBeginTransparencyLayer(CGContextRef _Nullable c, + CFDictionaryRef _Nullable auxiliaryInfo) + __attribute__((availability(macosx,introduced=10.3))); + + + + + +extern void CGContextBeginTransparencyLayerWithRect( + CGContextRef _Nullable c, CGRect rect, CFDictionaryRef _Nullable auxInfo) + __attribute__((availability(macosx,introduced=10.5))); + + + +extern void CGContextEndTransparencyLayer(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.3))); + + + + + + +extern CGAffineTransform + CGContextGetUserSpaceToDeviceSpaceTransform(CGContextRef _Nullable c) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CGPoint CGContextConvertPointToDeviceSpace(CGContextRef _Nullable c, + CGPoint point) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CGPoint CGContextConvertPointToUserSpace(CGContextRef _Nullable c, + CGPoint point) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CGSize CGContextConvertSizeToDeviceSpace(CGContextRef _Nullable c, + CGSize size) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CGSize CGContextConvertSizeToUserSpace(CGContextRef _Nullable c, + CGSize size) + __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern CGRect CGContextConvertRectToDeviceSpace(CGContextRef _Nullable c, + CGRect rect) + __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern CGRect CGContextConvertRectToUserSpace(CGContextRef _Nullable c, + CGRect rect) + __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern void CGContextSelectFont(CGContextRef _Nullable c, + const char * _Nullable name, CGFloat size, CGTextEncoding textEncoding) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); + + + + +extern void CGContextShowText(CGContextRef _Nullable c, + const char * _Nullable string, size_t length) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); + + + + +extern void CGContextShowTextAtPoint(CGContextRef _Nullable c, + CGFloat x, CGFloat y, const char * _Nullable string, size_t length) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); + + + + +extern void CGContextShowGlyphs(CGContextRef _Nullable c, + const CGGlyph * _Nullable g, size_t count) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); + + + + +extern void CGContextShowGlyphsAtPoint(CGContextRef _Nullable c, CGFloat x, + CGFloat y, const CGGlyph * _Nullable glyphs, size_t count) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); + + + + +extern void CGContextShowGlyphsWithAdvances(CGContextRef _Nullable c, + const CGGlyph * _Nullable glyphs, const CGSize * _Nullable advances, + size_t count) + __attribute__((availability(macosx,introduced=10.3,deprecated=10.9))); + + + + +extern void CGContextDrawPDFDocument(CGContextRef _Nullable c, CGRect rect, + CGPDFDocumentRef _Nullable document, int page) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.5))); +typedef void (*CGBitmapContextReleaseDataCallback)(void * _Nullable releaseInfo, + void * _Nullable data); +extern CGContextRef _Nullable CGBitmapContextCreateWithData( + void * _Nullable data, size_t width, size_t height, size_t bitsPerComponent, + size_t bytesPerRow, CGColorSpaceRef _Nullable space, uint32_t bitmapInfo, + CGBitmapContextReleaseDataCallback _Nullable releaseCallback, + void * _Nullable releaseInfo) + __attribute__((availability(macosx,introduced=10.6))); +extern CGContextRef _Nullable CGBitmapContextCreate(void * _Nullable data, + size_t width, size_t height, size_t bitsPerComponent, size_t bytesPerRow, + CGColorSpaceRef _Nullable space, uint32_t bitmapInfo) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void * _Nullable CGBitmapContextGetData(CGContextRef _Nullable context) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern size_t CGBitmapContextGetWidth(CGContextRef _Nullable context) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern size_t CGBitmapContextGetHeight(CGContextRef _Nullable context) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern size_t CGBitmapContextGetBitsPerComponent(CGContextRef _Nullable context) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern size_t CGBitmapContextGetBitsPerPixel(CGContextRef _Nullable context) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern size_t CGBitmapContextGetBytesPerRow(CGContextRef _Nullable context) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern CGColorSpaceRef _Nullable CGBitmapContextGetColorSpace( + CGContextRef _Nullable context) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern CGImageAlphaInfo CGBitmapContextGetAlphaInfo( + CGContextRef _Nullable context) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern CGBitmapInfo CGBitmapContextGetBitmapInfo( + CGContextRef _Nullable context) + __attribute__((availability(macosx,introduced=10.4))); +extern CGImageRef _Nullable CGBitmapContextCreateImage( + CGContextRef _Nullable context) + __attribute__((availability(macosx,introduced=10.4))); + +typedef const struct __attribute__((objc_bridge(id))) CGColorConversionInfo* CGColorConversionInfoRef; + + + + + +extern CFTypeID CGColorConversionInfoGetTypeID(void); + +typedef uint32_t CGColorConversionInfoTransformType; enum { + kCGColorConversionTransformFromSpace = 0, + kCGColorConversionTransformToSpace, + kCGColorConversionTransformApplySpace +}; + + + + + + +extern CGColorConversionInfoRef _Nullable CGColorConversionInfoCreate(_Nullable CGColorSpaceRef src, _Nullable CGColorSpaceRef dst) + __attribute__((availability(macosx,introduced=10.12))); + + + + + + + +extern CGColorConversionInfoRef _Nullable CGColorConversionInfoCreateFromList + (CFDictionaryRef _Nullable options, _Nullable CGColorSpaceRef, CGColorConversionInfoTransformType, CGColorRenderingIntent, ...) + __attribute__((availability(macosx,introduced=10.12))); + + +extern const CFStringRef kCGColorConversionBlackPointCompensation __attribute__((availability(macosx,introduced=10.12))); + + +typedef struct CGDataConsumer *CGDataConsumerRef; +typedef size_t (*CGDataConsumerPutBytesCallback)(void * _Nullable info, + const void * buffer, size_t count); + + + + +typedef void (*CGDataConsumerReleaseInfoCallback)(void * _Nullable info); + + + + + + + +struct CGDataConsumerCallbacks { + CGDataConsumerPutBytesCallback _Nullable putBytes; + CGDataConsumerReleaseInfoCallback _Nullable releaseConsumer; +}; +typedef struct CGDataConsumerCallbacks CGDataConsumerCallbacks; + + + +extern CFTypeID CGDataConsumerGetTypeID(void) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern CGDataConsumerRef _Nullable CGDataConsumerCreate( + void * _Nullable info, const CGDataConsumerCallbacks * _Nullable cbks) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGDataConsumerRef _Nullable CGDataConsumerCreateWithURL( + CFURLRef _Nullable url) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGDataConsumerRef _Nullable CGDataConsumerCreateWithCFData( + CFMutableDataRef _Nullable data) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CGDataConsumerRef _Nullable CGDataConsumerRetain( + CGDataConsumerRef _Nullable consumer) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern void CGDataConsumerRelease(_Nullable CGDataConsumerRef consumer) + __attribute__((availability(macosx,introduced=10.0))); + +typedef int32_t CGError; enum { + kCGErrorSuccess = 0, + kCGErrorFailure = 1000, + kCGErrorIllegalArgument = 1001, + kCGErrorInvalidConnection = 1002, + kCGErrorInvalidContext = 1003, + kCGErrorCannotComplete = 1004, + kCGErrorNotImplemented = 1006, + kCGErrorRangeCheck = 1007, + kCGErrorTypeCheck = 1008, + kCGErrorInvalidOperation = 1010, + kCGErrorNoneAvailable = 1011, +}; + + + + + +typedef struct CGLayer *CGLayerRef; +extern CGLayerRef _Nullable CGLayerCreateWithContext( + CGContextRef _Nullable context, + CGSize size, CFDictionaryRef _Nullable auxiliaryInfo) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CGLayerRef _Nullable CGLayerRetain(CGLayerRef _Nullable layer) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern void CGLayerRelease(CGLayerRef _Nullable layer) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CGSize CGLayerGetSize(CGLayerRef _Nullable layer) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CGContextRef _Nullable CGLayerGetContext(CGLayerRef _Nullable layer) + __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern void CGContextDrawLayerInRect(CGContextRef _Nullable context, + CGRect rect, CGLayerRef _Nullable layer) + __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern void CGContextDrawLayerAtPoint(CGContextRef _Nullable context, + CGPoint point, CGLayerRef _Nullable layer) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CFTypeID CGLayerGetTypeID(void) + __attribute__((availability(macosx,introduced=10.4))); + + + + + + + + +typedef struct CGPDFContentStream *CGPDFContentStreamRef; +extern CGPDFContentStreamRef CGPDFContentStreamCreateWithPage( + CGPDFPageRef page) __attribute__((availability(macosx,introduced=10.4))); + + + +extern CGPDFContentStreamRef CGPDFContentStreamCreateWithStream( + CGPDFStreamRef stream, CGPDFDictionaryRef streamResources, + CGPDFContentStreamRef _Nullable parent) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CGPDFContentStreamRef CGPDFContentStreamRetain( + CGPDFContentStreamRef cs) __attribute__((availability(macosx,introduced=10.4))); + + + +extern void CGPDFContentStreamRelease(CGPDFContentStreamRef cs) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CFArrayRef _Nullable CGPDFContentStreamGetStreams(CGPDFContentStreamRef cs) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CGPDFObjectRef _Nullable CGPDFContentStreamGetResource( + CGPDFContentStreamRef cs, const char *category, const char *name) + __attribute__((availability(macosx,introduced=10.4))); +extern CGContextRef _Nullable CGPDFContextCreate(CGDataConsumerRef _Nullable consumer, + const CGRect *_Nullable mediaBox, CFDictionaryRef _Nullable auxiliaryInfo) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern CGContextRef _Nullable CGPDFContextCreateWithURL(CFURLRef _Nullable url, + const CGRect * _Nullable mediaBox, CFDictionaryRef _Nullable auxiliaryInfo) + __attribute__((availability(macosx,introduced=10.0))); + + + + + + +extern void CGPDFContextClose(CGContextRef _Nullable context) + __attribute__((availability(macosx,introduced=10.5))); + + + +extern void CGPDFContextBeginPage(CGContextRef _Nullable context, + CFDictionaryRef _Nullable pageInfo) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern void CGPDFContextEndPage(CGContextRef _Nullable context) + __attribute__((availability(macosx,introduced=10.4))); +extern void CGPDFContextAddDocumentMetadata(CGContextRef _Nullable context, + CFDataRef _Nullable metadata) __attribute__((availability(macosx,introduced=10.7))); + + + + +extern void CGPDFContextSetURLForRect(CGContextRef _Nullable context, CFURLRef url, + CGRect rect) __attribute__((availability(macosx,introduced=10.4))); + + + + +extern void CGPDFContextAddDestinationAtPoint(CGContextRef _Nullable context, + CFStringRef name, CGPoint point) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern void CGPDFContextSetDestinationForRect(CGContextRef _Nullable context, + CFStringRef name, CGRect rect) + __attribute__((availability(macosx,introduced=10.4))); + + + + + + + +extern const CFStringRef kCGPDFContextMediaBox + __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern const CFStringRef kCGPDFContextCropBox + __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern const CFStringRef kCGPDFContextBleedBox + __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern const CFStringRef kCGPDFContextTrimBox + __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern const CFStringRef kCGPDFContextArtBox + __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern const CFStringRef kCGPDFContextTitle + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern const CFStringRef kCGPDFContextAuthor + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern const CFStringRef kCGPDFContextSubject + __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGPDFContextKeywords + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCGPDFContextCreator + __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGPDFContextOwnerPassword + __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGPDFContextUserPassword + __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGPDFContextEncryptionKeyLength + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCGPDFContextAllowsPrinting + __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern const CFStringRef kCGPDFContextAllowsCopying + __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGPDFContextOutputIntent + __attribute__((availability(macosx,introduced=10.4))); + + + + + + + +extern const CFStringRef kCGPDFXOutputIntentSubtype + __attribute__((availability(macosx,introduced=10.4))); + + + + + + + +extern const CFStringRef kCGPDFXOutputConditionIdentifier + __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern const CFStringRef kCGPDFXOutputCondition + __attribute__((availability(macosx,introduced=10.4))); + + + + + + + +extern const CFStringRef kCGPDFXRegistryName + __attribute__((availability(macosx,introduced=10.4))); + + + + + + + +extern const CFStringRef kCGPDFXInfo + __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGPDFXDestinationOutputProfile + __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGPDFContextOutputIntents + __attribute__((availability(macosx,introduced=10.4))); + + + +typedef struct CGPDFOperatorTable *CGPDFOperatorTableRef; + + +typedef struct CGPDFScanner *CGPDFScannerRef; + + + + + + + + + + +extern CGPDFScannerRef CGPDFScannerCreate( + CGPDFContentStreamRef cs, + CGPDFOperatorTableRef _Nullable table, void * _Nullable info) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CGPDFScannerRef _Nullable CGPDFScannerRetain( + CGPDFScannerRef _Nullable scanner) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern void CGPDFScannerRelease(CGPDFScannerRef _Nullable scanner) + __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern _Bool CGPDFScannerScan(CGPDFScannerRef _Nullable scanner) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CGPDFContentStreamRef CGPDFScannerGetContentStream( + CGPDFScannerRef scanner) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern _Bool CGPDFScannerPopObject(CGPDFScannerRef scanner, + CGPDFObjectRef _Nullable * _Nullable value) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern _Bool CGPDFScannerPopBoolean(CGPDFScannerRef scanner, + CGPDFBoolean * _Nullable value) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern _Bool CGPDFScannerPopInteger(CGPDFScannerRef scanner, + CGPDFInteger * _Nullable value) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern _Bool CGPDFScannerPopNumber(CGPDFScannerRef scanner, + CGPDFReal * _Nullable value) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern _Bool CGPDFScannerPopName(CGPDFScannerRef scanner, + const char * _Nullable * _Nullable value) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern _Bool CGPDFScannerPopString(CGPDFScannerRef scanner, + CGPDFStringRef _Nullable * _Nullable value) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern _Bool CGPDFScannerPopArray(CGPDFScannerRef scanner, + CGPDFArrayRef _Nullable * _Nullable value) + __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern _Bool CGPDFScannerPopDictionary(CGPDFScannerRef scanner, + CGPDFDictionaryRef _Nullable * _Nullable value) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern _Bool CGPDFScannerPopStream(CGPDFScannerRef scanner, + CGPDFStreamRef _Nullable * _Nullable value) + __attribute__((availability(macosx,introduced=10.4))); + + + + + +typedef void (*CGPDFOperatorCallback)(CGPDFScannerRef scanner, + void * _Nullable info); + + + +extern CGPDFOperatorTableRef _Nullable CGPDFOperatorTableCreate(void) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CGPDFOperatorTableRef _Nullable CGPDFOperatorTableRetain( + CGPDFOperatorTableRef _Nullable table) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern void CGPDFOperatorTableRelease( + CGPDFOperatorTableRef _Nullable table) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern void CGPDFOperatorTableSetCallback( + CGPDFOperatorTableRef _Nullable table, + const char * _Nullable name, CGPDFOperatorCallback _Nullable callback) + __attribute__((availability(macosx,introduced=10.4))); + + + + + + + + +typedef uint32_t CGDirectDisplayID; +typedef uint32_t CGOpenGLDisplayMask; +typedef double CGRefreshRate; + +typedef struct CGDisplayMode *CGDisplayModeRef; +extern CGDirectDisplayID CGMainDisplayID(void) + __attribute__((availability(macosx,introduced=10.2))); +extern CGError CGGetDisplaysWithPoint(CGPoint point, uint32_t maxDisplays, + CGDirectDisplayID * _Nullable displays, + uint32_t * _Nullable matchingDisplayCount) + __attribute__((availability(macosx,introduced=10.0))); + +extern CGError CGGetDisplaysWithRect(CGRect rect, uint32_t maxDisplays, + CGDirectDisplayID * _Nullable displays, + uint32_t * _Nullable matchingDisplayCount) + __attribute__((availability(macosx,introduced=10.0))); + +extern CGError CGGetDisplaysWithOpenGLDisplayMask(CGOpenGLDisplayMask mask, + uint32_t maxDisplays, CGDirectDisplayID * _Nullable displays, + uint32_t * _Nullable matchingDisplayCount) + __attribute__((availability(macosx,introduced=10.0))); +extern CGError CGGetActiveDisplayList(uint32_t maxDisplays, + CGDirectDisplayID * _Nullable activeDisplays, + uint32_t * _Nullable displayCount) + __attribute__((availability(macosx,introduced=10.0))); +extern CGError CGGetOnlineDisplayList(uint32_t maxDisplays, + CGDirectDisplayID * _Nullable onlineDisplays, + uint32_t * _Nullable displayCount) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern CGOpenGLDisplayMask CGDisplayIDToOpenGLDisplayMask( + CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern CGDirectDisplayID CGOpenGLDisplayMaskToDisplayID( + CGOpenGLDisplayMask mask) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern CGRect CGDisplayBounds(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern size_t CGDisplayPixelsWide(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern size_t CGDisplayPixelsHigh(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern CFArrayRef _Nullable CGDisplayCopyAllDisplayModes( + CGDirectDisplayID display, CFDictionaryRef _Nullable options) + __attribute__((availability(macosx,introduced=10.6))); + +extern const CFStringRef kCGDisplayShowDuplicateLowResolutionModes + __attribute__((availability(macosx,introduced=10.8))); + + + + +extern CGDisplayModeRef _Nullable CGDisplayCopyDisplayMode( + CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.6))); +extern CGError CGDisplaySetDisplayMode(CGDirectDisplayID display, + CGDisplayModeRef _Nullable mode, CFDictionaryRef _Nullable options) + __attribute__((availability(macosx,introduced=10.6))); + + + +extern size_t CGDisplayModeGetWidth(CGDisplayModeRef _Nullable mode) + __attribute__((availability(macosx,introduced=10.6))); + + + +extern size_t CGDisplayModeGetHeight(CGDisplayModeRef _Nullable mode) + __attribute__((availability(macosx,introduced=10.6))); + + + + +extern CFStringRef _Nullable CGDisplayModeCopyPixelEncoding( + CGDisplayModeRef _Nullable mode) + __attribute__((availability(macosx,introduced=10.6,deprecated=10.11))); + + + + +extern double CGDisplayModeGetRefreshRate(CGDisplayModeRef _Nullable mode) + __attribute__((availability(macosx,introduced=10.6))); + + + +extern uint32_t CGDisplayModeGetIOFlags(CGDisplayModeRef _Nullable mode) + __attribute__((availability(macosx,introduced=10.6))); + + + +extern int32_t CGDisplayModeGetIODisplayModeID( + CGDisplayModeRef _Nullable mode) + __attribute__((availability(macosx,introduced=10.6))); + + + + +extern _Bool CGDisplayModeIsUsableForDesktopGUI( + CGDisplayModeRef _Nullable mode) + __attribute__((availability(macosx,introduced=10.6))); + + + +extern CFTypeID CGDisplayModeGetTypeID(void) + __attribute__((availability(macosx,introduced=10.6))); + + + + +extern CGDisplayModeRef _Nullable CGDisplayModeRetain( + CGDisplayModeRef _Nullable mode) + __attribute__((availability(macosx,introduced=10.6))); + + + + +extern void CGDisplayModeRelease(CGDisplayModeRef _Nullable mode) + __attribute__((availability(macosx,introduced=10.6))); + + + +extern size_t CGDisplayModeGetPixelWidth(CGDisplayModeRef _Nullable mode) + __attribute__((availability(macosx,introduced=10.8))); + + + +extern size_t CGDisplayModeGetPixelHeight(CGDisplayModeRef _Nullable mode) + __attribute__((availability(macosx,introduced=10.8))); +typedef float CGGammaValue; + +extern CGError CGSetDisplayTransferByFormula(CGDirectDisplayID display, + CGGammaValue redMin, CGGammaValue redMax, CGGammaValue redGamma, + CGGammaValue greenMin, CGGammaValue greenMax, CGGammaValue greenGamma, + CGGammaValue blueMin, CGGammaValue blueMax, CGGammaValue blueGamma) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern CGError CGGetDisplayTransferByFormula(CGDirectDisplayID display, + CGGammaValue * _Nullable redMin, CGGammaValue * _Nullable redMax, + CGGammaValue * _Nullable redGamma, + CGGammaValue * _Nullable greenMin, CGGammaValue * _Nullable greenMax, + CGGammaValue * _Nullable greenGamma, + CGGammaValue * _Nullable blueMin, CGGammaValue * _Nullable blueMax, + CGGammaValue * _Nullable blueGamma) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern uint32_t CGDisplayGammaTableCapacity(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.3))); +extern CGError CGSetDisplayTransferByTable(CGDirectDisplayID display, + uint32_t tableSize, const CGGammaValue * _Nullable redTable, + const CGGammaValue * _Nullable greenTable, + const CGGammaValue * _Nullable blueTable) + __attribute__((availability(macosx,introduced=10.0))); + + + + + + + +extern CGError CGGetDisplayTransferByTable(CGDirectDisplayID display, + uint32_t capacity, CGGammaValue * _Nullable redTable, + CGGammaValue * _Nullable greenTable, + CGGammaValue * _Nullable blueTable, uint32_t * _Nullable sampleCount) + __attribute__((availability(macosx,introduced=10.0))); +extern CGError CGSetDisplayTransferByByteTable(CGDirectDisplayID display, + uint32_t tableSize, const uint8_t * redTable, + const uint8_t * greenTable, const uint8_t * blueTable) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGDisplayRestoreColorSyncSettings(void) + __attribute__((availability(macosx,introduced=10.0))); + + + + +typedef uint32_t CGCaptureOptions; enum { + kCGCaptureNoOptions = 0, + kCGCaptureNoFill __attribute__((deprecated)) = (1 << 0) +}; + + + +extern boolean_t CGDisplayIsCaptured(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); + + + +extern CGError CGDisplayCapture(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGError CGDisplayCaptureWithOptions(CGDirectDisplayID display, + CGCaptureOptions options) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern CGError CGDisplayRelease(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern CGError CGCaptureAllDisplays(void) + __attribute__((availability(macosx,introduced=10.0))); + + + + + +extern CGError CGCaptureAllDisplaysWithOptions(CGCaptureOptions options) + __attribute__((availability(macosx,introduced=10.3))); + + + + + +extern CGError CGReleaseAllDisplays(void) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern uint32_t CGShieldingWindowID(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern int32_t CGShieldingWindowLevel(void) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGImageRef _Nullable CGDisplayCreateImage(CGDirectDisplayID displayID) + __attribute__((availability(macosx,introduced=10.6))); + + + + + + +extern CGImageRef _Nullable CGDisplayCreateImageForRect( + CGDirectDisplayID display, CGRect rect) + __attribute__((availability(macosx,introduced=10.6))); + + + + +extern CGError CGDisplayHideCursor(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern CGError CGDisplayShowCursor(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.0))); + + + + + + +extern CGError CGDisplayMoveCursorToPoint(CGDirectDisplayID display, + CGPoint point) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGGetLastMouseDelta(int32_t *_Nullable deltaX, + int32_t * _Nullable deltaY) + __attribute__((availability(macosx,introduced=10.0))); +extern CGContextRef _Nullable CGDisplayGetDrawingContext( + CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.3))); +typedef uint32_t CGDisplayCount; +typedef CGError CGDisplayErr; + + + + + +extern CFArrayRef _Nullable CGDisplayAvailableModes(CGDirectDisplayID dsp) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + +extern CFDictionaryRef _Nullable CGDisplayBestModeForParameters( + CGDirectDisplayID display, size_t bitsPerPixel, size_t width, size_t height, + boolean_t * _Nullable exactMatch) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + +extern CFDictionaryRef _Nullable CGDisplayBestModeForParametersAndRefreshRate( + CGDirectDisplayID display, size_t bitsPerPixel, size_t width, size_t height, + CGRefreshRate refreshRate, boolean_t * _Nullable exactMatch) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + +extern CFDictionaryRef _Nullable CGDisplayCurrentMode( + CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + +extern CGError CGDisplaySwitchToMode(CGDirectDisplayID display, + CFDictionaryRef _Nullable mode) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +struct CGDeviceColor { + float red; + float green; + float blue; +}; +typedef struct CGDeviceColor CGDeviceColor; +typedef struct _CGDisplayConfigRef *CGDisplayConfigRef; + + + + + + +extern CGError CGBeginDisplayConfiguration( + CGDisplayConfigRef _Nullable * _Nullable config) + __attribute__((availability(macosx,introduced=10.0))); +extern CGError CGConfigureDisplayOrigin( + CGDisplayConfigRef _Nullable config, + CGDirectDisplayID display, int32_t x, int32_t y) + __attribute__((availability(macosx,introduced=10.0))); +extern CGError CGConfigureDisplayWithDisplayMode( + CGDisplayConfigRef _Nullable config, + CGDirectDisplayID display, CGDisplayModeRef _Nullable mode, + CFDictionaryRef _Nullable options) + __attribute__((availability(macosx,introduced=10.6))); +extern CGError CGConfigureDisplayStereoOperation( + CGDisplayConfigRef _Nullable config, + CGDirectDisplayID display, boolean_t stereo, boolean_t forceBlueLine) + __attribute__((availability(macosx,introduced=10.4))); +extern CGError CGConfigureDisplayMirrorOfDisplay( + CGDisplayConfigRef _Nullable config, + CGDirectDisplayID display, CGDirectDisplayID master) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern CGError CGCancelDisplayConfiguration( + CGDisplayConfigRef _Nullable config) + __attribute__((availability(macosx,introduced=10.0))); +typedef uint32_t CGConfigureOption; enum { + kCGConfigureForAppOnly = 0, + kCGConfigureForSession = 1, + kCGConfigurePermanently = 2 +}; + +extern CGError CGCompleteDisplayConfiguration( + CGDisplayConfigRef _Nullable config, + CGConfigureOption option) + __attribute__((availability(macosx,introduced=10.0))); + + + + +extern void CGRestorePermanentDisplayConfiguration(void) + __attribute__((availability(macosx,introduced=10.2))); +typedef uint32_t CGDisplayChangeSummaryFlags; enum { + kCGDisplayBeginConfigurationFlag = (1 << 0), + kCGDisplayMovedFlag = (1 << 1), + kCGDisplaySetMainFlag = (1 << 2), + kCGDisplaySetModeFlag = (1 << 3), + kCGDisplayAddFlag = (1 << 4), + kCGDisplayRemoveFlag = (1 << 5), + kCGDisplayEnabledFlag = (1 << 8), + kCGDisplayDisabledFlag = (1 << 9), + kCGDisplayMirrorFlag = (1 << 10), + kCGDisplayUnMirrorFlag = (1 << 11), + kCGDisplayDesktopShapeChangedFlag = (1 << 12) +}; + + + + +typedef void(*CGDisplayReconfigurationCallBack)(CGDirectDisplayID display, + CGDisplayChangeSummaryFlags flags, void * _Nullable userInfo); + + + + + +extern CGError CGDisplayRegisterReconfigurationCallback( + CGDisplayReconfigurationCallBack _Nullable callback, + void * _Nullable userInfo) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern CGError CGDisplayRemoveReconfigurationCallback( + CGDisplayReconfigurationCallBack _Nullable callback, + void * _Nullable userInfo) + __attribute__((availability(macosx,introduced=10.3))); +extern CGError CGDisplaySetStereoOperation(CGDirectDisplayID display, + boolean_t stereo, boolean_t forceBlueLine, CGConfigureOption option) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern boolean_t CGDisplayIsActive(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern boolean_t CGDisplayIsAsleep(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.2))); + + + +extern boolean_t CGDisplayIsOnline(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern boolean_t CGDisplayIsMain(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern boolean_t CGDisplayIsBuiltin(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.2))); + + + +extern boolean_t CGDisplayIsInMirrorSet(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern boolean_t CGDisplayIsAlwaysInMirrorSet(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern boolean_t CGDisplayIsInHWMirrorSet(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.2))); + + + + + +extern CGDirectDisplayID CGDisplayMirrorsDisplay(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern boolean_t CGDisplayUsesOpenGLAcceleration(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern boolean_t CGDisplayIsStereo(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CGDirectDisplayID CGDisplayPrimaryDisplay(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.2))); + + + +extern uint32_t CGDisplayUnitNumber(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.2))); + + + +extern uint32_t CGDisplayVendorNumber(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.2))); + + + +extern uint32_t CGDisplayModelNumber(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.2))); + + + +extern uint32_t CGDisplaySerialNumber(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.2))); + + + +extern io_service_t CGDisplayIOServicePort(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.9))); +extern CGSize CGDisplayScreenSize(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.3))); +extern double CGDisplayRotation(CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.5))); + + + +extern CGColorSpaceRef CGDisplayCopyColorSpace( + CGDirectDisplayID display) + __attribute__((availability(macosx,introduced=10.5))); + + + +extern CGError CGConfigureDisplayMode(CGDisplayConfigRef _Nullable config, + CGDirectDisplayID display, CFDictionaryRef _Nullable mode) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +typedef uint32_t CGDisplayFadeReservationToken; + + +typedef float CGDisplayBlendFraction; +typedef float CGDisplayFadeInterval; +extern CGError CGConfigureDisplayFadeEffect( + CGDisplayConfigRef _Nullable config, + CGDisplayFadeInterval fadeOutSeconds, CGDisplayFadeInterval fadeInSeconds, + float fadeRed, float fadeGreen, float fadeBlue) + __attribute__((availability(macosx,introduced=10.2))); +typedef float CGDisplayReservationInterval; + + + +extern CGError CGAcquireDisplayFadeReservation(CGDisplayReservationInterval + seconds, CGDisplayFadeReservationToken * _Nullable token) + __attribute__((availability(macosx,introduced=10.2))); +extern CGError CGReleaseDisplayFadeReservation( + CGDisplayFadeReservationToken token) + __attribute__((availability(macosx,introduced=10.2))); +extern CGError CGDisplayFade(CGDisplayFadeReservationToken token, + CGDisplayFadeInterval duration, CGDisplayBlendFraction startBlend, + CGDisplayBlendFraction endBlend, float redBlend, float greenBlend, + float blueBlend, boolean_t synchronous) + __attribute__((availability(macosx,introduced=10.2))); + + + + +extern boolean_t CGDisplayFadeOperationInProgress(void) + __attribute__((availability(macosx,introduced=10.2,deprecated=10.9))); +typedef struct CGDisplayStream *CGDisplayStreamRef; +typedef const struct CGDisplayStreamUpdate *CGDisplayStreamUpdateRef; +typedef int32_t CGDisplayStreamUpdateRectType; enum { + kCGDisplayStreamUpdateRefreshedRects, + kCGDisplayStreamUpdateMovedRects, + kCGDisplayStreamUpdateDirtyRects, + kCGDisplayStreamUpdateReducedDirtyRects, +}; +typedef int32_t CGDisplayStreamFrameStatus; enum{ + kCGDisplayStreamFrameStatusFrameComplete, + kCGDisplayStreamFrameStatusFrameIdle, + kCGDisplayStreamFrameStatusFrameBlank, + kCGDisplayStreamFrameStatusStopped, +}; +typedef void (^CGDisplayStreamFrameAvailableHandler)(CGDisplayStreamFrameStatus status, uint64_t displayTime, + IOSurfaceRef _Nullable frameSurface, + CGDisplayStreamUpdateRef _Nullable updateRef); + + + + + + +extern CFTypeID CGDisplayStreamUpdateGetTypeID(void) + __attribute__((availability(macosx,introduced=10.8))); +extern const CGRect * _Nullable CGDisplayStreamUpdateGetRects(CGDisplayStreamUpdateRef _Nullable updateRef, + CGDisplayStreamUpdateRectType rectType, size_t * rectCount) + __attribute__((availability(macosx,introduced=10.8))); +extern CGDisplayStreamUpdateRef _Nullable CGDisplayStreamUpdateCreateMergedUpdate( + CGDisplayStreamUpdateRef _Nullable firstUpdate, + CGDisplayStreamUpdateRef _Nullable secondUpdate) + __attribute__((availability(macosx,introduced=10.8))); +extern void CGDisplayStreamUpdateGetMovedRectsDelta(CGDisplayStreamUpdateRef _Nullable updateRef, + CGFloat * dx, CGFloat * dy) + __attribute__((availability(macosx,introduced=10.8))); +extern size_t CGDisplayStreamUpdateGetDropCount(CGDisplayStreamUpdateRef _Nullable updateRef) + __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGDisplayStreamSourceRect __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGDisplayStreamDestinationRect __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGDisplayStreamPreserveAspectRatio __attribute__((availability(macosx,introduced=10.8))); + + + + + +extern const CFStringRef kCGDisplayStreamColorSpace __attribute__((availability(macosx,introduced=10.8))); + + + + + +extern const CFStringRef kCGDisplayStreamMinimumFrameTime __attribute__((availability(macosx,introduced=10.8))); + + + + + +extern const CFStringRef kCGDisplayStreamShowCursor __attribute__((availability(macosx,introduced=10.8))); + + + + + +extern const CFStringRef kCGDisplayStreamQueueDepth __attribute__((availability(macosx,introduced=10.8))); + + + + + + +extern const CFStringRef kCGDisplayStreamYCbCrMatrix __attribute__((availability(macosx,introduced=10.8))); + + +extern const CFStringRef kCGDisplayStreamYCbCrMatrix_ITU_R_709_2 __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGDisplayStreamYCbCrMatrix_ITU_R_601_4 __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGDisplayStreamYCbCrMatrix_SMPTE_240M_1995 __attribute__((availability(macosx,introduced=10.8))); + + + + + + +extern CFTypeID CGDisplayStreamGetTypeID(void) + __attribute__((availability(macosx,introduced=10.8))); +extern CGDisplayStreamRef _Nullable CGDisplayStreamCreate(CGDirectDisplayID display, + size_t outputWidth, size_t outputHeight, int32_t pixelFormat, CFDictionaryRef _Nullable properties, + CGDisplayStreamFrameAvailableHandler _Nullable handler) + __attribute__((availability(macosx,introduced=10.8))); +extern CGDisplayStreamRef _Nullable CGDisplayStreamCreateWithDispatchQueue(CGDirectDisplayID display, + size_t outputWidth, size_t outputHeight, int32_t pixelFormat, CFDictionaryRef _Nullable properties, + dispatch_queue_t queue, CGDisplayStreamFrameAvailableHandler _Nullable handler) + __attribute__((availability(macosx,introduced=10.8))); + + + + + + + +extern CGError CGDisplayStreamStart(CGDisplayStreamRef _Nullable displayStream) + __attribute__((availability(macosx,introduced=10.8))); +extern CGError CGDisplayStreamStop(CGDisplayStreamRef _Nullable displayStream) + __attribute__((availability(macosx,introduced=10.8))); +extern CFRunLoopSourceRef _Nullable CGDisplayStreamGetRunLoopSource(CGDisplayStreamRef _Nullable displayStream) + __attribute__((availability(macosx,introduced=10.8))); +typedef CGError CGEventErr; + + + + + + +typedef uint32_t CGButtonCount; + + + + +typedef uint32_t CGWheelCount; + + + + +typedef uint16_t CGCharCode; + + + +typedef uint16_t CGKeyCode; +typedef void (*CGScreenRefreshCallback)(uint32_t count, + const CGRect * rects, + void *_Nullable userInfo); +extern CGError CGRegisterScreenRefreshCallback( + CGScreenRefreshCallback callback, void * _Nullable userInfo) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void CGUnregisterScreenRefreshCallback( + CGScreenRefreshCallback callback, void * _Nullable userInfo) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern CGError CGWaitForScreenRefreshRects( + CGRect *_Nullable * _Nullable rects, uint32_t * _Nullable count) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); + + + + +typedef uint32_t CGScreenUpdateOperation; enum { + kCGScreenUpdateOperationRefresh = 0, + kCGScreenUpdateOperationMove = (1u << 0), + kCGScreenUpdateOperationReducedDirtyRectangleCount = (1u << 31) +}; +struct CGScreenUpdateMoveDelta { + int32_t dX, dY; +}; +typedef struct CGScreenUpdateMoveDelta CGScreenUpdateMoveDelta; +typedef void (*CGScreenUpdateMoveCallback)(CGScreenUpdateMoveDelta delta, + size_t count, const CGRect * rects, void * _Nullable userInfo); + + + + + +extern CGError CGScreenRegisterMoveCallback( + CGScreenUpdateMoveCallback callback, void * _Nullable userInfo) + __attribute__((availability(macosx,introduced=10.3,deprecated=10.8))); + + + + +extern void CGScreenUnregisterMoveCallback( + CGScreenUpdateMoveCallback callback, void * _Nullable userInfo) + __attribute__((availability(macosx,introduced=10.3,deprecated=10.8))); +extern CGError CGWaitForScreenUpdateRects( + CGScreenUpdateOperation requestedOperations, + CGScreenUpdateOperation * _Nullable currentOperation, + CGRect * _Nullable * _Nullable rects, size_t * _Nullable rectCount, + CGScreenUpdateMoveDelta * _Nullable delta) + __attribute__((availability(macosx,introduced=10.3,deprecated=10.8))); + + + + +extern void CGReleaseScreenRefreshRects(CGRect * _Nullable rects) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); + + + +extern boolean_t CGCursorIsVisible(void) + __attribute__((availability(macosx,introduced=10.3,deprecated=10.9))); +extern boolean_t CGCursorIsDrawnInFramebuffer(void) + __attribute__((availability(macosx,introduced=10.3,deprecated=10.9))); + + + + +extern CGError CGWarpMouseCursorPosition(CGPoint newCursorPosition) + __attribute__((availability(macosx,introduced=10.0))); +extern CGError CGAssociateMouseAndMouseCursorPosition(boolean_t connected) + __attribute__((availability(macosx,introduced=10.0))); +extern CFMachPortRef _Nullable CGWindowServerCreateServerPort(void) + __attribute__((availability(macosx,introduced=10.8))); + + + + +extern CGError CGEnableEventStateCombining(boolean_t combineState) + __attribute__((availability(macosx,introduced=10.1,deprecated=10.6))); + + + + + +extern CGError CGInhibitLocalEvents(boolean_t inhibit) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern CGError CGPostMouseEvent(CGPoint mouseCursorPosition, + boolean_t updateMouseCursorPosition, CGButtonCount buttonCount, + boolean_t mouseButtonDown, ... ) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +extern CGError CGPostScrollWheelEvent(CGWheelCount wheelCount, + int32_t wheel1, ... ) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + +extern CGError CGPostKeyboardEvent(CGCharCode keyChar, CGKeyCode virtualKey, + boolean_t keyDown) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + + +typedef uint32_t CGEventFilterMask; enum { + kCGEventFilterMaskPermitLocalMouseEvents = 0x00000001, + kCGEventFilterMaskPermitLocalKeyboardEvents = 0x00000002, + kCGEventFilterMaskPermitSystemDefinedEvents = 0x00000004 +}; +typedef uint32_t CGEventSuppressionState; enum { + kCGEventSuppressionStateSuppressionInterval = 0, + kCGEventSuppressionStateRemoteMouseDrag, + kCGNumberOfEventSuppressionStates +}; + + + + +extern CGError CGSetLocalEventsFilterDuringSuppressionState( + CGEventFilterMask filter, CGEventSuppressionState state) + __attribute__((availability(macosx,introduced=10.1,deprecated=10.6))); + + + + +extern CGError CGSetLocalEventsSuppressionInterval(CFTimeInterval seconds) + __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + + + +extern CFMachPortRef _Nullable CGWindowServerCFMachPort(void) __attribute__((cf_returns_retained)) + __attribute__((availability(macosx,introduced=10.1,deprecated=10.8))); +typedef uint32_t CGRectCount; +typedef int64_t __attribute__((__aligned__((sizeof(int64_t))))) + OSAtomic_int64_aligned64_t; +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_add" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_add" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_add" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_add" "_explicit(memory_order_relaxed) from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +int32_t OSAtomicAdd32( int32_t __theAmount, volatile int32_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_add" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_add" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_add" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_add" "() from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +int32_t OSAtomicAdd32Barrier( int32_t __theAmount, volatile int32_t *__theValue ); + + + + + + + +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_add" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_add" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_add" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_add" "_explicit(memory_order_relaxed) from instead"))) +__attribute__((availability(macosx,introduced=10.10))) +int32_t OSAtomicIncrement32( volatile int32_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_add" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_add" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_add" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_add" "() from instead"))) +__attribute__((availability(macosx,introduced=10.10))) +int32_t OSAtomicIncrement32Barrier( volatile int32_t *__theValue ); + + + + + +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_sub" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_sub" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_sub" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_sub" "_explicit(memory_order_relaxed) from instead"))) +__attribute__((availability(macosx,introduced=10.10))) +int32_t OSAtomicDecrement32( volatile int32_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_sub" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_sub" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_sub" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_sub" "() from instead"))) +__attribute__((availability(macosx,introduced=10.10))) +int32_t OSAtomicDecrement32Barrier( volatile int32_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_add" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_add" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_add" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_add" "_explicit(memory_order_relaxed) from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +int64_t OSAtomicAdd64( int64_t __theAmount, + volatile OSAtomic_int64_aligned64_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_add" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_add" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_add" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_add" "() from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +int64_t OSAtomicAdd64Barrier( int64_t __theAmount, + volatile OSAtomic_int64_aligned64_t *__theValue ); + + + + + + + +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_add" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_add" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_add" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_add" "_explicit(memory_order_relaxed) from instead"))) +__attribute__((availability(macosx,introduced=10.10))) +int64_t OSAtomicIncrement64( volatile OSAtomic_int64_aligned64_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_add" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_add" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_add" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_add" "() from instead"))) +__attribute__((availability(macosx,introduced=10.10))) +int64_t OSAtomicIncrement64Barrier( volatile OSAtomic_int64_aligned64_t *__theValue ); + + + + + +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_sub" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_sub" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_sub" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_sub" "_explicit(memory_order_relaxed) from instead"))) +__attribute__((availability(macosx,introduced=10.10))) +int64_t OSAtomicDecrement64( volatile OSAtomic_int64_aligned64_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_sub" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_sub" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_sub" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_sub" "() from instead"))) +__attribute__((availability(macosx,introduced=10.10))) +int64_t OSAtomicDecrement64Barrier( volatile OSAtomic_int64_aligned64_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_or" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_or" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_or" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_or" "_explicit(memory_order_relaxed) from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +int32_t OSAtomicOr32( uint32_t __theMask, volatile uint32_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_or" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_or" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_or" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_or" "() from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +int32_t OSAtomicOr32Barrier( uint32_t __theMask, volatile uint32_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_or" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_or" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_or" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_or" "_explicit(memory_order_relaxed) from instead"))) +__attribute__((availability(macosx,introduced=10.5))) +int32_t OSAtomicOr32Orig( uint32_t __theMask, volatile uint32_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_or" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_or" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_or" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_or" "() from instead"))) +__attribute__((availability(macosx,introduced=10.5))) +int32_t OSAtomicOr32OrigBarrier( uint32_t __theMask, volatile uint32_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_and" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_and" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_and" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_and" "_explicit(memory_order_relaxed) from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +int32_t OSAtomicAnd32( uint32_t __theMask, volatile uint32_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_and" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_and" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_and" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_and" "() from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +int32_t OSAtomicAnd32Barrier( uint32_t __theMask, volatile uint32_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_and" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_and" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_and" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_and" "_explicit(memory_order_relaxed) from instead"))) +__attribute__((availability(macosx,introduced=10.5))) +int32_t OSAtomicAnd32Orig( uint32_t __theMask, volatile uint32_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_and" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_and" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_and" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_and" "() from instead"))) +__attribute__((availability(macosx,introduced=10.5))) +int32_t OSAtomicAnd32OrigBarrier( uint32_t __theMask, volatile uint32_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_xor" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_xor" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_xor" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_xor" "_explicit(memory_order_relaxed) from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +int32_t OSAtomicXor32( uint32_t __theMask, volatile uint32_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_xor" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_xor" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_xor" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_xor" "() from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +int32_t OSAtomicXor32Barrier( uint32_t __theMask, volatile uint32_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_xor" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_xor" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_xor" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_xor" "_explicit(memory_order_relaxed) from instead"))) +__attribute__((availability(macosx,introduced=10.5))) +int32_t OSAtomicXor32Orig( uint32_t __theMask, volatile uint32_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_xor" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_xor" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_xor" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_xor" "() from instead"))) +__attribute__((availability(macosx,introduced=10.5))) +int32_t OSAtomicXor32OrigBarrier( uint32_t __theMask, volatile uint32_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_compare_exchange_strong" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_compare_exchange_strong" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_compare_exchange_strong" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_compare_exchange_strong" "_explicit(memory_order_relaxed) from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +_Bool OSAtomicCompareAndSwap32( int32_t __oldValue, int32_t __newValue, volatile int32_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_compare_exchange_strong" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_compare_exchange_strong" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_compare_exchange_strong" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_compare_exchange_strong" "() from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +_Bool OSAtomicCompareAndSwap32Barrier( int32_t __oldValue, int32_t __newValue, volatile int32_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_compare_exchange_strong" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_compare_exchange_strong" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_compare_exchange_strong" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_compare_exchange_strong" "_explicit(memory_order_relaxed) from instead"))) +__attribute__((availability(macosx,introduced=10.5))) +_Bool OSAtomicCompareAndSwapPtr( void *__oldValue, void *__newValue, void * volatile *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_compare_exchange_strong" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_compare_exchange_strong" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_compare_exchange_strong" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_compare_exchange_strong" "() from instead"))) +__attribute__((availability(macosx,introduced=10.5))) +_Bool OSAtomicCompareAndSwapPtrBarrier( void *__oldValue, void *__newValue, void * volatile *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_compare_exchange_strong" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_compare_exchange_strong" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_compare_exchange_strong" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_compare_exchange_strong" "_explicit(memory_order_relaxed) from instead"))) +__attribute__((availability(macosx,introduced=10.5))) +_Bool OSAtomicCompareAndSwapInt( int __oldValue, int __newValue, volatile int *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_compare_exchange_strong" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_compare_exchange_strong" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_compare_exchange_strong" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_compare_exchange_strong" "() from instead"))) +__attribute__((availability(macosx,introduced=10.5))) +_Bool OSAtomicCompareAndSwapIntBarrier( int __oldValue, int __newValue, volatile int *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_compare_exchange_strong" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_compare_exchange_strong" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_compare_exchange_strong" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_compare_exchange_strong" "_explicit(memory_order_relaxed) from instead"))) +__attribute__((availability(macosx,introduced=10.5))) +_Bool OSAtomicCompareAndSwapLong( long __oldValue, long __newValue, volatile long *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_compare_exchange_strong" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_compare_exchange_strong" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_compare_exchange_strong" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_compare_exchange_strong" "() from instead"))) +__attribute__((availability(macosx,introduced=10.5))) +_Bool OSAtomicCompareAndSwapLongBarrier( long __oldValue, long __newValue, volatile long *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_compare_exchange_strong" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_compare_exchange_strong" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_compare_exchange_strong" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_compare_exchange_strong" "_explicit(memory_order_relaxed) from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +_Bool OSAtomicCompareAndSwap64( int64_t __oldValue, int64_t __newValue, + volatile OSAtomic_int64_aligned64_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_compare_exchange_strong" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_compare_exchange_strong" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_compare_exchange_strong" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_compare_exchange_strong" "() from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +_Bool OSAtomicCompareAndSwap64Barrier( int64_t __oldValue, int64_t __newValue, + volatile OSAtomic_int64_aligned64_t *__theValue ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_or" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_or" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_or" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_or" "_explicit(memory_order_relaxed) from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +_Bool OSAtomicTestAndSet( uint32_t __n, volatile void *__theAddress ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_or" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_or" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_or" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_or" "() from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +_Bool OSAtomicTestAndSetBarrier( uint32_t __n, volatile void *__theAddress ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_and" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_and" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_and" "_explicit(memory_order_relaxed) from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_and" "_explicit(memory_order_relaxed) from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +_Bool OSAtomicTestAndClear( uint32_t __n, volatile void *__theAddress ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_fetch_and" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_fetch_and" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_fetch_and" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_fetch_and" "() from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +_Bool OSAtomicTestAndClearBarrier( uint32_t __n, volatile void *__theAddress ); +__attribute__((availability(macosx,deprecated=10.12,message="Use " "atomic_thread_fence" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "atomic_thread_fence" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "atomic_thread_fence" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "atomic_thread_fence" "() from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +void OSMemoryBarrier( void ); +typedef int32_t OSSpinLock __attribute__((availability(macosx,deprecated=10.12,message="Use " "os_unfair_lock" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "os_unfair_lock" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "os_unfair_lock" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "os_unfair_lock" "() from instead"))); + + + + + + + +__attribute__((availability(macosx,deprecated=10.12,message="Use " "os_unfair_lock_trylock" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "os_unfair_lock_trylock" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "os_unfair_lock_trylock" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "os_unfair_lock_trylock" "() from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +_Bool OSSpinLockTry( volatile OSSpinLock *__lock ); + + + + + + + +__attribute__((availability(macosx,deprecated=10.12,message="Use " "os_unfair_lock_lock" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "os_unfair_lock_lock" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "os_unfair_lock_lock" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "os_unfair_lock_lock" "() from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +void OSSpinLockLock( volatile OSSpinLock *__lock ); + + + +__attribute__((availability(macosx,deprecated=10.12,message="Use " "os_unfair_lock_unlock" "() from instead"))) __attribute__((availability(ios,deprecated=10.0,message="Use " "os_unfair_lock_unlock" "() from instead"))) __attribute__((availability(tvos,deprecated=10.0,message="Use " "os_unfair_lock_unlock" "() from instead"))) __attribute__((availability(watchos,deprecated=3.0,message="Use " "os_unfair_lock_unlock" "() from instead"))) +__attribute__((availability(macosx,introduced=10.4))) +void OSSpinLockUnlock( volatile OSSpinLock *__lock ); +typedef volatile struct { + void *opaque1; + long opaque2; +} __attribute__ ((aligned (16))) OSQueueHead; +__attribute__((availability(macosx,introduced=10.5))) +void OSAtomicEnqueue( OSQueueHead *__list, void *__new, size_t __offset); +__attribute__((availability(macosx,introduced=10.5))) +void* OSAtomicDequeue( OSQueueHead *__list, size_t __offset); +typedef volatile struct { + void *opaque1; + void *opaque2; + int opaque3; +} __attribute__ ((aligned (16))) OSFifoQueueHead; +__attribute__((availability(macosx,introduced=10.7))) +void OSAtomicFifoEnqueue( OSFifoQueueHead *__list, void *__new, size_t __offset); +__attribute__((availability(macosx,introduced=10.7))) +void* OSAtomicFifoDequeue( OSFifoQueueHead *__list, size_t __offset); +typedef SInt32 IOIndex; +typedef UInt32 IOSelect; +typedef UInt32 IOFixed1616; +typedef UInt32 IODisplayVendorID; +typedef UInt32 IODisplayProductID; + +typedef SInt32 IODisplayModeID; +enum { + + kIODisplayModeIDBootProgrammable = (IODisplayModeID)0xFFFFFFFB, + + kIODisplayModeIDReservedBase = (IODisplayModeID)0x80000000 +}; + +enum { + kIOMaxPixelBits = 64 +}; +typedef char IOPixelEncoding[ kIOMaxPixelBits ]; +enum { + kIOCLUTPixels = 0, + kIOFixedCLUTPixels = 1, + kIORGBDirectPixels = 2, + kIOMonoDirectPixels = 3, + kIOMonoInverseDirectPixels = 4, + kIORGBSignedDirectPixels = 5, + kIORGBSignedFloatingPointPixels = 6 +}; +struct IOPixelInformation { + UInt32 bytesPerRow; + UInt32 bytesPerPlane; + UInt32 bitsPerPixel; + UInt32 pixelType; + UInt32 componentCount; + UInt32 bitsPerComponent; + UInt32 componentMasks[ 8 * 2 ]; + IOPixelEncoding pixelFormat; + UInt32 flags; + UInt32 activeWidth; + UInt32 activeHeight; + UInt32 reserved[ 2 ]; +}; +typedef struct IOPixelInformation IOPixelInformation; + + +typedef UInt32 IOAppleTimingID; +struct IODisplayModeInformation { + UInt32 nominalWidth; + UInt32 nominalHeight; + IOFixed1616 refreshRate; + IOIndex maxDepthIndex; + UInt32 flags; + UInt16 imageWidth; + UInt16 imageHeight; + UInt32 reserved[ 3 ]; +}; +typedef struct IODisplayModeInformation IODisplayModeInformation; + + +enum { + kDisplayModeSafetyFlags = 0x00000007, + + kDisplayModeAlwaysShowFlag = 0x00000008, + kDisplayModeNeverShowFlag = 0x00000080, + kDisplayModeNotResizeFlag = 0x00000010, + kDisplayModeRequiresPanFlag = 0x00000020, + + kDisplayModeInterlacedFlag = 0x00000040, + + kDisplayModeSimulscanFlag = 0x00000100, + kDisplayModeBuiltInFlag = 0x00000400, + kDisplayModeNotPresetFlag = 0x00000200, + kDisplayModeStretchedFlag = 0x00000800, + kDisplayModeNotGraphicsQualityFlag = 0x00001000, + kDisplayModeValidateAgainstDisplay = 0x00002000, + kDisplayModeTelevisionFlag = 0x00100000, + kDisplayModeValidForMirroringFlag = 0x00200000, + kDisplayModeAcceleratorBackedFlag = 0x00400000, + kDisplayModeValidForHiResFlag = 0x00800000, + kDisplayModeValidForAirPlayFlag = 0x01000000, + kDisplayModeNativeFlag = 0x02000000 +}; +enum { + kDisplayModeValidFlag = 0x00000001, + kDisplayModeSafeFlag = 0x00000002, + kDisplayModeDefaultFlag = 0x00000004 +}; + + + + +struct IOFramebufferInformation { + IOPhysicalAddress baseAddress; + UInt32 activeWidth; + UInt32 activeHeight; + IOByteCount bytesPerRow; + IOByteCount bytesPerPlane; + UInt32 bitsPerPixel; + UInt32 pixelType; + UInt32 flags; + UInt32 reserved[ 4 ]; +}; +typedef struct IOFramebufferInformation IOFramebufferInformation; + + + +enum { + kFramebufferSupportsCopybackCache = 0x00010000, + kFramebufferSupportsWritethruCache = 0x00020000, + kFramebufferSupportsGammaCorrection = 0x00040000, + kFramebufferDisableAltivecAccess = 0x00080000 +}; + + +typedef IOIndex IOPixelAperture; +enum { + kIOFBSystemAperture = 0 +}; + + + +typedef UInt16 IOColorComponent; +struct IOColorEntry { + UInt16 index; + IOColorComponent red; + IOColorComponent green; + IOColorComponent blue; +}; +typedef struct IOColorEntry IOColorEntry; + + +enum { + kSetCLUTByValue = 0x00000001, + kSetCLUTImmediately = 0x00000002, + kSetCLUTWithLuminance = 0x00000004 +}; + + + +enum { + kIOPowerStateAttribute = 'pwrs', + kIOPowerAttribute = 'powr', + kIODriverPowerAttribute = 'dpow', + kIOHardwareCursorAttribute = 'crsr', + + kIOMirrorAttribute = 'mirr', + kIOMirrorDefaultAttribute = 'mrdf', + + kIOCapturedAttribute = 'capd', + + kIOCursorControlAttribute = 'crsc', + + kIOSystemPowerAttribute = 'spwr', + kIOWindowServerActiveAttribute = 'wsrv', + kIOVRAMSaveAttribute = 'vrsv', + kIODeferCLUTSetAttribute = 'vclt', + + kIOClamshellStateAttribute = 'clam', + + kIOFBDisplayPortTrainingAttribute = 'dpta', +}; + + +enum { + kIOWSAA_Unaccelerated = 0, + kIOWSAA_Accelerated = 1, + kIOWSAA_From_Accelerated = 2, + kIOWSAA_To_Accelerated = 3, + kIOWSAA_Sleep = 4, + kIOWSAA_Hibernate = kIOWSAA_Sleep, + kIOWSAA_DriverOpen = 5, + kIOWSAA_Transactional = 0x10, + + kIOWSAA_DeferStart = 0x100, + kIOWSAA_DeferEnd = 0x200, + kIOWSAA_Reserved = 0xF0000000 +}; + + +enum { + kIOMirrorIsPrimary = 0x80000000, + kIOMirrorHWClipped = 0x40000000, + kIOMirrorIsMirrored = 0x20000000 +}; + + +enum { + kIOMirrorDefault = 0x00000001, + kIOMirrorForced = 0x00000002 +}; + + + +struct IODetailedTimingInformationV1 { + + UInt32 pixelClock; + UInt32 horizontalActive; + UInt32 horizontalBlanking; + UInt32 horizontalBorder; + UInt32 horizontalSyncOffset; + UInt32 horizontalSyncWidth; + UInt32 verticalActive; + UInt32 verticalBlanking; + UInt32 verticalBorder; + UInt32 verticalSyncOffset; + UInt32 verticalSyncWidth; +}; +typedef struct IODetailedTimingInformationV1 IODetailedTimingInformationV1; +struct IODetailedTimingInformationV2 { + + UInt32 __reservedA[3]; + UInt32 horizontalScaledInset; + UInt32 verticalScaledInset; + + UInt32 scalerFlags; + UInt32 horizontalScaled; + UInt32 verticalScaled; + + UInt32 signalConfig; + UInt32 signalLevels; + + UInt64 pixelClock; + + UInt64 minPixelClock; + UInt64 maxPixelClock; + + UInt32 horizontalActive; + UInt32 horizontalBlanking; + UInt32 horizontalSyncOffset; + UInt32 horizontalSyncPulseWidth; + + UInt32 verticalActive; + UInt32 verticalBlanking; + UInt32 verticalSyncOffset; + UInt32 verticalSyncPulseWidth; + + UInt32 horizontalBorderLeft; + UInt32 horizontalBorderRight; + UInt32 verticalBorderTop; + UInt32 verticalBorderBottom; + + UInt32 horizontalSyncConfig; + UInt32 horizontalSyncLevel; + UInt32 verticalSyncConfig; + UInt32 verticalSyncLevel; + UInt32 numLinks; + + UInt32 __reservedB[7]; +}; +typedef struct IODetailedTimingInformationV2 IODetailedTimingInformationV2; +typedef struct IODetailedTimingInformationV2 IODetailedTimingInformation; + +struct IOTimingInformation { + IOAppleTimingID appleTimingID; + UInt32 flags; + union { + IODetailedTimingInformationV1 v1; + IODetailedTimingInformationV2 v2; + } detailedInfo; +}; +typedef struct IOTimingInformation IOTimingInformation; + +enum { + + kIODetailedTimingValid = 0x80000000, + kIOScalingInfoValid = 0x40000000 +}; + +enum { + + kIOScaleStretchToFit = 0x00000001, + + kIOScaleRotateFlags = 0x000000f0, + + kIOScaleSwapAxes = 0x00000010, + kIOScaleInvertX = 0x00000020, + kIOScaleInvertY = 0x00000040, + + kIOScaleRotate0 = 0x00000000, + kIOScaleRotate90 = kIOScaleSwapAxes | kIOScaleInvertX, + kIOScaleRotate180 = kIOScaleInvertX | kIOScaleInvertY, + kIOScaleRotate270 = kIOScaleSwapAxes | kIOScaleInvertY +}; + + +struct IOFBDisplayModeDescription { + IODisplayModeInformation info; + IOTimingInformation timingInfo; +}; +typedef struct IOFBDisplayModeDescription IOFBDisplayModeDescription; +struct IODisplayTimingRange +{ + UInt32 __reservedA[2]; + UInt32 version; + UInt32 __reservedB[5]; + + UInt64 minPixelClock; + UInt64 maxPixelClock; + + UInt32 maxPixelError; + UInt32 supportedSyncFlags; + UInt32 supportedSignalLevels; + UInt32 supportedSignalConfigs; + + UInt32 minFrameRate; + UInt32 maxFrameRate; + UInt32 minLineRate; + UInt32 maxLineRate; + + UInt32 maxHorizontalTotal; + UInt32 maxVerticalTotal; + UInt32 __reservedD[2]; + + UInt8 charSizeHorizontalActive; + UInt8 charSizeHorizontalBlanking; + UInt8 charSizeHorizontalSyncOffset; + UInt8 charSizeHorizontalSyncPulse; + + UInt8 charSizeVerticalActive; + UInt8 charSizeVerticalBlanking; + UInt8 charSizeVerticalSyncOffset; + UInt8 charSizeVerticalSyncPulse; + + UInt8 charSizeHorizontalBorderLeft; + UInt8 charSizeHorizontalBorderRight; + UInt8 charSizeVerticalBorderTop; + UInt8 charSizeVerticalBorderBottom; + + UInt8 charSizeHorizontalTotal; + UInt8 charSizeVerticalTotal; + UInt16 __reservedE; + + UInt32 minHorizontalActiveClocks; + UInt32 maxHorizontalActiveClocks; + UInt32 minHorizontalBlankingClocks; + UInt32 maxHorizontalBlankingClocks; + + UInt32 minHorizontalSyncOffsetClocks; + UInt32 maxHorizontalSyncOffsetClocks; + UInt32 minHorizontalPulseWidthClocks; + UInt32 maxHorizontalPulseWidthClocks; + + UInt32 minVerticalActiveClocks; + UInt32 maxVerticalActiveClocks; + UInt32 minVerticalBlankingClocks; + UInt32 maxVerticalBlankingClocks; + + UInt32 minVerticalSyncOffsetClocks; + UInt32 maxVerticalSyncOffsetClocks; + UInt32 minVerticalPulseWidthClocks; + UInt32 maxVerticalPulseWidthClocks; + + UInt32 minHorizontalBorderLeft; + UInt32 maxHorizontalBorderLeft; + UInt32 minHorizontalBorderRight; + UInt32 maxHorizontalBorderRight; + + UInt32 minVerticalBorderTop; + UInt32 maxVerticalBorderTop; + UInt32 minVerticalBorderBottom; + UInt32 maxVerticalBorderBottom; + UInt32 maxNumLinks; + UInt32 minLink0PixelClock; + UInt32 maxLink0PixelClock; + UInt32 minLink1PixelClock; + UInt32 maxLink1PixelClock; + + UInt32 __reservedF[3]; +}; +typedef struct IODisplayTimingRange IODisplayTimingRange; + +enum { + + kIORangeSupportsSignal_0700_0300 = 0x00000001, + kIORangeSupportsSignal_0714_0286 = 0x00000002, + kIORangeSupportsSignal_1000_0400 = 0x00000004, + kIORangeSupportsSignal_0700_0000 = 0x00000008 +}; +enum { + + kIORangeSupportsSeparateSyncs = 0x00000001, + kIORangeSupportsSyncOnGreen = 0x00000002, + kIORangeSupportsCompositeSync = 0x00000004, + kIORangeSupportsVSyncSerration = 0x00000008 +}; +enum { + + kIORangeSupportsInterlacedCEATiming = 0x00000004, + kIORangeSupportsInterlacedCEATimingWithConfirm = 0x00000008 +}; + +enum { + + kIODigitalSignal = 0x00000001, + kIOAnalogSetupExpected = 0x00000002, + kIOInterlacedCEATiming = 0x00000004, + kIONTSCTiming = 0x00000008, + kIOPALTiming = 0x00000010 +}; + +enum { + + kIOAnalogSignalLevel_0700_0300 = 0, + kIOAnalogSignalLevel_0714_0286 = 1, + kIOAnalogSignalLevel_1000_0400 = 2, + kIOAnalogSignalLevel_0700_0000 = 3 +}; + +enum { + + kIOSyncPositivePolarity = 0x00000001 +}; +struct IODisplayScalerInformation { + UInt32 __reservedA[1]; + UInt32 version; + UInt32 __reservedB[2]; + + IOOptionBits scalerFeatures; + UInt32 maxHorizontalPixels; + UInt32 maxVerticalPixels; + UInt32 __reservedC[5]; +}; +typedef struct IODisplayScalerInformation IODisplayScalerInformation; + +enum { + + kIOScaleStretchOnly = 0x00000001, + kIOScaleCanUpSamplePixels = 0x00000002, + kIOScaleCanDownSamplePixels = 0x00000004, + kIOScaleCanScaleInterlaced = 0x00000008, + kIOScaleCanSupportInset = 0x00000010, + kIOScaleCanRotate = 0x00000020, + kIOScaleCanBorderInsetOnly = 0x00000040 +}; + + + +enum { + kOrConnections = 0xffffffe, + kAndConnections = 0xffffffd +}; + +enum { + kConnectionFlags = 'flgs', + kConnectionSyncEnable = 'sync', + kConnectionSyncFlags = 'sycf', + kConnectionSupportsAppleSense = 'asns', + kConnectionSupportsLLDDCSense = 'lddc', + kConnectionSupportsHLDDCSense = 'hddc', + kConnectionEnable = 'enab', + kConnectionCheckEnable = 'cena', + kConnectionProbe = 'prob', + kConnectionChanged = 'chng', + kConnectionPower = 'powr', + kConnectionPostWake = 'pwak', + kConnectionDisplayParameterCount = 'pcnt', + kConnectionDisplayParameters = 'parm', + kConnectionOverscan = 'oscn', + kConnectionVideoBest = 'vbst', + + kConnectionRedGammaScale = 'rgsc', + kConnectionGreenGammaScale = 'ggsc', + kConnectionBlueGammaScale = 'bgsc', + kConnectionGammaScale = 'gsc ', + kConnectionFlushParameters = 'flus', + + kConnectionVBLMultiplier = 'vblm', + + kConnectionHandleDisplayPortEvent = 'dpir', + + kConnectionPanelTimingDisable = 'pnlt', + + kConnectionColorMode = 'cyuv', + kConnectionColorModesSupported = 'colr', + kConnectionColorDepthsSupported = ' bpc', + + kConnectionControllerDepthsSupported = '\0grd', + kConnectionControllerColorDepth = '\0dpd', + kConnectionControllerDitherControl = '\0gdc', + + kConnectionDisplayFlags = 'dflg', + + kConnectionEnableAudio = 'aud ', + kConnectionAudioStreaming = 'auds', +}; + + +enum { + kIOConnectionBuiltIn = 0x00000800, + kIOConnectionStereoSync = 0x00008000 +}; + + +enum { + kIOHSyncDisable = 0x00000001, + kIOVSyncDisable = 0x00000002, + kIOCSyncDisable = 0x00000004, + kIONoSeparateSyncControl = 0x00000040, + kIOTriStateSyncs = 0x00000080, + kIOSyncOnBlue = 0x00000008, + kIOSyncOnGreen = 0x00000010, + kIOSyncOnRed = 0x00000020 +}; + + +enum { + kIODPEventStart = 1, + kIODPEventIdle = 2, + + kIODPEventForceRetrain = 3, + + kIODPEventRemoteControlCommandPending = 256, + kIODPEventAutomatedTestRequest = 257, + kIODPEventContentProtection = 258, + kIODPEventMCCS = 259, + kIODPEventSinkSpecific = 260 +}; +enum +{ + kIODisplayColorMode = kConnectionColorMode, +}; +enum +{ + + kIODisplayRGBColorComponentBitsUnknown = 0x00000000, + kIODisplayRGBColorComponentBits6 = 0x00000001, + kIODisplayRGBColorComponentBits8 = 0x00000002, + kIODisplayRGBColorComponentBits10 = 0x00000004, + kIODisplayRGBColorComponentBits12 = 0x00000008, + kIODisplayRGBColorComponentBits14 = 0x00000010, + kIODisplayRGBColorComponentBits16 = 0x00000020, + + kIODisplayYCbCr444ColorComponentBitsUnknown = 0x00000000, + kIODisplayYCbCr444ColorComponentBits6 = 0x00000100, + kIODisplayYCbCr444ColorComponentBits8 = 0x00000200, + kIODisplayYCbCr444ColorComponentBits10 = 0x00000400, + kIODisplayYCbCr444ColorComponentBits12 = 0x00000800, + kIODisplayYCbCr444ColorComponentBits14 = 0x00001000, + kIODisplayYCbCr444ColorComponentBits16 = 0x00002000, + + kIODisplayYCbCr422ColorComponentBitsUnknown = 0x00000000, + kIODisplayYCbCr422ColorComponentBits6 = 0x00010000, + kIODisplayYCbCr422ColorComponentBits8 = 0x00020000, + kIODisplayYCbCr422ColorComponentBits10 = 0x00040000, + kIODisplayYCbCr422ColorComponentBits12 = 0x00080000, + kIODisplayYCbCr422ColorComponentBits14 = 0x00100000, + kIODisplayYCbCr422ColorComponentBits16 = 0x00200000, +}; + +enum +{ + + kIODisplayDitherDisable = 0x00000000, + kIODisplayDitherSpatial = 0x00000001, + kIODisplayDitherTemporal = 0x00000002, + kIODisplayDitherFrameRateControl = 0x00000004, + kIODisplayDitherDefault = 0x00000080, + kIODisplayDitherAll = 0x000000FF, + kIODisplayDitherRGBShift = 0, + kIODisplayDitherYCbCr444Shift = 8, + kIODisplayDitherYCbCr422Shift = 16, +}; + +enum +{ + + kIODisplayNeedsCEAUnderscan = 0x00000001, +}; + +enum +{ + kIODisplayPowerStateOff = 0, + kIODisplayPowerStateMinUsable = 1, + kIODisplayPowerStateOn = 2, +}; +enum { + + kIOFBServerConnectType = 0, + kIOFBSharedConnectType = 1 +}; + +enum { + + kIOFBUserRequestProbe = 0x00000001 +}; + +struct IOGPoint { + SInt16 x; + SInt16 y; +}; +typedef struct IOGPoint IOGPoint; + +struct IOGSize { + SInt16 width; + SInt16 height; +}; +typedef struct IOGSize IOGSize; + +struct IOGBounds { + SInt16 minx; + SInt16 maxx; + SInt16 miny; + SInt16 maxy; +}; +typedef struct IOGBounds IOGBounds; +enum { + kTransparentEncoding = 0, + kInvertingEncoding +}; + +enum { + kTransparentEncodingShift = (kTransparentEncoding << 1), + kTransparentEncodedPixel = (0x01 << kTransparentEncodingShift), + + kInvertingEncodingShift = (kInvertingEncoding << 1), + kInvertingEncodedPixel = (0x01 << kInvertingEncodingShift) +}; + +enum { + kHardwareCursorDescriptorMajorVersion = 0x0001, + kHardwareCursorDescriptorMinorVersion = 0x0000 +}; +struct IOHardwareCursorDescriptor { + UInt16 majorVersion; + UInt16 minorVersion; + UInt32 height; + UInt32 width; + UInt32 bitDepth; + UInt32 maskBitDepth; + UInt32 numColors; + UInt32 * colorEncodings; + UInt32 flags; + UInt32 supportedSpecialEncodings; + UInt32 specialEncodings[16]; +}; +typedef struct IOHardwareCursorDescriptor IOHardwareCursorDescriptor; + +enum { + kHardwareCursorInfoMajorVersion = 0x0001, + kHardwareCursorInfoMinorVersion = 0x0000 +}; +struct IOHardwareCursorInfo { + UInt16 majorVersion; + UInt16 minorVersion; + UInt32 cursorHeight; + UInt32 cursorWidth; + + IOColorEntry * colorMap; + UInt8 * hardwareCursorData; + UInt16 cursorHotSpotX; + UInt16 cursorHotSpotY; + UInt32 reserved[5]; +}; +typedef struct IOHardwareCursorInfo IOHardwareCursorInfo; + + + +enum { + kIOFBVBLInterruptType = 'vbl ', + kIOFBHBLInterruptType = 'hbl ', + kIOFBFrameInterruptType = 'fram', + + kIOFBConnectInterruptType = 'dci ', + + kIOFBChangedInterruptType = 'chng', + + kIOFBOfflineInterruptType = 'remv', + + kIOFBOnlineInterruptType = 'add ', + + kIOFBDisplayPortInterruptType = 'dpir', + + kIOFBDisplayPortLinkChangeInterruptType = 'dplk', + + kIOFBMCCSInterruptType = 'mccs', + + kIOFBWakeInterruptType = 'vwak' +}; + + +enum { + kIOTimingIDInvalid = 0, + kIOTimingIDApple_FixedRateLCD = 42, + kIOTimingIDApple_512x384_60hz = 130, + kIOTimingIDApple_560x384_60hz = 135, + kIOTimingIDApple_640x480_67hz = 140, + kIOTimingIDApple_640x400_67hz = 145, + kIOTimingIDVESA_640x480_60hz = 150, + kIOTimingIDVESA_640x480_72hz = 152, + kIOTimingIDVESA_640x480_75hz = 154, + kIOTimingIDVESA_640x480_85hz = 158, + kIOTimingIDGTF_640x480_120hz = 159, + kIOTimingIDApple_640x870_75hz = 160, + kIOTimingIDApple_640x818_75hz = 165, + kIOTimingIDApple_832x624_75hz = 170, + kIOTimingIDVESA_800x600_56hz = 180, + kIOTimingIDVESA_800x600_60hz = 182, + kIOTimingIDVESA_800x600_72hz = 184, + kIOTimingIDVESA_800x600_75hz = 186, + kIOTimingIDVESA_800x600_85hz = 188, + kIOTimingIDVESA_1024x768_60hz = 190, + kIOTimingIDVESA_1024x768_70hz = 200, + kIOTimingIDVESA_1024x768_75hz = 204, + kIOTimingIDVESA_1024x768_85hz = 208, + kIOTimingIDApple_1024x768_75hz = 210, + kIOTimingIDVESA_1152x864_75hz = 215, + kIOTimingIDApple_1152x870_75hz = 220, + kIOTimingIDAppleNTSC_ST = 230, + kIOTimingIDAppleNTSC_FF = 232, + kIOTimingIDAppleNTSC_STconv = 234, + kIOTimingIDAppleNTSC_FFconv = 236, + kIOTimingIDApplePAL_ST = 238, + kIOTimingIDApplePAL_FF = 240, + kIOTimingIDApplePAL_STconv = 242, + kIOTimingIDApplePAL_FFconv = 244, + kIOTimingIDVESA_1280x960_75hz = 250, + kIOTimingIDVESA_1280x960_60hz = 252, + kIOTimingIDVESA_1280x960_85hz = 254, + kIOTimingIDVESA_1280x1024_60hz = 260, + kIOTimingIDVESA_1280x1024_75hz = 262, + kIOTimingIDVESA_1280x1024_85hz = 268, + kIOTimingIDVESA_1600x1200_60hz = 280, + kIOTimingIDVESA_1600x1200_65hz = 282, + kIOTimingIDVESA_1600x1200_70hz = 284, + kIOTimingIDVESA_1600x1200_75hz = 286, + kIOTimingIDVESA_1600x1200_80hz = 288, + kIOTimingIDVESA_1600x1200_85hz = 289, + kIOTimingIDVESA_1792x1344_60hz = 296, + kIOTimingIDVESA_1792x1344_75hz = 298, + kIOTimingIDVESA_1856x1392_60hz = 300, + kIOTimingIDVESA_1856x1392_75hz = 302, + kIOTimingIDVESA_1920x1440_60hz = 304, + kIOTimingIDVESA_1920x1440_75hz = 306, + kIOTimingIDSMPTE240M_60hz = 400, + kIOTimingIDFilmRate_48hz = 410, + kIOTimingIDSony_1600x1024_76hz = 500, + kIOTimingIDSony_1920x1080_60hz = 510, + kIOTimingIDSony_1920x1080_72hz = 520, + kIOTimingIDSony_1920x1200_76hz = 540, + kIOTimingIDApple_0x0_0hz_Offline = 550, + kIOTimingIDVESA_848x480_60hz = 570, + kIOTimingIDVESA_1360x768_60hz = 590 +}; +enum { + kIOHibernatePreviewActive = 0x00000001, + kIOHibernatePreviewUpdates = 0x00000002 +}; + + + + + + +enum { + kIOFBAVSignalTypeUnknown = 0x00000000, + kIOFBAVSignalTypeVGA = 0x00000001, + kIOFBAVSignalTypeDVI = 0x00000002, + kIOFBAVSignalTypeHDMI = 0x00000008, + kIOFBAVSignalTypeDP = 0x00000010, +}; + + + +struct IOFBDPLinkConfig +{ + uint16_t version; + uint8_t bitRate; + uint8_t __reservedA[1]; + uint16_t t1Time; + uint16_t t2Time; + uint16_t t3Time; + uint8_t idlePatterns; + uint8_t laneCount; + uint8_t voltage; + uint8_t preEmphasis; + uint8_t downspread; + uint8_t scrambler; + uint8_t maxBitRate; + uint8_t maxLaneCount; + uint8_t maxDownspread; + uint8_t __reservedB[9]; +}; +typedef struct IOFBDPLinkConfig IOFBDPLinkConfig; + +enum +{ + kIOFBBitRateRBR = 0x06, + kIOFBBitRateHBR = 0x0A, + kIOFBBitRateHBR2 = 0x14, +}; + +enum { + kIOFBLinkVoltageLevel0 = 0x00, + kIOFBLinkVoltageLevel1 = 0x01, + kIOFBLinkVoltageLevel2 = 0x02, + kIOFBLinkVoltageLevel3 = 0x03 +}; + +enum +{ + kIOFBLinkPreEmphasisLevel0 = 0x00, + kIOFBLinkPreEmphasisLevel1 = 0x01, + kIOFBLinkPreEmphasisLevel2 = 0x02, + kIOFBLinkPreEmphasisLevel3 = 0x03 +}; + +enum +{ + kIOFBLinkDownspreadNone = 0x0, + kIOFBLinkDownspreadMax = 0x1 +}; + +enum +{ + kIOFBLinkScramblerNormal = 0x0, + kIOFBLinkScramblerAlternate = 0x1 +}; +enum { + kDisplayVendorIDUnknown = 'unkn', + kDisplayProductIDGeneric = 0x717 +}; +enum { + kDisplaySubPixelLayoutUndefined = 0x00000000, + kDisplaySubPixelLayoutRGB = 0x00000001, + kDisplaySubPixelLayoutBGR = 0x00000002, + kDisplaySubPixelLayoutQuadGBL = 0x00000003, + kDisplaySubPixelLayoutQuadGBR = 0x00000004, + + kDisplaySubPixelConfigurationUndefined = 0x00000000, + kDisplaySubPixelConfigurationDelta = 0x00000001, + kDisplaySubPixelConfigurationStripe = 0x00000002, + kDisplaySubPixelConfigurationStripeOffset = 0x00000003, + kDisplaySubPixelConfigurationQuad = 0x00000004, + + kDisplaySubPixelShapeUndefined = 0x00000000, + kDisplaySubPixelShapeRound = 0x00000001, + kDisplaySubPixelShapeSquare = 0x00000002, + kDisplaySubPixelShapeRectangular = 0x00000003, + kDisplaySubPixelShapeOval = 0x00000004, + kDisplaySubPixelShapeElliptical = 0x00000005 +}; + + + + + + + + + + +typedef struct evsioKeymapping +{ + int size; + char *mapping; +} NXKeyMapping; + +typedef struct evsioMouseScaling +{ + int numScaleLevels; + short scaleThresholds[20]; + short scaleFactors[20]; +} NXMouseScaling; + +typedef enum { + NX_OneButton, + NX_LeftButton, + NX_RightButton +} NXMouseButton; + + +typedef struct __IOFixedPoint32 { + int32_t x; + int32_t y; +} IOFixedPoint32; +typedef int *NXEventSystemInfoType; + +typedef int NXEventSystemInfoData[(1024)]; +typedef struct { + int interface; + int interface_addr; + int dev_type; + int id; +} NXEventSystemDevice; + +typedef struct { + NXEventSystemDevice dev[16]; +} NXEventSystemDeviceList; +typedef enum {EVNOP, EVHIDE, EVSHOW, EVMOVE, EVLEVEL} EvCmd; +typedef float NXCoord; + +typedef struct _NXPoint { + NXCoord x, y; +} NXPoint; + +typedef struct _NXSize { + NXCoord width, height; +} NXSize; +typedef struct _NXTabletPointData { + SInt32 x; + SInt32 y; + SInt32 z; + UInt16 buttons; + UInt16 pressure; + struct { + SInt16 x; + SInt16 y; + } tilt; + UInt16 rotation; + SInt16 tangentialPressure; + UInt16 deviceID; + SInt16 vendor1; + SInt16 vendor2; + SInt16 vendor3; +} NXTabletPointData, *NXTabletPointDataPtr; + + + + + +typedef struct _NXTabletProximityData { + UInt16 vendorID; + UInt16 tabletID; + UInt16 pointerID; + UInt16 deviceID; + UInt16 systemTabletID; + UInt16 vendorPointerType; + UInt32 pointerSerialNumber; + UInt64 uniqueID __attribute__ ((packed)); + UInt32 capabilityMask; + UInt8 pointerType; + UInt8 enterProximity; + SInt16 reserved1; +} NXTabletProximityData, *NXTabletProximityDataPtr; + + + +typedef union { + struct { + UInt8 subx; + UInt8 suby; + SInt16 eventNum; + SInt32 click; + UInt8 pressure; + UInt8 buttonNumber; + UInt8 subType; + UInt8 reserved2; + SInt32 reserved3; + union { + NXTabletPointData point; + NXTabletProximityData proximity; + } tablet; + } mouse; + struct { + SInt32 dx; + SInt32 dy; + UInt8 subx; + UInt8 suby; + UInt8 subType; + UInt8 reserved1; + SInt32 reserved2; + union { + NXTabletPointData point; + NXTabletProximityData proximity; + } tablet; + } mouseMove; + struct { + UInt16 origCharSet; + SInt16 repeat; + UInt16 charSet; + UInt16 charCode; + UInt16 keyCode; + UInt16 origCharCode; + SInt32 reserved1; + UInt32 keyboardType; + SInt32 reserved2; + SInt32 reserved3; + SInt32 reserved4; + SInt32 reserved5[4]; + } key; + struct { + SInt16 reserved; + SInt16 eventNum; + SInt32 trackingNum; + SInt32 userData; + SInt32 reserved1; + SInt32 reserved2; + SInt32 reserved3; + SInt32 reserved4; + SInt32 reserved5; + SInt32 reserved6[4]; + } tracking; + struct { + SInt16 deltaAxis1; + SInt16 deltaAxis2; + SInt16 deltaAxis3; + SInt16 reserved1; + SInt32 fixedDeltaAxis1; + SInt32 fixedDeltaAxis2; + SInt32 fixedDeltaAxis3; + SInt32 pointDeltaAxis1; + SInt32 pointDeltaAxis2; + SInt32 pointDeltaAxis3; + SInt32 reserved8[4]; + } scrollWheel, zoom; + struct { + SInt16 reserved; + SInt16 subType; + union { + float F[11]; + SInt32 L[11]; + SInt16 S[22]; + char C[44]; + } misc; + } compound; + struct { + SInt32 x; + SInt32 y; + SInt32 z; + UInt16 buttons; + UInt16 pressure; + struct { + SInt16 x; + SInt16 y; + } tilt; + UInt16 rotation; + SInt16 tangentialPressure; + UInt16 deviceID; + SInt16 vendor1; + SInt16 vendor2; + SInt16 vendor3; + SInt32 reserved[4]; + } tablet; + struct { + UInt16 vendorID; + UInt16 tabletID; + UInt16 pointerID; + UInt16 deviceID; + UInt16 systemTabletID; + UInt16 vendorPointerType; + UInt32 pointerSerialNumber; + UInt64 uniqueID __attribute__ ((packed)); + UInt32 capabilityMask; + UInt8 pointerType; + UInt8 enterProximity; + SInt16 reserved1; + SInt32 reserved2[4]; + } proximity; +} NXEventData; + + + + + + + +typedef struct _NXEvent { + SInt32 type; + struct { + SInt32 x, y; + } location; + UInt64 time __attribute__ ((packed)); + SInt32 flags; + UInt32 window; + UInt64 service_id __attribute__ ((packed)); + SInt32 ext_pid; + NXEventData data; +} NXEvent, *NXEventPtr; +typedef struct _NXEventExtension { + UInt32 flags; +} NXEventExtension; + +typedef struct _NXEventExt { + NXEvent payload; + NXEventExtension extension; +} NXEventExt; +typedef struct __CGEvent *CGEventRef; + + +typedef uint32_t CGMouseButton; enum { + kCGMouseButtonLeft = 0, + kCGMouseButtonRight = 1, + kCGMouseButtonCenter = 2 +}; + + +typedef uint32_t CGScrollEventUnit; enum { + kCGScrollEventUnitPixel = 0, + kCGScrollEventUnitLine = 1, +}; + + +typedef uint32_t CGMomentumScrollPhase; enum { + kCGMomentumScrollPhaseNone = 0, + kCGMomentumScrollPhaseBegin = 1, + kCGMomentumScrollPhaseContinue = 2, + kCGMomentumScrollPhaseEnd = 3 +}; + + +typedef uint32_t CGScrollPhase; enum { + kCGScrollPhaseBegan = 1, + kCGScrollPhaseChanged = 2, + kCGScrollPhaseEnded = 4, + kCGScrollPhaseCancelled = 8, + kCGScrollPhaseMayBegin = 128 +}; + + +typedef uint32_t CGGesturePhase; enum { + kCGGesturePhaseNone = 0, + kCGGesturePhaseBegan = 1, + kCGGesturePhaseChanged = 2, + kCGGesturePhaseEnded = 4, + kCGGesturePhaseCancelled = 8, + kCGGesturePhaseMayBegin = 128 +}; + + + + + +typedef uint64_t CGEventFlags; enum { + + kCGEventFlagMaskAlphaShift = 0x00010000, + kCGEventFlagMaskShift = 0x00020000, + kCGEventFlagMaskControl = 0x00040000, + kCGEventFlagMaskAlternate = 0x00080000, + kCGEventFlagMaskCommand = 0x00100000, + + + kCGEventFlagMaskHelp = 0x00400000, + kCGEventFlagMaskSecondaryFn = 0x00800000, + + + kCGEventFlagMaskNumericPad = 0x00200000, + + + kCGEventFlagMaskNonCoalesced = 0x00000100 +}; + + +typedef uint32_t CGEventType; enum { + + kCGEventNull = 0, + + + kCGEventLeftMouseDown = 1, + kCGEventLeftMouseUp = 2, + kCGEventRightMouseDown = 3, + kCGEventRightMouseUp = 4, + kCGEventMouseMoved = 5, + kCGEventLeftMouseDragged = 6, + kCGEventRightMouseDragged = 7, + + + kCGEventKeyDown = 10, + kCGEventKeyUp = 11, + kCGEventFlagsChanged = 12, + + + kCGEventScrollWheel = 22, + kCGEventTabletPointer = 23, + kCGEventTabletProximity = 24, + kCGEventOtherMouseDown = 25, + kCGEventOtherMouseUp = 26, + kCGEventOtherMouseDragged = 27, + + + + kCGEventTapDisabledByTimeout = 0xFFFFFFFE, + kCGEventTapDisabledByUserInput = 0xFFFFFFFF +}; + + +typedef uint64_t CGEventTimestamp; + + +typedef uint32_t CGEventField; enum { + + + + kCGMouseEventNumber = 0, + + + + + + kCGMouseEventClickState = 1, + + + + + + kCGMouseEventPressure = 2, + + + + kCGMouseEventButtonNumber = 3, + + + + kCGMouseEventDeltaX = 4, + + + + kCGMouseEventDeltaY = 5, + + + + kCGMouseEventInstantMouser = 6, + + + + kCGMouseEventSubtype = 7, + + + + kCGKeyboardEventAutorepeat = 8, + + + + kCGKeyboardEventKeycode = 9, + + + + kCGKeyboardEventKeyboardType = 10, + + + + + + kCGScrollWheelEventDeltaAxis1 = 11, + + + + + kCGScrollWheelEventDeltaAxis2 = 12, + + + kCGScrollWheelEventDeltaAxis3 = 13, + kCGScrollWheelEventFixedPtDeltaAxis1 = 93, + + + + + + + + kCGScrollWheelEventFixedPtDeltaAxis2 = 94, + + + kCGScrollWheelEventFixedPtDeltaAxis3 = 95, + + + + + + kCGScrollWheelEventPointDeltaAxis1 = 96, + + + + + kCGScrollWheelEventPointDeltaAxis2 = 97, + + + kCGScrollWheelEventPointDeltaAxis3 = 98, + + + kCGScrollWheelEventScrollPhase = 99, + + + kCGScrollWheelEventScrollCount = 100, + + kCGScrollWheelEventMomentumPhase = 123, + + + + + kCGScrollWheelEventInstantMouser = 14, + + + + kCGTabletEventPointX = 15, + + + + kCGTabletEventPointY = 16, + + + + kCGTabletEventPointZ = 17, + + + + + kCGTabletEventPointButtons = 18, + + + + + kCGTabletEventPointPressure = 19, + + + + kCGTabletEventTiltX = 20, + + + + kCGTabletEventTiltY = 21, + + + kCGTabletEventRotation = 22, + + + + + kCGTabletEventTangentialPressure = 23, + + + + kCGTabletEventDeviceID = 24, + + + kCGTabletEventVendor1 = 25, + + + kCGTabletEventVendor2 = 26, + + + kCGTabletEventVendor3 = 27, + + + + kCGTabletProximityEventVendorID = 28, + + + + kCGTabletProximityEventTabletID = 29, + + + + kCGTabletProximityEventPointerID = 30, + + + + kCGTabletProximityEventDeviceID = 31, + + + + kCGTabletProximityEventSystemTabletID = 32, + + + + kCGTabletProximityEventVendorPointerType = 33, + + + + kCGTabletProximityEventVendorPointerSerialNumber = 34, + + + + kCGTabletProximityEventVendorUniqueID = 35, + + + + kCGTabletProximityEventCapabilityMask = 36, + + + kCGTabletProximityEventPointerType = 37, + + + + + kCGTabletProximityEventEnterProximity = 38, + + + + kCGEventTargetProcessSerialNumber = 39, + + + kCGEventTargetUnixProcessID = 40, + + + kCGEventSourceUnixProcessID = 41, + + + + kCGEventSourceUserData = 42, + + + + kCGEventSourceUserID = 43, + + + + kCGEventSourceGroupID = 44, + + + + kCGEventSourceStateID = 45, + + + + + + kCGScrollWheelEventIsContinuous = 88, + + + kCGMouseEventWindowUnderMousePointer = 91, + kCGMouseEventWindowUnderMousePointerThatCanHandleThisEvent = 92 +}; + + +typedef uint32_t CGEventMouseSubtype; enum { + kCGEventMouseSubtypeDefault = 0, + kCGEventMouseSubtypeTabletPoint = 1, + kCGEventMouseSubtypeTabletProximity = 2 +}; + + +typedef uint32_t CGEventTapLocation; enum { + kCGHIDEventTap = 0, + kCGSessionEventTap, + kCGAnnotatedSessionEventTap +}; + + + +typedef uint32_t CGEventTapPlacement; enum { + kCGHeadInsertEventTap = 0, + kCGTailAppendEventTap +}; + + + +typedef uint32_t CGEventTapOptions; enum { + kCGEventTapOptionDefault = 0x00000000, + kCGEventTapOptionListenOnly = 0x00000001 +}; + + + +typedef uint64_t CGEventMask; +typedef struct __CGEventTapProxy *CGEventTapProxy; +typedef CGEventRef _Nullable (*CGEventTapCallBack)(CGEventTapProxy proxy, + CGEventType type, CGEventRef event, void * _Nullable userInfo); +struct __CGEventTapInformation { + uint32_t eventTapID; + CGEventTapLocation tapPoint; + CGEventTapOptions options; + CGEventMask eventsOfInterest; + pid_t tappingProcess; + pid_t processBeingTapped; + _Bool enabled; + float minUsecLatency; + float avgUsecLatency; + float maxUsecLatency; +}; +typedef struct __CGEventTapInformation CGEventTapInformation; + + +typedef struct __CGEventSource *CGEventSourceRef; + + +typedef int32_t CGEventSourceStateID; enum { + kCGEventSourceStatePrivate = -1, + kCGEventSourceStateCombinedSessionState = 0, + kCGEventSourceStateHIDSystemState = 1 +}; + + + +typedef uint32_t CGEventSourceKeyboardType; + + + + + + + +extern CFTypeID CGEventGetTypeID(void) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CGEventRef _Nullable CGEventCreate(CGEventSourceRef _Nullable source) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CFDataRef _Nullable CGEventCreateData( + CFAllocatorRef _Nullable allocator, + CGEventRef _Nullable event) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CGEventRef _Nullable CGEventCreateFromData( + CFAllocatorRef _Nullable allocator, CFDataRef _Nullable data) + __attribute__((availability(macosx,introduced=10.4))); +extern CGEventRef _Nullable CGEventCreateMouseEvent( + CGEventSourceRef _Nullable source, + CGEventType mouseType, CGPoint mouseCursorPosition, + CGMouseButton mouseButton) + __attribute__((availability(macosx,introduced=10.4))); +extern CGEventRef _Nullable CGEventCreateKeyboardEvent( + CGEventSourceRef _Nullable source, + CGKeyCode virtualKey, _Bool keyDown) + __attribute__((availability(macosx,introduced=10.4))); +extern CGEventRef _Nullable CGEventCreateScrollWheelEvent( + CGEventSourceRef _Nullable source, + CGScrollEventUnit units, uint32_t wheelCount, int32_t wheel1, ...) + __attribute__((availability(macosx,introduced=10.5))); + + + +extern CGEventRef _Nullable CGEventCreateCopy(CGEventRef _Nullable event) + __attribute__((availability(macosx,introduced=10.4))); +extern CGEventSourceRef _Nullable CGEventCreateSourceFromEvent( + CGEventRef _Nullable event) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern void CGEventSetSource(CGEventRef _Nullable event, + CGEventSourceRef _Nullable source) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CGEventType CGEventGetType(CGEventRef _Nullable event) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern void CGEventSetType(CGEventRef _Nullable event, CGEventType type) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CGEventTimestamp CGEventGetTimestamp(CGEventRef _Nullable event) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern void CGEventSetTimestamp(CGEventRef _Nullable event, + CGEventTimestamp timestamp) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CGPoint CGEventGetLocation(CGEventRef _Nullable event) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CGPoint CGEventGetUnflippedLocation(CGEventRef _Nullable event) + __attribute__((availability(macosx,introduced=10.5))); + + + +extern void CGEventSetLocation(CGEventRef _Nullable event, CGPoint location) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CGEventFlags CGEventGetFlags(CGEventRef _Nullable event) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern void CGEventSetFlags(CGEventRef _Nullable event, CGEventFlags flags) + __attribute__((availability(macosx,introduced=10.4))); + + + + + + + +extern void CGEventKeyboardGetUnicodeString(CGEventRef _Nullable event, + UniCharCount maxStringLength, UniCharCount *_Nullable actualStringLength, + UniChar * _Nullable unicodeString) + __attribute__((availability(macosx,introduced=10.4))); +extern void CGEventKeyboardSetUnicodeString(CGEventRef _Nullable event, + UniCharCount stringLength, const UniChar * _Nullable unicodeString) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern int64_t CGEventGetIntegerValueField(CGEventRef _Nullable event, + CGEventField field) + __attribute__((availability(macosx,introduced=10.4))); +extern void CGEventSetIntegerValueField(CGEventRef _Nullable event, + CGEventField field, int64_t value) + __attribute__((availability(macosx,introduced=10.4))); + + + + + + + +extern double CGEventGetDoubleValueField(CGEventRef _Nullable event, + CGEventField field) + __attribute__((availability(macosx,introduced=10.4))); +extern void CGEventSetDoubleValueField(CGEventRef _Nullable event, + CGEventField field, double value) + __attribute__((availability(macosx,introduced=10.4))); +extern CFMachPortRef _Nullable CGEventTapCreate(CGEventTapLocation tap, + CGEventTapPlacement place, CGEventTapOptions options, + CGEventMask eventsOfInterest, CGEventTapCallBack callback, + void * _Nullable userInfo) + __attribute__((availability(macosx,introduced=10.4))); + + + + + + + +extern CFMachPortRef _Nullable CGEventTapCreateForPSN( + void * processSerialNumber, + CGEventTapPlacement place, CGEventTapOptions options, + CGEventMask eventsOfInterest, CGEventTapCallBack callback, + void *_Nullable userInfo) + __attribute__((availability(macosx,introduced=10.4))); + +extern CFMachPortRef _Nullable CGEventTapCreateForPid(pid_t pid, + CGEventTapPlacement place, CGEventTapOptions options, + CGEventMask eventsOfInterest, CGEventTapCallBack callback, + void * _Nullable userInfo) __attribute__((availability(macosx,introduced=10.11))); +extern void CGEventTapEnable(CFMachPortRef tap, _Bool enable) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern _Bool CGEventTapIsEnabled(CFMachPortRef tap) + __attribute__((availability(macosx,introduced=10.4))); +extern void CGEventTapPostEvent(CGEventTapProxy _Nullable proxy, + CGEventRef _Nullable event) + __attribute__((availability(macosx,introduced=10.4))); + + + + + + + +extern void CGEventPost(CGEventTapLocation tap, CGEventRef _Nullable event) + __attribute__((availability(macosx,introduced=10.4))); +extern void CGEventPostToPSN(void * _Nullable processSerialNumber, + CGEventRef _Nullable event) + __attribute__((availability(macosx,introduced=10.4))); + +extern void CGEventPostToPid( pid_t pid, + CGEventRef _Nullable event) + __attribute__((availability(macosx,introduced=10.11))); +extern CGError CGGetEventTapList(uint32_t maxNumberOfTaps, + CGEventTapInformation * _Nullable tapList, + uint32_t * _Nullable eventTapCount) + __attribute__((availability(macosx,introduced=10.4))); +extern CFTypeID CGEventSourceGetTypeID(void) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern CGEventSourceRef _Nullable CGEventSourceCreate( + CGEventSourceStateID stateID) + __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern CGEventSourceKeyboardType CGEventSourceGetKeyboardType( + CGEventSourceRef _Nullable source) + __attribute__((availability(macosx,introduced=10.4))); + + + +extern void CGEventSourceSetKeyboardType(CGEventSourceRef _Nullable source, + CGEventSourceKeyboardType keyboardType) + __attribute__((availability(macosx,introduced=10.4))); +extern double CGEventSourceGetPixelsPerLine( + CGEventSourceRef _Nullable source) + __attribute__((availability(macosx,introduced=10.5))); +extern void CGEventSourceSetPixelsPerLine(CGEventSourceRef _Nullable source, + double pixelsPerLine) + __attribute__((availability(macosx,introduced=10.5))); +extern CGEventSourceStateID CGEventSourceGetSourceStateID( + CGEventSourceRef _Nullable source) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern _Bool CGEventSourceButtonState(CGEventSourceStateID stateID, + CGMouseButton button) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern _Bool CGEventSourceKeyState(CGEventSourceStateID stateID, + CGKeyCode key) + __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CGEventFlags CGEventSourceFlagsState(CGEventSourceStateID stateID) + __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern CFTimeInterval CGEventSourceSecondsSinceLastEventType( + CGEventSourceStateID stateID, CGEventType eventType) + __attribute__((availability(macosx,introduced=10.4))); +extern uint32_t CGEventSourceCounterForEventType(CGEventSourceStateID + stateID, CGEventType eventType) + __attribute__((availability(macosx,introduced=10.4))); +extern void CGEventSourceSetUserData(CGEventSourceRef _Nullable source, + int64_t userData) + __attribute__((availability(macosx,introduced=10.4))); +extern int64_t CGEventSourceGetUserData(CGEventSourceRef _Nullable source) + __attribute__((availability(macosx,introduced=10.4))); +extern void CGEventSourceSetLocalEventsFilterDuringSuppressionState( + CGEventSourceRef _Nullable source, CGEventFilterMask filter, + CGEventSuppressionState state) + __attribute__((availability(macosx,introduced=10.4))); +extern CGEventFilterMask + CGEventSourceGetLocalEventsFilterDuringSuppressionState( + CGEventSourceRef _Nullable source, CGEventSuppressionState state) + __attribute__((availability(macosx,introduced=10.4))); +extern void CGEventSourceSetLocalEventsSuppressionInterval( + CGEventSourceRef _Nullable source, CFTimeInterval seconds) + __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern CFTimeInterval CGEventSourceGetLocalEventsSuppressionInterval( + CGEventSourceRef _Nullable source) + __attribute__((availability(macosx,introduced=10.4))); + +typedef struct CGPSConverter *CGPSConverterRef; +typedef void (*CGPSConverterBeginDocumentCallback)(void * _Nullable info); + +typedef void (*CGPSConverterEndDocumentCallback)(void * _Nullable info, + _Bool success); + +typedef void (*CGPSConverterBeginPageCallback)(void * _Nullable info, + size_t pageNumber, + CFDictionaryRef pageInfo); + +typedef void (*CGPSConverterEndPageCallback)(void * _Nullable info, + size_t pageNumber, + CFDictionaryRef pageInfo); + +typedef void (*CGPSConverterProgressCallback)(void * _Nullable info); + +typedef void (*CGPSConverterMessageCallback)(void * _Nullable info, + CFStringRef message); + +typedef void (*CGPSConverterReleaseInfoCallback)(void * _Nullable info); + +struct CGPSConverterCallbacks { + unsigned int version; + CGPSConverterBeginDocumentCallback _Nullable beginDocument; + CGPSConverterEndDocumentCallback _Nullable endDocument; + CGPSConverterBeginPageCallback _Nullable beginPage; + CGPSConverterEndPageCallback _Nullable endPage; + CGPSConverterProgressCallback _Nullable noteProgress; + CGPSConverterMessageCallback _Nullable noteMessage; + CGPSConverterReleaseInfoCallback _Nullable releaseInfo; +}; +typedef struct CGPSConverterCallbacks CGPSConverterCallbacks; + + + + +extern CGPSConverterRef _Nullable CGPSConverterCreate(void * _Nullable info, + const CGPSConverterCallbacks * callbacks, + CFDictionaryRef _Nullable options) + __attribute__((availability(macosx,introduced=10.3))); + + + + + +extern _Bool CGPSConverterConvert(CGPSConverterRef converter, + CGDataProviderRef provider, CGDataConsumerRef consumer, + CFDictionaryRef _Nullable options) + __attribute__((availability(macosx,introduced=10.3))); + + + + +extern _Bool CGPSConverterAbort(CGPSConverterRef converter) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern _Bool CGPSConverterIsConverting(CGPSConverterRef converter) + __attribute__((availability(macosx,introduced=10.3))); + + + +extern CFTypeID CGPSConverterGetTypeID(void) + __attribute__((availability(macosx,introduced=10.3))); + +extern CFDictionaryRef _Nullable CGSessionCopyCurrentDictionary(void) + __attribute__((availability(macosx,introduced=10.3))); +typedef uint32_t CGWindowID; + + +typedef uint32_t CGWindowSharingType; enum { + kCGWindowSharingNone = 0, + kCGWindowSharingReadOnly = 1, + kCGWindowSharingReadWrite = 2 +}; + + +typedef uint32_t CGWindowBackingType; enum { + kCGBackingStoreRetained = 0, + kCGBackingStoreNonretained = 1, + kCGBackingStoreBuffered = 2 +}; +extern const CFStringRef kCGWindowNumber + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCGWindowStoreType + __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kCGWindowLayer + __attribute__((availability(macosx,introduced=10.5))); + + + + + + +extern const CFStringRef kCGWindowBounds + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCGWindowSharingState + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCGWindowAlpha + __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kCGWindowOwnerPID + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCGWindowMemoryUsage + __attribute__((availability(macosx,introduced=10.5))); + + + + + + +extern const CFStringRef kCGWindowWorkspace + __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); + + + + +extern const CFStringRef kCGWindowOwnerName + __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kCGWindowName + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCGWindowIsOnscreen + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCGWindowBackingLocationVideoMemory + __attribute__((availability(macosx,introduced=10.5))); + + + +typedef uint32_t CGWindowListOption; enum { + + + + kCGWindowListOptionAll = 0, + + + + kCGWindowListOptionOnScreenOnly = (1 << 0), + + + + kCGWindowListOptionOnScreenAboveWindow = (1 << 1), + + + + kCGWindowListOptionOnScreenBelowWindow = (1 << 2), + + + + kCGWindowListOptionIncludingWindow = (1 << 3), + + + kCGWindowListExcludeDesktopElements = (1 << 4) +}; +extern CFArrayRef _Nullable CGWindowListCopyWindowInfo(CGWindowListOption option, + CGWindowID relativeToWindow) + __attribute__((availability(macosx,introduced=10.5))); + + + + + + + +extern CFArrayRef _Nullable CGWindowListCreate(CGWindowListOption option, + CGWindowID relativeToWindow) + __attribute__((availability(macosx,introduced=10.5))) + __attribute__((availability(swift, unavailable, message="No replacement at present"))); +extern CFArrayRef _Nullable CGWindowListCreateDescriptionFromArray( + CFArrayRef _Nullable windowArray) + __attribute__((availability(macosx,introduced=10.5))); + + + +typedef uint32_t CGWindowImageOption; enum { + + + kCGWindowImageDefault = 0, + + + + kCGWindowImageBoundsIgnoreFraming = (1 << 0), + + + kCGWindowImageShouldBeOpaque = (1 << 1), + + + kCGWindowImageOnlyShadows = (1 << 2), + + + + kCGWindowImageBestResolution = (1 << 3), + + + + kCGWindowImageNominalResolution = (1 << 4) +}; +extern CGImageRef _Nullable CGWindowListCreateImage(CGRect screenBounds, + CGWindowListOption listOption, CGWindowID windowID, + CGWindowImageOption imageOption) + __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern CGImageRef _Nullable CGWindowListCreateImageFromArray( + CGRect screenBounds, CFArrayRef windowArray, + CGWindowImageOption imageOption) + __attribute__((availability(macosx,introduced=10.5))); +typedef int32_t CGWindowLevelKey; enum { + kCGBaseWindowLevelKey = 0, + kCGMinimumWindowLevelKey, + kCGDesktopWindowLevelKey, + kCGBackstopMenuLevelKey, + kCGNormalWindowLevelKey, + kCGFloatingWindowLevelKey, + kCGTornOffMenuWindowLevelKey, + kCGDockWindowLevelKey, + kCGMainMenuWindowLevelKey, + kCGStatusWindowLevelKey, + kCGModalPanelWindowLevelKey, + kCGPopUpMenuWindowLevelKey, + kCGDraggingWindowLevelKey, + kCGScreenSaverWindowLevelKey, + kCGMaximumWindowLevelKey, + kCGOverlayWindowLevelKey, + kCGHelpWindowLevelKey, + kCGUtilityWindowLevelKey, + kCGDesktopIconWindowLevelKey, + kCGCursorWindowLevelKey, + kCGAssistiveTechHighWindowLevelKey, + kCGNumberOfWindowLevelKeys +}; + +typedef int32_t CGWindowLevel; + + + + +extern CGWindowLevel CGWindowLevelForKey(CGWindowLevelKey key) + __attribute__((availability(macosx,introduced=10.0))); + + + +extern const CFStringRef kCTFontSymbolicTrait __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontWeightTrait __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontWidthTrait __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontSlantTrait __attribute__((availability(macosx,introduced=10.5))); + + + + + + +enum { + kCTFontClassMaskShift = 28 +}; + + + + + + +typedef uint32_t CTFontSymbolicTraits; enum { + kCTFontTraitItalic = (1 << 0), + kCTFontTraitBold = (1 << 1), + kCTFontTraitExpanded = (1 << 5), + kCTFontTraitCondensed = (1 << 6), + kCTFontTraitMonoSpace = (1 << 10), + kCTFontTraitVertical = (1 << 11), + kCTFontTraitUIOptimized = (1 << 12), + kCTFontTraitColorGlyphs = (1 << 13), + kCTFontTraitComposite = (1 << 14), + + kCTFontTraitClassMask = (15U << kCTFontClassMaskShift), + + + kCTFontItalicTrait = kCTFontTraitItalic, + kCTFontBoldTrait = kCTFontTraitBold, + kCTFontExpandedTrait = kCTFontTraitExpanded, + kCTFontCondensedTrait = kCTFontTraitCondensed, + kCTFontMonoSpaceTrait = kCTFontTraitMonoSpace, + kCTFontVerticalTrait = kCTFontTraitVertical, + kCTFontUIOptimizedTrait = kCTFontTraitUIOptimized, + kCTFontColorGlyphsTrait = kCTFontTraitColorGlyphs, + kCTFontCompositeTrait = kCTFontTraitComposite, + kCTFontClassMaskTrait = kCTFontTraitClassMask +}; + + + + + + +typedef uint32_t CTFontStylisticClass; enum { + kCTFontClassUnknown = (0 << kCTFontClassMaskShift), + kCTFontClassOldStyleSerifs = (1 << kCTFontClassMaskShift), + kCTFontClassTransitionalSerifs = (2 << kCTFontClassMaskShift), + kCTFontClassModernSerifs = (3 << kCTFontClassMaskShift), + kCTFontClassClarendonSerifs = (4 << kCTFontClassMaskShift), + kCTFontClassSlabSerifs = (5 << kCTFontClassMaskShift), + kCTFontClassFreeformSerifs = (7 << kCTFontClassMaskShift), + kCTFontClassSansSerif = (8U << kCTFontClassMaskShift), + kCTFontClassOrnamentals = (9U << kCTFontClassMaskShift), + kCTFontClassScripts = (10U << kCTFontClassMaskShift), + kCTFontClassSymbolic = (12U << kCTFontClassMaskShift), + + kCTFontUnknownClass = kCTFontClassUnknown, + kCTFontOldStyleSerifsClass = kCTFontClassOldStyleSerifs, + kCTFontTransitionalSerifsClass = kCTFontClassTransitionalSerifs, + kCTFontModernSerifsClass = kCTFontClassModernSerifs, + kCTFontClarendonSerifsClass = kCTFontClassClarendonSerifs, + kCTFontSlabSerifsClass = kCTFontClassSlabSerifs, + kCTFontFreeformSerifsClass = kCTFontClassFreeformSerifs, + kCTFontSansSerifClass = kCTFontClassSansSerif, + kCTFontOrnamentalsClass = kCTFontClassOrnamentals, + kCTFontScriptsClass = kCTFontClassScripts, + kCTFontSymbolicClass = kCTFontClassSymbolic +}; +typedef const struct __attribute__((objc_bridge(NSFontDescriptor))) __CTFontDescriptor * CTFontDescriptorRef; +CFTypeID CTFontDescriptorGetTypeID( void ) __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCTFontURLAttribute __attribute__((availability(macosx,introduced=10.6))); + + + + + +extern const CFStringRef kCTFontNameAttribute __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontDisplayNameAttribute __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontFamilyNameAttribute __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontStyleNameAttribute __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontTraitsAttribute __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontVariationAttribute __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontSizeAttribute __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontMatrixAttribute __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontCascadeListAttribute __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontCharacterSetAttribute __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontLanguagesAttribute __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontBaselineAdjustAttribute __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontMacintoshEncodingsAttribute __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontFeaturesAttribute __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCTFontFeatureSettingsAttribute __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontFixedAdvanceAttribute __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontOrientationAttribute __attribute__((availability(macosx,introduced=10.5))); + + + + + +typedef uint32_t CTFontOrientation; enum { + kCTFontOrientationDefault __attribute__((availability(macosx,introduced=10.8))) = 0, + kCTFontOrientationHorizontal __attribute__((availability(macosx,introduced=10.8))) = 1, + kCTFontOrientationVertical __attribute__((availability(macosx,introduced=10.8))) = 2, + + kCTFontDefaultOrientation __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontOrientationDefault, + kCTFontHorizontalOrientation __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontOrientationHorizontal, + kCTFontVerticalOrientation __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontOrientationVertical +}; + + + + + + +extern const CFStringRef kCTFontFormatAttribute __attribute__((availability(macosx,introduced=10.6))); +typedef uint32_t CTFontFormat; enum { + kCTFontFormatUnrecognized = 0, + kCTFontFormatOpenTypePostScript = 1, + kCTFontFormatOpenTypeTrueType = 2, + kCTFontFormatTrueType = 3, + kCTFontFormatPostScript = 4, + kCTFontFormatBitmap = 5 +}; + + + + + + +extern const CFStringRef kCTFontRegistrationScopeAttribute __attribute__((availability(macosx,introduced=10.6))); + + + + + +extern const CFStringRef kCTFontPriorityAttribute __attribute__((availability(macosx,introduced=10.6))); +enum { + kCTFontPrioritySystem = 10000, + kCTFontPriorityNetwork = 20000, + kCTFontPriorityComputer = 30000, + kCTFontPriorityUser = 40000, + kCTFontPriorityDynamic = 50000, + kCTFontPriorityProcess = 60000 +}; +typedef uint32_t CTFontPriority; + + + + + + +extern const CFStringRef kCTFontEnabledAttribute __attribute__((availability(macosx,introduced=10.6))); + + + + + + +extern const CFStringRef kCTFontDownloadableAttribute __attribute__((availability(macosx,introduced=10.8))); + + + + + + +extern const CFStringRef kCTFontDownloadedAttribute __attribute__((availability(macosx,introduced=10.12))); +CTFontDescriptorRef CTFontDescriptorCreateWithNameAndSize( + CFStringRef name, + CGFloat size ) __attribute__((availability(macosx,introduced=10.5))); +CTFontDescriptorRef CTFontDescriptorCreateWithAttributes( + CFDictionaryRef attributes ) __attribute__((availability(macosx,introduced=10.5))); +CTFontDescriptorRef CTFontDescriptorCreateCopyWithAttributes( + CTFontDescriptorRef original, + CFDictionaryRef attributes ) __attribute__((availability(macosx,introduced=10.5))); +CTFontDescriptorRef _Nullable CTFontDescriptorCreateCopyWithFamily( + CTFontDescriptorRef original, + CFStringRef family ) __attribute__((availability(macosx,introduced=10.9))); +CTFontDescriptorRef _Nullable CTFontDescriptorCreateCopyWithSymbolicTraits( + CTFontDescriptorRef original, + CTFontSymbolicTraits symTraitValue, + CTFontSymbolicTraits symTraitMask ) __attribute__((availability(macosx,introduced=10.9))); +CTFontDescriptorRef CTFontDescriptorCreateCopyWithVariation( + CTFontDescriptorRef original, + CFNumberRef variationIdentifier, + CGFloat variationValue ) __attribute__((availability(macosx,introduced=10.5))); +CTFontDescriptorRef CTFontDescriptorCreateCopyWithFeature( + CTFontDescriptorRef original, + CFNumberRef featureTypeIdentifier, + CFNumberRef featureSelectorIdentifier ) __attribute__((availability(macosx,introduced=10.5))); +CFArrayRef _Nullable CTFontDescriptorCreateMatchingFontDescriptors( + CTFontDescriptorRef descriptor, + CFSetRef _Nullable mandatoryAttributes ) __attribute__((availability(macosx,introduced=10.5))); +CTFontDescriptorRef _Nullable CTFontDescriptorCreateMatchingFontDescriptor( + CTFontDescriptorRef descriptor, + CFSetRef _Nullable mandatoryAttributes ) __attribute__((availability(macosx,introduced=10.5))); + + + + + + +typedef uint32_t CTFontDescriptorMatchingState; enum { + kCTFontDescriptorMatchingDidBegin, + kCTFontDescriptorMatchingDidFinish, + + kCTFontDescriptorMatchingWillBeginQuerying, + kCTFontDescriptorMatchingStalled, + + + kCTFontDescriptorMatchingWillBeginDownloading, + kCTFontDescriptorMatchingDownloading, + kCTFontDescriptorMatchingDidFinishDownloading, + kCTFontDescriptorMatchingDidMatch, + + kCTFontDescriptorMatchingDidFailWithError +}; + + + + + + +extern const CFStringRef kCTFontDescriptorMatchingSourceDescriptor __attribute__((availability(macosx,introduced=10.8))); + + +extern const CFStringRef kCTFontDescriptorMatchingDescriptors __attribute__((availability(macosx,introduced=10.8))); + + +extern const CFStringRef kCTFontDescriptorMatchingResult __attribute__((availability(macosx,introduced=10.8))); + + +extern const CFStringRef kCTFontDescriptorMatchingPercentage __attribute__((availability(macosx,introduced=10.8))); + + +extern const CFStringRef kCTFontDescriptorMatchingCurrentAssetSize __attribute__((availability(macosx,introduced=10.8))); + + +extern const CFStringRef kCTFontDescriptorMatchingTotalDownloadedSize __attribute__((availability(macosx,introduced=10.8))); + + +extern const CFStringRef kCTFontDescriptorMatchingTotalAssetSize __attribute__((availability(macosx,introduced=10.8))); + + +extern const CFStringRef kCTFontDescriptorMatchingError __attribute__((availability(macosx,introduced=10.8))); + + + + +typedef _Bool (^CTFontDescriptorProgressHandler)(CTFontDescriptorMatchingState state, CFDictionaryRef progressParameter); +_Bool CTFontDescriptorMatchFontDescriptorsWithProgressHandler( + CFArrayRef descriptors, + CFSetRef _Nullable mandatoryAttributes, + CTFontDescriptorProgressHandler progressBlock) __attribute__((availability(macosx,introduced=10.9))); +CFDictionaryRef CTFontDescriptorCopyAttributes( + CTFontDescriptorRef descriptor ) __attribute__((availability(macosx,introduced=10.5))); +CFTypeRef _Nullable CTFontDescriptorCopyAttribute( + CTFontDescriptorRef descriptor, + CFStringRef attribute ) __attribute__((availability(macosx,introduced=10.5))); +CFTypeRef _Nullable CTFontDescriptorCopyLocalizedAttribute( + CTFontDescriptorRef descriptor, + CFStringRef attribute, + CFStringRef _Nullable * _Nullable language ) __attribute__((availability(macosx,introduced=10.5))); +typedef const struct __attribute__((objc_bridge(NSFont))) __CTFont * CTFontRef; + + + + + + + +CFTypeID CTFontGetTypeID( void ) __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCTFontCopyrightNameKey __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kCTFontFamilyNameKey __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kCTFontSubFamilyNameKey __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kCTFontStyleNameKey __attribute__((availability(macosx,introduced=10.5))); + + + + + + +extern const CFStringRef kCTFontUniqueNameKey __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kCTFontFullNameKey __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kCTFontVersionNameKey __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kCTFontPostScriptNameKey __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kCTFontTrademarkNameKey __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kCTFontManufacturerNameKey __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kCTFontDesignerNameKey __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kCTFontDescriptionNameKey __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kCTFontVendorURLNameKey __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kCTFontDesignerURLNameKey __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kCTFontLicenseNameKey __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kCTFontLicenseURLNameKey __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kCTFontSampleTextNameKey __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kCTFontPostScriptCIDNameKey __attribute__((availability(macosx,introduced=10.5))); +CTFontRef CTFontCreateWithName( + CFStringRef _Nullable name, + CGFloat size, + const CGAffineTransform * _Nullable matrix ) __attribute__((availability(macosx,introduced=10.5))); +CTFontRef CTFontCreateWithFontDescriptor( + CTFontDescriptorRef descriptor, + CGFloat size, + const CGAffineTransform * _Nullable matrix ) __attribute__((availability(macosx,introduced=10.5))); +typedef CFOptionFlags CTFontOptions; enum { + kCTFontOptionsDefault = 0, + kCTFontOptionsPreventAutoActivation = 1 << 0, + kCTFontOptionsPreferSystemFont = 1 << 2 +}; +CTFontRef CTFontCreateWithNameAndOptions( + CFStringRef name, + CGFloat size, + const CGAffineTransform * _Nullable matrix, + CTFontOptions options ) __attribute__((availability(macosx,introduced=10.6))); +CTFontRef CTFontCreateWithFontDescriptorAndOptions( + CTFontDescriptorRef descriptor, + CGFloat size, + const CGAffineTransform * _Nullable matrix, + CTFontOptions options ) __attribute__((availability(macosx,introduced=10.6))); + + + + + + +typedef uint32_t CTFontUIFontType; enum { + kCTFontUIFontNone __attribute__((availability(macosx,introduced=10.8))) = (uint32_t)-1, + kCTFontUIFontUser __attribute__((availability(macosx,introduced=10.8))) = 0, + kCTFontUIFontUserFixedPitch __attribute__((availability(macosx,introduced=10.8))) = 1, + kCTFontUIFontSystem __attribute__((availability(macosx,introduced=10.8))) = 2, + kCTFontUIFontEmphasizedSystem __attribute__((availability(macosx,introduced=10.8))) = 3, + kCTFontUIFontSmallSystem __attribute__((availability(macosx,introduced=10.8))) = 4, + kCTFontUIFontSmallEmphasizedSystem __attribute__((availability(macosx,introduced=10.8))) = 5, + kCTFontUIFontMiniSystem __attribute__((availability(macosx,introduced=10.8))) = 6, + kCTFontUIFontMiniEmphasizedSystem __attribute__((availability(macosx,introduced=10.8))) = 7, + kCTFontUIFontViews __attribute__((availability(macosx,introduced=10.8))) = 8, + kCTFontUIFontApplication __attribute__((availability(macosx,introduced=10.8))) = 9, + kCTFontUIFontLabel __attribute__((availability(macosx,introduced=10.8))) = 10, + kCTFontUIFontMenuTitle __attribute__((availability(macosx,introduced=10.8))) = 11, + kCTFontUIFontMenuItem __attribute__((availability(macosx,introduced=10.8))) = 12, + kCTFontUIFontMenuItemMark __attribute__((availability(macosx,introduced=10.8))) = 13, + kCTFontUIFontMenuItemCmdKey __attribute__((availability(macosx,introduced=10.8))) = 14, + kCTFontUIFontWindowTitle __attribute__((availability(macosx,introduced=10.8))) = 15, + kCTFontUIFontPushButton __attribute__((availability(macosx,introduced=10.8))) = 16, + kCTFontUIFontUtilityWindowTitle __attribute__((availability(macosx,introduced=10.8))) = 17, + kCTFontUIFontAlertHeader __attribute__((availability(macosx,introduced=10.8))) = 18, + kCTFontUIFontSystemDetail __attribute__((availability(macosx,introduced=10.8))) = 19, + kCTFontUIFontEmphasizedSystemDetail __attribute__((availability(macosx,introduced=10.8))) = 20, + kCTFontUIFontToolbar __attribute__((availability(macosx,introduced=10.8))) = 21, + kCTFontUIFontSmallToolbar __attribute__((availability(macosx,introduced=10.8))) = 22, + kCTFontUIFontMessage __attribute__((availability(macosx,introduced=10.8))) = 23, + kCTFontUIFontPalette __attribute__((availability(macosx,introduced=10.8))) = 24, + kCTFontUIFontToolTip __attribute__((availability(macosx,introduced=10.8))) = 25, + kCTFontUIFontControlContent __attribute__((availability(macosx,introduced=10.8))) = 26, + + kCTFontNoFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontNone, + kCTFontUserFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontUser, + kCTFontUserFixedPitchFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontUserFixedPitch, + kCTFontSystemFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontSystem, + kCTFontEmphasizedSystemFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontEmphasizedSystem, + kCTFontSmallSystemFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontSmallSystem, + kCTFontSmallEmphasizedSystemFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontSmallEmphasizedSystem, + kCTFontMiniSystemFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontMiniSystem, + kCTFontMiniEmphasizedSystemFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontMiniEmphasizedSystem, + kCTFontViewsFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontViews, + kCTFontApplicationFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontApplication, + kCTFontLabelFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontLabel, + kCTFontMenuTitleFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontMenuTitle, + kCTFontMenuItemFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontMenuItem, + kCTFontMenuItemMarkFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontMenuItemMark, + kCTFontMenuItemCmdKeyFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontMenuItemCmdKey, + kCTFontWindowTitleFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontWindowTitle, + kCTFontPushButtonFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontPushButton, + kCTFontUtilityWindowTitleFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontUtilityWindowTitle, + kCTFontAlertHeaderFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontAlertHeader, + kCTFontSystemDetailFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontSystemDetail, + kCTFontEmphasizedSystemDetailFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontEmphasizedSystemDetail, + kCTFontToolbarFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontToolbar, + kCTFontSmallToolbarFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontSmallToolbar, + kCTFontMessageFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontMessage, + kCTFontPaletteFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontPalette, + kCTFontToolTipFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontToolTip, + kCTFontControlContentFontType __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTFontUIFontControlContent +}; +CTFontRef _Nullable CTFontCreateUIFontForLanguage( + CTFontUIFontType uiType, + CGFloat size, + CFStringRef _Nullable language ) __attribute__((availability(macosx,introduced=10.5))); +CTFontRef CTFontCreateCopyWithAttributes( + CTFontRef font, + CGFloat size, + const CGAffineTransform * _Nullable matrix, + CTFontDescriptorRef _Nullable attributes ) __attribute__((availability(macosx,introduced=10.5))); +CTFontRef _Nullable CTFontCreateCopyWithSymbolicTraits( + CTFontRef font, + CGFloat size, + const CGAffineTransform * _Nullable matrix, + CTFontSymbolicTraits symTraitValue, + CTFontSymbolicTraits symTraitMask ) __attribute__((availability(macosx,introduced=10.5))); +CTFontRef _Nullable CTFontCreateCopyWithFamily( + CTFontRef font, + CGFloat size, + const CGAffineTransform * _Nullable matrix, + CFStringRef family ) __attribute__((availability(macosx,introduced=10.5))); +CTFontRef CTFontCreateForString( + CTFontRef currentFont, + CFStringRef string, + CFRange range ) __attribute__((availability(macosx,introduced=10.5))); +CTFontDescriptorRef CTFontCopyFontDescriptor( + CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CFTypeRef _Nullable CTFontCopyAttribute( + CTFontRef font, + CFStringRef attribute ) __attribute__((availability(macosx,introduced=10.5))); +CGFloat CTFontGetSize( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CGAffineTransform CTFontGetMatrix( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CTFontSymbolicTraits CTFontGetSymbolicTraits( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CFDictionaryRef CTFontCopyTraits( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CFStringRef CTFontCopyPostScriptName( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CFStringRef CTFontCopyFamilyName( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CFStringRef CTFontCopyFullName( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CFStringRef CTFontCopyDisplayName( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CFStringRef _Nullable CTFontCopyName( + CTFontRef font, + CFStringRef nameKey ) __attribute__((availability(macosx,introduced=10.5))); +CFStringRef _Nullable CTFontCopyLocalizedName( + CTFontRef font, + CFStringRef nameKey, + CFStringRef _Nullable * _Nullable actualLanguage ) __attribute__((availability(macosx,introduced=10.5))); +CFCharacterSetRef CTFontCopyCharacterSet( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CFStringEncoding CTFontGetStringEncoding( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CFArrayRef CTFontCopySupportedLanguages( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +_Bool CTFontGetGlyphsForCharacters( + CTFontRef font, + const UniChar characters[], + CGGlyph glyphs[], + CFIndex count ) __attribute__((availability(macosx,introduced=10.5))); +CGFloat CTFontGetAscent( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CGFloat CTFontGetDescent( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CGFloat CTFontGetLeading( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +unsigned CTFontGetUnitsPerEm( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CFIndex CTFontGetGlyphCount( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CGRect CTFontGetBoundingBox( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CGFloat CTFontGetUnderlinePosition( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CGFloat CTFontGetUnderlineThickness( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CGFloat CTFontGetSlantAngle( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CGFloat CTFontGetCapHeight( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CGFloat CTFontGetXHeight( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CGGlyph CTFontGetGlyphWithName( + CTFontRef font, + CFStringRef glyphName ) __attribute__((availability(macosx,introduced=10.5))); +CGRect CTFontGetBoundingRectsForGlyphs( + CTFontRef font, + CTFontOrientation orientation, + const CGGlyph glyphs[], + CGRect * _Nullable boundingRects, + CFIndex count ) __attribute__((availability(macosx,introduced=10.5))); +CGRect CTFontGetOpticalBoundsForGlyphs( + CTFontRef font, + const CGGlyph glyphs[], + CGRect * _Nullable boundingRects, + CFIndex count, + CFOptionFlags options ) __attribute__((availability(macosx,introduced=10.8))); +double CTFontGetAdvancesForGlyphs( + CTFontRef font, + CTFontOrientation orientation, + const CGGlyph glyphs[], + CGSize * _Nullable advances, + CFIndex count ) __attribute__((availability(macosx,introduced=10.5))); +void CTFontGetVerticalTranslationsForGlyphs( + CTFontRef font, + const CGGlyph glyphs[], + CGSize translations[], + CFIndex count ) __attribute__((availability(macosx,introduced=10.5))); +CGPathRef _Nullable CTFontCreatePathForGlyph( + CTFontRef font, + CGGlyph glyph, + const CGAffineTransform * _Nullable matrix ) __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCTFontVariationAxisIdentifierKey __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontVariationAxisMinimumValueKey __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontVariationAxisMaximumValueKey __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontVariationAxisDefaultValueKey __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontVariationAxisNameKey __attribute__((availability(macosx,introduced=10.5))); +CFArrayRef _Nullable CTFontCopyVariationAxes( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CFDictionaryRef _Nullable CTFontCopyVariation( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCTFontOpenTypeFeatureTag __attribute__((availability(macosx,introduced=10.10))); + + + + + +extern const CFStringRef kCTFontOpenTypeFeatureValue __attribute__((availability(macosx,introduced=10.10))); + + + + + +extern const CFStringRef kCTFontFeatureTypeIdentifierKey __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontFeatureTypeNameKey __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontFeatureTypeExclusiveKey __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontFeatureTypeSelectorsKey __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontFeatureSelectorIdentifierKey __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontFeatureSelectorNameKey __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontFeatureSelectorDefaultKey __attribute__((availability(macosx,introduced=10.5))); + + + + + +extern const CFStringRef kCTFontFeatureSelectorSettingKey __attribute__((availability(macosx,introduced=10.5))); +CFArrayRef _Nullable CTFontCopyFeatures( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CFArrayRef _Nullable CTFontCopyFeatureSettings( CTFontRef font ) __attribute__((availability(macosx,introduced=10.5))); +CGFontRef CTFontCopyGraphicsFont( + CTFontRef font, + CTFontDescriptorRef _Nullable * _Nullable attributes ) __attribute__((availability(macosx,introduced=10.5))); +CTFontRef CTFontCreateWithGraphicsFont( + CGFontRef graphicsFont, + CGFloat size, + const CGAffineTransform * _Nullable matrix, + CTFontDescriptorRef _Nullable attributes ) __attribute__((availability(macosx,introduced=10.5))); +ATSFontRef CTFontGetPlatformFont( + CTFontRef font, + CTFontDescriptorRef _Nullable * _Nullable attributes ) __attribute__((availability(macosx,introduced=10.5))); +CTFontRef _Nullable CTFontCreateWithPlatformFont( + ATSFontRef platformFont, + CGFloat size, + const CGAffineTransform * _Nullable matrix, + CTFontDescriptorRef _Nullable attributes ) __attribute__((availability(macosx,introduced=10.5))); +CTFontRef CTFontCreateWithQuickdrawInstance( + ConstStr255Param _Nullable name, + int16_t identifier, + uint8_t style, + CGFloat size ) __attribute__((availability(macosx,introduced=10.5))); + + + + + +enum { + kCTFontTableBASE = 'BASE', + kCTFontTableCFF = 'CFF ', + kCTFontTableDSIG = 'DSIG', + kCTFontTableEBDT = 'EBDT', + kCTFontTableEBLC = 'EBLC', + kCTFontTableEBSC = 'EBSC', + kCTFontTableGDEF = 'GDEF', + kCTFontTableGPOS = 'GPOS', + kCTFontTableGSUB = 'GSUB', + kCTFontTableJSTF = 'JSTF', + kCTFontTableLTSH = 'LTSH', + kCTFontTableMATH = 'MATH', + kCTFontTableOS2 = 'OS/2', + kCTFontTablePCLT = 'PCLT', + kCTFontTableVDMX = 'VDMX', + kCTFontTableVORG = 'VORG', + kCTFontTableZapf = 'Zapf', + kCTFontTableAcnt = 'acnt', + kCTFontTableAnkr = 'ankr', + kCTFontTableAvar = 'avar', + kCTFontTableBdat = 'bdat', + kCTFontTableBhed = 'bhed', + kCTFontTableBloc = 'bloc', + kCTFontTableBsln = 'bsln', + kCTFontTableCmap = 'cmap', + kCTFontTableCvar = 'cvar', + kCTFontTableCvt = 'cvt ', + kCTFontTableFdsc = 'fdsc', + kCTFontTableFeat = 'feat', + kCTFontTableFmtx = 'fmtx', + kCTFontTableFpgm = 'fpgm', + kCTFontTableFvar = 'fvar', + kCTFontTableGasp = 'gasp', + kCTFontTableGlyf = 'glyf', + kCTFontTableGvar = 'gvar', + kCTFontTableHdmx = 'hdmx', + kCTFontTableHead = 'head', + kCTFontTableHhea = 'hhea', + kCTFontTableHmtx = 'hmtx', + kCTFontTableHsty = 'hsty', + kCTFontTableJust = 'just', + kCTFontTableKern = 'kern', + kCTFontTableKerx = 'kerx', + kCTFontTableLcar = 'lcar', + kCTFontTableLtag = 'ltag', + kCTFontTableLoca = 'loca', + kCTFontTableMaxp = 'maxp', + kCTFontTableMort = 'mort', + kCTFontTableMorx = 'morx', + kCTFontTableName = 'name', + kCTFontTableOpbd = 'opbd', + kCTFontTablePost = 'post', + kCTFontTablePrep = 'prep', + kCTFontTableProp = 'prop', + kCTFontTableSbit = 'sbit', + kCTFontTableSbix = 'sbix', + kCTFontTableTrak = 'trak', + kCTFontTableVhea = 'vhea', + kCTFontTableVmtx = 'vmtx' +}; +typedef FourCharCode CTFontTableTag; + +typedef uint32_t CTFontTableOptions; enum { + kCTFontTableOptionNoOptions __attribute__((availability(macosx,introduced=10.5))) = 0, + kCTFontTableOptionExcludeSynthetic __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))) = (1 << 0) +}; +CFArrayRef _Nullable CTFontCopyAvailableTables( + CTFontRef font, + CTFontTableOptions options ) __attribute__((availability(macosx,introduced=10.5))); +CFDataRef _Nullable CTFontCopyTable( + CTFontRef font, + CTFontTableTag table, + CTFontTableOptions options ) __attribute__((availability(macosx,introduced=10.5))); +void CTFontDrawGlyphs( + CTFontRef font, + const CGGlyph glyphs[], + const CGPoint positions[], + size_t count, + CGContextRef context ) __attribute__((availability(macosx,introduced=10.7))); +CFIndex CTFontGetLigatureCaretPositions( + CTFontRef font, + CGGlyph glyph, + CGFloat * _Nullable positions, + CFIndex maxPositions ) __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCTBaselineClassRoman __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCTBaselineClassIdeographicCentered __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCTBaselineClassIdeographicLow __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCTBaselineClassIdeographicHigh __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCTBaselineClassHanging __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCTBaselineClassMath __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCTBaselineReferenceFont __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCTBaselineOriginalFont __attribute__((availability(macosx,introduced=10.8))); +CFArrayRef _Nullable CTFontCopyDefaultCascadeListForLanguages( CTFontRef font, CFArrayRef _Nullable languagePrefList ) __attribute__((availability(macosx,introduced=10.8))); +typedef const struct __attribute__((objc_bridge(NSFontCollection))) __CTFontCollection * CTFontCollectionRef; +typedef struct __attribute__((objc_bridge_mutable(NSMutableFontCollection))) __CTFontCollection * CTMutableFontCollectionRef; + + + + + + + +CFTypeID CTFontCollectionGetTypeID( void ) __attribute__((availability(macosx,introduced=10.5))); + + + + + + +typedef CFComparisonResult (*CTFontCollectionSortDescriptorsCallback)( + CTFontDescriptorRef first, + CTFontDescriptorRef second, + void *refCon ); +extern const CFStringRef kCTFontCollectionRemoveDuplicatesOption __attribute__((availability(macosx,introduced=10.5))); + + + + + + +extern const CFStringRef kCTFontCollectionIncludeDisabledFontsOption __attribute__((availability(macosx,introduced=10.7))); + + + + + + +extern const CFStringRef kCTFontCollectionDisallowAutoActivationOption __attribute__((availability(macosx,introduced=10.7))); +CTFontCollectionRef CTFontCollectionCreateFromAvailableFonts( + CFDictionaryRef _Nullable options ) __attribute__((availability(macosx,introduced=10.5))); +CTFontCollectionRef CTFontCollectionCreateWithFontDescriptors( + CFArrayRef _Nullable queryDescriptors, + CFDictionaryRef _Nullable options ) __attribute__((availability(macosx,introduced=10.5))); +CTFontCollectionRef CTFontCollectionCreateCopyWithFontDescriptors( + CTFontCollectionRef original, + CFArrayRef _Nullable queryDescriptors, + CFDictionaryRef _Nullable options ) __attribute__((availability(macosx,introduced=10.5))); +CTMutableFontCollectionRef CTFontCollectionCreateMutableCopy( + CTFontCollectionRef original ) __attribute__((availability(macosx,introduced=10.7))); +CFArrayRef _Nullable CTFontCollectionCopyQueryDescriptors( + CTFontCollectionRef collection ) __attribute__((availability(macosx,introduced=10.7))); +void CTFontCollectionSetQueryDescriptors( + CTMutableFontCollectionRef collection, + CFArrayRef _Nullable descriptors ) __attribute__((availability(macosx,introduced=10.7))); +CFArrayRef _Nullable CTFontCollectionCopyExclusionDescriptors( CTFontCollectionRef collection ) __attribute__((availability(macosx,introduced=10.7))); +void CTFontCollectionSetExclusionDescriptors( + CTMutableFontCollectionRef collection, + CFArrayRef _Nullable descriptors ) __attribute__((availability(macosx,introduced=10.7))); +CFArrayRef _Nullable CTFontCollectionCreateMatchingFontDescriptors( + CTFontCollectionRef collection ) __attribute__((availability(macosx,introduced=10.5))); +CFArrayRef _Nullable CTFontCollectionCreateMatchingFontDescriptorsSortedWithCallback( + CTFontCollectionRef collection, + CTFontCollectionSortDescriptorsCallback _Nullable sortCallback, + void * _Nullable refCon ) __attribute__((availability(macosx,introduced=10.5))); +CFArrayRef _Nullable CTFontCollectionCreateMatchingFontDescriptorsWithOptions( + CTFontCollectionRef collection, + CFDictionaryRef _Nullable options ) __attribute__((availability(macosx,introduced=10.7))); +CFArrayRef _Nullable CTFontCollectionCreateMatchingFontDescriptorsForFamily( + CTFontCollectionRef collection, + CFStringRef familyName, + CFDictionaryRef _Nullable options ) __attribute__((availability(macosx,introduced=10.7))); +typedef uint32_t CTFontCollectionCopyOptions; enum { + kCTFontCollectionCopyDefaultOptions = 0, + kCTFontCollectionCopyUnique = (1 << 0), + kCTFontCollectionCopyStandardSort = (1 << 1) +} __attribute__((availability(macosx,introduced=10.7))); +CFArrayRef CTFontCollectionCopyFontAttribute( + CTFontCollectionRef collection, + CFStringRef attributeName, + CTFontCollectionCopyOptions options ) __attribute__((availability(macosx,introduced=10.7))); +CFArrayRef CTFontCollectionCopyFontAttributes( + CTFontCollectionRef collection, + CFSetRef attributeNames, + CTFontCollectionCopyOptions options ) __attribute__((availability(macosx,introduced=10.7))); + +extern const CFStringRef kCTFontManagerErrorDomain __attribute__((availability(macosx,introduced=10.6))); + + + + + + +extern const CFStringRef kCTFontManagerErrorFontURLsKey __attribute__((availability(macosx,introduced=10.6))); +typedef CFIndex CTFontManagerError; enum { + kCTFontManagerErrorFileNotFound = 101, + kCTFontManagerErrorInsufficientPermissions = 102, + kCTFontManagerErrorUnrecognizedFormat = 103, + kCTFontManagerErrorInvalidFontData = 104, + kCTFontManagerErrorAlreadyRegistered = 105, + kCTFontManagerErrorNotRegistered = 201, + kCTFontManagerErrorInUse = 202, + kCTFontManagerErrorSystemRequired = 203, +}; +CFArrayRef CTFontManagerCopyAvailablePostScriptNames( void ) __attribute__((availability(macosx,introduced=10.6))); + + + + + + + +CFArrayRef CTFontManagerCopyAvailableFontFamilyNames( void ) __attribute__((availability(macosx,introduced=10.6))); + + + + + + + +CFArrayRef CTFontManagerCopyAvailableFontURLs( void ) __attribute__((availability(macosx,introduced=10.6))); +CFComparisonResult CTFontManagerCompareFontFamilyNames( + const void * family1, + const void * family2, + void * _Nullable context ) __attribute__((availability(macosx,introduced=10.6))); +CFArrayRef _Nullable CTFontManagerCreateFontDescriptorsFromURL( + CFURLRef fileURL ) __attribute__((availability(macosx,introduced=10.6))); +CTFontDescriptorRef _Nullable CTFontManagerCreateFontDescriptorFromData( + CFDataRef data ) __attribute__((availability(macosx,introduced=10.7))); +typedef uint32_t CTFontManagerScope; enum { + kCTFontManagerScopeNone = 0, + kCTFontManagerScopeProcess = 1, + kCTFontManagerScopeUser = 2, + kCTFontManagerScopeSession = 3 +}; +_Bool CTFontManagerRegisterFontsForURL( + CFURLRef fontURL, + CTFontManagerScope scope, + CFErrorRef * error ) __attribute__((availability(macosx,introduced=10.6))); +_Bool CTFontManagerUnregisterFontsForURL( + CFURLRef fontURL, + CTFontManagerScope scope, + CFErrorRef * error ) __attribute__((availability(macosx,introduced=10.6))); +_Bool CTFontManagerRegisterGraphicsFont( + CGFontRef font, + CFErrorRef * error ) __attribute__((availability(macosx,introduced=10.8))); +_Bool CTFontManagerUnregisterGraphicsFont( + CGFontRef font, + CFErrorRef * error ) __attribute__((availability(macosx,introduced=10.8))); +_Bool CTFontManagerRegisterFontsForURLs( + CFArrayRef fontURLs, + CTFontManagerScope scope, + CFArrayRef _Nullable * _Nullable errors ) __attribute__((availability(macosx,introduced=10.6))); +_Bool CTFontManagerUnregisterFontsForURLs( + CFArrayRef fontURLs, + CTFontManagerScope scope, + CFArrayRef _Nullable * _Nullable errors ) __attribute__((availability(macosx,introduced=10.6))); +void CTFontManagerEnableFontDescriptors( + CFArrayRef descriptors, + _Bool enable ) __attribute__((availability(macosx,introduced=10.6))); +CTFontManagerScope CTFontManagerGetScopeForURL( + CFURLRef fontURL ) __attribute__((availability(macosx,introduced=10.6))); +_Bool CTFontManagerIsSupportedFont( + CFURLRef fontURL ) __attribute__((availability(macosx,introduced=10.6))); +CFRunLoopSourceRef _Nullable CTFontManagerCreateFontRequestRunLoopSource( + CFIndex sourceOrder, + CFArrayRef (^createMatchesCallback)(CFDictionaryRef requestAttributes, pid_t requestingProcess)) __attribute__((availability(macosx,introduced=10.6))); + + + + + + + +extern const CFStringRef kCTFontManagerBundleIdentifier __attribute__((availability(macosx,introduced=10.6))); +typedef uint32_t CTFontManagerAutoActivationSetting; enum { + kCTFontManagerAutoActivationDefault = 0, + kCTFontManagerAutoActivationDisabled = 1, + kCTFontManagerAutoActivationEnabled = 2, + kCTFontManagerAutoActivationPromptUser = 3 +}; +void CTFontManagerSetAutoActivationSetting( + CFStringRef _Nullable bundleIdentifier, + CTFontManagerAutoActivationSetting setting ) __attribute__((availability(macosx,introduced=10.6))); +CTFontManagerAutoActivationSetting CTFontManagerGetAutoActivationSetting( + CFStringRef _Nullable bundleIdentifier ) __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kCTFontManagerRegisteredFontsChangedNotification __attribute__((availability(macosx,introduced=10.6))); + +typedef const struct __attribute__((objc_bridge(id))) __CTFrame * CTFrameRef; + + + + + + + +CFTypeID CTFrameGetTypeID( void ) __attribute__((availability(macosx,introduced=10.5))); +typedef uint32_t CTFrameProgression; enum { + kCTFrameProgressionTopToBottom = 0, + kCTFrameProgressionRightToLeft = 1, + kCTFrameProgressionLeftToRight = 2 +}; +extern const CFStringRef kCTFrameProgressionAttributeName __attribute__((availability(macosx,introduced=10.5))); +typedef uint32_t CTFramePathFillRule; enum { + kCTFramePathFillEvenOdd = 0, + kCTFramePathFillWindingNumber = 1 +}; +extern const CFStringRef kCTFramePathFillRuleAttributeName __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kCTFramePathWidthAttributeName __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kCTFrameClippingPathsAttributeName __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kCTFramePathClippingPathAttributeName __attribute__((availability(macosx,introduced=10.7))); +CFRange CTFrameGetStringRange( + CTFrameRef frame ) __attribute__((availability(macosx,introduced=10.5))); +CFRange CTFrameGetVisibleStringRange( + CTFrameRef frame ) __attribute__((availability(macosx,introduced=10.5))); +CGPathRef CTFrameGetPath( + CTFrameRef frame ) __attribute__((availability(macosx,introduced=10.5))); +CFDictionaryRef _Nullable CTFrameGetFrameAttributes( + CTFrameRef frame ) __attribute__((availability(macosx,introduced=10.5))); +CFArrayRef CTFrameGetLines( + CTFrameRef frame ) __attribute__((availability(macosx,introduced=10.5))); +void CTFrameGetLineOrigins( + CTFrameRef frame, + CFRange range, + CGPoint origins[] ) __attribute__((availability(macosx,introduced=10.5))); +void CTFrameDraw( + CTFrameRef frame, + CGContextRef context ) __attribute__((availability(macosx,introduced=10.5))); +typedef const struct __attribute__((objc_bridge(id))) __CTLine * CTLineRef; +typedef CFOptionFlags CTLineBoundsOptions; enum { + kCTLineBoundsExcludeTypographicLeading = 1 << 0, + kCTLineBoundsExcludeTypographicShifts = 1 << 1, + kCTLineBoundsUseHangingPunctuation = 1 << 2, + kCTLineBoundsUseGlyphPathBounds = 1 << 3, + kCTLineBoundsUseOpticalBounds = 1 << 4, + kCTLineBoundsIncludeLanguageExtents __attribute__((availability(macosx,introduced=10.11))) = 1 << 5, +}; +typedef uint32_t CTLineTruncationType; enum { + kCTLineTruncationStart = 0, + kCTLineTruncationEnd = 1, + kCTLineTruncationMiddle = 2 +}; + + + + + + + +CFTypeID CTLineGetTypeID( void ) __attribute__((availability(macosx,introduced=10.5))); +CTLineRef CTLineCreateWithAttributedString( + CFAttributedStringRef attrString ) __attribute__((availability(macosx,introduced=10.5))); +CTLineRef _Nullable CTLineCreateTruncatedLine( + CTLineRef line, + double width, + CTLineTruncationType truncationType, + CTLineRef _Nullable truncationToken ) __attribute__((availability(macosx,introduced=10.5))); +CTLineRef _Nullable CTLineCreateJustifiedLine( + CTLineRef line, + CGFloat justificationFactor, + double justificationWidth ) __attribute__((availability(macosx,introduced=10.5))); +CFIndex CTLineGetGlyphCount( + CTLineRef line ) __attribute__((availability(macosx,introduced=10.5))); +CFArrayRef CTLineGetGlyphRuns( + CTLineRef line ) __attribute__((availability(macosx,introduced=10.5))); +CFRange CTLineGetStringRange( + CTLineRef line ) __attribute__((availability(macosx,introduced=10.5))); +double CTLineGetPenOffsetForFlush( + CTLineRef line, + CGFloat flushFactor, + double flushWidth ) __attribute__((availability(macosx,introduced=10.5))); +void CTLineDraw( + CTLineRef line, + CGContextRef context ) __attribute__((availability(macosx,introduced=10.5))); +double CTLineGetTypographicBounds( + CTLineRef line, + CGFloat * _Nullable ascent, + CGFloat * _Nullable descent, + CGFloat * _Nullable leading ) __attribute__((availability(macosx,introduced=10.5))); +CGRect CTLineGetBoundsWithOptions( + CTLineRef line, + CTLineBoundsOptions options ) __attribute__((availability(macosx,introduced=10.8))); +double CTLineGetTrailingWhitespaceWidth( + CTLineRef line ) __attribute__((availability(macosx,introduced=10.5))); +CGRect CTLineGetImageBounds( + CTLineRef line, + CGContextRef _Nullable context ) __attribute__((availability(macosx,introduced=10.5))); +CFIndex CTLineGetStringIndexForPosition( + CTLineRef line, + CGPoint position ) __attribute__((availability(macosx,introduced=10.5))); +CGFloat CTLineGetOffsetForStringIndex( + CTLineRef line, + CFIndex charIndex, + CGFloat * _Nullable secondaryOffset ) __attribute__((availability(macosx,introduced=10.5))); +void CTLineEnumerateCaretOffsets( + CTLineRef line, + void (^block)(double offset, CFIndex charIndex, _Bool leadingEdge, _Bool* stop) ) __attribute__((availability(macosx,introduced=10.11))); +typedef const struct __attribute__((objc_bridge(id))) __CTTypesetter * CTTypesetterRef; + + + + + + + +CFTypeID CTTypesetterGetTypeID( void ) __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCTTypesetterOptionDisableBidiProcessing __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))); +extern const CFStringRef kCTTypesetterOptionForcedEmbeddingLevel __attribute__((availability(macosx,introduced=10.5))); +CTTypesetterRef CTTypesetterCreateWithAttributedString( + CFAttributedStringRef string ) __attribute__((availability(macosx,introduced=10.5))); +CTTypesetterRef CTTypesetterCreateWithAttributedStringAndOptions( + CFAttributedStringRef string, + CFDictionaryRef _Nullable options ) __attribute__((availability(macosx,introduced=10.5))); +CTLineRef CTTypesetterCreateLineWithOffset( + CTTypesetterRef typesetter, + CFRange stringRange, + double offset ) __attribute__((availability(macosx,introduced=10.6))); + + + + + + +CTLineRef CTTypesetterCreateLine( + CTTypesetterRef typesetter, + CFRange stringRange ) __attribute__((availability(macosx,introduced=10.5))); +CFIndex CTTypesetterSuggestLineBreakWithOffset( + CTTypesetterRef typesetter, + CFIndex startIndex, + double width, + double offset ) __attribute__((availability(macosx,introduced=10.6))); + + + + + + +CFIndex CTTypesetterSuggestLineBreak( + CTTypesetterRef typesetter, + CFIndex startIndex, + double width ) __attribute__((availability(macosx,introduced=10.5))); +CFIndex CTTypesetterSuggestClusterBreakWithOffset( + CTTypesetterRef typesetter, + CFIndex startIndex, + double width, + double offset ) __attribute__((availability(macosx,introduced=10.6))); + + + + + + + +CFIndex CTTypesetterSuggestClusterBreak( + CTTypesetterRef typesetter, + CFIndex startIndex, + double width ) __attribute__((availability(macosx,introduced=10.5))); +typedef const struct __attribute__((objc_bridge(id))) __CTFramesetter * CTFramesetterRef; + + + + + + + +CFTypeID CTFramesetterGetTypeID( void ) __attribute__((availability(macosx,introduced=10.5))); +CTFramesetterRef CTFramesetterCreateWithAttributedString( + CFAttributedStringRef string ) __attribute__((availability(macosx,introduced=10.5))); +CTFrameRef CTFramesetterCreateFrame( + CTFramesetterRef framesetter, + CFRange stringRange, + CGPathRef path, + CFDictionaryRef _Nullable frameAttributes ) __attribute__((availability(macosx,introduced=10.5))); +CTTypesetterRef CTFramesetterGetTypesetter( + CTFramesetterRef framesetter ) __attribute__((availability(macosx,introduced=10.5))); +CGSize CTFramesetterSuggestFrameSizeWithConstraints( + CTFramesetterRef framesetter, + CFRange stringRange, + CFDictionaryRef _Nullable frameAttributes, + CGSize constraints, + CFRange * _Nullable fitRange ) __attribute__((availability(macosx,introduced=10.5))); +typedef const struct __attribute__((objc_bridge(NSGlyphInfo))) __CTGlyphInfo * CTGlyphInfoRef; + + + + + + + +CFTypeID CTGlyphInfoGetTypeID( void ) __attribute__((availability(macosx,introduced=10.5))); +typedef uint16_t CTCharacterCollection; enum { + kCTCharacterCollectionIdentityMapping __attribute__((availability(macosx,introduced=10.8))) = 0, + kCTCharacterCollectionAdobeCNS1 __attribute__((availability(macosx,introduced=10.8))) = 1, + kCTCharacterCollectionAdobeGB1 __attribute__((availability(macosx,introduced=10.8))) = 2, + kCTCharacterCollectionAdobeJapan1 __attribute__((availability(macosx,introduced=10.8))) = 3, + kCTCharacterCollectionAdobeJapan2 __attribute__((availability(macosx,introduced=10.8))) = 4, + kCTCharacterCollectionAdobeKorea1 __attribute__((availability(macosx,introduced=10.8))) = 5, + + kCTIdentityMappingCharacterCollection __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTCharacterCollectionIdentityMapping, + kCTAdobeCNS1CharacterCollection __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTCharacterCollectionAdobeCNS1, + kCTAdobeGB1CharacterCollection __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTCharacterCollectionAdobeGB1, + kCTAdobeJapan1CharacterCollection __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTCharacterCollectionAdobeJapan1, + kCTAdobeJapan2CharacterCollection __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTCharacterCollectionAdobeJapan2, + kCTAdobeKorea1CharacterCollection __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTCharacterCollectionAdobeKorea1 +}; +CTGlyphInfoRef CTGlyphInfoCreateWithGlyphName( + CFStringRef glyphName, + CTFontRef font, + CFStringRef baseString ) __attribute__((availability(macosx,introduced=10.5))); +CTGlyphInfoRef CTGlyphInfoCreateWithGlyph( + CGGlyph glyph, + CTFontRef font, + CFStringRef baseString ) __attribute__((availability(macosx,introduced=10.5))); +CTGlyphInfoRef CTGlyphInfoCreateWithCharacterIdentifier( + CGFontIndex cid, + CTCharacterCollection collection, + CFStringRef baseString ) __attribute__((availability(macosx,introduced=10.5))); +CFStringRef _Nullable CTGlyphInfoGetGlyphName( + CTGlyphInfoRef glyphInfo ) __attribute__((availability(macosx,introduced=10.5))); +CGFontIndex CTGlyphInfoGetCharacterIdentifier( + CTGlyphInfoRef glyphInfo ) __attribute__((availability(macosx,introduced=10.5))); +CTCharacterCollection CTGlyphInfoGetCharacterCollection( + CTGlyphInfoRef glyphInfo ) __attribute__((availability(macosx,introduced=10.5))); + +typedef const struct __attribute__((objc_bridge_related(NSParagraphStyle,,))) __CTParagraphStyle * CTParagraphStyleRef; + + + + + + + +CFTypeID CTParagraphStyleGetTypeID( void ) __attribute__((availability(macosx,introduced=10.5))); +typedef uint8_t CTTextAlignment; enum { + kCTTextAlignmentLeft __attribute__((availability(macosx,introduced=10.8))) = 0, + kCTTextAlignmentRight __attribute__((availability(macosx,introduced=10.8))) = 1, + kCTTextAlignmentCenter __attribute__((availability(macosx,introduced=10.8))) = 2, + kCTTextAlignmentJustified __attribute__((availability(macosx,introduced=10.8))) = 3, + kCTTextAlignmentNatural __attribute__((availability(macosx,introduced=10.8))) = 4, + + kCTLeftTextAlignment __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTTextAlignmentLeft, + kCTRightTextAlignment __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTTextAlignmentRight, + kCTCenterTextAlignment __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTTextAlignmentCenter, + kCTJustifiedTextAlignment __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTTextAlignmentJustified, + kCTNaturalTextAlignment __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))) = kCTTextAlignmentNatural +}; +typedef uint8_t CTLineBreakMode; enum { + kCTLineBreakByWordWrapping = 0, + kCTLineBreakByCharWrapping = 1, + kCTLineBreakByClipping = 2, + kCTLineBreakByTruncatingHead = 3, + kCTLineBreakByTruncatingTail = 4, + kCTLineBreakByTruncatingMiddle = 5 +}; +typedef int8_t CTWritingDirection; enum { + kCTWritingDirectionNatural = -1, + kCTWritingDirectionLeftToRight = 0, + kCTWritingDirectionRightToLeft = 1 +}; +typedef uint32_t CTParagraphStyleSpecifier; enum { + kCTParagraphStyleSpecifierAlignment = 0, + kCTParagraphStyleSpecifierFirstLineHeadIndent = 1, + kCTParagraphStyleSpecifierHeadIndent = 2, + kCTParagraphStyleSpecifierTailIndent = 3, + kCTParagraphStyleSpecifierTabStops = 4, + kCTParagraphStyleSpecifierDefaultTabInterval = 5, + kCTParagraphStyleSpecifierLineBreakMode = 6, + kCTParagraphStyleSpecifierLineHeightMultiple = 7, + kCTParagraphStyleSpecifierMaximumLineHeight = 8, + kCTParagraphStyleSpecifierMinimumLineHeight = 9, + kCTParagraphStyleSpecifierLineSpacing __attribute__((availability(macosx,introduced=10.5,deprecated=10.8))) = 10, + kCTParagraphStyleSpecifierParagraphSpacing = 11, + kCTParagraphStyleSpecifierParagraphSpacingBefore = 12, + kCTParagraphStyleSpecifierBaseWritingDirection = 13, + kCTParagraphStyleSpecifierMaximumLineSpacing = 14, + kCTParagraphStyleSpecifierMinimumLineSpacing = 15, + kCTParagraphStyleSpecifierLineSpacingAdjustment = 16, + kCTParagraphStyleSpecifierLineBoundsOptions = 17, + + kCTParagraphStyleSpecifierCount +}; +typedef struct CTParagraphStyleSetting +{ + CTParagraphStyleSpecifier spec; + size_t valueSize; + const void * value; + +} CTParagraphStyleSetting; +CTParagraphStyleRef CTParagraphStyleCreate( + const CTParagraphStyleSetting * _Nullable settings, + size_t settingCount ) __attribute__((availability(macosx,introduced=10.5))); +CTParagraphStyleRef CTParagraphStyleCreateCopy( + CTParagraphStyleRef paragraphStyle ) __attribute__((availability(macosx,introduced=10.5))); +_Bool CTParagraphStyleGetValueForSpecifier( + CTParagraphStyleRef paragraphStyle, + CTParagraphStyleSpecifier spec, + size_t valueBufferSize, + void * valueBuffer ) __attribute__((availability(macosx,introduced=10.5))); +typedef const struct __attribute__((objc_bridge(id))) __CTRubyAnnotation * CTRubyAnnotationRef; + + + + + + + +CFTypeID CTRubyAnnotationGetTypeID( void ) __attribute__((availability(macosx,introduced=10.10))); +typedef uint8_t CTRubyAlignment; enum { + kCTRubyAlignmentInvalid = (uint8_t)-1, + kCTRubyAlignmentAuto = 0, + kCTRubyAlignmentStart = 1, + kCTRubyAlignmentCenter = 2, + kCTRubyAlignmentEnd = 3, + kCTRubyAlignmentDistributeLetter = 4, + kCTRubyAlignmentDistributeSpace = 5, + kCTRubyAlignmentLineEdge = 6 +} __attribute__((availability(macosx,introduced=10.10))); +typedef uint8_t CTRubyOverhang; enum { + kCTRubyOverhangInvalid = (uint8_t)-1, + kCTRubyOverhangAuto = 0, + kCTRubyOverhangStart = 1, + kCTRubyOverhangEnd = 2, + kCTRubyOverhangNone = 3 +} __attribute__((availability(macosx,introduced=10.10))); +typedef uint8_t CTRubyPosition; enum { + kCTRubyPositionBefore = 0, + kCTRubyPositionAfter = 1, + kCTRubyPositionInterCharacter = 2, + kCTRubyPositionInline = 3, + kCTRubyPositionCount +} __attribute__((availability(macosx,introduced=10.10))); +CTRubyAnnotationRef CTRubyAnnotationCreate( + CTRubyAlignment alignment, + CTRubyOverhang overhang, + CGFloat sizeFactor, + CFStringRef text[kCTRubyPositionCount] ) __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kCTRubyAnnotationSizeFactorAttributeName __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCTRubyAnnotationScaleToFitAttributeName __attribute__((availability(macosx,introduced=10.12))); +CTRubyAnnotationRef CTRubyAnnotationCreateWithAttributes( + CTRubyAlignment alignment, + CTRubyOverhang overhang, + CTRubyPosition position, + CFStringRef string, + CFDictionaryRef attributes ) __attribute__((availability(macosx,introduced=10.12))); +CTRubyAnnotationRef CTRubyAnnotationCreateCopy( + CTRubyAnnotationRef rubyAnnotation ) __attribute__((availability(macosx,introduced=10.10))); +CTRubyAlignment CTRubyAnnotationGetAlignment( + CTRubyAnnotationRef rubyAnnotation ) __attribute__((availability(macosx,introduced=10.10))); +CTRubyOverhang CTRubyAnnotationGetOverhang( + CTRubyAnnotationRef rubyAnnotation ) __attribute__((availability(macosx,introduced=10.10))); +CGFloat CTRubyAnnotationGetSizeFactor( + CTRubyAnnotationRef rubyAnnotation ) __attribute__((availability(macosx,introduced=10.10))); +CFStringRef _Nullable CTRubyAnnotationGetTextForPosition( + CTRubyAnnotationRef rubyAnnotation, + CTRubyPosition position ) __attribute__((availability(macosx,introduced=10.10))); +typedef const struct __attribute__((objc_bridge(id))) __CTRun * CTRunRef; +typedef uint32_t CTRunStatus; enum +{ + kCTRunStatusNoStatus = 0, + kCTRunStatusRightToLeft = (1 << 0), + kCTRunStatusNonMonotonic = (1 << 1), + kCTRunStatusHasNonIdentityMatrix = (1 << 2) +}; + + + + + + + +CFTypeID CTRunGetTypeID( void ) __attribute__((availability(macosx,introduced=10.5))); +CFIndex CTRunGetGlyphCount( + CTRunRef run ) __attribute__((availability(macosx,introduced=10.5))); +CFDictionaryRef CTRunGetAttributes( + CTRunRef run ) __attribute__((availability(macosx,introduced=10.5))); +CTRunStatus CTRunGetStatus( + CTRunRef run ) __attribute__((availability(macosx,introduced=10.5))); +const CGGlyph * _Nullable CTRunGetGlyphsPtr( + CTRunRef run ) __attribute__((availability(macosx,introduced=10.5))); +void CTRunGetGlyphs( + CTRunRef run, + CFRange range, + CGGlyph buffer[] ) __attribute__((availability(macosx,introduced=10.5))); +const CGPoint * _Nullable CTRunGetPositionsPtr( + CTRunRef run ) __attribute__((availability(macosx,introduced=10.5))); +void CTRunGetPositions( + CTRunRef run, + CFRange range, + CGPoint buffer[] ) __attribute__((availability(macosx,introduced=10.5))); +const CGSize * _Nullable CTRunGetAdvancesPtr( + CTRunRef run ) __attribute__((availability(macosx,introduced=10.5))); +void CTRunGetAdvances( + CTRunRef run, + CFRange range, + CGSize buffer[] ) __attribute__((availability(macosx,introduced=10.5))); +const CFIndex * _Nullable CTRunGetStringIndicesPtr( + CTRunRef run ) __attribute__((availability(macosx,introduced=10.5))); +void CTRunGetStringIndices( + CTRunRef run, + CFRange range, + CFIndex buffer[] ) __attribute__((availability(macosx,introduced=10.5))); +CFRange CTRunGetStringRange( + CTRunRef run ) __attribute__((availability(macosx,introduced=10.5))); +double CTRunGetTypographicBounds( + CTRunRef run, + CFRange range, + CGFloat * _Nullable ascent, + CGFloat * _Nullable descent, + CGFloat * _Nullable leading ) __attribute__((availability(macosx,introduced=10.5))); +CGRect CTRunGetImageBounds( + CTRunRef run, + CGContextRef _Nullable context, + CFRange range ) __attribute__((availability(macosx,introduced=10.5))); +CGAffineTransform CTRunGetTextMatrix( + CTRunRef run ) __attribute__((availability(macosx,introduced=10.5))); +void CTRunDraw( + CTRunRef run, + CGContextRef context, + CFRange range ) __attribute__((availability(macosx,introduced=10.5))); +typedef const struct __attribute__((objc_bridge(id))) __CTRunDelegate * CTRunDelegateRef; + + + + + + +CFTypeID CTRunDelegateGetTypeID( void ) __attribute__((availability(macosx,introduced=10.5))); +typedef void (*CTRunDelegateDeallocateCallback) ( + void * refCon ); +typedef CGFloat (*CTRunDelegateGetAscentCallback) ( + void * refCon ); +typedef CGFloat (*CTRunDelegateGetDescentCallback) ( + void * refCon ); +typedef CGFloat (*CTRunDelegateGetWidthCallback) ( + void * refCon ); +typedef struct +{ + CFIndex version; + CTRunDelegateDeallocateCallback dealloc; + CTRunDelegateGetAscentCallback getAscent; + CTRunDelegateGetDescentCallback getDescent; + CTRunDelegateGetWidthCallback getWidth; +} CTRunDelegateCallbacks; +enum { + kCTRunDelegateVersion1 = 1, + kCTRunDelegateCurrentVersion = kCTRunDelegateVersion1 +}; +CTRunDelegateRef _Nullable CTRunDelegateCreate( + const CTRunDelegateCallbacks* callbacks, + void * _Nullable refCon ) __attribute__((availability(macosx,introduced=10.5))); +void * CTRunDelegateGetRefCon( + CTRunDelegateRef runDelegate ) __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCTFontAttributeName __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCTForegroundColorFromContextAttributeName __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCTKernAttributeName __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCTLigatureAttributeName __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCTForegroundColorAttributeName __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCTBackgroundColorAttributeName __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCTParagraphStyleAttributeName __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCTStrokeWidthAttributeName __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kCTStrokeColorAttributeName __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kCTUnderlineStyleAttributeName __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCTSuperscriptAttributeName __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCTUnderlineColorAttributeName __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCTVerticalFormsAttributeName __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCTHorizontalInVerticalFormsAttributeName __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCTGlyphInfoAttributeName __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCTCharacterShapeAttributeName __attribute__((availability(macosx,introduced=10.5,deprecated=10.11))); +extern const CFStringRef kCTLanguageAttributeName __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kCTRunDelegateAttributeName __attribute__((availability(macosx,introduced=10.5))); +typedef int32_t CTUnderlineStyle; enum { + kCTUnderlineStyleNone = 0x00, + kCTUnderlineStyleSingle = 0x01, + kCTUnderlineStyleThick = 0x02, + kCTUnderlineStyleDouble = 0x09 +}; +typedef int32_t CTUnderlineStyleModifiers; enum { + kCTUnderlinePatternSolid = 0x0000, + kCTUnderlinePatternDot = 0x0100, + kCTUnderlinePatternDash = 0x0200, + kCTUnderlinePatternDashDot = 0x0300, + kCTUnderlinePatternDashDotDot = 0x0400 +}; +extern const CFStringRef kCTBaselineClassAttributeName __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCTBaselineInfoAttributeName __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCTBaselineReferenceInfoAttributeName __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCTWritingDirectionAttributeName __attribute__((availability(macosx,introduced=10.8))); +enum { + kCTWritingDirectionEmbedding = (0 << 1), + kCTWritingDirectionOverride = (1 << 1) +}; +extern const CFStringRef kCTRubyAnnotationAttributeName __attribute__((availability(macosx,introduced=10.10))); +typedef const struct __attribute__((objc_bridge_related(NSTextTab,,))) __CTTextTab * CTTextTabRef; + + + + + + + +CFTypeID CTTextTabGetTypeID( void ) __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCTTabColumnTerminatorsAttributeName __attribute__((availability(macosx,introduced=10.5))); +CTTextTabRef CTTextTabCreate( + CTTextAlignment alignment, + double location, + CFDictionaryRef _Nullable options ) __attribute__((availability(macosx,introduced=10.5))); +CTTextAlignment CTTextTabGetAlignment( + CTTextTabRef tab ) __attribute__((availability(macosx,introduced=10.5))); +double CTTextTabGetLocation( + CTTextTabRef tab ) __attribute__((availability(macosx,introduced=10.5))); +CFDictionaryRef _Nullable CTTextTabGetOptions( + CTTextTabRef tab ) __attribute__((availability(macosx,introduced=10.5))); +uint32_t CTGetCoreTextVersion( void ) __attribute__((availability(macosx,introduced=10.5))); + + + + + +enum { + cmICCProfileVersion4 = 0x04000000, + cmICCProfileVersion2 = 0x02000000, + cmICCProfileVersion21 = 0x02100000, + cmCS2ProfileVersion = cmICCProfileVersion2, + cmCS1ProfileVersion = 0x00000100 +}; + + +enum { + cmProfileMajorVersionMask = (int)0xFF000000, + cmCurrentProfileMajorVersion = 0x02000000 +}; + + +enum { + cmMagicNumber = 'acsp' +}; + + + + + + +enum { + cmICCReservedFlagsMask = 0x0000FFFF, + cmEmbeddedMask = 0x00000001, + cmEmbeddedUseMask = 0x00000002, + cmBlackPointCompensationMask = 0x00000004, + cmCMSReservedFlagsMask = (int)0xFFFF0000, + cmQualityMask = 0x00030000, + cmInterpolationMask = 0x00040000, + cmGamutCheckingMask = 0x00080000 +}; + + +enum { + cmEmbeddedProfile = 0, + cmEmbeddedUse = 1 +}; + + +enum { + cmNormalMode = 0, + cmDraftMode = 1, + cmBestMode = 2 +}; + + +enum { + cmBlackPointCompensation = 1 +}; + + + + + + +enum { + cmReflectiveTransparentMask = 0x00000001, + cmGlossyMatteMask = 0x00000002 +}; + + +enum { + cmReflective = 0, + cmGlossy = 1 +}; + + + +enum { + cmPerceptual = 0, + cmRelativeColorimetric = 1, + cmSaturation = 2, + cmAbsoluteColorimetric = 3 +}; + + + + +enum { + cmAsciiData = 0, + cmBinaryData = 1 +}; + + +enum { + cmPrtrDefaultScreens = 0, + cmLinesPer = 1 +}; + + +enum { + cmNumHeaderElements = 10 +}; + + +enum { + cmAToB0Tag = 'A2B0', + cmAToB1Tag = 'A2B1', + cmAToB2Tag = 'A2B2', + cmBlueColorantTag = 'bXYZ', + cmBlueTRCTag = 'bTRC', + cmBToA0Tag = 'B2A0', + cmBToA1Tag = 'B2A1', + cmBToA2Tag = 'B2A2', + cmCalibrationDateTimeTag = 'calt', + cmChromaticAdaptationTag = 'chad', + cmCharTargetTag = 'targ', + cmCopyrightTag = 'cprt', + cmDeviceMfgDescTag = 'dmnd', + cmDeviceModelDescTag = 'dmdd', + cmGamutTag = 'gamt', + cmGrayTRCTag = 'kTRC', + cmGreenColorantTag = 'gXYZ', + cmGreenTRCTag = 'gTRC', + cmLuminanceTag = 'lumi', + cmMeasurementTag = 'meas', + cmMediaBlackPointTag = 'bkpt', + cmMediaWhitePointTag = 'wtpt', + cmNamedColorTag = 'ncol', + cmNamedColor2Tag = 'ncl2', + cmPreview0Tag = 'pre0', + cmPreview1Tag = 'pre1', + cmPreview2Tag = 'pre2', + cmProfileDescriptionTag = 'desc', + cmProfileSequenceDescTag = 'pseq', + cmPS2CRD0Tag = 'psd0', + cmPS2CRD1Tag = 'psd1', + cmPS2CRD2Tag = 'psd2', + cmPS2CRD3Tag = 'psd3', + cmPS2CSATag = 'ps2s', + cmPS2RenderingIntentTag = 'ps2i', + cmRedColorantTag = 'rXYZ', + cmRedTRCTag = 'rTRC', + cmScreeningDescTag = 'scrd', + cmScreeningTag = 'scrn', + cmTechnologyTag = 'tech', + cmUcrBgTag = 'bfd ', + cmViewingConditionsDescTag = 'vued', + cmViewingConditionsTag = 'view' +}; + + +enum { + cmPS2CRDVMSizeTag = 'psvm', + cmVideoCardGammaTag = 'vcgt', + cmMakeAndModelTag = 'mmod', + cmProfileDescriptionMLTag = 'dscm', + cmNativeDisplayInfoTag = 'ndin' +}; + + +enum { + cmSigCrdInfoType = 'crdi', + cmSigCurveType = 'curv', + cmSigDataType = 'data', + cmSigDateTimeType = 'dtim', + cmSigLut16Type = 'mft2', + cmSigLut8Type = 'mft1', + cmSigMeasurementType = 'meas', + cmSigMultiFunctA2BType = 'mAB ', + cmSigMultiFunctB2AType = 'mBA ', + cmSigNamedColorType = 'ncol', + cmSigNamedColor2Type = 'ncl2', + cmSigParametricCurveType = 'para', + cmSigProfileDescriptionType = 'desc', + cmSigProfileSequenceDescType = 'pseq', + cmSigScreeningType = 'scrn', + cmSigS15Fixed16Type = 'sf32', + cmSigSignatureType = 'sig ', + cmSigTextType = 'text', + cmSigU16Fixed16Type = 'uf32', + cmSigU1Fixed15Type = 'uf16', + cmSigUInt8Type = 'ui08', + cmSigUInt16Type = 'ui16', + cmSigUInt32Type = 'ui32', + cmSigUInt64Type = 'ui64', + cmSigUcrBgType = 'bfd ', + cmSigUnicodeTextType = 'utxt', + cmSigViewingConditionsType = 'view', + cmSigXYZType = 'XYZ ' +}; + + +enum { + cmSigPS2CRDVMSizeType = 'psvm', + cmSigVideoCardGammaType = 'vcgt', + cmSigMakeAndModelType = 'mmod', + cmSigNativeDisplayInfoType = 'ndin', + cmSigMultiLocalizedUniCodeType = 'mluc' +}; + + + +enum { + cmTechnologyDigitalCamera = 'dcam', + cmTechnologyFilmScanner = 'fscn', + cmTechnologyReflectiveScanner = 'rscn', + cmTechnologyInkJetPrinter = 'ijet', + cmTechnologyThermalWaxPrinter = 'twax', + cmTechnologyElectrophotographicPrinter = 'epho', + cmTechnologyElectrostaticPrinter = 'esta', + cmTechnologyDyeSublimationPrinter = 'dsub', + cmTechnologyPhotographicPaperPrinter = 'rpho', + cmTechnologyFilmWriter = 'fprn', + cmTechnologyVideoMonitor = 'vidm', + cmTechnologyVideoCamera = 'vidc', + cmTechnologyProjectionTelevision = 'pjtv', + cmTechnologyCRTDisplay = 'CRT ', + cmTechnologyPMDisplay = 'PMD ', + cmTechnologyAMDisplay = 'AMD ', + cmTechnologyPhotoCD = 'KPCD', + cmTechnologyPhotoImageSetter = 'imgs', + cmTechnologyGravure = 'grav', + cmTechnologyOffsetLithography = 'offs', + cmTechnologySilkscreen = 'silk', + cmTechnologyFlexography = 'flex' +}; + + + + +enum { + cmFlare0 = 0x00000000, + cmFlare100 = 0x00000001 +}; + + +enum { + cmGeometryUnknown = 0x00000000, + cmGeometry045or450 = 0x00000001, + cmGeometry0dord0 = 0x00000002 +}; + + +enum { + cmStdobsUnknown = 0x00000000, + cmStdobs1931TwoDegrees = 0x00000001, + cmStdobs1964TenDegrees = 0x00000002 +}; + + +enum { + cmIlluminantUnknown = 0x00000000, + cmIlluminantD50 = 0x00000001, + cmIlluminantD65 = 0x00000002, + cmIlluminantD93 = 0x00000003, + cmIlluminantF2 = 0x00000004, + cmIlluminantD55 = 0x00000005, + cmIlluminantA = 0x00000006, + cmIlluminantEquiPower = 0x00000007, + cmIlluminantF8 = 0x00000008 +}; + + +enum { + cmSpotFunctionUnknown = 0, + cmSpotFunctionDefault = 1, + cmSpotFunctionRound = 2, + cmSpotFunctionDiamond = 3, + cmSpotFunctionEllipse = 4, + cmSpotFunctionLine = 5, + cmSpotFunctionSquare = 6, + cmSpotFunctionCross = 7 +}; + + +enum { + cmXYZData = 'XYZ ', + cmLabData = 'Lab ', + cmLuvData = 'Luv ', + cmYCbCrData = 'YCbr', + cmYxyData = 'Yxy ', + cmRGBData = 'RGB ', + cmSRGBData = 'sRGB', + cmGrayData = 'GRAY', + cmHSVData = 'HSV ', + cmHLSData = 'HLS ', + cmCMYKData = 'CMYK', + cmCMYData = 'CMY ', + cmMCH5Data = 'MCH5', + cmMCH6Data = 'MCH6', + cmMCH7Data = 'MCH7', + cmMCH8Data = 'MCH8', + cm3CLRData = '3CLR', + cm4CLRData = '4CLR', + cm5CLRData = '5CLR', + cm6CLRData = '6CLR', + cm7CLRData = '7CLR', + cm8CLRData = '8CLR', + cm9CLRData = '9CLR', + cm10CLRData = 'ACLR', + cm11CLRData = 'BCLR', + cm12CLRData = 'CCLR', + cm13CLRData = 'DCLR', + cm14CLRData = 'ECLR', + cm15CLRData = 'FCLR', + cmNamedData = 'NAME' +}; + + +enum { + cmInputClass = 'scnr', + cmDisplayClass = 'mntr', + cmOutputClass = 'prtr', + cmLinkClass = 'link', + cmAbstractClass = 'abst', + cmColorSpaceClass = 'spac', + cmNamedColorClass = 'nmcl' +}; + + +enum { + cmMacintosh = 'APPL', + cmMicrosoft = 'MSFT', + cmSolaris = 'SUNW', + cmSiliconGraphics = 'SGI ', + cmTaligent = 'TGNT' +}; + + +enum { + cmParametricType0 = 0, + cmParametricType1 = 1, + cmParametricType2 = 2, + cmParametricType3 = 3, + cmParametricType4 = 4 +}; + + + +enum { + cmCS1ChromTag = 'chrm', + cmCS1TRCTag = 'trc ', + cmCS1NameTag = 'name', + cmCS1CustTag = 'cust' +}; + + +typedef struct CMDateTime { + UInt16 year; + UInt16 month; + UInt16 dayOfTheMonth; + UInt16 hours; + UInt16 minutes; + UInt16 seconds; +} CMDateTime __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMFixedXYColor { + Fixed x; + Fixed y; +} CMFixedXYColor __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMFixedXYZColor { + Fixed X; + Fixed Y; + Fixed Z; +} CMFixedXYZColor __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef UInt16 CMXYZComponent; + +typedef struct CMXYZColor { + CMXYZComponent X; + CMXYZComponent Y; + CMXYZComponent Z; +} CMXYZColor; + + + + +typedef unsigned char CMProfileMD5[16] __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +typedef CMProfileMD5 * CMProfileMD5Ptr __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +typedef struct CM2Header { + UInt32 size; + OSType CMMType; + UInt32 profileVersion; + OSType profileClass; + OSType dataColorSpace; + OSType profileConnectionSpace; + CMDateTime dateTime; + OSType CS2profileSignature; + OSType platform; + UInt32 flags; + OSType deviceManufacturer; + UInt32 deviceModel; + UInt32 deviceAttributes[2]; + UInt32 renderingIntent; + CMFixedXYZColor white; + OSType creator; + char reserved[44]; +} CM2Header __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CM4Header { + UInt32 size; + OSType CMMType; + UInt32 profileVersion; + OSType profileClass; + OSType dataColorSpace; + OSType profileConnectionSpace; + CMDateTime dateTime; + OSType CS2profileSignature; + OSType platform; + UInt32 flags; + OSType deviceManufacturer; + UInt32 deviceModel; + UInt32 deviceAttributes[2]; + UInt32 renderingIntent; + CMFixedXYZColor white; + OSType creator; + CMProfileMD5 digest; + char reserved[28]; +} CM4Header __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMTagRecord { + OSType tag; + UInt32 elementOffset; + UInt32 elementSize; +} CMTagRecord __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMTagElemTable { + UInt32 count; + CMTagRecord tagList[1]; +} CMTagElemTable __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CM2Profile { + CM2Header header; + CMTagElemTable tagTable; + char elemData[1]; +} CM2Profile, *CM2ProfilePtr, **CM2ProfileHandle __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + +typedef struct CMAdaptationMatrixType { + OSType typeDescriptor; + UInt32 reserved; + Fixed adaptationMatrix[9]; +} CMAdaptationMatrixType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMCurveType { + OSType typeDescriptor; + UInt32 reserved; + UInt32 countValue; + UInt16 data[1]; +} CMCurveType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMDataType { + OSType typeDescriptor; + UInt32 reserved; + UInt32 dataFlag; + char data[1]; +} CMDataType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMDateTimeType { + OSType typeDescriptor; + UInt32 reserved; + CMDateTime dateTime; +} CMDateTimeType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMLut16Type { + OSType typeDescriptor; + UInt32 reserved; + UInt8 inputChannels; + UInt8 outputChannels; + UInt8 gridPoints; + UInt8 reserved2; + Fixed matrix[3][3]; + UInt16 inputTableEntries; + UInt16 outputTableEntries; + UInt16 inputTable[1]; +} CMLut16Type __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMLut8Type { + OSType typeDescriptor; + UInt32 reserved; + UInt8 inputChannels; + UInt8 outputChannels; + UInt8 gridPoints; + UInt8 reserved2; + Fixed matrix[3][3]; + UInt8 inputTable[1]; +} CMLut8Type __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMMultiFunctLutType { + OSType typeDescriptor; + UInt32 reserved; + UInt8 inputChannels; + UInt8 outputChannels; + UInt16 reserved2; + UInt32 offsetBcurves; + UInt32 offsetMatrix; + UInt32 offsetMcurves; + UInt32 offsetCLUT; + UInt32 offsetAcurves; + UInt8 data[1]; +} CMMultiFunctLutType, CMMultiFunctLutA2BType, CMMultiFunctLutB2AType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMMultiFunctCLUTType { + UInt8 gridPoints[16]; + UInt8 entrySize; + UInt8 reserved[3]; + UInt8 data[2]; +} CMMultiFunctCLUTType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMMeasurementType { + OSType typeDescriptor; + UInt32 reserved; + UInt32 standardObserver; + CMFixedXYZColor backingXYZ; + UInt32 geometry; + UInt32 flare; + UInt32 illuminant; +} CMMeasurementType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMNamedColorType { + OSType typeDescriptor; + UInt32 reserved; + UInt32 vendorFlag; + UInt32 count; + UInt8 prefixName[1]; +} CMNamedColorType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMNamedColor2EntryType { + UInt8 rootName[32]; + UInt16 PCSColorCoords[3]; + UInt16 DeviceColorCoords[1]; +} CMNamedColor2EntryType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMNamedColor2Type { + OSType typeDescriptor; + UInt32 reserved; + UInt32 vendorFlag; + UInt32 count; + UInt32 deviceChannelCount; + UInt8 prefixName[32]; + UInt8 suffixName[32]; + char data[1]; +} CMNamedColor2Type __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMNativeDisplayInfo { + UInt32 dataSize; + CMFixedXYColor redPhosphor; + CMFixedXYColor greenPhosphor; + CMFixedXYColor bluePhosphor; + CMFixedXYColor whitePoint; + Fixed redGammaValue; + Fixed greenGammaValue; + Fixed blueGammaValue; + + + + UInt16 gammaChannels; + UInt16 gammaEntryCount; + UInt16 gammaEntrySize; + char gammaData[1]; +} CMNativeDisplayInfo __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMNativeDisplayInfoType { + OSType typeDescriptor; + UInt32 reserved; + CMNativeDisplayInfo nativeDisplayInfo; +} CMNativeDisplayInfoType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMParametricCurveType { + OSType typeDescriptor; + UInt32 reserved; + UInt16 functionType; + UInt16 reserved2; + Fixed value[1]; +} CMParametricCurveType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMTextDescriptionType { + OSType typeDescriptor; + UInt32 reserved; + UInt32 ASCIICount; + UInt8 ASCIIName[2]; +} CMTextDescriptionType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMTextType { + OSType typeDescriptor; + UInt32 reserved; + UInt8 text[1]; +} CMTextType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMUnicodeTextType { + OSType typeDescriptor; + UInt32 reserved; + UniChar text[1]; +} CMUnicodeTextType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMScreeningChannelRec { + Fixed frequency; + Fixed angle; + UInt32 spotFunction; +} CMScreeningChannelRec __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMScreeningType { + OSType typeDescriptor; + UInt32 reserved; + UInt32 screeningFlag; + UInt32 channelCount; + CMScreeningChannelRec channelInfo[1]; +} CMScreeningType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMSignatureType { + OSType typeDescriptor; + UInt32 reserved; + OSType signature; +} CMSignatureType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMS15Fixed16ArrayType { + OSType typeDescriptor; + UInt32 reserved; + Fixed value[1]; +} CMS15Fixed16ArrayType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMU16Fixed16ArrayType { + OSType typeDescriptor; + UInt32 reserved; + UInt32 value[1]; +} CMU16Fixed16ArrayType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMUInt8ArrayType { + OSType typeDescriptor; + UInt32 reserved; + UInt8 value[1]; +} CMUInt8ArrayType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMUInt16ArrayType { + OSType typeDescriptor; + UInt32 reserved; + UInt16 value[1]; +} CMUInt16ArrayType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMUInt32ArrayType { + OSType typeDescriptor; + UInt32 reserved; + UInt32 value[1]; +} CMUInt32ArrayType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMUInt64ArrayType { + OSType typeDescriptor; + UInt32 reserved; + UInt32 value[1]; +} CMUInt64ArrayType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMViewingConditionsType { + OSType typeDescriptor; + UInt32 reserved; + CMFixedXYZColor illuminant; + CMFixedXYZColor surround; + UInt32 stdIlluminant; +} CMViewingConditionsType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMXYZType { + OSType typeDescriptor; + UInt32 reserved; + CMFixedXYZColor XYZ[1]; +} CMXYZType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMProfileSequenceDescType { + OSType typeDescriptor; + UInt32 reserved; + UInt32 count; + char data[1]; +} CMProfileSequenceDescType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMUcrBgType { + OSType typeDescriptor; + UInt32 reserved; + UInt32 ucrCount; + UInt16 ucrValues[1]; +} CMUcrBgType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + + + +typedef struct CMIntentCRDVMSize { + UInt32 renderingIntent; + UInt32 VMSize; +} CMIntentCRDVMSize __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMPS2CRDVMSizeType { + OSType typeDescriptor; + UInt32 reserved; + UInt32 count; + CMIntentCRDVMSize intentCRD[1]; +} CMPS2CRDVMSizeType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + +enum { + cmVideoCardGammaTableType = 0, + cmVideoCardGammaFormulaType = 1 +}; + +typedef struct CMVideoCardGammaTable { + UInt16 channels; + UInt16 entryCount; + UInt16 entrySize; + char data[1]; +} CMVideoCardGammaTable __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMVideoCardGammaFormula { + Fixed redGamma; + Fixed redMin; + Fixed redMax; + Fixed greenGamma; + Fixed greenMin; + Fixed greenMax; + Fixed blueGamma; + Fixed blueMin; + Fixed blueMax; +} CMVideoCardGammaFormula __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMVideoCardGamma { + UInt32 tagType; + union { + CMVideoCardGammaTable table; + CMVideoCardGammaFormula formula; + } u; +} CMVideoCardGamma __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMVideoCardGammaType { + OSType typeDescriptor; + UInt32 reserved; + CMVideoCardGamma gamma; +} CMVideoCardGammaType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMMakeAndModel { + OSType manufacturer; + UInt32 model; + UInt32 serialNumber; + UInt32 manufactureDate; + UInt32 reserved1; + UInt32 reserved2; + UInt32 reserved3; + UInt32 reserved4; +} CMMakeAndModel __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMMakeAndModelType { + OSType typeDescriptor; + UInt32 reserved; + CMMakeAndModel makeAndModel; +} CMMakeAndModelType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMMultiLocalizedUniCodeEntryRec { + char languageCode[2]; + char regionCode[2]; + UInt32 textLength; + UInt32 textOffset; +} CMMultiLocalizedUniCodeEntryRec __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMMultiLocalizedUniCodeType { + OSType typeDescriptor; + UInt32 reserved; + UInt32 entryCount; + UInt32 entrySize; + + +} CMMultiLocalizedUniCodeType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + + +typedef OSStatus CMError __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + +typedef struct OpaqueCMProfileRef* CMProfileRef __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +typedef struct OpaqueCMWorldRef* CMWorldRef __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + + +typedef UInt32 CMDisplayIDType __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +typedef UInt32 CMChromaticAdaptation __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +enum { + cmUseDefaultChromaticAdaptation = 0, + cmLinearChromaticAdaptation = 1, + cmVonKriesChromaticAdaptation = 2, + cmBradfordChromaticAdaptation = 3 +}; + + + + +typedef OSErr ( * CMFlattenProcPtr)(SInt32 command, long *size, void *data, void *refCon); + +typedef CMFlattenProcPtr CMFlattenUPP; +typedef Boolean ( * CMBitmapCallBackProcPtr)(SInt32 progress, void *refCon) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef CMBitmapCallBackProcPtr CMBitmapCallBackUPP __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + + +typedef Boolean ( * CMConcatCallBackProcPtr)(SInt32 progress, void *refCon) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef CMConcatCallBackProcPtr CMConcatCallBackUPP __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +enum { + kDefaultCMMSignature = 'appl' +}; +enum { + cmPS7bit = 1, + cmPS8bit = 2 +}; +enum { + cmOpenReadSpool = 1, + cmOpenWriteSpool = 2, + cmReadSpool = 3, + cmWriteSpool = 4, + cmCloseSpool = 5 +}; + + +enum { + cmOpenReadAccess = 1, + cmOpenWriteAccess = 2, + cmReadAccess = 3, + cmWriteAccess = 4, + cmCloseAccess = 5, + cmCreateNewAccess = 6, + cmAbortWriteAccess = 7, + cmBeginAccess = 8, + cmEndAccess = 9 +}; + + +enum { + cmInputUse = 'inpt', + cmOutputUse = 'outp', + cmDisplayUse = 'dply', + cmProofUse = 'pruf' +}; + + + +union CMAppleProfileHeader { + + + + CM2Header cm2; + CM4Header cm4; +}; +typedef union CMAppleProfileHeader CMAppleProfileHeader __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + +typedef struct CMConcatProfileSet { + UInt16 keyIndex; + UInt16 count; + CMProfileRef profileSet[1]; +} CMConcatProfileSet __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + +typedef struct NCMConcatProfileSpec { + UInt32 renderingIntent; + UInt32 transformTag; + CMProfileRef profile; +} NCMConcatProfileSpec __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct NCMConcatProfileSet { + OSType cmm; + UInt32 flags; + UInt32 flagsMask; + UInt32 profileCount; + NCMConcatProfileSpec profileSpecs[1]; +} NCMConcatProfileSet __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +enum { + kNoTransform = 0, + kUseAtoB = 1, + kUseBtoA = 2, + kUseBtoB = 3, + + kDeviceToPCS = kUseAtoB, + kPCSToDevice = kUseBtoA, + kPCSToPCS = kUseBtoB, + kUseProfileIntent = (int)0xFFFFFFFF +}; + + + +typedef struct CMRGBColor { + UInt16 red; + UInt16 green; + UInt16 blue; +} CMRGBColor __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMCMYKColor { + UInt16 cyan; + UInt16 magenta; + UInt16 yellow; + UInt16 black; +} CMCMYKColor __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMCMYColor { + UInt16 cyan; + UInt16 magenta; + UInt16 yellow; +} CMCMYColor __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMHLSColor { + UInt16 hue; + UInt16 lightness; + UInt16 saturation; +} CMHLSColor __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMHSVColor { + UInt16 hue; + UInt16 saturation; + UInt16 value; +} CMHSVColor __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMLabColor { + UInt16 L; + UInt16 a; + UInt16 b; +} CMLabColor __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMLuvColor { + UInt16 L; + UInt16 u; + UInt16 v; +} CMLuvColor __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMYxyColor { + UInt16 capY; + UInt16 x; + UInt16 y; +} CMYxyColor __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMGrayColor { + UInt16 gray; +} CMGrayColor __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMMultichannel5Color { + UInt8 components[5]; +} CMMultichannel5Color __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMMultichannel6Color { + UInt8 components[6]; +} CMMultichannel6Color __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMMultichannel7Color { + UInt8 components[7]; +} CMMultichannel7Color __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMMultichannel8Color { + UInt8 components[8]; +} CMMultichannel8Color __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMNamedColor { + UInt32 namedColorIndex; +} CMNamedColor __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef union CMColor { + CMRGBColor rgb; + CMHSVColor hsv; + CMHLSColor hls; + CMXYZColor XYZ; + CMLabColor Lab; + CMLuvColor Luv; + CMYxyColor Yxy; + CMCMYKColor cmyk; + CMCMYColor cmy; + CMGrayColor gray; + CMMultichannel5Color mc5; + CMMultichannel6Color mc6; + CMMultichannel7Color mc7; + CMMultichannel8Color mc8; + CMNamedColor namedColor; +} CMColor __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +typedef struct CMMInfo { + size_t dataSize; + OSType CMMType; + OSType CMMMfr; + UInt32 CMMVersion; + unsigned char ASCIIName[32]; + unsigned char ASCIIDesc[256]; + UniCharCount UniCodeNameCount; + UniChar UniCodeName[32]; + UniCharCount UniCodeDescCount; + UniChar UniCodeDesc[256]; +} CMMInfo __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +enum { + cmColorSpaceSpaceMask = 0x0000003F, + cmColorSpacePremulAlphaMask = 0x00000040, + cmColorSpaceAlphaMask = 0x00000080, + cmColorSpaceSpaceAndAlphaMask = 0x000000FF, + cmColorSpacePackingMask = 0x0000FF00, + cmColorSpaceEncodingMask = 0x000F0000, + cmColorSpaceReservedMask = (int)0xFFF00000 +}; + + +enum { + cmNoColorPacking = 0x0000, + cmWord5ColorPacking = 0x0500, + cmWord565ColorPacking = 0x0600, + cmLong8ColorPacking = 0x0800, + cmLong10ColorPacking = 0x0A00, + cmAlphaFirstPacking = 0x1000, + cmOneBitDirectPacking = 0x0B00, + cmAlphaLastPacking = 0x0000, + cm8_8ColorPacking = 0x2800, + cm16_8ColorPacking = 0x2000, + cm24_8ColorPacking = 0x2100, + cm32_8ColorPacking = cmLong8ColorPacking, + cm40_8ColorPacking = 0x2200, + cm48_8ColorPacking = 0x2300, + cm56_8ColorPacking = 0x2400, + cm64_8ColorPacking = 0x2500, + cm32_16ColorPacking = 0x2600, + cm48_16ColorPacking = 0x2900, + cm64_16ColorPacking = 0x2A00, + cm32_32ColorPacking = 0x2700, + cmLittleEndianPacking = 0x4000, + cmReverseChannelPacking = 0x8000 +}; + + +enum { + cmSRGB16ChannelEncoding = 0x00010000 +}; + + +enum { + cmNoSpace = 0x0000, + cmRGBSpace = 0x0001, + cmCMYKSpace = 0x0002, + cmHSVSpace = 0x0003, + cmHLSSpace = 0x0004, + cmYXYSpace = 0x0005, + cmXYZSpace = 0x0006, + cmLUVSpace = 0x0007, + cmLABSpace = 0x0008, + cmReservedSpace1 = 0x0009, + cmGraySpace = 0x000A, + cmReservedSpace2 = 0x000B, + cmGamutResultSpace = 0x000C, + cmNamedIndexedSpace = 0x0010, + cmMCFiveSpace = 0x0011, + cmMCSixSpace = 0x0012, + cmMCSevenSpace = 0x0013, + cmMCEightSpace = 0x0014, + cmAlphaPmulSpace = 0x0040, + cmAlphaSpace = 0x0080, + cmRGBASpace = cmRGBSpace + cmAlphaSpace, + cmGrayASpace = cmGraySpace + cmAlphaSpace, + cmRGBAPmulSpace = cmRGBASpace + cmAlphaPmulSpace, + cmGrayAPmulSpace = cmGrayASpace + cmAlphaPmulSpace +}; + + + + +enum { + cmGray8Space = cmGraySpace + cm8_8ColorPacking, + cmGray16Space = cmGraySpace, + cmGray16LSpace = cmGraySpace + cmLittleEndianPacking, + cmGrayA16Space = cmGrayASpace + cm16_8ColorPacking, + cmGrayA32Space = cmGrayASpace, + cmGrayA32LSpace = cmGrayASpace + cmLittleEndianPacking, + cmGrayA16PmulSpace = cmGrayAPmulSpace + cm16_8ColorPacking, + cmGrayA32PmulSpace = cmGrayAPmulSpace, + cmGrayA32LPmulSpace = cmGrayAPmulSpace + cmLittleEndianPacking, + cmRGB16Space = cmRGBSpace + cmWord5ColorPacking, + cmRGB16LSpace = cmRGBSpace + cmWord5ColorPacking + cmLittleEndianPacking, + cmRGB565Space = cmRGBSpace + cmWord565ColorPacking, + cmRGB565LSpace = cmRGBSpace + cmWord565ColorPacking + cmLittleEndianPacking, + cmRGB24Space = cmRGBSpace + cm24_8ColorPacking, + cmRGB32Space = cmRGBSpace + cm32_8ColorPacking, + cmRGB48Space = cmRGBSpace + cm48_16ColorPacking, + cmRGB48LSpace = cmRGBSpace + cm48_16ColorPacking + cmLittleEndianPacking, + cmARGB32Space = cmRGBASpace + cm32_8ColorPacking + cmAlphaFirstPacking, + cmARGB64Space = cmRGBASpace + cm64_16ColorPacking + cmAlphaFirstPacking, + cmARGB64LSpace = cmRGBASpace + cm64_16ColorPacking + cmAlphaFirstPacking + cmLittleEndianPacking, + cmRGBA32Space = cmRGBASpace + cm32_8ColorPacking + cmAlphaLastPacking, + cmRGBA64Space = cmRGBASpace + cm64_16ColorPacking + cmAlphaLastPacking, + cmRGBA64LSpace = cmRGBASpace + cm64_16ColorPacking + cmAlphaLastPacking + cmLittleEndianPacking, + cmARGB32PmulSpace = cmRGBAPmulSpace + cm32_8ColorPacking + cmAlphaFirstPacking, + cmARGB64PmulSpace = cmRGBAPmulSpace + cm64_16ColorPacking + cmAlphaFirstPacking, + cmARGB64LPmulSpace = cmRGBAPmulSpace + cm64_16ColorPacking + cmAlphaFirstPacking + cmLittleEndianPacking, + cmRGBA32PmulSpace = cmRGBAPmulSpace + cm32_8ColorPacking + cmAlphaLastPacking, + cmRGBA64PmulSpace = cmRGBAPmulSpace + cm64_16ColorPacking + cmAlphaLastPacking, + cmRGBA64LPmulSpace = cmRGBAPmulSpace + cm64_16ColorPacking + cmAlphaLastPacking + cmLittleEndianPacking, + cmCMYK32Space = cmCMYKSpace + cm32_8ColorPacking, + cmCMYK64Space = cmCMYKSpace + cm64_16ColorPacking, + cmCMYK64LSpace = cmCMYKSpace + cm64_16ColorPacking + cmLittleEndianPacking, + cmHSV32Space = cmHSVSpace + cmLong10ColorPacking, + cmHLS32Space = cmHLSSpace + cmLong10ColorPacking, + cmYXY32Space = cmYXYSpace + cmLong10ColorPacking, + cmXYZ24Space = cmXYZSpace + cm24_8ColorPacking, + cmXYZ32Space = cmXYZSpace + cmLong10ColorPacking, + cmXYZ48Space = cmXYZSpace + cm48_16ColorPacking, + cmXYZ48LSpace = cmXYZSpace + cm48_16ColorPacking + cmLittleEndianPacking, + cmLUV32Space = cmLUVSpace + cmLong10ColorPacking, + cmLAB24Space = cmLABSpace + cm24_8ColorPacking, + cmLAB32Space = cmLABSpace + cmLong10ColorPacking, + cmLAB48Space = cmLABSpace + cm48_16ColorPacking, + cmLAB48LSpace = cmLABSpace + cm48_16ColorPacking + cmLittleEndianPacking, + cmGamutResult1Space = cmOneBitDirectPacking + cmGamutResultSpace, + cmNamedIndexed32Space = cm32_32ColorPacking + cmNamedIndexedSpace, + cmNamedIndexed32LSpace = cm32_32ColorPacking + cmNamedIndexedSpace + cmLittleEndianPacking, + cmMCFive8Space = cm40_8ColorPacking + cmMCFiveSpace, + cmMCSix8Space = cm48_8ColorPacking + cmMCSixSpace, + cmMCSeven8Space = cm56_8ColorPacking + cmMCSevenSpace, + cmMCEight8Space = cm64_8ColorPacking + cmMCEightSpace +}; + + +typedef UInt32 CMBitmapColorSpace __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMBitmap { + char * image; + size_t width; + size_t height; + size_t rowBytes; + size_t pixelSize; + CMBitmapColorSpace space; + UInt32 user1; + UInt32 user2; +} CMBitmap __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + + +enum { + + + + + + + CS_MAX_PATH = 1024 + +}; + + +enum { + cmNoProfileBase = 0, + + + + + + + cmPathBasedProfile = 5, + cmBufferBasedProfile = 6 +}; +typedef struct CMHandleLocation { + Handle h; +} CMHandleLocation __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +typedef struct CMPathLocation { + + + + char path[CS_MAX_PATH]; + +} CMPathLocation __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMBufferLocation { + void * buffer; + UInt32 size; +} CMBufferLocation __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef union CMProfLoc { + + + + CMHandleLocation handleLoc; + + + + + CMPathLocation pathLoc; + CMBufferLocation bufferLoc; +} CMProfLoc __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct CMProfileLocation { + short locType; + CMProfLoc u; +} CMProfileLocation __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +enum { + cmOriginalProfileLocationSize = 72, + cmCurrentProfileLocationSize = sizeof(CMProfileLocation) +}; + + + + +enum { + cmProfileIterateDataVersion1 = 0x00010000, + cmProfileIterateDataVersion2 = 0x00020000, + cmProfileIterateDataVersion3 = 0x00030000, + cmProfileIterateDataVersion4 = 0x00040000 +}; + +typedef struct CMProfileIterateData { + UInt32 dataVersion; + CM2Header header; + ScriptCode code; + Str255 name; + CMProfileLocation location; + UniCharCount uniCodeNameCount; + UniChar * uniCodeName; + unsigned char * asciiName; + CMMakeAndModel * makeAndModel; + CMProfileMD5 * digest; +} CMProfileIterateData __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + + +typedef OSErr ( * CMProfileIterateProcPtr)(CMProfileIterateData *iterateData, void *refCon) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef CMProfileIterateProcPtr CMProfileIterateUPP __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + + +typedef OSErr ( * CMMIterateProcPtr)(CMMInfo *iterateData, void *refCon) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef CMMIterateProcPtr CMMIterateUPP __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + +typedef void ( * CMLabToLabProcPtr)(float *L, float *a, float *b, void *refcon) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +enum CMFloatBitmapFlags { + kCMFloatBitmapFlagsNone = 0, + kCMFloatBitmapFlagsAlpha = 1, + kCMFloatBitmapFlagsAlphaPremul = 2, + kCMFloatBitmapFlagsRangeClipped = 4 +}; +typedef enum CMFloatBitmapFlags CMFloatBitmapFlags; +typedef struct CMFloatBitmap { + unsigned long version; + float * buffers[16]; + size_t height; + size_t width; + ptrdiff_t rowStride; + ptrdiff_t colStride; + OSType space; + CMFloatBitmapFlags flags; +} CMFloatBitmap __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +enum { + cmDeviceInfoVersion1 = 0x00010000, + cmDeviceProfileInfoVersion1 = 0x00010000, + cmDeviceProfileInfoVersion2 = 0x00020000 +}; + +enum { + cmCurrentDeviceInfoVersion = cmDeviceInfoVersion1, + cmCurrentProfileInfoVersion = cmDeviceProfileInfoVersion1 +}; + + + + + +enum { + cmDefaultDeviceID = 0, + cmDefaultProfileID = 0 +}; + + + + + +enum { + cmDeviceStateDefault = 0x00000000, + cmDeviceStateOffline = 0x00000001, + cmDeviceStateBusy = 0x00000002, + cmDeviceStateForceNotify = (int)0x80000000, + cmDeviceStateDeviceRsvdBits = 0x00FF0000, + cmDeviceStateAppleRsvdBits = (int)0xFF00FFFF +}; +enum { + cmIterateFactoryDeviceProfiles = 0x00000001, + cmIterateCustomDeviceProfiles = 0x00000002, + cmIterateCurrentDeviceProfiles = 0x00000003, + cmIterateAllDeviceProfiles = 0x00000004, + cmIterateDeviceProfilesMask = 0x0000000F +}; + + + + +enum { + cmDeviceDBNotFoundErr = -4227, + cmDeviceAlreadyRegistered = -4228, + cmDeviceNotRegistered = -4229, + cmDeviceProfilesNotFound = -4230, + cmInternalCFErr = -4231, + cmPrefsSynchError = -4232 +}; +typedef UInt32 CMDeviceState __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + + + +typedef UInt32 CMDeviceID __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + + +typedef UInt32 CMDeviceProfileID __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + +enum { + cmScannerDeviceClass = 'scnr', + cmCameraDeviceClass = 'cmra', + cmDisplayDeviceClass = 'mntr', + cmPrinterDeviceClass = 'prtr', + cmProofDeviceClass = 'pruf' +}; + +typedef OSType CMDeviceClass; + + + + + +typedef struct CMDeviceScope { + CFStringRef deviceUser; + CFStringRef deviceHost; +} CMDeviceScope, CMDeviceProfileScope __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + + + +typedef struct CMDeviceInfo { + UInt32 dataVersion; + CMDeviceClass deviceClass; + CMDeviceID deviceID; + CMDeviceScope deviceScope; + CMDeviceState deviceState; + CMDeviceProfileID defaultProfileID; + CFDictionaryRef * deviceName; + + UInt32 profileCount; + UInt32 reserved; +} CMDeviceInfo, *CMDeviceInfoPtr __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + + + +typedef struct CMDeviceProfileInfo { + UInt32 dataVersion; + CMDeviceProfileID profileID; + CMProfileLocation profileLoc; + CFDictionaryRef profileName; + UInt32 reserved; +} CMDeviceProfileInfo __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + +typedef struct NCMDeviceProfileInfo { + UInt32 dataVersion; + CMDeviceProfileID profileID; + CMProfileLocation profileLoc; + CFDictionaryRef profileName; + CMDeviceProfileScope profileScope; + UInt32 reserved; +} NCMDeviceProfileInfo __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + + + + + +typedef struct CMDeviceProfileArray { + UInt32 profileCount; + CMDeviceProfileInfo profiles[1]; +} CMDeviceProfileArray, *CMDeviceProfileArrayPtr __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + + + + + +typedef OSErr ( * CMIterateDeviceInfoProcPtr)(const CMDeviceInfo *deviceInfo, void *refCon) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); +typedef OSErr ( * CMIterateDeviceProfileProcPtr)(const CMDeviceInfo *deviceInfo, const NCMDeviceProfileInfo *profileInfo, void *refCon) __attribute__((availability(macosx,introduced=10.0,deprecated=10.6))); + + +typedef struct OpaqueGrafPtr* GrafPtr; +typedef GrafPtr CGrafPtr; +typedef CGrafPtr GWorldPtr; +typedef short QDErr; +typedef unsigned long GWorldFlags; + + +enum { + srcCopy = 0 +}; + + + +struct BitMap { + Ptr baseAddr; + short rowBytes; + Rect bounds; +}; +typedef struct BitMap BitMap; +typedef BitMap * BitMapPtr; +typedef BitMapPtr * BitMapHandle; +struct RGBColor { + unsigned short red; + unsigned short green; + unsigned short blue; +}; +typedef struct RGBColor RGBColor; +struct ColorSpec { + short value; + RGBColor rgb; +}; +typedef struct ColorSpec ColorSpec; +typedef ColorSpec * ColorSpecPtr; +typedef ColorSpec CSpecArray[1]; +struct ColorTable { + SInt32 ctSeed; + short ctFlags; + short ctSize; + CSpecArray ctTable; +}; +typedef struct ColorTable ColorTable; +typedef ColorTable * CTabPtr; +typedef CTabPtr * CTabHandle; +struct PixMap { + Ptr baseAddr; + short rowBytes; + Rect bounds; + short pmVersion; + short packType; + SInt32 packSize; + Fixed hRes; + Fixed vRes; + short pixelType; + short pixelSize; + short cmpCount; + short cmpSize; + OSType pixelFormat; + CTabHandle pmTable; + void * pmExt; +}; +typedef struct PixMap PixMap; +typedef PixMap * PixMapPtr; +typedef PixMapPtr * PixMapHandle; + + + + +enum { + + k1MonochromePixelFormat = 0x00000001, + k2IndexedPixelFormat = 0x00000002, + k4IndexedPixelFormat = 0x00000004, + k8IndexedPixelFormat = 0x00000008, + k16BE555PixelFormat = 0x00000010, + k24RGBPixelFormat = 0x00000018, + k32ARGBPixelFormat = 0x00000020, + + k1IndexedGrayPixelFormat = 0x00000021, + k2IndexedGrayPixelFormat = 0x00000022, + k4IndexedGrayPixelFormat = 0x00000024, + k8IndexedGrayPixelFormat = 0x00000028, + k16LE555PixelFormat = 'L555', + k16LE5551PixelFormat = '5551', + k16BE565PixelFormat = 'B565', + k16LE565PixelFormat = 'L565', + k24BGRPixelFormat = '24BG', + k32BGRAPixelFormat = 'BGRA', + k32ABGRPixelFormat = 'ABGR', + k32RGBAPixelFormat = 'RGBA', + kYUVSPixelFormat = 'yuvs', + kYUVUPixelFormat = 'yuvu', + kYVU9PixelFormat = 'YVU9', + kYUV411PixelFormat = 'Y411', + kYVYU422PixelFormat = 'YVYU', + kUYVY422PixelFormat = 'UYVY', + kYUV211PixelFormat = 'Y211', + k2vuyPixelFormat = '2vuy' +}; + + +struct Pattern { + UInt8 pat[8]; +}; +typedef struct Pattern Pattern; +typedef Pattern * PatPtr; +typedef PatPtr * PatHandle; +struct PixPat { + short patType; + PixMapHandle patMap; + Handle patData; + Handle patXData; + short patXValid; + Handle patXMap; + Pattern pat1Data; +}; +typedef struct PixPat PixPat; +typedef PixPat * PixPatPtr; +typedef PixPatPtr * PixPatHandle; +typedef struct OpaqueRgnHandle* RgnHandle; +typedef struct GDevice GDevice; +typedef GDevice * GDPtr; +typedef GDPtr * GDHandle; +struct GDevice { + short gdRefNum; + short gdID; + short gdType; + Handle gdITable; + short gdResPref; + Handle gdSearchProc; + Handle gdCompProc; + short gdFlags; + PixMapHandle gdPMap; + SInt32 gdRefCon; + GDHandle gdNextGD; + Rect gdRect; + SInt32 gdMode; + short gdCCBytes; + short gdCCDepth; + Handle gdCCXData; + Handle gdCCXMask; + Handle gdExt; +}; + +struct Picture { + short picSize; + Rect picFrame; +}; +typedef struct Picture Picture; +typedef Picture * PicPtr; +typedef PicPtr * PicHandle; +struct OpenCPicParams { + Rect srcRect; + Fixed hRes; + Fixed vRes; + short version; + short reserved1; + SInt32 reserved2; +}; +typedef struct OpenCPicParams OpenCPicParams; +struct FontInfo { + short ascent; + short descent; + short widMax; + short leading; +}; +typedef struct FontInfo FontInfo; + +typedef SInt32 QDRegionParseDirection; +typedef OSStatus ( * RegionToRectsProcPtr)(UInt16 message, RgnHandle rgn, const Rect *rect, void *refCon); +typedef RegionToRectsProcPtr RegionToRectsUPP; + + +typedef short TruncCode; + +typedef UInt16 DragConstraint; +enum { + kNoConstraint = 0, + kVerticalConstraint = 1, + kHorizontalConstraint = 2 +}; + + + +typedef void ( * DragGrayRgnProcPtr)(void); +typedef Boolean ( * ColorSearchProcPtr)(RGBColor *rgb, long *position); +typedef Boolean ( * ColorComplementProcPtr)(RGBColor * rgb); +typedef DragGrayRgnProcPtr DragGrayRgnUPP; +typedef ColorSearchProcPtr ColorSearchUPP; +typedef ColorComplementProcPtr ColorComplementUPP; + + + + + + + +typedef struct OpaqueWindowPtr* WindowPtr; +typedef struct OpaqueDialogPtr* DialogPtr; +typedef WindowPtr WindowRef; + + + + + + + +struct VDGammaRecord { + Ptr csGTable; +}; +typedef struct VDGammaRecord VDGammaRecord; +typedef VDGammaRecord * VDGamRecPtr; + + +struct MacPolygon { + short polySize; + Rect polyBBox; + Point polyPoints[1]; +}; +typedef struct MacPolygon MacPolygon; + + + + +typedef MacPolygon Polygon; +typedef MacPolygon * PolyPtr; +typedef PolyPtr * PolyHandle; +typedef SInt8 GrafVerb; +typedef SInt32 PrinterStatusOpcode; +typedef void ( * QDTextProcPtr)(short byteCount, const void *textBuf, Point numer, Point denom); +typedef void ( * QDLineProcPtr)(Point newPt); +typedef void ( * QDRectProcPtr)(GrafVerb verb, const Rect *r); +typedef void ( * QDRRectProcPtr)(GrafVerb verb, const Rect *r, short ovalWidth, short ovalHeight); +typedef void ( * QDOvalProcPtr)(GrafVerb verb, const Rect *r); +typedef void ( * QDArcProcPtr)(GrafVerb verb, const Rect *r, short startAngle, short arcAngle); +typedef void ( * QDPolyProcPtr)(GrafVerb verb, PolyHandle poly); +typedef void ( * QDRgnProcPtr)(GrafVerb verb, RgnHandle rgn); +typedef void ( * QDBitsProcPtr)(const BitMap *srcBits, const Rect *srcRect, const Rect *dstRect, short mode, RgnHandle maskRgn); +typedef void ( * QDCommentProcPtr)(short kind, short dataSize, Handle dataHandle); +typedef short ( * QDTxMeasProcPtr)(short byteCount, const void *textAddr, Point *numer, Point *denom, FontInfo *info); +typedef void ( * QDGetPicProcPtr)(void *dataPtr, short byteCount); +typedef void ( * QDPutPicProcPtr)(const void *dataPtr, short byteCount); +typedef void ( * QDOpcodeProcPtr)(const Rect *fromRect, const Rect *toRect, UInt16 opcode, SInt16 version); + +typedef OSStatus ( * QDStdGlyphsProcPtr)(void *dataStream, ByteCount size); +typedef void ( * QDJShieldCursorProcPtr)(short left, short top, short right, short bottom); +typedef OSStatus ( * QDPrinterStatusProcPtr)(PrinterStatusOpcode opcode, CGrafPtr currentPort, void *printerStatus); +typedef QDTextProcPtr QDTextUPP; +typedef QDLineProcPtr QDLineUPP; +typedef QDRectProcPtr QDRectUPP; +typedef QDRRectProcPtr QDRRectUPP; +typedef QDOvalProcPtr QDOvalUPP; +typedef QDArcProcPtr QDArcUPP; +typedef QDPolyProcPtr QDPolyUPP; +typedef QDRgnProcPtr QDRgnUPP; +typedef QDBitsProcPtr QDBitsUPP; +typedef QDCommentProcPtr QDCommentUPP; +typedef QDTxMeasProcPtr QDTxMeasUPP; +typedef QDGetPicProcPtr QDGetPicUPP; +typedef QDPutPicProcPtr QDPutPicUPP; +typedef QDOpcodeProcPtr QDOpcodeUPP; +typedef QDStdGlyphsProcPtr QDStdGlyphsUPP; +typedef QDJShieldCursorProcPtr QDJShieldCursorUPP; +typedef QDPrinterStatusProcPtr QDPrinterStatusUPP; + + +struct CQDProcs { + QDTextUPP textProc; + QDLineUPP lineProc; + QDRectUPP rectProc; + QDRRectUPP rRectProc; + QDOvalUPP ovalProc; + QDArcUPP arcProc; + QDPolyUPP polyProc; + QDRgnUPP rgnProc; + QDBitsUPP bitsProc; + QDCommentUPP commentProc; + QDTxMeasUPP txMeasProc; + QDGetPicUPP getPicProc; + QDPutPicUPP putPicProc; + QDOpcodeUPP opcodeProc; + UniversalProcPtr newProc1; + QDStdGlyphsUPP glyphsProc; + QDPrinterStatusUPP printerStatusProc; + UniversalProcPtr newProc4; + UniversalProcPtr newProc5; + UniversalProcPtr newProc6; +}; +typedef struct CQDProcs CQDProcs; +typedef CQDProcs * CQDProcsPtr; + + + +struct GrafPort { + short whatever[87]; +}; +typedef struct GrafPort GrafPort; +typedef GrafPort CGrafPort; + + +typedef const struct __HIShape* HIShapeRef; +typedef struct __HIShape* HIMutableShapeRef; + + + + + +enum { + + + + + kHIShapeEnumerateInit = 1, + + + + + + kHIShapeEnumerateRect = 2, + + + + + kHIShapeEnumerateTerminate = 3 +}; + + + + + + +enum { + + + + + + kHIShapeParseFromTop = 0, + + + + + kHIShapeParseFromBottom = (1 << 0), + + + + + + kHIShapeParseFromLeft = 0, + + + + + kHIShapeParseFromRight = (1 << 1), + + + + + + kHIShapeParseFromTopLeft = kHIShapeParseFromTop | kHIShapeParseFromLeft, + + + + + kHIShapeParseFromBottomRight = kHIShapeParseFromBottom | kHIShapeParseFromRight +}; +typedef OSStatus ( * HIShapeEnumerateProcPtr)(int inMessage, HIShapeRef inShape, const CGRect *inRect, void *inRefcon); +extern CFTypeID +HIShapeGetTypeID(void) __attribute__((availability(macosx,introduced=10.2))); +extern HIShapeRef +HIShapeCreateEmpty(void) __attribute__((availability(macosx,introduced=10.4))); +extern HIShapeRef +HIShapeCreateWithQDRgn(RgnHandle inRgn) __attribute__((availability(macosx,introduced=10.2))); +extern HIShapeRef +HIShapeCreateWithRect(const CGRect * inRect) __attribute__((availability(macosx,introduced=10.2))); +extern HIShapeRef +HIShapeCreateCopy(HIShapeRef inShape) __attribute__((availability(macosx,introduced=10.2))); +extern HIShapeRef +HIShapeCreateIntersection( + HIShapeRef inShape1, + HIShapeRef inShape2) __attribute__((availability(macosx,introduced=10.2))); +extern HIShapeRef +HIShapeCreateDifference( + HIShapeRef inShape1, + HIShapeRef inShape2) __attribute__((availability(macosx,introduced=10.2))); +extern HIShapeRef +HIShapeCreateUnion( + HIShapeRef inShape1, + HIShapeRef inShape2) __attribute__((availability(macosx,introduced=10.2))); +extern HIShapeRef +HIShapeCreateXor( + HIShapeRef inShape1, + HIShapeRef inShape2) __attribute__((availability(macosx,introduced=10.5))); +extern Boolean +HIShapeIsEmpty(HIShapeRef inShape) __attribute__((availability(macosx,introduced=10.2))); +extern Boolean +HIShapeIsRectangular(HIShapeRef inShape) __attribute__((availability(macosx,introduced=10.2))); +extern Boolean +HIShapeContainsPoint( + HIShapeRef inShape, + const CGPoint * inPoint) __attribute__((availability(macosx,introduced=10.2))); +extern Boolean +HIShapeIntersectsRect( + HIShapeRef inShape, + const CGRect * inRect) __attribute__((availability(macosx,introduced=10.4))); +extern CGRect * +HIShapeGetBounds( + HIShapeRef inShape, + CGRect * outRect) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +HIShapeGetAsQDRgn( + HIShapeRef inShape, + RgnHandle outRgn) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +HIShapeReplacePathInCGContext( + HIShapeRef inShape, + CGContextRef inContext) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +HIShapeEnumerate( + HIShapeRef inShape, + OptionBits inOptions, + HIShapeEnumerateProcPtr inProc, + void * inRefcon) __attribute__((availability(macosx,introduced=10.5))); +extern HIMutableShapeRef +HIShapeCreateMutable(void) __attribute__((availability(macosx,introduced=10.2))); +extern HIMutableShapeRef +HIShapeCreateMutableCopy(HIShapeRef inOrig) __attribute__((availability(macosx,introduced=10.2))); +extern HIMutableShapeRef +HIShapeCreateMutableWithRect(const CGRect * inRect) __attribute__((availability(macosx,introduced=10.5))); +extern OSStatus +HIShapeSetEmpty(HIMutableShapeRef inShape) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +HIShapeSetWithShape( + HIMutableShapeRef inDestShape, + HIShapeRef inSrcShape) __attribute__((availability(macosx,introduced=10.5))); +extern OSStatus +HIShapeIntersect( + HIShapeRef inShape1, + HIShapeRef inShape2, + HIMutableShapeRef outResult) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +HIShapeDifference( + HIShapeRef inShape1, + HIShapeRef inShape2, + HIMutableShapeRef outResult) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +HIShapeUnion( + HIShapeRef inShape1, + HIShapeRef inShape2, + HIMutableShapeRef outResult) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +HIShapeXor( + HIShapeRef inShape1, + HIShapeRef inShape2, + HIMutableShapeRef outResult) __attribute__((availability(macosx,introduced=10.5))); +extern OSStatus +HIShapeOffset( + HIMutableShapeRef inShape, + CGFloat inDX, + CGFloat inDY) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +HIShapeInset( + HIMutableShapeRef inShape, + CGFloat inDX, + CGFloat inDY) __attribute__((availability(macosx,introduced=10.5))); +extern OSStatus +HIShapeUnionWithRect( + HIMutableShapeRef inShape, + const CGRect * inRect) __attribute__((availability(macosx,introduced=10.5))); + + + + + +enum { + kAlignNone = 0x00, + kAlignVerticalCenter = 0x01, + kAlignTop = 0x02, + kAlignBottom = 0x03, + kAlignHorizontalCenter = 0x04, + kAlignAbsoluteCenter = kAlignVerticalCenter | kAlignHorizontalCenter, + kAlignCenterTop = kAlignTop | kAlignHorizontalCenter, + kAlignCenterBottom = kAlignBottom | kAlignHorizontalCenter, + kAlignLeft = 0x08, + kAlignCenterLeft = kAlignVerticalCenter | kAlignLeft, + kAlignTopLeft = kAlignTop | kAlignLeft, + kAlignBottomLeft = kAlignBottom | kAlignLeft, + kAlignRight = 0x0C, + kAlignCenterRight = kAlignVerticalCenter | kAlignRight, + kAlignTopRight = kAlignTop | kAlignRight, + kAlignBottomRight = kAlignBottom | kAlignRight +}; + + +enum { + atNone = kAlignNone, + atVerticalCenter = kAlignVerticalCenter, + atTop = kAlignTop, + atBottom = kAlignBottom, + atHorizontalCenter = kAlignHorizontalCenter, + atAbsoluteCenter = kAlignAbsoluteCenter, + atCenterTop = kAlignCenterTop, + atCenterBottom = kAlignCenterBottom, + atLeft = kAlignLeft, + atCenterLeft = kAlignCenterLeft, + atTopLeft = kAlignTopLeft, + atBottomLeft = kAlignBottomLeft, + atRight = kAlignRight, + atCenterRight = kAlignCenterRight, + atTopRight = kAlignTopRight, + atBottomRight = kAlignBottomRight +}; + +typedef SInt16 IconAlignmentType; + +enum { + kTransformNone = 0x00, + kTransformDisabled = 0x01, + kTransformOffline = 0x02, + kTransformOpen = 0x03, + kTransformLabel1 = 0x0100, + kTransformLabel2 = 0x0200, + kTransformLabel3 = 0x0300, + kTransformLabel4 = 0x0400, + kTransformLabel5 = 0x0500, + kTransformLabel6 = 0x0600, + kTransformLabel7 = 0x0700, + kTransformSelected = 0x4000, + kTransformSelectedDisabled = kTransformSelected | kTransformDisabled, + kTransformSelectedOffline = kTransformSelected | kTransformOffline, + kTransformSelectedOpen = kTransformSelected | kTransformOpen +}; + + +enum { + ttNone = kTransformNone, + ttDisabled = kTransformDisabled, + ttOffline = kTransformOffline, + ttOpen = kTransformOpen, + ttLabel1 = kTransformLabel1, + ttLabel2 = kTransformLabel2, + ttLabel3 = kTransformLabel3, + ttLabel4 = kTransformLabel4, + ttLabel5 = kTransformLabel5, + ttLabel6 = kTransformLabel6, + ttLabel7 = kTransformLabel7, + ttSelected = kTransformSelected, + ttSelectedDisabled = kTransformSelectedDisabled, + ttSelectedOffline = kTransformSelectedOffline, + ttSelectedOpen = kTransformSelectedOpen +}; + +typedef SInt16 IconTransformType; + +enum { + kSelectorLarge1Bit = 0x00000001, + kSelectorLarge4Bit = 0x00000002, + kSelectorLarge8Bit = 0x00000004, + kSelectorLarge32Bit = 0x00000008, + kSelectorLarge8BitMask = 0x00000010, + kSelectorSmall1Bit = 0x00000100, + kSelectorSmall4Bit = 0x00000200, + kSelectorSmall8Bit = 0x00000400, + kSelectorSmall32Bit = 0x00000800, + kSelectorSmall8BitMask = 0x00001000, + kSelectorMini1Bit = 0x00010000, + kSelectorMini4Bit = 0x00020000, + kSelectorMini8Bit = 0x00040000, + kSelectorHuge1Bit = 0x01000000, + kSelectorHuge4Bit = 0x02000000, + kSelectorHuge8Bit = 0x04000000, + kSelectorHuge32Bit = 0x08000000, + kSelectorHuge8BitMask = 0x10000000, + kSelectorAllLargeData = 0x000000FF, + kSelectorAllSmallData = 0x0000FF00, + kSelectorAllMiniData = 0x00FF0000, + kSelectorAllHugeData = (UInt32)0xFF000000, + kSelectorAll1BitData = kSelectorLarge1Bit | kSelectorSmall1Bit | kSelectorMini1Bit | kSelectorHuge1Bit, + kSelectorAll4BitData = kSelectorLarge4Bit | kSelectorSmall4Bit | kSelectorMini4Bit | kSelectorHuge4Bit, + kSelectorAll8BitData = kSelectorLarge8Bit | kSelectorSmall8Bit | kSelectorMini8Bit | kSelectorHuge8Bit, + kSelectorAll32BitData = kSelectorLarge32Bit | kSelectorSmall32Bit | kSelectorHuge32Bit, + kSelectorAllAvailableData = (UInt32)0xFFFFFFFF +}; + +typedef UInt32 IconSelectorValue; + +enum { + svLarge1Bit = kSelectorLarge1Bit, + svLarge4Bit = kSelectorLarge4Bit, + svLarge8Bit = kSelectorLarge8Bit, + svSmall1Bit = kSelectorSmall1Bit, + svSmall4Bit = kSelectorSmall4Bit, + svSmall8Bit = kSelectorSmall8Bit, + svMini1Bit = kSelectorMini1Bit, + svMini4Bit = kSelectorMini4Bit, + svMini8Bit = kSelectorMini8Bit, + svAllLargeData = kSelectorAllLargeData, + svAllSmallData = kSelectorAllSmallData, + svAllMiniData = kSelectorAllMiniData, + svAll1BitData = kSelectorAll1BitData, + svAll4BitData = kSelectorAll4BitData, + svAll8BitData = kSelectorAll8BitData, + svAllAvailableData = kSelectorAllAvailableData +}; + +typedef OSErr ( * IconActionProcPtr)(ResType theType, Handle *theIcon, void *yourDataPtr); +typedef Handle ( * IconGetterProcPtr)(ResType theType, void *yourDataPtr); +typedef IconActionProcPtr IconActionUPP; +typedef IconGetterProcPtr IconGetterUPP; +extern IconActionUPP +NewIconActionUPP(IconActionProcPtr userRoutine) ; +extern IconGetterUPP +NewIconGetterUPP(IconGetterProcPtr userRoutine) ; +extern void +DisposeIconActionUPP(IconActionUPP userUPP) ; +extern void +DisposeIconGetterUPP(IconGetterUPP userUPP) ; +extern OSErr +InvokeIconActionUPP( + ResType theType, + Handle * theIcon, + void * yourDataPtr, + IconActionUPP userUPP) ; +extern Handle +InvokeIconGetterUPP( + ResType theType, + void * yourDataPtr, + IconGetterUPP userUPP) ; +typedef UInt32 PlotIconRefFlags; +enum { + + + + + kPlotIconRefNormalFlags = 0, + + + + + kPlotIconRefNoImage = (1 << 1), + + + + + kPlotIconRefNoMask = (1 << 2) +}; +extern OSErr +IconRefToIconFamily( + IconRef theIconRef, + IconSelectorValue whichIcons, + IconFamilyHandle * iconFamily) ; +extern OSErr +SetIconFamilyData( + IconFamilyHandle iconFamily, + OSType iconType, + Handle h) ; +extern OSErr +GetIconFamilyData( + IconFamilyHandle iconFamily, + OSType iconType, + Handle h) ; +extern OSStatus +PlotIconRefInContext( + CGContextRef inContext, + const CGRect * inRect, + IconAlignmentType inAlign, + IconTransformType inTransform, + const RGBColor * inLabelColor, + PlotIconRefFlags inFlags, + IconRef inIconRef) __attribute__((availability(macosx,introduced=10.1))); +extern Boolean +IconRefContainsCGPoint( + const CGPoint * testPt, + const CGRect * iconRect, + IconAlignmentType align, + IconServicesUsageFlags iconServicesUsageFlags, + IconRef theIconRef) __attribute__((availability(macosx,introduced=10.5))); +extern Boolean +IconRefIntersectsCGRect( + const CGRect * testRect, + const CGRect * iconRect, + IconAlignmentType align, + IconServicesUsageFlags iconServicesUsageFlags, + IconRef theIconRef) __attribute__((availability(macosx,introduced=10.5))); +extern HIShapeRef +IconRefToHIShape( + const CGRect * iconRect, + IconAlignmentType align, + IconServicesUsageFlags iconServicesUsageFlags, + IconRef theIconRef) __attribute__((availability(macosx,introduced=10.5))); +extern Boolean +IsIconRefMaskEmpty(IconRef iconRef) ; +extern IconRef +GetIconRefVariant( + IconRef inIconRef, + OSType inVariant, + IconTransformType * outTransform) ; + + + + + + + + +enum { + icPrefNotFoundErr = -666, + icPermErr = -667, + icPrefDataErr = -668, + icInternalErr = -669, + icTruncatedErr = -670, + icNoMoreWritersErr = -671, + icNothingToOverrideErr = -672, + icNoURLErr = -673, + icConfigNotFoundErr = -674, + icConfigInappropriateErr = -675, + icProfileNotFoundErr = -676, + icTooManyProfilesErr = -677 +}; + + + + + +enum { + kICComponentInterfaceVersion0 = 0x00000000, + kICComponentInterfaceVersion1 = 0x00010000, + kICComponentInterfaceVersion2 = 0x00020000, + kICComponentInterfaceVersion3 = 0x00030000, + kICComponentInterfaceVersion4 = 0x00040000, + kICComponentInterfaceVersion = kICComponentInterfaceVersion4 +}; + + + + + +typedef struct OpaqueICInstance* ICInstance; +typedef UInt32 ICAttr; +enum { + kICAttrLockedBit = 0, + kICAttrVolatileBit = 1 +}; + +enum { + kICAttrNoChange = (UInt32)0xFFFFFFFF, + kICAttrLockedMask = 0x00000001, + kICAttrVolatileMask = 0x00000002 +}; + + + + +typedef UInt8 ICPerm; +enum { + icNoPerm = 0, + icReadOnlyPerm = 1, + icReadWritePerm = 2 +}; + + + + + +typedef SInt32 ICProfileID; +typedef ICProfileID * ICProfileIDPtr; +enum { + kICNilProfileID = 0 +}; + + + + +enum { + kICNoUserInteractionBit = 0 +}; + +enum { + kICNoUserInteractionMask = 0x00000001 +}; + +enum { + kICFileType = 'ICAp', + kICCreator = 'ICAp' +}; + + + + +enum { + kInternetEventClass = 'GURL', + kAEGetURL = 'GURL', + kAEFetchURL = 'FURL', + keyAEAttaching = 'Atch' +}; + + +enum { + kICEditPreferenceEventClass = 'ICAp', + kICEditPreferenceEvent = 'ICAp', + keyICEditPreferenceDestination = 'dest' +}; + + + + +enum { + kICComponentVersion = 0, + kICNumVersion = 1 +}; + + + + +struct ICFontRecord { + SInt16 size; + Style face; + char pad; + Str255 font; +}; +typedef struct ICFontRecord ICFontRecord; +typedef ICFontRecord * ICFontRecordPtr; +typedef ICFontRecordPtr * ICFontRecordHandle; + + + + +struct ICCharTable { + unsigned char netToMac[256]; + unsigned char macToNet[256]; +}; +typedef struct ICCharTable ICCharTable; +typedef ICCharTable * ICCharTablePtr; +typedef ICCharTablePtr * ICCharTableHandle; + + + + +struct ICAppSpec { + OSType fCreator; + Str63 name; +}; +typedef struct ICAppSpec ICAppSpec; +typedef ICAppSpec * ICAppSpecPtr; +typedef ICAppSpecPtr * ICAppSpecHandle; +struct ICAppSpecList { + SInt16 numberOfItems; + ICAppSpec appSpecs[1]; +}; +typedef struct ICAppSpecList ICAppSpecList; +typedef ICAppSpecList * ICAppSpecListPtr; +typedef ICAppSpecListPtr * ICAppSpecListHandle; + + + + +struct ICFileSpec { + Str31 volName; + SInt32 volCreationDate; + FSSpec fss; + AliasRecord alias; + + +}; +typedef struct ICFileSpec ICFileSpec; +typedef ICFileSpec * ICFileSpecPtr; +typedef ICFileSpecPtr * ICFileSpecHandle; +enum { + kICFileSpecHeaderSize = sizeof(ICFileSpec) - sizeof(AliasRecord) +}; + + + + +typedef SInt32 ICMapEntryFlags; +typedef SInt16 ICFixedLength; +struct ICMapEntry { + SInt16 totalLength; + ICFixedLength fixedLength; + SInt16 version; + OSType fileType; + OSType fileCreator; + OSType postCreator; + ICMapEntryFlags flags; + + Str255 extension; + Str255 creatorAppName; + Str255 postAppName; + Str255 MIMEType; + Str255 entryName; +}; +typedef struct ICMapEntry ICMapEntry; +typedef ICMapEntry * ICMapEntryPtr; +typedef ICMapEntryPtr * ICMapEntryHandle; +enum { + kICMapFixedLength = 22 +}; + +enum { + kICMapBinaryBit = 0, + kICMapResourceForkBit = 1, + kICMapDataForkBit = 2, + kICMapPostBit = 3, + kICMapNotIncomingBit = 4, + kICMapNotOutgoingBit = 5 +}; + +enum { + kICMapBinaryMask = 0x00000001, + kICMapResourceForkMask = 0x00000002, + kICMapDataForkMask = 0x00000004, + kICMapPostMask = 0x00000008, + kICMapNotIncomingMask = 0x00000010, + kICMapNotOutgoingMask = 0x00000020 +}; + + + + +typedef SInt16 ICServiceEntryFlags; +struct ICServiceEntry { + Str255 name; + SInt16 port; + ICServiceEntryFlags flags; +}; +typedef struct ICServiceEntry ICServiceEntry; +typedef ICServiceEntry * ICServiceEntryPtr; +typedef ICServiceEntryPtr * ICServiceEntryHandle; + +enum { + kICServicesTCPBit = 0, + kICServicesUDPBit = 1 +}; + +enum { + kICServicesTCPMask = 0x00000001, + kICServicesUDPMask = 0x00000002 +}; + +struct ICServices { + SInt16 count; + ICServiceEntry services[1]; +}; +typedef struct ICServices ICServices; +typedef ICServices * ICServicesPtr; +typedef ICServicesPtr * ICServicesHandle; +extern OSStatus +ICStart( + ICInstance * inst, + OSType signature) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICStop(ICInstance inst) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICGetVersion( + ICInstance inst, + long whichVersion, + UInt32 * version) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICGetConfigName( + ICInstance inst, + Boolean longname, + Str255 name) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICGetSeed( + ICInstance inst, + long * seed) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICGetPerm( + ICInstance inst, + ICPerm * perm) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICBegin( + ICInstance inst, + ICPerm perm) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICGetPref( + ICInstance inst, + ConstStr255Param key, + ICAttr * attr, + void * buf, + long * size) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICSetPref( + ICInstance inst, + ConstStr255Param key, + ICAttr attr, + const void * buf, + long size) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICFindPrefHandle( + ICInstance inst, + ConstStr255Param key, + ICAttr * attr, + Handle prefh) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICGetPrefHandle( + ICInstance inst, + ConstStr255Param key, + ICAttr * attr, + Handle * prefh) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICSetPrefHandle( + ICInstance inst, + ConstStr255Param key, + ICAttr attr, + Handle prefh) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICCountPref( + ICInstance inst, + long * count) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICGetIndPref( + ICInstance inst, + long index, + Str255 key) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICDeletePref( + ICInstance inst, + ConstStr255Param key) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICEnd(ICInstance inst) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICGetDefaultPref( + ICInstance inst, + ConstStr255Param key, + Handle prefH) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICEditPreferences( + ICInstance inst, + ConstStr255Param key) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICLaunchURL( + ICInstance inst, + ConstStr255Param hint, + const void * data, + long len, + long * selStart, + long * selEnd) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICParseURL( + ICInstance inst, + ConstStr255Param hint, + const void * data, + long len, + long * selStart, + long * selEnd, + Handle url) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICCreateGURLEvent( + ICInstance inst, + OSType helperCreator, + Handle urlH, + AppleEvent * theEvent) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICSendGURLEvent( + ICInstance inst, + AppleEvent * theEvent) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICMapFilename( + ICInstance inst, + ConstStr255Param filename, + ICMapEntry * entry) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICMapTypeCreator( + ICInstance inst, + OSType fType, + OSType fCreator, + ConstStr255Param filename, + ICMapEntry * entry) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICMapEntriesFilename( + ICInstance inst, + Handle entries, + ConstStr255Param filename, + ICMapEntry * entry) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICMapEntriesTypeCreator( + ICInstance inst, + Handle entries, + OSType fType, + OSType fCreator, + ConstStr255Param filename, + ICMapEntry * entry) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICCountMapEntries( + ICInstance inst, + Handle entries, + long * count) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICGetIndMapEntry( + ICInstance inst, + Handle entries, + long index, + long * pos, + ICMapEntry * entry) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICGetMapEntry( + ICInstance inst, + Handle entries, + long pos, + ICMapEntry * entry) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICSetMapEntry( + ICInstance inst, + Handle entries, + long pos, + const ICMapEntry * entry) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICDeleteMapEntry( + ICInstance inst, + Handle entries, + long pos) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICAddMapEntry( + ICInstance inst, + Handle entries, + const ICMapEntry * entry) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICGetCurrentProfile( + ICInstance inst, + ICProfileID * currentID) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICSetCurrentProfile( + ICInstance inst, + ICProfileID newID) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICCountProfiles( + ICInstance inst, + long * count) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICGetIndProfile( + ICInstance inst, + long index, + ICProfileID * thisID) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICGetProfileName( + ICInstance inst, + ICProfileID thisID, + Str255 name) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICSetProfileName( + ICInstance inst, + ICProfileID thisID, + ConstStr255Param name) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICAddProfile( + ICInstance inst, + ICProfileID prototypeID, + ICProfileID * newID) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); +extern OSStatus +ICDeleteProfile( + ICInstance inst, + ICProfileID thisID) __attribute__((availability(macosx,introduced=10.0,deprecated=10.7))); + + + + + + + + + + + + +enum { + + kNoProcess = 0, + kSystemProcess = 1, + kCurrentProcess = 2 +}; + + + +typedef UInt16 LaunchFlags; +enum { + launchContinue = 0x4000, + launchNoFileFlags = 0x0800, + launchUseMinimum = 0x0400, + launchDontSwitch = 0x0200, + launchAllow24Bit = 0x0100, + launchInhibitDaemon = 0x0080 +}; + + + +struct AppParameters { + struct { + UInt16 what; + UInt32 message; + UInt32 when; + Point where; + UInt16 modifiers; + } theMsgEvent; + UInt32 eventRefCon; + UInt32 messageLength; +}; +typedef struct AppParameters AppParameters; +typedef AppParameters * AppParametersPtr; + + +struct LaunchParamBlockRec { + UInt32 reserved1; + UInt16 reserved2; + UInt16 launchBlockID; + UInt32 launchEPBLength; + UInt16 launchFileFlags; + LaunchFlags launchControlFlags; + FSRefPtr launchAppRef; + ProcessSerialNumber launchProcessSN; + UInt32 launchPreferredSize; + UInt32 launchMinimumSize; + UInt32 launchAvailableSize; + AppParametersPtr launchAppParameters; +}; +typedef struct LaunchParamBlockRec LaunchParamBlockRec; +typedef LaunchParamBlockRec * LaunchPBPtr; + + +enum { + extendedBlock = 0x4C43, + extendedBlockLen = sizeof(LaunchParamBlockRec) - 12 +}; + +enum { + + modeReserved = 0x01000000, + modeControlPanel = 0x00080000, + modeLaunchDontSwitch = 0x00040000, + modeDeskAccessory = 0x00020000, + modeMultiLaunch = 0x00010000, + modeNeedSuspendResume = 0x00004000, + modeCanBackground = 0x00001000, + modeDoesActivateOnFGSwitch = 0x00000800, + modeOnlyBackground = 0x00000400, + modeGetFrontClicks = 0x00000200, + modeGetAppDiedMsg = 0x00000100, + mode32BitCompatible = 0x00000080, + modeHighLevelEventAware = 0x00000040, + modeLocalAndRemoteHLEvents = 0x00000020, + modeStationeryAware = 0x00000010, + modeUseTextEditServices = 0x00000008, + modeDisplayManagerAware = 0x00000004 +}; + +typedef UInt32 ProcessApplicationTransformState; +enum { + kProcessTransformToForegroundApplication = 1, + kProcessTransformToBackgroundApplication = 2, + kProcessTransformToUIElementApplication = 4 +}; +struct ProcessInfoRec { + UInt32 processInfoLength; + StringPtr processName; + ProcessSerialNumber processNumber; + UInt32 processType; + OSType processSignature; + UInt32 processMode; + Ptr processLocation; + UInt32 processSize; + UInt32 processFreeMem; + ProcessSerialNumber processLauncher; + UInt32 processLaunchDate; + UInt32 processActiveTime; + FSRefPtr processAppRef; +}; +typedef struct ProcessInfoRec ProcessInfoRec; +typedef ProcessInfoRec * ProcessInfoRecPtr; +struct ProcessInfoExtendedRec { + UInt32 processInfoLength; + StringPtr processName; + ProcessSerialNumber processNumber; + UInt32 processType; + OSType processSignature; + UInt32 processMode; + Ptr processLocation; + UInt32 processSize; + UInt32 processFreeMem; + ProcessSerialNumber processLauncher; + UInt32 processLaunchDate; + UInt32 processActiveTime; + FSRefPtr processAppRef; + UInt32 processTempMemTotal; + UInt32 processPurgeableTempMemTotal; +}; +typedef struct ProcessInfoExtendedRec ProcessInfoExtendedRec; +typedef ProcessInfoExtendedRec * ProcessInfoExtendedRecPtr; + +struct SizeResourceRec { + UInt16 flags; + UInt32 preferredHeapSize; + UInt32 minimumHeapSize; +}; +typedef struct SizeResourceRec SizeResourceRec; +typedef SizeResourceRec * SizeResourceRecPtr; +typedef SizeResourceRecPtr * SizeResourceRecHandle; + + + + + +enum { + + + + + + kProcessDictionaryIncludeAllInformationMask = (int)0xFFFFFFFF +}; +enum { + kQuitBeforeNormalTimeMask = 1, + kQuitAtNormalTimeMask = 2, + kQuitBeforeFBAsQuitMask = 4, + kQuitBeforeShellQuitsMask = 8, + kQuitBeforeTerminatorAppQuitsMask = 16, + kQuitNeverMask = 32, + kQuitOptionsMask = 0x7F, + kQuitNotQuitDuringInstallMask = 0x0100, + kQuitNotQuitDuringLogoutMask = 0x0200 +}; +extern OSErr +LaunchApplication(LaunchPBPtr LaunchParams) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); +extern OSErr +GetCurrentProcess(ProcessSerialNumber * PSN) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); +extern OSErr +GetFrontProcess(ProcessSerialNumber * PSN) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); +extern OSErr +GetNextProcess(ProcessSerialNumber * PSN) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); +extern OSErr +GetProcessInformation( + const ProcessSerialNumber * PSN, + ProcessInfoRec * info) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); +extern CFDictionaryRef +ProcessInformationCopyDictionary( + const ProcessSerialNumber * PSN, + UInt32 infoToReturn) __attribute__((availability(macosx,introduced=10.2,deprecated=10.9))); +extern OSErr +SetFrontProcess(const ProcessSerialNumber * PSN) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); + + + + + + + +enum { + + + + + + + kSetFrontProcessFrontWindowOnly = (1 << 0), + kSetFrontProcessCausedByUser = (1 << 1) +}; +extern OSStatus +SetFrontProcessWithOptions( + const ProcessSerialNumber * inProcess, + OptionBits inOptions) __attribute__((availability(macosx,introduced=10.2,deprecated=10.9))); +extern OSErr +WakeUpProcess(const ProcessSerialNumber * PSN) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); +extern OSErr +SameProcess( + const ProcessSerialNumber * PSN1, + const ProcessSerialNumber * PSN2, + Boolean * result) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); +void ExitToShell( void ) __attribute__ (( __noreturn__ )) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); +extern OSErr +KillProcess(const ProcessSerialNumber * inProcess) __attribute__((availability(macosx,introduced=10.2,deprecated=10.9))); +extern OSStatus +GetProcessBundleLocation( + const ProcessSerialNumber * psn, + FSRef * location) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); +extern OSStatus +CopyProcessName( + const ProcessSerialNumber * psn, + CFStringRef * name) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); +extern OSStatus +GetProcessPID( + const ProcessSerialNumber * psn, + pid_t * pid) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); +extern OSStatus +GetProcessForPID( + pid_t pid, + ProcessSerialNumber * psn) __attribute__((availability(macosx,introduced=10.0,deprecated=10.9))); +extern Boolean +IsProcessVisible(const ProcessSerialNumber * psn) __attribute__((availability(macosx,introduced=10.1,deprecated=10.9))); +extern OSErr +ShowHideProcess( + const ProcessSerialNumber * psn, + Boolean visible) __attribute__((availability(macosx,introduced=10.1,deprecated=10.9))); +extern OSStatus +TransformProcessType( + const ProcessSerialNumber * psn, + ProcessApplicationTransformState transformState) __attribute__((availability(macosx,introduced=10.3))); + + + + + +enum { + initDev = 0, + hitDev = 1, + closeDev = 2, + nulDev = 3, + updateDev = 4, + activDev = 5, + deactivDev = 6, + keyEvtDev = 7, + macDev = 8, + undoDev = 9, + cutDev = 10, + copyDev = 11, + pasteDev = 12, + clearDev = 13, + cursorDev = 14 +}; + + +enum { + cdevGenErr = -1, + cdevMemErr = 0, + cdevResErr = 1, + cdevUnset = 3 +}; + + + + + + + + +typedef struct __attribute__((objc_bridge(id))) OpaquePasteboardRef* PasteboardRef; +typedef void * PasteboardItemID; + +enum { + badPasteboardSyncErr = -25130, + badPasteboardIndexErr = -25131, + badPasteboardItemErr = -25132, + badPasteboardFlavorErr = -25133, + duplicatePasteboardFlavorErr = -25134, + notPasteboardOwnerErr = -25135, + noPasteboardPromiseKeeperErr = -25136 +}; +typedef OptionBits PasteboardSyncFlags; enum { + kPasteboardModified = (1 << 0), + + + + + + + + kPasteboardClientIsOwner = (1 << 1) +}; +typedef OptionBits PasteboardFlavorFlags; enum { + + + + + kPasteboardFlavorNoFlags = 0, + + + + + + + + kPasteboardFlavorSenderOnly = (1 << 0), + + + + + + + kPasteboardFlavorSenderTranslated = (1 << 1), + + + + + + + + kPasteboardFlavorNotSaved = (1 << 2), + kPasteboardFlavorRequestOnly = (1 << 3), + kPasteboardFlavorSystemTranslated = (1 << 8), + kPasteboardFlavorPromised = (1 << 9) +}; +typedef OSType PasteboardStandardLocation; enum { + + + + + + + + kPasteboardStandardLocationTrash = 'trsh', + + + + + kPasteboardStandardLocationUnknown = 'unkn' +}; +extern CFTypeID +PasteboardGetTypeID(void) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PasteboardCreate( + CFStringRef _Nullable inName, + PasteboardRef _Nullable * _Nonnull outPasteboard __attribute__((cf_returns_retained))) __attribute__((availability(macosx,introduced=10.3))); +extern PasteboardSyncFlags +PasteboardSynchronize(PasteboardRef inPasteboard) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PasteboardClear(PasteboardRef inPasteboard) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PasteboardCopyName( + PasteboardRef inPasteboard, + CFStringRef _Nullable * _Nonnull outName __attribute__((cf_returns_retained))) __attribute__((availability(macosx,introduced=10.4))); +extern OSStatus +PasteboardGetItemCount( + PasteboardRef inPasteboard, + ItemCount * outItemCount) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PasteboardGetItemIdentifier( + PasteboardRef inPasteboard, + CFIndex inIndex, + PasteboardItemID _Nullable * _Nonnull outItem) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PasteboardCopyItemFlavors( + PasteboardRef inPasteboard, + PasteboardItemID inItem, + CFArrayRef _Nullable * _Nonnull outFlavorTypes __attribute__((cf_returns_retained))) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PasteboardGetItemFlavorFlags( + PasteboardRef inPasteboard, + PasteboardItemID inItem, + CFStringRef inFlavorType, + PasteboardFlavorFlags * outFlags) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PasteboardCopyItemFlavorData( + PasteboardRef inPasteboard, + PasteboardItemID inItem, + CFStringRef inFlavorType, + CFDataRef _Nullable * _Nonnull outData __attribute__((cf_returns_retained))) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PasteboardPutItemFlavor( + PasteboardRef inPasteboard, + PasteboardItemID inItem, + CFStringRef inFlavorType, + CFDataRef _Nullable inData, + PasteboardFlavorFlags inFlags) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PasteboardCopyPasteLocation( + PasteboardRef inPasteboard, + CFURLRef _Nullable * _Nonnull outPasteLocation __attribute__((cf_returns_retained))) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PasteboardSetPasteLocation( + PasteboardRef inPasteboard, + CFURLRef inPasteLocation) __attribute__((availability(macosx,introduced=10.3))); +typedef OSStatus ( * PasteboardPromiseKeeperProcPtr)(PasteboardRef pasteboard, PasteboardItemID item, CFStringRef flavorType, void * _Nullable context); +extern OSStatus +PasteboardSetPromiseKeeper( + PasteboardRef inPasteboard, + PasteboardPromiseKeeperProcPtr inPromiseKeeper, + void * _Nullable inContext) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PasteboardResolvePromises(PasteboardRef inPasteboard) __attribute__((availability(macosx,introduced=10.3))); + + + +typedef struct OpaqueTranslationRef* TranslationRef; + +enum { + + + + + + badTranslationRefErr = -3031 +}; +typedef OptionBits TranslationFlags; +enum { + + + + + + kTranslationDataTranslation = (1 << 0), + + + + + + kTranslationFileTranslation = (1 << 1) +}; +extern CFTypeID +TranslationGetTypeID(void) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +TranslationCreate( + CFStringRef inSourceType, + CFStringRef inDestinationType, + TranslationFlags inTranslationFlags, + TranslationRef * outTranslation) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +TranslationCreateWithSourceArray( + CFArrayRef inSourceTypes, + TranslationFlags inTranslationFlags, + CFArrayRef * outDestinationTypes, + CFDictionaryRef * outTranslations) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +TranslationPerformForData( + TranslationRef inTranslation, + CFDataRef inSourceData, + CFDataRef * outDestinationData) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +TranslationPerformForFile( + TranslationRef inTranslation, + const FSRef * inSourceFile, + const FSRef * inDestinationDirectory, + CFStringRef inDestinationName, + FSRef * outTranslatedFile) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +TranslationPerformForURL( + TranslationRef inTranslation, + CFURLRef inSourceURL, + CFURLRef inDestinationURL, + CFURLRef * outTranslatedURL) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +TranslationCopySourceType( + TranslationRef inTranslation, + CFStringRef * outSourceType) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +TranslationCopyDestinationType( + TranslationRef inTranslation, + CFStringRef * outDestinationType) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +TranslationGetTranslationFlags( + TranslationRef inTranslation, + TranslationFlags * outTranslationFlags) __attribute__((availability(macosx,introduced=10.3))); + + + +typedef SInt32 AXError; enum { + + kAXErrorSuccess = 0, + + + kAXErrorFailure = -25200, + + + kAXErrorIllegalArgument = -25201, + + + kAXErrorInvalidUIElement = -25202, + + + kAXErrorInvalidUIElementObserver = -25203, + + + kAXErrorCannotComplete = -25204, + + + kAXErrorAttributeUnsupported = -25205, + + + kAXErrorActionUnsupported = -25206, + + + kAXErrorNotificationUnsupported = -25207, + + + kAXErrorNotImplemented = -25208, + + + kAXErrorNotificationAlreadyRegistered = -25209, + + + kAXErrorNotificationNotRegistered = -25210, + + + kAXErrorAPIDisabled = -25211, + + + kAXErrorNoValue = -25212, + + + kAXErrorParameterizedAttributeUnsupported = -25213, + + + kAXErrorNotEnoughPrecision = -25214 +}; +typedef UInt32 AXMenuItemModifiers; enum { + kAXMenuItemModifierNone = 0, + kAXMenuItemModifierShift = (1 << 0), + kAXMenuItemModifierOption = (1 << 1), + kAXMenuItemModifierControl = (1 << 2), + kAXMenuItemModifierNoCommand = (1 << 3) +}; +typedef CFIndex AXPriority; enum { + kAXPriorityLow = 10, + kAXPriorityMedium = 50, + kAXPriorityHigh = 90 +} __attribute__((availability(macosx,introduced=10_9))); +extern Boolean AXAPIEnabled (void) __attribute__((availability(macosx,introduced=10_0,deprecated=10_9,message="" ))); +extern Boolean AXIsProcessTrustedWithOptions (CFDictionaryRef _Nullable options) __attribute__((availability(macosx,introduced=10_9))); + +extern CFStringRef kAXTrustedCheckOptionPrompt __attribute__((availability(macosx,introduced=10_9))); + + + + + + + +extern Boolean AXIsProcessTrusted (void) __attribute__((availability(macosx,introduced=10_4))); +extern AXError AXMakeProcessTrusted (CFStringRef executablePath) __attribute__((availability(macosx,introduced=10_4,deprecated=10_9,message="" ))); +typedef const struct __attribute__((objc_bridge(id))) __AXUIElement *AXUIElementRef; + + + + + + +typedef UInt32 AXCopyMultipleAttributeOptions; enum { + kAXCopyMultipleAttributeOptionStopOnError = 0x1 +}; + + + + + + + +extern CFTypeID AXUIElementGetTypeID (void); +extern AXError AXUIElementCopyAttributeNames (AXUIElementRef element, CFArrayRef _Nullable * _Nonnull __attribute__((cf_returns_retained)) names); +extern AXError AXUIElementCopyAttributeValue (AXUIElementRef element, CFStringRef attribute, CFTypeRef _Nullable * _Nonnull __attribute__((cf_returns_retained)) value); +extern AXError AXUIElementGetAttributeValueCount (AXUIElementRef element, CFStringRef attribute, CFIndex *count); +extern AXError AXUIElementCopyAttributeValues (AXUIElementRef element, CFStringRef attribute, CFIndex index, CFIndex maxValues, CFArrayRef _Nullable * _Nonnull __attribute__((cf_returns_retained)) values); +extern AXError AXUIElementIsAttributeSettable (AXUIElementRef element, CFStringRef attribute, Boolean *settable); +extern AXError AXUIElementSetAttributeValue (AXUIElementRef element, CFStringRef attribute, CFTypeRef value); +extern AXError AXUIElementCopyMultipleAttributeValues (AXUIElementRef element, CFArrayRef attributes, AXCopyMultipleAttributeOptions options, CFArrayRef _Nullable * _Nonnull __attribute__((cf_returns_retained)) values) __attribute__((availability(macosx,introduced=10_4))); +extern AXError AXUIElementCopyParameterizedAttributeNames (AXUIElementRef element, CFArrayRef _Nullable * _Nonnull __attribute__((cf_returns_retained)) names) __attribute__((availability(macosx,introduced=10_3))); +extern AXError AXUIElementCopyParameterizedAttributeValue (AXUIElementRef element, CFStringRef parameterizedAttribute, CFTypeRef parameter, CFTypeRef _Nullable * _Nonnull __attribute__((cf_returns_retained)) result) __attribute__((availability(macosx,introduced=10_3))); +extern AXError AXUIElementCopyActionNames (AXUIElementRef element, CFArrayRef _Nullable * _Nonnull __attribute__((cf_returns_retained)) names); +extern AXError AXUIElementCopyActionDescription (AXUIElementRef element, CFStringRef action, CFStringRef _Nullable * _Nonnull __attribute__((cf_returns_retained)) description); +extern AXError AXUIElementPerformAction (AXUIElementRef element, CFStringRef action); +extern AXError AXUIElementCopyElementAtPosition (AXUIElementRef application, float x,float y, AXUIElementRef _Nullable * _Nonnull __attribute__((cf_returns_retained)) element); +extern AXUIElementRef AXUIElementCreateApplication (pid_t pid); +extern AXUIElementRef AXUIElementCreateSystemWide (void); +extern AXError AXUIElementGetPid (AXUIElementRef element, pid_t *pid); +extern AXError AXUIElementSetMessagingTimeout (AXUIElementRef element, float timeoutInSeconds) __attribute__((availability(macosx,introduced=10_4))); +extern AXError AXUIElementPostKeyboardEvent (AXUIElementRef application, CGCharCode keyChar, CGKeyCode virtualKey, Boolean keyDown) __attribute__((availability(macosx,introduced=10_0,deprecated=10_9,message="" )));; +typedef struct __attribute__((objc_bridge(id))) __AXObserver *AXObserverRef; +typedef void (*AXObserverCallback)(AXObserverRef observer, AXUIElementRef element, CFStringRef notification, void * _Nullable refcon); +typedef void (*AXObserverCallbackWithInfo)(AXObserverRef observer, AXUIElementRef element, CFStringRef notification, CFDictionaryRef info, void * _Nullable refcon); + + + + + + + +CFTypeID AXObserverGetTypeID (void); +extern AXError AXObserverCreate (pid_t application, AXObserverCallback callback, AXObserverRef _Nullable * _Nonnull __attribute__((cf_returns_retained)) outObserver); +extern AXError AXObserverCreateWithInfoCallback (pid_t application, AXObserverCallbackWithInfo callback, AXObserverRef _Nullable * _Nonnull __attribute__((cf_returns_retained)) outObserver); +extern AXError AXObserverAddNotification (AXObserverRef observer, AXUIElementRef element, CFStringRef notification, void * _Nullable refcon); +extern AXError AXObserverRemoveNotification (AXObserverRef observer, AXUIElementRef element, CFStringRef notification); +extern CFRunLoopSourceRef AXObserverGetRunLoopSource (AXObserverRef observer); +typedef UInt32 AXValueType; enum { + kAXValueTypeCGPoint __attribute__((availability(macosx,introduced=10_11))) = 1, + kAXValueTypeCGSize __attribute__((availability(macosx,introduced=10_11))) = 2, + kAXValueTypeCGRect __attribute__((availability(macosx,introduced=10_11))) = 3, + kAXValueTypeCFRange __attribute__((availability(macosx,introduced=10_11))) = 4, + kAXValueTypeAXError __attribute__((availability(macosx,introduced=10_11))) = 5, + kAXValueTypeIllegal __attribute__((availability(macosx,introduced=10_11))) = 0, +}; + + +static const UInt32 kAXValueCGPointType = kAXValueTypeCGPoint; +static const UInt32 kAXValueCGSizeType = kAXValueTypeCGSize; +static const UInt32 kAXValueCGRectType = kAXValueTypeCGRect; +static const UInt32 kAXValueCFRangeType = kAXValueTypeCFRange; +static const UInt32 kAXValueAXErrorType = kAXValueTypeAXError; +static const UInt32 kAXValueIllegalType = kAXValueTypeIllegal; +typedef const struct __attribute__((objc_bridge(id))) __AXValue *AXValueRef; +extern CFTypeID AXValueGetTypeID() __attribute__((availability(macosx,introduced=10.3))); +extern AXValueRef _Nullable AXValueCreate (AXValueType theType, const void *valuePtr); +extern AXValueType AXValueGetType(AXValueRef value); +extern Boolean AXValueGetValue(AXValueRef value, AXValueType theType, void *valuePtr); +extern CFStringRef kAXFontTextAttribute __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CFStringRef kAXForegroundColorTextAttribute __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CFStringRef kAXBackgroundColorTextAttribute __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CFStringRef kAXUnderlineColorTextAttribute __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CFStringRef kAXStrikethroughColorTextAttribute __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CFStringRef kAXUnderlineTextAttribute __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CFStringRef kAXSuperscriptTextAttribute __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CFStringRef kAXStrikethroughTextAttribute __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CFStringRef kAXShadowTextAttribute __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern CFStringRef kAXAttachmentTextAttribute __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CFStringRef kAXLinkTextAttribute __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CFStringRef kAXNaturalLanguageTextAttribute __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CFStringRef kAXReplacementStringTextAttribute __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern CFStringRef kAXMisspelledTextAttribute __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern CFStringRef kAXMarkedMisspelledTextAttribute __attribute__((availability(macosx,introduced=10.9))); + + + + + + +extern CFStringRef kAXAutocorrectedTextAttribute __attribute__((availability(macosx,introduced=10.7))); + + + + + + +extern CFStringRef kAXListItemPrefixTextAttribute __attribute__((availability(macosx,introduced=10.11))); + + + + +extern CFStringRef kAXListItemIndexTextAttribute __attribute__((availability(macosx,introduced=10.11))); + + + + +extern CFStringRef kAXListItemLevelTextAttribute __attribute__((availability(macosx,introduced=10.11))); +extern CFStringRef kAXFontNameKey __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CFStringRef kAXFontFamilyKey __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CFStringRef kAXVisibleNameKey __attribute__((availability(macosx,introduced=10.4))); + + + + +extern CFStringRef kAXFontSizeKey __attribute__((availability(macosx,introduced=10.4))); + + + + + +typedef UInt32 AXUnderlineStyle; enum { + kAXUnderlineStyleNone = 0x0, + kAXUnderlineStyleSingle = 0x1, + kAXUnderlineStyleThick = 0x2, + kAXUnderlineStyleDouble = 0x9 +}; + + + +extern CFStringRef kAXForegoundColorTextAttribute __attribute__((availability(macosx,introduced=10.4))); + + +typedef UInt32 UAZoomChangeFocusType; + + + + + + +enum { + + + + kUAZoomFocusTypeOther = 0, + + + + kUAZoomFocusTypeInsertionPoint = 1 +}; +extern Boolean +UAZoomEnabled(void) __attribute__((availability(macosx,introduced=10.4))); +extern OSStatus +UAZoomChangeFocus( + const CGRect * inRect, + const CGRect * inHighlightRect, + UAZoomChangeFocusType inType) __attribute__((availability(macosx,introduced=10.4))); + + + + +typedef struct __attribute__((objc_bridge(id))) CGImageSource * CGImageSourceRef; + + + +typedef const struct __attribute__((objc_bridge(id))) CGImageMetadata *CGImageMetadataRef; + + + + + + + +extern CFTypeID CGImageMetadataGetTypeID(void); + + + + + + + +typedef struct __attribute__((objc_bridge(id))) CGImageMetadata *CGMutableImageMetadataRef; + + + + + +extern CGMutableImageMetadataRef _Nonnull CGImageMetadataCreateMutable(void) __attribute__((availability(macosx,introduced=10.8))); +extern CGMutableImageMetadataRef _Nullable CGImageMetadataCreateMutableCopy(CGImageMetadataRef _Nonnull metadata) __attribute__((availability(macosx,introduced=10.8))); +typedef struct __attribute__((objc_bridge(id))) CGImageMetadataTag *CGImageMetadataTagRef; + + + + + + + +extern CFTypeID CGImageMetadataTagGetTypeID(void) __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGImageMetadataNamespaceExif __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGImageMetadataNamespaceExifAux __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGImageMetadataNamespaceExifEX __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kCGImageMetadataNamespaceDublinCore __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGImageMetadataNamespaceIPTCCore __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGImageMetadataNamespacePhotoshop __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGImageMetadataNamespaceTIFF __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGImageMetadataNamespaceXMPBasic __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGImageMetadataNamespaceXMPRights __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGImageMetadataPrefixExif __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGImageMetadataPrefixExifAux __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGImageMetadataPrefixExifEX __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kCGImageMetadataPrefixDublinCore __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGImageMetadataPrefixIPTCCore __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGImageMetadataPrefixPhotoshop __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGImageMetadataPrefixTIFF __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGImageMetadataPrefixXMPBasic __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGImageMetadataPrefixXMPRights __attribute__((availability(macosx,introduced=10.8))); +typedef int32_t CGImageMetadataType; enum { + kCGImageMetadataTypeInvalid = -1, + kCGImageMetadataTypeDefault = 0, + kCGImageMetadataTypeString = 1, + kCGImageMetadataTypeArrayUnordered = 2, + kCGImageMetadataTypeArrayOrdered = 3, + kCGImageMetadataTypeAlternateArray = 4, + kCGImageMetadataTypeAlternateText = 5, + kCGImageMetadataTypeStructure = 6 +}; +extern CGImageMetadataTagRef _Nullable CGImageMetadataTagCreate (CFStringRef _Nonnull xmlns, CFStringRef _Nullable prefix, CFStringRef _Nonnull name, CGImageMetadataType type, CFTypeRef _Nonnull value) __attribute__((availability(macosx,introduced=10.8))); +extern CFStringRef _Nullable CGImageMetadataTagCopyNamespace(CGImageMetadataTagRef _Nonnull tag) __attribute__((availability(macosx,introduced=10.8))); + + + + + +extern CFStringRef _Nullable CGImageMetadataTagCopyPrefix(CGImageMetadataTagRef _Nonnull tag) __attribute__((availability(macosx,introduced=10.8))); + + + + + +extern CFStringRef _Nullable CGImageMetadataTagCopyName(CGImageMetadataTagRef _Nonnull tag) __attribute__((availability(macosx,introduced=10.8))); +extern CFTypeRef _Nullable CGImageMetadataTagCopyValue(CGImageMetadataTagRef _Nonnull tag) __attribute__((availability(macosx,introduced=10.8))); + + + + + + + +extern CGImageMetadataType CGImageMetadataTagGetType(CGImageMetadataTagRef _Nonnull tag) __attribute__((availability(macosx,introduced=10.8))); +extern CFArrayRef _Nullable CGImageMetadataTagCopyQualifiers(CGImageMetadataTagRef _Nonnull tag) __attribute__((availability(macosx,introduced=10.8))); +extern CFArrayRef _Nullable CGImageMetadataCopyTags(CGImageMetadataRef _Nonnull metadata) __attribute__((availability(macosx,introduced=10.8))); +extern CGImageMetadataTagRef _Nullable CGImageMetadataCopyTagWithPath(CGImageMetadataRef _Nonnull metadata, CGImageMetadataTagRef _Nullable parent, CFStringRef _Nonnull path) __attribute__((availability(macosx,introduced=10.8))); +extern CFStringRef _Nullable CGImageMetadataCopyStringValueWithPath(CGImageMetadataRef _Nonnull metadata, CGImageMetadataTagRef _Nullable parent, CFStringRef _Nonnull path) __attribute__((availability(macosx,introduced=10.8))); +extern _Bool CGImageMetadataRegisterNamespaceForPrefix(CGMutableImageMetadataRef _Nonnull metadata, CFStringRef _Nonnull xmlns, CFStringRef _Nonnull prefix, _Nullable CFErrorRef * _Nullable err) __attribute__((availability(macosx,introduced=10.8))); +extern _Bool CGImageMetadataSetTagWithPath(CGMutableImageMetadataRef _Nonnull metadata, CGImageMetadataTagRef _Nullable parent, CFStringRef _Nonnull path, CGImageMetadataTagRef _Nonnull tag) __attribute__((availability(macosx,introduced=10.8))); +extern _Bool CGImageMetadataSetValueWithPath(CGMutableImageMetadataRef _Nonnull metadata, CGImageMetadataTagRef _Nullable parent, CFStringRef _Nonnull path, CFTypeRef _Nonnull value) __attribute__((availability(macosx,introduced=10.8))); +extern _Bool CGImageMetadataRemoveTagWithPath(CGMutableImageMetadataRef _Nonnull metadata, CGImageMetadataTagRef _Nullable parent, CFStringRef _Nonnull path) __attribute__((availability(macosx,introduced=10.8))); +typedef _Bool(^CGImageMetadataTagBlock)(CFStringRef _Nonnull path, CGImageMetadataTagRef _Nonnull tag); +extern void CGImageMetadataEnumerateTagsUsingBlock(CGImageMetadataRef _Nonnull metadata, CFStringRef _Nullable rootPath, CFDictionaryRef _Nullable options, CGImageMetadataTagBlock _Nonnull block) __attribute__((availability(macosx,introduced=10.8))); + + + + + + +extern const CFStringRef _Nonnull kCGImageMetadataEnumerateRecursively __attribute__((availability(macosx,introduced=10.8))); +extern CGImageMetadataTagRef _Nullable CGImageMetadataCopyTagMatchingImageProperty(CGImageMetadataRef _Nonnull metadata, CFStringRef _Nonnull dictionaryName, CFStringRef _Nonnull propertyName) __attribute__((availability(macosx,introduced=10.8))); +extern _Bool CGImageMetadataSetValueMatchingImageProperty(CGMutableImageMetadataRef _Nonnull metadata, CFStringRef _Nonnull dictionaryName, CFStringRef _Nonnull propertyName, CFTypeRef _Nonnull value) __attribute__((availability(macosx,introduced=10.8))); +extern CFDataRef _Nullable CGImageMetadataCreateXMPData (CGImageMetadataRef _Nonnull metadata, CFDictionaryRef _Nullable options) __attribute__((availability(macosx,introduced=10.8))); +extern CGImageMetadataRef _Nullable CGImageMetadataCreateFromXMPData (CFDataRef _Nonnull data) __attribute__((availability(macosx,introduced=10.8))); + + + + + + +extern const CFStringRef _Nonnull kCFErrorDomainCGImageMetadata; + + + + + +typedef int32_t CGImageMetadataErrors; enum { + kCGImageMetadataErrorUnknown = 0, + kCGImageMetadataErrorUnsupportedFormat = 1, + kCGImageMetadataErrorBadArgument = 2, + kCGImageMetadataErrorConflictingArguments = 3, + kCGImageMetadataErrorPrefixConflict = 4, +}; + + + +typedef int32_t CGImageSourceStatus; enum { + kCGImageStatusUnexpectedEOF = -5, + kCGImageStatusInvalidData = -4, + kCGImageStatusUnknownType = -3, + kCGImageStatusReadingHeader = -2, + kCGImageStatusIncomplete = -1, + kCGImageStatusComplete = 0 +}; +extern const CFStringRef kCGImageSourceTypeIdentifierHint __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImageSourceShouldCache __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern const CFStringRef kCGImageSourceShouldCacheImmediately __attribute__((availability(macosx,introduced=10.9))); + + + + + + + +extern const CFStringRef kCGImageSourceShouldAllowFloat __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImageSourceCreateThumbnailFromImageIfAbsent __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImageSourceCreateThumbnailFromImageAlways __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern const CFStringRef kCGImageSourceThumbnailMaxPixelSize __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern const CFStringRef kCGImageSourceCreateThumbnailWithTransform __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImageSourceSubsampleFactor __attribute__((availability(macosx,introduced=10.11))); + + + + + + +extern CFTypeID CGImageSourceGetTypeID (void) __attribute__((availability(macosx,introduced=10.4))); + + + +extern CFArrayRef _Nonnull CGImageSourceCopyTypeIdentifiers(void) __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern CGImageSourceRef _Nullable CGImageSourceCreateWithDataProvider(CGDataProviderRef _Nonnull provider, CFDictionaryRef _Nullable options) __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern CGImageSourceRef _Nullable CGImageSourceCreateWithData(CFDataRef _Nonnull data, CFDictionaryRef _Nullable options) __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern CGImageSourceRef _Nullable CGImageSourceCreateWithURL(CFURLRef _Nonnull url, CFDictionaryRef _Nullable options) __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern CFStringRef _Nullable CGImageSourceGetType(CGImageSourceRef _Nonnull isrc) __attribute__((availability(macosx,introduced=10.4))); + + + + +extern size_t CGImageSourceGetCount(CGImageSourceRef _Nonnull isrc) __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern CFDictionaryRef _Nullable CGImageSourceCopyProperties(CGImageSourceRef _Nonnull isrc, CFDictionaryRef _Nullable options) __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern CFDictionaryRef _Nullable CGImageSourceCopyPropertiesAtIndex(CGImageSourceRef _Nonnull isrc, size_t index, CFDictionaryRef _Nullable options) __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern CGImageMetadataRef _Nullable CGImageSourceCopyMetadataAtIndex (CGImageSourceRef _Nonnull isrc, size_t index, CFDictionaryRef _Nullable options) __attribute__((availability(macosx,introduced=10.8))); + + + + + +extern CGImageRef _Nullable CGImageSourceCreateImageAtIndex(CGImageSourceRef _Nonnull isrc, size_t index, CFDictionaryRef _Nullable options) __attribute__((availability(macosx,introduced=10.4))); + + + + +extern void CGImageSourceRemoveCacheAtIndex(CGImageSourceRef _Nonnull isrc, size_t index) __attribute__((availability(macosx,introduced=10.9))); + + + + + + +extern CGImageRef _Nullable CGImageSourceCreateThumbnailAtIndex(CGImageSourceRef _Nonnull isrc, size_t index, CFDictionaryRef _Nullable options) __attribute__((availability(macosx,introduced=10.4))); + + + + + + + +extern CGImageSourceRef _Nonnull CGImageSourceCreateIncremental(CFDictionaryRef _Nullable options) __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern void CGImageSourceUpdateData(CGImageSourceRef _Nonnull isrc, CFDataRef _Nonnull data, _Bool final) __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern void CGImageSourceUpdateDataProvider(CGImageSourceRef _Nonnull isrc, CGDataProviderRef _Nonnull provider, _Bool final) __attribute__((availability(macosx,introduced=10.4))); + + + + + +extern CGImageSourceStatus CGImageSourceGetStatus(CGImageSourceRef _Nonnull isrc) __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern CGImageSourceStatus CGImageSourceGetStatusAtIndex(CGImageSourceRef _Nonnull isrc, size_t index) __attribute__((availability(macosx,introduced=10.4))); + +typedef struct __attribute__((objc_bridge(id))) CGImageDestination * CGImageDestinationRef; +extern const CFStringRef kCGImageDestinationLossyCompressionQuality __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImageDestinationBackgroundColor __attribute__((availability(macosx,introduced=10.4))); + + + + +extern const CFStringRef kCGImageDestinationImageMaxPixelSize __attribute__((availability(macosx,introduced=10.10))); + + + + +extern const CFStringRef kCGImageDestinationEmbedThumbnail __attribute__((availability(macosx,introduced=10.10))); + + + + + + +extern const CFStringRef kCGImageDestinationOptimizeColorForSharing __attribute__((availability(macosx,introduced=10.12))); + + + + + + +extern CFTypeID CGImageDestinationGetTypeID(void) __attribute__((availability(macosx,introduced=10.4))); + + + +extern CFArrayRef _Nonnull CGImageDestinationCopyTypeIdentifiers(void) __attribute__((availability(macosx,introduced=10.4))); +extern CGImageDestinationRef _Nullable CGImageDestinationCreateWithDataConsumer(CGDataConsumerRef _Nonnull consumer, CFStringRef _Nonnull type, size_t count, CFDictionaryRef _Nullable options) __attribute__((availability(macosx,introduced=10.4))); + + + + + + + +extern CGImageDestinationRef _Nullable CGImageDestinationCreateWithData(CFMutableDataRef _Nonnull data, CFStringRef _Nonnull type, size_t count, CFDictionaryRef _Nullable options) __attribute__((availability(macosx,introduced=10.4))); +extern CGImageDestinationRef _Nullable CGImageDestinationCreateWithURL(CFURLRef _Nonnull url, CFStringRef _Nonnull type, size_t count, CFDictionaryRef _Nullable options) __attribute__((availability(macosx,introduced=10.4))); + + + + +extern void CGImageDestinationSetProperties(CGImageDestinationRef _Nonnull idst, CFDictionaryRef _Nullable properties) __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern void CGImageDestinationAddImage(CGImageDestinationRef _Nonnull idst, CGImageRef _Nonnull image, CFDictionaryRef _Nullable properties) __attribute__((availability(macosx,introduced=10.4))); +extern void CGImageDestinationAddImageFromSource(CGImageDestinationRef _Nonnull idst, CGImageSourceRef _Nonnull isrc, size_t index, CFDictionaryRef _Nullable properties) __attribute__((availability(macosx,introduced=10.4))); + + + + + + + +extern _Bool CGImageDestinationFinalize(CGImageDestinationRef _Nonnull idst) __attribute__((availability(macosx,introduced=10.4))); + + + + + + +extern void CGImageDestinationAddImageAndMetadata(CGImageDestinationRef _Nonnull idst, CGImageRef _Nonnull image, CGImageMetadataRef _Nullable metadata, CFDictionaryRef _Nullable options) __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGImageDestinationMetadata __attribute__((availability(macosx,introduced=10.8))); +extern const CFStringRef kCGImageDestinationMergeMetadata __attribute__((availability(macosx,introduced=10.8))); + + + + + + +extern const CFStringRef kCGImageMetadataShouldExcludeXMP __attribute__((availability(macosx,introduced=10.8))); + + + + + + + +extern const CFStringRef kCGImageMetadataShouldExcludeGPS __attribute__((availability(macosx,introduced=10.10))); + + + + + + + +extern const CFStringRef kCGImageDestinationDateTime __attribute__((availability(macosx,introduced=10.8))); + + + + + +extern const CFStringRef kCGImageDestinationOrientation __attribute__((availability(macosx,introduced=10.8))); +extern _Bool CGImageDestinationCopyImageSource(CGImageDestinationRef _Nonnull idst, CGImageSourceRef _Nonnull isrc, CFDictionaryRef _Nullable options, _Nullable CFErrorRef * _Nullable err) __attribute__((availability(macosx,introduced=10.8))); + +extern const CFStringRef kCGImagePropertyTIFFDictionary __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGIFDictionary __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyJFIFDictionary __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifDictionary __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyPNGDictionary __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCDictionary __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSDictionary __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyRawDictionary __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyCIFFDictionary __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyMakerCanonDictionary __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerNikonDictionary __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerMinoltaDictionary __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerFujiDictionary __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerOlympusDictionary __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerPentaxDictionary __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImageProperty8BIMDictionary __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyDNGDictionary __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyExifAuxDictionary __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyOpenEXRDictionary __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kCGImagePropertyMakerAppleDictionary __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kCGImagePropertyFileSize __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyPixelHeight __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyPixelWidth __attribute__((availability(macosx,introduced=10.4))); + + + + +extern const CFStringRef kCGImagePropertyDPIHeight __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyDPIWidth __attribute__((availability(macosx,introduced=10.4))); + + + + +extern const CFStringRef kCGImagePropertyDepth __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyOrientation __attribute__((availability(macosx,introduced=10.4))); + + + + +extern const CFStringRef kCGImagePropertyIsFloat __attribute__((availability(macosx,introduced=10.4))); + + + + +extern const CFStringRef kCGImagePropertyIsIndexed __attribute__((availability(macosx,introduced=10.4))); + + + + +extern const CFStringRef kCGImagePropertyHasAlpha __attribute__((availability(macosx,introduced=10.4))); + + + + +extern const CFStringRef kCGImagePropertyColorModel __attribute__((availability(macosx,introduced=10.4))); + + + + +extern const CFStringRef kCGImagePropertyProfileName __attribute__((availability(macosx,introduced=10.4))); + + + + +extern const CFStringRef kCGImagePropertyColorModelRGB __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyColorModelGray __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyColorModelCMYK __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyColorModelLab __attribute__((availability(macosx,introduced=10.4))); + + + + +extern const CFStringRef kCGImagePropertyTIFFCompression __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyTIFFPhotometricInterpretation __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyTIFFDocumentName __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyTIFFImageDescription __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyTIFFMake __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyTIFFModel __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyTIFFOrientation __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyTIFFXResolution __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyTIFFYResolution __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyTIFFResolutionUnit __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyTIFFSoftware __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyTIFFTransferFunction __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyTIFFDateTime __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyTIFFArtist __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyTIFFHostComputer __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyTIFFCopyright __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyTIFFWhitePoint __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyTIFFPrimaryChromaticities __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyTIFFTileWidth __attribute__((availability(macosx,introduced=10.11))); +extern const CFStringRef kCGImagePropertyTIFFTileLength __attribute__((availability(macosx,introduced=10.11))); + + + +extern const CFStringRef kCGImagePropertyJFIFVersion __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyJFIFXDensity __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyJFIFYDensity __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyJFIFDensityUnit __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyJFIFIsProgressive __attribute__((availability(macosx,introduced=10.4))); + + + + +extern const CFStringRef kCGImagePropertyExifExposureTime __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifFNumber __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifExposureProgram __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifSpectralSensitivity __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifISOSpeedRatings __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifOECF __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifSensitivityType __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kCGImagePropertyExifStandardOutputSensitivity __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kCGImagePropertyExifRecommendedExposureIndex __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kCGImagePropertyExifISOSpeed __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kCGImagePropertyExifISOSpeedLatitudeyyy __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kCGImagePropertyExifISOSpeedLatitudezzz __attribute__((availability(macosx,introduced=10.9))); +extern const CFStringRef kCGImagePropertyExifVersion __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifDateTimeOriginal __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifDateTimeDigitized __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifComponentsConfiguration __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifCompressedBitsPerPixel __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifShutterSpeedValue __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifApertureValue __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifBrightnessValue __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifExposureBiasValue __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifMaxApertureValue __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifSubjectDistance __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifMeteringMode __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifLightSource __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifFlash __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifFocalLength __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifSubjectArea __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifMakerNote __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifUserComment __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifSubsecTime __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifSubsecTimeOriginal __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifSubsecTimeDigitized __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifFlashPixVersion __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifColorSpace __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifPixelXDimension __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifPixelYDimension __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifRelatedSoundFile __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifFlashEnergy __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifSpatialFrequencyResponse __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifFocalPlaneXResolution __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifFocalPlaneYResolution __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifFocalPlaneResolutionUnit __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifSubjectLocation __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifExposureIndex __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifSensingMethod __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifFileSource __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifSceneType __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifCFAPattern __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifCustomRendered __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifExposureMode __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifWhiteBalance __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifDigitalZoomRatio __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifFocalLenIn35mmFilm __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifSceneCaptureType __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifGainControl __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifContrast __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifSaturation __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifSharpness __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifDeviceSettingDescription __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifSubjectDistRange __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifImageUniqueID __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyExifCameraOwnerName __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kCGImagePropertyExifBodySerialNumber __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kCGImagePropertyExifLensSpecification __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kCGImagePropertyExifLensMake __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kCGImagePropertyExifLensModel __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kCGImagePropertyExifLensSerialNumber __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kCGImagePropertyExifGamma __attribute__((availability(macosx,introduced=10.4))); + + +extern const CFStringRef kCGImagePropertyExifSubsecTimeOrginal __attribute__((availability(macosx,introduced=10.4))); + + +extern const CFStringRef kCGImagePropertyExifAuxLensInfo __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyExifAuxLensModel __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyExifAuxSerialNumber __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyExifAuxLensID __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyExifAuxLensSerialNumber __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyExifAuxImageNumber __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyExifAuxFlashCompensation __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyExifAuxOwnerName __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyExifAuxFirmware __attribute__((availability(macosx,introduced=10.5))); + + + +extern const CFStringRef kCGImagePropertyGIFLoopCount __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGIFDelayTime __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGIFImageColorMap __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGIFHasGlobalColorMap __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGIFUnclampedDelayTime __attribute__((availability(macosx,introduced=10.7))); + + + +extern const CFStringRef kCGImagePropertyPNGGamma __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyPNGInterlaceType __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyPNGXPixelsPerMeter __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyPNGYPixelsPerMeter __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyPNGsRGBIntent __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyPNGChromaticities __attribute__((availability(macosx,introduced=10.4))); + +extern const CFStringRef kCGImagePropertyPNGAuthor __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kCGImagePropertyPNGCopyright __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kCGImagePropertyPNGCreationTime __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kCGImagePropertyPNGDescription __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kCGImagePropertyPNGModificationTime __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kCGImagePropertyPNGSoftware __attribute__((availability(macosx,introduced=10.7))); +extern const CFStringRef kCGImagePropertyPNGTitle __attribute__((availability(macosx,introduced=10.7))); + +extern const CFStringRef kCGImagePropertyAPNGLoopCount __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kCGImagePropertyAPNGDelayTime __attribute__((availability(macosx,introduced=10.10))); +extern const CFStringRef kCGImagePropertyAPNGUnclampedDelayTime __attribute__((availability(macosx,introduced=10.10))); + + + +extern const CFStringRef kCGImagePropertyGPSVersion __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSLatitudeRef __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSLatitude __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSLongitudeRef __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSLongitude __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSAltitudeRef __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSAltitude __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSTimeStamp __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSSatellites __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSStatus __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSMeasureMode __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSDOP __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSSpeedRef __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSSpeed __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSTrackRef __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSTrack __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSImgDirectionRef __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSImgDirection __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSMapDatum __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSDestLatitudeRef __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSDestLatitude __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSDestLongitudeRef __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSDestLongitude __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSDestBearingRef __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSDestBearing __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSDestDistanceRef __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSDestDistance __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSProcessingMethod __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSAreaInformation __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSDateStamp __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSDifferental __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyGPSHPositioningError __attribute__((availability(macosx,introduced=10.10))); + + + +extern const CFStringRef kCGImagePropertyIPTCObjectTypeReference __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCObjectAttributeReference __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCObjectName __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCEditStatus __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCEditorialUpdate __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCUrgency __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCSubjectReference __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCCategory __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCSupplementalCategory __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCFixtureIdentifier __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCKeywords __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCContentLocationCode __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCContentLocationName __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCReleaseDate __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCReleaseTime __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCExpirationDate __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCExpirationTime __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCSpecialInstructions __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCActionAdvised __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCReferenceService __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCReferenceDate __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCReferenceNumber __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCDateCreated __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCTimeCreated __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCDigitalCreationDate __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCDigitalCreationTime __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCOriginatingProgram __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCProgramVersion __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCObjectCycle __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCByline __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCBylineTitle __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCCity __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCSubLocation __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCProvinceState __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCCountryPrimaryLocationCode __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCCountryPrimaryLocationName __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCOriginalTransmissionReference __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCHeadline __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCCredit __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCSource __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCCopyrightNotice __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCContact __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCCaptionAbstract __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCWriterEditor __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCImageType __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCImageOrientation __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCLanguageIdentifier __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCStarRating __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImagePropertyIPTCCreatorContactInfo __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kCGImagePropertyIPTCRightsUsageTerms __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kCGImagePropertyIPTCScene __attribute__((availability(macosx,introduced=10.6))); + + + +extern const CFStringRef kCGImagePropertyIPTCContactInfoCity __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kCGImagePropertyIPTCContactInfoCountry __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kCGImagePropertyIPTCContactInfoAddress __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kCGImagePropertyIPTCContactInfoPostalCode __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kCGImagePropertyIPTCContactInfoStateProvince __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kCGImagePropertyIPTCContactInfoEmails __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kCGImagePropertyIPTCContactInfoPhones __attribute__((availability(macosx,introduced=10.6))); +extern const CFStringRef kCGImagePropertyIPTCContactInfoWebURLs __attribute__((availability(macosx,introduced=10.6))); + + + +extern const CFStringRef kCGImageProperty8BIMLayerNames __attribute__((availability(macosx,introduced=10.4))); +extern const CFStringRef kCGImageProperty8BIMVersion __attribute__((availability(macosx,introduced=10.10))); + + + +extern const CFStringRef kCGImagePropertyDNGVersion __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyDNGBackwardVersion __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyDNGUniqueCameraModel __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyDNGLocalizedCameraModel __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyDNGCameraSerialNumber __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyDNGLensInfo __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyDNGBlackLevel __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCGImagePropertyDNGWhiteLevel __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCGImagePropertyDNGCalibrationIlluminant1 __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCGImagePropertyDNGCalibrationIlluminant2 __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCGImagePropertyDNGColorMatrix1 __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCGImagePropertyDNGColorMatrix2 __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCGImagePropertyDNGCameraCalibration1 __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCGImagePropertyDNGCameraCalibration2 __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCGImagePropertyDNGAsShotNeutral __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCGImagePropertyDNGAsShotWhiteXY __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCGImagePropertyDNGBaselineExposure __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCGImagePropertyDNGBaselineNoise __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCGImagePropertyDNGBaselineSharpness __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCGImagePropertyDNGPrivateData __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCGImagePropertyDNGCameraCalibrationSignature __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCGImagePropertyDNGProfileCalibrationSignature __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCGImagePropertyDNGNoiseProfile __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCGImagePropertyDNGWarpRectilinear __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCGImagePropertyDNGWarpFisheye __attribute__((availability(macosx,introduced=10.12))); +extern const CFStringRef kCGImagePropertyDNGFixVignetteRadial __attribute__((availability(macosx,introduced=10.12))); + + + + +extern const CFStringRef kCGImagePropertyCIFFDescription __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyCIFFFirmware __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyCIFFOwnerName __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyCIFFImageName __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyCIFFImageFileName __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyCIFFReleaseMethod __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyCIFFReleaseTiming __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyCIFFRecordID __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyCIFFSelfTimingTime __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyCIFFCameraSerialNumber __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyCIFFImageSerialNumber __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyCIFFContinuousDrive __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyCIFFFocusMode __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyCIFFMeteringMode __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyCIFFShootingMode __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyCIFFLensModel __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyCIFFLensMaxMM __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyCIFFLensMinMM __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyCIFFWhiteBalanceIndex __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyCIFFFlashExposureComp __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyCIFFMeasuredEV __attribute__((availability(macosx,introduced=10.5))); + + + + +extern const CFStringRef kCGImagePropertyMakerNikonISOSetting __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerNikonColorMode __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerNikonQuality __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerNikonWhiteBalanceMode __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerNikonSharpenMode __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerNikonFocusMode __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerNikonFlashSetting __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerNikonISOSelection __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerNikonFlashExposureComp __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerNikonImageAdjustment __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerNikonLensAdapter __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerNikonLensType __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerNikonLensInfo __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerNikonFocusDistance __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerNikonDigitalZoom __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerNikonShootingMode __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerNikonCameraSerialNumber __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerNikonShutterCount __attribute__((availability(macosx,introduced=10.5))); + + + +extern const CFStringRef kCGImagePropertyMakerCanonOwnerName __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerCanonCameraSerialNumber __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerCanonImageSerialNumber __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerCanonFlashExposureComp __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerCanonContinuousDrive __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerCanonLensModel __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerCanonFirmware __attribute__((availability(macosx,introduced=10.5))); +extern const CFStringRef kCGImagePropertyMakerCanonAspectRatioInfo __attribute__((availability(macosx,introduced=10.5))); + + + +extern const CFStringRef kCGImagePropertyOpenEXRAspectRatio __attribute__((availability(macosx,introduced=10.9))); + + + +typedef uint32_t CGImagePropertyOrientation; enum { + kCGImagePropertyOrientationUp = 1, + kCGImagePropertyOrientationUpMirrored, + kCGImagePropertyOrientationDown, + kCGImagePropertyOrientationDownMirrored, + kCGImagePropertyOrientationLeftMirrored, + kCGImagePropertyOrientationRight, + kCGImagePropertyOrientationRightMirrored, + kCGImagePropertyOrientationLeft +}; +extern const CFStringRef kCGImagePropertyPNGCompressionFilter __attribute__((availability(macosx,introduced=10.11))); + + + +enum { + kDictionaryFileType = 'dict', + kDCMDictionaryHeaderSignature = 'dict', + kDCMDictionaryHeaderVersion = 2 +}; + +enum { + kDCMAnyFieldTag = typeWildCard, + kDCMAnyFieldType = typeWildCard +}; + + + + +enum { + keyDCMFieldTag = 'ftag', + keyDCMFieldType = 'ftyp', + keyDCMMaxRecordSize = 'mrsz', + keyDCMFieldAttributes = 'fatr', + keyDCMFieldDefaultData = 'fdef', + keyDCMFieldName = 'fnam', + keyDCMFieldFindMethods = 'ffnd' +}; + + + + +enum { + typeDCMFieldAttributes = 'fatr', + typeDCMFindMethod = 'fmth' +}; + + + + + +enum { + kDCMIndexedFieldMask = 0x00000001, + kDCMRequiredFieldMask = 0x00000002, + kDCMIdentifyFieldMask = 0x00000004, + kDCMFixedSizeFieldMask = 0x00000008, + kDCMHiddenFieldMask = (int)0x80000000 +}; + +typedef OptionBits DCMFieldAttributes; + + + +enum { + pDCMAccessMethod = 'amtd', + pDCMPermission = 'perm', + pDCMListing = 'list', + pDCMMaintenance = 'mtnc', + pDCMLocale = 'locl', + pDCMClass = pClass, + pDCMCopyright = 'info' +}; + + + + +enum { + kDCMReadOnlyDictionary = 0, + kDCMReadWriteDictionary = 1 +}; + + + + +enum { + kDCMAllowListing = 0, + kDCMProhibitListing = 1 +}; + + + + +enum { + kDCMUserDictionaryClass = 0, + kDCMSpecificDictionaryClass = 1, + kDCMBasicDictionaryClass = 2 +}; + + + + +enum { + kDCMFindMethodExactMatch = kAEEquals, + kDCMFindMethodBeginningMatch = kAEBeginsWith, + kDCMFindMethodContainsMatch = kAEContains, + kDCMFindMethodEndingMatch = kAEEndsWith, + kDCMFindMethodForwardTrie = 'ftri', + kDCMFindMethodBackwardTrie = 'btri' +}; + +typedef OSType DCMFindMethod; + + + +enum { + kDCMCanUseFileDictionaryMask = 0x00000001, + kDCMCanUseMemoryDictionaryMask = 0x00000002, + kDCMCanStreamDictionaryMask = 0x00000004, + kDCMCanHaveMultipleIndexMask = 0x00000008, + kDCMCanModifyDictionaryMask = 0x00000010, + kDCMCanCreateDictionaryMask = 0x00000020, + kDCMCanAddDictionaryFieldMask = 0x00000040, + kDCMCanUseTransactionMask = 0x00000080 +}; + +typedef OptionBits DCMAccessMethodFeature; +typedef UInt32 DCMUniqueID; +typedef struct OpaqueDCMObjectID* DCMObjectID; +typedef DCMObjectID DCMAccessMethodID; +typedef DCMObjectID DCMDictionaryID; + +typedef struct OpaqueDCMObjectRef* DCMObjectRef; +typedef DCMObjectRef DCMDictionaryRef; +typedef DCMObjectRef DCMDictionaryStreamRef; + +typedef struct OpaqueDCMObjectIterator* DCMObjectIterator; +typedef DCMObjectIterator DCMAccessMethodIterator; +typedef DCMObjectIterator DCMDictionaryIterator; +typedef struct OpaqueDCMFoundRecordIterator* DCMFoundRecordIterator; + + + +typedef DescType DCMFieldTag; +typedef DescType DCMFieldType; + + + +struct DCMDictionaryHeader { + FourCharCode headerSignature; + UInt32 headerVersion; + UInt32 headerSize; + Str63 accessMethod; +}; +typedef struct DCMDictionaryHeader DCMDictionaryHeader; + + + +typedef Boolean ( * DCMProgressFilterProcPtr)(Boolean determinateProcess, UInt16 percentageComplete, UInt32 callbackUD); +typedef DCMProgressFilterProcPtr DCMProgressFilterUPP; +enum { + kMaxYomiLengthInAppleJapaneseDictionary = 40, + kMaxKanjiLengthInAppleJapaneseDictionary = 64 +}; + + + + +enum { + kDCMJapaneseYomiTag = 'yomi', + kDCMJapaneseHyokiTag = 'hyok', + kDCMJapaneseHinshiTag = 'hins', + kDCMJapaneseWeightTag = 'hind', + kDCMJapanesePhoneticTag = 'hton', + kDCMJapaneseAccentTag = 'acnt', + kDCMJapaneseOnKunReadingTag = 'OnKn', + kDCMJapaneseFukugouInfoTag = 'fuku' +}; + +enum { + kDCMJapaneseYomiType = typeUnicodeText, + kDCMJapaneseHyokiType = typeUnicodeText, + kDCMJapaneseHinshiType = 'hins', + kDCMJapaneseWeightType = typeSInt16, + kDCMJapanesePhoneticType = typeUnicodeText, + kDCMJapaneseAccentType = 'byte', + kDCMJapaneseOnKunReadingType = typeUnicodeText, + kDCMJapaneseFukugouInfoType = 'fuku' +}; + + + + +typedef struct OpaqueLAEnvironmentRef* LAEnvironmentRef; +typedef struct OpaqueLAContextRef* LAContextRef; +typedef AEKeyword LAPropertyKey; +typedef DescType LAPropertyType; + + + +struct LAMorphemeRec { + UInt32 sourceTextLength; + LogicalAddress sourceTextPtr; + UInt32 morphemeTextLength; + LogicalAddress morphemeTextPtr; + UInt32 partOfSpeech; +}; +typedef struct LAMorphemeRec LAMorphemeRec; +struct LAMorphemesArray { + ItemCount morphemesCount; + UInt32 processedTextLength; + UInt32 morphemesTextLength; + LAMorphemeRec morphemes[1]; +}; +typedef struct LAMorphemesArray LAMorphemesArray; +typedef LAMorphemesArray * LAMorphemesArrayPtr; +enum { + kLAMorphemesArrayVersion = 0 +}; + + + + +typedef AERecord LAMorphemeBundle; +typedef AERecord LAMorphemePath; +typedef AERecord LAMorpheme; +typedef AERecord LAHomograph; +enum { + keyAELAMorphemeBundle = 'lmfb', + keyAELAMorphemePath = 'lmfp', + keyAELAMorpheme = 'lmfn', + keyAELAHomograph = 'lmfh' +}; + +enum { + typeLAMorphemeBundle = typeAERecord, + typeLAMorphemePath = typeAERecord, + typeLAMorpheme = typeAEList, + typeLAHomograph = typeAEList +}; + + + + +enum { + keyAEMorphemePartOfSpeechCode = 'lamc', + keyAEMorphemeTextRange = 'lamt' +}; + +enum { + typeAEMorphemePartOfSpeechCode = 'lamc', + typeAEMorphemeTextRange = 'lamt' +}; + +typedef UInt32 MorphemePartOfSpeech; +struct MorphemeTextRange { + UInt32 sourceOffset; + UInt32 length; +}; +typedef struct MorphemeTextRange MorphemeTextRange; + + + +enum { + kLAEndOfSourceTextMask = 0x00000001 +}; + + + + +enum { + kLADefaultEdge = 0, + kLAFreeEdge = 1, + kLAIncompleteEdge = 2 +}; + + + + +enum { + kLAAllMorphemes = 0 +}; +enum { + kAppleJapaneseDictionarySignature = 'jlan' +}; + + + + +enum { + kMaxInputLengthOfAppleJapaneseEngine = 200 +}; + + + + + +typedef MorphemePartOfSpeech JapanesePartOfSpeech; +typedef UInt16 HomographWeight; +typedef UInt8 HomographAccent; + + + +enum { + keyAEHomographDicInfo = 'lahd', + keyAEHomographWeight = 'lahw', + keyAEHomographAccent = 'laha' +}; + +enum { + typeAEHomographDicInfo = 'lahd', + typeAEHomographWeight = typeSInt16, + typeAEHomographAccent = 'laha' +}; + + + + +struct HomographDicInfoRec { + DCMDictionaryID dictionaryID; + DCMUniqueID uniqueID; +}; +typedef struct HomographDicInfoRec HomographDicInfoRec; +enum { + kLASpeechRoughClassMask = 0x0000F000, + kLASpeechMediumClassMask = 0x0000FF00, + kLASpeechStrictClassMask = 0x0000FFF0, + kLASpeechKatsuyouMask = 0x0000000F +}; + + + + + +enum { + kLASpeechMeishi = 0x00000000, + kLASpeechFutsuuMeishi = 0x00000000, + kLASpeechJinmei = 0x00000100, + kLASpeechJinmeiSei = 0x00000110, + kLASpeechJinmeiMei = 0x00000120, + kLASpeechChimei = 0x00000200, + kLASpeechSetsubiChimei = 0x00000210, + kLASpeechSoshikimei = 0x00000300, + kLASpeechKoyuuMeishi = 0x00000400, + kLASpeechSahenMeishi = 0x00000500, + kLASpeechKeidouMeishi = 0x00000600, + kLASpeechRentaishi = 0x00001000, + kLASpeechFukushi = 0x00002000, + kLASpeechSetsuzokushi = 0x00003000, + kLASpeechKandoushi = 0x00004000, + kLASpeechDoushi = 0x00005000, + kLASpeechGodanDoushi = 0x00005000, + kLASpeechKagyouGodan = 0x00005000, + kLASpeechSagyouGodan = 0x00005010, + kLASpeechTagyouGodan = 0x00005020, + kLASpeechNagyouGodan = 0x00005030, + kLASpeechMagyouGodan = 0x00005040, + kLASpeechRagyouGodan = 0x00005050, + kLASpeechWagyouGodan = 0x00005060, + kLASpeechGagyouGodan = 0x00005070, + kLASpeechBagyouGodan = 0x00005080, + kLASpeechIchidanDoushi = 0x00005100, + kLASpeechKahenDoushi = 0x00005200, + kLASpeechSahenDoushi = 0x00005300, + kLASpeechZahenDoushi = 0x00005400, + kLASpeechKeiyoushi = 0x00006000, + kLASpeechKeiyoudoushi = 0x00007000, + kLASpeechSettougo = 0x00008000, + kLASpeechSuujiSettougo = 0x00008100, + kLASpeechSetsubigo = 0x00009000, + kLASpeechJinmeiSetsubigo = 0x00009100, + kLASpeechChimeiSetsubigo = 0x00009200, + kLASpeechSoshikimeiSetsubigo = 0x00009300, + kLASpeechSuujiSetsubigo = 0x00009400, + kLASpeechMuhinshi = 0x0000A000, + kLASpeechTankanji = 0x0000A000, + kLASpeechKigou = 0x0000A100, + kLASpeechKuten = 0x0000A110, + kLASpeechTouten = 0x0000A120, + kLASpeechSuushi = 0x0000A200, + kLASpeechDokuritsugo = 0x0000A300, + kLASpeechSeiku = 0x0000A400, + kLASpeechJodoushi = 0x0000B000, + kLASpeechJoshi = 0x0000C000 +}; + + + + + +enum { + kLASpeechKatsuyouGokan = 0x00000001, + kLASpeechKatsuyouMizen = 0x00000002, + kLASpeechKatsuyouRenyou = 0x00000003, + kLASpeechKatsuyouSyuushi = 0x00000004, + kLASpeechKatsuyouRentai = 0x00000005, + kLASpeechKatsuyouKatei = 0x00000006, + kLASpeechKatsuyouMeirei = 0x00000007 +}; + + + + + + +typedef const void * PMObject; +typedef struct OpaquePMPrintSettings* PMPrintSettings; +typedef struct OpaquePMPageFormat* PMPageFormat; +typedef struct OpaquePMPrintSession* PMPrintSession; +typedef struct OpaquePMPrinter* PMPrinter; +typedef struct OpaquePMServer* PMServer; +typedef struct OpaquePMPreset* PMPreset; +typedef struct OpaquePMPaper* PMPaper; +enum { + kPMCancel = 0x0080 +}; +typedef UInt16 PMDestinationType; +enum { + kPMDestinationInvalid = 0, + kPMDestinationPrinter = 1, + kPMDestinationFile = 2, + kPMDestinationFax = 3, + kPMDestinationPreview = 4, + kPMDestinationProcessPDF = 5 +}; + + + +typedef UInt16 PMOrientation; +enum { + kPMPortrait = 1, + kPMLandscape = 2, + kPMReversePortrait = 3, + kPMReverseLandscape = 4 +}; + + +typedef UInt16 PMPrinterState; +enum { + kPMPrinterIdle = 3, + kPMPrinterProcessing = 4, + kPMPrinterStopped = 5 +}; + +typedef UInt32 PMColorSpaceModel; +enum { + kPMUnknownColorSpaceModel = 0, + kPMGrayColorSpaceModel = 1, + kPMRGBColorSpaceModel = 2, + kPMCMYKColorSpaceModel = 3, + kPMDevNColorSpaceModel = 4 +}; + + + + +typedef UInt32 PMQualityMode; +enum { + kPMQualityLowest = 0x0000, + kPMQualityInkSaver = 0x0001, + kPMQualityDraft = 0x0004, + kPMQualityNormal = 0x0008, + kPMQualityPhoto = 0x000B, + kPMQualityBest = 0x000D, + kPMQualityHighest = 0x000F +}; + + + +typedef UInt32 PMPaperType; +enum { + kPMPaperTypeUnknown = 0x0000, + kPMPaperTypePlain = 0x0001, + kPMPaperTypeCoated = 0x0002, + kPMPaperTypePremium = 0x0003, + kPMPaperTypeGlossy = 0x0004, + kPMPaperTypeTransparency = 0x0005, + kPMPaperTypeTShirt = 0x0006 +}; + + +typedef UInt16 PMScalingAlignment; +enum { + kPMScalingPinTopLeft = 1, + kPMScalingPinTopRight = 2, + kPMScalingPinBottomLeft = 3, + kPMScalingPinBottomRight = 4, + kPMScalingCenterOnPaper = 5, + kPMScalingCenterOnImgArea = 6 +}; + + +typedef UInt32 PMDuplexMode; +enum { + kPMDuplexNone = 0x0001, + kPMDuplexNoTumble = 0x0002, + kPMDuplexTumble = 0x0003, + kPMSimplexTumble = 0x0004 +}; + + +typedef UInt16 PMLayoutDirection; +enum { + + kPMLayoutLeftRightTopBottom = 1, + kPMLayoutLeftRightBottomTop = 2, + kPMLayoutRightLeftTopBottom = 3, + kPMLayoutRightLeftBottomTop = 4, + kPMLayoutTopBottomLeftRight = 5, + kPMLayoutTopBottomRightLeft = 6, + kPMLayoutBottomTopLeftRight = 7, + kPMLayoutBottomTopRightLeft = 8 +}; + + +typedef UInt16 PMBorderType; +enum { + kPMBorderSingleHairline = 1, + kPMBorderDoubleHairline = 2, + kPMBorderSingleThickline = 3, + kPMBorderDoubleThickline = 4 +}; + + + + + +typedef OptionBits PMPrintDialogOptionFlags; +enum { + kPMHideInlineItems = (0L << 0), + kPMShowDefaultInlineItems = (1L << 15), + kPMShowInlineCopies = (1L << 0), + kPMShowInlinePageRange = (1L << 1), + kPMShowInlinePageRangeWithSelection = (1L << 6), + kPMShowInlinePaperSize = (1L << 2), + kPMShowInlineOrientation = (1L << 3), + kPMShowInlineScale = (1L << 7), + kPMShowPageAttributesPDE = (1L << 8), +}; + +typedef UInt16 PMPPDDomain; +enum { + kAllPPDDomains = 1, + kSystemPPDDomain = 2, + kLocalPPDDomain = 3, + kNetworkPPDDomain = 4, + kUserPPDDomain = 5, + kCUPSPPDDomain = 6 +}; +enum { + kPMNoError = noErr, + kPMGeneralError = -30870, + kPMOutOfScope = -30871, + kPMInvalidParameter = paramErr, + kPMNoDefaultPrinter = -30872, + kPMNotImplemented = -30873, + kPMNoSuchEntry = -30874, + kPMInvalidPrintSettings = -30875, + kPMInvalidPageFormat = -30876, + kPMValueOutOfRange = -30877, + kPMLockIgnored = -30878 +}; + +enum { + kPMInvalidPrintSession = -30879, + kPMInvalidPrinter = -30880, + kPMObjectInUse = -30881, + kPMInvalidPreset = -30899 +}; + + +enum { + kPMPrintAllPages = -1 +}; + +enum { + kPMUnlocked = 0 +}; + +struct PMRect { + double top; + double left; + double bottom; + double right; +}; +typedef struct PMRect PMRect; +struct PMResolution { + double hRes; + double vRes; +}; +typedef struct PMResolution PMResolution; +struct PMLanguageInfo { + Str32 level; + Str32 version; + Str32 release; +}; +typedef struct PMLanguageInfo PMLanguageInfo; + +typedef PMRect PMPaperMargins; +enum PMDataFormat { + kPMDataFormatXMLDefault = 0, + kPMDataFormatXMLMinimal = 1, + kPMDataFormatXMLCompressed = 2 +}; +typedef enum PMDataFormat PMDataFormat; + + + +extern OSStatus +PMRetain(PMObject _Nullable object) ; +extern OSStatus +PMRelease(PMObject _Nullable object) ; +extern OSStatus +PMCreateSession(_Nonnull PMPrintSession* _Nonnull printSession) ; +extern OSStatus +PMSessionError(PMPrintSession printSession) ; +extern OSStatus +PMSessionSetError( + PMPrintSession printSession, + OSStatus printError) ; +extern OSStatus +PMSessionBeginCGDocumentNoDialog( + PMPrintSession printSession, + PMPrintSettings printSettings, + PMPageFormat pageFormat) __attribute__((availability(macosx,introduced=10.4))); +extern OSStatus +PMSessionEndDocumentNoDialog(PMPrintSession printSession) ; +extern OSStatus +PMSessionBeginPageNoDialog( + PMPrintSession printSession, + PMPageFormat _Nullable pageFormat, + const PMRect * _Nullable pageFrame) ; +extern OSStatus +PMSessionEndPageNoDialog(PMPrintSession printSession) ; +extern OSStatus +PMSessionGetCGGraphicsContext( + PMPrintSession printSession, + CGContextRef _Nullable * _Nonnull context) __attribute__((availability(macosx,introduced=10.4))); +extern OSStatus +PMSessionGetDestinationType( + PMPrintSession printSession, + PMPrintSettings printSettings, + PMDestinationType * destTypeP) __attribute__((availability(macosx,introduced=10.1))); +extern OSStatus +PMSessionCopyDestinationFormat( + PMPrintSession printSession, + PMPrintSettings printSettings, + CFStringRef _Nullable * _Nonnull destFormatP) __attribute__((availability(macosx,introduced=10.1))); +extern OSStatus +PMSessionCopyDestinationLocation( + PMPrintSession printSession, + PMPrintSettings printSettings, + CFURLRef _Nullable * _Nonnull destLocationP) __attribute__((availability(macosx,introduced=10.1))); +extern OSStatus +PMSessionSetDestination( + PMPrintSession printSession, + PMPrintSettings printSettings, + PMDestinationType destType, + CFStringRef _Nullable destFormat, + CFURLRef _Nullable destLocation) __attribute__((availability(macosx,introduced=10.1))); +extern OSStatus +PMSessionCopyOutputFormatList( + PMPrintSession printSession, + PMDestinationType destType, + CFArrayRef _Nullable * _Nonnull documentFormatP) __attribute__((availability(macosx,introduced=10.1))); +extern OSStatus +PMSessionCreatePageFormatList( + PMPrintSession printSession, + PMPrinter _Nullable printer, + CFArrayRef _Nullable * _Nonnull pageFormatList) __attribute__((availability(macosx,introduced=10.1))); +extern OSStatus +PMSessionCreatePrinterList( + PMPrintSession printSession, + CFArrayRef _Nonnull * _Nonnull printerList, + CFIndex * _Nullable currentIndex, + PMPrinter _Nonnull * _Nullable currentPrinter) __attribute__((availability(macosx,introduced=10.1))); +extern OSStatus +PMSessionGetCurrentPrinter( + PMPrintSession printSession, + PMPrinter _Nonnull * _Nonnull currentPrinter) ; +extern OSStatus +PMSessionSetCurrentPMPrinter( + PMPrintSession session, + PMPrinter printer) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PMSessionGetDataFromSession( + PMPrintSession printSession, + CFStringRef key, + CFTypeRef _Nullable * _Nonnull data) ; +extern OSStatus +PMSessionSetDataInSession( + PMPrintSession printSession, + CFStringRef key, + CFTypeRef data) ; +extern OSStatus +PMCreatePageFormat(PMPageFormat _Nonnull * _Nonnull pageFormat) ; +extern OSStatus +PMSessionDefaultPageFormat( + PMPrintSession printSession, + PMPageFormat pageFormat) ; +extern OSStatus +PMSessionValidatePageFormat( + PMPrintSession printSession, + PMPageFormat pageFormat, + Boolean * _Nullable changed) ; +extern OSStatus +PMCopyPageFormat( + PMPageFormat formatSrc, + PMPageFormat formatDest) ; +extern OSStatus +PMCreatePageFormatWithPMPaper( + PMPageFormat _Nonnull * _Nonnull pageFormat, + PMPaper paper) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PMPageFormatCreateDataRepresentation( + PMPageFormat pageFormat, + CFDataRef _Nonnull * _Nonnull data, + PMDataFormat format) __attribute__((availability(macosx,introduced=10.5))); +extern OSStatus +PMPageFormatCreateWithDataRepresentation( + CFDataRef data, + PMPageFormat _Nonnull * _Nonnull pageFormat) __attribute__((availability(macosx,introduced=10.5))); +extern OSStatus +PMGetAdjustedPageRect( + PMPageFormat pageFormat, + PMRect * pageRect) ; +extern OSStatus +PMGetAdjustedPaperRect( + PMPageFormat pageFormat, + PMRect * paperRect) ; +extern OSStatus +PMGetOrientation( + PMPageFormat pageFormat, + PMOrientation * orientation) ; +extern OSStatus +PMGetPageFormatExtendedData( + PMPageFormat pageFormat, + OSType dataID, + UInt32 * _Nullable size, + void * _Nullable extendedData) ; +extern OSStatus +PMPageFormatGetPrinterID( + PMPageFormat pageFormat, + CFStringRef _Nullable * _Nonnull printerID ) __attribute__((availability(macosx,introduced=10.5))); +extern OSStatus +PMGetScale( + PMPageFormat pageFormat, + double * scale) ; +extern OSStatus +PMGetUnadjustedPageRect( + PMPageFormat pageFormat, + PMRect * pageRect) ; +extern OSStatus +PMGetUnadjustedPaperRect( + PMPageFormat pageFormat, + PMRect * paperRect) ; +extern OSStatus +PMSetOrientation( + PMPageFormat pageFormat, + PMOrientation orientation, + Boolean lock) ; +extern OSStatus +PMSetPageFormatExtendedData( + PMPageFormat pageFormat, + OSType dataID, + UInt32 size, + void * extendedData) ; +extern OSStatus +PMSetScale( + PMPageFormat pageFormat, + double scale) ; +extern OSStatus +PMCreatePrintSettings( + PMPrintSettings _Nonnull * _Nonnull printSettings) ; +extern OSStatus +PMSessionDefaultPrintSettings( + PMPrintSession printSession, + PMPrintSettings printSettings) ; +extern OSStatus +PMSessionValidatePrintSettings( + PMPrintSession printSession, + PMPrintSettings printSettings, + Boolean * _Nullable changed) ; +extern OSStatus +PMCopyPrintSettings( + PMPrintSettings settingSrc, + PMPrintSettings settingDest) ; +extern OSStatus +PMPrintSettingsCreateDataRepresentation( + PMPrintSettings printSettings, + CFDataRef _Nonnull * _Nonnull data, + PMDataFormat format) __attribute__((availability(macosx,introduced=10.5))); +extern OSStatus +PMPrintSettingsCreateWithDataRepresentation( + CFDataRef data, + PMPrintSettings _Nonnull * _Nonnull printSettings) __attribute__((availability(macosx,introduced=10.5))); +extern OSStatus +PMGetCollate( + PMPrintSettings printSettings, + Boolean * collate) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +PMGetCopies( + PMPrintSettings printSettings, + UInt32 * copies) ; +extern OSStatus +PMGetDuplex( + PMPrintSettings printSettings, + PMDuplexMode * duplexSetting) __attribute__((availability(macosx,introduced=10.4))); +extern OSStatus +PMGetFirstPage( + PMPrintSettings printSettings, + UInt32 * first) ; +extern OSStatus +PMGetLastPage( + PMPrintSettings printSettings, + UInt32 * last) ; +extern OSStatus +PMGetPageRange( + PMPrintSettings printSettings, + UInt32 * minPage, + UInt32 * maxPage) ; +extern OSStatus +PMPrintSettingsGetJobName( + PMPrintSettings printSettings, + CFStringRef _Nullable * _Nonnull name) __attribute__((availability(macosx,introduced=10.4))); +extern OSStatus +PMPrintSettingsGetValue( + PMPrintSettings printSettings, + CFStringRef key, + CFTypeRef _Nullable * _Nonnull value) __attribute__((availability(macosx,introduced=10.4))); +extern OSStatus +PMSetCollate( + PMPrintSettings printSettings, + Boolean collate) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +PMSetCopies( + PMPrintSettings printSettings, + UInt32 copies, + Boolean lock) ; +extern OSStatus +PMSetDuplex( + PMPrintSettings printSettings, + PMDuplexMode duplexSetting) __attribute__((availability(macosx,introduced=10.4))); +extern OSStatus +PMSetFirstPage( + PMPrintSettings printSettings, + UInt32 first, + Boolean lock) ; +extern OSStatus +PMSetLastPage( + PMPrintSettings printSettings, + UInt32 last, + Boolean lock) ; +extern OSStatus +PMSetPageRange( + PMPrintSettings printSettings, + UInt32 minPage, + UInt32 maxPage) ; +extern OSStatus +PMPrintSettingsSetJobName( + PMPrintSettings printSettings, + CFStringRef name) __attribute__((availability(macosx,introduced=10.4))); +extern OSStatus +PMPrintSettingsSetValue( + PMPrintSettings printSettings, + CFStringRef key, + CFTypeRef _Nullable value, + Boolean locked) __attribute__((availability(macosx,introduced=10.4))); +extern OSStatus +PMPrintSettingsCopyAsDictionary( + PMPrintSettings printSettings, + CFDictionaryRef _Nullable * _Nonnull settingsDictionary) __attribute__((availability(macosx,introduced=10.5))); +extern OSStatus +PMPrintSettingsCopyKeys( + PMPrintSettings printSettings, + CFArrayRef _Nullable * _Nonnull settingsKeys) __attribute__((availability(macosx,introduced=10.5))); +extern OSStatus +PMCreateGenericPrinter( + PMPrinter _Nonnull * _Nonnull printer) __attribute__((availability(macosx,introduced=10.5))); +extern OSStatus +PMServerCreatePrinterList( + PMServer _Nullable server, + CFArrayRef _Nullable * _Nonnull printerList) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +PMServerLaunchPrinterBrowser( + PMServer _Nullable server, + CFDictionaryRef _Nullable options) __attribute__((availability(macosx,introduced=10.5))); +extern PMPrinter _Nullable +PMPrinterCreateFromPrinterID(CFStringRef printerID) __attribute__((availability(macosx,introduced=10.4))); +extern OSStatus +PMPrinterCopyDescriptionURL( + PMPrinter printer, + CFStringRef descriptionType, + CFURLRef _Nullable * _Nonnull fileURL) __attribute__((availability(macosx,introduced=10.4))); +extern OSStatus +PMPrinterCopyDeviceURI( + PMPrinter printer, + CFURLRef _Nullable * _Nonnull deviceURI) __attribute__((availability(macosx,introduced=10.4))); +extern OSStatus +PMPrinterCopyHostName( + PMPrinter printer, + CFStringRef _Nonnull * _Nonnull hostNameP) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PMPrinterCopyPresets( + PMPrinter printer, + CFArrayRef _Nullable * _Nonnull presetList) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PMPrinterGetCommInfo( + PMPrinter printer, + Boolean * _Nullable supportsControlCharRangeP, + Boolean * _Nullable supportsEightBitP) __attribute__((availability(macosx,introduced=10.3))); +extern CFStringRef _Nullable +PMPrinterGetID(PMPrinter printer) __attribute__((availability(macosx,introduced=10.2))); +extern CFStringRef _Nullable +PMPrinterGetLocation(PMPrinter printer) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +PMPrinterGetDriverCreator( + PMPrinter printer, + OSType * creator) ; +extern OSStatus +PMPrinterGetDriverReleaseInfo( + PMPrinter printer, + VersRec * release) ; +extern OSStatus +PMPrinterGetPrinterResolutionCount( + PMPrinter printer, + UInt32 * countP) ; +extern OSStatus +PMPrinterGetIndexedPrinterResolution( + PMPrinter printer, + UInt32 index, + PMResolution * resolutionP) ; +OSStatus PMPrinterGetOutputResolution( + PMPrinter printer, + PMPrintSettings printSettings, + PMResolution *resolutionP) __attribute__((availability(macosx,introduced=10.5))); +OSStatus PMPrinterSetOutputResolution( + PMPrinter printer, + PMPrintSettings printSettings, + const PMResolution *resolutionP) __attribute__((availability(macosx,introduced=10.5))); +extern OSStatus +PMPrinterGetLanguageInfo( + PMPrinter printer, + PMLanguageInfo * info) ; +extern OSStatus +PMPrinterGetMakeAndModelName( + PMPrinter printer, + CFStringRef _Nullable * _Nonnull makeAndModel) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +PMPrinterGetMimeTypes( + PMPrinter printer, + PMPrintSettings _Nullable settings, + CFArrayRef _Nullable * _Nonnull mimeTypes) __attribute__((availability(macosx,introduced=10.3))); +extern CFStringRef _Nullable +PMPrinterGetName(PMPrinter printer) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +PMPrinterGetPaperList( + PMPrinter printer, + CFArrayRef _Nullable * _Nonnull paperList) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PMPrinterGetState( + PMPrinter printer, + PMPrinterState * state) __attribute__((availability(macosx,introduced=10.2))); +extern Boolean +PMPrinterIsDefault(PMPrinter printer) __attribute__((availability(macosx,introduced=10.2))); +extern Boolean +PMPrinterIsFavorite(PMPrinter printer) __attribute__((availability(macosx,introduced=10.2))); +extern Boolean +PMPrinterIsPostScriptCapable(PMPrinter printer) __attribute__((availability(macosx,introduced=10.2))); +extern OSStatus +PMPrinterIsPostScriptPrinter(PMPrinter printer, Boolean *isPSPrinter) __attribute__((availability(macosx,introduced=10.5))); +extern OSStatus +PMPrinterIsRemote( + PMPrinter printer, + Boolean * isRemoteP) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus PMPrinterSetDefault(PMPrinter printer) __attribute__((availability(macosx,introduced=10.5))); +extern OSStatus +PMPresetCopyName( + PMPreset preset, + CFStringRef _Nullable * _Nonnull name) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PMPresetCreatePrintSettings( + PMPreset preset, + PMPrintSession session, + PMPrintSettings _Nonnull * _Nonnull printSettings) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PMPresetGetAttributes( + PMPreset preset, + CFDictionaryRef _Nullable * _Nonnull attributes) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PMGetPageFormatPaper( + PMPageFormat format, + PMPaper _Nonnull * _Nonnull paper) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PMPaperCreateCustom( + PMPrinter _Nullable printer, + CFStringRef _Nullable id, + CFStringRef _Nullable name, + double width, + double height, + const PMPaperMargins * margins, + PMPaper _Nullable * _Nonnull paperP) __attribute__((availability(macosx,introduced=10.5))); +extern OSStatus +PMPaperGetWidth( + PMPaper paper, + double * paperWidth) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PMPaperGetHeight( + PMPaper paper, + double * paperHeight) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PMPaperGetMargins( + PMPaper paper, + PMPaperMargins * paperMargins) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PMPaperGetID( + PMPaper paper, + CFStringRef _Nonnull * _Nonnull paperID) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PMPaperGetPPDPaperName( + PMPaper paper, + CFStringRef _Nullable * _Nonnull paperName) __attribute__((availability(macosx,introduced=10.5))); +extern OSStatus +PMPaperCreateLocalizedName( + PMPaper paper, + PMPrinter printer, + CFStringRef _Nullable * _Nonnull paperName) __attribute__((availability(macosx,introduced=10.5))); +extern OSStatus +PMPaperGetPrinterID( + PMPaper paper, + CFStringRef _Nullable * _Nonnull printerID) __attribute__((availability(macosx,introduced=10.5))); +extern Boolean +PMPaperIsCustom(PMPaper paper ) __attribute__((availability(macosx,introduced=10.5))); +extern OSStatus +PMWorkflowCopyItems( + CFArrayRef _Nullable * _Nonnull workflowItems) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PMWorkflowSubmitPDFWithOptions( + CFURLRef workflowItem, + CFStringRef _Nullable title, + const char* _Nullable options, + CFURLRef pdfFile) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PMWorkflowSubmitPDFWithSettings( + CFURLRef workflowItem, + PMPrintSettings settings, + CFURLRef pdfFile) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PMPrinterPrintWithProvider( + PMPrinter printer, + PMPrintSettings settings, + PMPageFormat _Nullable format, + CFStringRef mimeType, + CGDataProviderRef provider) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PMPrinterPrintWithFile( + PMPrinter printer, + PMPrintSettings settings, + PMPageFormat _Nullable format, + CFStringRef _Nullable mimeType, + CFURLRef fileURL) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PMPrinterWritePostScriptToURL( + PMPrinter printer, + PMPrintSettings settings, + PMPageFormat _Nullable format, + CFStringRef _Nullable mimeType, + CFURLRef sourceFileURL, + CFURLRef destinationFileURL) __attribute__((availability(macosx,introduced=10.5))); +extern OSStatus +PMPrintSettingsToOptions( + PMPrintSettings settings, + char* _Nullable * _Nonnull options) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PMPrintSettingsToOptionsWithPrinterAndPageFormat( + PMPrintSettings settings, + PMPrinter printer, + PMPageFormat _Nullable pageFormat, + char* _Nullable * _Nonnull options) __attribute__((availability(macosx,introduced=10.5))); +extern OSStatus +PMPrinterSendCommand( + PMPrinter printer, + CFStringRef commandString, + CFStringRef _Nullable jobTitle, + CFDictionaryRef _Nullable options) __attribute__((availability(macosx,introduced=10.6))); +extern OSStatus +PMPrinterCopyState( + PMPrinter printer, + CFDictionaryRef _Nonnull * _Nonnull stateDict) __attribute__((availability(macosx,introduced=10.6))); +extern OSStatus +PMCopyAvailablePPDs( + PMPPDDomain domain, + CFArrayRef _Nullable * _Nonnull ppds) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PMCopyLocalizedPPD( + CFURLRef ppd, + CFURLRef _Nullable * _Nonnull localizedPPD) __attribute__((availability(macosx,introduced=10.3))); +extern OSStatus +PMCopyPPDData( + CFURLRef ppd, + CFDataRef _Nullable * _Nonnull data) __attribute__((availability(macosx,introduced=10.3))); +extern CGImageRef _Nullable +PMCGImageCreateWithEPSDataProvider( + CGDataProviderRef _Nullable epsDataProvider, + CGImageRef epsPreview) __attribute__((availability(macosx,introduced=10.1))); + + + + + + +enum { + kPMCoverPageNone = 1, + + kPMCoverPageBefore = 2, + + kPMCoverPageAfter = 3 +}; +typedef enum{ + kPMPageToPaperMappingNone = 1, + kPMPageToPaperMappingScaleToFit, +}PMPageToPaperMappingType; + + + +enum { + kPMAllocationFailure = memFullErr, + kPMInternalError = kPMGeneralError, + + kPMInvalidIndex = -30882, + kPMStringConversionFailure = -30883, + kPMXMLParseError = -30884, + + kPMInvalidJobTemplate = -30885, + kPMInvalidPrinterInfo = -30886, + kPMInvalidConnection = -30887, + kPMInvalidKey = -30888, + kPMInvalidValue = -30889, + kPMInvalidAllocator = -30890, + kPMInvalidTicket = -30891, + kPMInvalidItem = -30892, + kPMInvalidType = -30893, + kPMInvalidReply = -30894, + kPMInvalidFileType = -30895, + kPMInvalidObject = -30896, + kPMInvalidPaper = -30897, + kPMInvalidCalibrationTarget = -30898, + + + kPMNoDefaultItem = -9500, + kPMNoDefaultSettings = -9501, + kPMInvalidPDEContext = -9530, + kPMDontSwitchPDEError = -9531, + kPMUnableToFindProcess = -9532, + kPMFeatureNotInstalled = -9533, + + + kPMInvalidPBMRef = -9540, + kPMNoSelectedPrinters = -9541, + kPMInvalidLookupSpec = -9542, + kPMSyncRequestFailed = -9543, + kPMEditRequestFailed = -9544, + kPMPrBrowserNoUI = -9545, + + + kPMTicketTypeNotFound = -9580, + kPMUpdateTicketFailed = -9581, + kPMValidateTicketFailed = -9582, + kPMSubTicketNotFound = -9583, + kPMInvalidSubTicket = -9584, + kPMDeleteSubTicketFailed = -9585, + kPMItemIsLocked = -9586, + kPMTicketIsLocked = -9587, + kPMTemplateIsLocked = -9588, + kPMKeyNotFound = -9589, + kPMKeyNotUnique = -9590, + kPMUnknownDataType = -9591, + + + kPMCreateMessageFailed = -9620, + kPMServerCommunicationFailed = -9621, + kPMKeyOrValueNotFound = -9623, + kPMMessagingError = -9624, + + + kPMServerNotFound = -9630, + kPMServerAlreadyRunning = -9631, + kPMServerSuspended = -9632, + kPMServerAttributeRestricted = -9633, + kPMFileOrDirOperationFailed = -9634, + kPMUserOrGroupNotFound = -9635, + kPMPermissionError = -9636, + kPMUnknownMessage = -9637, + kPMQueueNotFound = -9638, + kPMQueueAlreadyExists = -9639, + kPMQueueJobFailed = -9640, + kPMJobNotFound = -9641, + kPMJobBusy = -9642, + kPMJobCanceled = -9643, + kPMDocumentNotFound = -9644, + + + kPMPMSymbolNotFound = -9660, + kPMIOMSymbolNotFound = -9661, + kPMCVMSymbolNotFound = -9662, + kPMInvalidPMContext = -9663, + kPMInvalidIOMContext = -9664, + kPMInvalidCVMContext = -9665, + kPMInvalidJobID = -9666, + kPMNoPrinterJobID = -9667, + kPMJobStreamOpenFailed = -9668, + kPMJobStreamReadFailed = -9669, + kPMJobStreamEndError = -9670, + kPMJobManagerAborted = -9671, + kPMJobGetTicketBadFormatError = -9672, + kPMJobGetTicketReadError = -9673, + + + kPMPluginNotFound = -9701, + kPMPluginRegisterationFailed = -9702, + kPMFontNotFound = -9703, + kPMFontNameTooLong = -9704, + kPMGeneralCGError = -9705, + kPMInvalidState = -9706, + kPMUnexpectedImagingError = -9707, + + + + + kPMInvalidPrinterAddress = -9780, + kPMOpenFailed = -9781, + kPMReadFailed = -9782, + kPMWriteFailed = -9783, + kPMStatusFailed = -9784, + kPMCloseFailed = -9785, + kPMUnsupportedConnection = -9786, + kPMIOAttrNotAvailable = -9787, + kPMReadGotZeroData = -9788, + + kPMLastErrorCodeToMakeMaintenanceOfThisListEasier = -9799 +}; + + + + +struct FontRec { + SInt16 fontType; + SInt16 firstChar; + SInt16 lastChar; + SInt16 widMax; + SInt16 kernMax; + SInt16 nDescent; + SInt16 fRectWidth; + SInt16 fRectHeight; + UInt16 owTLoc; + SInt16 ascent; + SInt16 descent; + SInt16 leading; + SInt16 rowWords; +}; +typedef struct FontRec FontRec; +typedef FontRec * FontRecPtr; +typedef FontRecPtr * FontRecHdl; +struct FMInput { + short family; + short size; + Style face; + Boolean needBits; + short device; + Point numer; + Point denom; +}; +typedef struct FMInput FMInput; +struct FamRec { + SInt16 ffFlags; + SInt16 ffFamID; + SInt16 ffFirstChar; + SInt16 ffLastChar; + SInt16 ffAscent; + SInt16 ffDescent; + SInt16 ffLeading; + SInt16 ffWidMax; + SInt32 ffWTabOff; + SInt32 ffKernOff; + SInt32 ffStylOff; + SInt16 ffProperty[9]; + SInt16 ffIntl[2]; + SInt16 ffVersion; +}; +typedef struct FamRec FamRec; +struct AsscEntry { + SInt16 fontSize; + SInt16 fontStyle; + SInt16 fontID; +}; +typedef struct AsscEntry AsscEntry; +struct FontAssoc { + SInt16 numAssoc; +}; +typedef struct FontAssoc FontAssoc; +struct StyleTable { + SInt16 fontClass; + SInt32 offset; + SInt32 reserved; + char indexes[48]; +}; +typedef struct StyleTable StyleTable; +struct NameTable { + SInt16 stringCount; + Str255 baseFontName; +}; +typedef struct NameTable NameTable; +struct KernPair { + char kernFirst; + char kernSecond; + SInt16 kernWidth; +}; +typedef struct KernPair KernPair; +struct KernEntry { + SInt16 kernStyle; + SInt16 kernLength; +}; +typedef struct KernEntry KernEntry; +struct KernTable { + SInt16 numKerns; +}; +typedef struct KernTable KernTable; + + + + +typedef struct OpaqueATSUTextLayout* ATSUTextLayout; +typedef struct OpaqueATSUStyle* ATSUStyle; +typedef struct OpaqueATSUFontFallbacks* ATSUFontFallbacks; +typedef Fixed ATSUTextMeasurement; +typedef FMFont ATSUFontID; +typedef UInt16 ATSUFontFeatureType; +typedef UInt16 ATSUFontFeatureSelector; +typedef FourCharCode ATSUFontVariationAxis; +typedef Fixed ATSUFontVariationValue; +typedef UInt32 ATSUAttributeTag; +enum { + + + + + + kATSULineWidthTag = 1, + + + + + + kATSULineRotationTag = 2, + + + + + + + kATSULineDirectionTag = 3, + + + + + + kATSULineJustificationFactorTag = 4, + + + + + + kATSULineFlushFactorTag = 5, + + + + + + + kATSULineBaselineValuesTag = 6, + + + + + + + + kATSULineLayoutOptionsTag = 7, + kATSULineAscentTag = 8, + kATSULineDescentTag = 9, + + + + + + + kATSULineLangRegionTag = 10, + + + + + + + kATSULineTextLocatorTag = 11, + + + + + + + kATSULineTruncationTag = 12, + kATSULineFontFallbacksTag = 13, + + + + + + + + kATSULineDecimalTabCharacterTag = 14, + + + + + + + + kATSULayoutOperationOverrideTag = 15, + + + + + + + kATSULineHighlightCGColorTag = 17, + + + + + + kATSUMaxLineTag = 18, + + + + + kATSULineLanguageTag = 10, + kATSUCGContextTag = 32767, + + + + + + + + kATSUQDBoldfaceTag = 256, + + + + + + + + kATSUQDItalicTag = 257, + + + + + + kATSUQDUnderlineTag = 258, + + + + + + kATSUQDCondensedTag = 259, + + + + + + kATSUQDExtendedTag = 260, + + + + + + kATSUFontTag = 261, + + + + + + kATSUSizeTag = 262, + + + + + + kATSUColorTag = 263, + + + + + + + kATSULangRegionTag = 264, + + + + + + + + kATSUVerticalCharacterTag = 265, + + + + + + kATSUImposeWidthTag = 266, + + + + + kATSUBeforeWithStreamShiftTag = 267, + + + + + kATSUAfterWithStreamShiftTag = 268, + + + + + kATSUCrossStreamShiftTag = 269, + + + + + + kATSUTrackingTag = 270, + + + + + kATSUHangingInhibitFactorTag = 271, + + + + + kATSUKerningInhibitFactorTag = 272, + + + + + + kATSUDecompositionFactorTag = 273, + + + + + + + + kATSUBaselineClassTag = 274, + + + + + + + kATSUPriorityJustOverrideTag = 275, + + + + + + + kATSUNoLigatureSplitTag = 276, + + + + + + + kATSUNoCaretAngleTag = 277, + + + + + + + kATSUSuppressCrossKerningTag = 278, + + + + + + + kATSUNoOpticalAlignmentTag = 279, + + + + + + + kATSUForceHangingTag = 280, + + + + + + + kATSUNoSpecialJustificationTag = 281, + + + + + + + kATSUStyleTextLocatorTag = 282, + + + + + + + + kATSUStyleRenderingOptionsTag = 283, + kATSUAscentTag = 284, + kATSUDescentTag = 285, + kATSULeadingTag = 286, + + + + + + + kATSUGlyphSelectorTag = 287, + + + + + + + kATSURGBAlphaColorTag = 288, + + + + + + + + kATSUFontMatrixTag = 289, + + + + + + + kATSUStyleUnderlineCountOptionTag = 290, + + + + + + + kATSUStyleUnderlineColorOptionTag = 291, + + + + + + kATSUStyleStrikeThroughTag = 292, + + + + + + + kATSUStyleStrikeThroughCountOptionTag = 293, + + + + + + + kATSUStyleStrikeThroughColorOptionTag = 294, + + + + + + + kATSUStyleDropShadowTag = 295, + + + + + + kATSUStyleDropShadowBlurOptionTag = 296, + + + + + + + kATSUStyleDropShadowOffsetOptionTag = 297, + + + + + + kATSUStyleDropShadowColorOptionTag = 298, + + + + + + kATSUMaxStyleTag = 299, + + + + + + + kATSULanguageTag = 264, + kATSUMaxATSUITagValue = 65535 +}; +typedef void * ATSUAttributeValuePtr; +typedef const void * ConstATSUAttributeValuePtr; +struct ATSUAttributeInfo { + ATSUAttributeTag fTag; + ByteCount fValueSize; +}; +typedef struct ATSUAttributeInfo ATSUAttributeInfo; +struct ATSUCaret { + Fixed fX; + Fixed fY; + Fixed fDeltaX; + Fixed fDeltaY; +}; +typedef struct ATSUCaret ATSUCaret; +typedef UInt16 ATSUCursorMovementType; +enum { + + + + + + kATSUByCharacter = 0, + + + + + + kATSUByTypographicCluster = 1, + + + + + kATSUByWord = 2, + + + + + kATSUByCharacterCluster = 3, + + + + + kATSUByCluster = 1 +}; +typedef UInt32 ATSULineTruncation; +enum { + kATSUTruncateNone = 0, + kATSUTruncateStart = 1, + kATSUTruncateEnd = 2, + kATSUTruncateMiddle = 3, + kATSUTruncateSpecificationMask = 0x00000007, + kATSUTruncFeatNoSquishing = 0x00000008 +}; +typedef UInt16 ATSUStyleLineCountType; +enum { + kATSUStyleSingleLineCount = 1, + kATSUStyleDoubleLineCount = 2 +}; +typedef UInt16 ATSUVerticalCharacterType; +enum { + kATSUStronglyHorizontal = 0, + kATSUStronglyVertical = 1 +}; +typedef UInt16 ATSUStyleComparison; +enum { + kATSUStyleUnequal = 0, + kATSUStyleContains = 1, + kATSUStyleEquals = 2, + kATSUStyleContainedBy = 3 +}; +typedef UInt16 ATSUFontFallbackMethod; +enum { + + + + + + kATSUDefaultFontFallbacks = 0, + + + + + + kATSULastResortOnlyFallback = 1, + kATSUSequentialFallbacksPreferred = 2, + kATSUSequentialFallbacksExclusive = 3 +}; +typedef UInt16 ATSUTabType; +enum { + kATSULeftTab = 0, + kATSUCenterTab = 1, + kATSURightTab = 2, + kATSUDecimalTab = 3, + kATSUNumberTabTypes = 4 +}; +struct ATSUTab { + ATSUTextMeasurement tabPosition; + ATSUTabType tabType; +}; +typedef struct ATSUTab ATSUTab; +struct ATSURGBAlphaColor { + float red; + float green; + float blue; + float alpha; +}; +typedef struct ATSURGBAlphaColor ATSURGBAlphaColor; +typedef UInt16 GlyphCollection; +enum { + kGlyphCollectionGID = 0, + kGlyphCollectionAdobeCNS1 = 1, + kGlyphCollectionAdobeGB1 = 2, + kGlyphCollectionAdobeJapan1 = 3, + kGlyphCollectionAdobeJapan2 = 4, + kGlyphCollectionAdobeKorea1 = 5, + kGlyphCollectionUnspecified = 0xFF +}; +struct ATSUGlyphSelector { + + + + + + GlyphCollection collection; + + + + + + + GlyphID glyphID; +}; +typedef struct ATSUGlyphSelector ATSUGlyphSelector; +struct ATSUGlyphInfo { + GlyphID glyphID; + UInt16 reserved; + UInt32 layoutFlags; + UniCharArrayOffset charIndex; + ATSUStyle style; + Float32 deltaY; + Float32 idealX; + SInt16 screenX; + SInt16 caretX; +}; +typedef struct ATSUGlyphInfo ATSUGlyphInfo; +struct ATSUGlyphInfoArray { + ATSUTextLayout layout; + ItemCount numGlyphs; + ATSUGlyphInfo glyphs[1]; +}; +typedef struct ATSUGlyphInfoArray ATSUGlyphInfoArray; +typedef UInt32 ATSUHighlightMethod; +enum { + kInvertHighlighting = 0, + kRedrawHighlighting = 1 +}; +typedef UInt32 ATSUBackgroundDataType; +enum { + kATSUBackgroundColor = 0, + kATSUBackgroundCallback = 1 +}; +typedef ATSURGBAlphaColor ATSUBackgroundColor; +typedef Boolean ( * RedrawBackgroundProcPtr)(ATSUTextLayout iLayout, UniCharArrayOffset iTextOffset, UniCharCount iTextLength, ATSTrapezoid iUnhighlightArea[], ItemCount iTrapezoidCount); +typedef RedrawBackgroundProcPtr RedrawBackgroundUPP; +union ATSUBackgroundData { + + + + + ATSUBackgroundColor backgroundColor; + + + + + + RedrawBackgroundUPP backgroundUPP; +}; +typedef union ATSUBackgroundData ATSUBackgroundData; +struct ATSUUnhighlightData { + + + + + + + + ATSUBackgroundDataType dataType; + + + + + + + ATSUBackgroundData unhighlightData; +}; +typedef struct ATSUUnhighlightData ATSUUnhighlightData; +enum { + + + + + kATSULeftToRightBaseDirection = 0, + + + + + kATSURightToLeftBaseDirection = 1 +}; +enum { + kATSUInvalidFontID = 0 +}; +enum { + kATSUUseLineControlWidth = 0x7FFFFFFF +}; +enum { + kATSUNoSelector = 0x0000FFFF +}; +enum { + + + + + kATSUFromTextBeginning = (UInt32)0xFFFFFFFF, + + + + + kATSUToTextEnd = (UInt32)0xFFFFFFFF, + + + + + kATSUFromPreviousLayout = (UInt32)0xFFFFFFFE, + + + + + kATSUFromFollowingLayout = (UInt32)0xFFFFFFFD +}; + + + + + + +enum { + + + + + + + kATSUUseGrafPortPenLoc = (UInt32)0xFFFFFFFF, + + + + + + + kATSUClearAll = (UInt32)0xFFFFFFFF +}; + + + + + +typedef OSStatus ( * ATSQuadraticNewPathProcPtr)(void * callBackDataPtr); +typedef ATSQuadraticNewPathProcPtr ATSQuadraticNewPathUPP; +typedef OSStatus ( * ATSQuadraticLineProcPtr)(const Float32Point *pt1, const Float32Point *pt2, void *callBackDataPtr); +typedef ATSQuadraticLineProcPtr ATSQuadraticLineUPP; +typedef OSStatus ( * ATSQuadraticCurveProcPtr)(const Float32Point *pt1, const Float32Point *controlPt, const Float32Point *pt2, void *callBackDataPtr); +typedef ATSQuadraticCurveProcPtr ATSQuadraticCurveUPP; +typedef OSStatus ( * ATSQuadraticClosePathProcPtr)(void * callBackDataPtr); +typedef ATSQuadraticClosePathProcPtr ATSQuadraticClosePathUPP; +typedef OSStatus ( * ATSCubicMoveToProcPtr)(const Float32Point *pt, void *callBackDataPtr); +typedef ATSCubicMoveToProcPtr ATSCubicMoveToUPP; +typedef OSStatus ( * ATSCubicLineToProcPtr)(const Float32Point *pt, void *callBackDataPtr); +typedef ATSCubicLineToProcPtr ATSCubicLineToUPP; +typedef OSStatus ( * ATSCubicCurveToProcPtr)(const Float32Point *pt1, const Float32Point *pt2, const Float32Point *pt3, void *callBackDataPtr); +typedef ATSCubicCurveToProcPtr ATSCubicCurveToUPP; +typedef OSStatus ( * ATSCubicClosePathProcPtr)(void * callBackDataPtr); +typedef ATSCubicClosePathProcPtr ATSCubicClosePathUPP; + + + + +typedef UInt32 ATSUFlattenedDataStreamFormat; +enum { + kATSUDataStreamUnicodeStyledText = 'ustl' +}; + + + + + + + +typedef UInt32 ATSUFlattenStyleRunOptions; +enum { + kATSUFlattenOptionNoOptionsMask = 0x00000000 +}; + + + + + + +typedef UInt32 ATSUUnFlattenStyleRunOptions; +enum { + kATSUUnFlattenOptionNoOptionsMask = 0x00000000 +}; +struct ATSUStyleRunInfo { + UInt32 runLength; + UInt32 styleObjectIndex; +}; +typedef struct ATSUStyleRunInfo ATSUStyleRunInfo; +enum { + kATSFlatDataUstlVersion0 = 0, + kATSFlatDataUstlVersion1 = 1, + kATSFlatDataUstlVersion2 = 2, + kATSFlatDataUstlCurrentVersion = kATSFlatDataUstlVersion2 +}; +struct ATSFlatDataMainHeaderBlock { + + + + + UInt32 version; + + + + UInt32 sizeOfDataBlock; + + + + UInt32 offsetToTextLayouts; + + + + UInt32 offsetToStyleRuns; + + + + UInt32 offsetToStyleList; +}; +typedef struct ATSFlatDataMainHeaderBlock ATSFlatDataMainHeaderBlock; +struct ATSFlatDataTextLayoutDataHeader { + + + + UInt32 sizeOfLayoutData; + + + UInt32 textLayoutLength; + + + + + UInt32 offsetToLayoutControls; + + + + + UInt32 offsetToLineInfo; + + + + + + + +}; +typedef struct ATSFlatDataTextLayoutDataHeader ATSFlatDataTextLayoutDataHeader; + + + + + +struct ATSFlatDataTextLayoutHeader { + + + + + UInt32 numFlattenedTextLayouts; + + + + + ATSFlatDataTextLayoutDataHeader flattenedTextLayouts[1]; +}; +typedef struct ATSFlatDataTextLayoutHeader ATSFlatDataTextLayoutHeader; + + + + + +struct ATSFlatDataLayoutControlsDataHeader { + + + + UInt32 numberOfLayoutControls; + ATSUAttributeInfo controlArray[1]; +}; +typedef struct ATSFlatDataLayoutControlsDataHeader ATSFlatDataLayoutControlsDataHeader; +struct ATSFlatDataLineInfoData { + + + UInt32 lineLength; + + + + UInt32 numberOfLineControls; + + + + +}; +typedef struct ATSFlatDataLineInfoData ATSFlatDataLineInfoData; + + + + + +struct ATSFlatDataLineInfoHeader { + + + + + + UInt32 numberOfLines; + + + + + ATSFlatDataLineInfoData lineInfoArray[1]; +}; +typedef struct ATSFlatDataLineInfoHeader ATSFlatDataLineInfoHeader; +struct ATSFlatDataStyleRunDataHeader { + + + UInt32 numberOfStyleRuns; + + + + + ATSUStyleRunInfo styleRunArray[1]; +}; +typedef struct ATSFlatDataStyleRunDataHeader ATSFlatDataStyleRunDataHeader; +struct ATSFlatDataStyleListStyleDataHeader { + + + + + UInt32 sizeOfStyleInfo; + + + + + UInt32 numberOfSetAttributes; + + + + UInt32 numberOfSetFeatures; + + + + UInt32 numberOfSetVariations; +}; +typedef struct ATSFlatDataStyleListStyleDataHeader ATSFlatDataStyleListStyleDataHeader; + + + + + +struct ATSFlatDataStyleListHeader { + + + UInt32 numberOfStyles; + + + + + + + ATSFlatDataStyleListStyleDataHeader styleDataArray[1]; + +}; +typedef struct ATSFlatDataStyleListHeader ATSFlatDataStyleListHeader; + + + + + +struct ATSFlatDataStyleListFeatureData { + + + ATSUFontFeatureType theFeatureType; + + + ATSUFontFeatureSelector theFeatureSelector; +}; +typedef struct ATSFlatDataStyleListFeatureData ATSFlatDataStyleListFeatureData; + + + + + + +struct ATSFlatDataStyleListVariationData { + + + ATSUFontVariationAxis theVariationAxis; + + + ATSUFontVariationValue theVariationValue; +}; +typedef struct ATSFlatDataStyleListVariationData ATSFlatDataStyleListVariationData; +typedef UInt32 ATSFlatDataFontSpeciferType; +enum { + + + kATSFlattenedFontSpecifierRawNameData = 'namd' +}; + + + + + + +struct ATSFlatDataFontNameDataHeader { + + + ATSFlatDataFontSpeciferType nameSpecifierType; + + + + + + UInt32 nameSpecifierSize; + + + + + + + +}; +typedef struct ATSFlatDataFontNameDataHeader ATSFlatDataFontNameDataHeader; + + + + + + + +struct ATSFlatDataFontSpecRawNameData { + + + FontNameCode fontNameType; + + + + + + FontPlatformCode fontNamePlatform; + + + + + + FontScriptCode fontNameScript; + + + + + FontLanguageCode fontNameLanguage; + + + + UInt32 fontNameLength; + + + + +}; +typedef struct ATSFlatDataFontSpecRawNameData ATSFlatDataFontSpecRawNameData; +struct ATSFlatDataFontSpecRawNameDataHeader { + + + + UInt32 numberOfFlattenedNames; + + + + + + ATSFlatDataFontSpecRawNameData nameDataArray[1]; + +}; +typedef struct ATSFlatDataFontSpecRawNameDataHeader ATSFlatDataFontSpecRawNameDataHeader; + + + + + + + + +typedef UInt32 ATSUDirectDataSelector; +enum { + kATSUDirectDataAdvanceDeltaFixedArray = 0, + kATSUDirectDataBaselineDeltaFixedArray = 1, + kATSUDirectDataDeviceDeltaSInt16Array = 2, + kATSUDirectDataStyleIndexUInt16Array = 3, + kATSUDirectDataStyleSettingATSUStyleSettingRefArray = 4, + kATSUDirectDataLayoutRecordATSLayoutRecordVersion1 = 100, + kATSUDirectDataLayoutRecordATSLayoutRecordCurrent = kATSUDirectDataLayoutRecordATSLayoutRecordVersion1 +}; +typedef struct LLCStyleInfo* ATSUStyleSettingRef; + + + + +enum { + kTextToSpeechSynthType = 'ttsc', + kTextToSpeechVoiceType = 'ttvd', + kTextToSpeechVoiceFileType = 'ttvf', + kTextToSpeechVoiceBundleType = 'ttvb' +}; + +enum { + kNoEndingProsody = 1, + kNoSpeechInterrupt = 2, + kPreflightThenPause = 4 +}; + +enum { + kImmediate = 0, + kEndOfWord = 1, + kEndOfSentence = 2 +}; + + + + + +enum { + soStatus = 'stat', + soErrors = 'erro', + soInputMode = 'inpt', + soCharacterMode = 'char', + soNumberMode = 'nmbr', + soRate = 'rate', + soPitchBase = 'pbas', + soPitchMod = 'pmod', + soVolume = 'volm', + soSynthType = 'vers', + soRecentSync = 'sync', + soPhonemeSymbols = 'phsy', + soCurrentVoice = 'cvox', + soCommandDelimiter = 'dlim', + soReset = 'rset', + soCurrentA5 = 'myA5', + soRefCon = 'refc', + soTextDoneCallBack = 'tdcb', + soSpeechDoneCallBack = 'sdcb', + soSyncCallBack = 'sycb', + soErrorCallBack = 'ercb', + soPhonemeCallBack = 'phcb', + soWordCallBack = 'wdcb', + soSynthExtension = 'xtnd', + soSoundOutput = 'sndo', + soOutputToFileWithCFURL = 'opaf', + soOutputToExtAudioFile = 'opax', + soOutputToAudioDevice = 'opad', + soPhonemeOptions = 'popt' +}; + + + + + +enum { + modeText = 'TEXT', + modePhonemes = 'PHON', + modeTune = 'TUNE', + modeNormal = 'NORM', + modeLiteral = 'LTRL' +}; + + +enum { + soVoiceDescription = 'info', + soVoiceFile = 'fref' +}; + + + + +enum { + kSpeechGenerateTune = 1, + kSpeechRelativePitch = 2, + kSpeechRelativeDuration = 4, + kSpeechShowSyllables = 8 +}; + + + + +enum { + kAudioUnitSubType_SpeechSynthesis = 'ttsp', + kAudioUnitProperty_Voice = 3330, + kAudioUnitProperty_SpeechChannel = 3331 +}; + + + + + +struct SpeechChannelRecord { + long data[1]; +}; +typedef struct SpeechChannelRecord SpeechChannelRecord; +typedef SpeechChannelRecord * SpeechChannel; + +struct VoiceSpec { + OSType creator; + OSType id; +}; +typedef struct VoiceSpec VoiceSpec; +typedef VoiceSpec * VoiceSpecPtr; + +enum { + kNeuter = 0, + kMale = 1, + kFemale = 2 +}; + + + + +struct VoiceDescription { + SInt32 length; + VoiceSpec voice; + SInt32 version; + Str63 name; + Str255 comment; + SInt16 gender; + SInt16 age; + SInt16 script; + SInt16 language; + SInt16 region; + SInt32 reserved[4]; +}; +typedef struct VoiceDescription VoiceDescription; + + +struct VoiceFileInfo { + FSSpec fileSpec; + SInt16 resID; +}; +typedef struct VoiceFileInfo VoiceFileInfo; +struct SpeechStatusInfo { + Boolean outputBusy; + Boolean outputPaused; + long inputBytesLeft; + SInt16 phonemeCode; +}; +typedef struct SpeechStatusInfo SpeechStatusInfo; + + +struct SpeechErrorInfo { + SInt16 count; + OSErr oldest; + long oldPos; + OSErr newest; + long newPos; +}; +typedef struct SpeechErrorInfo SpeechErrorInfo; + + +struct SpeechVersionInfo { + OSType synthType; + OSType synthSubType; + OSType synthManufacturer; + SInt32 synthFlags; + NumVersion synthVersion; +}; +typedef struct SpeechVersionInfo SpeechVersionInfo; + + +struct PhonemeInfo { + SInt16 opcode; + Str15 phStr; + Str31 exampleStr; + SInt16 hiliteStart; + SInt16 hiliteEnd; +}; +typedef struct PhonemeInfo PhonemeInfo; + +struct PhonemeDescriptor { + SInt16 phonemeCount; + PhonemeInfo thePhonemes[1]; +}; +typedef struct PhonemeDescriptor PhonemeDescriptor; +struct SpeechXtndData { + OSType synthCreator; + Byte synthData[2]; +}; +typedef struct SpeechXtndData SpeechXtndData; + +struct DelimiterInfo { + Byte startDelimiter[2]; + Byte endDelimiter[2]; +}; +typedef struct DelimiterInfo DelimiterInfo; +extern CFStringRef const kSpeechStatusProperty __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechErrorsProperty __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechInputModeProperty __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechCharacterModeProperty __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechNumberModeProperty __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechRateProperty __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechPitchBaseProperty __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechPitchModProperty __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechVolumeProperty __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechSynthesizerInfoProperty __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechRecentSyncProperty __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechPhonemeSymbolsProperty __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechCurrentVoiceProperty __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechCommandDelimiterProperty __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechResetProperty __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechOutputToFileURLProperty __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechOutputToExtAudioFileProperty __attribute__((availability(macosx,introduced=10.6))); +extern CFStringRef const kSpeechOutputToAudioDeviceProperty __attribute__((availability(macosx,introduced=10.6))); + + + + + + +extern CFStringRef const kSpeechOutputToFileDescriptorProperty __attribute__((availability(macosx,introduced=10.9))); + + + + + + +extern CFStringRef const kSpeechAudioOutputFormatProperty __attribute__((availability(macosx,introduced=10.9))); + + + + + + + +extern CFStringRef const kSpeechOutputChannelMapProperty __attribute__((availability(macosx,introduced=10.9))); +extern CFStringRef const kSpeechRefConProperty __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechTextDoneCallBack __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechSpeechDoneCallBack __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechSyncCallBack __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechPhonemeCallBack __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechErrorCFCallBack __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechWordCFCallBack __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechPhonemeOptionsProperty __attribute__((availability(macosx,introduced=10.6))); +extern CFStringRef const kSpeechAudioUnitProperty __attribute__((availability(macosx,introduced=10.6))); +extern CFStringRef const kSpeechAudioGraphProperty __attribute__((availability(macosx,introduced=10.6))); +extern CFStringRef const kSpeechSynthExtensionProperty __attribute__((availability(macosx,introduced=10.9))); +extern CFStringRef const kSpeechModeText __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechModePhoneme __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechModeTune __attribute__((availability(macosx,introduced=10.6))); +extern CFStringRef const kSpeechModeNormal __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechModeLiteral __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechNoEndingProsody __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechNoSpeechInterrupt __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechPreflightThenPause __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechStatusOutputBusy __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechStatusOutputPaused __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechStatusNumberOfCharactersLeft __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechStatusPhonemeCode __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechErrorCount __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechErrorOldest __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechErrorOldestCharacterOffset __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechErrorNewest __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechErrorNewestCharacterOffset __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechSynthesizerInfoIdentifier __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechSynthesizerInfoManufacturer __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechSynthesizerInfoVersion __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechPhonemeInfoOpcode __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechPhonemeInfoSymbol __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechPhonemeInfoExample __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechPhonemeInfoHiliteStart __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechPhonemeInfoHiliteEnd __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechVoiceCreator __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechVoiceID __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechCommandPrefix __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechCommandSuffix __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechDictionaryLocaleIdentifier __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechDictionaryModificationDate __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechDictionaryPronunciations __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechDictionaryAbbreviations __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechDictionaryEntrySpelling __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechDictionaryEntryPhonemes __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechErrorCallbackSpokenString __attribute__((availability(macosx,introduced=10.5))); +extern CFStringRef const kSpeechErrorCallbackCharacterOffset __attribute__((availability(macosx,introduced=10.5))); + +typedef void ( * SpeechTextDoneProcPtr)(SpeechChannel chan, SRefCon refCon, const void * _Nullable * _Nullable nextBuf, unsigned long *byteLen, SInt32 *controlFlags); +typedef void ( * SpeechDoneProcPtr)(SpeechChannel chan, SRefCon refCon); +typedef void ( * SpeechSyncProcPtr)(SpeechChannel chan, SRefCon refCon, OSType syncMessage); +typedef void ( * SpeechErrorProcPtr)(SpeechChannel chan, SRefCon refCon, OSErr theError, long bytePos); +typedef void ( * SpeechPhonemeProcPtr)(SpeechChannel chan, SRefCon refCon, SInt16 phonemeOpcode); +typedef void ( * SpeechWordProcPtr)(SpeechChannel chan, SRefCon refCon, unsigned long wordPos, UInt16 wordLen); +typedef SpeechTextDoneProcPtr SpeechTextDoneUPP; +typedef SpeechDoneProcPtr SpeechDoneUPP; +typedef SpeechSyncProcPtr SpeechSyncUPP; +typedef SpeechErrorProcPtr SpeechErrorUPP; +typedef SpeechPhonemeProcPtr SpeechPhonemeUPP; +typedef SpeechWordProcPtr SpeechWordUPP; +extern SpeechTextDoneUPP +NewSpeechTextDoneUPP(SpeechTextDoneProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SpeechDoneUPP +NewSpeechDoneUPP(SpeechDoneProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SpeechSyncUPP +NewSpeechSyncUPP(SpeechSyncProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SpeechErrorUPP +NewSpeechErrorUPP(SpeechErrorProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SpeechPhonemeUPP +NewSpeechPhonemeUPP(SpeechPhonemeProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern SpeechWordUPP +NewSpeechWordUPP(SpeechWordProcPtr userRoutine) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeSpeechTextDoneUPP(SpeechTextDoneUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeSpeechDoneUPP(SpeechDoneUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeSpeechSyncUPP(SpeechSyncUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeSpeechErrorUPP(SpeechErrorUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeSpeechPhonemeUPP(SpeechPhonemeUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +DisposeSpeechWordUPP(SpeechWordUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +InvokeSpeechTextDoneUPP( + SpeechChannel chan, + SRefCon refCon, + const void * _Nullable * _Nullable nextBuf, + unsigned long * byteLen, + SInt32 * controlFlags, + SpeechTextDoneUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +InvokeSpeechDoneUPP( + SpeechChannel chan, + SRefCon refCon, + SpeechDoneUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +InvokeSpeechSyncUPP( + SpeechChannel chan, + SRefCon refCon, + OSType syncMessage, + SpeechSyncUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +InvokeSpeechErrorUPP( + SpeechChannel chan, + SRefCon refCon, + OSErr theError, + long bytePos, + SpeechErrorUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +InvokeSpeechPhonemeUPP( + SpeechChannel chan, + SRefCon refCon, + SInt16 phonemeOpcode, + SpeechPhonemeUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern void +InvokeSpeechWordUPP( + SpeechChannel chan, + SRefCon refCon, + unsigned long wordPos, + UInt16 wordLen, + SpeechWordUPP userUPP) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +typedef void ( * SpeechErrorCFProcPtr)(SpeechChannel chan, SRefCon refCon, CFErrorRef theError); +typedef void ( * SpeechWordCFProcPtr)(SpeechChannel chan, SRefCon refCon, CFStringRef aString, CFRange wordRange); +extern NumVersion +SpeechManagerVersion(void) ; +extern OSErr +MakeVoiceSpec( + OSType creator, + OSType id, + VoiceSpec * voice) ; +extern OSErr +CountVoices(SInt16 * numVoices) ; +extern OSErr +GetIndVoice( + SInt16 index, + VoiceSpec * voice) ; +extern OSErr +GetVoiceDescription( + const VoiceSpec * _Nullable voice, + VoiceDescription * _Nullable info, + long infoLength) ; +extern OSErr +GetVoiceInfo( + const VoiceSpec * _Nullable voice, + OSType selector, + void * voiceInfo) ; +extern OSErr +NewSpeechChannel( + VoiceSpec * _Nullable voice, + SpeechChannel _Nullable * _Nonnull chan) ; +extern OSErr +DisposeSpeechChannel(SpeechChannel chan) ; +extern OSErr +SpeakString(ConstStr255Param textToBeSpoken) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +SpeakText( + SpeechChannel chan, + const void * textBuf, + unsigned long textBytes) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +SpeakBuffer( + SpeechChannel chan, + const void * textBuf, + unsigned long textBytes, + SInt32 controlFlags) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +StopSpeech(SpeechChannel chan) ; +extern OSErr +StopSpeechAt( + SpeechChannel chan, + SInt32 whereToStop) ; +extern OSErr +PauseSpeechAt( + SpeechChannel chan, + SInt32 whereToPause) ; +extern OSErr +ContinueSpeech(SpeechChannel chan) ; +extern SInt16 +SpeechBusy(void) ; +extern SInt16 +SpeechBusySystemWide(void) ; +extern OSErr +SetSpeechRate( + SpeechChannel chan, + Fixed rate) ; +extern OSErr +GetSpeechRate( + SpeechChannel chan, + Fixed * rate) ; +extern OSErr +SetSpeechPitch( + SpeechChannel chan, + Fixed pitch) ; +extern OSErr +GetSpeechPitch( + SpeechChannel chan, + Fixed * pitch) ; +extern OSErr +SetSpeechInfo( + SpeechChannel chan, + OSType selector, + const void * _Nullable speechInfo) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +GetSpeechInfo( + SpeechChannel chan, + OSType selector, + void * speechInfo) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +TextToPhonemes( + SpeechChannel chan, + const void * textBuf, + unsigned long textBytes, + Handle _Nonnull phonemeBuf, + long * phonemeBytes) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +UseDictionary( + SpeechChannel chan, + Handle _Nonnull dictionary) __attribute__((availability(macosx,introduced=10.0,deprecated=10.8))); +extern OSErr +SpeakCFString( + SpeechChannel chan, + CFStringRef aString, + CFDictionaryRef _Nullable options) __attribute__((availability(macosx,introduced=10.5))); +extern OSErr +UseSpeechDictionary( + SpeechChannel chan, + CFDictionaryRef speechDictionary) __attribute__((availability(macosx,introduced=10.5))); +extern OSErr +CopyPhonemesFromText( + SpeechChannel chan, + CFStringRef text, + CFStringRef _Nullable * _Nonnull __attribute__((cf_returns_retained)) phonemes) __attribute__((availability(macosx,introduced=10.5))); +extern OSErr +CopySpeechProperty( + SpeechChannel chan, + CFStringRef property, + CFTypeRef _Nullable * _Nonnull __attribute__((cf_returns_retained)) object) __attribute__((availability(macosx,introduced=10.5))); +extern OSErr +SetSpeechProperty( + SpeechChannel chan, + CFStringRef property, + CFTypeRef _Nullable object) __attribute__((availability(macosx,introduced=10.5))); +extern OSErr +SpeechSynthesisRegisterModuleURL(CFURLRef url) __attribute__((availability(macosx,introduced=10.6))); +extern OSErr +SpeechSynthesisUnregisterModuleURL(CFURLRef url) __attribute__((availability(macosx,introduced=10.6))); + + + + + typedef double cpFloat; +static inline cpFloat cpfmax(cpFloat a, cpFloat b) +{ + return (a > b) ? a : b; +} + + +static inline cpFloat cpfmin(cpFloat a, cpFloat b) +{ + return (a < b) ? a : b; +} + + +static inline cpFloat cpfabs(cpFloat f) +{ + return (f < 0) ? -f : f; +} + + +static inline cpFloat cpfclamp(cpFloat f, cpFloat min, cpFloat max) +{ + return cpfmin(cpfmax(f, min), max); +} + + +static inline cpFloat cpfclamp01(cpFloat f) +{ + return cpfmax(0.0f, cpfmin(f, 1.0f)); +} + + + + +static inline cpFloat cpflerp(cpFloat f1, cpFloat f2, cpFloat t) +{ + return f1*(1.0f - t) + f2*t; +} + + +static inline cpFloat cpflerpconst(cpFloat f1, cpFloat f2, cpFloat d) +{ + return f1 + cpfclamp(f2 - f1, -d, d); +} + + + + + + typedef uintptr_t cpHashValue; + + + + +typedef uint32_t cpCollisionID; + + + + + + + typedef unsigned char cpBool; + typedef void * cpDataPointer; + + + + + + + typedef uintptr_t cpCollisionType; + + + + + + + typedef uintptr_t cpGroup; + + + + + + + typedef unsigned int cpBitmask; + + + + + + + typedef unsigned int cpTimestamp; + typedef CGPoint cpVect; + + + + + + + + typedef CGAffineTransform cpTransform; +typedef struct cpMat2x2 { + + cpFloat a, b, c, d; +} cpMat2x2; +typedef struct cpArray cpArray; +typedef struct cpHashSet cpHashSet; + +typedef struct cpBody cpBody; + +typedef struct cpShape cpShape; +typedef struct cpCircleShape cpCircleShape; +typedef struct cpSegmentShape cpSegmentShape; +typedef struct cpPolyShape cpPolyShape; + +typedef struct cpConstraint cpConstraint; +typedef struct cpPinJoint cpPinJoint; +typedef struct cpSlideJoint cpSlideJoint; +typedef struct cpPivotJoint cpPivotJoint; +typedef struct cpGrooveJoint cpGrooveJoint; +typedef struct cpDampedSpring cpDampedSpring; +typedef struct cpDampedRotarySpring cpDampedRotarySpring; +typedef struct cpRotaryLimitJoint cpRotaryLimitJoint; +typedef struct cpRatchetJoint cpRatchetJoint; +typedef struct cpGearJoint cpGearJoint; +typedef struct cpSimpleMotorJoint cpSimpleMotorJoint; + +typedef struct cpCollisionHandler cpCollisionHandler; +typedef struct cpContactPointSet cpContactPointSet; +typedef struct cpArbiter cpArbiter; + +typedef struct cpSpace cpSpace; + + +static const cpVect cpvzero = {0.0f,0.0f}; + + +static inline cpVect cpv(const cpFloat x, const cpFloat y) +{ + cpVect v = {x, y}; + return v; +} + + +static inline cpBool cpveql(const cpVect v1, const cpVect v2) +{ + return (v1.x == v2.x && v1.y == v2.y); +} + + +static inline cpVect cpvadd(const cpVect v1, const cpVect v2) +{ + return cpv(v1.x + v2.x, v1.y + v2.y); +} + + +static inline cpVect cpvsub(const cpVect v1, const cpVect v2) +{ + return cpv(v1.x - v2.x, v1.y - v2.y); +} + + +static inline cpVect cpvneg(const cpVect v) +{ + return cpv(-v.x, -v.y); +} + + +static inline cpVect cpvmult(const cpVect v, const cpFloat s) +{ + return cpv(v.x*s, v.y*s); +} + + +static inline cpFloat cpvdot(const cpVect v1, const cpVect v2) +{ + return v1.x*v2.x + v1.y*v2.y; +} + + + + +static inline cpFloat cpvcross(const cpVect v1, const cpVect v2) +{ + return v1.x*v2.y - v1.y*v2.x; +} + + +static inline cpVect cpvperp(const cpVect v) +{ + return cpv(-v.y, v.x); +} + + +static inline cpVect cpvrperp(const cpVect v) +{ + return cpv(v.y, -v.x); +} + + +static inline cpVect cpvproject(const cpVect v1, const cpVect v2) +{ + return cpvmult(v2, cpvdot(v1, v2)/cpvdot(v2, v2)); +} + + +static inline cpVect cpvforangle(const cpFloat a) +{ + return cpv(cos(a), sin(a)); +} + + +static inline cpFloat cpvtoangle(const cpVect v) +{ + return atan2(v.y, v.x); +} + + +static inline cpVect cpvrotate(const cpVect v1, const cpVect v2) +{ + return cpv(v1.x*v2.x - v1.y*v2.y, v1.x*v2.y + v1.y*v2.x); +} + + +static inline cpVect cpvunrotate(const cpVect v1, const cpVect v2) +{ + return cpv(v1.x*v2.x + v1.y*v2.y, v1.y*v2.x - v1.x*v2.y); +} + + +static inline cpFloat cpvlengthsq(const cpVect v) +{ + return cpvdot(v, v); +} + + +static inline cpFloat cpvlength(const cpVect v) +{ + return sqrt(cpvdot(v, v)); +} + + +static inline cpVect cpvlerp(const cpVect v1, const cpVect v2, const cpFloat t) +{ + return cpvadd(cpvmult(v1, 1.0f - t), cpvmult(v2, t)); +} + + +static inline cpVect cpvnormalize(const cpVect v) +{ + + return cpvmult(v, 1.0f/(cpvlength(v) + 2.2250738585072014e-308)); +} + + +static inline cpVect +cpvslerp(const cpVect v1, const cpVect v2, const cpFloat t) +{ + cpFloat dot = cpvdot(cpvnormalize(v1), cpvnormalize(v2)); + cpFloat omega = acos(cpfclamp(dot, -1.0f, 1.0f)); + + if(omega < 1e-3){ + + return cpvlerp(v1, v2, t); + } else { + cpFloat denom = 1.0f/sin(omega); + return cpvadd(cpvmult(v1, sin((1.0f - t)*omega)*denom), cpvmult(v2, sin(t*omega)*denom)); + } +} + + +static inline cpVect +cpvslerpconst(const cpVect v1, const cpVect v2, const cpFloat a) +{ + cpFloat dot = cpvdot(cpvnormalize(v1), cpvnormalize(v2)); + cpFloat omega = acos(cpfclamp(dot, -1.0f, 1.0f)); + + return cpvslerp(v1, v2, cpfmin(a, omega)/omega); +} + + +static inline cpVect cpvclamp(const cpVect v, const cpFloat len) +{ + return (cpvdot(v,v) > len*len) ? cpvmult(cpvnormalize(v), len) : v; +} + + +static inline cpVect cpvlerpconst(cpVect v1, cpVect v2, cpFloat d) +{ + return cpvadd(v1, cpvclamp(cpvsub(v2, v1), d)); +} + + +static inline cpFloat cpvdist(const cpVect v1, const cpVect v2) +{ + return cpvlength(cpvsub(v1, v2)); +} + + +static inline cpFloat cpvdistsq(const cpVect v1, const cpVect v2) +{ + return cpvlengthsq(cpvsub(v1, v2)); +} + + +static inline cpBool cpvnear(const cpVect v1, const cpVect v2, const cpFloat dist) +{ + return cpvdistsq(v1, v2) < dist*dist; +} +static inline cpMat2x2 +cpMat2x2New(cpFloat a, cpFloat b, cpFloat c, cpFloat d) +{ + cpMat2x2 m = {a, b, c, d}; + return m; +} + +static inline cpVect +cpMat2x2Transform(cpMat2x2 m, cpVect v) +{ + return cpv(v.x*m.a + v.y*m.b, v.x*m.c + v.y*m.d); +} +typedef struct cpBB{ + cpFloat l, b, r ,t; +} cpBB; + + +static inline cpBB cpBBNew(const cpFloat l, const cpFloat b, const cpFloat r, const cpFloat t) +{ + cpBB bb = {l, b, r, t}; + return bb; +} + + +static inline cpBB +cpBBNewForExtents(const cpVect c, const cpFloat hw, const cpFloat hh) +{ + return cpBBNew(c.x - hw, c.y - hh, c.x + hw, c.y + hh); +} + + +static inline cpBB cpBBNewForCircle(const cpVect p, const cpFloat r) +{ + return cpBBNewForExtents(p, r, r); +} + + +static inline cpBool cpBBIntersects(const cpBB a, const cpBB b) +{ + return (a.l <= b.r && b.l <= a.r && a.b <= b.t && b.b <= a.t); +} + + +static inline cpBool cpBBContainsBB(const cpBB bb, const cpBB other) +{ + return (bb.l <= other.l && bb.r >= other.r && bb.b <= other.b && bb.t >= other.t); +} + + +static inline cpBool cpBBContainsVect(const cpBB bb, const cpVect v) +{ + return (bb.l <= v.x && bb.r >= v.x && bb.b <= v.y && bb.t >= v.y); +} + + +static inline cpBB cpBBMerge(const cpBB a, const cpBB b){ + return cpBBNew( + cpfmin(a.l, b.l), + cpfmin(a.b, b.b), + cpfmax(a.r, b.r), + cpfmax(a.t, b.t) + ); +} + + +static inline cpBB cpBBExpand(const cpBB bb, const cpVect v){ + return cpBBNew( + cpfmin(bb.l, v.x), + cpfmin(bb.b, v.y), + cpfmax(bb.r, v.x), + cpfmax(bb.t, v.y) + ); +} + + +static inline cpVect +cpBBCenter(cpBB bb) +{ + return cpvlerp(cpv(bb.l, bb.b), cpv(bb.r, bb.t), 0.5f); +} + + +static inline cpFloat cpBBArea(cpBB bb) +{ + return (bb.r - bb.l)*(bb.t - bb.b); +} + + +static inline cpFloat cpBBMergedArea(cpBB a, cpBB b) +{ + return (cpfmax(a.r, b.r) - cpfmin(a.l, b.l))*(cpfmax(a.t, b.t) - cpfmin(a.b, b.b)); +} + + +static inline cpFloat cpBBSegmentQuery(cpBB bb, cpVect a, cpVect b) +{ + cpFloat idx = 1.0f/(b.x - a.x); + + + + cpFloat tx1 = (bb.l == a.x ? -__builtin_huge_valf() : (bb.l - a.x)*idx); + cpFloat tx2 = (bb.r == a.x ? __builtin_huge_valf() : (bb.r - a.x)*idx); + cpFloat txmin = cpfmin(tx1, tx2); + cpFloat txmax = cpfmax(tx1, tx2); + + cpFloat idy = 1.0f/(b.y - a.y); + cpFloat ty1 = (bb.b == a.y ? -__builtin_huge_valf() : (bb.b - a.y)*idy); + cpFloat ty2 = (bb.t == a.y ? __builtin_huge_valf() : (bb.t - a.y)*idy); + + + + cpFloat tymin = cpfmin(ty1, ty2); + cpFloat tymax = cpfmax(ty1, ty2); + + if(tymin <= txmax && txmin <= tymax){ + cpFloat min = cpfmax(txmin, tymin); + cpFloat max = cpfmin(txmax, tymax); + + if(0.0 <= max && min <= 1.0) return cpfmax(min, 0.0); + } + + return __builtin_huge_valf(); +} + + +static inline cpBool cpBBIntersectsSegment(cpBB bb, cpVect a, cpVect b) +{ + return (cpBBSegmentQuery(bb, a, b) != __builtin_huge_valf()); +} + + +static inline cpVect +cpBBClampVect(const cpBB bb, const cpVect v) +{ + return cpv(cpfclamp(v.x, bb.l, bb.r), cpfclamp(v.y, bb.b, bb.t)); +} + + +static inline cpVect +cpBBWrapVect(const cpBB bb, const cpVect v) +{ + cpFloat dx = cpfabs(bb.r - bb.l); + cpFloat modx = fmod(v.x - bb.l, dx); + cpFloat x = (modx > 0.0f) ? modx : modx + dx; + + cpFloat dy = cpfabs(bb.t - bb.b); + cpFloat mody = fmod(v.y - bb.b, dy); + cpFloat y = (mody > 0.0f) ? mody : mody + dy; + + return cpv(x + bb.l, y + bb.b); +} + + +static inline cpBB +cpBBOffset(const cpBB bb, const cpVect v) +{ + return cpBBNew( + bb.l + v.x, + bb.b + v.y, + bb.r + v.x, + bb.t + v.y + ); +} +static const cpTransform cpTransformIdentity = {1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f}; + + + + + +static inline cpTransform +cpTransformNew(cpFloat a, cpFloat b, cpFloat c, cpFloat d, cpFloat tx, cpFloat ty) +{ + cpTransform t = {a, b, c, d, tx, ty}; + return t; +} + + +static inline cpTransform +cpTransformNewTranspose(cpFloat a, cpFloat c, cpFloat tx, cpFloat b, cpFloat d, cpFloat ty) +{ + cpTransform t = {a, b, c, d, tx, ty}; + return t; +} + + +static inline cpTransform +cpTransformInverse(cpTransform t) +{ + cpFloat inv_det = 1.0/(t.a*t.d - t.c*t.b); + return cpTransformNewTranspose( + t.d*inv_det, -t.c*inv_det, (t.c*t.ty - t.tx*t.d)*inv_det, + -t.b*inv_det, t.a*inv_det, (t.tx*t.b - t.a*t.ty)*inv_det + ); +} + + +static inline cpTransform +cpTransformMult(cpTransform t1, cpTransform t2) +{ + return cpTransformNewTranspose( + t1.a*t2.a + t1.c*t2.b, t1.a*t2.c + t1.c*t2.d, t1.a*t2.tx + t1.c*t2.ty + t1.tx, + t1.b*t2.a + t1.d*t2.b, t1.b*t2.c + t1.d*t2.d, t1.b*t2.tx + t1.d*t2.ty + t1.ty + ); +} + + +static inline cpVect +cpTransformPoint(cpTransform t, cpVect p) +{ + return cpv(t.a*p.x + t.c*p.y + t.tx, t.b*p.x + t.d*p.y + t.ty); +} + + +static inline cpVect +cpTransformVect(cpTransform t, cpVect v) +{ + return cpv(t.a*v.x + t.c*v.y, t.b*v.x + t.d*v.y); +} + + +static inline cpBB +cpTransformbBB(cpTransform t, cpBB bb) +{ + cpVect center = cpBBCenter(bb); + cpFloat hw = (bb.r - bb.l)*0.5; + cpFloat hh = (bb.t - bb.b)*0.5; + + cpFloat a = t.a*hw, b = t.c*hh, d = t.b*hw, e = t.d*hh; + cpFloat hw_max = cpfmax(cpfabs(a + b), cpfabs(a - b)); + cpFloat hh_max = cpfmax(cpfabs(d + e), cpfabs(d - e)); + return cpBBNewForExtents(cpTransformPoint(t, center), hw_max, hh_max); +} + + +static inline cpTransform +cpTransformTranslate(cpVect translate) +{ + return cpTransformNewTranspose( + 1.0, 0.0, translate.x, + 0.0, 1.0, translate.y + ); +} + + +static inline cpTransform +cpTransformScale(cpFloat scaleX, cpFloat scaleY) +{ + return cpTransformNewTranspose( + scaleX, 0.0, 0.0, + 0.0, scaleY, 0.0 + ); +} + + +static inline cpTransform +cpTransformRotate(cpFloat radians) +{ + cpVect rot = cpvforangle(radians); + return cpTransformNewTranspose( + rot.x, -rot.y, 0.0, + rot.y, rot.x, 0.0 + ); +} + + +static inline cpTransform +cpTransformRigid(cpVect translate, cpFloat radians) +{ + cpVect rot = cpvforangle(radians); + return cpTransformNewTranspose( + rot.x, -rot.y, translate.x, + rot.y, rot.x, translate.y + ); +} + + +static inline cpTransform +cpTransformRigidInverse(cpTransform t) +{ + return cpTransformNewTranspose( + t.d, -t.c, (t.c*t.ty - t.tx*t.d), + -t.b, t.a, (t.tx*t.b - t.a*t.ty) + ); +} + + + + +static inline cpTransform +cpTransformWrap(cpTransform outer, cpTransform inner) +{ + return cpTransformMult(cpTransformInverse(outer), cpTransformMult(inner, outer)); +} + +static inline cpTransform +cpTransformWrapInverse(cpTransform outer, cpTransform inner) +{ + return cpTransformMult(outer, cpTransformMult(inner, cpTransformInverse(outer))); +} + +static inline cpTransform +cpTransformOrtho(cpBB bb) +{ + return cpTransformNewTranspose( + 2.0/(bb.r - bb.l), 0.0, -(bb.r + bb.l)/(bb.r - bb.l), + 0.0, 2.0/(bb.t - bb.b), -(bb.t + bb.b)/(bb.t - bb.b) + ); +} + +static inline cpTransform +cpTransformBoneScale(cpVect v0, cpVect v1) +{ + cpVect d = cpvsub(v1, v0); + return cpTransformNewTranspose( + d.x, -d.y, v0.x, + d.y, d.x, v0.y + ); +} + +static inline cpTransform +cpTransformAxialScale(cpVect axis, cpVect pivot, cpFloat scale) +{ + cpFloat A = axis.x*axis.y*(scale - 1.0); + cpFloat B = cpvdot(axis, pivot)*(1.0 - scale); + + return cpTransformNewTranspose( + scale*axis.x*axis.x + axis.y*axis.y, A, axis.x*B, + A, axis.x*axis.x + scale*axis.y*axis.y, axis.y*B + ); +} +typedef cpBB (*cpSpatialIndexBBFunc)(void *obj); + +typedef void (*cpSpatialIndexIteratorFunc)(void *obj, void *data); + +typedef cpCollisionID (*cpSpatialIndexQueryFunc)(void *obj1, void *obj2, cpCollisionID id, void *data); + +typedef cpFloat (*cpSpatialIndexSegmentQueryFunc)(void *obj1, void *obj2, void *data); + + +typedef struct cpSpatialIndexClass cpSpatialIndexClass; +typedef struct cpSpatialIndex cpSpatialIndex; + + +struct cpSpatialIndex { + cpSpatialIndexClass *klass; + + cpSpatialIndexBBFunc bbfunc; + + cpSpatialIndex *staticIndex, *dynamicIndex; +}; + + + + +typedef struct cpSpaceHash cpSpaceHash; + + + cpSpaceHash* cpSpaceHashAlloc(void); + + cpSpatialIndex* cpSpaceHashInit(cpSpaceHash *hash, cpFloat celldim, int numcells, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex); + + cpSpatialIndex* cpSpaceHashNew(cpFloat celldim, int cells, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex); + + + + + + void cpSpaceHashResize(cpSpaceHash *hash, cpFloat celldim, int numcells); + + + +typedef struct cpBBTree cpBBTree; + + + cpBBTree* cpBBTreeAlloc(void); + + cpSpatialIndex* cpBBTreeInit(cpBBTree *tree, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex); + + cpSpatialIndex* cpBBTreeNew(cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex); + + + void cpBBTreeOptimize(cpSpatialIndex *index); + + + +typedef cpVect (*cpBBTreeVelocityFunc)(void *obj); + + void cpBBTreeSetVelocityFunc(cpSpatialIndex *index, cpBBTreeVelocityFunc func); + + + +typedef struct cpSweep1D cpSweep1D; + + + cpSweep1D* cpSweep1DAlloc(void); + + cpSpatialIndex* cpSweep1DInit(cpSweep1D *sweep, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex); + + cpSpatialIndex* cpSweep1DNew(cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex); + + + +typedef void (*cpSpatialIndexDestroyImpl)(cpSpatialIndex *index); + +typedef int (*cpSpatialIndexCountImpl)(cpSpatialIndex *index); +typedef void (*cpSpatialIndexEachImpl)(cpSpatialIndex *index, cpSpatialIndexIteratorFunc func, void *data); + +typedef cpBool (*cpSpatialIndexContainsImpl)(cpSpatialIndex *index, void *obj, cpHashValue hashid); +typedef void (*cpSpatialIndexInsertImpl)(cpSpatialIndex *index, void *obj, cpHashValue hashid); +typedef void (*cpSpatialIndexRemoveImpl)(cpSpatialIndex *index, void *obj, cpHashValue hashid); + +typedef void (*cpSpatialIndexReindexImpl)(cpSpatialIndex *index); +typedef void (*cpSpatialIndexReindexObjectImpl)(cpSpatialIndex *index, void *obj, cpHashValue hashid); +typedef void (*cpSpatialIndexReindexQueryImpl)(cpSpatialIndex *index, cpSpatialIndexQueryFunc func, void *data); + +typedef void (*cpSpatialIndexQueryImpl)(cpSpatialIndex *index, void *obj, cpBB bb, cpSpatialIndexQueryFunc func, void *data); +typedef void (*cpSpatialIndexSegmentQueryImpl)(cpSpatialIndex *index, void *obj, cpVect a, cpVect b, cpFloat t_exit, cpSpatialIndexSegmentQueryFunc func, void *data); + +struct cpSpatialIndexClass { + cpSpatialIndexDestroyImpl destroy; + + cpSpatialIndexCountImpl count; + cpSpatialIndexEachImpl each; + + cpSpatialIndexContainsImpl contains; + cpSpatialIndexInsertImpl insert; + cpSpatialIndexRemoveImpl remove; + + cpSpatialIndexReindexImpl reindex; + cpSpatialIndexReindexObjectImpl reindexObject; + cpSpatialIndexReindexQueryImpl reindexQuery; + + cpSpatialIndexQueryImpl query; + cpSpatialIndexSegmentQueryImpl segmentQuery; +}; + + +void cpSpatialIndexFree(cpSpatialIndex *index); + +void cpSpatialIndexCollideStatic(cpSpatialIndex *dynamicIndex, cpSpatialIndex *staticIndex, cpSpatialIndexQueryFunc func, void *data); + + +static inline void cpSpatialIndexDestroy(cpSpatialIndex *index) +{ + if(index->klass) index->klass->destroy(index); +} + + +static inline int cpSpatialIndexCount(cpSpatialIndex *index) +{ + return index->klass->count(index); +} + + +static inline void cpSpatialIndexEach(cpSpatialIndex *index, cpSpatialIndexIteratorFunc func, void *data) +{ + index->klass->each(index, func, data); +} + + + +static inline cpBool cpSpatialIndexContains(cpSpatialIndex *index, void *obj, cpHashValue hashid) +{ + return index->klass->contains(index, obj, hashid); +} + + + +static inline void cpSpatialIndexInsert(cpSpatialIndex *index, void *obj, cpHashValue hashid) +{ + index->klass->insert(index, obj, hashid); +} + + + +static inline void cpSpatialIndexRemove(cpSpatialIndex *index, void *obj, cpHashValue hashid) +{ + index->klass->remove(index, obj, hashid); +} + + +static inline void cpSpatialIndexReindex(cpSpatialIndex *index) +{ + index->klass->reindex(index); +} + + +static inline void cpSpatialIndexReindexObject(cpSpatialIndex *index, void *obj, cpHashValue hashid) +{ + index->klass->reindexObject(index, obj, hashid); +} + + +static inline void cpSpatialIndexQuery(cpSpatialIndex *index, void *obj, cpBB bb, cpSpatialIndexQueryFunc func, void *data) +{ + index->klass->query(index, obj, bb, func, data); +} + + +static inline void cpSpatialIndexSegmentQuery(cpSpatialIndex *index, void *obj, cpVect a, cpVect b, cpFloat t_exit, cpSpatialIndexSegmentQueryFunc func, void *data) +{ + index->klass->segmentQuery(index, obj, a, b, t_exit, func, data); +} + + + + +static inline void cpSpatialIndexReindexQuery(cpSpatialIndex *index, cpSpatialIndexQueryFunc func, void *data) +{ + index->klass->reindexQuery(index, func, data); +} + + cpFloat cpArbiterGetRestitution(const cpArbiter *arb); + + void cpArbiterSetRestitution(cpArbiter *arb, cpFloat restitution); + + cpFloat cpArbiterGetFriction(const cpArbiter *arb); + + void cpArbiterSetFriction(cpArbiter *arb, cpFloat friction); + + + cpVect cpArbiterGetSurfaceVelocity(cpArbiter *arb); + + + + void cpArbiterSetSurfaceVelocity(cpArbiter *arb, cpVect vr); + + + cpDataPointer cpArbiterGetUserData(const cpArbiter *arb); + + + void cpArbiterSetUserData(cpArbiter *arb, cpDataPointer userData); + + + + cpVect cpArbiterTotalImpulse(const cpArbiter *arb); + + + cpFloat cpArbiterTotalKE(const cpArbiter *arb); + + + + cpBool cpArbiterIgnore(cpArbiter *arb); + + + + + void cpArbiterGetShapes(const cpArbiter *arb, cpShape **a, cpShape **b); + + + + + + + + void cpArbiterGetBodies(const cpArbiter *arb, cpBody **a, cpBody **b); + + + + + +struct cpContactPointSet { + + int count; + + + cpVect normal; + + + struct { + + cpVect pointA, pointB; + + + cpFloat distance; + } points[2]; +}; + + + cpContactPointSet cpArbiterGetContactPointSet(const cpArbiter *arb); + + + + void cpArbiterSetContactPointSet(cpArbiter *arb, cpContactPointSet *set); + + + cpBool cpArbiterIsFirstContact(const cpArbiter *arb); + + cpBool cpArbiterIsRemoval(const cpArbiter *arb); + + + int cpArbiterGetCount(const cpArbiter *arb); + + cpVect cpArbiterGetNormal(const cpArbiter *arb); + + cpVect cpArbiterGetPointA(const cpArbiter *arb, int i); + + cpVect cpArbiterGetPointB(const cpArbiter *arb, int i); + + cpFloat cpArbiterGetDepth(const cpArbiter *arb, int i); + + + + cpBool cpArbiterCallWildcardBeginA(cpArbiter *arb, cpSpace *space); + + + cpBool cpArbiterCallWildcardBeginB(cpArbiter *arb, cpSpace *space); + + + + cpBool cpArbiterCallWildcardPreSolveA(cpArbiter *arb, cpSpace *space); + + + cpBool cpArbiterCallWildcardPreSolveB(cpArbiter *arb, cpSpace *space); + + + void cpArbiterCallWildcardPostSolveA(cpArbiter *arb, cpSpace *space); + + void cpArbiterCallWildcardPostSolveB(cpArbiter *arb, cpSpace *space); + + + void cpArbiterCallWildcardSeparateA(cpArbiter *arb, cpSpace *space); + + void cpArbiterCallWildcardSeparateB(cpArbiter *arb, cpSpace *space); + +typedef enum cpBodyType { + + + CP_BODY_TYPE_DYNAMIC, + + + + + CP_BODY_TYPE_KINEMATIC, + + + + CP_BODY_TYPE_STATIC, +} cpBodyType; + + +typedef void (*cpBodyVelocityFunc)(cpBody *body, cpVect gravity, cpFloat damping, cpFloat dt); + +typedef void (*cpBodyPositionFunc)(cpBody *body, cpFloat dt); + + + cpBody* cpBodyAlloc(void); + + cpBody* cpBodyInit(cpBody *body, cpFloat mass, cpFloat moment); + + cpBody* cpBodyNew(cpFloat mass, cpFloat moment); + + + cpBody* cpBodyNewKinematic(void); + + cpBody* cpBodyNewStatic(void); + + + void cpBodyDestroy(cpBody *body); + + void cpBodyFree(cpBody *body); + + + + void cpBodyActivate(cpBody *body); + + void cpBodyActivateStatic(cpBody *body, cpShape *filter); + + + void cpBodySleep(cpBody *body); + + void cpBodySleepWithGroup(cpBody *body, cpBody *group); + + + cpBool cpBodyIsSleeping(const cpBody *body); + + + cpBodyType cpBodyGetType(cpBody *body); + + void cpBodySetType(cpBody *body, cpBodyType type); + + + cpSpace* cpBodyGetSpace(const cpBody *body); + + + cpFloat cpBodyGetMass(const cpBody *body); + + void cpBodySetMass(cpBody *body, cpFloat m); + + + cpFloat cpBodyGetMoment(const cpBody *body); + + void cpBodySetMoment(cpBody *body, cpFloat i); + + + cpVect cpBodyGetPosition(const cpBody *body); + + void cpBodySetPosition(cpBody *body, cpVect pos); + + + cpVect cpBodyGetCenterOfGravity(const cpBody *body); + + void cpBodySetCenterOfGravity(cpBody *body, cpVect cog); + + + cpVect cpBodyGetVelocity(const cpBody *body); + + void cpBodySetVelocity(cpBody *body, cpVect velocity); + + + cpVect cpBodyGetForce(const cpBody *body); + + void cpBodySetForce(cpBody *body, cpVect force); + + + cpFloat cpBodyGetAngle(const cpBody *body); + + void cpBodySetAngle(cpBody *body, cpFloat a); + + + cpFloat cpBodyGetAngularVelocity(const cpBody *body); + + void cpBodySetAngularVelocity(cpBody *body, cpFloat angularVelocity); + + + cpFloat cpBodyGetTorque(const cpBody *body); + + void cpBodySetTorque(cpBody *body, cpFloat torque); + + + cpVect cpBodyGetRotation(const cpBody *body); + + + cpDataPointer cpBodyGetUserData(const cpBody *body); + + void cpBodySetUserData(cpBody *body, cpDataPointer userData); + + + void cpBodySetVelocityUpdateFunc(cpBody *body, cpBodyVelocityFunc velocityFunc); + + + void cpBodySetPositionUpdateFunc(cpBody *body, cpBodyPositionFunc positionFunc); + + + void cpBodyUpdateVelocity(cpBody *body, cpVect gravity, cpFloat damping, cpFloat dt); + + void cpBodyUpdatePosition(cpBody *body, cpFloat dt); + + + cpVect cpBodyLocalToWorld(const cpBody *body, const cpVect point); + + cpVect cpBodyWorldToLocal(const cpBody *body, const cpVect point); + + + void cpBodyApplyForceAtWorldPoint(cpBody *body, cpVect force, cpVect point); + + void cpBodyApplyForceAtLocalPoint(cpBody *body, cpVect force, cpVect point); + + + void cpBodyApplyImpulseAtWorldPoint(cpBody *body, cpVect impulse, cpVect point); + + void cpBodyApplyImpulseAtLocalPoint(cpBody *body, cpVect impulse, cpVect point); + + + cpVect cpBodyGetVelocityAtWorldPoint(const cpBody *body, cpVect point); + + cpVect cpBodyGetVelocityAtLocalPoint(const cpBody *body, cpVect point); + + + cpFloat cpBodyKineticEnergy(const cpBody *body); + + +typedef void (*cpBodyShapeIteratorFunc)(cpBody *body, cpShape *shape, void *data); + + void cpBodyEachShape(cpBody *body, cpBodyShapeIteratorFunc func, void *data); + + +typedef void (*cpBodyConstraintIteratorFunc)(cpBody *body, cpConstraint *constraint, void *data); + + void cpBodyEachConstraint(cpBody *body, cpBodyConstraintIteratorFunc func, void *data); + + +typedef void (*cpBodyArbiterIteratorFunc)(cpBody *body, cpArbiter *arbiter, void *data); + + void cpBodyEachArbiter(cpBody *body, cpBodyArbiterIteratorFunc func, void *data); +typedef struct cpPointQueryInfo { + + const cpShape *shape; + + cpVect point; + + cpFloat distance; + + + cpVect gradient; +} cpPointQueryInfo; + + +typedef struct cpSegmentQueryInfo { + + const cpShape *shape; + + cpVect point; + + cpVect normal; + + cpFloat alpha; +} cpSegmentQueryInfo; + + +typedef struct cpShapeFilter { + + + cpGroup group; + + + cpBitmask categories; + + + cpBitmask mask; +} cpShapeFilter; + + +static const cpShapeFilter CP_SHAPE_FILTER_ALL = {((cpGroup)0), (~(cpBitmask)0), (~(cpBitmask)0)}; + +static const cpShapeFilter CP_SHAPE_FILTER_NONE = {((cpGroup)0), ~(~(cpBitmask)0), ~(~(cpBitmask)0)}; + + +static inline cpShapeFilter +cpShapeFilterNew(cpGroup group, cpBitmask categories, cpBitmask mask) +{ + cpShapeFilter filter = {group, categories, mask}; + return filter; +} + + + void cpShapeDestroy(cpShape *shape); + + void cpShapeFree(cpShape *shape); + + + cpBB cpShapeCacheBB(cpShape *shape); + + cpBB cpShapeUpdate(cpShape *shape, cpTransform transform); + + + + cpFloat cpShapePointQuery(const cpShape *shape, cpVect p, cpPointQueryInfo *out); + + + cpBool cpShapeSegmentQuery(const cpShape *shape, cpVect a, cpVect b, cpFloat radius, cpSegmentQueryInfo *info); + + + cpContactPointSet cpShapesCollide(const cpShape *a, const cpShape *b); + + + cpSpace* cpShapeGetSpace(const cpShape *shape); + + + cpBody* cpShapeGetBody(const cpShape *shape); + + + void cpShapeSetBody(cpShape *shape, cpBody *body); + + +cpFloat cpShapeGetMass(cpShape *shape); + + void cpShapeSetMass(cpShape *shape, cpFloat mass); + + + cpFloat cpShapeGetDensity(cpShape *shape); + + void cpShapeSetDensity(cpShape *shape, cpFloat density); + + + cpFloat cpShapeGetMoment(cpShape *shape); + + cpFloat cpShapeGetArea(cpShape *shape); + + cpVect cpShapeGetCenterOfGravity(cpShape *shape); + + + cpBB cpShapeGetBB(const cpShape *shape); + + + cpBool cpShapeGetSensor(const cpShape *shape); + + void cpShapeSetSensor(cpShape *shape, cpBool sensor); + + + cpFloat cpShapeGetElasticity(const cpShape *shape); + + void cpShapeSetElasticity(cpShape *shape, cpFloat elasticity); + + + cpFloat cpShapeGetFriction(const cpShape *shape); + + void cpShapeSetFriction(cpShape *shape, cpFloat friction); + + + cpVect cpShapeGetSurfaceVelocity(const cpShape *shape); + + void cpShapeSetSurfaceVelocity(cpShape *shape, cpVect surfaceVelocity); + + + cpDataPointer cpShapeGetUserData(const cpShape *shape); + + void cpShapeSetUserData(cpShape *shape, cpDataPointer userData); + + + cpCollisionType cpShapeGetCollisionType(const cpShape *shape); + + void cpShapeSetCollisionType(cpShape *shape, cpCollisionType collisionType); + + + cpShapeFilter cpShapeGetFilter(const cpShape *shape); + + void cpShapeSetFilter(cpShape *shape, cpShapeFilter filter); + + + + + + + cpCircleShape* cpCircleShapeAlloc(void); + + cpCircleShape* cpCircleShapeInit(cpCircleShape *circle, cpBody *body, cpFloat radius, cpVect offset); + + cpShape* cpCircleShapeNew(cpBody *body, cpFloat radius, cpVect offset); + + + cpVect cpCircleShapeGetOffset(const cpShape *shape); + + cpFloat cpCircleShapeGetRadius(const cpShape *shape); + + + + + + cpSegmentShape* cpSegmentShapeAlloc(void); + + cpSegmentShape* cpSegmentShapeInit(cpSegmentShape *seg, cpBody *body, cpVect a, cpVect b, cpFloat radius); + + cpShape* cpSegmentShapeNew(cpBody *body, cpVect a, cpVect b, cpFloat radius); + + + void cpSegmentShapeSetNeighbors(cpShape *shape, cpVect prev, cpVect next); + + + cpVect cpSegmentShapeGetA(const cpShape *shape); + + cpVect cpSegmentShapeGetB(const cpShape *shape); + + cpVect cpSegmentShapeGetNormal(const cpShape *shape); + + cpFloat cpSegmentShapeGetRadius(const cpShape *shape); + cpPolyShape* cpPolyShapeAlloc(void); + + + cpPolyShape* cpPolyShapeInit(cpPolyShape *poly, cpBody *body, int count, const cpVect *verts, cpTransform transform, cpFloat radius); + + + cpPolyShape* cpPolyShapeInitRaw(cpPolyShape *poly, cpBody *body, int count, const cpVect *verts, cpFloat radius); + + + cpShape* cpPolyShapeNew(cpBody *body, int count, const cpVect *verts, cpTransform transform, cpFloat radius); + + + cpShape* cpPolyShapeNewRaw(cpBody *body, int count, const cpVect *verts, cpFloat radius); + + + cpPolyShape* cpBoxShapeInit(cpPolyShape *poly, cpBody *body, cpFloat width, cpFloat height, cpFloat radius); + + cpPolyShape* cpBoxShapeInit2(cpPolyShape *poly, cpBody *body, cpBB box, cpFloat radius); + + cpShape* cpBoxShapeNew(cpBody *body, cpFloat width, cpFloat height, cpFloat radius); + + cpShape* cpBoxShapeNew2(cpBody *body, cpBB box, cpFloat radius); + + + int cpPolyShapeGetCount(const cpShape *shape); + + cpVect cpPolyShapeGetVert(const cpShape *shape, int index); + + cpFloat cpPolyShapeGetRadius(const cpShape *shape); + +typedef void (*cpConstraintPreSolveFunc)(cpConstraint *constraint, cpSpace *space); + +typedef void (*cpConstraintPostSolveFunc)(cpConstraint *constraint, cpSpace *space); + + + void cpConstraintDestroy(cpConstraint *constraint); + + void cpConstraintFree(cpConstraint *constraint); + + + cpSpace* cpConstraintGetSpace(const cpConstraint *constraint); + + + cpBody* cpConstraintGetBodyA(const cpConstraint *constraint); + + + cpBody* cpConstraintGetBodyB(const cpConstraint *constraint); + + + cpFloat cpConstraintGetMaxForce(const cpConstraint *constraint); + + void cpConstraintSetMaxForce(cpConstraint *constraint, cpFloat maxForce); + + + cpFloat cpConstraintGetErrorBias(const cpConstraint *constraint); + + + + void cpConstraintSetErrorBias(cpConstraint *constraint, cpFloat errorBias); + + + cpFloat cpConstraintGetMaxBias(const cpConstraint *constraint); + + void cpConstraintSetMaxBias(cpConstraint *constraint, cpFloat maxBias); + + + cpBool cpConstraintGetCollideBodies(const cpConstraint *constraint); + + void cpConstraintSetCollideBodies(cpConstraint *constraint, cpBool collideBodies); + + + cpConstraintPreSolveFunc cpConstraintGetPreSolveFunc(const cpConstraint *constraint); + + void cpConstraintSetPreSolveFunc(cpConstraint *constraint, cpConstraintPreSolveFunc preSolveFunc); + + + cpConstraintPostSolveFunc cpConstraintGetPostSolveFunc(const cpConstraint *constraint); + + void cpConstraintSetPostSolveFunc(cpConstraint *constraint, cpConstraintPostSolveFunc postSolveFunc); + + + cpDataPointer cpConstraintGetUserData(const cpConstraint *constraint); + + void cpConstraintSetUserData(cpConstraint *constraint, cpDataPointer userData); + + + cpFloat cpConstraintGetImpulse(cpConstraint *constraint); + + + cpBool cpConstraintIsPinJoint(const cpConstraint *constraint); + + + cpPinJoint* cpPinJointAlloc(void); + + cpPinJoint* cpPinJointInit(cpPinJoint *joint, cpBody *a, cpBody *b, cpVect anchorA, cpVect anchorB); + + cpConstraint* cpPinJointNew(cpBody *a, cpBody *b, cpVect anchorA, cpVect anchorB); + + + cpVect cpPinJointGetAnchorA(const cpConstraint *constraint); + + void cpPinJointSetAnchorA(cpConstraint *constraint, cpVect anchorA); + + + cpVect cpPinJointGetAnchorB(const cpConstraint *constraint); + + void cpPinJointSetAnchorB(cpConstraint *constraint, cpVect anchorB); + + + cpFloat cpPinJointGetDist(const cpConstraint *constraint); + + void cpPinJointSetDist(cpConstraint *constraint, cpFloat dist); + cpBool cpConstraintIsSlideJoint(const cpConstraint *constraint); + + + cpSlideJoint* cpSlideJointAlloc(void); + + cpSlideJoint* cpSlideJointInit(cpSlideJoint *joint, cpBody *a, cpBody *b, cpVect anchorA, cpVect anchorB, cpFloat min, cpFloat max); + + cpConstraint* cpSlideJointNew(cpBody *a, cpBody *b, cpVect anchorA, cpVect anchorB, cpFloat min, cpFloat max); + + + cpVect cpSlideJointGetAnchorA(const cpConstraint *constraint); + + void cpSlideJointSetAnchorA(cpConstraint *constraint, cpVect anchorA); + + + cpVect cpSlideJointGetAnchorB(const cpConstraint *constraint); + + void cpSlideJointSetAnchorB(cpConstraint *constraint, cpVect anchorB); + + + cpFloat cpSlideJointGetMin(const cpConstraint *constraint); + + void cpSlideJointSetMin(cpConstraint *constraint, cpFloat min); + + + cpFloat cpSlideJointGetMax(const cpConstraint *constraint); + + void cpSlideJointSetMax(cpConstraint *constraint, cpFloat max); + cpBool cpConstraintIsPivotJoint(const cpConstraint *constraint); + + + cpPivotJoint* cpPivotJointAlloc(void); + + cpPivotJoint* cpPivotJointInit(cpPivotJoint *joint, cpBody *a, cpBody *b, cpVect anchorA, cpVect anchorB); + + cpConstraint* cpPivotJointNew(cpBody *a, cpBody *b, cpVect pivot); + + cpConstraint* cpPivotJointNew2(cpBody *a, cpBody *b, cpVect anchorA, cpVect anchorB); + + + cpVect cpPivotJointGetAnchorA(const cpConstraint *constraint); + + void cpPivotJointSetAnchorA(cpConstraint *constraint, cpVect anchorA); + + + cpVect cpPivotJointGetAnchorB(const cpConstraint *constraint); + + void cpPivotJointSetAnchorB(cpConstraint *constraint, cpVect anchorB); + cpBool cpConstraintIsGrooveJoint(const cpConstraint *constraint); + + + cpGrooveJoint* cpGrooveJointAlloc(void); + + cpGrooveJoint* cpGrooveJointInit(cpGrooveJoint *joint, cpBody *a, cpBody *b, cpVect groove_a, cpVect groove_b, cpVect anchorB); + + cpConstraint* cpGrooveJointNew(cpBody *a, cpBody *b, cpVect groove_a, cpVect groove_b, cpVect anchorB); + + + cpVect cpGrooveJointGetGrooveA(const cpConstraint *constraint); + + void cpGrooveJointSetGrooveA(cpConstraint *constraint, cpVect grooveA); + + + cpVect cpGrooveJointGetGrooveB(const cpConstraint *constraint); + + void cpGrooveJointSetGrooveB(cpConstraint *constraint, cpVect grooveB); + + + cpVect cpGrooveJointGetAnchorB(const cpConstraint *constraint); + + void cpGrooveJointSetAnchorB(cpConstraint *constraint, cpVect anchorB); + cpBool cpConstraintIsDampedSpring(const cpConstraint *constraint); + + +typedef cpFloat (*cpDampedSpringForceFunc)(cpConstraint *spring, cpFloat dist); + + + cpDampedSpring* cpDampedSpringAlloc(void); + + cpDampedSpring* cpDampedSpringInit(cpDampedSpring *joint, cpBody *a, cpBody *b, cpVect anchorA, cpVect anchorB, cpFloat restLength, cpFloat stiffness, cpFloat damping); + + cpConstraint* cpDampedSpringNew(cpBody *a, cpBody *b, cpVect anchorA, cpVect anchorB, cpFloat restLength, cpFloat stiffness, cpFloat damping); + + + cpVect cpDampedSpringGetAnchorA(const cpConstraint *constraint); + + void cpDampedSpringSetAnchorA(cpConstraint *constraint, cpVect anchorA); + + + cpVect cpDampedSpringGetAnchorB(const cpConstraint *constraint); + + void cpDampedSpringSetAnchorB(cpConstraint *constraint, cpVect anchorB); + + + cpFloat cpDampedSpringGetRestLength(const cpConstraint *constraint); + + void cpDampedSpringSetRestLength(cpConstraint *constraint, cpFloat restLength); + + + cpFloat cpDampedSpringGetStiffness(const cpConstraint *constraint); + + void cpDampedSpringSetStiffness(cpConstraint *constraint, cpFloat stiffness); + + + cpFloat cpDampedSpringGetDamping(const cpConstraint *constraint); + + void cpDampedSpringSetDamping(cpConstraint *constraint, cpFloat damping); + + + cpDampedSpringForceFunc cpDampedSpringGetSpringForceFunc(const cpConstraint *constraint); + + void cpDampedSpringSetSpringForceFunc(cpConstraint *constraint, cpDampedSpringForceFunc springForceFunc); + cpBool cpConstraintIsDampedRotarySpring(const cpConstraint *constraint); + + +typedef cpFloat (*cpDampedRotarySpringTorqueFunc)(struct cpConstraint *spring, cpFloat relativeAngle); + + + cpDampedRotarySpring* cpDampedRotarySpringAlloc(void); + + cpDampedRotarySpring* cpDampedRotarySpringInit(cpDampedRotarySpring *joint, cpBody *a, cpBody *b, cpFloat restAngle, cpFloat stiffness, cpFloat damping); + + cpConstraint* cpDampedRotarySpringNew(cpBody *a, cpBody *b, cpFloat restAngle, cpFloat stiffness, cpFloat damping); + + + cpFloat cpDampedRotarySpringGetRestAngle(const cpConstraint *constraint); + + void cpDampedRotarySpringSetRestAngle(cpConstraint *constraint, cpFloat restAngle); + + + cpFloat cpDampedRotarySpringGetStiffness(const cpConstraint *constraint); + + void cpDampedRotarySpringSetStiffness(cpConstraint *constraint, cpFloat stiffness); + + + cpFloat cpDampedRotarySpringGetDamping(const cpConstraint *constraint); + + void cpDampedRotarySpringSetDamping(cpConstraint *constraint, cpFloat damping); + + + cpDampedRotarySpringTorqueFunc cpDampedRotarySpringGetSpringTorqueFunc(const cpConstraint *constraint); + + void cpDampedRotarySpringSetSpringTorqueFunc(cpConstraint *constraint, cpDampedRotarySpringTorqueFunc springTorqueFunc); + cpBool cpConstraintIsRotaryLimitJoint(const cpConstraint *constraint); + + + cpRotaryLimitJoint* cpRotaryLimitJointAlloc(void); + + cpRotaryLimitJoint* cpRotaryLimitJointInit(cpRotaryLimitJoint *joint, cpBody *a, cpBody *b, cpFloat min, cpFloat max); + + cpConstraint* cpRotaryLimitJointNew(cpBody *a, cpBody *b, cpFloat min, cpFloat max); + + + cpFloat cpRotaryLimitJointGetMin(const cpConstraint *constraint); + + void cpRotaryLimitJointSetMin(cpConstraint *constraint, cpFloat min); + + + cpFloat cpRotaryLimitJointGetMax(const cpConstraint *constraint); + + void cpRotaryLimitJointSetMax(cpConstraint *constraint, cpFloat max); + cpBool cpConstraintIsRatchetJoint(const cpConstraint *constraint); + + + cpRatchetJoint* cpRatchetJointAlloc(void); + + cpRatchetJoint* cpRatchetJointInit(cpRatchetJoint *joint, cpBody *a, cpBody *b, cpFloat phase, cpFloat ratchet); + + cpConstraint* cpRatchetJointNew(cpBody *a, cpBody *b, cpFloat phase, cpFloat ratchet); + + + cpFloat cpRatchetJointGetAngle(const cpConstraint *constraint); + + void cpRatchetJointSetAngle(cpConstraint *constraint, cpFloat angle); + + + cpFloat cpRatchetJointGetPhase(const cpConstraint *constraint); + + void cpRatchetJointSetPhase(cpConstraint *constraint, cpFloat phase); + + + cpFloat cpRatchetJointGetRatchet(const cpConstraint *constraint); + + void cpRatchetJointSetRatchet(cpConstraint *constraint, cpFloat ratchet); + cpBool cpConstraintIsGearJoint(const cpConstraint *constraint); + + + cpGearJoint* cpGearJointAlloc(void); + + cpGearJoint* cpGearJointInit(cpGearJoint *joint, cpBody *a, cpBody *b, cpFloat phase, cpFloat ratio); + + cpConstraint* cpGearJointNew(cpBody *a, cpBody *b, cpFloat phase, cpFloat ratio); + + + cpFloat cpGearJointGetPhase(const cpConstraint *constraint); + + void cpGearJointSetPhase(cpConstraint *constraint, cpFloat phase); + + + cpFloat cpGearJointGetRatio(const cpConstraint *constraint); + + void cpGearJointSetRatio(cpConstraint *constraint, cpFloat ratio); +typedef struct cpSimpleMotor cpSimpleMotor; + + + cpBool cpConstraintIsSimpleMotor(const cpConstraint *constraint); + + + cpSimpleMotor* cpSimpleMotorAlloc(void); + + cpSimpleMotor* cpSimpleMotorInit(cpSimpleMotor *joint, cpBody *a, cpBody *b, cpFloat rate); + + cpConstraint* cpSimpleMotorNew(cpBody *a, cpBody *b, cpFloat rate); + + + cpFloat cpSimpleMotorGetRate(const cpConstraint *constraint); + + void cpSimpleMotorSetRate(cpConstraint *constraint, cpFloat rate); + +typedef cpBool (*cpCollisionBeginFunc)(cpArbiter *arb, cpSpace *space, cpDataPointer userData); + + +typedef cpBool (*cpCollisionPreSolveFunc)(cpArbiter *arb, cpSpace *space, cpDataPointer userData); + +typedef void (*cpCollisionPostSolveFunc)(cpArbiter *arb, cpSpace *space, cpDataPointer userData); + +typedef void (*cpCollisionSeparateFunc)(cpArbiter *arb, cpSpace *space, cpDataPointer userData); + + + +struct cpCollisionHandler { + + + const cpCollisionType typeA; + + + const cpCollisionType typeB; + + cpCollisionBeginFunc beginFunc; + + + cpCollisionPreSolveFunc preSolveFunc; + + + cpCollisionPostSolveFunc postSolveFunc; + + cpCollisionSeparateFunc separateFunc; + + cpDataPointer userData; +}; + + + + + + + + cpSpace* cpSpaceAlloc(void); + + cpSpace* cpSpaceInit(cpSpace *space); + + cpSpace* cpSpaceNew(void); + + + void cpSpaceDestroy(cpSpace *space); + + void cpSpaceFree(cpSpace *space); + + + + + + int cpSpaceGetIterations(const cpSpace *space); + void cpSpaceSetIterations(cpSpace *space, int iterations); + + + cpVect cpSpaceGetGravity(const cpSpace *space); + void cpSpaceSetGravity(cpSpace *space, cpVect gravity); + + + + + + cpFloat cpSpaceGetDamping(const cpSpace *space); + void cpSpaceSetDamping(cpSpace *space, cpFloat damping); + + + + cpFloat cpSpaceGetIdleSpeedThreshold(const cpSpace *space); + void cpSpaceSetIdleSpeedThreshold(cpSpace *space, cpFloat idleSpeedThreshold); + + + + + cpFloat cpSpaceGetSleepTimeThreshold(const cpSpace *space); + void cpSpaceSetSleepTimeThreshold(cpSpace *space, cpFloat sleepTimeThreshold); + + + + + + cpFloat cpSpaceGetCollisionSlop(const cpSpace *space); + void cpSpaceSetCollisionSlop(cpSpace *space, cpFloat collisionSlop); + + + + + cpFloat cpSpaceGetCollisionBias(const cpSpace *space); + void cpSpaceSetCollisionBias(cpSpace *space, cpFloat collisionBias); + + + + cpTimestamp cpSpaceGetCollisionPersistence(const cpSpace *space); + void cpSpaceSetCollisionPersistence(cpSpace *space, cpTimestamp collisionPersistence); + + + + + cpDataPointer cpSpaceGetUserData(const cpSpace *space); + void cpSpaceSetUserData(cpSpace *space, cpDataPointer userData); + + + + cpBody* cpSpaceGetStaticBody(const cpSpace *space); + + + + cpFloat cpSpaceGetCurrentTimeStep(const cpSpace *space); + + + cpBool cpSpaceIsLocked(cpSpace *space); + + + + + + cpCollisionHandler *cpSpaceAddDefaultCollisionHandler(cpSpace *space); + + + cpCollisionHandler *cpSpaceAddCollisionHandler(cpSpace *space, cpCollisionType a, cpCollisionType b); + + cpCollisionHandler *cpSpaceAddWildcardHandler(cpSpace *space, cpCollisionType type); + + + + + + + cpShape* cpSpaceAddShape(cpSpace *space, cpShape *shape); + + cpBody* cpSpaceAddBody(cpSpace *space, cpBody *body); + + cpConstraint* cpSpaceAddConstraint(cpSpace *space, cpConstraint *constraint); + + + void cpSpaceRemoveShape(cpSpace *space, cpShape *shape); + + void cpSpaceRemoveBody(cpSpace *space, cpBody *body); + + void cpSpaceRemoveConstraint(cpSpace *space, cpConstraint *constraint); + + + cpBool cpSpaceContainsShape(cpSpace *space, cpShape *shape); + + cpBool cpSpaceContainsBody(cpSpace *space, cpBody *body); + + cpBool cpSpaceContainsConstraint(cpSpace *space, cpConstraint *constraint); + + + + +typedef void (*cpPostStepFunc)(cpSpace *space, void *key, void *data); + + + + + cpBool cpSpaceAddPostStepCallback(cpSpace *space, cpPostStepFunc func, void *key, void *data); +typedef void (*cpSpacePointQueryFunc)(cpShape *shape, cpVect point, cpFloat distance, cpVect gradient, void *data); + + void cpSpacePointQuery(cpSpace *space, cpVect point, cpFloat maxDistance, cpShapeFilter filter, cpSpacePointQueryFunc func, void *data); + + cpShape *cpSpacePointQueryNearest(cpSpace *space, cpVect point, cpFloat maxDistance, cpShapeFilter filter, cpPointQueryInfo *out); + + +typedef void (*cpSpaceSegmentQueryFunc)(cpShape *shape, cpVect point, cpVect normal, cpFloat alpha, void *data); + + void cpSpaceSegmentQuery(cpSpace *space, cpVect start, cpVect end, cpFloat radius, cpShapeFilter filter, cpSpaceSegmentQueryFunc func, void *data); + + cpShape *cpSpaceSegmentQueryFirst(cpSpace *space, cpVect start, cpVect end, cpFloat radius, cpShapeFilter filter, cpSegmentQueryInfo *out); + + +typedef void (*cpSpaceBBQueryFunc)(cpShape *shape, void *data); + + + void cpSpaceBBQuery(cpSpace *space, cpBB bb, cpShapeFilter filter, cpSpaceBBQueryFunc func, void *data); + + +typedef void (*cpSpaceShapeQueryFunc)(cpShape *shape, cpContactPointSet *points, void *data); + + cpBool cpSpaceShapeQuery(cpSpace *space, cpShape *shape, cpSpaceShapeQueryFunc func, void *data); + + + + + +typedef void (*cpSpaceBodyIteratorFunc)(cpBody *body, void *data); + + void cpSpaceEachBody(cpSpace *space, cpSpaceBodyIteratorFunc func, void *data); + + +typedef void (*cpSpaceShapeIteratorFunc)(cpShape *shape, void *data); + + void cpSpaceEachShape(cpSpace *space, cpSpaceShapeIteratorFunc func, void *data); + + +typedef void (*cpSpaceConstraintIteratorFunc)(cpConstraint *constraint, void *data); + + void cpSpaceEachConstraint(cpSpace *space, cpSpaceConstraintIteratorFunc func, void *data); + + + + + + void cpSpaceReindexStatic(cpSpace *space); + + void cpSpaceReindexShape(cpSpace *space, cpShape *shape); + + void cpSpaceReindexShapesForBody(cpSpace *space, cpBody *body); + + + void cpSpaceUseSpatialHash(cpSpace *space, cpFloat dim, int count); + + + + + + void cpSpaceStep(cpSpace *space, cpFloat dt); + + + + + + + +typedef struct cpSpaceDebugColor { + float r, g, b, a; +} cpSpaceDebugColor; + + +typedef void (*cpSpaceDebugDrawCircleImpl)(cpVect pos, cpFloat angle, cpFloat radius, cpSpaceDebugColor outlineColor, cpSpaceDebugColor fillColor, cpDataPointer data); + +typedef void (*cpSpaceDebugDrawSegmentImpl)(cpVect a, cpVect b, cpSpaceDebugColor color, cpDataPointer data); + +typedef void (*cpSpaceDebugDrawFatSegmentImpl)(cpVect a, cpVect b, cpFloat radius, cpSpaceDebugColor outlineColor, cpSpaceDebugColor fillColor, cpDataPointer data); + +typedef void (*cpSpaceDebugDrawPolygonImpl)(int count, const cpVect *verts, cpFloat radius, cpSpaceDebugColor outlineColor, cpSpaceDebugColor fillColor, cpDataPointer data); + +typedef void (*cpSpaceDebugDrawDotImpl)(cpFloat size, cpVect pos, cpSpaceDebugColor color, cpDataPointer data); + +typedef cpSpaceDebugColor (*cpSpaceDebugDrawColorForShapeImpl)(cpShape *shape, cpDataPointer data); + +typedef enum cpSpaceDebugDrawFlags { + CP_SPACE_DEBUG_DRAW_SHAPES = 1<<0, + CP_SPACE_DEBUG_DRAW_CONSTRAINTS = 1<<1, + CP_SPACE_DEBUG_DRAW_COLLISION_POINTS = 1<<2, +} cpSpaceDebugDrawFlags; + + +typedef struct cpSpaceDebugDrawOptions { + + cpSpaceDebugDrawCircleImpl drawCircle; + + cpSpaceDebugDrawSegmentImpl drawSegment; + + cpSpaceDebugDrawFatSegmentImpl drawFatSegment; + + cpSpaceDebugDrawPolygonImpl drawPolygon; + + cpSpaceDebugDrawDotImpl drawDot; + + + cpSpaceDebugDrawFlags flags; + + cpSpaceDebugColor shapeOutlineColor; + + cpSpaceDebugDrawColorForShapeImpl colorForShape; + + cpSpaceDebugColor constraintColor; + + cpSpaceDebugColor collisionPointColor; + + + cpDataPointer data; +} cpSpaceDebugDrawOptions; + + + void cpSpaceDebugDraw(cpSpace *space, cpSpaceDebugDrawOptions *options); + + + + + + + + extern const char *cpVersionString; + + + + cpFloat cpMomentForCircle(cpFloat m, cpFloat r1, cpFloat r2, cpVect offset); + + + + cpFloat cpAreaForCircle(cpFloat r1, cpFloat r2); + + + + cpFloat cpMomentForSegment(cpFloat m, cpVect a, cpVect b, cpFloat radius); + + + cpFloat cpAreaForSegment(cpVect a, cpVect b, cpFloat radius); + + + cpFloat cpMomentForPoly(cpFloat m, int count, const cpVect *verts, cpVect offset, cpFloat radius); + + + + cpFloat cpAreaForPoly(const int count, const cpVect *verts, cpFloat radius); + + + cpVect cpCentroidForPoly(const int count, const cpVect *verts); + + + cpFloat cpMomentForBox(cpFloat m, cpFloat width, cpFloat height); + + + cpFloat cpMomentForBox2(cpFloat m, cpBB box); + + + + + + int cpConvexHull(int count, const cpVect *verts, cpVect *result, int *first, cpFloat tol); +static inline cpVect +cpClosetPointOnSegment(const cpVect p, const cpVect a, const cpVect b) +{ + cpVect delta = cpvsub(a, b); + cpFloat t = cpfclamp01(cpvdot(delta, cpvsub(p, b))/cpvlengthsq(delta)); + return cpvadd(b, cpvmult(delta, t)); +} + + + + + + + +void cpSpaceEachBody_b(cpSpace *space, void (^block)(cpBody *body)); +void cpSpaceEachShape_b(cpSpace *space, void (^block)(cpShape *shape)); +void cpSpaceEachConstraint_b(cpSpace *space, void (^block)(cpConstraint *constraint)); + +void cpBodyEachShape_b(cpBody *body, void (^block)(cpShape *shape)); +void cpBodyEachConstraint_b(cpBody *body, void (^block)(cpConstraint *constraint)); +void cpBodyEachArbiter_b(cpBody *body, void (^block)(cpArbiter *arbiter)); + +typedef void (^cpSpacePointQueryBlock)(cpShape *shape, cpVect point, cpFloat distance, cpVect gradient); +void cpSpacePointQuery_b(cpSpace *space, cpVect point, cpFloat maxDistance, cpShapeFilter filter, cpSpacePointQueryBlock block); + +typedef void (^cpSpaceSegmentQueryBlock)(cpShape *shape, cpVect point, cpVect normal, cpFloat alpha); +void cpSpaceSegmentQuery_b(cpSpace *space, cpVect start, cpVect end, cpFloat radius, cpShapeFilter filter, cpSpaceSegmentQueryBlock block); + +typedef void (^cpSpaceBBQueryBlock)(cpShape *shape); +void cpSpaceBBQuery_b(cpSpace *space, cpBB bb, cpShapeFilter filter, cpSpaceBBQueryBlock block); + +typedef void (^cpSpaceShapeQueryBlock)(cpShape *shape, cpContactPointSet *points); +cpBool cpSpaceShapeQuery_b(cpSpace *space, cpShape *shape, cpSpaceShapeQueryBlock block); + diff --git a/chipmunk.lua b/chipmunk.lua new file mode 100644 index 0000000..53f56e1 --- /dev/null +++ b/chipmunk.lua @@ -0,0 +1,10 @@ +--=========== Copyright © 2016, Planimeter, All rights reserved. =============-- +-- +-- Purpose: +-- +--============================================================================-- + +local ffi = require( "ffi" ) +io.input( "chipmunk.h" ) +ffi.cdef( io.read( "*all" ) ) +return ffi.load( "chipmunk" )