### Preview documentation Source: https://opendefocus.codeberg.page/developer/xtask.html Starts a local server to preview project documentation. ```bash cargo xtask --serve-docs ``` -------------------------------- ### Run Development Tasks with xtask Source: https://opendefocus.codeberg.page/print.html The xtask tool manages all development-related tasks. Install Rust to use these commands cross-platform. Use `cargo xtask --help` for a full list of available tasks. ```bash cargo xtask --compile --nuke-versions 15.0 --target-platform linux --use-zig ``` ```bash cargo xtask --test-crates ``` ```bash cargo xtask --pytest ``` ```bash cargo xtask --precomit ``` ```bash cargo xtask --serve-docs ``` -------------------------------- ### Configure init.py for OpenDefocus Source: https://opendefocus.codeberg.page/installation.html Add the plugin path to Nuke's initialization script. Use the relative path if the plugin is in the .nuke folder or an absolute path for custom locations. ```python nuke.pluginAddPath("./opendefocus_plugin") ``` ```python nuke.pluginAddPath("the/path/to/the/installation/here") ``` -------------------------------- ### Open Directory and Handle Errors Source: https://opendefocus.codeberg.page/print.html Opens a directory specified by the path. If opening fails, it logs a system library error and returns 0. Otherwise, it proceeds to read directory entries. ```c DIR *dir = opendir(path); if (dir == NULL) { OPENSSL_PUT_ERROR(SSL, ERR_R_SYS_LIB); ERR_add_error_data(3, "opendir(‘", dir, "’)"); return 0; } ``` -------------------------------- ### Clone the OpenDefocus Repository Source: https://opendefocus.codeberg.page/print.html Clone the main repository to your Codeberg account to begin development. Navigate into the cloned directory to proceed. ```bash __ git clone ssh://git@codeberg.org/YOUR_USERNAME/opendefocus.git cd opendefocus/ ``` -------------------------------- ### Run compilation tasks Source: https://opendefocus.codeberg.page/developer/xtask.html Compiles the project with specific versioning and platform targets. ```bash cargo xtask --compile --nuke-versions 15.0 --target-platform linux --use-zig ``` -------------------------------- ### Build for Nuke with Zig on Linux Source: https://opendefocus.codeberg.page/contributing.html Build the project for Nuke, specifying version 15.0, targeting Linux, using Zig, and outputting to a package. This command is part of the xtask development environment. ```bash cargo xtask --compile --nuke-versions 15.0 --target-platform linux --use-zig --output-to-package ``` -------------------------------- ### Construct Full Path and Add Certificate Subjects Source: https://opendefocus.codeberg.page/print.html Constructs the full path for a directory entry and adds its certificate subjects to the stack. It includes checks for path length and potential errors during string formatting or subject addition. ```c char buf[1024]; if (strlen(path) + strlen(dirent->d_name) + 2 > sizeof(buf)) { OPENSSL_PUT_ERROR(SSL, SSL_R_PATH_TOO_LONG); break; } int r = snprintf(buf, sizeof(buf), "%s/%s", path, dirent->d_name); if (r <= 0 || r >= (int)sizeof(buf) || !SSL_add_file_cert_subjects_to_stack(stack, buf)) { break; } ``` -------------------------------- ### Clone OpenDefocus Repository Source: https://opendefocus.codeberg.page/contributing.html Clone the OpenDefocus repository to your local machine using SSH. Ensure you replace YOUR_USERNAME with your Codeberg username. ```bash git clone ssh://git@codeberg.org/YOUR_USERNAME/opendefocus.git cd opendefocus/ ``` -------------------------------- ### Compile Nuke 15 using xtask Source: https://opendefocus.codeberg.page/developer/building.html Use the xtask utility to compile specific Nuke versions for a target platform. ```bash cargo xtask \ --compile \ --nuke-versions 15.1,15.2 \ --target-platform linux \ --output-to-package ``` -------------------------------- ### Run testing tasks Source: https://opendefocus.codeberg.page/developer/xtask.html Executes crate-level tests or Python-based tests. ```bash cargo xtask --test-crates ``` ```bash cargo xtask --pytest ``` -------------------------------- ### Run pre-commit checks Source: https://opendefocus.codeberg.page/developer/xtask.html Executes automated checks before committing changes. ```bash cargo xtask --precomit ``` -------------------------------- ### Rustls-webpki License Terms Source: https://opendefocus.codeberg.page/license.html This section details the ISC-style license terms for the 'rustls-webpki' project, version 0.103.8. It covers permissions for use, modification, and distribution, along with warranty disclaimers. It also notes separate licensing for files under third-party/chromium. ```text Copyright 2015 Brian Smith. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. The files under third-party/chromium are licensed as described in third-party/chromium/LICENSE. ``` -------------------------------- ### Include OpenSSL SSL Header Source: https://opendefocus.codeberg.page/license.html Include the main SSL header file for OpenSSL functionalities. ```c #include ``` -------------------------------- ### Add Certificate Subjects from Directory Source: https://opendefocus.codeberg.page/license.html Adds certificate subjects from a specified directory to a stack. Handles directory opening, reading entries, and adding subjects. Returns 0 on success, 1 if the directory was empty or no entries were processed. ```c int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack, const char *path) { DIR *dir = opendir(path); if (dir == NULL) { OPENSSL_PUT_ERROR(SSL, ERR_R_SYS_LIB); ERR_add_error_data(3, "opendir(‘", dir, “’)”); return 0; } ``` ```c int ret = 0; for (;;) { // |readdir| may fail with or without setting |errno|. errno = 0; struct dirent *dirent = readdir(dir); if (dirent == NULL) { if (errno) { OPENSSL_PUT_ERROR(SSL, ERR_R_SYS_LIB); ERR_add_error_data(3, "readdir(‘", path, “’)”); } else { ret = 1; } break; } ``` ```c char buf[1024]; if (strlen(path) + strlen(dirent->d_name) + 2 > sizeof(buf)) { OPENSSL_PUT_ERROR(SSL, SSL_R_PATH_TOO_LONG); break; } int r = snprintf(buf, sizeof(buf), "%s/%s", path, dirent->d_name); if (r <= 0 || r >= (int)sizeof(buf) || !SSL_add_file_cert_subjects_to_stack(stack, buf)) { break; } ``` ```c } ``` ```c closedir(dir); return ret; } ``` -------------------------------- ### Include Error and String Headers Source: https://opendefocus.codeberg.page/license.html Include headers for error handling and string manipulation. ```c #include ``` ```c #include ``` -------------------------------- ### Unicode License Agreement Notice Source: https://opendefocus.codeberg.page/print.html This section contains the Unicode License Agreement, Version 3.0, outlining permissions and restrictions for using Unicode data files and software. ```text COPYRIGHT AND PERMISSION NOTICE Copyright © 1991-2023 Unicode, Inc. NOTICE TO USER: Carefully read the following legal agreement. BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE. ``` -------------------------------- ### Unicode Data Files and Software Usage Permissions Source: https://opendefocus.codeberg.page/print.html Grants permission to use, copy, modify, merge, publish, distribute, and sell Unicode data files and software, provided the copyright notice is included. ```text Permission is hereby granted, free of charge, to any person obtaining a copy of data files and any associated documentation (the “Data Files”) or software and any associated documentation (the “Software”) to deal in the Data Files or Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom the Data Files or Software are furnished to do so, provided that either (a) this copyright and permission notice appear with all copies of the Data Files or Software, or (b) this copyright and permission notice appear in associated Documentation. ``` -------------------------------- ### Configure NUKE_PATH environment variable Source: https://opendefocus.codeberg.page/developer/building.html Set the NUKE_PATH environment variable to include the generated package directory. ```bash export NUKE_PATH=$(pwd)/package # launch your nuke etc... ``` -------------------------------- ### Apache License Boilerplate Source: https://opendefocus.codeberg.page/license.html Use this boilerplate text, replacing bracketed information, within your project files to comply with the Apache License, Version 2.0. Ensure it's placed in appropriate comment syntax for your file format. ```text Copyright {yyyy} {name of copyright owner} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ``` -------------------------------- ### Include Directory Operations Header Source: https://opendefocus.codeberg.page/license.html Include the dirent.h header for directory manipulation functions, conditional on the operating system. ```c #include ```