From 6ca30dd9a8ec5e85d593c3a38c0dce979bfa026a Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Thu, 19 Oct 2017 22:23:08 -0400 Subject: [PATCH] Add support for CFUUID --- core-foundation-sys/src/lib.rs | 1 + core-foundation-sys/src/uuid.rs | 43 +++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 core-foundation-sys/src/uuid.rs diff --git a/core-foundation-sys/src/lib.rs b/core-foundation-sys/src/lib.rs index 96c0b1e..932c353 100644 --- a/core-foundation-sys/src/lib.rs +++ b/core-foundation-sys/src/lib.rs @@ -26,3 +26,4 @@ pub mod runloop; pub mod set; pub mod string; pub mod url; +pub mod uuid; diff --git a/core-foundation-sys/src/uuid.rs b/core-foundation-sys/src/uuid.rs new file mode 100644 index 0000000..21e8c89 --- /dev/null +++ b/core-foundation-sys/src/uuid.rs @@ -0,0 +1,43 @@ +// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. +use libc::c_void; + +use base::CFAllocatorRef; + +#[repr(C)] +pub struct __CFUUID(c_void); + +pub type CFUUIDRef = *const __CFUUID; + +#[repr(C)] +pub struct CFUUIDBytes { + byte0: u8, + byte1: u8, + byte2: u8, + byte3: u8, + byte4: u8, + byte5: u8, + byte6: u8, + byte7: u8, + byte8: u8, + byte9: u8, + byte10: u8, + byte11: u8, + byte12: u8, + byte13: u8, + byte14: u8, + byte15: u8 +} + +extern { + /* + * CFUUID.h + */ + pub fn CFUUIDCreateFromUUIDBytes(allocator: CFAllocatorRef, bytes: CFUUIDBytes) -> CFUUIDRef; +}