├── libddsc-sys ├── wrapper.h ├── Cargo.toml ├── src │ └── lib.rs ├── build.rs └── LICENSE ├── .gitmodules ├── .gitignore ├── Cargo.toml ├── README.md ├── .github └── workflows │ └── rust.yml ├── src └── lib.rs └── LICENSE /libddsc-sys/wrapper.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "libddsc-sys/src/cyclonedds"] 2 | path = libddsc-sys/src/cyclonedds 3 | url = https://github.com/eclipse-cyclonedds/cyclonedds.git 4 | shallow = true 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | /target/ 4 | 5 | # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries 6 | # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html 7 | Cargo.lock 8 | 9 | # These are backup files generated by rustfmt 10 | **/*.rs.bk 11 | -------------------------------------------------------------------------------- /libddsc-sys/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "libddsc-sys" 3 | version = "0.1.2" 4 | authors = ["kydos ", "Esteve Fernandez "] 5 | license = "Apache-2.0" 6 | links = "ddsc-util" 7 | edition = "2018" 8 | description = """ 9 | Native bindings to libddsc (CycloneDDS). 10 | """ 11 | build="build.rs" 12 | 13 | [dependencies] 14 | libc = "0.2.67" 15 | 16 | [lib] 17 | name = "libddsc_sys" 18 | path = "src/lib.rs" 19 | 20 | [build-dependencies] 21 | bindgen = "0.55.1" 22 | cmake = "0.1.44" 23 | 24 | [features] 25 | default = [] 26 | static = [] 27 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ddsc" 3 | version = "0.1.2" 4 | authors = ["kydos ", "Esteve Fernandez "] 5 | license = "Apache-2.0" 6 | readme = "README.md" 7 | keywords = ["DDS", "CycloneDDS"] 8 | repository = "https://github.com/atolabs/cdds-rust" 9 | documentation = "https://docs.rs/ddsc" 10 | description = """ 11 | High-level API for the native CycloneDDS bindings (libddsc-sys). 12 | """ 13 | categories = ["api-bindings"] 14 | edition = "2018" 15 | 16 | [lib] 17 | name = "dds" 18 | 19 | [dependencies] 20 | libc = "0.2.67" 21 | libddsc-sys = { path = "libddsc-sys", version = "0.1.2" } 22 | 23 | [features] 24 | default = [] 25 | static = ["libddsc-sys/static"] 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dds-rs 2 | 3 | CycloneDDS bindings for Rust 4 | 5 | ```toml 6 | [dependencies] 7 | ddsc = "0.1.2" 8 | ``` 9 | 10 | ## Rust version requirements 11 | 12 | dds-rs works with stable Rust, and typically works with the most recent prior 13 | stable release as well. 14 | 15 | ## Version of libddsc 16 | 17 | Currently this library requires CycloneDDS 0.5.1 or newer. 18 | 19 | ## Building ddsc 20 | 21 | ```sh 22 | $ git clone https://github.com/atolab/cdds-rust 23 | $ cd cdds-rust 24 | $ cargo build 25 | ``` 26 | 27 | # License 28 | 29 | This project is licensed under Apache License, Version 2.0 ([LICENSE](LICENSE) or http://www.apache.org/licenses/LICENSE-2.0) 30 | 31 | ### Contribution 32 | 33 | Unless you explicitly state otherwise, any contribution intentionally submitted 34 | for inclusion in dds-rs by you, as defined in the Apache-2.0 license, shall be 35 | under the same license, without any additional terms or conditions. 36 | -------------------------------------------------------------------------------- /libddsc-sys/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(non_upper_case_globals)] 2 | #![allow(non_camel_case_types)] 3 | #![allow(non_snake_case)] 4 | 5 | pub const DDS_MIN_PSEUDO_HANDLE: dds_entity_t = 0x7fff0000 as dds_entity_t; 6 | 7 | /* @defgroup builtintopic_constants Convenience constants for referring to builtin topics 8 | * 9 | * These constants can be used in place of an actual dds_topic_t, when creating 10 | * readers or writers for builtin-topics. 11 | * 12 | * @{ 13 | */ 14 | pub const DDS_BUILTIN_TOPIC_DCPSPARTICIPANT: dds_entity_t = 15 | (DDS_MIN_PSEUDO_HANDLE + 1) as dds_entity_t; 16 | pub const DDS_BUILTIN_TOPIC_DCPSTOPIC: dds_entity_t = (DDS_MIN_PSEUDO_HANDLE + 2) as dds_entity_t; 17 | pub const DDS_BUILTIN_TOPIC_DCPSPUBLICATION: dds_entity_t = 18 | (DDS_MIN_PSEUDO_HANDLE + 3) as dds_entity_t; 19 | pub const DDS_BUILTIN_TOPIC_DCPSSUBSCRIPTION: dds_entity_t = 20 | (DDS_MIN_PSEUDO_HANDLE + 4) as dds_entity_t; 21 | 22 | /** Special handle representing the entity corresponding to the CycloneDDS library itself */ 23 | pub const DDS_CYCLONEDDS_HANDLE: dds_entity_t = (DDS_MIN_PSEUDO_HANDLE + 256) as dds_entity_t; 24 | 25 | pub const DDS_DOMAIN_DEFAULT: u32 = 0xffffffff as u32; 26 | 27 | include!(concat!(env!("OUT_DIR"), "/bindings.rs")); 28 | -------------------------------------------------------------------------------- /libddsc-sys/build.rs: -------------------------------------------------------------------------------- 1 | extern crate bindgen; 2 | extern crate cmake; 3 | 4 | use cmake::Config; 5 | use std::env; 6 | use std::path::Path; 7 | use std::path::PathBuf; 8 | use std::process::Command; 9 | 10 | fn build_static_cyclonedds() -> String { 11 | if !Path::new("src/cyclonedds/.git").exists() { 12 | let _ = Command::new("git") 13 | .args(&["submodule", "update", "--init", "src/cyclonedds"]) 14 | .status(); 15 | } 16 | 17 | let dst = Config::new("src/cyclonedds") 18 | .define("BUILD_IDLC", "OFF") 19 | .define("BUILD_SHARED_LIBS", "OFF") 20 | .build(); 21 | 22 | println!("cargo:rustc-link-search=native={}/lib", dst.display()); 23 | println!("cargo:rustc-link-lib=static=ddsc"); 24 | 25 | // Link against OpenSSL libraries 26 | if cfg!(target_os = "linux") { 27 | println!("cargo:rustc-link-lib=crypto"); 28 | println!("cargo:rustc-link-lib=ssl"); 29 | } 30 | 31 | format!("-I{}/include", dst.display()) 32 | } 33 | 34 | fn main() { 35 | let bindgen_builder = bindgen::Builder::default() 36 | .header("wrapper.h") 37 | .generate_comments(false); 38 | 39 | let bindings = if cfg!(feature = "static") { 40 | bindgen_builder.clang_arg(build_static_cyclonedds()) 41 | } else { 42 | println!("cargo:rustc-link-lib=ddsc"); 43 | println!("cargo:rustc-link-search=/opt/ros/foxy/lib/x86_64-linux-gnu"); 44 | println!("cargo:rustc-link-search=/opt/ros/eloquent/lib"); 45 | println!("cargo:rustc-link-search=/opt/ros/dashing/lib"); 46 | bindgen_builder 47 | .clang_arg("-I/usr/local/include") 48 | .clang_arg("-I/opt/ros/foxy/include") 49 | .clang_arg("-I/opt/ros/eloquent/include") 50 | .clang_arg("-I/opt/ros/dashing/include") 51 | .clang_arg("-I/usr/lib/gcc/x86_64-linux-gnu/8/include") 52 | } 53 | .generate() 54 | .expect("Unable to generate bindings"); 55 | 56 | let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); 57 | bindings 58 | .write_to_file(out_path.join("bindings.rs")) 59 | .expect("Couldn't write bindings!"); 60 | } 61 | -------------------------------------------------------------------------------- /.github/workflows/rust.yml: -------------------------------------------------------------------------------- 1 | name: Rust 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | env: 10 | CARGO_TERM_COLOR: always 11 | 12 | jobs: 13 | build_ros2: 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - name: Install APT pre-requisites 18 | run: sudo apt-get update && sudo apt-get -y install curl gnupg2 lsb-release 19 | 20 | - name: Add ROS 2 repository key 21 | run: curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - 22 | 23 | - name: Add ROS 2 repository 24 | run: sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list' 25 | 26 | - name: Update ROS 2 APT sources 27 | run: sudo apt-get update && sudo apt-get -y install ros-eloquent-cyclonedds 28 | 29 | - uses: actions/checkout@v2 30 | 31 | - name: Run cargo check 32 | uses: actions-rs/cargo@v1 33 | with: 34 | command: check 35 | 36 | - name: Build 37 | uses: actions-rs/cargo@v1 38 | with: 39 | command: build 40 | args: --verbose --all-targets 41 | 42 | - name: Run tests 43 | uses: actions-rs/cargo@v1 44 | with: 45 | command: test 46 | args: --verbose --all-targets 47 | 48 | - name: Clippy 49 | uses: actions-rs/cargo@v1 50 | with: 51 | command: clippy 52 | args: --all --examples 53 | 54 | - name: Run rustfmt 55 | uses: actions-rs/cargo@v1 56 | with: 57 | command: fmt 58 | args: -- --check 59 | 60 | build_static: 61 | runs-on: ${{ matrix.os }} 62 | strategy: 63 | matrix: 64 | os: [ubuntu-latest, macos-latest] 65 | 66 | steps: 67 | - name: Install LLVM 68 | run: sudo apt-get update && sudo apt-get -y install llvm 69 | if: ${{ matrix.os == 'ubuntu-latest' }} 70 | 71 | - name: Install latest toolchain 72 | uses: actions-rs/toolchain@v1 73 | with: 74 | toolchain: stable 75 | override: true 76 | components: rustfmt, clippy 77 | 78 | - uses: actions/checkout@v2 79 | 80 | - name: Run cargo check 81 | uses: actions-rs/cargo@v1 82 | with: 83 | command: check 84 | args: --verbose --all-targets --features "static libddsc-sys/static" 85 | 86 | - name: Build 87 | uses: actions-rs/cargo@v1 88 | with: 89 | command: build 90 | args: --verbose --all-targets --features "static libddsc-sys/static" 91 | 92 | - name: Run tests 93 | uses: actions-rs/cargo@v1 94 | with: 95 | command: test 96 | args: --verbose --all-targets --features "static libddsc-sys/static" 97 | 98 | - name: Clippy 99 | uses: actions-rs/cargo@v1 100 | with: 101 | command: clippy 102 | args: --all --examples 103 | 104 | - name: Run rustfmt 105 | uses: actions-rs/cargo@v1 106 | with: 107 | command: fmt 108 | args: -- --check 109 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | extern crate libc; 2 | use std::ffi::CString; 3 | use std::os::raw::c_char; 4 | 5 | extern crate libddsc_sys; 6 | 7 | pub enum History { 8 | KeepLast { n: u32 }, 9 | KeepAll, 10 | } 11 | 12 | pub enum Durability { 13 | Volatile, 14 | TransientLocal, 15 | Transient, 16 | Persistent, 17 | } 18 | 19 | pub struct QoS { 20 | qos: *mut libddsc_sys::dds_qos_t, 21 | } 22 | 23 | impl QoS { 24 | pub fn reset(&mut self) { 25 | unsafe { libddsc_sys::dds_qos_reset(self.qos) } 26 | } 27 | 28 | pub fn history(&mut self, h: &History) { 29 | match h { 30 | History::KeepLast { n } => unsafe { 31 | libddsc_sys::dds_qset_history( 32 | self.qos, 33 | libddsc_sys::dds_history_kind_DDS_HISTORY_KEEP_LAST, 34 | *n as i32, 35 | ) 36 | }, 37 | History::KeepAll => unsafe { 38 | libddsc_sys::dds_qset_history( 39 | self.qos, 40 | libddsc_sys::dds_history_kind_DDS_HISTORY_KEEP_ALL, 41 | 0, 42 | ) 43 | }, 44 | } 45 | } 46 | 47 | pub fn partitions(&mut self, ps: &[String]) { 48 | // let mut xs : [*const c_char; ps.len()] = [ std::ptr::null(); ps.len()]; 49 | // let p = CString::new(ps[0]).unwrap().as_ptr(); 50 | let mut cps: Vec<*const c_char> = ps 51 | .iter() 52 | .map(|s| CString::new(String::from(s)).unwrap().into_raw() as *const c_char) 53 | .collect(); 54 | unsafe { 55 | libddsc_sys::dds_qset_partition( 56 | self.qos, 57 | ps.len() as u32, 58 | cps.as_mut_ptr() as *mut *const ::std::os::raw::c_char, 59 | ) 60 | } 61 | } 62 | } 63 | 64 | impl Default for QoS { 65 | fn default() -> QoS { 66 | QoS { 67 | qos: unsafe { libddsc_sys::dds_create_qos() }, 68 | } 69 | } 70 | } 71 | 72 | impl PartialEq for QoS { 73 | fn eq(&self, other: &Self) -> bool { 74 | unsafe { libddsc_sys::dds_qos_equal(self.qos, other.qos) } 75 | } 76 | } 77 | 78 | impl Eq for QoS {} 79 | 80 | impl Clone for QoS { 81 | fn clone(&self) -> Self { 82 | let dst = QoS { 83 | qos: unsafe { libddsc_sys::dds_create_qos() }, 84 | }; 85 | unsafe { libddsc_sys::dds_copy_qos(dst.qos, self.qos as *const libddsc_sys::dds_qos_t) }; 86 | dst 87 | } 88 | } 89 | 90 | impl Drop for QoS { 91 | fn drop(&mut self) { 92 | unsafe { libddsc_sys::dds_qos_delete(self.qos) }; 93 | } 94 | } 95 | 96 | pub struct Participant { 97 | entity: libddsc_sys::dds_entity_t, 98 | } 99 | 100 | impl Drop for Participant { 101 | fn drop(&mut self) { 102 | unsafe { libddsc_sys::dds_delete(self.entity) }; 103 | } 104 | } 105 | 106 | impl Participant { 107 | pub fn new(d: libddsc_sys::dds_domainid_t) -> Participant { 108 | let e = 109 | unsafe { libddsc_sys::dds_create_participant(d, std::ptr::null(), std::ptr::null()) }; 110 | Participant { entity: e } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /libddsc-sys/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------