diff --git a/.Rbuildignore b/.Rbuildignore index 6d86d3468..a83d9868a 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -25,3 +25,5 @@ ^_pkgdown\.yml$ ^docs$ ^pkgdown$ +scripts +^Makefile$ diff --git a/.gitignore b/.gitignore index 160bec811..ba1fb07dc 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ configure.log .vscode *.orig docs +scripts/R-devel diff --git a/DESCRIPTION b/DESCRIPTION index d942436b3..ae0b286f1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -42,7 +42,10 @@ Authors@R: c( person("Trantor Standard Systems", role = "cph", comment = "base64 implementation"), person("Igor", "Sysoev", role = "cph", - comment = "http-parser") + comment = "http-parser"), + person(given = "Mauricio", family = "Vargas Sepulveda", role = "aut", + email = "m.vargas.sepulveda@gmail.com", + comment = c(ORCID = "0000-0003-1017-7574")) ) Description: Provides low-level socket and protocol support for handling HTTP and WebSocket requests directly from within R. It is primarily @@ -60,7 +63,6 @@ Imports: later (>= 0.8.0), promises, R6, - Rcpp (>= 1.0.7), utils Suggests: callr, @@ -70,16 +72,15 @@ Suggests: websocket LinkingTo: later, - Rcpp + cpp11 Config/Needs/website: tidyverse/tidytemplate Config/testthat/edition: 3 Config/usethis/last-upkeep: 2025-07-01 Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.3 SystemRequirements: GNU make, zlib Collate: - 'RcppExports.R' + 'cpp11.R' 'httpuv-package.R' 'httpuv.R' 'random_port.R' @@ -87,3 +88,4 @@ Collate: 'staticServer.R' 'static_paths.R' 'utils.R' +Config/roxygen2/version: 8.0.0 diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..6fcb92e6c --- /dev/null +++ b/Makefile @@ -0,0 +1,41 @@ +clean: + @Rscript -e 'devtools::clean_dll(".");' + +install: + @Rscript -e 'devtools::install(".");' + +STANDARDS := cxx17 cxx20 cxx23 +COMPILERS := gcc clang + +ALL_CHECKS := $(foreach std,$(STANDARDS),$(foreach comp,$(COMPILERS),check-$(std)-$(comp))) + +check: $(ALL_CHECKS) + +define run-check +check-$(1)-$(2): + @echo "Checking C++ code with $(1) standard and $(2) compiler" + # @$$(MAKE) install + ./scripts/check_prepare.sh "$(1)" "$(2)"; \ + if ! ./scripts/check_run.sh "$(1)" "$(2)"; then \ + echo "Check failed"; \ + ./scripts/check_restore.sh "$(1)" "$(2)"; \ + exit 1; \ + fi; \ + ./scripts/check_restore.sh "$(1)" "$(2)" +endef + +clang_format=`which clang-format-21` + +format: $(shell find . -name '*.h') $(shell find . -name '*.hpp') $(shell find . -name '*.cpp') + @${clang_format} -i $? + +build-r-devel: + @echo "Building R-devel from source" + ./scripts/build_r_devel.sh + +check-devel: + @echo "Checking with R-devel (CXX23, gcc)" + ./scripts/check_r_devel.sh cxx23 gcc + +$(foreach std,$(STANDARDS),$(foreach comp,$(COMPILERS),$(eval $(call run-check,$(std),$(comp))))) +$(foreach std,$(STANDARDS),$(eval check-$(std)-glang: check-$(std)-clang)) diff --git a/NAMESPACE b/NAMESPACE index 5200da447..a2d91d6c5 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -32,7 +32,6 @@ export(stopAllServers) export(stopDaemonizedServer) export(stopServer) importFrom(R6,R6Class) -importFrom(Rcpp,evalCpp) importFrom(later,run_now) importFrom(promises,"%...!%") importFrom(promises,"%...>%") diff --git a/R/RcppExports.R b/R/RcppExports.R deleted file mode 100644 index 406dedb79..000000000 --- a/R/RcppExports.R +++ /dev/null @@ -1,147 +0,0 @@ -# Generated by using Rcpp::compileAttributes() -> do not edit by hand -# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 - -sendWSMessage <- function(conn, binary, message) { - invisible(.Call(`_httpuv_sendWSMessage`, conn, binary, message)) -} - -closeWS <- function(conn, code, reason) { - invisible(.Call(`_httpuv_closeWS`, conn, code, reason)) -} - -makeTcpServer <- function(host, port, onHeaders, onBodyData, onRequest, onWSOpen, onWSMessage, onWSClose, staticPaths, staticPathOptions, quiet) { - .Call(`_httpuv_makeTcpServer`, host, port, onHeaders, onBodyData, onRequest, onWSOpen, onWSMessage, onWSClose, staticPaths, staticPathOptions, quiet) -} - -makePipeServer <- function(name, mask, onHeaders, onBodyData, onRequest, onWSOpen, onWSMessage, onWSClose, staticPaths, staticPathOptions, quiet) { - .Call(`_httpuv_makePipeServer`, name, mask, onHeaders, onBodyData, onRequest, onWSOpen, onWSMessage, onWSClose, staticPaths, staticPathOptions, quiet) -} - -stopServer_ <- function(handle) { - invisible(.Call(`_httpuv_stopServer_`, handle)) -} - -getStaticPaths_ <- function(handle) { - .Call(`_httpuv_getStaticPaths_`, handle) -} - -setStaticPaths_ <- function(handle, sp) { - .Call(`_httpuv_setStaticPaths_`, handle, sp) -} - -removeStaticPaths_ <- function(handle, paths) { - .Call(`_httpuv_removeStaticPaths_`, handle, paths) -} - -getStaticPathOptions_ <- function(handle) { - .Call(`_httpuv_getStaticPathOptions_`, handle) -} - -setStaticPathOptions_ <- function(handle, opts) { - .Call(`_httpuv_setStaticPathOptions_`, handle, opts) -} - -base64encode <- function(x) { - .Call(`_httpuv_base64encode`, x) -} - -#' URI encoding/decoding -#' -#' Encodes/decodes strings using URI encoding/decoding in the same way that web -#' browsers do. The precise behaviors of these functions can be found at -#' developer.mozilla.org: -#' \href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI}{encodeURI}, -#' \href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent}{encodeURIComponent}, -#' \href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI}{decodeURI}, -#' \href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent}{decodeURIComponent} -#' -#' Intended as a faster replacement for [utils::URLencode()] and -#' [utils::URLdecode()]. -#' -#' encodeURI differs from encodeURIComponent in that the former will not encode -#' reserved characters: \code{;,/?:@@&=+$} -#' -#' decodeURI differs from decodeURIComponent in that it will refuse to decode -#' encoded sequences that decode to a reserved character. (If in doubt, use -#' decodeURIComponent.) -#' -#' For \code{encodeURI} and \code{encodeURIComponent}, input strings will be -#' converted to UTF-8 before URL-encoding. -#' -#' @param value Character vector to be encoded or decoded. -#' @return Encoded or decoded character vector of the same length as the -#' input value. \code{decodeURI} and \code{decodeURIComponent} will return -#' strings that are UTF-8 encoded. -#' -#' @export -encodeURI <- function(value) { - .Call(`_httpuv_encodeURI`, value) -} - -#' @rdname encodeURI -#' @export -encodeURIComponent <- function(value) { - .Call(`_httpuv_encodeURIComponent`, value) -} - -#' @rdname encodeURI -#' @export -decodeURI <- function(value) { - .Call(`_httpuv_decodeURI`, value) -} - -#' @rdname encodeURI -#' @export -decodeURIComponent <- function(value) { - .Call(`_httpuv_decodeURIComponent`, value) -} - -#' Check whether an address is IPv4 or IPv6 -#' -#' Given an IP address, this checks whether it is an IPv4 or IPv6 address. -#' -#' @param ip A single string representing an IP address. -#' -#' @return -#' For IPv4 addresses, \code{4}; for IPv6 addresses, \code{6}. If the address is -#' neither, \code{-1}. -#' -#' @examples -#' ipFamily("127.0.0.1") # 4 -#' ipFamily("500.0.0.500") # -1 -#' ipFamily("500.0.0.500") # -1 -#' -#' ipFamily("::") # 6 -#' ipFamily("::1") # 6 -#' ipFamily("fe80::1ff:fe23:4567:890a") # 6 -#' @export -ipFamily <- function(ip) { - .Call(`_httpuv_ipFamily`, ip) -} - -invokeCppCallback <- function(data, callback_xptr) { - invisible(.Call(`_httpuv_invokeCppCallback`, data, callback_xptr)) -} - -#' Apply the value of .Random.seed to R's internal RNG state -#' -#' This function is needed in unusual cases where a C++ function calls -#' an R function which sets the value of \code{.Random.seed}. This function -#' should be called at the end of the R function to ensure that the new value -#' \code{.Random.seed} is preserved. Otherwise, Rcpp may overwrite it with a -#' previous value. -#' -#' @keywords internal -#' @export -getRNGState <- function() { - invisible(.Call(`_httpuv_getRNGState`)) -} - -wsconn_address <- function(external_ptr) { - .Call(`_httpuv_wsconn_address`, external_ptr) -} - -log_level <- function(level) { - .Call(`_httpuv_log_level`, level) -} - diff --git a/R/cpp11.R b/R/cpp11.R new file mode 100644 index 000000000..76e10beeb --- /dev/null +++ b/R/cpp11.R @@ -0,0 +1,81 @@ +# Generated by cpp11: do not edit by hand + +sendWSMessage <- function(conn, binary, message) { + invisible(.Call(`_httpuv_sendWSMessage`, conn, binary, message)) +} + +closeWS <- function(conn, code, reason) { + invisible(.Call(`_httpuv_closeWS`, conn, code, reason)) +} + +makeTcpServer <- function(host, port, onHeaders, onBodyData, onRequest, onWSOpen, onWSMessage, onWSClose, staticPaths, staticPathOptions, quiet) { + .Call(`_httpuv_makeTcpServer`, host, port, onHeaders, onBodyData, onRequest, onWSOpen, onWSMessage, onWSClose, staticPaths, staticPathOptions, quiet) +} + +makePipeServer <- function(name, mask, onHeaders, onBodyData, onRequest, onWSOpen, onWSMessage, onWSClose, staticPaths, staticPathOptions, quiet) { + .Call(`_httpuv_makePipeServer`, name, mask, onHeaders, onBodyData, onRequest, onWSOpen, onWSMessage, onWSClose, staticPaths, staticPathOptions, quiet) +} + +stopServer_ <- function(handle) { + invisible(.Call(`_httpuv_stopServer_`, handle)) +} + +getStaticPaths_ <- function(handle) { + .Call(`_httpuv_getStaticPaths_`, handle) +} + +setStaticPaths_ <- function(handle, sp) { + .Call(`_httpuv_setStaticPaths_`, handle, sp) +} + +removeStaticPaths_ <- function(handle, paths) { + .Call(`_httpuv_removeStaticPaths_`, handle, paths) +} + +getStaticPathOptions_ <- function(handle) { + .Call(`_httpuv_getStaticPathOptions_`, handle) +} + +setStaticPathOptions_ <- function(handle, opts) { + .Call(`_httpuv_setStaticPathOptions_`, handle, opts) +} + +base64encode <- function(x) { + .Call(`_httpuv_base64encode`, x) +} + +encodeURI_ <- function(value) { + .Call(`_httpuv_encodeURI_`, value) +} + +encodeURIComponent_ <- function(value) { + .Call(`_httpuv_encodeURIComponent_`, value) +} + +decodeURI_ <- function(value) { + .Call(`_httpuv_decodeURI_`, value) +} + +decodeURIComponent_ <- function(value) { + .Call(`_httpuv_decodeURIComponent_`, value) +} + +ipFamily_ <- function(ip) { + .Call(`_httpuv_ipFamily_`, ip) +} + +invokeCppCallback <- function(data, callback_xptr) { + invisible(.Call(`_httpuv_invokeCppCallback`, data, callback_xptr)) +} + +getRNGState_ <- function() { + invisible(.Call(`_httpuv_getRNGState_`)) +} + +wsconn_address <- function(external_ptr) { + .Call(`_httpuv_wsconn_address`, external_ptr) +} + +log_level <- function(level) { + .Call(`_httpuv_log_level`, level) +} diff --git a/R/httpuv-package.R b/R/httpuv-package.R index a0abe6420..dda8fb2c6 100644 --- a/R/httpuv-package.R +++ b/R/httpuv-package.R @@ -26,9 +26,98 @@ "_PACKAGE" ## usethis namespace: start -#' @importFrom Rcpp evalCpp #' @importFrom promises promise then finally is.promise %...>% %...!% #' @importFrom later run_now #' @importFrom R6 R6Class ## usethis namespace: end NULL + +# The following functions take C++ functions and provide an exported wrapper. +# The approach is +# R: myfun(); C++: myfun_(). +# The C++ functions are registered with cpp11, and the R functions are exported. +# 'cpp4' (not in use) "saves" this step by allowing this on C++ side: +# /* roxygen +# @title My Function +# @param x something. +# @export +# */ +# int myfun(int x) { +# return x + 1; +# } + +#' @title Apply the value of .Random.seed to R's internal RNG state +#' @description This function is needed in unusual cases where a C++ function calls +#' an R function which sets the value of \code{.Random.seed}. This function +#' should be called at the end of the R function to ensure that the new value +#' \code{.Random.seed} is preserved. +#' @keywords internal +#' @export +getRNGState <- function() { + getRNGState_() +} + +#' @title URI encoding/decoding +#' @description Encodes/decodes strings using URI encoding/decoding in the same way that web +#' browsers do. The precise behaviors of these functions can be found at developer.mozilla.org: +#' \href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI}{encodeURI}, +#' \href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent}{encodeURIComponent}, +#' \href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI}{decodeURI}, +#' \href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent}{decodeURIComponent} +#' +#' Intended as a faster replacement for [utils::URLencode()] and [utils::URLdecode()]. +#' encodeURI differs from encodeURIComponent in that the former will not encode +#' reserved characters: \code{;,/?:@@&=+$} +#' +#' decodeURI differs from decodeURIComponent in that it will refuse to decode +#' encoded sequences that decode to a reserved character. (If in doubt, use +#' decodeURIComponent.) +#' +#' For \code{encodeURI} and \code{encodeURIComponent}, input strings will be +#' converted to UTF-8 before URL-encoding. +#' @param value Character vector to be encoded or decoded. +#' +#' @return Encoded or decoded character vector of the same length as the +#' input value. \code{decodeURI} and \code{decodeURIComponent} will return +#' strings that are UTF-8 encoded. +#' +#' @export +encodeURI <- function(value) { + encodeURI_(value) +} + +#' @rdname encodeURI +#' @export +encodeURIComponent <- function(value) { + encodeURIComponent_(value) +} + +#' @rdname encodeURI +#' @export +decodeURI <- function(value) { + decodeURI_(value) +} + +#' @rdname encodeURI +#' @export +decodeURIComponent <- function(value) { + decodeURIComponent_(value) +} + +#' @title Check whether an address is IPv4 or IPv6 +#' @description Given an IP address, this checks whether it is an IPv4 or IPv6 address. +#' @param ip A single string representing an IP address. +#' @return For IPv4 addresses, \code{4}; for IPv6 addresses, \code{6}. If the address is +#' neither, \code{-1}. +#' @examples +#' ipFamily("127.0.0.1") # 4 +#' ipFamily("500.0.0.500") # -1 +#' ipFamily("500.0.0.500") # -1 +#' +#' ipFamily("::") # 6 +#' ipFamily("::1") # 6 +#' ipFamily("fe80::1ff:fe23:4567:890a") # 6 +#' @export +ipFamily <- function(ip) { + ipFamily_(ip) +} diff --git a/check-gcc-clang/check-CXX17-clang.log b/check-gcc-clang/check-CXX17-clang.log new file mode 100644 index 000000000..b8b92ebc4 --- /dev/null +++ b/check-gcc-clang/check-CXX17-clang.log @@ -0,0 +1,167 @@ +Loading required package: usethis +Loading required package: usethis +* using log directory ‘/home/pacha/Documents/httpuv/httpuv.Rcheck’ +* using R version 4.6.0 (2026-04-24) +* using platform: x86_64-pc-linux-gnu +* R was compiled by + gcc (GCC) 15.2.1 20260209 + GNU Fortran (GCC) 15.2.1 20260209 +* running under: Manjaro Linux +* using session charset: UTF-8 +* current time: 2026-05-14 00:43:44 UTC +* using options ‘--no-manual --as-cran’ +* checking for file ‘httpuv/DESCRIPTION’ ... OK +* checking extension type ... Package +* this is package ‘httpuv’ version ‘1.6.16.9000’ +* package encoding: UTF-8 +* checking CRAN incoming feasibility ... [9s/19s] WARNING +Maintainer: ‘Winston Chang ’ + +Insufficient package version (submitted: 1.6.16.9000, existing: 1.6.17) +Version contains large components (1.6.16.9000) +* checking package namespace information ... OK +* checking package dependencies ... OK +* checking if this is a source package ... OK +* checking if there is a namespace ... OK +* checking for executable files ... OK +* checking for hidden files and directories ... OK +* checking for portable file names ... OK +* checking for sufficient/correct file permissions ... OK +* checking serialization versions ... OK +* checking whether package ‘httpuv’ can be installed ... [80s/81s] OK +* used C compiler: ‘clang version 22.1.3’ +* used C++ compiler: ‘clang version 22.1.3’ +* checking C++ specification ... INFO + specified C++17 +* checking installed package size ... OK +* checking package directory ... OK +* checking for future file timestamps ... OK +* checking DESCRIPTION meta-information ... OK +* checking top-level files ... NOTE +Non-standard file/directory found at top level: + ‘check-gcc-clang’ +* checking for left-over files ... OK +* checking index information ... OK +* checking package subdirectories ... OK +* checking code files for non-ASCII characters ... OK +* checking R files for syntax errors ... OK +* checking whether the package can be loaded ... OK +* checking whether the package can be loaded with stated dependencies ... OK +* checking whether the package can be unloaded cleanly ... OK +* checking whether the namespace can be loaded with stated dependencies ... OK +* checking whether the namespace can be unloaded cleanly ... OK +* checking loading without being on the library search path ... OK +* checking use of S3 registration ... OK +* checking dependencies in R code ... OK +* checking S3 generic/method consistency ... OK +* checking replacement functions ... OK +* checking foreign function calls ... OK +* checking R code for possible problems ... OK +* checking Rd files ... OK +* checking Rd metadata ... OK +* checking Rd line widths ... OK +* checking Rd cross-references ... OK +* checking for missing documentation entries ... OK +* checking for code/documentation mismatches ... OK +* checking Rd \usage sections ... OK +* checking Rd contents ... OK +* checking for unstated dependencies in examples ... OK +* checking line endings in shell scripts ... OK +* checking line endings in C/C++/Fortran sources/headers ... OK +* checking line endings in Makefiles ... OK +* checking compilation flags in Makevars ... OK +* checking for GNU extensions in Makefiles ... INFO +GNU make is a SystemRequirements. +* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK +* checking use of PKG_*FLAGS in Makefiles ... OK +* checking use of SHLIB_OPENMP_*FLAGS in Makefiles ... OK +* checking include directives in Makefiles ... OK +* checking pragmas in C/C++ headers and code ... NOTE +File which contains pragma(s) suppressing diagnostics: + ‘src/libuv/test/task.h’ +* checking compilation flags used ... NOTE +Compilation used the following non-portable flag(s): + ‘-Werror=format-security’ ‘-Wformat’ ‘-Wp,-D_FORTIFY_SOURCE=3’ + ‘-Wp,-D_GLIBCXX_ASSERTIONS’ ‘-march=x86-64’ + ‘-mno-omit-leaf-frame-pointer’ +* checking compiled code ... OK +* checking examples ... OK +* checking for unstated dependencies in ‘demo’ ... OK +* checking for unstated dependencies in ‘tests’ ... OK +* checking tests ... + Running ‘testthat.R’ [18s/20s] + [18s/20s] OK +* checking for non-standard things in the check directory ... OK +* checking for detritus in the temp directory ... OK +* DONE + +Status: 1 WARNING, 3 NOTEs +See + ‘/home/pacha/Documents/httpuv/httpuv.Rcheck/00check.log’ +for details. + +=== BEGIN 00install.out === +Loading required package: usethis +* installing *source* package ‘httpuv’ ... +** this is package ‘httpuv’ version ‘1.6.16.9000’ +** using staged installation +** Using libuv found by pkg-config in /usr +** PKG_CFLAGS= +** PKG_LIBS=-luv +** libs +specified C++17 +using C compiler: ‘clang version 22.1.3’ +using C++ compiler: ‘clang version 22.1.3’ +using C++17 +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callback.cpp -o callback.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callbackqueue.cpp -o callbackqueue.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c cpp11.cpp -o cpp11.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-unix.cpp -o filedatasource-unix.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-win.cpp -o filedatasource-win.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c fs.cpp -o fs.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c gzipdatasource.cpp -o gzipdatasource.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http.cpp -o http.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httprequest.cpp -o httprequest.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpresponse.cpp -o httpresponse.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpuv.cpp -o httpuv.o +clang -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c md5.c -o md5.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c mime.cpp -o mime.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c socket.cpp -o socket.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c staticpath.cpp -o staticpath.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c thread.cpp -o thread.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c timegm.cpp -o timegm.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c utils.cpp -o utils.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c uvutil.cpp -o uvutil.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c webapplication.cpp -o webapplication.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-base.cpp -o websockets-base.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hixie76.cpp -o websockets-hixie76.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hybi03.cpp -o websockets-hybi03.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-ietf.cpp -o websockets-ietf.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets.cpp -o websockets.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c winutils.cpp -o winutils.o +clang -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http-parser/http_parser.c -o http-parser/http_parser.o +clang -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c sha1/sha1.c -o sha1/sha1.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c base64/base64.cpp -o base64/base64.o +clang++ -std=gnu++17 -shared -L/usr/lib64/R/lib -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -o httpuv.so callback.o callbackqueue.o cpp11.o filedatasource-unix.o filedatasource-win.o fs.o gzipdatasource.o http.o httprequest.o httpresponse.o httpuv.o md5.o mime.o socket.o staticpath.o thread.o timegm.o utils.o uvutil.o webapplication.o websockets-base.o websockets-hixie76.o websockets-hybi03.o websockets-ietf.o websockets.o winutils.o -luv ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o -pthread -L/usr/lib64/R/lib -lR +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/filedatasource-win.o: no symbols +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/winutils.o: no symbols +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +installing to /home/pacha/Documents/httpuv/httpuv.Rcheck/00LOCK-httpuv/00new/httpuv/libs +** R +** demo +** inst +** byte-compile and prepare package for lazy loading +** help +*** installing help indices +** building package indices +** testing if installed package can be loaded from temporary location +** checking absolute paths in shared objects and dynamic libraries +** testing if installed package can be loaded from final location +** testing if installed package keeps a record of temporary installation path +* DONE (httpuv) +=== END 00install.out === +R CMD check completed with no ERRORs. Warnings/Notes (if any) are allowed. See ./check-gcc-clang/check-CXX17-clang.log for full output. +Run complete. diff --git a/check-gcc-clang/check-CXX17-gcc.log b/check-gcc-clang/check-CXX17-gcc.log new file mode 100644 index 000000000..efb610f9b --- /dev/null +++ b/check-gcc-clang/check-CXX17-gcc.log @@ -0,0 +1,170 @@ +Loading required package: usethis +Loading required package: usethis +* using log directory ‘/home/pacha/Documents/httpuv/httpuv.Rcheck’ +* using R version 4.6.0 (2026-04-24) +* using platform: x86_64-pc-linux-gnu +* R was compiled by + gcc (GCC) 15.2.1 20260209 + GNU Fortran (GCC) 15.2.1 20260209 +* running under: Manjaro Linux +* using session charset: UTF-8 +* current time: 2026-05-14 00:01:07 UTC +* using options ‘--no-manual --as-cran’ +* checking for file ‘httpuv/DESCRIPTION’ ... OK +* checking extension type ... Package +* this is package ‘httpuv’ version ‘1.6.16.9000’ +* package encoding: UTF-8 +* checking CRAN incoming feasibility ... [7s/16s] WARNING +Maintainer: ‘Winston Chang ’ + +Insufficient package version (submitted: 1.6.16.9000, existing: 1.6.17) +Version contains large components (1.6.16.9000) +* checking package namespace information ... OK +* checking package dependencies ... OK +* checking if this is a source package ... OK +* checking if there is a namespace ... OK +* checking for executable files ... OK +* checking for hidden files and directories ... OK +* checking for portable file names ... OK +* checking for sufficient/correct file permissions ... OK +* checking serialization versions ... OK +* checking whether package ‘httpuv’ can be installed ... [115s/91s] OK +* used C compiler: ‘gcc (GCC) 15.2.1 20260209’ +* used C++ compiler: ‘g++ (GCC) 15.2.1 20260209’ +* checking C++ specification ... INFO + specified C++17 +* checking installed package size ... INFO + installed size is 7.3Mb + sub-directories of 1Mb or more: + libs 6.9Mb +* checking package directory ... OK +* checking for future file timestamps ... OK +* checking DESCRIPTION meta-information ... OK +* checking top-level files ... NOTE +Non-standard file/directory found at top level: + ‘check-gcc-clang’ +* checking for left-over files ... OK +* checking index information ... OK +* checking package subdirectories ... OK +* checking code files for non-ASCII characters ... OK +* checking R files for syntax errors ... OK +* checking whether the package can be loaded ... OK +* checking whether the package can be loaded with stated dependencies ... OK +* checking whether the package can be unloaded cleanly ... OK +* checking whether the namespace can be loaded with stated dependencies ... OK +* checking whether the namespace can be unloaded cleanly ... OK +* checking loading without being on the library search path ... OK +* checking use of S3 registration ... OK +* checking dependencies in R code ... OK +* checking S3 generic/method consistency ... OK +* checking replacement functions ... OK +* checking foreign function calls ... OK +* checking R code for possible problems ... OK +* checking Rd files ... OK +* checking Rd metadata ... OK +* checking Rd line widths ... OK +* checking Rd cross-references ... OK +* checking for missing documentation entries ... OK +* checking for code/documentation mismatches ... OK +* checking Rd \usage sections ... OK +* checking Rd contents ... OK +* checking for unstated dependencies in examples ... OK +* checking line endings in shell scripts ... OK +* checking line endings in C/C++/Fortran sources/headers ... OK +* checking line endings in Makefiles ... OK +* checking compilation flags in Makevars ... OK +* checking for GNU extensions in Makefiles ... INFO +GNU make is a SystemRequirements. +* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK +* checking use of PKG_*FLAGS in Makefiles ... OK +* checking use of SHLIB_OPENMP_*FLAGS in Makefiles ... OK +* checking include directives in Makefiles ... OK +* checking pragmas in C/C++ headers and code ... NOTE +File which contains pragma(s) suppressing diagnostics: + ‘src/libuv/test/task.h’ +* checking compilation flags used ... NOTE +Compilation used the following non-portable flag(s): + ‘-Werror=format-security’ ‘-Wformat’ ‘-Wp,-D_FORTIFY_SOURCE=3’ + ‘-Wp,-D_GLIBCXX_ASSERTIONS’ ‘-march=x86-64’ + ‘-mno-omit-leaf-frame-pointer’ +* checking compiled code ... OK +* checking examples ... OK +* checking for unstated dependencies in ‘demo’ ... OK +* checking for unstated dependencies in ‘tests’ ... OK +* checking tests ... + Running ‘testthat.R’ [19s/21s] + [19s/21s] OK +* checking for non-standard things in the check directory ... OK +* checking for detritus in the temp directory ... OK +* DONE + +Status: 1 WARNING, 3 NOTEs +See + ‘/home/pacha/Documents/httpuv/httpuv.Rcheck/00check.log’ +for details. + +=== BEGIN 00install.out === +Loading required package: usethis +* installing *source* package ‘httpuv’ ... +** this is package ‘httpuv’ version ‘1.6.16.9000’ +** using staged installation +** Using libuv found by pkg-config in /usr +** PKG_CFLAGS= +** PKG_LIBS=-luv +** libs +specified C++17 +using C compiler: ‘gcc (GCC) 15.2.1 20260209’ +using C++ compiler: ‘g++ (GCC) 15.2.1 20260209’ +using C++17 +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callback.cpp -o callback.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callbackqueue.cpp -o callbackqueue.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c cpp11.cpp -o cpp11.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-unix.cpp -o filedatasource-unix.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-win.cpp -o filedatasource-win.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c fs.cpp -o fs.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c gzipdatasource.cpp -o gzipdatasource.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http.cpp -o http.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httprequest.cpp -o httprequest.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpresponse.cpp -o httpresponse.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpuv.cpp -o httpuv.o +gcc -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c md5.c -o md5.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c mime.cpp -o mime.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c socket.cpp -o socket.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c staticpath.cpp -o staticpath.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c thread.cpp -o thread.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c timegm.cpp -o timegm.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c utils.cpp -o utils.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c uvutil.cpp -o uvutil.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c webapplication.cpp -o webapplication.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-base.cpp -o websockets-base.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hixie76.cpp -o websockets-hixie76.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hybi03.cpp -o websockets-hybi03.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-ietf.cpp -o websockets-ietf.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets.cpp -o websockets.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c winutils.cpp -o winutils.o +gcc -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http-parser/http_parser.c -o http-parser/http_parser.o +gcc -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c sha1/sha1.c -o sha1/sha1.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c base64/base64.cpp -o base64/base64.o +g++ -std=gnu++17 -shared -L/usr/lib64/R/lib -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -o httpuv.so callback.o callbackqueue.o cpp11.o filedatasource-unix.o filedatasource-win.o fs.o gzipdatasource.o http.o httprequest.o httpresponse.o httpuv.o md5.o mime.o socket.o staticpath.o thread.o timegm.o utils.o uvutil.o webapplication.o websockets-base.o websockets-hixie76.o websockets-hybi03.o websockets-ietf.o websockets.o winutils.o -luv ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o -pthread -L/usr/lib64/R/lib -lR +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/filedatasource-win.o: no symbols +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/winutils.o: no symbols +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +installing to /home/pacha/Documents/httpuv/httpuv.Rcheck/00LOCK-httpuv/00new/httpuv/libs +** R +** demo +** inst +** byte-compile and prepare package for lazy loading +** help +*** installing help indices +** building package indices +** testing if installed package can be loaded from temporary location +** checking absolute paths in shared objects and dynamic libraries +** testing if installed package can be loaded from final location +** testing if installed package keeps a record of temporary installation path +* DONE (httpuv) +=== END 00install.out === +R CMD check completed with no ERRORs. Warnings/Notes (if any) are allowed. See ./check-gcc-clang/check-CXX17-gcc.log for full output. +Run complete. diff --git a/check-gcc-clang/check-CXX20-clang.log b/check-gcc-clang/check-CXX20-clang.log new file mode 100644 index 000000000..959fbfc1d --- /dev/null +++ b/check-gcc-clang/check-CXX20-clang.log @@ -0,0 +1,167 @@ +Loading required package: usethis +Loading required package: usethis +* using log directory ‘/home/pacha/Documents/httpuv/httpuv.Rcheck’ +* using R version 4.6.0 (2026-04-24) +* using platform: x86_64-pc-linux-gnu +* R was compiled by + gcc (GCC) 15.2.1 20260209 + GNU Fortran (GCC) 15.2.1 20260209 +* running under: Manjaro Linux +* using session charset: UTF-8 +* current time: 2026-05-14 00:38:58 UTC +* using options ‘--no-manual --as-cran’ +* checking for file ‘httpuv/DESCRIPTION’ ... OK +* checking extension type ... Package +* this is package ‘httpuv’ version ‘1.6.16.9000’ +* package encoding: UTF-8 +* checking CRAN incoming feasibility ... [11s/19s] WARNING +Maintainer: ‘Winston Chang ’ + +Insufficient package version (submitted: 1.6.16.9000, existing: 1.6.17) +Version contains large components (1.6.16.9000) +* checking package namespace information ... OK +* checking package dependencies ... OK +* checking if this is a source package ... OK +* checking if there is a namespace ... OK +* checking for executable files ... OK +* checking for hidden files and directories ... OK +* checking for portable file names ... OK +* checking for sufficient/correct file permissions ... OK +* checking serialization versions ... OK +* checking whether package ‘httpuv’ can be installed ... [82s/83s] OK +* used C compiler: ‘clang version 22.1.3’ +* used C++ compiler: ‘clang version 22.1.3’ +* checking C++ specification ... INFO + specified C++20 +* checking installed package size ... OK +* checking package directory ... OK +* checking for future file timestamps ... OK +* checking DESCRIPTION meta-information ... OK +* checking top-level files ... NOTE +Non-standard file/directory found at top level: + ‘check-gcc-clang’ +* checking for left-over files ... OK +* checking index information ... OK +* checking package subdirectories ... OK +* checking code files for non-ASCII characters ... OK +* checking R files for syntax errors ... OK +* checking whether the package can be loaded ... OK +* checking whether the package can be loaded with stated dependencies ... OK +* checking whether the package can be unloaded cleanly ... OK +* checking whether the namespace can be loaded with stated dependencies ... OK +* checking whether the namespace can be unloaded cleanly ... OK +* checking loading without being on the library search path ... OK +* checking use of S3 registration ... OK +* checking dependencies in R code ... OK +* checking S3 generic/method consistency ... OK +* checking replacement functions ... OK +* checking foreign function calls ... OK +* checking R code for possible problems ... OK +* checking Rd files ... OK +* checking Rd metadata ... OK +* checking Rd line widths ... OK +* checking Rd cross-references ... OK +* checking for missing documentation entries ... OK +* checking for code/documentation mismatches ... OK +* checking Rd \usage sections ... OK +* checking Rd contents ... OK +* checking for unstated dependencies in examples ... OK +* checking line endings in shell scripts ... OK +* checking line endings in C/C++/Fortran sources/headers ... OK +* checking line endings in Makefiles ... OK +* checking compilation flags in Makevars ... OK +* checking for GNU extensions in Makefiles ... INFO +GNU make is a SystemRequirements. +* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK +* checking use of PKG_*FLAGS in Makefiles ... OK +* checking use of SHLIB_OPENMP_*FLAGS in Makefiles ... OK +* checking include directives in Makefiles ... OK +* checking pragmas in C/C++ headers and code ... NOTE +File which contains pragma(s) suppressing diagnostics: + ‘src/libuv/test/task.h’ +* checking compilation flags used ... NOTE +Compilation used the following non-portable flag(s): + ‘-Werror=format-security’ ‘-Wformat’ ‘-Wp,-D_FORTIFY_SOURCE=3’ + ‘-Wp,-D_GLIBCXX_ASSERTIONS’ ‘-march=x86-64’ + ‘-mno-omit-leaf-frame-pointer’ +* checking compiled code ... OK +* checking examples ... OK +* checking for unstated dependencies in ‘demo’ ... OK +* checking for unstated dependencies in ‘tests’ ... OK +* checking tests ... + Running ‘testthat.R’ [19s/21s] + [19s/21s] OK +* checking for non-standard things in the check directory ... OK +* checking for detritus in the temp directory ... OK +* DONE + +Status: 1 WARNING, 3 NOTEs +See + ‘/home/pacha/Documents/httpuv/httpuv.Rcheck/00check.log’ +for details. + +=== BEGIN 00install.out === +Loading required package: usethis +* installing *source* package ‘httpuv’ ... +** this is package ‘httpuv’ version ‘1.6.16.9000’ +** using staged installation +** Using libuv found by pkg-config in /usr +** PKG_CFLAGS= +** PKG_LIBS=-luv +** libs +specified C++20 +using C compiler: ‘clang version 22.1.3’ +using C++ compiler: ‘clang version 22.1.3’ +using C++20 +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callback.cpp -o callback.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callbackqueue.cpp -o callbackqueue.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c cpp11.cpp -o cpp11.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-unix.cpp -o filedatasource-unix.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-win.cpp -o filedatasource-win.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c fs.cpp -o fs.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c gzipdatasource.cpp -o gzipdatasource.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http.cpp -o http.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httprequest.cpp -o httprequest.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpresponse.cpp -o httpresponse.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpuv.cpp -o httpuv.o +clang -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c md5.c -o md5.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c mime.cpp -o mime.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c socket.cpp -o socket.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c staticpath.cpp -o staticpath.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c thread.cpp -o thread.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c timegm.cpp -o timegm.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c utils.cpp -o utils.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c uvutil.cpp -o uvutil.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c webapplication.cpp -o webapplication.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-base.cpp -o websockets-base.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hixie76.cpp -o websockets-hixie76.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hybi03.cpp -o websockets-hybi03.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-ietf.cpp -o websockets-ietf.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets.cpp -o websockets.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c winutils.cpp -o winutils.o +clang -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http-parser/http_parser.c -o http-parser/http_parser.o +clang -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c sha1/sha1.c -o sha1/sha1.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c base64/base64.cpp -o base64/base64.o +clang++ -std=gnu++20 -shared -L/usr/lib64/R/lib -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -o httpuv.so callback.o callbackqueue.o cpp11.o filedatasource-unix.o filedatasource-win.o fs.o gzipdatasource.o http.o httprequest.o httpresponse.o httpuv.o md5.o mime.o socket.o staticpath.o thread.o timegm.o utils.o uvutil.o webapplication.o websockets-base.o websockets-hixie76.o websockets-hybi03.o websockets-ietf.o websockets.o winutils.o -luv ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o -pthread -L/usr/lib64/R/lib -lR +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/filedatasource-win.o: no symbols +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/winutils.o: no symbols +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +installing to /home/pacha/Documents/httpuv/httpuv.Rcheck/00LOCK-httpuv/00new/httpuv/libs +** R +** demo +** inst +** byte-compile and prepare package for lazy loading +** help +*** installing help indices +** building package indices +** testing if installed package can be loaded from temporary location +** checking absolute paths in shared objects and dynamic libraries +** testing if installed package can be loaded from final location +** testing if installed package keeps a record of temporary installation path +* DONE (httpuv) +=== END 00install.out === +R CMD check completed with no ERRORs. Warnings/Notes (if any) are allowed. See ./check-gcc-clang/check-CXX20-clang.log for full output. +Run complete. diff --git a/check-gcc-clang/check-CXX20-gcc.log b/check-gcc-clang/check-CXX20-gcc.log new file mode 100644 index 000000000..25d79cb78 --- /dev/null +++ b/check-gcc-clang/check-CXX20-gcc.log @@ -0,0 +1,170 @@ +Loading required package: usethis +Loading required package: usethis +* using log directory ‘/home/pacha/Documents/httpuv/httpuv.Rcheck’ +* using R version 4.6.0 (2026-04-24) +* using platform: x86_64-pc-linux-gnu +* R was compiled by + gcc (GCC) 15.2.1 20260209 + GNU Fortran (GCC) 15.2.1 20260209 +* running under: Manjaro Linux +* using session charset: UTF-8 +* current time: 2026-05-14 00:34:43 UTC +* using options ‘--no-manual --as-cran’ +* checking for file ‘httpuv/DESCRIPTION’ ... OK +* checking extension type ... Package +* this is package ‘httpuv’ version ‘1.6.16.9000’ +* package encoding: UTF-8 +* checking CRAN incoming feasibility ... [9s/23s] WARNING +Maintainer: ‘Winston Chang ’ + +Insufficient package version (submitted: 1.6.16.9000, existing: 1.6.17) +Version contains large components (1.6.16.9000) +* checking package namespace information ... OK +* checking package dependencies ... OK +* checking if this is a source package ... OK +* checking if there is a namespace ... OK +* checking for executable files ... OK +* checking for hidden files and directories ... OK +* checking for portable file names ... OK +* checking for sufficient/correct file permissions ... OK +* checking serialization versions ... OK +* checking whether package ‘httpuv’ can be installed ... [130s/105s] OK +* used C compiler: ‘gcc (GCC) 15.2.1 20260209’ +* used C++ compiler: ‘g++ (GCC) 15.2.1 20260209’ +* checking C++ specification ... INFO + specified C++20 +* checking installed package size ... INFO + installed size is 7.3Mb + sub-directories of 1Mb or more: + libs 6.9Mb +* checking package directory ... OK +* checking for future file timestamps ... OK +* checking DESCRIPTION meta-information ... OK +* checking top-level files ... NOTE +Non-standard file/directory found at top level: + ‘check-gcc-clang’ +* checking for left-over files ... OK +* checking index information ... OK +* checking package subdirectories ... OK +* checking code files for non-ASCII characters ... OK +* checking R files for syntax errors ... OK +* checking whether the package can be loaded ... OK +* checking whether the package can be loaded with stated dependencies ... OK +* checking whether the package can be unloaded cleanly ... OK +* checking whether the namespace can be loaded with stated dependencies ... OK +* checking whether the namespace can be unloaded cleanly ... OK +* checking loading without being on the library search path ... OK +* checking use of S3 registration ... OK +* checking dependencies in R code ... OK +* checking S3 generic/method consistency ... OK +* checking replacement functions ... OK +* checking foreign function calls ... OK +* checking R code for possible problems ... OK +* checking Rd files ... OK +* checking Rd metadata ... OK +* checking Rd line widths ... OK +* checking Rd cross-references ... OK +* checking for missing documentation entries ... OK +* checking for code/documentation mismatches ... OK +* checking Rd \usage sections ... OK +* checking Rd contents ... OK +* checking for unstated dependencies in examples ... OK +* checking line endings in shell scripts ... OK +* checking line endings in C/C++/Fortran sources/headers ... OK +* checking line endings in Makefiles ... OK +* checking compilation flags in Makevars ... OK +* checking for GNU extensions in Makefiles ... INFO +GNU make is a SystemRequirements. +* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK +* checking use of PKG_*FLAGS in Makefiles ... OK +* checking use of SHLIB_OPENMP_*FLAGS in Makefiles ... OK +* checking include directives in Makefiles ... OK +* checking pragmas in C/C++ headers and code ... NOTE +File which contains pragma(s) suppressing diagnostics: + ‘src/libuv/test/task.h’ +* checking compilation flags used ... NOTE +Compilation used the following non-portable flag(s): + ‘-Werror=format-security’ ‘-Wformat’ ‘-Wp,-D_FORTIFY_SOURCE=3’ + ‘-Wp,-D_GLIBCXX_ASSERTIONS’ ‘-march=x86-64’ + ‘-mno-omit-leaf-frame-pointer’ +* checking compiled code ... OK +* checking examples ... OK +* checking for unstated dependencies in ‘demo’ ... OK +* checking for unstated dependencies in ‘tests’ ... OK +* checking tests ... + Running ‘testthat.R’ [21s/22s] + [21s/22s] OK +* checking for non-standard things in the check directory ... OK +* checking for detritus in the temp directory ... OK +* DONE + +Status: 1 WARNING, 3 NOTEs +See + ‘/home/pacha/Documents/httpuv/httpuv.Rcheck/00check.log’ +for details. + +=== BEGIN 00install.out === +Loading required package: usethis +* installing *source* package ‘httpuv’ ... +** this is package ‘httpuv’ version ‘1.6.16.9000’ +** using staged installation +** Using libuv found by pkg-config in /usr +** PKG_CFLAGS= +** PKG_LIBS=-luv +** libs +specified C++20 +using C compiler: ‘gcc (GCC) 15.2.1 20260209’ +using C++ compiler: ‘g++ (GCC) 15.2.1 20260209’ +using C++20 +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callback.cpp -o callback.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callbackqueue.cpp -o callbackqueue.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c cpp11.cpp -o cpp11.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-unix.cpp -o filedatasource-unix.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-win.cpp -o filedatasource-win.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c fs.cpp -o fs.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c gzipdatasource.cpp -o gzipdatasource.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http.cpp -o http.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httprequest.cpp -o httprequest.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpresponse.cpp -o httpresponse.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpuv.cpp -o httpuv.o +gcc -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c md5.c -o md5.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c mime.cpp -o mime.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c socket.cpp -o socket.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c staticpath.cpp -o staticpath.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c thread.cpp -o thread.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c timegm.cpp -o timegm.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c utils.cpp -o utils.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c uvutil.cpp -o uvutil.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c webapplication.cpp -o webapplication.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-base.cpp -o websockets-base.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hixie76.cpp -o websockets-hixie76.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hybi03.cpp -o websockets-hybi03.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-ietf.cpp -o websockets-ietf.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets.cpp -o websockets.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c winutils.cpp -o winutils.o +gcc -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http-parser/http_parser.c -o http-parser/http_parser.o +gcc -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c sha1/sha1.c -o sha1/sha1.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c base64/base64.cpp -o base64/base64.o +g++ -std=gnu++20 -shared -L/usr/lib64/R/lib -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -o httpuv.so callback.o callbackqueue.o cpp11.o filedatasource-unix.o filedatasource-win.o fs.o gzipdatasource.o http.o httprequest.o httpresponse.o httpuv.o md5.o mime.o socket.o staticpath.o thread.o timegm.o utils.o uvutil.o webapplication.o websockets-base.o websockets-hixie76.o websockets-hybi03.o websockets-ietf.o websockets.o winutils.o -luv ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o -pthread -L/usr/lib64/R/lib -lR +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/filedatasource-win.o: no symbols +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/winutils.o: no symbols +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +installing to /home/pacha/Documents/httpuv/httpuv.Rcheck/00LOCK-httpuv/00new/httpuv/libs +** R +** demo +** inst +** byte-compile and prepare package for lazy loading +** help +*** installing help indices +** building package indices +** testing if installed package can be loaded from temporary location +** checking absolute paths in shared objects and dynamic libraries +** testing if installed package can be loaded from final location +** testing if installed package keeps a record of temporary installation path +* DONE (httpuv) +=== END 00install.out === +R CMD check completed with no ERRORs. Warnings/Notes (if any) are allowed. See ./check-gcc-clang/check-CXX20-gcc.log for full output. +Run complete. diff --git a/check-gcc-clang/check-CXX23-clang.log b/check-gcc-clang/check-CXX23-clang.log new file mode 100644 index 000000000..6fdf67e7b --- /dev/null +++ b/check-gcc-clang/check-CXX23-clang.log @@ -0,0 +1,167 @@ +Loading required package: usethis +Loading required package: usethis +* using log directory ‘/home/pacha/Documents/httpuv/httpuv.Rcheck’ +* using R version 4.6.0 (2026-04-24) +* using platform: x86_64-pc-linux-gnu +* R was compiled by + gcc (GCC) 15.2.1 20260209 + GNU Fortran (GCC) 15.2.1 20260209 +* running under: Manjaro Linux +* using session charset: UTF-8 +* current time: 2026-05-14 00:30:35 UTC +* using options ‘--no-manual --as-cran’ +* checking for file ‘httpuv/DESCRIPTION’ ... OK +* checking extension type ... Package +* this is package ‘httpuv’ version ‘1.6.16.9000’ +* package encoding: UTF-8 +* checking CRAN incoming feasibility ... [7s/16s] WARNING +Maintainer: ‘Winston Chang ’ + +Insufficient package version (submitted: 1.6.16.9000, existing: 1.6.17) +Version contains large components (1.6.16.9000) +* checking package namespace information ... OK +* checking package dependencies ... OK +* checking if this is a source package ... OK +* checking if there is a namespace ... OK +* checking for executable files ... OK +* checking for hidden files and directories ... OK +* checking for portable file names ... OK +* checking for sufficient/correct file permissions ... OK +* checking serialization versions ... OK +* checking whether package ‘httpuv’ can be installed ... [119s/121s] OK +* used C compiler: ‘clang version 22.1.3’ +* used C++ compiler: ‘clang version 22.1.3’ +* checking C++ specification ... OK + Not all R platforms support C++23 +* checking installed package size ... OK +* checking package directory ... OK +* checking for future file timestamps ... OK +* checking DESCRIPTION meta-information ... OK +* checking top-level files ... NOTE +Non-standard file/directory found at top level: + ‘check-gcc-clang’ +* checking for left-over files ... OK +* checking index information ... OK +* checking package subdirectories ... OK +* checking code files for non-ASCII characters ... OK +* checking R files for syntax errors ... OK +* checking whether the package can be loaded ... OK +* checking whether the package can be loaded with stated dependencies ... OK +* checking whether the package can be unloaded cleanly ... OK +* checking whether the namespace can be loaded with stated dependencies ... OK +* checking whether the namespace can be unloaded cleanly ... OK +* checking loading without being on the library search path ... OK +* checking use of S3 registration ... OK +* checking dependencies in R code ... OK +* checking S3 generic/method consistency ... OK +* checking replacement functions ... OK +* checking foreign function calls ... OK +* checking R code for possible problems ... OK +* checking Rd files ... OK +* checking Rd metadata ... OK +* checking Rd line widths ... OK +* checking Rd cross-references ... OK +* checking for missing documentation entries ... OK +* checking for code/documentation mismatches ... OK +* checking Rd \usage sections ... OK +* checking Rd contents ... OK +* checking for unstated dependencies in examples ... OK +* checking line endings in shell scripts ... OK +* checking line endings in C/C++/Fortran sources/headers ... OK +* checking line endings in Makefiles ... OK +* checking compilation flags in Makevars ... OK +* checking for GNU extensions in Makefiles ... INFO +GNU make is a SystemRequirements. +* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK +* checking use of PKG_*FLAGS in Makefiles ... OK +* checking use of SHLIB_OPENMP_*FLAGS in Makefiles ... OK +* checking include directives in Makefiles ... OK +* checking pragmas in C/C++ headers and code ... NOTE +File which contains pragma(s) suppressing diagnostics: + ‘src/libuv/test/task.h’ +* checking compilation flags used ... NOTE +Compilation used the following non-portable flag(s): + ‘-Werror=format-security’ ‘-Wformat’ ‘-Wp,-D_FORTIFY_SOURCE=3’ + ‘-Wp,-D_GLIBCXX_ASSERTIONS’ ‘-march=x86-64’ + ‘-mno-omit-leaf-frame-pointer’ +* checking compiled code ... OK +* checking examples ... OK +* checking for unstated dependencies in ‘demo’ ... OK +* checking for unstated dependencies in ‘tests’ ... OK +* checking tests ... + Running ‘testthat.R’ [18s/20s] + [18s/20s] OK +* checking for non-standard things in the check directory ... OK +* checking for detritus in the temp directory ... OK +* DONE + +Status: 1 WARNING, 3 NOTEs +See + ‘/home/pacha/Documents/httpuv/httpuv.Rcheck/00check.log’ +for details. + +=== BEGIN 00install.out === +Loading required package: usethis +* installing *source* package ‘httpuv’ ... +** this is package ‘httpuv’ version ‘1.6.16.9000’ +** using staged installation +** Using libuv found by pkg-config in /usr +** PKG_CFLAGS= +** PKG_LIBS=-luv +** libs +specified C++23 +using C compiler: ‘clang version 22.1.3’ +using C++ compiler: ‘clang version 22.1.3’ +using C++23 +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callback.cpp -o callback.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callbackqueue.cpp -o callbackqueue.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c cpp11.cpp -o cpp11.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-unix.cpp -o filedatasource-unix.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-win.cpp -o filedatasource-win.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c fs.cpp -o fs.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c gzipdatasource.cpp -o gzipdatasource.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http.cpp -o http.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httprequest.cpp -o httprequest.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpresponse.cpp -o httpresponse.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpuv.cpp -o httpuv.o +clang -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c md5.c -o md5.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c mime.cpp -o mime.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c socket.cpp -o socket.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c staticpath.cpp -o staticpath.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c thread.cpp -o thread.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c timegm.cpp -o timegm.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c utils.cpp -o utils.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c uvutil.cpp -o uvutil.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c webapplication.cpp -o webapplication.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-base.cpp -o websockets-base.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hixie76.cpp -o websockets-hixie76.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hybi03.cpp -o websockets-hybi03.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-ietf.cpp -o websockets-ietf.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets.cpp -o websockets.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c winutils.cpp -o winutils.o +clang -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http-parser/http_parser.c -o http-parser/http_parser.o +clang -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c sha1/sha1.c -o sha1/sha1.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c base64/base64.cpp -o base64/base64.o +clang++ -std=gnu++23 -shared -L/usr/lib64/R/lib -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -o httpuv.so callback.o callbackqueue.o cpp11.o filedatasource-unix.o filedatasource-win.o fs.o gzipdatasource.o http.o httprequest.o httpresponse.o httpuv.o md5.o mime.o socket.o staticpath.o thread.o timegm.o utils.o uvutil.o webapplication.o websockets-base.o websockets-hixie76.o websockets-hybi03.o websockets-ietf.o websockets.o winutils.o -luv ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o -pthread -L/usr/lib64/R/lib -lR +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/filedatasource-win.o: no symbols +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/winutils.o: no symbols +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +installing to /home/pacha/Documents/httpuv/httpuv.Rcheck/00LOCK-httpuv/00new/httpuv/libs +** R +** demo +** inst +** byte-compile and prepare package for lazy loading +** help +*** installing help indices +** building package indices +** testing if installed package can be loaded from temporary location +** checking absolute paths in shared objects and dynamic libraries +** testing if installed package can be loaded from final location +** testing if installed package keeps a record of temporary installation path +* DONE (httpuv) +=== END 00install.out === +R CMD check completed with no ERRORs. Warnings/Notes (if any) are allowed. See ./check-gcc-clang/check-CXX23-clang.log for full output. +Run complete. diff --git a/check-gcc-clang/check-CXX23-gcc.log b/check-gcc-clang/check-CXX23-gcc.log new file mode 100644 index 000000000..14b1ee8da --- /dev/null +++ b/check-gcc-clang/check-CXX23-gcc.log @@ -0,0 +1,170 @@ +Loading required package: usethis +Loading required package: usethis +* using log directory ‘/home/pacha/Documents/httpuv/httpuv.Rcheck’ +* using R version 4.6.0 (2026-04-24) +* using platform: x86_64-pc-linux-gnu +* R was compiled by + gcc (GCC) 15.2.1 20260209 + GNU Fortran (GCC) 15.2.1 20260209 +* running under: Manjaro Linux +* using session charset: UTF-8 +* current time: 2026-05-14 00:09:32 UTC +* using options ‘--no-manual --as-cran’ +* checking for file ‘httpuv/DESCRIPTION’ ... OK +* checking extension type ... Package +* this is package ‘httpuv’ version ‘1.6.16.9000’ +* package encoding: UTF-8 +* checking CRAN incoming feasibility ... [8s/17s] WARNING +Maintainer: ‘Winston Chang ’ + +Insufficient package version (submitted: 1.6.16.9000, existing: 1.6.17) +Version contains large components (1.6.16.9000) +* checking package namespace information ... OK +* checking package dependencies ... OK +* checking if this is a source package ... OK +* checking if there is a namespace ... OK +* checking for executable files ... OK +* checking for hidden files and directories ... OK +* checking for portable file names ... OK +* checking for sufficient/correct file permissions ... OK +* checking serialization versions ... OK +* checking whether package ‘httpuv’ can be installed ... [146s/122s] OK +* used C compiler: ‘gcc (GCC) 15.2.1 20260209’ +* used C++ compiler: ‘g++ (GCC) 15.2.1 20260209’ +* checking C++ specification ... OK + Not all R platforms support C++23 +* checking installed package size ... INFO + installed size is 7.7Mb + sub-directories of 1Mb or more: + libs 7.3Mb +* checking package directory ... OK +* checking for future file timestamps ... OK +* checking DESCRIPTION meta-information ... OK +* checking top-level files ... NOTE +Non-standard file/directory found at top level: + ‘check-gcc-clang’ +* checking for left-over files ... OK +* checking index information ... OK +* checking package subdirectories ... OK +* checking code files for non-ASCII characters ... OK +* checking R files for syntax errors ... OK +* checking whether the package can be loaded ... OK +* checking whether the package can be loaded with stated dependencies ... OK +* checking whether the package can be unloaded cleanly ... OK +* checking whether the namespace can be loaded with stated dependencies ... OK +* checking whether the namespace can be unloaded cleanly ... OK +* checking loading without being on the library search path ... OK +* checking use of S3 registration ... OK +* checking dependencies in R code ... OK +* checking S3 generic/method consistency ... OK +* checking replacement functions ... OK +* checking foreign function calls ... OK +* checking R code for possible problems ... OK +* checking Rd files ... OK +* checking Rd metadata ... OK +* checking Rd line widths ... OK +* checking Rd cross-references ... OK +* checking for missing documentation entries ... OK +* checking for code/documentation mismatches ... OK +* checking Rd \usage sections ... OK +* checking Rd contents ... OK +* checking for unstated dependencies in examples ... OK +* checking line endings in shell scripts ... OK +* checking line endings in C/C++/Fortran sources/headers ... OK +* checking line endings in Makefiles ... OK +* checking compilation flags in Makevars ... OK +* checking for GNU extensions in Makefiles ... INFO +GNU make is a SystemRequirements. +* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK +* checking use of PKG_*FLAGS in Makefiles ... OK +* checking use of SHLIB_OPENMP_*FLAGS in Makefiles ... OK +* checking include directives in Makefiles ... OK +* checking pragmas in C/C++ headers and code ... NOTE +File which contains pragma(s) suppressing diagnostics: + ‘src/libuv/test/task.h’ +* checking compilation flags used ... NOTE +Compilation used the following non-portable flag(s): + ‘-Werror=format-security’ ‘-Wformat’ ‘-Wp,-D_FORTIFY_SOURCE=3’ + ‘-Wp,-D_GLIBCXX_ASSERTIONS’ ‘-march=x86-64’ + ‘-mno-omit-leaf-frame-pointer’ +* checking compiled code ... OK +* checking examples ... OK +* checking for unstated dependencies in ‘demo’ ... OK +* checking for unstated dependencies in ‘tests’ ... OK +* checking tests ... + Running ‘testthat.R’ [19s/21s] + [20s/21s] OK +* checking for non-standard things in the check directory ... OK +* checking for detritus in the temp directory ... OK +* DONE + +Status: 1 WARNING, 3 NOTEs +See + ‘/home/pacha/Documents/httpuv/httpuv.Rcheck/00check.log’ +for details. + +=== BEGIN 00install.out === +Loading required package: usethis +* installing *source* package ‘httpuv’ ... +** this is package ‘httpuv’ version ‘1.6.16.9000’ +** using staged installation +** Using libuv found by pkg-config in /usr +** PKG_CFLAGS= +** PKG_LIBS=-luv +** libs +specified C++23 +using C compiler: ‘gcc (GCC) 15.2.1 20260209’ +using C++ compiler: ‘g++ (GCC) 15.2.1 20260209’ +using C++23 +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callback.cpp -o callback.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callbackqueue.cpp -o callbackqueue.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c cpp11.cpp -o cpp11.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-unix.cpp -o filedatasource-unix.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-win.cpp -o filedatasource-win.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c fs.cpp -o fs.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c gzipdatasource.cpp -o gzipdatasource.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http.cpp -o http.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httprequest.cpp -o httprequest.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpresponse.cpp -o httpresponse.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpuv.cpp -o httpuv.o +gcc -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c md5.c -o md5.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c mime.cpp -o mime.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c socket.cpp -o socket.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c staticpath.cpp -o staticpath.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c thread.cpp -o thread.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c timegm.cpp -o timegm.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c utils.cpp -o utils.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c uvutil.cpp -o uvutil.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c webapplication.cpp -o webapplication.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-base.cpp -o websockets-base.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hixie76.cpp -o websockets-hixie76.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hybi03.cpp -o websockets-hybi03.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-ietf.cpp -o websockets-ietf.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets.cpp -o websockets.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c winutils.cpp -o winutils.o +gcc -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http-parser/http_parser.c -o http-parser/http_parser.o +gcc -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c sha1/sha1.c -o sha1/sha1.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c base64/base64.cpp -o base64/base64.o +g++ -std=gnu++23 -shared -L/usr/lib64/R/lib -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -o httpuv.so callback.o callbackqueue.o cpp11.o filedatasource-unix.o filedatasource-win.o fs.o gzipdatasource.o http.o httprequest.o httpresponse.o httpuv.o md5.o mime.o socket.o staticpath.o thread.o timegm.o utils.o uvutil.o webapplication.o websockets-base.o websockets-hixie76.o websockets-hybi03.o websockets-ietf.o websockets.o winutils.o -luv ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o -pthread -L/usr/lib64/R/lib -lR +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/filedatasource-win.o: no symbols +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/winutils.o: no symbols +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +installing to /home/pacha/Documents/httpuv/httpuv.Rcheck/00LOCK-httpuv/00new/httpuv/libs +** R +** demo +** inst +** byte-compile and prepare package for lazy loading +** help +*** installing help indices +** building package indices +** testing if installed package can be loaded from temporary location +** checking absolute paths in shared objects and dynamic libraries +** testing if installed package can be loaded from final location +** testing if installed package keeps a record of temporary installation path +* DONE (httpuv) +=== END 00install.out === +R CMD check completed with no ERRORs. Warnings/Notes (if any) are allowed. See ./check-gcc-clang/check-CXX23-gcc.log for full output. +Run complete. diff --git a/check-gcc-clang/install-CXX17-clang.log b/check-gcc-clang/install-CXX17-clang.log new file mode 100644 index 000000000..32560d2d6 --- /dev/null +++ b/check-gcc-clang/install-CXX17-clang.log @@ -0,0 +1,61 @@ +Loading required package: usethis +* installing *source* package ‘httpuv’ ... +** this is package ‘httpuv’ version ‘1.6.16.9000’ +** using staged installation +** Using libuv found by pkg-config in /usr +** PKG_CFLAGS= +** PKG_LIBS=-luv +** libs +specified C++17 +using C compiler: ‘clang version 22.1.3’ +using C++ compiler: ‘clang version 22.1.3’ +using C++17 +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callback.cpp -o callback.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callbackqueue.cpp -o callbackqueue.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c cpp11.cpp -o cpp11.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-unix.cpp -o filedatasource-unix.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-win.cpp -o filedatasource-win.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c fs.cpp -o fs.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c gzipdatasource.cpp -o gzipdatasource.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http.cpp -o http.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httprequest.cpp -o httprequest.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpresponse.cpp -o httpresponse.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpuv.cpp -o httpuv.o +clang -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c md5.c -o md5.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c mime.cpp -o mime.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c socket.cpp -o socket.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c staticpath.cpp -o staticpath.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c thread.cpp -o thread.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c timegm.cpp -o timegm.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c utils.cpp -o utils.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c uvutil.cpp -o uvutil.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c webapplication.cpp -o webapplication.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-base.cpp -o websockets-base.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hixie76.cpp -o websockets-hixie76.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hybi03.cpp -o websockets-hybi03.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-ietf.cpp -o websockets-ietf.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets.cpp -o websockets.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c winutils.cpp -o winutils.o +clang -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http-parser/http_parser.c -o http-parser/http_parser.o +clang -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c sha1/sha1.c -o sha1/sha1.o +clang++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c base64/base64.cpp -o base64/base64.o +clang++ -std=gnu++17 -shared -L/usr/lib64/R/lib -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -o httpuv.so callback.o callbackqueue.o cpp11.o filedatasource-unix.o filedatasource-win.o fs.o gzipdatasource.o http.o httprequest.o httpresponse.o httpuv.o md5.o mime.o socket.o staticpath.o thread.o timegm.o utils.o uvutil.o webapplication.o websockets-base.o websockets-hixie76.o websockets-hybi03.o websockets-ietf.o websockets.o winutils.o -luv ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o -pthread -L/usr/lib64/R/lib -lR +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/filedatasource-win.o: no symbols +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/winutils.o: no symbols +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +installing to /home/pacha/Documents/httpuv/httpuv.Rcheck/00LOCK-httpuv/00new/httpuv/libs +** R +** demo +** inst +** byte-compile and prepare package for lazy loading +** help +*** installing help indices +** building package indices +** testing if installed package can be loaded from temporary location +** checking absolute paths in shared objects and dynamic libraries +** testing if installed package can be loaded from final location +** testing if installed package keeps a record of temporary installation path +* DONE (httpuv) diff --git a/check-gcc-clang/install-CXX17-gcc.log b/check-gcc-clang/install-CXX17-gcc.log new file mode 100644 index 000000000..6966e47bd --- /dev/null +++ b/check-gcc-clang/install-CXX17-gcc.log @@ -0,0 +1,61 @@ +Loading required package: usethis +* installing *source* package ‘httpuv’ ... +** this is package ‘httpuv’ version ‘1.6.16.9000’ +** using staged installation +** Using libuv found by pkg-config in /usr +** PKG_CFLAGS= +** PKG_LIBS=-luv +** libs +specified C++17 +using C compiler: ‘gcc (GCC) 15.2.1 20260209’ +using C++ compiler: ‘g++ (GCC) 15.2.1 20260209’ +using C++17 +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callback.cpp -o callback.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callbackqueue.cpp -o callbackqueue.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c cpp11.cpp -o cpp11.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-unix.cpp -o filedatasource-unix.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-win.cpp -o filedatasource-win.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c fs.cpp -o fs.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c gzipdatasource.cpp -o gzipdatasource.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http.cpp -o http.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httprequest.cpp -o httprequest.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpresponse.cpp -o httpresponse.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpuv.cpp -o httpuv.o +gcc -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c md5.c -o md5.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c mime.cpp -o mime.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c socket.cpp -o socket.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c staticpath.cpp -o staticpath.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c thread.cpp -o thread.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c timegm.cpp -o timegm.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c utils.cpp -o utils.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c uvutil.cpp -o uvutil.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c webapplication.cpp -o webapplication.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-base.cpp -o websockets-base.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hixie76.cpp -o websockets-hixie76.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hybi03.cpp -o websockets-hybi03.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-ietf.cpp -o websockets-ietf.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets.cpp -o websockets.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c winutils.cpp -o winutils.o +gcc -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http-parser/http_parser.c -o http-parser/http_parser.o +gcc -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c sha1/sha1.c -o sha1/sha1.o +g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c base64/base64.cpp -o base64/base64.o +g++ -std=gnu++17 -shared -L/usr/lib64/R/lib -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -o httpuv.so callback.o callbackqueue.o cpp11.o filedatasource-unix.o filedatasource-win.o fs.o gzipdatasource.o http.o httprequest.o httpresponse.o httpuv.o md5.o mime.o socket.o staticpath.o thread.o timegm.o utils.o uvutil.o webapplication.o websockets-base.o websockets-hixie76.o websockets-hybi03.o websockets-ietf.o websockets.o winutils.o -luv ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o -pthread -L/usr/lib64/R/lib -lR +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/filedatasource-win.o: no symbols +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/winutils.o: no symbols +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +installing to /home/pacha/Documents/httpuv/httpuv.Rcheck/00LOCK-httpuv/00new/httpuv/libs +** R +** demo +** inst +** byte-compile and prepare package for lazy loading +** help +*** installing help indices +** building package indices +** testing if installed package can be loaded from temporary location +** checking absolute paths in shared objects and dynamic libraries +** testing if installed package can be loaded from final location +** testing if installed package keeps a record of temporary installation path +* DONE (httpuv) diff --git a/check-gcc-clang/install-CXX20-clang.log b/check-gcc-clang/install-CXX20-clang.log new file mode 100644 index 000000000..a03854567 --- /dev/null +++ b/check-gcc-clang/install-CXX20-clang.log @@ -0,0 +1,61 @@ +Loading required package: usethis +* installing *source* package ‘httpuv’ ... +** this is package ‘httpuv’ version ‘1.6.16.9000’ +** using staged installation +** Using libuv found by pkg-config in /usr +** PKG_CFLAGS= +** PKG_LIBS=-luv +** libs +specified C++20 +using C compiler: ‘clang version 22.1.3’ +using C++ compiler: ‘clang version 22.1.3’ +using C++20 +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callback.cpp -o callback.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callbackqueue.cpp -o callbackqueue.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c cpp11.cpp -o cpp11.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-unix.cpp -o filedatasource-unix.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-win.cpp -o filedatasource-win.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c fs.cpp -o fs.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c gzipdatasource.cpp -o gzipdatasource.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http.cpp -o http.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httprequest.cpp -o httprequest.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpresponse.cpp -o httpresponse.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpuv.cpp -o httpuv.o +clang -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c md5.c -o md5.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c mime.cpp -o mime.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c socket.cpp -o socket.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c staticpath.cpp -o staticpath.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c thread.cpp -o thread.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c timegm.cpp -o timegm.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c utils.cpp -o utils.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c uvutil.cpp -o uvutil.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c webapplication.cpp -o webapplication.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-base.cpp -o websockets-base.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hixie76.cpp -o websockets-hixie76.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hybi03.cpp -o websockets-hybi03.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-ietf.cpp -o websockets-ietf.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets.cpp -o websockets.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c winutils.cpp -o winutils.o +clang -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http-parser/http_parser.c -o http-parser/http_parser.o +clang -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c sha1/sha1.c -o sha1/sha1.o +clang++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c base64/base64.cpp -o base64/base64.o +clang++ -std=gnu++20 -shared -L/usr/lib64/R/lib -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -o httpuv.so callback.o callbackqueue.o cpp11.o filedatasource-unix.o filedatasource-win.o fs.o gzipdatasource.o http.o httprequest.o httpresponse.o httpuv.o md5.o mime.o socket.o staticpath.o thread.o timegm.o utils.o uvutil.o webapplication.o websockets-base.o websockets-hixie76.o websockets-hybi03.o websockets-ietf.o websockets.o winutils.o -luv ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o -pthread -L/usr/lib64/R/lib -lR +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/filedatasource-win.o: no symbols +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/winutils.o: no symbols +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +installing to /home/pacha/Documents/httpuv/httpuv.Rcheck/00LOCK-httpuv/00new/httpuv/libs +** R +** demo +** inst +** byte-compile and prepare package for lazy loading +** help +*** installing help indices +** building package indices +** testing if installed package can be loaded from temporary location +** checking absolute paths in shared objects and dynamic libraries +** testing if installed package can be loaded from final location +** testing if installed package keeps a record of temporary installation path +* DONE (httpuv) diff --git a/check-gcc-clang/install-CXX20-gcc.log b/check-gcc-clang/install-CXX20-gcc.log new file mode 100644 index 000000000..35d2becd6 --- /dev/null +++ b/check-gcc-clang/install-CXX20-gcc.log @@ -0,0 +1,61 @@ +Loading required package: usethis +* installing *source* package ‘httpuv’ ... +** this is package ‘httpuv’ version ‘1.6.16.9000’ +** using staged installation +** Using libuv found by pkg-config in /usr +** PKG_CFLAGS= +** PKG_LIBS=-luv +** libs +specified C++20 +using C compiler: ‘gcc (GCC) 15.2.1 20260209’ +using C++ compiler: ‘g++ (GCC) 15.2.1 20260209’ +using C++20 +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callback.cpp -o callback.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callbackqueue.cpp -o callbackqueue.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c cpp11.cpp -o cpp11.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-unix.cpp -o filedatasource-unix.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-win.cpp -o filedatasource-win.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c fs.cpp -o fs.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c gzipdatasource.cpp -o gzipdatasource.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http.cpp -o http.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httprequest.cpp -o httprequest.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpresponse.cpp -o httpresponse.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpuv.cpp -o httpuv.o +gcc -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c md5.c -o md5.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c mime.cpp -o mime.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c socket.cpp -o socket.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c staticpath.cpp -o staticpath.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c thread.cpp -o thread.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c timegm.cpp -o timegm.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c utils.cpp -o utils.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c uvutil.cpp -o uvutil.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c webapplication.cpp -o webapplication.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-base.cpp -o websockets-base.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hixie76.cpp -o websockets-hixie76.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hybi03.cpp -o websockets-hybi03.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-ietf.cpp -o websockets-ietf.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets.cpp -o websockets.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c winutils.cpp -o winutils.o +gcc -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http-parser/http_parser.c -o http-parser/http_parser.o +gcc -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c sha1/sha1.c -o sha1/sha1.o +g++ -std=gnu++20 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c base64/base64.cpp -o base64/base64.o +g++ -std=gnu++20 -shared -L/usr/lib64/R/lib -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -o httpuv.so callback.o callbackqueue.o cpp11.o filedatasource-unix.o filedatasource-win.o fs.o gzipdatasource.o http.o httprequest.o httpresponse.o httpuv.o md5.o mime.o socket.o staticpath.o thread.o timegm.o utils.o uvutil.o webapplication.o websockets-base.o websockets-hixie76.o websockets-hybi03.o websockets-ietf.o websockets.o winutils.o -luv ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o -pthread -L/usr/lib64/R/lib -lR +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/filedatasource-win.o: no symbols +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/winutils.o: no symbols +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +installing to /home/pacha/Documents/httpuv/httpuv.Rcheck/00LOCK-httpuv/00new/httpuv/libs +** R +** demo +** inst +** byte-compile and prepare package for lazy loading +** help +*** installing help indices +** building package indices +** testing if installed package can be loaded from temporary location +** checking absolute paths in shared objects and dynamic libraries +** testing if installed package can be loaded from final location +** testing if installed package keeps a record of temporary installation path +* DONE (httpuv) diff --git a/check-gcc-clang/install-CXX23-clang.log b/check-gcc-clang/install-CXX23-clang.log new file mode 100644 index 000000000..8221c65c4 --- /dev/null +++ b/check-gcc-clang/install-CXX23-clang.log @@ -0,0 +1,61 @@ +Loading required package: usethis +* installing *source* package ‘httpuv’ ... +** this is package ‘httpuv’ version ‘1.6.16.9000’ +** using staged installation +** Using libuv found by pkg-config in /usr +** PKG_CFLAGS= +** PKG_LIBS=-luv +** libs +specified C++23 +using C compiler: ‘clang version 22.1.3’ +using C++ compiler: ‘clang version 22.1.3’ +using C++23 +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callback.cpp -o callback.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callbackqueue.cpp -o callbackqueue.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c cpp11.cpp -o cpp11.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-unix.cpp -o filedatasource-unix.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-win.cpp -o filedatasource-win.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c fs.cpp -o fs.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c gzipdatasource.cpp -o gzipdatasource.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http.cpp -o http.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httprequest.cpp -o httprequest.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpresponse.cpp -o httpresponse.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpuv.cpp -o httpuv.o +clang -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c md5.c -o md5.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c mime.cpp -o mime.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c socket.cpp -o socket.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c staticpath.cpp -o staticpath.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c thread.cpp -o thread.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c timegm.cpp -o timegm.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c utils.cpp -o utils.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c uvutil.cpp -o uvutil.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c webapplication.cpp -o webapplication.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-base.cpp -o websockets-base.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hixie76.cpp -o websockets-hixie76.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hybi03.cpp -o websockets-hybi03.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-ietf.cpp -o websockets-ietf.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets.cpp -o websockets.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c winutils.cpp -o winutils.o +clang -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http-parser/http_parser.c -o http-parser/http_parser.o +clang -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c sha1/sha1.c -o sha1/sha1.o +clang++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c base64/base64.cpp -o base64/base64.o +clang++ -std=gnu++23 -shared -L/usr/lib64/R/lib -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -o httpuv.so callback.o callbackqueue.o cpp11.o filedatasource-unix.o filedatasource-win.o fs.o gzipdatasource.o http.o httprequest.o httpresponse.o httpuv.o md5.o mime.o socket.o staticpath.o thread.o timegm.o utils.o uvutil.o webapplication.o websockets-base.o websockets-hixie76.o websockets-hybi03.o websockets-ietf.o websockets.o winutils.o -luv ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o -pthread -L/usr/lib64/R/lib -lR +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/filedatasource-win.o: no symbols +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/winutils.o: no symbols +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +installing to /home/pacha/Documents/httpuv/httpuv.Rcheck/00LOCK-httpuv/00new/httpuv/libs +** R +** demo +** inst +** byte-compile and prepare package for lazy loading +** help +*** installing help indices +** building package indices +** testing if installed package can be loaded from temporary location +** checking absolute paths in shared objects and dynamic libraries +** testing if installed package can be loaded from final location +** testing if installed package keeps a record of temporary installation path +* DONE (httpuv) diff --git a/check-gcc-clang/install-CXX23-gcc.log b/check-gcc-clang/install-CXX23-gcc.log new file mode 100644 index 000000000..db1786c7d --- /dev/null +++ b/check-gcc-clang/install-CXX23-gcc.log @@ -0,0 +1,61 @@ +Loading required package: usethis +* installing *source* package ‘httpuv’ ... +** this is package ‘httpuv’ version ‘1.6.16.9000’ +** using staged installation +** Using libuv found by pkg-config in /usr +** PKG_CFLAGS= +** PKG_LIBS=-luv +** libs +specified C++23 +using C compiler: ‘gcc (GCC) 15.2.1 20260209’ +using C++ compiler: ‘g++ (GCC) 15.2.1 20260209’ +using C++23 +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callback.cpp -o callback.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c callbackqueue.cpp -o callbackqueue.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c cpp11.cpp -o cpp11.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-unix.cpp -o filedatasource-unix.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c filedatasource-win.cpp -o filedatasource-win.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c fs.cpp -o fs.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c gzipdatasource.cpp -o gzipdatasource.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http.cpp -o http.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httprequest.cpp -o httprequest.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpresponse.cpp -o httpresponse.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c httpuv.cpp -o httpuv.o +gcc -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c md5.c -o md5.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c mime.cpp -o mime.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c socket.cpp -o socket.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c staticpath.cpp -o staticpath.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c thread.cpp -o thread.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c timegm.cpp -o timegm.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c utils.cpp -o utils.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c uvutil.cpp -o uvutil.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c webapplication.cpp -o webapplication.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-base.cpp -o websockets-base.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hixie76.cpp -o websockets-hixie76.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-hybi03.cpp -o websockets-hybi03.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets-ietf.cpp -o websockets-ietf.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c websockets.cpp -o websockets.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c winutils.cpp -o winutils.o +gcc -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c http-parser/http_parser.c -o http-parser/http_parser.o +gcc -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c sha1/sha1.c -o sha1/sha1.o +g++ -std=gnu++23 -I"/usr/include/R/" -DNDEBUG -pthread -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/later/include' -I'/home/pacha/R/x86_64-pc-linux-gnu-library/4.6/cpp11/include' -I/usr/local/include -fvisibility=hidden -DSTRICT_R_HEADERS -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c base64/base64.cpp -o base64/base64.o +g++ -std=gnu++23 -shared -L/usr/lib64/R/lib -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -o httpuv.so callback.o callbackqueue.o cpp11.o filedatasource-unix.o filedatasource-win.o fs.o gzipdatasource.o http.o httprequest.o httpresponse.o httpuv.o md5.o mime.o socket.o staticpath.o thread.o timegm.o utils.o uvutil.o webapplication.o websockets-base.o websockets-hixie76.o websockets-hybi03.o websockets-ietf.o websockets.o winutils.o -luv ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o -pthread -L/usr/lib64/R/lib -lR +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +make[1]: Entering directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/filedatasource-win.o: no symbols +/usr/bin/nm: /home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src/winutils.o: no symbols +make[1]: Leaving directory '/home/pacha/Documents/httpuv/httpuv.Rcheck/00_pkg_src/httpuv/src' +installing to /home/pacha/Documents/httpuv/httpuv.Rcheck/00LOCK-httpuv/00new/httpuv/libs +** R +** demo +** inst +** byte-compile and prepare package for lazy loading +** help +*** installing help indices +** building package indices +** testing if installed package can be loaded from temporary location +** checking absolute paths in shared objects and dynamic libraries +** testing if installed package can be loaded from final location +** testing if installed package keeps a record of temporary installation path +* DONE (httpuv) diff --git a/man/PipeServer.Rd b/man/PipeServer.Rd index 865b487c9..7502667c8 100644 --- a/man/PipeServer.Rd +++ b/man/PipeServer.Rd @@ -10,7 +10,7 @@ named pipe. \examples{ ## ------------------------------------------------ -## Method `PipeServer$new` +## Method `PipeServer$new()` ## ------------------------------------------------ \dontrun{ @@ -31,62 +31,57 @@ server <- PipeServer$new("my_pipe", -1, app) } \keyword{internal} \section{Super class}{ -\code{\link[httpuv:Server]{httpuv::Server}} -> \code{PipeServer} +\code{\link[httpuv:Server]{Server}} -> \code{PipeServer} } \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-PipeServer-new}{\code{PipeServer$new()}} -\item \href{#method-PipeServer-getName}{\code{PipeServer$getName()}} -\item \href{#method-PipeServer-getMask}{\code{PipeServer$getMask()}} + \itemize{ + \item \href{#method-PipeServer-initialize}{\code{PipeServer$new()}} + \item \href{#method-PipeServer-getName}{\code{PipeServer$getName()}} + \item \href{#method-PipeServer-getMask}{\code{PipeServer$getMask()}} + } } -} -\if{html}{\out{ -
Inherited methods +\if{html}{\out{
Inherited methods -
-}} +
}} \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-PipeServer-new}{}}} -\subsection{Method \code{new()}}{ -Initialize a new PipeServer object +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-PipeServer-initialize}{}}} +\subsection{\code{PipeServer$new()}}{ + Initialize a new PipeServer object Create a new \code{PipeServer} object. \code{app} is an httpuv application object as described in \code{\link[=startServer]{startServer()}}. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{PipeServer$new(name, mask, app, quiet = FALSE)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{name}}{The name of the named pipe to bind the server to.} - -\item{\code{mask}}{The mask for the named pipe. If NULL, it defaults to -1.} - -\item{\code{app}}{An httpuv application object as described in + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{PipeServer$new(name, mask, app, quiet = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{name}}{The name of the named pipe to bind the server to.} + \item{\code{mask}}{The mask for the named pipe. If NULL, it defaults to -1.} + \item{\code{app}}{An httpuv application object as described in \code{\link[=startServer]{startServer()}}.} - -\item{\code{quiet}}{If TRUE, suppresses output from the server.} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -A new \code{PipeServer} object. -} -\subsection{Examples}{ -\if{html}{\out{
}} -\preformatted{\dontrun{ -# Create a simple app + \item{\code{quiet}}{If TRUE, suppresses output from the server.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + A new \code{PipeServer} object. + } + \subsection{Examples}{ + \if{html}{\out{
}} + \preformatted{# Create a simple app app <- function(req) { list( status = 200L, @@ -97,36 +92,38 @@ app <- function(req) { # Create a server server <- PipeServer$new("my_pipe", -1, app) } -} -\if{html}{\out{
}} - + \if{html}{\out{
}} + } } -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-PipeServer-getName}{}}} -\subsection{Method \code{getName()}}{ -Get the name of the named pipe -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{PipeServer$getName()}\if{html}{\out{
}} +\subsection{\code{PipeServer$getName()}}{ + Get the name of the named pipe + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{PipeServer$getName()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + The name of the named pipe that the server is bound to. + } } -\subsection{Returns}{ -The name of the named pipe that the server is bound to. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-PipeServer-getMask}{}}} -\subsection{Method \code{getMask()}}{ -Get the mask for the named pipe -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{PipeServer$getMask()}\if{html}{\out{
}} +\subsection{\code{PipeServer$getMask()}}{ + Get the mask for the named pipe + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{PipeServer$getMask()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + The mask for the named pipe that the server is bound to. + } } -\subsection{Returns}{ -The mask for the named pipe that the server is bound to. -} -} } diff --git a/man/Server.Rd b/man/Server.Rd index 77c94ae6c..74bb83b2a 100644 --- a/man/Server.Rd +++ b/man/Server.Rd @@ -11,7 +11,7 @@ be instantiated. \examples{ ## ------------------------------------------------ -## Method `Server$setStaticPath` +## Method `Server$setStaticPath()` ## ------------------------------------------------ \dontrun{ @@ -25,7 +25,7 @@ server$setStaticPath( } ## ------------------------------------------------ -## Method `Server$removeStaticPath` +## Method `Server$removeStaticPath()` ## ------------------------------------------------ \dontrun{ @@ -46,78 +46,83 @@ server$removeStaticPath("staticPath1") \keyword{internal} \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-Server-stop}{\code{Server$stop()}} -\item \href{#method-Server-isRunning}{\code{Server$isRunning()}} -\item \href{#method-Server-getStaticPaths}{\code{Server$getStaticPaths()}} -\item \href{#method-Server-setStaticPath}{\code{Server$setStaticPath()}} -\item \href{#method-Server-removeStaticPath}{\code{Server$removeStaticPath()}} -\item \href{#method-Server-getStaticPathOptions}{\code{Server$getStaticPathOptions()}} -\item \href{#method-Server-setStaticPathOption}{\code{Server$setStaticPathOption()}} -} + \itemize{ + \item \href{#method-Server-stop}{\code{Server$stop()}} + \item \href{#method-Server-isRunning}{\code{Server$isRunning()}} + \item \href{#method-Server-getStaticPaths}{\code{Server$getStaticPaths()}} + \item \href{#method-Server-setStaticPath}{\code{Server$setStaticPath()}} + \item \href{#method-Server-removeStaticPath}{\code{Server$removeStaticPath()}} + \item \href{#method-Server-getStaticPathOptions}{\code{Server$getStaticPathOptions()}} + \item \href{#method-Server-setStaticPathOption}{\code{Server$setStaticPathOption()}} + } } \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-Server-stop}{}}} -\subsection{Method \code{stop()}}{ -Stop a running server -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{Server$stop()}\if{html}{\out{
}} +\subsection{\code{Server$stop()}}{ + Stop a running server + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{Server$stop()} + \if{html}{\out{
}} + } } -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-Server-isRunning}{}}} -\subsection{Method \code{isRunning()}}{ -Check if the server is running -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{Server$isRunning()}\if{html}{\out{
}} +\subsection{\code{Server$isRunning()}}{ + Check if the server is running + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{Server$isRunning()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + TRUE if the server is running, FALSE otherwise. + } } -\subsection{Returns}{ -TRUE if the server is running, FALSE otherwise. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-Server-getStaticPaths}{}}} -\subsection{Method \code{getStaticPaths()}}{ -Get the static paths for the server -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{Server$getStaticPaths()}\if{html}{\out{
}} +\subsection{\code{Server$getStaticPaths()}}{ + Get the static paths for the server + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{Server$getStaticPaths()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + A list of \code{\link[=staticPath]{staticPath()}} objects. + } } -\subsection{Returns}{ -A list of \code{\link[=staticPath]{staticPath()}} objects. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-Server-setStaticPath}{}}} -\subsection{Method \code{setStaticPath()}}{ -Set a static path for the server -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{Server$setStaticPath(..., .list = NULL)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{...}}{Named arguments where each name is the name of the static path +\subsection{\code{Server$setStaticPath()}}{ + Set a static path for the server + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{Server$setStaticPath(..., .list = NULL)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{...}}{Named arguments where each name is the name of the static path and the value is the path to the directory to serve. If there already exists a static path with the same name, it will be replaced.} - -\item{\code{.list}}{A named list where each name is the name of the static path + \item{\code{.list}}{A named list where each name is the name of the static path and the value is the path to the directory to serve. If there already exists a static path with the same name, it will be replaced.} -} -\if{html}{\out{
}} -} -\subsection{Examples}{ -\if{html}{\out{
}} -\preformatted{\dontrun{ -# Create a server + } + \if{html}{\out{
}} + } + \subsection{Examples}{ + \if{html}{\out{
}} + \preformatted{# Create a server server <- WebServer$new("127.0.0.1", 8080, app = my_app) #' # Set a static path server$setStaticPath( @@ -125,36 +130,34 @@ server$setStaticPath( staticPath2 = "another/path/to/static/files" ) } -} -\if{html}{\out{
}} - + \if{html}{\out{
}} + } } -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-Server-removeStaticPath}{}}} -\subsection{Method \code{removeStaticPath()}}{ -Remove a static path -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{Server$removeStaticPath(path)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{path}}{The name of the static path to remove.} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -An invisible NULL if the server is running, otherwise it does +\subsection{\code{Server$removeStaticPath()}}{ + Remove a static path + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{Server$removeStaticPath(path)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{path}}{The name of the static path to remove.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + An invisible NULL if the server is running, otherwise it does nothing. -} -\subsection{Examples}{ -\if{html}{\out{
}} -\preformatted{\dontrun{ -# Create a server + } + \subsection{Examples}{ + \if{html}{\out{
}} + \preformatted{# Create a server server <- WebServer$new("127.0.0.1", 8080, app = my_app) # Set a static path server$setStaticPath( @@ -164,50 +167,51 @@ server$setStaticPath( # Remove a static path server$removeStaticPath("staticPath1") } -} -\if{html}{\out{
}} - + \if{html}{\out{
}} + } } -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-Server-getStaticPathOptions}{}}} -\subsection{Method \code{getStaticPathOptions()}}{ -Get the static path options for the server -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{Server$getStaticPathOptions()}\if{html}{\out{
}} -} - -\subsection{Returns}{ -A list of default \code{staticPathOptions} for the current server. +\subsection{\code{Server$getStaticPathOptions()}}{ + Get the static path options for the server + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{Server$getStaticPathOptions()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + A list of default \code{staticPathOptions} for the current server. Each static path will use these options by default, but they can be overridden for each static path. + } } -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-Server-setStaticPathOption}{}}} -\subsection{Method \code{setStaticPathOption()}}{ -Set one or more static path options -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{Server$setStaticPathOption(..., .list = NULL)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{...}}{Named arguments where each name is the name of the static path +\subsection{\code{Server$setStaticPathOption()}}{ + Set one or more static path options + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{Server$setStaticPathOption(..., .list = NULL)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{...}}{Named arguments where each name is the name of the static path option and the value is the value to set for that option.} - -\item{\code{.list}}{A named list where each name is the name of the static path + \item{\code{.list}}{A named list where each name is the name of the static path option and the value is the value to set for that option.} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -An invisible NULL if the server is running, otherwise it does + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + An invisible NULL if the server is running, otherwise it does nothing. + } } -} + } diff --git a/man/WebServer.Rd b/man/WebServer.Rd index 2e5d99267..daf83c785 100644 --- a/man/WebServer.Rd +++ b/man/WebServer.Rd @@ -10,7 +10,7 @@ can be running at the same time. \examples{ ## ------------------------------------------------ -## Method `WebServer$new` +## Method `WebServer$new()` ## ------------------------------------------------ \dontrun{ @@ -31,61 +31,56 @@ server <- WebServer$new("127.0.0.1", 8080, app) } \keyword{internal} \section{Super class}{ -\code{\link[httpuv:Server]{httpuv::Server}} -> \code{WebServer} +\code{\link[httpuv:Server]{Server}} -> \code{WebServer} } \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-WebServer-new}{\code{WebServer$new()}} -\item \href{#method-WebServer-getHost}{\code{WebServer$getHost()}} -\item \href{#method-WebServer-getPort}{\code{WebServer$getPort()}} + \itemize{ + \item \href{#method-WebServer-initialize}{\code{WebServer$new()}} + \item \href{#method-WebServer-getHost}{\code{WebServer$getHost()}} + \item \href{#method-WebServer-getPort}{\code{WebServer$getPort()}} + } } -} -\if{html}{\out{ -
Inherited methods +\if{html}{\out{
Inherited methods -
-}} +
}} \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-WebServer-new}{}}} -\subsection{Method \code{new()}}{ -Initialize a new WebServer object +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-WebServer-initialize}{}}} +\subsection{\code{WebServer$new()}}{ + Initialize a new WebServer object Create a new \code{WebServer} object. \code{app} is an httpuv application object as described in \code{\link[=startServer]{startServer()}}. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{WebServer$new(host, port, app, quiet = FALSE)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{host}}{The host name or IP address to bind the server to.} - -\item{\code{port}}{The port number to bind the server to.} - -\item{\code{app}}{An httpuv application object as described in \code{\link[=startServer]{startServer()}}.} - -\item{\code{quiet}}{If TRUE, suppresses output from the server.} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -A new \code{WebServer} object. -} -\subsection{Examples}{ -\if{html}{\out{
}} -\preformatted{\dontrun{ -# Create a simple app + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{WebServer$new(host, port, app, quiet = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{host}}{The host name or IP address to bind the server to.} + \item{\code{port}}{The port number to bind the server to.} + \item{\code{app}}{An httpuv application object as described in \code{\link[=startServer]{startServer()}}.} + \item{\code{quiet}}{If TRUE, suppresses output from the server.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + A new \code{WebServer} object. + } + \subsection{Examples}{ + \if{html}{\out{
}} + \preformatted{# Create a simple app app <- function(req) { list( status = 200L, @@ -96,36 +91,38 @@ app <- function(req) { # Create a server server <- WebServer$new("127.0.0.1", 8080, app) } -} -\if{html}{\out{
}} - + \if{html}{\out{
}} + } } -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-WebServer-getHost}{}}} -\subsection{Method \code{getHost()}}{ -Get the host name or IP address of the server -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{WebServer$getHost()}\if{html}{\out{
}} +\subsection{\code{WebServer$getHost()}}{ + Get the host name or IP address of the server + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{WebServer$getHost()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + The host name or IP address that the server is bound to. + } } -\subsection{Returns}{ -The host name or IP address that the server is bound to. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-WebServer-getPort}{}}} -\subsection{Method \code{getPort()}}{ -Get the port number of the server -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{WebServer$getPort()}\if{html}{\out{
}} +\subsection{\code{WebServer$getPort()}}{ + Get the port number of the server + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{WebServer$getPort()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + The port number that the server is bound to. + } } -\subsection{Returns}{ -The port number that the server is bound to. -} -} } diff --git a/man/WebSocket.Rd b/man/WebSocket.Rd index cc24d6a7d..5e56384e6 100644 --- a/man/WebSocket.Rd +++ b/man/WebSocket.Rd @@ -45,142 +45,152 @@ startServer("0.0.0.0", 8080, } } \section{Public fields}{ -\if{html}{\out{
}} -\describe{ -\item{\code{handle}}{The server handle} + \if{html}{\out{
}} + \describe{ + \item{\code{handle}}{The server handle} -\item{\code{messageCallbacks}}{A list of callback functions that will be invoked + \item{\code{messageCallbacks}}{A list of callback functions that will be invoked when a message is received on this connection.} -\item{\code{closeCallbacks}}{A list of callback functions that will be invoked + \item{\code{closeCallbacks}}{A list of callback functions that will be invoked when the connection is closed.} -\item{\code{request}}{The Rook request environment that opened the connection. + \item{\code{request}}{The Rook request environment that opened the connection. This can be used to inspect HTTP headers, for example.} -} -\if{html}{\out{
}} + } + \if{html}{\out{
}} } \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-WebSocket-new}{\code{WebSocket$new()}} -\item \href{#method-WebSocket-onMessage}{\code{WebSocket$onMessage()}} -\item \href{#method-WebSocket-onClose}{\code{WebSocket$onClose()}} -\item \href{#method-WebSocket-send}{\code{WebSocket$send()}} -\item \href{#method-WebSocket-close}{\code{WebSocket$close()}} -\item \href{#method-WebSocket-clone}{\code{WebSocket$clone()}} -} + \itemize{ + \item \href{#method-WebSocket-initialize}{\code{WebSocket$new()}} + \item \href{#method-WebSocket-onMessage}{\code{WebSocket$onMessage()}} + \item \href{#method-WebSocket-onClose}{\code{WebSocket$onClose()}} + \item \href{#method-WebSocket-send}{\code{WebSocket$send()}} + \item \href{#method-WebSocket-close}{\code{WebSocket$close()}} + \item \href{#method-WebSocket-clone}{\code{WebSocket$clone()}} + } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-WebSocket-new}{}}} -\subsection{Method \code{new()}}{ -Initializes a new WebSocket object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{WebSocket$new(handle, req)}\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-WebSocket-initialize}{}}} +\subsection{\code{WebSocket$new()}}{ + Initializes a new WebSocket object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{WebSocket$new(handle, req)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{handle}}{An C++ WebSocket handle.} + \item{\code{req}}{The Rook request environment that opened the connection.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{handle}}{An C++ WebSocket handle.} - -\item{\code{req}}{The Rook request environment that opened the connection.} -} -\if{html}{\out{
}} -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-WebSocket-onMessage}{}}} -\subsection{Method \code{onMessage()}}{ -Registers a callback function that will be invoked whenever a message is +\subsection{\code{WebSocket$onMessage()}}{ + Registers a callback function that will be invoked whenever a message is received on this connection. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{WebSocket$onMessage(func)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{func}}{The callback function to be registered. The callback function will be invoked with + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{WebSocket$onMessage(func)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{func}}{The callback function to be registered. The callback function will be invoked with two arguments. The first argument is \code{TRUE} if the message is binary and \code{FALSE} if it is text. The second argument is either a raw vector (if the message is binary) or a character vector.} + } + \if{html}{\out{
}} + } } -\if{html}{\out{
}} -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-WebSocket-onClose}{}}} -\subsection{Method \code{onClose()}}{ -Registers a callback function that will be invoked when the connection is +\subsection{\code{WebSocket$onClose()}}{ + Registers a callback function that will be invoked when the connection is closed. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{WebSocket$onClose(func)}\if{html}{\out{
}} + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{WebSocket$onClose(func)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{func}}{The callback function to be registered.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{func}}{The callback function to be registered.} -} -\if{html}{\out{
}} -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-WebSocket-send}{}}} -\subsection{Method \code{send()}}{ -Begins sending the given message over the websocket. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{WebSocket$send(message)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{message}}{Either a raw vector, or a single-element character +\subsection{\code{WebSocket$send()}}{ + Begins sending the given message over the websocket. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{WebSocket$send(message)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{message}}{Either a raw vector, or a single-element character vector that is encoded in UTF-8.} + } + \if{html}{\out{
}} + } } -\if{html}{\out{
}} -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-WebSocket-close}{}}} -\subsection{Method \code{close()}}{ -Closes the websocket connection -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{WebSocket$close(code = 1000L, reason = "")}\if{html}{\out{
}} +\subsection{\code{WebSocket$close()}}{ + Closes the websocket connection + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{WebSocket$close(code = 1000L, reason = "")} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{code}}{An integer that indicates the \href{https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#code}{WebSocket close code}.} + \item{\code{reason}}{A concise human-readable prose \href{https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#reason}{explanation for the closure}.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{code}}{An integer that indicates the \href{https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#code}{WebSocket close code}.} - -\item{\code{reason}}{A concise human-readable prose \href{https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#reason}{explanation for the closure}.} -} -\if{html}{\out{
}} -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-WebSocket-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{WebSocket$clone(deep = FALSE)}\if{html}{\out{
}} +\subsection{\code{WebSocket$clone()}}{ + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{WebSocket$clone(deep = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
}} -} -} } diff --git a/man/encodeURI.Rd b/man/encodeURI.Rd index 6671c0e9f..a71c6e7c6 100644 --- a/man/encodeURI.Rd +++ b/man/encodeURI.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/RcppExports.R +% Please edit documentation in R/httpuv-package.R \name{encodeURI} \alias{encodeURI} \alias{encodeURIComponent} @@ -25,17 +25,13 @@ strings that are UTF-8 encoded. } \description{ Encodes/decodes strings using URI encoding/decoding in the same way that web -browsers do. The precise behaviors of these functions can be found at -developer.mozilla.org: +browsers do. The precise behaviors of these functions can be found at developer.mozilla.org: \href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI}{encodeURI}, \href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent}{encodeURIComponent}, \href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI}{decodeURI}, \href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent}{decodeURIComponent} -} -\details{ -Intended as a faster replacement for \code{\link[utils:URLencode]{utils::URLencode()}} and -\code{\link[utils:URLencode]{utils::URLdecode()}}. +Intended as a faster replacement for \code{\link[utils:URLencode]{utils::URLencode()}} and \code{\link[utils:URLdecode]{utils::URLdecode()}}. encodeURI differs from encodeURIComponent in that the former will not encode reserved characters: \code{;,/?:@&=+$} diff --git a/man/getRNGState.Rd b/man/getRNGState.Rd index 5c0ac4d54..cdacef290 100644 --- a/man/getRNGState.Rd +++ b/man/getRNGState.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/RcppExports.R +% Please edit documentation in R/httpuv-package.R \name{getRNGState} \alias{getRNGState} \title{Apply the value of .Random.seed to R's internal RNG state} @@ -10,7 +10,6 @@ getRNGState() This function is needed in unusual cases where a C++ function calls an R function which sets the value of \code{.Random.seed}. This function should be called at the end of the R function to ensure that the new value -\code{.Random.seed} is preserved. Otherwise, Rcpp may overwrite it with a -previous value. +\code{.Random.seed} is preserved. } \keyword{internal} diff --git a/man/ipFamily.Rd b/man/ipFamily.Rd index 29b26ddf8..2d150f349 100644 --- a/man/ipFamily.Rd +++ b/man/ipFamily.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/RcppExports.R +% Please edit documentation in R/httpuv-package.R \name{ipFamily} \alias{ipFamily} \title{Check whether an address is IPv4 or IPv6} diff --git a/man/runStaticServer.Rd b/man/runStaticServer.Rd index 3da02c595..31e4ec674 100644 --- a/man/runStaticServer.Rd +++ b/man/runStaticServer.Rd @@ -24,7 +24,7 @@ listened on. Note that on most Unix-like systems including Linux and macOS, port numbers smaller than 1024 require root privileges.} \item{...}{ - Arguments passed on to \code{\link[=staticPath]{staticPath}} + Arguments passed on to \code{\link{staticPath}} \describe{ \item{\code{path}}{The local path.} \item{\code{indexhtml}}{If an index.html file is present, should it be served up diff --git a/scripts/build_r_devel.sh b/scripts/build_r_devel.sh new file mode 100755 index 000000000..171e7d4ad --- /dev/null +++ b/scripts/build_r_devel.sh @@ -0,0 +1,59 @@ +#!/bin/bash +set -euo pipefail + +# Configuration +R_DEVEL_PREFIX="/opt/R-devel" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +R_SOURCE_DIR="${SCRIPT_DIR}/R-devel" +R_TARBALL_URL="https://cran.r-project.org/src/base-prerelease/R-devel.tar.gz" +R_TARBALL="${SCRIPT_DIR}/R-devel.tar.gz" + +echo "===============================" +echo "Building R-devel from source" +echo "Installation prefix: ${R_DEVEL_PREFIX}" +echo "===============================" + +# Download R-devel tarball (includes recommended packages) +echo "Downloading R-devel tarball..." +curl -L -o "${R_TARBALL}" "${R_TARBALL_URL}" + +# Extract tarball +echo "Extracting R-devel..." +rm -rf "${R_SOURCE_DIR}" +tar -xzf "${R_TARBALL}" -C "${SCRIPT_DIR}" + +cd "${R_SOURCE_DIR}" + +# Configure R +echo "Configuring R..." +./configure \ + --prefix="${R_DEVEL_PREFIX}" \ + --enable-R-shlib \ + --with-blas \ + --with-lapack \ + --with-readline \ + --with-x=no + +# Build R +echo "Building R (this may take a while)..." +make -j$(nproc) + +# Install R (requires sudo for /opt) +echo "Installing R to ${R_DEVEL_PREFIX}..." +echo "Note: This requires sudo permissions" +sudo make install + +# Cleanup tarball +rm -f "${R_TARBALL}" + +# Verify installation +if [ -x "${R_DEVEL_PREFIX}/bin/R" ]; then + echo "===============================" + echo "R-devel installed successfully!" + echo "R version:" + "${R_DEVEL_PREFIX}/bin/R" --version | head -n 1 + echo "===============================" +else + echo "ERROR: R-devel installation failed" + exit 1 +fi diff --git a/scripts/check_loop.sh b/scripts/check_loop.sh new file mode 100755 index 000000000..d2a2d9ee9 --- /dev/null +++ b/scripts/check_loop.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -euo pipefail + +rm -f check-results.md + +for std in CXX23 CXX20 CXX17; do + for compiler in clang gcc; do + echo "===============================" + echo "Checking C++ code with $std standard and $compiler compiler" + + mkdir -p ./check-gcc-clang + + ./scripts/check_prepare.sh "$std" "$compiler" + + touch ./check-gcc-clang/check-results.md + + # Run check, but don't exit on failure + if ! ./scripts/check_run.sh "$std" "$compiler"; then + echo "WARNING: check_run.sh failed for $std standard with $compiler, continuing..." + echo "$std + $compiler = fail" >> ./check-gcc-clang/check-results.md || true + else + echo "$std + $compiler = ok" >> ./check-gcc-clang/check-results.md || true + fi + + ./scripts/check_restore.sh "$std" "$compiler" + + echo "===============================" + echo "" + done +done diff --git a/scripts/check_prepare.sh b/scripts/check_prepare.sh new file mode 100755 index 000000000..692c91692 --- /dev/null +++ b/scripts/check_prepare.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -euo pipefail + +std=${1:-CXX17} +std=$(echo "$std" | tr '[:lower:]' '[:upper:]') +compiler=${2:-gcc} + +echo "===============================" +echo "Preparing C++ code with $std standard and $compiler compiler" +echo "" + +# Add or replace CXX_STD in src/Makevars.in +# configure regenerates src/Makevars from src/Makevars.in during R CMD check, +# so we must patch Makevars.in (not Makevars directly). +if grep -q "^CXX_STD" ./src/Makevars.in; then + sed -i "s/^CXX_STD = .*/CXX_STD = ${std}/" ./src/Makevars.in +else + sed -i "1s/^/CXX_STD = ${std}\n/" ./src/Makevars.in +fi diff --git a/scripts/check_r_devel.sh b/scripts/check_r_devel.sh new file mode 100755 index 000000000..00bff6619 --- /dev/null +++ b/scripts/check_r_devel.sh @@ -0,0 +1,122 @@ +#!/bin/bash +set -euo pipefail + +# Configuration +R_DEVEL_PREFIX="/opt/R-devel" +R_DEVEL="${R_DEVEL_PREFIX}/bin/R" +RSCRIPT_DEVEL="${R_DEVEL_PREFIX}/bin/Rscript" + +# Default values matching check-cxx23-gcc +std="${1:-CXX23}" +std=$(echo "$std" | tr '[:lower:]' '[:upper:]') +compiler="${2:-gcc}" + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PROJECT_DIR="$(dirname "${SCRIPT_DIR}")" + +echo "===============================" +echo "Checking C++ code with R-devel" +echo "Standard: $std" +echo "Compiler: $compiler" +echo "===============================" + +# Check if R-devel is installed +if [ ! -x "${R_DEVEL}" ]; then + echo "ERROR: R-devel not found at ${R_DEVEL}" + echo "Run ./scripts/build_r_devel.sh first to build R-devel" + exit 1 +fi + +echo "Using R-devel:" +"${R_DEVEL}" --version | head -n 1 + +cd "${PROJECT_DIR}" + +# Prevent R from loading any startup files +export R_PROFILE="" +export R_PROFILE_USER="" +export R_ENVIRON="" +export R_ENVIRON_USER="" + +# Install required packages in R-devel if not present +echo "Checking/installing required packages in R-devel..." +"${RSCRIPT_DEVEL}" --vanilla -e ' + pkgs <- c("devtools", "roxygen2", "testthat", "usethis", "later", "promises", + "R6", "withr", "pkgbuild", "curl") + missing <- pkgs[!sapply(pkgs, requireNamespace, quietly = TRUE)] + if (length(missing) > 0) { + install.packages(missing, repos = "https://cloud.r-project.org") + } +' + +# Patch src/Makevars with the requested C++ standard +"${SCRIPT_DIR}/check_prepare.sh" "${std}" "${compiler}" + +# Set up compiler override via R_MAKEVARS_USER +TMPDIR_MAKE=$(mktemp -d) +MAKEVARS_FILE="${TMPDIR_MAKE}/Makevars" +trap '"${SCRIPT_DIR}/check_restore.sh" "${std}" "${compiler}"; rm -rf "${TMPDIR_MAKE}"' EXIT + +if [ "$compiler" = "clang" ]; then + cat > "${MAKEVARS_FILE}" << 'EOF' +CC = clang +CXX = clang++ +CXX17 = clang++ +CXX17STD = -std=gnu++17 +CXX20 = clang++ +CXX20STD = -std=gnu++20 +CXX23 = clang++ +CXX23STD = -std=gnu++23 +SHLIB_OPENMP_CXXFLAGS = -fopenmp=libgomp +EOF +else + touch "${MAKEVARS_FILE}" +fi +export R_MAKEVARS_USER="${MAKEVARS_FILE}" + +# Ensure results directory exists +mkdir -p "./check-r-devel" +LOG="./check-r-devel/check-${std}-${compiler}-devel.log" + +# Clear previous log if it exists +rm -f "${LOG}" + +# Capture everything (stdout+stderr) into the log while printing to console +exec > >(tee -a "${LOG}") 2>&1 + +# Build httpuv tarball using R-devel +echo "Building tarball with R-devel..." +TARBALL=$("${RSCRIPT_DEVEL}" --vanilla -e 'cat(devtools::build(".", quiet = TRUE))') +if [ -z "${TARBALL}" ]; then + echo "Failed to build httpuv tarball." + exit 1 +fi + +echo "Tarball created: ${TARBALL}" + +# Run R CMD check on the tarball using R-devel +echo "Running R CMD check with R-devel..." +"${R_DEVEL}" CMD check --as-cran --no-manual "${TARBALL}" || true + +# If there was an error, copy the install log for inspection +if [ -f "./httpuv.Rcheck/00install.out" ]; then + cp "./httpuv.Rcheck/00install.out" "./check-r-devel/install-${std}-${compiler}-devel.log" + echo "=== BEGIN 00install.out ===" + cat "./httpuv.Rcheck/00install.out" + echo "=== END 00install.out ===" +fi + +# Inspect log for ERRORs only. Allow WARNINGs and NOTEs. +if grep -q "\bERROR\b" "${LOG}"; then + echo "R CMD check found ERRORs. See ${LOG} for details." + grep -n "\bERROR\b" "${LOG}" || true + exit 1 +else + echo "R CMD check completed with no ERRORs. Warnings/Notes (if any) are allowed. See ${LOG} for full output." +fi + +rm -f "${TARBALL}" + +echo "===============================" +echo "R-devel check complete." +echo "===============================" diff --git a/scripts/check_restore.sh b/scripts/check_restore.sh new file mode 100755 index 000000000..535e9b53c --- /dev/null +++ b/scripts/check_restore.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -euo pipefail + +std=${1:-CXX17} +std=$(echo "$std" | tr '[:lower:]' '[:upper:]') +compiler=${2:-gcc} + +echo "Restoring files for $std and $compiler" + +# Remove the CXX_STD line added by check_prepare.sh +sed -i '/^CXX_STD = /d' ./src/Makevars.in + +# Clear check files +rm -rf ./httpuv.Rcheck || true diff --git a/scripts/check_run.sh b/scripts/check_run.sh new file mode 100755 index 000000000..925dda02a --- /dev/null +++ b/scripts/check_run.sh @@ -0,0 +1,73 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Accept std and compiler as positional parameters +std="$1" +std=$(echo "$std" | tr '[:lower:]' '[:upper:]') +compiler="$2" + +# R_MAKEVARS_USER is included AFTER Makeconf, so it can override the compiler. +# Package src/Makevars is included BEFORE Makeconf and cannot override CXX17 etc. +TMPDIR_MAKE=$(mktemp -d) +MAKEVARS_FILE="${TMPDIR_MAKE}/Makevars" +trap 'rm -rf "${TMPDIR_MAKE}"' EXIT + +if [ "$compiler" = "clang" ]; then + cat > "${MAKEVARS_FILE}" << 'EOF' +CC = clang +CXX = clang++ +CXX17 = clang++ +CXX17STD = -std=gnu++17 +CXX20 = clang++ +CXX20STD = -std=gnu++20 +CXX23 = clang++ +CXX23STD = -std=gnu++23 +SHLIB_OPENMP_CXXFLAGS = -fopenmp=libgomp +EOF +else + touch "${MAKEVARS_FILE}" +fi +export R_MAKEVARS_USER="${MAKEVARS_FILE}" + +# Ensure results directory and set per-iteration log +mkdir -p "./check-gcc-clang" +LOG="./check-gcc-clang/check-${std}-${compiler}.log" + +# clear previous log if it exists +rm -f "${LOG}" + +# Capture everything (stdout+stderr) from this point into the per-iteration log +# while still printing to the console via tee. This ensures all printed lines +# (from Rscript, R CMD check and this script) are saved. +exec > >(tee -a "${LOG}") 2>&1 + +# Build httpuv tarball +TARBALL=$(Rscript -e 'cat(devtools::build(".", quiet = TRUE))') +if [ -z "${TARBALL}" ]; then + echo "Failed to build tarball for httpuv." + exit 1 +fi + +# Run R CMD check on the tarball and capture output. Skip PDF/manual to avoid TeX font issues. +R CMD check --as-cran --no-manual "${TARBALL}" || true + +# If there was an error, copy the install log to the results directory for inspection +if [ -f "./httpuv.Rcheck/00install.out" ]; then + cp "./httpuv.Rcheck/00install.out" "./check-gcc-clang/install-${std}-${compiler}.log" + echo "=== BEGIN 00install.out ===" + cat "./httpuv.Rcheck/00install.out" + echo "=== END 00install.out ===" +fi + +# Inspect log for ERRORs only. Allow WARNINGs and NOTEs. +if grep -q "\bERROR\b" "${LOG}"; then + echo "R CMD check found ERRORs. See ${LOG} for details." + grep -n "\bERROR\b" "${LOG}" || true + exit 1 +else + echo "R CMD check completed with no ERRORs. Warnings/Notes (if any) are allowed. See ${LOG} for full output." +fi + +rm -f "${TARBALL}" + +echo "Run complete." diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp deleted file mode 100644 index 3e522207e..000000000 --- a/src/RcppExports.cpp +++ /dev/null @@ -1,283 +0,0 @@ -// Generated by using Rcpp::compileAttributes() -> do not edit by hand -// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 - -#include - -using namespace Rcpp; - -#ifdef RCPP_USE_GLOBAL_ROSTREAM -Rcpp::Rostream& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); -Rcpp::Rostream& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get(); -#endif - -// sendWSMessage -void sendWSMessage(SEXP conn, bool binary, Rcpp::RObject message); -RcppExport SEXP _httpuv_sendWSMessage(SEXP connSEXP, SEXP binarySEXP, SEXP messageSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< SEXP >::type conn(connSEXP); - Rcpp::traits::input_parameter< bool >::type binary(binarySEXP); - Rcpp::traits::input_parameter< Rcpp::RObject >::type message(messageSEXP); - sendWSMessage(conn, binary, message); - return R_NilValue; -END_RCPP -} -// closeWS -void closeWS(SEXP conn, uint16_t code, std::string reason); -RcppExport SEXP _httpuv_closeWS(SEXP connSEXP, SEXP codeSEXP, SEXP reasonSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< SEXP >::type conn(connSEXP); - Rcpp::traits::input_parameter< uint16_t >::type code(codeSEXP); - Rcpp::traits::input_parameter< std::string >::type reason(reasonSEXP); - closeWS(conn, code, reason); - return R_NilValue; -END_RCPP -} -// makeTcpServer -Rcpp::RObject makeTcpServer(const std::string& host, int port, Rcpp::Function onHeaders, Rcpp::Function onBodyData, Rcpp::Function onRequest, Rcpp::Function onWSOpen, Rcpp::Function onWSMessage, Rcpp::Function onWSClose, Rcpp::List staticPaths, Rcpp::List staticPathOptions, bool quiet); -RcppExport SEXP _httpuv_makeTcpServer(SEXP hostSEXP, SEXP portSEXP, SEXP onHeadersSEXP, SEXP onBodyDataSEXP, SEXP onRequestSEXP, SEXP onWSOpenSEXP, SEXP onWSMessageSEXP, SEXP onWSCloseSEXP, SEXP staticPathsSEXP, SEXP staticPathOptionsSEXP, SEXP quietSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const std::string& >::type host(hostSEXP); - Rcpp::traits::input_parameter< int >::type port(portSEXP); - Rcpp::traits::input_parameter< Rcpp::Function >::type onHeaders(onHeadersSEXP); - Rcpp::traits::input_parameter< Rcpp::Function >::type onBodyData(onBodyDataSEXP); - Rcpp::traits::input_parameter< Rcpp::Function >::type onRequest(onRequestSEXP); - Rcpp::traits::input_parameter< Rcpp::Function >::type onWSOpen(onWSOpenSEXP); - Rcpp::traits::input_parameter< Rcpp::Function >::type onWSMessage(onWSMessageSEXP); - Rcpp::traits::input_parameter< Rcpp::Function >::type onWSClose(onWSCloseSEXP); - Rcpp::traits::input_parameter< Rcpp::List >::type staticPaths(staticPathsSEXP); - Rcpp::traits::input_parameter< Rcpp::List >::type staticPathOptions(staticPathOptionsSEXP); - Rcpp::traits::input_parameter< bool >::type quiet(quietSEXP); - rcpp_result_gen = Rcpp::wrap(makeTcpServer(host, port, onHeaders, onBodyData, onRequest, onWSOpen, onWSMessage, onWSClose, staticPaths, staticPathOptions, quiet)); - return rcpp_result_gen; -END_RCPP -} -// makePipeServer -Rcpp::RObject makePipeServer(const std::string& name, int mask, Rcpp::Function onHeaders, Rcpp::Function onBodyData, Rcpp::Function onRequest, Rcpp::Function onWSOpen, Rcpp::Function onWSMessage, Rcpp::Function onWSClose, Rcpp::List staticPaths, Rcpp::List staticPathOptions, bool quiet); -RcppExport SEXP _httpuv_makePipeServer(SEXP nameSEXP, SEXP maskSEXP, SEXP onHeadersSEXP, SEXP onBodyDataSEXP, SEXP onRequestSEXP, SEXP onWSOpenSEXP, SEXP onWSMessageSEXP, SEXP onWSCloseSEXP, SEXP staticPathsSEXP, SEXP staticPathOptionsSEXP, SEXP quietSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const std::string& >::type name(nameSEXP); - Rcpp::traits::input_parameter< int >::type mask(maskSEXP); - Rcpp::traits::input_parameter< Rcpp::Function >::type onHeaders(onHeadersSEXP); - Rcpp::traits::input_parameter< Rcpp::Function >::type onBodyData(onBodyDataSEXP); - Rcpp::traits::input_parameter< Rcpp::Function >::type onRequest(onRequestSEXP); - Rcpp::traits::input_parameter< Rcpp::Function >::type onWSOpen(onWSOpenSEXP); - Rcpp::traits::input_parameter< Rcpp::Function >::type onWSMessage(onWSMessageSEXP); - Rcpp::traits::input_parameter< Rcpp::Function >::type onWSClose(onWSCloseSEXP); - Rcpp::traits::input_parameter< Rcpp::List >::type staticPaths(staticPathsSEXP); - Rcpp::traits::input_parameter< Rcpp::List >::type staticPathOptions(staticPathOptionsSEXP); - Rcpp::traits::input_parameter< bool >::type quiet(quietSEXP); - rcpp_result_gen = Rcpp::wrap(makePipeServer(name, mask, onHeaders, onBodyData, onRequest, onWSOpen, onWSMessage, onWSClose, staticPaths, staticPathOptions, quiet)); - return rcpp_result_gen; -END_RCPP -} -// stopServer_ -void stopServer_(std::string handle); -RcppExport SEXP _httpuv_stopServer_(SEXP handleSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< std::string >::type handle(handleSEXP); - stopServer_(handle); - return R_NilValue; -END_RCPP -} -// getStaticPaths_ -Rcpp::List getStaticPaths_(std::string handle); -RcppExport SEXP _httpuv_getStaticPaths_(SEXP handleSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< std::string >::type handle(handleSEXP); - rcpp_result_gen = Rcpp::wrap(getStaticPaths_(handle)); - return rcpp_result_gen; -END_RCPP -} -// setStaticPaths_ -Rcpp::List setStaticPaths_(std::string handle, Rcpp::List sp); -RcppExport SEXP _httpuv_setStaticPaths_(SEXP handleSEXP, SEXP spSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< std::string >::type handle(handleSEXP); - Rcpp::traits::input_parameter< Rcpp::List >::type sp(spSEXP); - rcpp_result_gen = Rcpp::wrap(setStaticPaths_(handle, sp)); - return rcpp_result_gen; -END_RCPP -} -// removeStaticPaths_ -Rcpp::List removeStaticPaths_(std::string handle, Rcpp::CharacterVector paths); -RcppExport SEXP _httpuv_removeStaticPaths_(SEXP handleSEXP, SEXP pathsSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< std::string >::type handle(handleSEXP); - Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type paths(pathsSEXP); - rcpp_result_gen = Rcpp::wrap(removeStaticPaths_(handle, paths)); - return rcpp_result_gen; -END_RCPP -} -// getStaticPathOptions_ -Rcpp::List getStaticPathOptions_(std::string handle); -RcppExport SEXP _httpuv_getStaticPathOptions_(SEXP handleSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< std::string >::type handle(handleSEXP); - rcpp_result_gen = Rcpp::wrap(getStaticPathOptions_(handle)); - return rcpp_result_gen; -END_RCPP -} -// setStaticPathOptions_ -Rcpp::List setStaticPathOptions_(std::string handle, Rcpp::List opts); -RcppExport SEXP _httpuv_setStaticPathOptions_(SEXP handleSEXP, SEXP optsSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< std::string >::type handle(handleSEXP); - Rcpp::traits::input_parameter< Rcpp::List >::type opts(optsSEXP); - rcpp_result_gen = Rcpp::wrap(setStaticPathOptions_(handle, opts)); - return rcpp_result_gen; -END_RCPP -} -// base64encode -std::string base64encode(const Rcpp::RawVector& x); -RcppExport SEXP _httpuv_base64encode(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const Rcpp::RawVector& >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(base64encode(x)); - return rcpp_result_gen; -END_RCPP -} -// encodeURI -Rcpp::CharacterVector encodeURI(Rcpp::CharacterVector value); -RcppExport SEXP _httpuv_encodeURI(SEXP valueSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type value(valueSEXP); - rcpp_result_gen = Rcpp::wrap(encodeURI(value)); - return rcpp_result_gen; -END_RCPP -} -// encodeURIComponent -Rcpp::CharacterVector encodeURIComponent(Rcpp::CharacterVector value); -RcppExport SEXP _httpuv_encodeURIComponent(SEXP valueSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type value(valueSEXP); - rcpp_result_gen = Rcpp::wrap(encodeURIComponent(value)); - return rcpp_result_gen; -END_RCPP -} -// decodeURI -Rcpp::CharacterVector decodeURI(Rcpp::CharacterVector value); -RcppExport SEXP _httpuv_decodeURI(SEXP valueSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type value(valueSEXP); - rcpp_result_gen = Rcpp::wrap(decodeURI(value)); - return rcpp_result_gen; -END_RCPP -} -// decodeURIComponent -Rcpp::CharacterVector decodeURIComponent(Rcpp::CharacterVector value); -RcppExport SEXP _httpuv_decodeURIComponent(SEXP valueSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type value(valueSEXP); - rcpp_result_gen = Rcpp::wrap(decodeURIComponent(value)); - return rcpp_result_gen; -END_RCPP -} -// ipFamily -int ipFamily(const std::string& ip); -RcppExport SEXP _httpuv_ipFamily(SEXP ipSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const std::string& >::type ip(ipSEXP); - rcpp_result_gen = Rcpp::wrap(ipFamily(ip)); - return rcpp_result_gen; -END_RCPP -} -// invokeCppCallback -void invokeCppCallback(Rcpp::List data, SEXP callback_xptr); -RcppExport SEXP _httpuv_invokeCppCallback(SEXP dataSEXP, SEXP callback_xptrSEXP) { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::List >::type data(dataSEXP); - Rcpp::traits::input_parameter< SEXP >::type callback_xptr(callback_xptrSEXP); - invokeCppCallback(data, callback_xptr); - return R_NilValue; -END_RCPP -} -// getRNGState -void getRNGState(); -RcppExport SEXP _httpuv_getRNGState() { -BEGIN_RCPP - Rcpp::RNGScope rcpp_rngScope_gen; - getRNGState(); - return R_NilValue; -END_RCPP -} -// wsconn_address -std::string wsconn_address(SEXP external_ptr); -RcppExport SEXP _httpuv_wsconn_address(SEXP external_ptrSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< SEXP >::type external_ptr(external_ptrSEXP); - rcpp_result_gen = Rcpp::wrap(wsconn_address(external_ptr)); - return rcpp_result_gen; -END_RCPP -} -// log_level -std::string log_level(const std::string& level); -RcppExport SEXP _httpuv_log_level(SEXP levelSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const std::string& >::type level(levelSEXP); - rcpp_result_gen = Rcpp::wrap(log_level(level)); - return rcpp_result_gen; -END_RCPP -} - -static const R_CallMethodDef CallEntries[] = { - {"_httpuv_sendWSMessage", (DL_FUNC) &_httpuv_sendWSMessage, 3}, - {"_httpuv_closeWS", (DL_FUNC) &_httpuv_closeWS, 3}, - {"_httpuv_makeTcpServer", (DL_FUNC) &_httpuv_makeTcpServer, 11}, - {"_httpuv_makePipeServer", (DL_FUNC) &_httpuv_makePipeServer, 11}, - {"_httpuv_stopServer_", (DL_FUNC) &_httpuv_stopServer_, 1}, - {"_httpuv_getStaticPaths_", (DL_FUNC) &_httpuv_getStaticPaths_, 1}, - {"_httpuv_setStaticPaths_", (DL_FUNC) &_httpuv_setStaticPaths_, 2}, - {"_httpuv_removeStaticPaths_", (DL_FUNC) &_httpuv_removeStaticPaths_, 2}, - {"_httpuv_getStaticPathOptions_", (DL_FUNC) &_httpuv_getStaticPathOptions_, 1}, - {"_httpuv_setStaticPathOptions_", (DL_FUNC) &_httpuv_setStaticPathOptions_, 2}, - {"_httpuv_base64encode", (DL_FUNC) &_httpuv_base64encode, 1}, - {"_httpuv_encodeURI", (DL_FUNC) &_httpuv_encodeURI, 1}, - {"_httpuv_encodeURIComponent", (DL_FUNC) &_httpuv_encodeURIComponent, 1}, - {"_httpuv_decodeURI", (DL_FUNC) &_httpuv_decodeURI, 1}, - {"_httpuv_decodeURIComponent", (DL_FUNC) &_httpuv_decodeURIComponent, 1}, - {"_httpuv_ipFamily", (DL_FUNC) &_httpuv_ipFamily, 1}, - {"_httpuv_invokeCppCallback", (DL_FUNC) &_httpuv_invokeCppCallback, 2}, - {"_httpuv_getRNGState", (DL_FUNC) &_httpuv_getRNGState, 0}, - {"_httpuv_wsconn_address", (DL_FUNC) &_httpuv_wsconn_address, 1}, - {"_httpuv_log_level", (DL_FUNC) &_httpuv_log_level, 1}, - {NULL, NULL, 0} -}; - -RcppExport void R_init_httpuv(DllInfo *dll) { - R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); - R_useDynamicSymbols(dll, FALSE); -} diff --git a/src/auto_deleter.h b/src/auto_deleter.h index 9a618c35e..1e04084f9 100644 --- a/src/auto_deleter.h +++ b/src/auto_deleter.h @@ -1,27 +1,26 @@ #ifndef AUTO_DELETER_HPP #define AUTO_DELETER_HPP -#include #include "callbackqueue.h" #include "thread.h" +#include "utils.h" +#include #include - -extern CallbackQueue* background_queue; - +extern CallbackQueue *background_queue; // A deleter function, which, if called on the main thread, will delete the // object immediately. If called on the background thread, it will schedule // deletion to happen on the main thread. This is useful in cases where we // don't know ahead of time which thread will be triggering the deletion. -template -void auto_deleter_main(void* obj) { +template void auto_deleter_main(void *obj) { // Unlike auto_deleter_background, this function takes a void* argument. // This is because later() can only pass a void* to the callback. if (is_main_thread()) { try { - delete reinterpret_cast(obj); - } catch (...) {} + delete reinterpret_cast(obj); + } catch (...) { + } } else if (is_background_thread()) { later::later(auto_deleter_main, obj, 0); @@ -35,20 +34,20 @@ void auto_deleter_main(void* obj) { // the object immediately. If called on the main thread, it will schedule // deletion to happen on the background thread. This is useful in cases where // we don't know ahead of time which thread will be triggering the deletion. -template -void auto_deleter_background(T* obj) { +template void auto_deleter_background(T *obj) { if (is_main_thread()) { background_queue->push(std::bind(auto_deleter_background, obj)); } else if (is_background_thread()) { try { delete obj; - } catch (...) {} + } catch (...) { + } } else { - debug_log("Can't detect correct thread for auto_deleter_background.", LOG_ERROR); + debug_log("Can't detect correct thread for auto_deleter_background.", + LOG_ERROR); } } - #endif diff --git a/src/base64/base64.cpp b/src/base64/base64.cpp index 63a999a97..4770ec2f8 100644 --- a/src/base64/base64.cpp +++ b/src/base64/base64.cpp @@ -5,17 +5,20 @@ /* * Translation Table as described in RFC1113 */ -static const char cb64[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +static const char cb64[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /* * encodeblock * * encode 3 8-bit binary bytes as 4 '6-bit' characters */ -void encodeblock( unsigned char in[3], unsigned char out[4], int len ) -{ - out[0] = cb64[ in[0] >> 2 ]; - out[1] = cb64[ ((in[0] & 0x03) << 4) | ((in[1] & 0xf0) >> 4) ]; - out[2] = (unsigned char) (len > 1 ? cb64[ ((in[1] & 0x0f) << 2) | ((in[2] & 0xc0) >> 6) ] : '='); - out[3] = (unsigned char) (len > 2 ? cb64[ in[2] & 0x3f ] : '='); +void encodeblock(unsigned char in[3], unsigned char out[4], int len) { + out[0] = cb64[in[0] >> 2]; + out[1] = cb64[((in[0] & 0x03) << 4) | ((in[1] & 0xf0) >> 4)]; + out[2] = + (unsigned char)(len > 1 + ? cb64[((in[1] & 0x0f) << 2) | ((in[2] & 0xc0) >> 6)] + : '='); + out[3] = (unsigned char)(len > 2 ? cb64[in[2] & 0x3f] : '='); } diff --git a/src/base64/base64.hpp b/src/base64/base64.hpp index 852bc1447..6fe05ec84 100644 --- a/src/base64/base64.hpp +++ b/src/base64/base64.hpp @@ -1,35 +1,34 @@ #ifndef BASE64_H #define BASE64_H -void encodeblock( unsigned char in[3], unsigned char out[4], int len ); +void encodeblock(unsigned char in[3], unsigned char out[4], int len); template -std::string b64encode(InputIterator begin, InputIterator end) -{ - unsigned char in[3], out[4]; - int i, len; +std::string b64encode(InputIterator begin, InputIterator end) { + unsigned char in[3], out[4]; + int i, len; - std::string databuf; + std::string databuf; - while( begin != end ) { - len = 0; - for( i = 0; i < 3; i++ ) { - if( begin != end ) { - in[i] = static_cast( *begin++ ); - len++; - } else { - in[i] = 0; - } + while (begin != end) { + len = 0; + for (i = 0; i < 3; i++) { + if (begin != end) { + in[i] = static_cast(*begin++); + len++; + } else { + in[i] = 0; } - if( len ) { - encodeblock( in, out, len ); - for( i = 0; i < 4; i++ ) { - databuf.push_back(out[i]); - } + } + if (len) { + encodeblock(in, out, len); + for (i = 0; i < 4; i++) { + databuf.push_back(out[i]); } - } + } + } - return databuf; + return databuf; } #endif diff --git a/src/callback.cpp b/src/callback.cpp index fe1c2bf55..299a08d68 100644 --- a/src/callback.cpp +++ b/src/callback.cpp @@ -2,14 +2,14 @@ // Invoke a callback and delete the object. The Callback object must have been // heap-allocated. -void invoke_callback(void* data) { - Callback* cb = reinterpret_cast(data); +void invoke_callback(void *data) { + Callback *cb = reinterpret_cast(data); (*cb)(); delete cb; } // Schedule a std::function to be invoked with later(). void invoke_later(std::function f, double secs) { - StdFunctionCallback* b_fun = new StdFunctionCallback(f); - later::later(invoke_callback, (void*)b_fun, secs); + StdFunctionCallback *b_fun = new StdFunctionCallback(f); + later::later(invoke_callback, (void *)b_fun, secs); } diff --git a/src/callback.h b/src/callback.h index b9e47b33b..5a03ee0da 100644 --- a/src/callback.h +++ b/src/callback.h @@ -12,23 +12,17 @@ class Callback { // If the Callback class were integrated into later, this wouldn't be // necessary -- later could accept a void(Callback*) function. -void invoke_callback(void* data); - +void invoke_callback(void *data); // Wrapper class for std functions class StdFunctionCallback : public Callback { private: - std::function fun; + std::function fun; public: - StdFunctionCallback(std::function fun) - : fun(fun) { - } - - void operator()() { - fun(); - } + StdFunctionCallback(std::function fun) : fun(fun) {} + void operator()() { fun(); } }; void invoke_later(std::function f, double secs = 0); diff --git a/src/callbackqueue.cpp b/src/callbackqueue.cpp index fb976c7c9..d3078dce4 100644 --- a/src/callbackqueue.cpp +++ b/src/callbackqueue.cpp @@ -1,33 +1,30 @@ -#include #include "callbackqueue.h" -#include "tqueue.h" #include "thread.h" +#include "tqueue.h" +#include #include - // This non-class function is a plain C wrapper for CallbackQueue::flush(), and // is needed as a callback to pass to uv_async_send. void flush_callback_queue(uv_async_t *handle) { - CallbackQueue* wq = reinterpret_cast(handle->data); + CallbackQueue *wq = reinterpret_cast(handle->data); wq->flush(); } - -CallbackQueue::CallbackQueue(uv_loop_t* loop) { +CallbackQueue::CallbackQueue(uv_loop_t *loop) { ASSERT_BACKGROUND_THREAD() uv_async_init(loop, &flush_handle, flush_callback_queue); - flush_handle.data = reinterpret_cast(this); + flush_handle.data = reinterpret_cast(this); } - -void CallbackQueue::push(std::function cb) { +void CallbackQueue::push(std::function cb) { q.push(cb); uv_async_send(&flush_handle); } void CallbackQueue::flush() { ASSERT_BACKGROUND_THREAD() - std::function cb; + std::function cb; while (1) { // Do queue operations inside this guarded scope, but we'll execute the diff --git a/src/callbackqueue.h b/src/callbackqueue.h index 9596d9217..b5d770adb 100644 --- a/src/callbackqueue.h +++ b/src/callbackqueue.h @@ -7,16 +7,15 @@ class CallbackQueue { public: - CallbackQueue(uv_loop_t* loop); - void push(std::function cb); + CallbackQueue(uv_loop_t *loop); + void push(std::function cb); // Needs to be a friend to call .flush() friend void flush_callback_queue(uv_async_t *handle); private: void flush(); uv_async_t flush_handle; - tqueue< std::function > q; + tqueue> q; }; - #endif diff --git a/src/constants.h b/src/constants.h index a7bc98bb4..5e9fed776 100644 --- a/src/constants.h +++ b/src/constants.h @@ -3,8 +3,8 @@ #include -#include #include +#include #include enum Opcode { @@ -21,28 +21,26 @@ enum Opcode { const size_t MAX_HEADER_BYTES = 14; const size_t MAX_FOOTER_BYTES = 1; -enum WSParseState { - InHeader, - InPayload -}; +enum WSParseState { InHeader, InPayload }; struct compare_ci { - bool operator()(const std::string& a, const std::string& b) const { + bool operator()(const std::string &a, const std::string &b) const { return strcasecmp(a.c_str(), b.c_str()) < 0; } }; typedef std::map RequestHeaders; -typedef std::vector > ResponseHeaders; +typedef std::vector> ResponseHeaders; class NoCopy { protected: NoCopy() {} ~NoCopy() {} + private: - NoCopy(const NoCopy&) {} - const NoCopy& operator=(const NoCopy& a) { return a; } + NoCopy(const NoCopy &) {} + const NoCopy &operator=(const NoCopy &a) { return a; } }; // trim from both ends @@ -51,7 +49,7 @@ static inline std::string trim(const std::string &s) { if (start == std::string::npos) return std::string(); size_t end = s.find_last_not_of("\t ") + 1; - return s.substr(start, end-start); + return s.substr(start, end - start); } #endif // CONSTANTS_H diff --git a/src/cpp11.cpp b/src/cpp11.cpp new file mode 100644 index 000000000..b2851c01c --- /dev/null +++ b/src/cpp11.cpp @@ -0,0 +1,184 @@ +// Generated by cpp11: do not edit by hand +// clang-format off + + +#include "cpp11/declarations.hpp" +#include + +// httpuv.cpp +void sendWSMessage(SEXP conn, bool binary, SEXP message); +extern "C" SEXP _httpuv_sendWSMessage(SEXP conn, SEXP binary, SEXP message) { + BEGIN_CPP11 + sendWSMessage(cpp11::as_cpp>(conn), cpp11::as_cpp>(binary), cpp11::as_cpp>(message)); + return R_NilValue; + END_CPP11 +} +// httpuv.cpp +void closeWS(SEXP conn, uint16_t code, std::string reason); +extern "C" SEXP _httpuv_closeWS(SEXP conn, SEXP code, SEXP reason) { + BEGIN_CPP11 + closeWS(cpp11::as_cpp>(conn), cpp11::as_cpp>(code), cpp11::as_cpp>(reason)); + return R_NilValue; + END_CPP11 +} +// httpuv.cpp +SEXP makeTcpServer(const std::string & host, int port, sexp onHeaders, function onBodyData, function onRequest, function onWSOpen, function onWSMessage, function onWSClose, list staticPaths, list staticPathOptions, bool quiet); +extern "C" SEXP _httpuv_makeTcpServer(SEXP host, SEXP port, SEXP onHeaders, SEXP onBodyData, SEXP onRequest, SEXP onWSOpen, SEXP onWSMessage, SEXP onWSClose, SEXP staticPaths, SEXP staticPathOptions, SEXP quiet) { + BEGIN_CPP11 + return cpp11::as_sexp(makeTcpServer(cpp11::as_cpp>(host), cpp11::as_cpp>(port), cpp11::as_cpp>(onHeaders), cpp11::as_cpp>(onBodyData), cpp11::as_cpp>(onRequest), cpp11::as_cpp>(onWSOpen), cpp11::as_cpp>(onWSMessage), cpp11::as_cpp>(onWSClose), cpp11::as_cpp>(staticPaths), cpp11::as_cpp>(staticPathOptions), cpp11::as_cpp>(quiet))); + END_CPP11 +} +// httpuv.cpp +SEXP makePipeServer(const std::string & name, int mask, sexp onHeaders, function onBodyData, function onRequest, function onWSOpen, function onWSMessage, function onWSClose, list staticPaths, list staticPathOptions, bool quiet); +extern "C" SEXP _httpuv_makePipeServer(SEXP name, SEXP mask, SEXP onHeaders, SEXP onBodyData, SEXP onRequest, SEXP onWSOpen, SEXP onWSMessage, SEXP onWSClose, SEXP staticPaths, SEXP staticPathOptions, SEXP quiet) { + BEGIN_CPP11 + return cpp11::as_sexp(makePipeServer(cpp11::as_cpp>(name), cpp11::as_cpp>(mask), cpp11::as_cpp>(onHeaders), cpp11::as_cpp>(onBodyData), cpp11::as_cpp>(onRequest), cpp11::as_cpp>(onWSOpen), cpp11::as_cpp>(onWSMessage), cpp11::as_cpp>(onWSClose), cpp11::as_cpp>(staticPaths), cpp11::as_cpp>(staticPathOptions), cpp11::as_cpp>(quiet))); + END_CPP11 +} +// httpuv.cpp +void stopServer_(std::string handle); +extern "C" SEXP _httpuv_stopServer_(SEXP handle) { + BEGIN_CPP11 + stopServer_(cpp11::as_cpp>(handle)); + return R_NilValue; + END_CPP11 +} +// httpuv.cpp +list getStaticPaths_(std::string handle); +extern "C" SEXP _httpuv_getStaticPaths_(SEXP handle) { + BEGIN_CPP11 + return cpp11::as_sexp(getStaticPaths_(cpp11::as_cpp>(handle))); + END_CPP11 +} +// httpuv.cpp +list setStaticPaths_(std::string handle, list sp); +extern "C" SEXP _httpuv_setStaticPaths_(SEXP handle, SEXP sp) { + BEGIN_CPP11 + return cpp11::as_sexp(setStaticPaths_(cpp11::as_cpp>(handle), cpp11::as_cpp>(sp))); + END_CPP11 +} +// httpuv.cpp +list removeStaticPaths_(std::string handle, strings paths); +extern "C" SEXP _httpuv_removeStaticPaths_(SEXP handle, SEXP paths) { + BEGIN_CPP11 + return cpp11::as_sexp(removeStaticPaths_(cpp11::as_cpp>(handle), cpp11::as_cpp>(paths))); + END_CPP11 +} +// httpuv.cpp +list getStaticPathOptions_(std::string handle); +extern "C" SEXP _httpuv_getStaticPathOptions_(SEXP handle) { + BEGIN_CPP11 + return cpp11::as_sexp(getStaticPathOptions_(cpp11::as_cpp>(handle))); + END_CPP11 +} +// httpuv.cpp +list setStaticPathOptions_(std::string handle, list opts); +extern "C" SEXP _httpuv_setStaticPathOptions_(SEXP handle, SEXP opts) { + BEGIN_CPP11 + return cpp11::as_sexp(setStaticPathOptions_(cpp11::as_cpp>(handle), cpp11::as_cpp>(opts))); + END_CPP11 +} +// httpuv.cpp +std::string base64encode(const raws & x); +extern "C" SEXP _httpuv_base64encode(SEXP x) { + BEGIN_CPP11 + return cpp11::as_sexp(base64encode(cpp11::as_cpp>(x))); + END_CPP11 +} +// httpuv.cpp +strings encodeURI_(strings value); +extern "C" SEXP _httpuv_encodeURI_(SEXP value) { + BEGIN_CPP11 + return cpp11::as_sexp(encodeURI_(cpp11::as_cpp>(value))); + END_CPP11 +} +// httpuv.cpp +strings encodeURIComponent_(strings value); +extern "C" SEXP _httpuv_encodeURIComponent_(SEXP value) { + BEGIN_CPP11 + return cpp11::as_sexp(encodeURIComponent_(cpp11::as_cpp>(value))); + END_CPP11 +} +// httpuv.cpp +strings decodeURI_(strings value); +extern "C" SEXP _httpuv_decodeURI_(SEXP value) { + BEGIN_CPP11 + return cpp11::as_sexp(decodeURI_(cpp11::as_cpp>(value))); + END_CPP11 +} +// httpuv.cpp +strings decodeURIComponent_(strings value); +extern "C" SEXP _httpuv_decodeURIComponent_(SEXP value) { + BEGIN_CPP11 + return cpp11::as_sexp(decodeURIComponent_(cpp11::as_cpp>(value))); + END_CPP11 +} +// httpuv.cpp +int ipFamily_(const std::string & ip); +extern "C" SEXP _httpuv_ipFamily_(SEXP ip) { + BEGIN_CPP11 + return cpp11::as_sexp(ipFamily_(cpp11::as_cpp>(ip))); + END_CPP11 +} +// httpuv.cpp +void invokeCppCallback(SEXP data, SEXP callback_xptr); +extern "C" SEXP _httpuv_invokeCppCallback(SEXP data, SEXP callback_xptr) { + BEGIN_CPP11 + invokeCppCallback(cpp11::as_cpp>(data), cpp11::as_cpp>(callback_xptr)); + return R_NilValue; + END_CPP11 +} +// httpuv.cpp +void getRNGState_(); +extern "C" SEXP _httpuv_getRNGState_() { + BEGIN_CPP11 + getRNGState_(); + return R_NilValue; + END_CPP11 +} +// httpuv.cpp +std::string wsconn_address(SEXP external_ptr); +extern "C" SEXP _httpuv_wsconn_address(SEXP external_ptr) { + BEGIN_CPP11 + return cpp11::as_sexp(wsconn_address(cpp11::as_cpp>(external_ptr))); + END_CPP11 +} +// utils.cpp +std::string log_level(const std::string & level); +extern "C" SEXP _httpuv_log_level(SEXP level) { + BEGIN_CPP11 + return cpp11::as_sexp(log_level(cpp11::as_cpp>(level))); + END_CPP11 +} + +extern "C" { +static const R_CallMethodDef CallEntries[] = { + {"_httpuv_base64encode", (DL_FUNC) &_httpuv_base64encode, 1}, + {"_httpuv_closeWS", (DL_FUNC) &_httpuv_closeWS, 3}, + {"_httpuv_decodeURIComponent_", (DL_FUNC) &_httpuv_decodeURIComponent_, 1}, + {"_httpuv_decodeURI_", (DL_FUNC) &_httpuv_decodeURI_, 1}, + {"_httpuv_encodeURIComponent_", (DL_FUNC) &_httpuv_encodeURIComponent_, 1}, + {"_httpuv_encodeURI_", (DL_FUNC) &_httpuv_encodeURI_, 1}, + {"_httpuv_getRNGState_", (DL_FUNC) &_httpuv_getRNGState_, 0}, + {"_httpuv_getStaticPathOptions_", (DL_FUNC) &_httpuv_getStaticPathOptions_, 1}, + {"_httpuv_getStaticPaths_", (DL_FUNC) &_httpuv_getStaticPaths_, 1}, + {"_httpuv_invokeCppCallback", (DL_FUNC) &_httpuv_invokeCppCallback, 2}, + {"_httpuv_ipFamily_", (DL_FUNC) &_httpuv_ipFamily_, 1}, + {"_httpuv_log_level", (DL_FUNC) &_httpuv_log_level, 1}, + {"_httpuv_makePipeServer", (DL_FUNC) &_httpuv_makePipeServer, 11}, + {"_httpuv_makeTcpServer", (DL_FUNC) &_httpuv_makeTcpServer, 11}, + {"_httpuv_removeStaticPaths_", (DL_FUNC) &_httpuv_removeStaticPaths_, 2}, + {"_httpuv_sendWSMessage", (DL_FUNC) &_httpuv_sendWSMessage, 3}, + {"_httpuv_setStaticPathOptions_", (DL_FUNC) &_httpuv_setStaticPathOptions_, 2}, + {"_httpuv_setStaticPaths_", (DL_FUNC) &_httpuv_setStaticPaths_, 2}, + {"_httpuv_stopServer_", (DL_FUNC) &_httpuv_stopServer_, 1}, + {"_httpuv_wsconn_address", (DL_FUNC) &_httpuv_wsconn_address, 1}, + {NULL, NULL, 0} +}; +} + +extern "C" attribute_visible void R_init_httpuv(DllInfo* dll){ + R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); + R_useDynamicSymbols(dll, FALSE); + R_forceSymbols(dll, TRUE); +} diff --git a/src/filedatasource-unix.cpp b/src/filedatasource-unix.cpp index 6db068299..88263a1d1 100644 --- a/src/filedatasource-unix.cpp +++ b/src/filedatasource-unix.cpp @@ -2,13 +2,14 @@ #include "filedatasource.h" #include "utils.h" +#include #include -#include #include +#include #include -#include -FileDataSourceResult FileDataSource::initialize(const std::string& path, bool owned) { +FileDataSourceResult FileDataSource::initialize(const std::string &path, + bool owned) { // This can be called from either the main thread or background thread. _fd = open(path.c_str(), O_RDONLY); @@ -17,14 +18,15 @@ FileDataSourceResult FileDataSource::initialize(const std::string& path, bool ow _lastErrorMessage = "File does not exist: " + path + "\n"; return FDS_NOT_EXIST; } else { - _lastErrorMessage = "Error opening file " + path + ": " + toString(errno) + "\n"; + _lastErrorMessage = + "Error opening file " + path + ": " + toString(errno) + "\n"; return FDS_ERROR; } - } - else { + } else { struct stat info = {0}; if (fstat(_fd, &info)) { - _lastErrorMessage = "Error opening path " + path + ": " + toString(errno) + "\n"; + _lastErrorMessage = + "Error opening path " + path + ": " + toString(errno) + "\n"; ::close(_fd); return FDS_ERROR; } @@ -48,16 +50,14 @@ FileDataSourceResult FileDataSource::initialize(const std::string& path, bool ow } } -uint64_t FileDataSource::size() const { - return _length; -} +uint64_t FileDataSource::size() const { return _length; } uv_buf_t FileDataSource::getData(size_t bytesDesired) { ASSERT_BACKGROUND_THREAD() if (bytesDesired == 0) return uv_buf_init(NULL, 0); - char* buffer = (char*)malloc(bytesDesired); + char *buffer = (char *)malloc(bytesDesired); if (!buffer) { throw std::runtime_error("Couldn't allocate buffer"); } @@ -72,9 +72,7 @@ uv_buf_t FileDataSource::getData(size_t bytesDesired) { return uv_buf_init(buffer, bytesRead); } -void FileDataSource::freeData(uv_buf_t buffer) { - free(buffer.base); -} +void FileDataSource::freeData(uv_buf_t buffer) { free(buffer.base); } time_t FileDataSource::getMtime() { struct stat res; @@ -95,5 +93,4 @@ std::string FileDataSource::lastErrorMessage() const { return _lastErrorMessage; } - #endif // #ifndef _WIN32 diff --git a/src/filedatasource-win.cpp b/src/filedatasource-win.cpp index e5366966b..9007c5a72 100644 --- a/src/filedatasource-win.cpp +++ b/src/filedatasource-win.cpp @@ -9,25 +9,22 @@ // so we can use FILE_FLAG_DELETE_ON_CLOSE, which is not available // using the POSIX file functions. - -FileDataSourceResult FileDataSource::initialize(const std::string& path, bool owned) { +FileDataSourceResult FileDataSource::initialize(const std::string &path, + bool owned) { // This can be called from either the main thread or background thread. DWORD flags = FILE_FLAG_SEQUENTIAL_SCAN; if (owned) flags |= FILE_FLAG_DELETE_ON_CLOSE; - - _hFile = CreateFileW(utf8ToWide(path).data(), - GENERIC_READ, - FILE_SHARE_READ, // allow other processes to read - NULL, // security attributes - OPEN_EXISTING, - flags, - NULL); + _hFile = CreateFileW(utf8ToWide(path).data(), GENERIC_READ, + FILE_SHARE_READ, // allow other processes to read + NULL, // security attributes + OPEN_EXISTING, flags, NULL); if (_hFile == INVALID_HANDLE_VALUE) { - if (GetLastError() == ERROR_FILE_NOT_FOUND || GetLastError() == ERROR_PATH_NOT_FOUND) { + if (GetLastError() == ERROR_FILE_NOT_FOUND || + GetLastError() == ERROR_PATH_NOT_FOUND) { _lastErrorMessage = "File does not exist: " + path + "\n"; return FDS_NOT_EXIST; @@ -43,32 +40,31 @@ FileDataSourceResult FileDataSource::initialize(const std::string& path, bool ow return FDS_ISDIR; } else { - _lastErrorMessage = "Error opening file " + path + ": " + toString(GetLastError()) + "\n"; + _lastErrorMessage = + "Error opening file " + path + ": " + toString(GetLastError()) + "\n"; return FDS_ERROR; } } - if (!GetFileSizeEx(_hFile, &_length)) { CloseHandle(_hFile); _hFile = INVALID_HANDLE_VALUE; - _lastErrorMessage = "Error retrieving file size for " + path + ": " + toString(GetLastError()) + "\n"; + _lastErrorMessage = "Error retrieving file size for " + path + ": " + + toString(GetLastError()) + "\n"; return FDS_ERROR; } return FDS_OK; } -uint64_t FileDataSource::size() const { - return _length.QuadPart; -} +uint64_t FileDataSource::size() const { return _length.QuadPart; } uv_buf_t FileDataSource::getData(size_t bytesDesired) { ASSERT_BACKGROUND_THREAD() if (bytesDesired == 0) return uv_buf_init(NULL, 0); - char* buffer = (char*)malloc(bytesDesired); + char *buffer = (char *)malloc(bytesDesired); if (!buffer) { throw std::runtime_error("Couldn't allocate buffer"); } @@ -84,13 +80,11 @@ uv_buf_t FileDataSource::getData(size_t bytesDesired) { return uv_buf_init(buffer, bytesRead); } -void FileDataSource::freeData(uv_buf_t buffer) { - free(buffer.base); -} +void FileDataSource::freeData(uv_buf_t buffer) { free(buffer.base); } -time_t FileTimeToTimeT(const FILETIME& ft) { +time_t FileTimeToTimeT(const FILETIME &ft) { ULARGE_INTEGER ull; - ull.LowPart = ft.dwLowDateTime; + ull.LowPart = ft.dwLowDateTime; ull.HighPart = ft.dwHighDateTime; return ull.QuadPart / 10000000ULL - 11644473600ULL; } @@ -116,5 +110,4 @@ std::string FileDataSource::lastErrorMessage() const { return _lastErrorMessage; } - #endif // #ifdef _WIN32 diff --git a/src/filedatasource.h b/src/filedatasource.h index d32ac0b07..9428132d0 100644 --- a/src/filedatasource.h +++ b/src/filedatasource.h @@ -3,16 +3,14 @@ #include "uvutil.h" - // Status codes for FileDataSource::initialize(). enum FileDataSourceResult { - FDS_OK = 0, // Initialization worked - FDS_NOT_EXIST, // File did not exist - FDS_ISDIR, // File is a directory - FDS_ERROR // Other error + FDS_OK = 0, // Initialization worked + FDS_NOT_EXIST, // File did not exist + FDS_ISDIR, // File is a directory + FDS_ERROR // Other error }; - class FileDataSource : public DataSource { #ifdef _WIN32 HANDLE _hFile; @@ -26,11 +24,9 @@ class FileDataSource : public DataSource { public: FileDataSource() {} - ~FileDataSource() { - close(); - } + ~FileDataSource() { close(); } - FileDataSourceResult initialize(const std::string& path, bool owned); + FileDataSourceResult initialize(const std::string &path, bool owned); uint64_t size() const; uv_buf_t getData(size_t bytesDesired); void freeData(uv_buf_t buffer); diff --git a/src/fs.cpp b/src/fs.cpp index 108ae89f7..25cbe4190 100644 --- a/src/fs.cpp +++ b/src/fs.cpp @@ -2,15 +2,14 @@ #include "utils.h" #ifdef _WIN32 -#include #include "winutils.h" +#include #else #include #endif #include - // Given a filename, return the extension. std::string find_extension(const std::string &filename) { size_t found_idx = filename.find_last_of('.'); @@ -34,7 +33,6 @@ std::string basename(const std::string &path) { } } - // filename is assumed to be UTF-8. bool is_directory(const std::string &filename) { #ifdef _WIN32 diff --git a/src/gzipdatasource.cpp b/src/gzipdatasource.cpp index a6cb789ba..3655a39bc 100644 --- a/src/gzipdatasource.cpp +++ b/src/gzipdatasource.cpp @@ -1,12 +1,13 @@ #include "gzipdatasource.h" #include "utils.h" -GZipDataSource::GZipDataSource(std::shared_ptr pData) : - _pData(pData), _state(Streaming) { +GZipDataSource::GZipDataSource(std::shared_ptr pData) + : _pData(pData), _state(Streaming) { _zstrm = {0}; _inputBuf = {0}; - int res = deflateInit2(&_zstrm, 6, Z_DEFLATED, 15 + 16, 8, Z_DEFAULT_STRATEGY); + int res = + deflateInit2(&_zstrm, 6, Z_DEFLATED, 15 + 16, 8, Z_DEFAULT_STRATEGY); if (res != Z_OK) { if (_zstrm.msg) { throw std::runtime_error(_zstrm.msg); @@ -23,7 +24,8 @@ GZipDataSource::~GZipDataSource() { } uint64_t GZipDataSource::size() const { - debug_log("GZipDataSource::size() was called, this should never happen\n", LOG_WARN); + debug_log("GZipDataSource::size() was called, this should never happen\n", + LOG_WARN); return 0; } @@ -34,7 +36,7 @@ uv_buf_t GZipDataSource::getData(size_t bytesDesired) { } // Prepare the output area to be written to - Bytef* outputBuf = (Bytef*)malloc(bytesDesired); + Bytef *outputBuf = (Bytef *)malloc(bytesDesired); _zstrm.next_out = outputBuf; _zstrm.avail_out = bytesDesired; @@ -46,7 +48,7 @@ uv_buf_t GZipDataSource::getData(size_t bytesDesired) { freeInputBuffer(); _inputBuf = _pData->getData(bytesDesired); - _zstrm.next_in = (Bytef*)_inputBuf.base; + _zstrm.next_in = (Bytef *)_inputBuf.base; _zstrm.avail_in = _inputBuf.len; if (_inputBuf.len == 0) { @@ -60,18 +62,14 @@ uv_buf_t GZipDataSource::getData(size_t bytesDesired) { freeInputBuffer(); uv_buf_t ret = {0}; - ret.base = (char*)outputBuf; + ret.base = (char *)outputBuf; ret.len = bytesDesired - _zstrm.avail_out; return ret; } -void GZipDataSource::freeData(uv_buf_t buffer) { - free(buffer.base); -} +void GZipDataSource::freeData(uv_buf_t buffer) { free(buffer.base); } -void GZipDataSource::close() { - _pData->close(); -} +void GZipDataSource::close() { _pData->close(); } // Attempt to deflate more data, reading from _zstrm.next_in and writing to // _zstrm.next_out. Both reads and (potentially) writes _state. diff --git a/src/gzipdatasource.h b/src/gzipdatasource.h index 382153c00..fd5960d0e 100644 --- a/src/gzipdatasource.h +++ b/src/gzipdatasource.h @@ -1,9 +1,8 @@ #ifndef GZIPDATASOURCE_H #define GZIPDATASOURCE_H -#include #include "uvutil.h" - +#include enum GDState { Streaming, Finishing, Done }; diff --git a/src/http-parser/http_parser.h b/src/http-parser/http_parser.h index eafc19ad5..20d2a0e1d 100644 --- a/src/http-parser/http_parser.h +++ b/src/http-parser/http_parser.h @@ -30,8 +30,8 @@ extern "C" { #define HTTP_PARSER_VERSION_PATCH 1 #include -#if defined(_WIN32) && !defined(__MINGW32__) && \ - (!defined(_MSC_VER) || _MSC_VER<1600) && !defined(__WINE__) +#if defined(_WIN32) && !defined(__MINGW32__) && \ + (!defined(_MSC_VER) || _MSC_VER < 1600) && !defined(__WINE__) #include #include typedef __int8 int8_t; @@ -50,7 +50,7 @@ typedef unsigned __int64 uint64_t; * faster */ #ifndef HTTP_PARSER_STRICT -# define HTTP_PARSER_STRICT 1 +#define HTTP_PARSER_STRICT 1 #endif /* Maximium header size allowed. If the macro is not defined @@ -61,13 +61,12 @@ typedef unsigned __int64 uint64_t; * to a very large number (e.g. -DHTTP_MAX_HEADER_SIZE=0x7fffffff) */ #ifndef HTTP_MAX_HEADER_SIZE -# define HTTP_MAX_HEADER_SIZE (80*1024) +#define HTTP_MAX_HEADER_SIZE (80 * 1024) #endif typedef struct http_parser http_parser; typedef struct http_parser_settings http_parser_settings; - /* Callbacks should return non-zero to indicate an error. The parser will * then halt execution. * @@ -86,139 +85,125 @@ typedef struct http_parser_settings http_parser_settings; * many times for each string. E.G. you might get 10 callbacks for "on_url" * each providing just a few characters more data. */ -typedef int (*http_data_cb) (http_parser*, const char *at, size_t length); -typedef int (*http_cb) (http_parser*); - +typedef int (*http_data_cb)(http_parser *, const char *at, size_t length); +typedef int (*http_cb)(http_parser *); /* Request Methods */ -#define HTTP_METHOD_MAP(XX) \ - XX(0, DELETE, DELETE) \ - XX(1, GET, GET) \ - XX(2, HEAD, HEAD) \ - XX(3, POST, POST) \ - XX(4, PUT, PUT) \ - /* pathological */ \ - XX(5, CONNECT, CONNECT) \ - XX(6, OPTIONS, OPTIONS) \ - XX(7, TRACE, TRACE) \ - /* WebDAV */ \ - XX(8, COPY, COPY) \ - XX(9, LOCK, LOCK) \ - XX(10, MKCOL, MKCOL) \ - XX(11, MOVE, MOVE) \ - XX(12, PROPFIND, PROPFIND) \ - XX(13, PROPPATCH, PROPPATCH) \ - XX(14, SEARCH, SEARCH) \ - XX(15, UNLOCK, UNLOCK) \ - XX(16, BIND, BIND) \ - XX(17, REBIND, REBIND) \ - XX(18, UNBIND, UNBIND) \ - XX(19, ACL, ACL) \ - /* subversion */ \ - XX(20, REPORT, REPORT) \ - XX(21, MKACTIVITY, MKACTIVITY) \ - XX(22, CHECKOUT, CHECKOUT) \ - XX(23, MERGE, MERGE) \ - /* upnp */ \ - XX(24, MSEARCH, M-SEARCH) \ - XX(25, NOTIFY, NOTIFY) \ - XX(26, SUBSCRIBE, SUBSCRIBE) \ - XX(27, UNSUBSCRIBE, UNSUBSCRIBE) \ - /* RFC-5789 */ \ - XX(28, PATCH, PATCH) \ - XX(29, PURGE, PURGE) \ - /* CalDAV */ \ - XX(30, MKCALENDAR, MKCALENDAR) \ - /* RFC-2068, section 19.6.1.2 */ \ - XX(31, LINK, LINK) \ - XX(32, UNLINK, UNLINK) \ - -enum http_method - { +#define HTTP_METHOD_MAP(XX) \ + XX(0, DELETE, DELETE) \ + XX(1, GET, GET) \ + XX(2, HEAD, HEAD) \ + XX(3, POST, POST) \ + XX(4, PUT, PUT) \ + /* pathological */ \ + XX(5, CONNECT, CONNECT) \ + XX(6, OPTIONS, OPTIONS) \ + XX(7, TRACE, TRACE) \ + /* WebDAV */ \ + XX(8, COPY, COPY) \ + XX(9, LOCK, LOCK) \ + XX(10, MKCOL, MKCOL) \ + XX(11, MOVE, MOVE) \ + XX(12, PROPFIND, PROPFIND) \ + XX(13, PROPPATCH, PROPPATCH) \ + XX(14, SEARCH, SEARCH) \ + XX(15, UNLOCK, UNLOCK) \ + XX(16, BIND, BIND) \ + XX(17, REBIND, REBIND) \ + XX(18, UNBIND, UNBIND) \ + XX(19, ACL, ACL) \ + /* subversion */ \ + XX(20, REPORT, REPORT) \ + XX(21, MKACTIVITY, MKACTIVITY) \ + XX(22, CHECKOUT, CHECKOUT) \ + XX(23, MERGE, MERGE) \ + /* upnp */ \ + XX(24, MSEARCH, M - SEARCH) \ + XX(25, NOTIFY, NOTIFY) \ + XX(26, SUBSCRIBE, SUBSCRIBE) \ + XX(27, UNSUBSCRIBE, UNSUBSCRIBE) \ + /* RFC-5789 */ \ + XX(28, PATCH, PATCH) \ + XX(29, PURGE, PURGE) \ + /* CalDAV */ \ + XX(30, MKCALENDAR, MKCALENDAR) \ + /* RFC-2068, section 19.6.1.2 */ \ + XX(31, LINK, LINK) \ + XX(32, UNLINK, UNLINK) + +enum http_method { #define XX(num, name, string) HTTP_##name = num, HTTP_METHOD_MAP(XX) #undef XX - }; - +}; enum http_parser_type { HTTP_REQUEST, HTTP_RESPONSE, HTTP_BOTH }; - /* Flag values for http_parser.flags field */ -enum flags - { F_CHUNKED = 1 << 0 - , F_CONNECTION_KEEP_ALIVE = 1 << 1 - , F_CONNECTION_CLOSE = 1 << 2 - , F_CONNECTION_UPGRADE = 1 << 3 - , F_TRAILING = 1 << 4 - , F_UPGRADE = 1 << 5 - , F_SKIPBODY = 1 << 6 - , F_CONTENTLENGTH = 1 << 7 - }; - +enum flags { + F_CHUNKED = 1 << 0, + F_CONNECTION_KEEP_ALIVE = 1 << 1, + F_CONNECTION_CLOSE = 1 << 2, + F_CONNECTION_UPGRADE = 1 << 3, + F_TRAILING = 1 << 4, + F_UPGRADE = 1 << 5, + F_SKIPBODY = 1 << 6, + F_CONTENTLENGTH = 1 << 7 +}; /* Map for errno-related constants * * The provided argument should be a macro that takes 2 arguments. */ -#define HTTP_ERRNO_MAP(XX) \ - /* No error */ \ - XX(OK, "success") \ - \ - /* Callback-related errors */ \ - XX(CB_message_begin, "the on_message_begin callback failed") \ - XX(CB_url, "the on_url callback failed") \ - XX(CB_header_field, "the on_header_field callback failed") \ - XX(CB_header_value, "the on_header_value callback failed") \ - XX(CB_headers_complete, "the on_headers_complete callback failed") \ - XX(CB_body, "the on_body callback failed") \ - XX(CB_message_complete, "the on_message_complete callback failed") \ - XX(CB_status, "the on_status callback failed") \ - XX(CB_chunk_header, "the on_chunk_header callback failed") \ - XX(CB_chunk_complete, "the on_chunk_complete callback failed") \ - \ - /* Parsing-related errors */ \ - XX(REENTRANT_CALL, "re-entrant call to http_parser_execute") \ - XX(INVALID_EOF_STATE, "stream ended at an unexpected time") \ - XX(HEADER_OVERFLOW, \ - "too many header bytes seen; overflow detected") \ - XX(CLOSED_CONNECTION, \ - "data received after completed connection: close message") \ - XX(INVALID_VERSION, "invalid HTTP version") \ - XX(INVALID_STATUS, "invalid HTTP status code") \ - XX(INVALID_METHOD, "invalid HTTP method") \ - XX(INVALID_URL, "invalid URL") \ - XX(INVALID_HOST, "invalid host") \ - XX(INVALID_PORT, "invalid port") \ - XX(INVALID_PATH, "invalid path") \ - XX(INVALID_QUERY_STRING, "invalid query string") \ - XX(INVALID_FRAGMENT, "invalid fragment") \ - XX(LF_EXPECTED, "LF character expected") \ - XX(INVALID_HEADER_TOKEN, "invalid character in header") \ - XX(INVALID_CONTENT_LENGTH, \ - "invalid character in content-length header") \ - XX(UNEXPECTED_CONTENT_LENGTH, \ - "unexpected content-length header") \ - XX(INVALID_CHUNK_SIZE, \ - "invalid character in chunk size header") \ - XX(INVALID_CONSTANT, "invalid constant string") \ - XX(INVALID_INTERNAL_STATE, "encountered unexpected internal state")\ - XX(STRICT, "strict mode assertion failed") \ - XX(PAUSED, "parser is paused") \ +#define HTTP_ERRNO_MAP(XX) \ + /* No error */ \ + XX(OK, "success") \ + \ + /* Callback-related errors */ \ + XX(CB_message_begin, "the on_message_begin callback failed") \ + XX(CB_url, "the on_url callback failed") \ + XX(CB_header_field, "the on_header_field callback failed") \ + XX(CB_header_value, "the on_header_value callback failed") \ + XX(CB_headers_complete, "the on_headers_complete callback failed") \ + XX(CB_body, "the on_body callback failed") \ + XX(CB_message_complete, "the on_message_complete callback failed") \ + XX(CB_status, "the on_status callback failed") \ + XX(CB_chunk_header, "the on_chunk_header callback failed") \ + XX(CB_chunk_complete, "the on_chunk_complete callback failed") \ + \ + /* Parsing-related errors */ \ + XX(REENTRANT_CALL, "re-entrant call to http_parser_execute") \ + XX(INVALID_EOF_STATE, "stream ended at an unexpected time") \ + XX(HEADER_OVERFLOW, "too many header bytes seen; overflow detected") \ + XX(CLOSED_CONNECTION, \ + "data received after completed connection: close message") \ + XX(INVALID_VERSION, "invalid HTTP version") \ + XX(INVALID_STATUS, "invalid HTTP status code") \ + XX(INVALID_METHOD, "invalid HTTP method") \ + XX(INVALID_URL, "invalid URL") \ + XX(INVALID_HOST, "invalid host") \ + XX(INVALID_PORT, "invalid port") \ + XX(INVALID_PATH, "invalid path") \ + XX(INVALID_QUERY_STRING, "invalid query string") \ + XX(INVALID_FRAGMENT, "invalid fragment") \ + XX(LF_EXPECTED, "LF character expected") \ + XX(INVALID_HEADER_TOKEN, "invalid character in header") \ + XX(INVALID_CONTENT_LENGTH, "invalid character in content-length header") \ + XX(UNEXPECTED_CONTENT_LENGTH, "unexpected content-length header") \ + XX(INVALID_CHUNK_SIZE, "invalid character in chunk size header") \ + XX(INVALID_CONSTANT, "invalid constant string") \ + XX(INVALID_INTERNAL_STATE, "encountered unexpected internal state") \ + XX(STRICT, "strict mode assertion failed") \ + XX(PAUSED, "parser is paused") \ XX(UNKNOWN, "an unknown error occurred") - /* Define HPE_* values for each errno value above */ #define HTTP_ERRNO_GEN(n, s) HPE_##n, -enum http_errno { - HTTP_ERRNO_MAP(HTTP_ERRNO_GEN) -}; +enum http_errno { HTTP_ERRNO_MAP(HTTP_ERRNO_GEN) }; #undef HTTP_ERRNO_GEN - /* Get an http_errno value from an http_parser */ -#define HTTP_PARSER_ERRNO(p) ((enum http_errno) (p)->http_errno) - +#define HTTP_PARSER_ERRNO(p) ((enum http_errno)(p)->http_errno) struct http_parser { /** PRIVATE **/ @@ -249,7 +234,6 @@ struct http_parser { /** PUBLIC **/ void *data; /* A pointer to get hook to the "connection" or "socket" object */ - /** ADDED FOR ASYNC on_headers_complete **/ /* The status code set by the application code after processing the * headers. Initial value is -1. After headers have been processed, it should @@ -262,40 +246,37 @@ struct http_parser { int is_running; }; - struct http_parser_settings { - http_cb on_message_begin; + http_cb on_message_begin; http_data_cb on_url; http_data_cb on_status; http_data_cb on_header_field; http_data_cb on_header_value; - http_cb on_headers_complete; + http_cb on_headers_complete; http_data_cb on_body; - http_cb on_message_complete; + http_cb on_message_complete; /* When on_chunk_header is called, the current chunk length is stored * in parser->content_length. */ - http_cb on_chunk_header; - http_cb on_chunk_complete; + http_cb on_chunk_header; + http_cb on_chunk_complete; /* If 0, on_headers_complete is expected to be synchronous and return a * meaningful result. If 1, it is expected to be async, and return 0 * immediately. */ - int is_async_on_headers_complete; + int is_async_on_headers_complete; }; - -enum http_parser_url_fields - { UF_SCHEMA = 0 - , UF_HOST = 1 - , UF_PORT = 2 - , UF_PATH = 3 - , UF_QUERY = 4 - , UF_FRAGMENT = 5 - , UF_USERINFO = 6 - , UF_MAX = 7 - }; - +enum http_parser_url_fields { + UF_SCHEMA = 0, + UF_HOST = 1, + UF_PORT = 2, + UF_PATH = 3, + UF_QUERY = 4, + UF_FRAGMENT = 5, + UF_USERINFO = 6, + UF_MAX = 7 +}; /* Result structure for http_parser_parse_url(). * @@ -305,16 +286,15 @@ enum http_parser_url_fields * a uint16_t. */ struct http_parser_url { - uint16_t field_set; /* Bitmask of (1 << UF_*) values */ - uint16_t port; /* Converted UF_PORT string */ + uint16_t field_set; /* Bitmask of (1 << UF_*) values */ + uint16_t port; /* Converted UF_PORT string */ struct { - uint16_t off; /* Offset into buffer in which field starts */ - uint16_t len; /* Length of run in buffer */ + uint16_t off; /* Offset into buffer in which field starts */ + uint16_t len; /* Length of run in buffer */ } field_data[UF_MAX]; }; - /* Returns the library version. Bits 16-23 contain the major version number, * bits 8-15 the minor version number and bits 0-7 the patch level. * Usage example: @@ -329,18 +309,15 @@ unsigned long http_parser_version(void); void http_parser_init(http_parser *parser, enum http_parser_type type); - /* Initialize http_parser_settings members to 0 */ void http_parser_settings_init(http_parser_settings *settings); - /* Executes the parser. Returns number of parsed bytes. Sets * `parser->http_errno` on error. */ size_t http_parser_execute(http_parser *parser, const http_parser_settings *settings, - const char *data, - size_t len); + const char *data, size_t len); /* Return 1 if the parser is in the s_wait_for_on_headers_completed state, * 0 otherwise. */ @@ -375,8 +352,7 @@ const char *http_errno_description(enum http_errno err); void http_parser_url_init(struct http_parser_url *u); /* Parse a URL; return nonzero on failure */ -int http_parser_parse_url(const char *buf, size_t buflen, - int is_connect, +int http_parser_parse_url(const char *buf, size_t buflen, int is_connect, struct http_parser_url *u); /* Pause or un-pause the parser; a nonzero value pauses */ diff --git a/src/http.cpp b/src/http.cpp index d21e3389d..bde09c446 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -1,23 +1,22 @@ #include "http.h" +#include "callbackqueue.h" #include "httprequest.h" #include "httpresponse.h" -#include "callbackqueue.h" #include "socket.h" -#include "utils.h" #include "thread.h" +#include "utils.h" #include #include #include #include -#include #include - +#include // TODO: Streaming response body (with chunked transfer encoding) // TODO: Fast/easy use of files as response body -void on_request(uv_stream_t* handle, int status) { +void on_request(uv_stream_t *handle, int status) { ASSERT_BACKGROUND_THREAD() if (status) { err_printf("connection error: %s\n", uv_strerror(status)); @@ -25,14 +24,13 @@ void on_request(uv_stream_t* handle, int status) { } // Copy the shared_ptr - std::shared_ptr pSocket(*(std::shared_ptr*)handle->data); - CallbackQueue* bg_queue = pSocket->background_queue; + std::shared_ptr pSocket(*(std::shared_ptr *)handle->data); + CallbackQueue *bg_queue = pSocket->background_queue; // Freed by HttpRequest itself when close() is called, which // can occur on EOF, error, or when the Socket is destroyed std::shared_ptr req = createHttpRequest( - handle->loop, pSocket->pWebApplication, pSocket, bg_queue - ); + handle->loop, pSocket->pWebApplication, pSocket, bg_queue); int r = uv_accept(handle, req->handle()); if (r) { @@ -41,26 +39,20 @@ void on_request(uv_stream_t* handle, int status) { } req->handleRequest(); - } -uv_stream_t* createPipeServer( - uv_loop_t* pLoop, - const std::string& name, - int mask, - std::shared_ptr pWebApplication, - bool quiet, - CallbackQueue* background_queue -) { +uv_stream_t *createPipeServer(uv_loop_t *pLoop, const std::string &name, + int mask, + std::shared_ptr pWebApplication, + bool quiet, CallbackQueue *background_queue) { ASSERT_BACKGROUND_THREAD() // We own pWebApplication. It will be destroyed by the socket but if in // the future we have failure cases that stop execution before we get // that far, we MUST delete pWebApplication ourselves. - std::shared_ptr pSocket = std::make_shared( - pWebApplication, background_queue - ); + std::shared_ptr pSocket = + std::make_shared(pWebApplication, background_queue); // TODO: Handle error uv_pipe_init(pLoop, &pSocket->handle.pipe, 0); @@ -79,15 +71,17 @@ uv_stream_t* createPipeServer( if (r) { if (!quiet) err_printf("createPipeServer: %s\n", uv_strerror(r)); - // It's important that close() is explicitly called, so that the uv_pipe_t is cleaned up + // It's important that close() is explicitly called, so that the uv_pipe_t + // is cleaned up pSocket->close(); return NULL; } - r = uv_listen((uv_stream_t*)&pSocket->handle.stream, 128, &on_request); + r = uv_listen((uv_stream_t *)&pSocket->handle.stream, 128, &on_request); if (r) { if (!quiet) err_printf("createPipeServer: %s\n", uv_strerror(r)); - // It's important that close() is explicitly called, so that the uv_pipe_t is cleaned up + // It's important that close() is explicitly called, so that the uv_pipe_t + // is cleaned up pSocket->close(); return NULL; } @@ -97,41 +91,32 @@ uv_stream_t* createPipeServer( // A wrapper for createPipeServer. The main thread schedules this to run on // the background thread, then waits for this to finish, using a barrier. -void createPipeServerSync( - uv_loop_t* loop, - const std::string& name, - int mask, - std::shared_ptr pWebApplication, - bool quiet, - CallbackQueue* background_queue, - uv_stream_t** pServer, - std::shared_ptr blocker -) { +void createPipeServerSync(uv_loop_t *loop, const std::string &name, int mask, + std::shared_ptr pWebApplication, + bool quiet, CallbackQueue *background_queue, + uv_stream_t **pServer, + std::shared_ptr blocker) { ASSERT_BACKGROUND_THREAD() - *pServer = createPipeServer(loop, name, mask, pWebApplication, quiet, background_queue); + *pServer = createPipeServer(loop, name, mask, pWebApplication, quiet, + background_queue); // Tell the main thread that the server is ready blocker->wait(); } -uv_stream_t* createTcpServer( - uv_loop_t* pLoop, - const std::string& host, - int port, - std::shared_ptr pWebApplication, - bool quiet, - CallbackQueue* background_queue -) { +uv_stream_t *createTcpServer(uv_loop_t *pLoop, const std::string &host, + int port, + std::shared_ptr pWebApplication, + bool quiet, CallbackQueue *background_queue) { ASSERT_BACKGROUND_THREAD() // We own pWebApplication. It will be destroyed by the socket but if in // the future we have failure cases that stop execution before we get // that far, we MUST delete pWebApplication ourselves. - std::shared_ptr pSocket = std::make_shared( - pWebApplication, background_queue - ); + std::shared_ptr pSocket = + std::make_shared(pWebApplication, background_queue); // TODO: Handle error uv_tcp_init(pLoop, &pSocket->handle.tcp); @@ -143,15 +128,15 @@ uv_stream_t* createTcpServer( int r; // Lifetime of these needs to encompass use of pAddress in uv_tcp_bind() struct sockaddr_in6 addr6; - struct sockaddr_in addr4; - sockaddr* pAddress; + struct sockaddr_in addr4; + sockaddr *pAddress; int family = ip_family(host); if (family == AF_INET6) { r = uv_ip6_addr(host.c_str(), port, &addr6); - pAddress = reinterpret_cast(&addr6); - } else if (family == AF_INET){ + pAddress = reinterpret_cast(&addr6); + } else if (family == AF_INET) { r = uv_ip4_addr(host.c_str(), port, &addr4); - pAddress = reinterpret_cast(&addr4); + pAddress = reinterpret_cast(&addr4); } else { r = 1; if (!quiet) @@ -161,7 +146,8 @@ uv_stream_t* createTcpServer( if (r) { if (!quiet) err_printf("createTcpServer: %s\n", uv_strerror(r)); - // It's important that close() is explicitly called, so that the uv_tcp_t is cleaned up + // It's important that close() is explicitly called, so that the uv_tcp_t is + // cleaned up pSocket->close(); return NULL; } @@ -171,15 +157,17 @@ uv_stream_t* createTcpServer( if (r) { if (!quiet) err_printf("createTcpServer: %s\n", uv_strerror(r)); - // It's important that close() is explicitly called, so that the uv_tcp_t is cleaned up + // It's important that close() is explicitly called, so that the uv_tcp_t is + // cleaned up pSocket->close(); return NULL; } - r = uv_listen((uv_stream_t*)&pSocket->handle.stream, 128, &on_request); + r = uv_listen((uv_stream_t *)&pSocket->handle.stream, 128, &on_request); if (r) { if (!quiet) err_printf("createTcpServer: %s\n", uv_strerror(r)); - // It's important that close() is explicitly called, so that the uv_tcp_t is cleaned up + // It's important that close() is explicitly called, so that the uv_tcp_t is + // cleaned up pSocket->close(); return NULL; } @@ -189,29 +177,24 @@ uv_stream_t* createTcpServer( // A wrapper for createTcpServer. The main thread schedules this to run on the // background thread, then waits for this to finish, using a barrier. -void createTcpServerSync( - uv_loop_t* pLoop, - const std::string& host, - int port, - std::shared_ptr pWebApplication, - bool quiet, - CallbackQueue* background_queue, - uv_stream_t** pServer, - std::shared_ptr blocker -) { +void createTcpServerSync(uv_loop_t *pLoop, const std::string &host, int port, + std::shared_ptr pWebApplication, + bool quiet, CallbackQueue *background_queue, + uv_stream_t **pServer, + std::shared_ptr blocker) { ASSERT_BACKGROUND_THREAD() - *pServer = createTcpServer(pLoop, host, port, pWebApplication, quiet, background_queue); + *pServer = createTcpServer(pLoop, host, port, pWebApplication, quiet, + background_queue); // Tell the main thread that the server is ready blocker->wait(); } - -void freeServer(uv_stream_t* pHandle) { +void freeServer(uv_stream_t *pHandle) { ASSERT_BACKGROUND_THREAD() // TODO: Check if server is still running? - std::shared_ptr* ppSocket = (std::shared_ptr*)pHandle->data; + std::shared_ptr *ppSocket = (std::shared_ptr *)pHandle->data; (*ppSocket)->close(); // ppSocket gets deleted in a callback in close() } diff --git a/src/http.h b/src/http.h index 882bbf288..a76ff3b85 100644 --- a/src/http.h +++ b/src/http.h @@ -1,14 +1,14 @@ #ifndef HTTP_HPP #define HTTP_HPP -#include -#include -#include -#include "webapplication.h" -#include "websockets.h" +#include "auto_deleter.h" #include "callbackqueue.h" #include "utils.h" -#include "auto_deleter.h" +#include "webapplication.h" +#include "websockets.h" +#include +#include +#include typedef struct { union { @@ -23,97 +23,69 @@ struct Address { std::string host; unsigned short port; - Address() : port(0) { - } + Address() : port(0) {} }; class Socket; -uv_stream_t* createPipeServer(uv_loop_t* loop, const std::string& name, int mask, - std::shared_ptr pWebApplication); - -uv_stream_t* createTcpServer(uv_loop_t* loop, const std::string& host, int port, - std::shared_ptr pWebApplication); - -void createPipeServerSync(uv_loop_t* loop, const std::string& name, int mask, - std::shared_ptr pWebApplication, bool quiet, - CallbackQueue* background_queue, - uv_stream_t** pServer, std::shared_ptr blocker); +uv_stream_t *createPipeServer(uv_loop_t *loop, const std::string &name, + int mask, + std::shared_ptr pWebApplication); -void createTcpServerSync(uv_loop_t* loop, const std::string& host, int port, - std::shared_ptr pWebApplication, bool quiet, - CallbackQueue* background_queue, - uv_stream_t** pServer, std::shared_ptr blocker); +uv_stream_t *createTcpServer(uv_loop_t *loop, const std::string &host, int port, + std::shared_ptr pWebApplication); -void freeServer(uv_stream_t* pServer); -bool runNonBlocking(uv_loop_t* loop); +void createPipeServerSync(uv_loop_t *loop, const std::string &name, int mask, + std::shared_ptr pWebApplication, + bool quiet, CallbackQueue *background_queue, + uv_stream_t **pServer, + std::shared_ptr blocker); +void createTcpServerSync(uv_loop_t *loop, const std::string &host, int port, + std::shared_ptr pWebApplication, + bool quiet, CallbackQueue *background_queue, + uv_stream_t **pServer, + std::shared_ptr blocker); -// NOTE: externalize/internalize_shared_ptr were originally template functions -// but were made into non-template functions because gcc 4.4.7 (used on RHEL -// 6) gives the following error with the templated versions: -// sorry, unimplemented: mangling template_id_expr -// This was due to a bug in gcc which was fixed in later versions. -// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38600 +void freeServer(uv_stream_t *pServer); +bool runNonBlocking(uv_loop_t *loop); // externalize_shared_ptr is used to pass a shared_ptr to R, and have its // lifetime be tied to the R external pointer object. This function creates a // copy of the shared_ptr (incrementing the shared_ptr's target's refcount) -// using `new`, and puts it inside of the XPtr. When the XPtr is garbage -// collected, the shared_ptr is deleted, which decrements the refcount. +// using `new`, and puts it inside of the external_pointer. When the +// external_pointer is garbage collected, the shared_ptr is deleted, which +// decrements the refcount. // -// As long as R has the XPtr object, the shared_ptr's target won't be deleted. -// Also, when the XPtr gets GC'd, the shared_ptr will get deleted, and if the -// refcount goes to 0, then the target object will be deleted (or, if it has a -// deleter, that will be called). This means that the target object could be -// deleted from the main thread due to a GC event in R. -// -// The reason we need the explicit Xptr type is because we want to set the last -// argument (finalizeOnExit) to true. -inline Rcpp::XPtr, - Rcpp::PreserveStorage, - auto_deleter_background >, - true> externalize_shared_ptr(std::shared_ptr obj) -{ - ASSERT_MAIN_THREAD() - std::shared_ptr* obj_copy = new std::shared_ptr(obj); - - Rcpp::XPtr, - Rcpp::PreserveStorage, - auto_deleter_background >, - true> obj_xptr(obj_copy, true); - - return obj_xptr; -} - -// Given an XPtr to a shared_ptr, return a copy of the shared_ptr. This -// increases the shared_ptr's ref count by one. -inline std::shared_ptr internalize_shared_ptr( - Rcpp::XPtr, - Rcpp::PreserveStorage, - auto_deleter_background >, - true> obj_xptr) -{ +// As long as R has the external_pointer object, the shared_ptr's target won't +// be deleted. Also, when the external_pointer gets GC'd, the shared_ptr will +// get deleted, and if the refcount goes to 0, then the target object will be +// deleted (or, if it has a deleter, that will be called). This means that the +// target object could be deleted from the main thread due to a GC event in R. +inline external_pointer< + std::shared_ptr, + auto_deleter_background>> +externalize_shared_ptr(std::shared_ptr obj) { ASSERT_MAIN_THREAD() - std::shared_ptr* obj_copy = obj_xptr.get(); - // Return a copy of the shared pointer. - return *obj_copy; + std::shared_ptr *obj_copy = + new std::shared_ptr(obj); + return external_pointer< + std::shared_ptr, + auto_deleter_background>>( + obj_copy, true, true); } - -template -std::string externalize_str(T* pServer) { +template std::string externalize_str(T *pServer) { std::ostringstream os; os << reinterpret_cast(pServer); return os.str(); } -template -T* internalize_str(std::string serverHandle) { +template T *internalize_str(std::string serverHandle) { std::istringstream is(serverHandle); uintptr_t result; is >> result; - return reinterpret_cast(result); + return reinterpret_cast(result); } #endif // HTTP_HPP diff --git a/src/httprequest.cpp b/src/httprequest.cpp index 55fee9528..0fd45c7f4 100644 --- a/src/httprequest.cpp +++ b/src/httprequest.cpp @@ -1,14 +1,13 @@ -#include -#include #include "httprequest.h" -#include +#include "auto_deleter.h" #include "callback.h" -#include "utils.h" #include "thread.h" -#include "auto_deleter.h" - +#include "utils.h" +#include +#include +#include -http_parser_settings& request_settings() { +http_parser_settings &request_settings() { static http_parser_settings settings; settings.on_message_begin = HttpRequest_on_message_begin; settings.on_url = HttpRequest_on_url; @@ -22,22 +21,23 @@ http_parser_settings& request_settings() { return settings; } -void on_alloc(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) { +void on_alloc(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf) { ASSERT_BACKGROUND_THREAD() // Freed in HttpRequest::_on_request_read - void* result = malloc(suggested_size); - *buf = uv_buf_init((char*)result, suggested_size); + void *result = malloc(suggested_size); + *buf = uv_buf_init((char *)result, suggested_size); } // Does a header field `name` exist? -bool HttpRequest::hasHeader(const std::string& name) const { +bool HttpRequest::hasHeader(const std::string &name) const { return _headers.find(name) != _headers.end(); } // Does a header field `name` exist and have a particular value? If ci is // true, do a case-insensitive comparison of the value (fields are always // case- insensitive.) -bool HttpRequest::hasHeader(const std::string& name, const std::string& value, bool ci) const { +bool HttpRequest::hasHeader(const std::string &name, const std::string &value, + bool ci) const { RequestHeaders::const_iterator item = _headers.find(name); if (item == _headers.end()) return false; @@ -51,7 +51,7 @@ bool HttpRequest::hasHeader(const std::string& name, const std::string& value, b // Return the value of a specified header. If the specified header isn't // found, return "". -std::string HttpRequest::getHeader(const std::string& name) const { +std::string HttpRequest::getHeader(const std::string &name) const { RequestHeaders::const_iterator item = _headers.find(name); if (item == _headers.end()) return ""; @@ -59,9 +59,7 @@ std::string HttpRequest::getHeader(const std::string& name) const { return item->second; } -uv_stream_t* HttpRequest::handle() { - return &_handle.stream; -} +uv_stream_t *HttpRequest::handle() { return &_handle.stream; } Address HttpRequest::serverAddress() { Address address; @@ -69,7 +67,7 @@ Address HttpRequest::serverAddress() { if (_handle.isTcp) { struct sockaddr_in addr = {0}; int len = sizeof(sockaddr_in); - int r = uv_tcp_getsockname(&_handle.tcp, (struct sockaddr*)&addr, &len); + int r = uv_tcp_getsockname(&_handle.tcp, (struct sockaddr *)&addr, &len); if (r) { // TODO: warn? return address; @@ -81,7 +79,7 @@ Address HttpRequest::serverAddress() { } // addrstr is a pointer to static buffer, no need to free - char* addrstr = inet_ntoa(addr.sin_addr); + char *addrstr = inet_ntoa(addr.sin_addr); if (addrstr) address.host = std::string(addrstr); else { @@ -99,7 +97,7 @@ Address HttpRequest::clientAddress() { if (_handle.isTcp) { struct sockaddr_in addr = {0}; int len = sizeof(sockaddr_in); - int r = uv_tcp_getpeername(&_handle.tcp, (struct sockaddr*)&addr, &len); + int r = uv_tcp_getpeername(&_handle.tcp, (struct sockaddr *)&addr, &len); if (r) { // TODO: warn? return address; @@ -111,7 +109,7 @@ Address HttpRequest::clientAddress() { } // addrstr is a pointer to static buffer, no need to free - char* addrstr = inet_ntoa(addr.sin_addr); + char *addrstr = inet_ntoa(addr.sin_addr); if (addrstr) address.host = std::string(addrstr); else { @@ -141,29 +139,24 @@ void HttpRequest::_newRequest() { // Schedule on main thread: // this->_initializeEnv(); - invoke_later( - std::bind(&HttpRequest::_initializeEnv, shared_from_this()) - ); + invoke_later(std::bind(&HttpRequest::_initializeEnv, shared_from_this())); } void HttpRequest::_initializeEnv() { ASSERT_MAIN_THREAD() - using namespace Rcpp; - - Environment base(R_BaseEnv); - Function new_env = Rcpp::as(base["new.env"]); + environment base(R_BaseEnv); + function new_env(base["new.env"]); // The deleter is called either when this function is called again, or when // the HttpRequest object is deleted. The deletion will happen on the // background thread; auto_deleter_main() schedules the deletion of the - // Rcpp::Environment object on the main thread. - _env = std::shared_ptr( - new Environment(new_env(_["parent"] = R_EmptyEnv)), - auto_deleter_main - ); + // environment object on the main thread. + _env = std::shared_ptr( + new environment(new_env("parent"_nm = R_EmptyEnv)), + auto_deleter_main); } -Rcpp::Environment& HttpRequest::env() { +environment &HttpRequest::env() { ASSERT_MAIN_THREAD() return *_env; } @@ -172,13 +165,9 @@ std::string HttpRequest::method() const { return http_method_str((enum http_method)_parser.method); } -std::string HttpRequest::url() const { - return _url; -} +std::string HttpRequest::url() const { return _url; } -const RequestHeaders& HttpRequest::headers() const { - return _headers; -} +const RequestHeaders &HttpRequest::headers() const { return _headers; } void HttpRequest::responseScheduled() { ASSERT_MAIN_THREAD() @@ -197,31 +186,32 @@ void HttpRequest::requestCompleted() { _handling_request = false; } - // ============================================================================ // Miscellaneous callbacks for http parser // ============================================================================ -int HttpRequest::_on_message_begin(http_parser* pParser) { +int HttpRequest::_on_message_begin(http_parser *pParser) { ASSERT_BACKGROUND_THREAD() debug_log("HttpRequest::_on_message_begin", LOG_DEBUG); _newRequest(); return 0; } -int HttpRequest::_on_url(http_parser* pParser, const char* pAt, size_t length) { +int HttpRequest::_on_url(http_parser *pParser, const char *pAt, size_t length) { ASSERT_BACKGROUND_THREAD() debug_log("HttpRequest::_on_url", LOG_DEBUG); _url = std::string(pAt, length); return 0; } -int HttpRequest::_on_status(http_parser* pParser, const char* pAt, size_t length) { +int HttpRequest::_on_status(http_parser *pParser, const char *pAt, + size_t length) { ASSERT_BACKGROUND_THREAD() debug_log("HttpRequest::_on_status", LOG_DEBUG); return 0; } -int HttpRequest::_on_header_field(http_parser* pParser, const char* pAt, size_t length) { +int HttpRequest::_on_header_field(http_parser *pParser, const char *pAt, + size_t length) { ASSERT_BACKGROUND_THREAD() debug_log("HttpRequest::_on_header_field", LOG_DEBUG); @@ -234,7 +224,8 @@ int HttpRequest::_on_header_field(http_parser* pParser, const char* pAt, size_t return 0; } -int HttpRequest::_on_header_value(http_parser* pParser, const char* pAt, size_t length) { +int HttpRequest::_on_header_value(http_parser *pParser, const char *pAt, + size_t length) { ASSERT_BACKGROUND_THREAD() debug_log("HttpRequest::_on_header_value", LOG_DEBUG); @@ -300,9 +291,7 @@ void HttpRequest::updateUpgradeStatus() { }; } -bool HttpRequest::isUpgrade() const { - return _is_upgrade; -} +bool HttpRequest::isUpgrade() const { return _is_upgrade; } // ============================================================================ // Headers complete @@ -315,7 +304,7 @@ bool HttpRequest::isUpgrade() const { // asynchronously, we don't know at this point if there has been an error. If // one of those conditions occurs, we'll set it later, but before we call // http_parser_execute() again. -int HttpRequest::_on_headers_complete(http_parser* pParser) { +int HttpRequest::_on_headers_complete(http_parser *pParser) { ASSERT_BACKGROUND_THREAD() debug_log("HttpRequest::_on_headers_complete", LOG_DEBUG); updateUpgradeStatus(); @@ -323,35 +312,28 @@ int HttpRequest::_on_headers_complete(http_parser* pParser) { // Attempt static serving here. If the request is for a static path, this // will be a response object; if not, it will be an empty shared_ptr. std::shared_ptr pResponse = - _pWebApplication->staticFileResponse(shared_from_this()); + _pWebApplication->staticFileResponse(shared_from_this()); if (pResponse) { // The request was for a static path. Skip over the webapplication code // (which calls back into R on the main thread). Just add a call to // _on_headers_complete_complete to the queue on the background thread. - std::function cb( - std::bind(&HttpRequest::_on_headers_complete_complete, shared_from_this(), pResponse) - ); + std::function cb( + std::bind(&HttpRequest::_on_headers_complete_complete, + shared_from_this(), pResponse)); _background_queue->push(cb); return 0; } - std::function)> schedule_bg_callback( - std::bind(&HttpRequest::_schedule_on_headers_complete_complete, shared_from_this(), std::placeholders::_1) - ); - - // Use later to schedule _pWebApplication->onHeaders(this, schedule_bg_callback) - // to run on the main thread. That function in turn calls - // this->_schedule_on_headers_complete_complete. - invoke_later( - std::bind( - &WebApplication::onHeaders, - _pWebApplication, - shared_from_this(), - schedule_bg_callback - ) - ); + std::bind(&HttpRequest::_schedule_on_headers_complete_complete, + shared_from_this(), std::placeholders::_1)); + + // Use later to schedule _pWebApplication->onHeaders(this, + // schedule_bg_callback) to run on the main thread. That function in turn + // calls this->_schedule_on_headers_complete_complete. + invoke_later(std::bind(&WebApplication::onHeaders, _pWebApplication, + shared_from_this(), schedule_bg_callback)); return 0; } @@ -359,30 +341,33 @@ int HttpRequest::_on_headers_complete(http_parser* pParser) { // This is called at the end of WebApplication::onHeaders(). It puts an item // on the write queue and signals to the background thread that there's // something there. -void HttpRequest::_schedule_on_headers_complete_complete(std::shared_ptr pResponse) { +void HttpRequest::_schedule_on_headers_complete_complete( + std::shared_ptr pResponse) { ASSERT_MAIN_THREAD() debug_log("HttpRequest::_schedule_on_headers_complete_complete", LOG_DEBUG); if (pResponse) responseScheduled(); - std::function cb( - std::bind(&HttpRequest::_on_headers_complete_complete, shared_from_this(), pResponse) - ); + std::function cb( + std::bind(&HttpRequest::_on_headers_complete_complete, shared_from_this(), + pResponse)); _background_queue->push(cb); } // This is called after the user's R onHeaders() function has finished. It can // write a response, if onHeaders() wants that. It also sets a status code for // http-parser and then re-executes the parser. Runs on the background thread. -void HttpRequest::_on_headers_complete_complete(std::shared_ptr pResponse) { +void HttpRequest::_on_headers_complete_complete( + std::shared_ptr pResponse) { ASSERT_BACKGROUND_THREAD() debug_log("HttpRequest::_on_headers_complete_complete", LOG_DEBUG); int result = 0; if (pResponse) { - bool bodyExpected = hasHeader("Content-Length") || hasHeader("Transfer-Encoding"); + bool bodyExpected = + hasHeader("Content-Length") || hasHeader("Transfer-Encoding"); bool shouldKeepAlive = http_should_keep_alive(&_parser); // There are two reasons we might want to send a message and close: @@ -397,7 +382,7 @@ void HttpRequest::_on_headers_complete_complete(std::shared_ptr pR if (bodyExpected || !shouldKeepAlive) { pResponse->closeAfterWritten(); - uv_read_stop((uv_stream_t*)handle()); + uv_read_stop((uv_stream_t *)handle()); _ignoreNewData = true; } @@ -408,16 +393,14 @@ void HttpRequest::_on_headers_complete_complete(std::shared_ptr pR // here; we just want processing to terminate, which we indicate with // result = 3. result = 3; - } - else { + } else { // If the request is Expect: Continue, and the app didn't say otherwise, // then give it what it wants if (hasHeader("Expect", "100-continue")) { pResponse = std::shared_ptr( - new HttpResponse(shared_from_this(), 100, "Continue", - std::shared_ptr()), - auto_deleter_background - ); + new HttpResponse(shared_from_this(), 100, "Continue", + std::shared_ptr()), + auto_deleter_background); pResponse->writeResponse(); } } @@ -429,49 +412,42 @@ void HttpRequest::_on_headers_complete_complete(std::shared_ptr pR this->_parse_http_data_from_buffer(); } - // ============================================================================ // Message body (for POST) // ============================================================================ -int HttpRequest::_on_body(http_parser* pParser, const char* pAt, size_t length) { +int HttpRequest::_on_body(http_parser *pParser, const char *pAt, + size_t length) { ASSERT_BACKGROUND_THREAD() debug_log("HttpRequest::_on_body", LOG_DEBUG); // Copy pAt because the source data is deleted right after calling this // function. - std::shared_ptr > buf = std::make_shared >(pAt, pAt + length); + std::shared_ptr> buf = + std::make_shared>(pAt, pAt + length); std::function)> schedule_bg_callback( - std::bind(&HttpRequest::_schedule_on_body_error, shared_from_this(), std::placeholders::_1) - ); + std::bind(&HttpRequest::_schedule_on_body_error, shared_from_this(), + std::placeholders::_1)); // Schedule on main thread: // _pWebApplication->onBodyData(this, pAt, length, schedule_bg_callback); - invoke_later( - std::bind( - &WebApplication::onBodyData, - _pWebApplication, - shared_from_this(), - buf, - schedule_bg_callback - ) - ); + invoke_later(std::bind(&WebApplication::onBodyData, _pWebApplication, + shared_from_this(), buf, schedule_bg_callback)); return 0; } -void HttpRequest::_schedule_on_body_error(std::shared_ptr pResponse) { +void HttpRequest::_schedule_on_body_error( + std::shared_ptr pResponse) { ASSERT_MAIN_THREAD() debug_log("HttpRequest::_schedule_on_body_error", LOG_DEBUG); responseScheduled(); - std::function cb( - std::bind(&HttpRequest::_on_body_error, shared_from_this(), pResponse) - ); + std::function cb( + std::bind(&HttpRequest::_on_body_error, shared_from_this(), pResponse)); _background_queue->push(cb); - } void HttpRequest::_on_body_error(std::shared_ptr pResponse) { @@ -481,18 +457,17 @@ void HttpRequest::_on_body_error(std::shared_ptr pResponse) { http_parser_pause(&_parser, 1); pResponse->closeAfterWritten(); - uv_read_stop((uv_stream_t*)handle()); + uv_read_stop((uv_stream_t *)handle()); _ignoreNewData = true; pResponse->writeResponse(); } - // ============================================================================ // Message complete // ============================================================================ -int HttpRequest::_on_message_complete(http_parser* pParser) { +int HttpRequest::_on_message_complete(http_parser *pParser) { ASSERT_BACKGROUND_THREAD() debug_log("HttpRequest::_on_message_complete", LOG_DEBUG); @@ -500,38 +475,34 @@ int HttpRequest::_on_message_complete(http_parser* pParser) { return 0; std::function)> schedule_bg_callback( - std::bind(&HttpRequest::_schedule_on_message_complete_complete, shared_from_this(), std::placeholders::_1) - ); - - // Use later to schedule _pWebApplication->getResponse(this, schedule_bg_callback) - // to run on the main thread. That function in turn calls - // this->_schedule_on_message_complete_complete. - invoke_later( - std::bind( - &WebApplication::getResponse, - _pWebApplication, - shared_from_this(), - schedule_bg_callback - ) - ); + std::bind(&HttpRequest::_schedule_on_message_complete_complete, + shared_from_this(), std::placeholders::_1)); + + // Use later to schedule _pWebApplication->getResponse(this, + // schedule_bg_callback) to run on the main thread. That function in turn + // calls this->_schedule_on_message_complete_complete. + invoke_later(std::bind(&WebApplication::getResponse, _pWebApplication, + shared_from_this(), schedule_bg_callback)); return 0; } // This is called by the user's application code during or after the end of // WebApplication::getResponse(). It puts an item on the background queue. -void HttpRequest::_schedule_on_message_complete_complete(std::shared_ptr pResponse) { +void HttpRequest::_schedule_on_message_complete_complete( + std::shared_ptr pResponse) { ASSERT_MAIN_THREAD() responseScheduled(); - std::function cb( - std::bind(&HttpRequest::_on_message_complete_complete, shared_from_this(), pResponse) - ); + std::function cb( + std::bind(&HttpRequest::_on_message_complete_complete, shared_from_this(), + pResponse)); _background_queue->push(cb); } -void HttpRequest::_on_message_complete_complete(std::shared_ptr pResponse) { +void HttpRequest::_on_message_complete_complete( + std::shared_ptr pResponse) { ASSERT_BACKGROUND_THREAD() debug_log("HttpRequest::_on_message_complete_complete", LOG_DEBUG); @@ -548,7 +519,7 @@ void HttpRequest::_on_message_complete_complete(std::shared_ptr pR if (!http_should_keep_alive(&_parser)) { pResponse->closeAfterWritten(); - uv_read_stop((uv_stream_t*)handle()); + uv_read_stop((uv_stream_t *)handle()); _ignoreNewData = true; } @@ -556,23 +527,22 @@ void HttpRequest::_on_message_complete_complete(std::shared_ptr pR pResponse->writeResponse(); } - // ============================================================================ // Incoming websocket messages // ============================================================================ // Called from WebSocketConnection::onFrameComplete -void HttpRequest::onWSMessage(bool binary, const char* data, size_t len) { +void HttpRequest::onWSMessage(bool binary, const char *data, size_t len) { ASSERT_BACKGROUND_THREAD() debug_log("HttpRequest::onWSMessage", LOG_DEBUG); // Copy data because the source data is deleted right after calling this // function. - std::shared_ptr > buf = std::make_shared >(data, data + len); + std::shared_ptr> buf = + std::make_shared>(data, data + len); - std::function error_callback( - std::bind(&HttpRequest::schedule_close, shared_from_this()) - ); + std::function error_callback( + std::bind(&HttpRequest::schedule_close, shared_from_this())); std::shared_ptr p_wsc = _pWebSocketConnection; // It's possible for _pWebSocketConnection to have had its refcount drop to @@ -584,16 +554,8 @@ void HttpRequest::onWSMessage(bool binary, const char* data, size_t len) { // Schedule: // _pWebApplication->onWSMessage(p_wsc, binary, data, len); - invoke_later( - std::bind( - &WebApplication::onWSMessage, - _pWebApplication, - p_wsc, - binary, - buf, - error_callback - ) - ); + invoke_later(std::bind(&WebApplication::onWSMessage, _pWebApplication, p_wsc, + binary, buf, error_callback)); } void HttpRequest::onWSClose(int code) { @@ -607,40 +569,42 @@ void HttpRequest::onWSClose(int code) { typedef struct { uv_write_t writeReq; - std::vector* pHeader; - std::vector* pData; - std::vector* pFooter; + std::vector *pHeader; + std::vector *pData; + std::vector *pFooter; } ws_send_t; -void on_ws_message_sent(uv_write_t* handle, int status) { +void on_ws_message_sent(uv_write_t *handle, int status) { ASSERT_BACKGROUND_THREAD() debug_log("on_ws_message_sent", LOG_DEBUG); // TODO: Handle error if status != 0 - ws_send_t* pSend = (ws_send_t*)handle; + ws_send_t *pSend = (ws_send_t *)handle; delete pSend->pHeader; delete pSend->pData; delete pSend->pFooter; free(pSend); } -void HttpRequest::sendWSFrame(const char* pHeader, size_t headerSize, - const char* pData, size_t dataSize, - const char* pFooter, size_t footerSize) { +void HttpRequest::sendWSFrame(const char *pHeader, size_t headerSize, + const char *pData, size_t dataSize, + const char *pFooter, size_t footerSize) { ASSERT_BACKGROUND_THREAD() debug_log("HttpRequest::sendWSFrame", LOG_DEBUG); - ws_send_t* pSend = (ws_send_t*)malloc(sizeof(ws_send_t)); + ws_send_t *pSend = (ws_send_t *)malloc(sizeof(ws_send_t)); memset(pSend, 0, sizeof(ws_send_t)); pSend->pHeader = new std::vector(pHeader, pHeader + headerSize); pSend->pData = new std::vector(pData, pData + dataSize); pSend->pFooter = new std::vector(pFooter, pFooter + footerSize); uv_buf_t buffers[3]; - buffers[0] = uv_buf_init(safe_vec_addr(*pSend->pHeader), pSend->pHeader->size()); + buffers[0] = + uv_buf_init(safe_vec_addr(*pSend->pHeader), pSend->pHeader->size()); buffers[1] = uv_buf_init(safe_vec_addr(*pSend->pData), pSend->pData->size()); - buffers[2] = uv_buf_init(safe_vec_addr(*pSend->pFooter), pSend->pFooter->size()); + buffers[2] = + uv_buf_init(safe_vec_addr(*pSend->pFooter), pSend->pFooter->size()); // TODO: Handle return code - uv_write(&pSend->writeReq, (uv_stream_t*)handle(), buffers, 3, + uv_write(&pSend->writeReq, (uv_stream_t *)handle(), buffers, 3, &on_ws_message_sent); } @@ -649,12 +613,11 @@ void HttpRequest::closeWSSocket() { close(); } - // ============================================================================ // Closing connection // ============================================================================ -void HttpRequest::_on_closed(uv_handle_t* handle) { +void HttpRequest::_on_closed(uv_handle_t *handle) { ASSERT_BACKGROUND_THREAD() debug_log("HttpRequest::_on_closed", LOG_DEBUG); @@ -697,12 +660,7 @@ void HttpRequest::close() { // Schedule: // _pWebApplication->onWSClose(p_wsc) invoke_later( - std::bind( - &WebApplication::onWSClose, - _pWebApplication, - p_wsc - ) - ); + std::bind(&WebApplication::onWSClose, _pWebApplication, p_wsc)); } _pSocket->removeConnection(shared_from_this()); @@ -717,12 +675,9 @@ void HttpRequest::schedule_close() { debug_log("HttpRequest::schedule_close", LOG_DEBUG); // Schedule on background thread: // pRequest->close() - _background_queue->push( - std::bind(&HttpRequest::close, shared_from_this()) - ); + _background_queue->push(std::bind(&HttpRequest::close, shared_from_this())); } - // ============================================================================ // Open websocket // ============================================================================ @@ -731,9 +686,8 @@ void HttpRequest::_call_r_on_ws_open() { ASSERT_MAIN_THREAD() debug_log("HttpRequest::_call_r_on_ws_open", LOG_DEBUG); - std::function error_callback( - std::bind(&HttpRequest::schedule_close, shared_from_this()) - ); + std::function error_callback( + std::bind(&HttpRequest::schedule_close, shared_from_this())); this->_pWebApplication->onWSOpen(shared_from_this(), error_callback); @@ -748,29 +702,24 @@ void HttpRequest::_call_r_on_ws_open() { // _requestBuffer is likely empty at this point, but copy its contents and // _pass along just in case. - std::shared_ptr > req_buffer = std::make_shared >(_requestBuffer); + std::shared_ptr> req_buffer = + std::make_shared>(_requestBuffer); _requestBuffer.clear(); - // Schedule on background thread: // p_wsc->read(safe_vec_addr(*req_buffer), req_buffer->size()) - std::function cb( - std::bind(&WebSocketConnection::read, - p_wsc, - safe_vec_addr(*req_buffer), - req_buffer->size() - ) - ); + std::function cb(std::bind(&WebSocketConnection::read, p_wsc, + safe_vec_addr(*req_buffer), + req_buffer->size())); _background_queue->push(cb); } - // ============================================================================ // Parse incoming data // ============================================================================ -void HttpRequest::_parse_http_data(char* buffer, const ssize_t n) { +void HttpRequest::_parse_http_data(char *buffer, const ssize_t n) { ASSERT_BACKGROUND_THREAD() int parsed = http_parser_execute(&_parser, &request_settings(), buffer, n); @@ -780,7 +729,7 @@ void HttpRequest::_parse_http_data(char* buffer, const ssize_t n) { _requestBuffer.insert(_requestBuffer.end(), buffer + parsed, buffer + n); } else if (isUpgrade()) { - char* pData = buffer + parsed; + char *pData = buffer + parsed; size_t pDataLen = n - parsed; std::shared_ptr p_wsc = _pWebSocketConnection; @@ -793,15 +742,15 @@ void HttpRequest::_parse_http_data(char* buffer, const ssize_t n) { if (p_wsc->accept(_headers, pData, pDataLen)) { // Freed in on_response_written - std::shared_ptrpDS = std::make_shared(); + std::shared_ptr pDS = + std::make_shared(); std::shared_ptr pResp( - new HttpResponse(shared_from_this(), 101, "Switching Protocols", pDS), - auto_deleter_background - ); + new HttpResponse(shared_from_this(), 101, "Switching Protocols", pDS), + auto_deleter_background); std::vector body; - p_wsc->handshake(_url, _headers, &pData, &pDataLen, - &pResp->headers(), &body); + p_wsc->handshake(_url, _headers, &pData, &pDataLen, &pResp->headers(), + &body); if (body.size() > 0) { pDS->add(body); } @@ -816,8 +765,7 @@ void HttpRequest::_parse_http_data(char* buffer, const ssize_t n) { // Schedule on main thread: // this->_call_r_on_ws_open() invoke_later( - std::bind(&HttpRequest::_call_r_on_ws_open, shared_from_this()) - ); + std::bind(&HttpRequest::_call_r_on_ws_open, shared_from_this())); } if (_protocol != WebSockets) { @@ -826,12 +774,10 @@ void HttpRequest::_parse_http_data(char* buffer, const ssize_t n) { } } else if (parsed < n) { if (!_ignoreNewData) { - debug_log( - std::string("HttpRequest::_parse_http_data error: ") + - http_errno_description(HTTP_PARSER_ERRNO(&_parser)), - LOG_INFO - ); - uv_read_stop((uv_stream_t*)handle()); + debug_log(std::string("HttpRequest::_parse_http_data error: ") + + http_errno_description(HTTP_PARSER_ERRNO(&_parser)), + LOG_INFO); + uv_read_stop((uv_stream_t *)handle()); close(); } } @@ -847,10 +793,11 @@ void HttpRequest::_parse_http_data_from_buffer() { this->_parse_http_data(safe_vec_addr(req_buffer), req_buffer.size()); } -void HttpRequest::_on_request_read(uv_stream_t*, ssize_t nread, const uv_buf_t* buf) { +void HttpRequest::_on_request_read(uv_stream_t *, ssize_t nread, + const uv_buf_t *buf) { ASSERT_BACKGROUND_THREAD() if (nread > 0) { - //std::cerr << nread << " bytes read\n"; + // std::cerr << nread << " bytes read\n"; if (_ignoreNewData) { // Do nothing } else if (_protocol == HTTP) { @@ -858,8 +805,8 @@ void HttpRequest::_on_request_read(uv_stream_t*, ssize_t nread, const uv_buf_t* } else if (_protocol == WebSockets) { std::shared_ptr p_wsc = _pWebSocketConnection; - // It's possible for _pWebSocketConnection to have had its refcount drop to - // zero from another thread or earlier callback in this thread. If that + // It's possible for _pWebSocketConnection to have had its refcount drop + // to zero from another thread or earlier callback in this thread. If that // happened, do nothing. if (p_wsc) { p_wsc->read(buf->base, nread); @@ -868,11 +815,9 @@ void HttpRequest::_on_request_read(uv_stream_t*, ssize_t nread, const uv_buf_t* } else if (nread < 0) { if (nread == UV_EOF || nread == UV_ECONNRESET) { } else { - debug_log( - std::string("HttpRequest::on_request_read error: ") + - uv_strerror(nread), - LOG_INFO - ); + debug_log(std::string("HttpRequest::on_request_read error: ") + + uv_strerror(nread), + LOG_INFO); } close(); } else { @@ -887,36 +832,40 @@ void HttpRequest::handleRequest() { ASSERT_BACKGROUND_THREAD() int r = uv_read_start(handle(), &on_alloc, &HttpRequest_on_request_read); if (r) { - debug_log( - std::string("HttpRequest::handlRequest error: [uv_read_start] ") + - uv_strerror(r), - LOG_INFO - ); + debug_log(std::string("HttpRequest::handlRequest error: [uv_read_start] ") + + uv_strerror(r), + LOG_INFO); return; } } - -#define IMPLEMENT_CALLBACK_1(type, function_name, return_type, type_1) \ - return_type type##_##function_name(type_1 arg1) { \ - return ((type*)(arg1->data))->_##function_name(arg1); \ +#define IMPLEMENT_CALLBACK_1(type, function_name, return_type, type_1) \ + return_type type##_##function_name(type_1 arg1) { \ + return ((type *)(arg1->data))->_##function_name(arg1); \ } #define IMPLEMENT_CALLBACK_2(type, function_name, return_type, type_1, type_2) \ - return_type type##_##function_name(type_1 arg1, type_2 arg2) { \ - return ((type*)(arg1->data))->_##function_name(arg1, arg2); \ + return_type type##_##function_name(type_1 arg1, type_2 arg2) { \ + return ((type *)(arg1->data))->_##function_name(arg1, arg2); \ } -#define IMPLEMENT_CALLBACK_3(type, function_name, return_type, type_1, type_2, type_3) \ - return_type type##_##function_name(type_1 arg1, type_2 arg2, type_3 arg3) { \ - return ((type*)(arg1->data))->_##function_name(arg1, arg2, arg3); \ +#define IMPLEMENT_CALLBACK_3(type, function_name, return_type, type_1, type_2, \ + type_3) \ + return_type type##_##function_name(type_1 arg1, type_2 arg2, type_3 arg3) { \ + return ((type *)(arg1->data))->_##function_name(arg1, arg2, arg3); \ } -IMPLEMENT_CALLBACK_1(HttpRequest, on_message_begin, int, http_parser*) -IMPLEMENT_CALLBACK_3(HttpRequest, on_url, int, http_parser*, const char*, size_t) -IMPLEMENT_CALLBACK_3(HttpRequest, on_status, int, http_parser*, const char*, size_t) -IMPLEMENT_CALLBACK_3(HttpRequest, on_header_field, int, http_parser*, const char*, size_t) -IMPLEMENT_CALLBACK_3(HttpRequest, on_header_value, int, http_parser*, const char*, size_t) -IMPLEMENT_CALLBACK_1(HttpRequest, on_headers_complete, int, http_parser*) -IMPLEMENT_CALLBACK_3(HttpRequest, on_body, int, http_parser*, const char*, size_t) -IMPLEMENT_CALLBACK_1(HttpRequest, on_message_complete, int, http_parser*) -IMPLEMENT_CALLBACK_1(HttpRequest, on_closed, void, uv_handle_t*) -IMPLEMENT_CALLBACK_3(HttpRequest, on_request_read, void, uv_stream_t*, ssize_t, const uv_buf_t*) +IMPLEMENT_CALLBACK_1(HttpRequest, on_message_begin, int, http_parser *) +IMPLEMENT_CALLBACK_3(HttpRequest, on_url, int, http_parser *, const char *, + size_t) +IMPLEMENT_CALLBACK_3(HttpRequest, on_status, int, http_parser *, const char *, + size_t) +IMPLEMENT_CALLBACK_3(HttpRequest, on_header_field, int, http_parser *, + const char *, size_t) +IMPLEMENT_CALLBACK_3(HttpRequest, on_header_value, int, http_parser *, + const char *, size_t) +IMPLEMENT_CALLBACK_1(HttpRequest, on_headers_complete, int, http_parser *) +IMPLEMENT_CALLBACK_3(HttpRequest, on_body, int, http_parser *, const char *, + size_t) +IMPLEMENT_CALLBACK_1(HttpRequest, on_message_complete, int, http_parser *) +IMPLEMENT_CALLBACK_1(HttpRequest, on_closed, void, uv_handle_t *) +IMPLEMENT_CALLBACK_3(HttpRequest, on_request_read, void, uv_stream_t *, ssize_t, + const uv_buf_t *) diff --git a/src/httprequest.h b/src/httprequest.h index 543e4baa5..e101c0d78 100644 --- a/src/httprequest.h +++ b/src/httprequest.h @@ -1,33 +1,29 @@ #ifndef HTTPREQUEST_HPP #define HTTPREQUEST_HPP -#include #include +#include -#include -#include -#include -#include "http-parser/http_parser.h" -#include "socket.h" -#include "webapplication.h" +#include "auto_deleter.h" #include "callbackqueue.h" +#include "http-parser/http_parser.h" #include "httpresponse.h" -#include "utils.h" +#include "socket.h" #include "thread.h" -#include "auto_deleter.h" +#include "utils.h" +#include "webapplication.h" +#include +#include +#include -enum Protocol { - HTTP, - WebSockets -}; +enum Protocol { HTTP, WebSockets }; // HttpRequest is a bit of a misnomer -- a HttpRequest object represents a // single connection, on which multiple actual HTTP requests can be made. class HttpRequest : public WebSocketConnectionCallbacks, - public std::enable_shared_from_this -{ + public std::enable_shared_from_this { private: - uv_loop_t* _pLoop; + uv_loop_t *_pLoop; std::shared_ptr _pWebApplication; VariantHandle _handle; std::shared_ptr _pSocket; @@ -38,13 +34,13 @@ class HttpRequest : public WebSocketConnectionCallbacks, std::string _lastHeaderField; std::shared_ptr _pWebSocketConnection; - // `_env` is an shared_ptr instead of an Environment because it + // `_env` is an shared_ptr instead of an environment because it // must be created and deleted on the main thread. However, the creation and // deletion of HttpRequest objects happens on the background thread, and so - // the lifetime of the Environment can't be strictly tied to the lifetime of + // the lifetime of the environment can't be strictly tied to the lifetime of // the HttpRequest. It is instantiated with a deleter function that ensures // deletion happens on the main thread. - std::shared_ptr _env; + std::shared_ptr _env; void _newRequest(); void _initializeEnv(); @@ -62,7 +58,7 @@ class HttpRequest : public WebSocketConnectionCallbacks, // true after the headers are complete. bool _is_upgrade; - void _parse_http_data(char* buf, const ssize_t n); + void _parse_http_data(char *buf, const ssize_t n); // Parse data that has been stored in the buffer. void _parse_http_data_from_buffer(); @@ -78,36 +74,22 @@ class HttpRequest : public WebSocketConnectionCallbacks, // Most of the methods in HttpRequest run on a background thread. Some // methods run on the main thread. This is used by the main-thread methods // to schedule callbacks to run on the background thread. - CallbackQueue* _background_queue; + CallbackQueue *_background_queue; // Used to keep track of state when parsing headers. This is needed because // sometimes the header fields and values can be split across multiple TCP // messages, resulting in multiple calls to _on_header_field or // _on_header_value. - enum LastHeaderState - { - START, - FIELD, - VALUE - }; + enum LastHeaderState { START, FIELD, VALUE }; LastHeaderState _last_header_state; public: - HttpRequest(uv_loop_t* pLoop, - std::shared_ptr pWebApplication, - std::shared_ptr pSocket, - CallbackQueue* backgroundQueue) - : _pLoop(pLoop), - _pWebApplication(pWebApplication), - _pSocket(pSocket), - _protocol(HTTP), - _ignoreNewData(false), - _is_closing(false), - _is_upgrade(false), - _response_scheduled(false), - _handling_request(false), - _background_queue(backgroundQueue) - { + HttpRequest(uv_loop_t *pLoop, std::shared_ptr pWebApplication, + std::shared_ptr pSocket, CallbackQueue *backgroundQueue) + : _pLoop(pLoop), _pWebApplication(pWebApplication), _pSocket(pSocket), + _protocol(HTTP), _ignoreNewData(false), _is_closing(false), + _is_upgrade(false), _response_scheduled(false), + _handling_request(false), _background_queue(backgroundQueue) { ASSERT_BACKGROUND_THREAD() uv_tcp_init(pLoop, &_handle.tcp); _handle.isTcp = true; @@ -127,30 +109,30 @@ class HttpRequest : public WebSocketConnectionCallbacks, _pWebSocketConnection.reset(); } - uv_stream_t* handle(); + uv_stream_t *handle(); std::shared_ptr websocket() const { return _pWebSocketConnection; } Address clientAddress(); Address serverAddress(); - Rcpp::Environment& env(); + environment &env(); void handleRequest(); std::string method() const; std::string url() const; - const RequestHeaders& headers() const; + const RequestHeaders &headers() const; - bool hasHeader(const std::string& name) const; - bool hasHeader(const std::string& name, const std::string& value, bool ci = false) const; - std::string getHeader(const std::string& name) const; + bool hasHeader(const std::string &name) const; + bool hasHeader(const std::string &name, const std::string &value, + bool ci = false) const; + std::string getHeader(const std::string &name) const; // Is the request an Upgrade (i.e. WebSocket connection)? bool isUpgrade() const; - void sendWSFrame(const char* pHeader, size_t headerSize, - const char* pData, size_t dataSize, - const char* pFooter, size_t footerSize); + void sendWSFrame(const char *pHeader, size_t headerSize, const char *pData, + size_t dataSize, const char *pFooter, size_t footerSize); void closeWSSocket(); // Call this function from the main thread to indicate that a response has @@ -167,95 +149,98 @@ class HttpRequest : public WebSocketConnectionCallbacks, void requestCompleted(); void _call_r_on_ws_open(); - void _schedule_on_headers_complete_complete(std::shared_ptr pResponse); + void _schedule_on_headers_complete_complete( + std::shared_ptr pResponse); void _on_headers_complete_complete(std::shared_ptr pResponse); void _schedule_on_body_error(std::shared_ptr pResponse); void _on_body_error(std::shared_ptr pResponse); - void _schedule_on_message_complete_complete(std::shared_ptr pResponse); + void _schedule_on_message_complete_complete( + std::shared_ptr pResponse); void _on_message_complete_complete(std::shared_ptr pResponse); public: // Callbacks - virtual int _on_message_begin(http_parser* pParser); - virtual int _on_url(http_parser* pParser, const char* pAt, size_t length); - virtual int _on_status(http_parser* pParser, const char* pAt, size_t length); - virtual int _on_header_field(http_parser* pParser, const char* pAt, size_t length); - virtual int _on_header_value(http_parser* pParser, const char* pAt, size_t length); - virtual int _on_headers_complete(http_parser* pParser); - virtual int _on_body(http_parser* pParser, const char* pAt, size_t length); - virtual int _on_message_complete(http_parser* pParser); - - virtual void onWSMessage(bool binary, const char* data, size_t len); + virtual int _on_message_begin(http_parser *pParser); + virtual int _on_url(http_parser *pParser, const char *pAt, size_t length); + virtual int _on_status(http_parser *pParser, const char *pAt, size_t length); + virtual int _on_header_field(http_parser *pParser, const char *pAt, + size_t length); + virtual int _on_header_value(http_parser *pParser, const char *pAt, + size_t length); + virtual int _on_headers_complete(http_parser *pParser); + virtual int _on_body(http_parser *pParser, const char *pAt, size_t length); + virtual int _on_message_complete(http_parser *pParser); + + virtual void onWSMessage(bool binary, const char *data, size_t len); virtual void onWSClose(int code); // Update whether or not this HttpRequest is to be upgraded. This is called // from _on_headers_complete(). void updateUpgradeStatus(); - void _on_closed(uv_handle_t* handle); + void _on_closed(uv_handle_t *handle); void close(); void schedule_close(); - void _on_request_read(uv_stream_t*, ssize_t nread, const uv_buf_t* buf); + void _on_request_read(uv_stream_t *, ssize_t nread, const uv_buf_t *buf); void _on_response_write(int status); void _initializeSocket() { // Coerce to parent class std::shared_ptr this_base( - std::static_pointer_cast(shared_from_this()) - ); + std::static_pointer_cast( + shared_from_this())); _pWebSocketConnection = std::shared_ptr( - new WebSocketConnection(this->_pLoop, this_base), - auto_deleter_background - ); + new WebSocketConnection(this->_pLoop, this_base), + auto_deleter_background); _pSocket->addConnection(shared_from_this()); } }; - // Same for Websocketconnection // Factory function needed because we can't call shared_from_this() inside the // constructor. inline std::shared_ptr createHttpRequest( - uv_loop_t* pLoop, - std::shared_ptr pWebApplication, - std::shared_ptr pSocket, - CallbackQueue* backgroundQueue) -{ + uv_loop_t *pLoop, std::shared_ptr pWebApplication, + std::shared_ptr pSocket, CallbackQueue *backgroundQueue) { ASSERT_BACKGROUND_THREAD() // The shared_ptr has a custom deleter which ensures that the HttpRequest is // deleted on the background thread. std::shared_ptr req( - new HttpRequest(pLoop, pWebApplication, pSocket, backgroundQueue), - auto_deleter_background - ); + new HttpRequest(pLoop, pWebApplication, pSocket, backgroundQueue), + auto_deleter_background); req->_initializeSocket(); return req; } - -#define DECLARE_CALLBACK_1(type, function_name, return_type, type_1) \ +#define DECLARE_CALLBACK_1(type, function_name, return_type, type_1) \ return_type type##_##function_name(type_1 arg1); -#define DECLARE_CALLBACK_3(type, function_name, return_type, type_1, type_2, type_3) \ +#define DECLARE_CALLBACK_3(type, function_name, return_type, type_1, type_2, \ + type_3) \ return_type type##_##function_name(type_1 arg1, type_2 arg2, type_3 arg3); -#define DECLARE_CALLBACK_2(type, function_name, return_type, type_1, type_2) \ +#define DECLARE_CALLBACK_2(type, function_name, return_type, type_1, type_2) \ return_type type##_##function_name(type_1 arg1, type_2 arg2); -DECLARE_CALLBACK_1(HttpRequest, on_message_begin, int, http_parser*) -DECLARE_CALLBACK_3(HttpRequest, on_url, int, http_parser*, const char*, size_t) -DECLARE_CALLBACK_3(HttpRequest, on_status, int, http_parser*, const char*, size_t) -DECLARE_CALLBACK_3(HttpRequest, on_header_field, int, http_parser*, const char*, size_t) -DECLARE_CALLBACK_3(HttpRequest, on_header_value, int, http_parser*, const char*, size_t) -DECLARE_CALLBACK_1(HttpRequest, on_headers_complete, int, http_parser*) -DECLARE_CALLBACK_3(HttpRequest, on_body, int, http_parser*, const char*, size_t) -DECLARE_CALLBACK_1(HttpRequest, on_message_complete, int, http_parser*) -DECLARE_CALLBACK_1(HttpRequest, on_closed, void, uv_handle_t*) -DECLARE_CALLBACK_3(HttpRequest, on_request_read, void, uv_stream_t*, ssize_t, const uv_buf_t*) -DECLARE_CALLBACK_2(HttpRequest, on_response_write, void, uv_write_t*, int) - +DECLARE_CALLBACK_1(HttpRequest, on_message_begin, int, http_parser *) +DECLARE_CALLBACK_3(HttpRequest, on_url, int, http_parser *, const char *, + size_t) +DECLARE_CALLBACK_3(HttpRequest, on_status, int, http_parser *, const char *, + size_t) +DECLARE_CALLBACK_3(HttpRequest, on_header_field, int, http_parser *, + const char *, size_t) +DECLARE_CALLBACK_3(HttpRequest, on_header_value, int, http_parser *, + const char *, size_t) +DECLARE_CALLBACK_1(HttpRequest, on_headers_complete, int, http_parser *) +DECLARE_CALLBACK_3(HttpRequest, on_body, int, http_parser *, const char *, + size_t) +DECLARE_CALLBACK_1(HttpRequest, on_message_complete, int, http_parser *) +DECLARE_CALLBACK_1(HttpRequest, on_closed, void, uv_handle_t *) +DECLARE_CALLBACK_3(HttpRequest, on_request_read, void, uv_stream_t *, ssize_t, + const uv_buf_t *) +DECLARE_CALLBACK_2(HttpRequest, on_response_write, void, uv_write_t *, int) #endif // HTTPREQUEST_HPP diff --git a/src/httpresponse.cpp b/src/httpresponse.cpp index c2a1c0870..168740c91 100644 --- a/src/httpresponse.cpp +++ b/src/httpresponse.cpp @@ -1,36 +1,35 @@ #include "httpresponse.h" -#include "httprequest.h" #include "constants.h" +#include "gzipdatasource.h" +#include "httprequest.h" #include "thread.h" #include "utils.h" -#include "gzipdatasource.h" #include - -void on_response_written(uv_write_t* handle, int status) { +void on_response_written(uv_write_t *handle, int status) { ASSERT_BACKGROUND_THREAD() // Make a local copy of the shared_ptr before deleting the original one. - std::shared_ptr pResponse(*(std::shared_ptr*)handle->data); + std::shared_ptr pResponse( + *(std::shared_ptr *)handle->data); - delete (std::shared_ptr*)handle->data; + delete (std::shared_ptr *)handle->data; free(handle); pResponse->onResponseWritten(status); } +ResponseHeaders &HttpResponse::headers() { return _headers; } -ResponseHeaders& HttpResponse::headers() { - return _headers; -} - -void HttpResponse::addHeader(const std::string& name, const std::string& value) { +void HttpResponse::addHeader(const std::string &name, + const std::string &value) { _headers.push_back(std::pair(name, value)); } // Set a header to a particular value. If the header already exists, delete // it, and add the header with the new value. The new header will be the last // item. -void HttpResponse::setHeader(const std::string& name, const std::string& value) { +void HttpResponse::setHeader(const std::string &name, + const std::string &value) { // Look for existing header with same name, and delete if present ResponseHeaders::iterator it = _headers.begin(); while (it != _headers.end()) { @@ -46,16 +45,15 @@ void HttpResponse::setHeader(const std::string& name, const std::string& value) class HttpResponseExtendedWrite : public ExtendedWrite { std::shared_ptr _pParent; + public: HttpResponseExtendedWrite(std::shared_ptr pParent, - uv_stream_t* pHandle, + uv_stream_t *pHandle, std::shared_ptr pDataSource, - bool chunked) : - ExtendedWrite(pHandle, pDataSource, chunked), _pParent(pParent) {} + bool chunked) + : ExtendedWrite(pHandle, pDataSource, chunked), _pParent(pParent) {} - void onWriteComplete(int status) { - delete this; - } + void onWriteComplete(int status) { delete this; } }; void HttpResponse::writeResponse() { @@ -67,8 +65,7 @@ void HttpResponse::writeResponse() { bool contentEncoding = false; std::string contentLength; for (ResponseHeaders::const_iterator it = _headers.begin(); - it != _headers.end(); - it++) { + it != _headers.end(); it++) { if (strcasecmp(it->first.c_str(), "Content-Length") == 0) { contentLength = it->second; } else { @@ -132,29 +129,32 @@ void HttpResponse::writeResponse() { // For Hixie-76 and HyBi-03, it's important that the body be sent immediately, // before any WebSocket traffic is sent from the server - if (_statusCode == 101 && _pBody != NULL && _pBody->size() > 0 && _pBody->size() < 256) { + if (_statusCode == 101 && _pBody != NULL && _pBody->size() > 0 && + _pBody->size() < 256) { uv_buf_t buffer = _pBody->getData(_pBody->size()); if (buffer.len > 0) { _responseHeader.reserve(_responseHeader.size() + buffer.len); } - _responseHeader.insert(_responseHeader.end(), buffer.base, buffer.base + buffer.len); + _responseHeader.insert(_responseHeader.end(), buffer.base, + buffer.base + buffer.len); if (buffer.len == _pBody->size()) { // We used up the body, kill it _pBody.reset(); } } - uv_buf_t headerBuf = uv_buf_init(safe_vec_addr(_responseHeader), _responseHeader.size()); - uv_write_t* pWriteReq = (uv_write_t*)malloc(sizeof(uv_write_t)); + uv_buf_t headerBuf = + uv_buf_init(safe_vec_addr(_responseHeader), _responseHeader.size()); + uv_write_t *pWriteReq = (uv_write_t *)malloc(sizeof(uv_write_t)); memset(pWriteReq, 0, sizeof(uv_write_t)); // Pointer to shared_ptr pWriteReq->data = new std::shared_ptr(shared_from_this()); int r = uv_write(pWriteReq, _pRequest->handle(), &headerBuf, 1, - &on_response_written); + &on_response_written); if (r) { debug_log(std::string("uv_write() error:") + uv_strerror(r), LOG_INFO); - delete (std::shared_ptr*)pWriteReq->data; + delete (std::shared_ptr *)pWriteReq->data; free(pWriteReq); } else { _pRequest->requestCompleted(); @@ -171,8 +171,8 @@ void HttpResponse::onResponseWritten(int status) { } if (_pBody != NULL) { - HttpResponseExtendedWrite* pResponseWrite = new HttpResponseExtendedWrite( - shared_from_this(), _pRequest->handle(), _pBody, this->_chunked); + HttpResponseExtendedWrite *pResponseWrite = new HttpResponseExtendedWrite( + shared_from_this(), _pRequest->handle(), _pBody, this->_chunked); pResponseWrite->begin(); } } diff --git a/src/httpresponse.h b/src/httpresponse.h index ed7b78f96..e09cd6b3b 100644 --- a/src/httpresponse.h +++ b/src/httpresponse.h @@ -1,15 +1,15 @@ #ifndef HTTPRESPONSE_HPP #define HTTPRESPONSE_HPP +#include "constants.h" +#include "utils.h" +#include "uvutil.h" #include #include -#include "uvutil.h" -#include "utils.h" -#include "constants.h" class HttpRequest; -class HttpResponse : public std::enable_shared_from_this { +class HttpResponse : public std::enable_shared_from_this { std::shared_ptr _pRequest; int _statusCode; @@ -21,25 +21,18 @@ class HttpResponse : public std::enable_shared_from_this { bool _chunked; public: - HttpResponse(std::shared_ptr pRequest, - int statusCode, - const std::string& status, - std::shared_ptr pBody) - : _pRequest(pRequest), - _statusCode(statusCode), - _status(status), - _pBody(pBody), - _closeAfterWritten(false), - _chunked(false) - { + HttpResponse(std::shared_ptr pRequest, int statusCode, + const std::string &status, std::shared_ptr pBody) + : _pRequest(pRequest), _statusCode(statusCode), _status(status), + _pBody(pBody), _closeAfterWritten(false), _chunked(false) { _headers.push_back(std::make_pair("Date", http_date_string(time(NULL)))); } ~HttpResponse(); - ResponseHeaders& headers(); + ResponseHeaders &headers(); - void addHeader(const std::string& name, const std::string& value); - void setHeader(const std::string& name, const std::string& value); + void addHeader(const std::string &name, const std::string &value); + void setHeader(const std::string &name, const std::string &value); void writeResponse(); void onResponseWritten(int status); void closeAfterWritten(); diff --git a/src/httpuv.cpp b/src/httpuv.cpp index 25963b1d9..fa20815ed 100644 --- a/src/httpuv.cpp +++ b/src/httpuv.cpp @@ -1,44 +1,44 @@ #define _FILE_OFFSET_BITS 64 -#include -#include -#include -#include -#include -#include -#include -#include -#include "base64/base64.hpp" -#include "uvutil.h" -#include "webapplication.h" -#include "http.h" -#include "callbackqueue.h" -#include "utils.h" -#include "thread.h" #include "httpuv.h" #include "auto_deleter.h" +#include "base64/base64.hpp" +#include "callbackqueue.h" +#include "http.h" #include "socket.h" +#include "thread.h" +#include "utils.h" +#include "uvutil.h" +#include "webapplication.h" #include +#include +#include +#include +#include +#include +#include +#include +#include +#include "cpp11.hpp" +#include "R.h" +#include "Rmath.h" -void throwError(int err, - const std::string& prefix = std::string(), - const std::string& suffix = std::string()) -{ +using namespace cpp11; + +void throwError(int err, const std::string &prefix = std::string(), + const std::string &suffix = std::string()) { ASSERT_MAIN_THREAD() std::string msg = prefix + uv_strerror(err) + suffix; - throw Rcpp::exception(msg.c_str()); + stop(msg); } // For keeping track of all running server apps. -std::vector pServers; - +std::vector pServers; class UVLoop { public: - UVLoop() : _initialized(false) { - uv_mutex_init(&_mutex); - }; + UVLoop() : _initialized(false) { uv_mutex_init(&_mutex); }; void ensure_initialized() { guard guard(_mutex); @@ -48,7 +48,7 @@ class UVLoop { } } - uv_loop_t* get() { + uv_loop_t *get() { guard guard(_mutex); if (!_initialized) { throw std::runtime_error("io_loop not initialized!"); @@ -74,7 +74,7 @@ class UVLoop { // A queue of tasks to run on the background thread. This is how the main // thread schedules work to be done on the background thread. -CallbackQueue* background_queue; +CallbackQueue *background_queue; uv_thread_t io_thread_id; ThreadSafe io_thread_running(false); @@ -82,7 +82,7 @@ ThreadSafe io_thread_running(false); UVLoop io_loop; uv_async_t async_stop_io_loop; -void close_handle_cb(uv_handle_t* handle, void* arg) { +void close_handle_cb(uv_handle_t *handle, void *arg) { ASSERT_BACKGROUND_THREAD() if (!uv_is_closing(handle)) { uv_close(handle, NULL); @@ -109,9 +109,10 @@ void block_sigpipe() { } #endif -void io_thread(void* data) { +void io_thread(void *data) { register_background_thread(); - std::shared_ptr* pBlocker = reinterpret_cast*>(data); + std::shared_ptr *pBlocker = + reinterpret_cast *>(data); std::shared_ptr blocker = std::shared_ptr(*pBlocker); delete pBlocker; @@ -159,117 +160,95 @@ void ensure_io_thread() { // We want to pass a copy of the shared_ptr to the new pthread. To do that, we // need to create a new shared_ptr and get the regular pointer to it. - std::shared_ptr* pBlocker = new std::shared_ptr(blocker); + std::shared_ptr *pBlocker = new std::shared_ptr(blocker); int ret = uv_thread_create(&io_thread_id, io_thread, pBlocker); // Wait for io_loop to be initialized before continuing blocker->wait(); if (ret != 0) { - Rcpp::stop(std::string("Error: ") + uv_strerror(ret)); + stop(std::string("Error: ") + uv_strerror(ret)); } } - // ============================================================================ // Outgoing websocket messages // ============================================================================ -// [[Rcpp::export]] -void sendWSMessage(SEXP conn, - bool binary, - Rcpp::RObject message) -{ +[[cpp11::register]] void sendWSMessage(SEXP conn, bool binary, SEXP message) { ASSERT_MAIN_THREAD() - Rcpp::XPtr, - Rcpp::PreserveStorage, - auto_deleter_background >, - true> conn_xptr(conn); - std::shared_ptr wsc = internalize_shared_ptr(conn_xptr); + external_pointer< + std::shared_ptr, + auto_deleter_background>> + conn_xptr(conn); + std::shared_ptr wsc = *conn_xptr; Opcode mode; SEXP msg_sexp; - std::vector* str; + std::vector *str; // Efficiently copy message into a new vector. There's probably a // cleaner way to do this. - if (binary) { + if (binary) { mode = Binary; - msg_sexp = PROTECT(Rcpp::as(message)); - str = new std::vector(RAW(msg_sexp), RAW(msg_sexp) + Rf_length(msg_sexp)); + msg_sexp = PROTECT(message); + str = new std::vector(RAW(msg_sexp), + RAW(msg_sexp) + Rf_length(msg_sexp)); UNPROTECT(1); } else { mode = Text; msg_sexp = PROTECT(STRING_ELT(message, 0)); - str = new std::vector(CHAR(msg_sexp), CHAR(msg_sexp) + Rf_length(msg_sexp)); + str = new std::vector(CHAR(msg_sexp), + CHAR(msg_sexp) + Rf_length(msg_sexp)); UNPROTECT(1); } - - std::function cb( - std::bind(&WebSocketConnection::sendWSMessage, wsc, - mode, - safe_vec_addr(*str), - str->size() - ) - ); + std::function cb(std::bind(&WebSocketConnection::sendWSMessage, + wsc, mode, safe_vec_addr(*str), + str->size())); background_queue->push(cb); // Free str after data is written // deleter_background>(str) - background_queue->push(std::bind(deleter_background >, str)); + background_queue->push(std::bind(deleter_background>, str)); } -// [[Rcpp::export]] -void closeWS(SEXP conn, - uint16_t code, - std::string reason) -{ +[[cpp11::register]] void closeWS(SEXP conn, uint16_t code, std::string reason) { ASSERT_MAIN_THREAD() debug_log("closeWS", LOG_DEBUG); - Rcpp::XPtr, - Rcpp::PreserveStorage, - auto_deleter_background >, - true> conn_xptr(conn); - std::shared_ptr wsc = internalize_shared_ptr(conn_xptr); + external_pointer< + std::shared_ptr, + auto_deleter_background>> + conn_xptr(conn); + std::shared_ptr wsc = *conn_xptr; // Schedule on background thread: // wsc->closeWS(code, reason); background_queue->push( - std::bind(&WebSocketConnection::closeWS, wsc, code, reason) - ); + std::bind(&WebSocketConnection::closeWS, wsc, code, reason)); } - // ============================================================================ // Create/stop servers // ============================================================================ -// [[Rcpp::export]] -Rcpp::RObject makeTcpServer(const std::string& host, int port, - Rcpp::Function onHeaders, - Rcpp::Function onBodyData, - Rcpp::Function onRequest, - Rcpp::Function onWSOpen, - Rcpp::Function onWSMessage, - Rcpp::Function onWSClose, - Rcpp::List staticPaths, - Rcpp::List staticPathOptions, - bool quiet -) { - - using namespace Rcpp; +[[cpp11::register]] SEXP makeTcpServer(const std::string &host, int port, + sexp onHeaders, function onBodyData, + function onRequest, function onWSOpen, + function onWSMessage, function onWSClose, + list staticPaths, list staticPathOptions, + bool quiet) { + register_main_thread(); // Deleted when owning pServer is deleted. If pServer creation fails, // this should be deleted when it goes out of scope. std::shared_ptr pHandler( - new RWebApplication(onHeaders, onBodyData, onRequest, - onWSOpen, onWSMessage, onWSClose, - staticPaths, staticPathOptions), - auto_deleter_main - ); + new RWebApplication(onHeaders, onBodyData, onRequest, onWSOpen, + onWSMessage, onWSClose, staticPaths, + staticPathOptions), + auto_deleter_main); ensure_io_thread(); @@ -277,7 +256,7 @@ Rcpp::RObject makeTcpServer(const std::string& host, int port, // this function, since it is passed to the background thread. std::shared_ptr blocker = std::make_shared(2); - uv_stream_t* pServer; + uv_stream_t *pServer; // Run on background thread: // createTcpServerSync( @@ -286,12 +265,9 @@ Rcpp::RObject makeTcpServer(const std::string& host, int port, // background_queue, &pServer, blocker // ); background_queue->push( - std::bind(createTcpServerSync, - io_loop.get(), host.c_str(), port, - std::static_pointer_cast(pHandler), - quiet, background_queue, &pServer, blocker - ) - ); + std::bind(createTcpServerSync, io_loop.get(), host.c_str(), port, + std::static_pointer_cast(pHandler), quiet, + background_queue, &pServer, blocker)); // Wait for server to be created before continuing blocker->wait(); @@ -302,40 +278,31 @@ Rcpp::RObject makeTcpServer(const std::string& host, int port, pServers.push_back(pServer); - return Rcpp::wrap(externalize_str(pServer)); + return as_sexp(externalize_str(pServer)); } -// [[Rcpp::export]] -Rcpp::RObject makePipeServer(const std::string& name, - int mask, - Rcpp::Function onHeaders, - Rcpp::Function onBodyData, - Rcpp::Function onRequest, - Rcpp::Function onWSOpen, - Rcpp::Function onWSMessage, - Rcpp::Function onWSClose, - Rcpp::List staticPaths, - Rcpp::List staticPathOptions, - bool quiet -) { +[[cpp11::register]] SEXP makePipeServer(const std::string &name, int mask, + sexp onHeaders, function onBodyData, + function onRequest, function onWSOpen, + function onWSMessage, + function onWSClose, list staticPaths, + list staticPathOptions, bool quiet) { - using namespace Rcpp; register_main_thread(); // Deleted when owning pServer is deleted. If pServer creation fails, // this should be deleted when it goes out of scope. std::shared_ptr pHandler( - new RWebApplication(onHeaders, onBodyData, onRequest, - onWSOpen, onWSMessage, onWSClose, - staticPaths, staticPathOptions), - auto_deleter_main - ); + new RWebApplication(onHeaders, onBodyData, onRequest, onWSOpen, + onWSMessage, onWSClose, staticPaths, + staticPathOptions), + auto_deleter_main); ensure_io_thread(); std::shared_ptr blocker = std::make_shared(2); - uv_stream_t* pServer; + uv_stream_t *pServer; // Run on background thread: // createPipeServerSync( @@ -344,12 +311,9 @@ Rcpp::RObject makePipeServer(const std::string& name, // background_queue, &pServer, blocker // ); background_queue->push( - std::bind(createPipeServerSync, - io_loop.get(), name.c_str(), mask, - std::static_pointer_cast(pHandler), - quiet, background_queue, &pServer, blocker - ) - ); + std::bind(createPipeServerSync, io_loop.get(), name.c_str(), mask, + std::static_pointer_cast(pHandler), quiet, + background_queue, &pServer, blocker)); // Wait for server to be created before continuing blocker->wait(); @@ -360,118 +324,111 @@ Rcpp::RObject makePipeServer(const std::string& name, pServers.push_back(pServer); - return Rcpp::wrap(externalize_str(pServer)); + return as_sexp(externalize_str(pServer)); } - -void stopServer_(uv_stream_t* pServer) { +void stopServer_(uv_stream_t *pServer) { ASSERT_MAIN_THREAD() // Remove it from the list of running servers. // Note: we're removing it from the pServers list without waiting for the // background thread to call freeServer(). - std::vector::iterator pos = std::find(pServers.begin(), pServers.end(), pServer); + std::vector::iterator pos = + std::find(pServers.begin(), pServers.end(), pServer); if (pos != pServers.end()) { pServers.erase(pos); } else { - throw Rcpp::exception("pServer handle not found in list of running servers."); + stop("pServer handle not found in list of running servers."); } // Run on background thread: // freeServer(pServer); - background_queue->push( - std::bind(freeServer, pServer) - ); + background_queue->push(std::bind(freeServer, pServer)); } -// [[Rcpp::export]] -void stopServer_(std::string handle) { +[[cpp11::register]] void stopServer_(std::string handle) { ASSERT_MAIN_THREAD() - uv_stream_t* pServer = internalize_str(handle); + uv_stream_t *pServer = internalize_str(handle); stopServer_(pServer); } -void stop_loop_timer_cb(uv_timer_t* handle) { - uv_stop(handle->loop); -} - +void stop_loop_timer_cb(uv_timer_t *handle) { uv_stop(handle->loop); } // ============================================================================ // Static file serving // ============================================================================ -std::shared_ptr get_pWebApplication(uv_stream_t* pServer) { +std::shared_ptr get_pWebApplication(uv_stream_t *pServer) { // Copy the Socket shared_ptr - std::shared_ptr pSocket(*(std::shared_ptr*)pServer->data); + std::shared_ptr pSocket(*(std::shared_ptr *)pServer->data); return pSocket->pWebApplication; } std::shared_ptr get_pWebApplication(std::string handle) { - uv_stream_t* pServer = internalize_str(handle); + uv_stream_t *pServer = internalize_str(handle); return get_pWebApplication(pServer); } -// [[Rcpp::export]] -Rcpp::List getStaticPaths_(std::string handle) { +[[cpp11::register]] list getStaticPaths_(std::string handle) { ASSERT_MAIN_THREAD() return get_pWebApplication(handle)->getStaticPathManager().pathsAsRObject(); } -// [[Rcpp::export]] -Rcpp::List setStaticPaths_(std::string handle, Rcpp::List sp) { +[[cpp11::register]] list setStaticPaths_(std::string handle, list sp) { ASSERT_MAIN_THREAD() get_pWebApplication(handle)->getStaticPathManager().set(sp); return getStaticPaths_(handle); } -// [[Rcpp::export]] -Rcpp::List removeStaticPaths_(std::string handle, Rcpp::CharacterVector paths) { +[[cpp11::register]] list removeStaticPaths_(std::string handle, strings paths) { ASSERT_MAIN_THREAD() get_pWebApplication(handle)->getStaticPathManager().remove(paths); return getStaticPaths_(handle); } -// [[Rcpp::export]] -Rcpp::List getStaticPathOptions_(std::string handle) { +[[cpp11::register]] list getStaticPathOptions_(std::string handle) { ASSERT_MAIN_THREAD() - return get_pWebApplication(handle)->getStaticPathManager().getOptions().asRObject(); + return get_pWebApplication(handle) + ->getStaticPathManager() + .getOptions() + .asRObject(); } - -// [[Rcpp::export]] -Rcpp::List setStaticPathOptions_(std::string handle, Rcpp::List opts) { +[[cpp11::register]] list setStaticPathOptions_(std::string handle, list opts) { ASSERT_MAIN_THREAD() get_pWebApplication(handle)->getStaticPathManager().setOptions(opts); return getStaticPathOptions_(handle); } - // ============================================================================ // Miscellaneous utility functions // ============================================================================ -// [[Rcpp::export]] -std::string base64encode(const Rcpp::RawVector& x) { - return b64encode(x.begin(), x.end()); +[[cpp11::register]] std::string base64encode(const raws &x) { + std::vector buf(x.begin(), x.end()); + return b64encode(buf.begin(), buf.end()); } -static std::string allowed = ";,/?:@&=+$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_.!~*'()"; +static std::string allowed = + ";,/" + "?:@&=+$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_.!~" + "*'()"; bool isReservedUrlChar(char c) { switch (c) { - case ';': - case ',': - case '/': - case '?': - case ':': - case '@': - case '&': - case '=': - case '+': - case '$': - return true; - default: - return false; + case ';': + case ',': + case '/': + case '?': + case ':': + case '@': + case '&': + case '=': + case '+': + case '$': + return true; + default: + return false; } } @@ -485,16 +442,16 @@ bool needsEscape(char c, bool encodeReserved) { if (isReservedUrlChar(c)) return encodeReserved; switch (c) { - case '-': - case '_': - case '.': - case '!': - case '~': - case '*': - case '\'': - case '(': - case ')': - return false; + case '-': + case '_': + case '.': + case '!': + case '~': + case '*': + case '\'': + case '(': + case ')': + return false; } return true; } @@ -502,71 +459,44 @@ bool needsEscape(char c, bool encodeReserved) { std::string doEncodeURI(std::string value, bool encodeReserved) { std::ostringstream os; os << std::hex << std::uppercase; - for (std::string::const_iterator it = value.begin(); - it != value.end(); - it++) { + for (std::string::const_iterator it = value.begin(); it != value.end(); + it++) { if (!needsEscape(*it, encodeReserved)) { os << *it; } else { - os << '%' << std::setw(2) << std::setfill('0') << static_cast(static_cast(*it)); + os << '%' << std::setw(2) << std::setfill('0') + << static_cast(static_cast(*it)); } } return os.str(); } -//' URI encoding/decoding -//' -//' Encodes/decodes strings using URI encoding/decoding in the same way that web -//' browsers do. The precise behaviors of these functions can be found at -//' developer.mozilla.org: -//' \href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI}{encodeURI}, -//' \href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent}{encodeURIComponent}, -//' \href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI}{decodeURI}, -//' \href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent}{decodeURIComponent} -//' -//' Intended as a faster replacement for [utils::URLencode()] and -//' [utils::URLdecode()]. -//' -//' encodeURI differs from encodeURIComponent in that the former will not encode -//' reserved characters: \code{;,/?:@@&=+$} -//' -//' decodeURI differs from decodeURIComponent in that it will refuse to decode -//' encoded sequences that decode to a reserved character. (If in doubt, use -//' decodeURIComponent.) -//' -//' For \code{encodeURI} and \code{encodeURIComponent}, input strings will be -//' converted to UTF-8 before URL-encoding. -//' -//' @param value Character vector to be encoded or decoded. -//' @return Encoded or decoded character vector of the same length as the -//' input value. \code{decodeURI} and \code{decodeURIComponent} will return -//' strings that are UTF-8 encoded. -//' -//' @export -// [[Rcpp::export]] -Rcpp::CharacterVector encodeURI(Rcpp::CharacterVector value) { - Rcpp::CharacterVector out(value.size(), NA_STRING); - - for (int i = 0; i < value.size(); i++) { - if (value[i] != NA_STRING) { - std::string encoded = doEncodeURI(Rf_translateCharUTF8(value[i]), false); - out[i] = Rf_mkCharCE(encoded.c_str(), CE_UTF8); +[[cpp11::register]] strings encodeURI_(strings value) { + writable::strings out(value.size()); + + for (R_xlen_t i = 0; i < value.size(); i++) { + if (value[i] == NA_STRING) { + out[i] = r_string(NA_STRING); + } else { + std::string encoded = + doEncodeURI(Rf_translateCharUTF8(SEXP(value[i])), false); + out[i] = r_string(Rf_mkCharCE(encoded.c_str(), CE_UTF8)); } } return out; } -//' @rdname encodeURI -//' @export -// [[Rcpp::export]] -Rcpp::CharacterVector encodeURIComponent(Rcpp::CharacterVector value) { - Rcpp::CharacterVector out(value.size(), NA_STRING); +[[cpp11::register]] strings encodeURIComponent_(strings value) { + writable::strings out(value.size()); - for (int i = 0; i < value.size(); i++) { - if (value[i] != NA_STRING) { - std::string encoded = doEncodeURI(Rf_translateCharUTF8(value[i]), true); - out[i] = Rf_mkCharCE(encoded.c_str(), CE_UTF8); + for (R_xlen_t i = 0; i < value.size(); i++) { + if (value[i] == NA_STRING) { + out[i] = r_string(NA_STRING); + } else { + std::string encoded = + doEncodeURI(Rf_translateCharUTF8(SEXP(value[i])), true); + out[i] = r_string(Rf_mkCharCE(encoded.c_str(), CE_UTF8)); } } return out; @@ -574,31 +504,53 @@ Rcpp::CharacterVector encodeURIComponent(Rcpp::CharacterVector value) { int hexToInt(char c) { switch (c) { - case '0': return 0; - case '1': return 1; - case '2': return 2; - case '3': return 3; - case '4': return 4; - case '5': return 5; - case '6': return 6; - case '7': return 7; - case '8': return 8; - case '9': return 9; - case 'A': case 'a': return 10; - case 'B': case 'b': return 11; - case 'C': case 'c': return 12; - case 'D': case 'd': return 13; - case 'E': case 'e': return 14; - case 'F': case 'f': return 15; - default: return -1; + case '0': + return 0; + case '1': + return 1; + case '2': + return 2; + case '3': + return 3; + case '4': + return 4; + case '5': + return 5; + case '6': + return 6; + case '7': + return 7; + case '8': + return 8; + case '9': + return 9; + case 'A': + case 'a': + return 10; + case 'B': + case 'b': + return 11; + case 'C': + case 'c': + return 12; + case 'D': + case 'd': + return 13; + case 'E': + case 'e': + return 14; + case 'F': + case 'f': + return 15; + default: + return -1; } } std::string doDecodeURI(std::string value, bool component) { std::ostringstream os; - for (std::string::const_iterator it = value.begin(); - it != value.end(); - it++) { + for (std::string::const_iterator it = value.begin(); it != value.end(); + it++) { // If there aren't enough characters left for this to be a // valid escape code, just use the character and move on @@ -631,60 +583,39 @@ std::string doDecodeURI(std::string value, bool component) { return os.str(); } +[[cpp11::register]] strings decodeURI_(strings value) { + writable::strings out(value.size()); -//' @rdname encodeURI -//' @export -// [[Rcpp::export]] -Rcpp::CharacterVector decodeURI(Rcpp::CharacterVector value) { - Rcpp::CharacterVector out(value.size(), NA_STRING); - - for (int i = 0; i < value.size(); i++) { - if (value[i] != NA_STRING) { - std::string decoded = doDecodeURI(Rcpp::as(value[i]), false); - out[i] = Rf_mkCharLenCE(decoded.c_str(), decoded.length(), CE_UTF8); + for (R_xlen_t i = 0; i < value.size(); i++) { + if (value[i] == NA_STRING) { + out[i] = r_string(NA_STRING); + } else { + std::string decoded = doDecodeURI(std::string(value[i]), false); + out[i] = + r_string(Rf_mkCharLenCE(decoded.c_str(), decoded.length(), CE_UTF8)); } } return out; } -//' @rdname encodeURI -//' @export -// [[Rcpp::export]] -Rcpp::CharacterVector decodeURIComponent(Rcpp::CharacterVector value) { - Rcpp::CharacterVector out(value.size(), NA_STRING); +[[cpp11::register]] strings decodeURIComponent_(strings value) { + writable::strings out(value.size()); - for (int i = 0; i < value.size(); i++) { - if (value[i] != NA_STRING) { - std::string decoded = doDecodeURI(Rcpp::as(value[i]), true); - out[i] = Rf_mkCharLenCE(decoded.c_str(), decoded.length(), CE_UTF8); + for (R_xlen_t i = 0; i < value.size(); i++) { + if (value[i] == NA_STRING) { + out[i] = r_string(NA_STRING); + } else { + std::string decoded = doDecodeURI(std::string(value[i]), true); + out[i] = + r_string(Rf_mkCharLenCE(decoded.c_str(), decoded.length(), CE_UTF8)); } } return out; } -//' Check whether an address is IPv4 or IPv6 -//' -//' Given an IP address, this checks whether it is an IPv4 or IPv6 address. -//' -//' @param ip A single string representing an IP address. -//' -//' @return -//' For IPv4 addresses, \code{4}; for IPv6 addresses, \code{6}. If the address is -//' neither, \code{-1}. -//' -//' @examples -//' ipFamily("127.0.0.1") # 4 -//' ipFamily("500.0.0.500") # -1 -//' ipFamily("500.0.0.500") # -1 -//' -//' ipFamily("::") # 6 -//' ipFamily("::1") # 6 -//' ipFamily("fe80::1ff:fe23:4567:890a") # 6 -//' @export -// [[Rcpp::export]] -int ipFamily(const std::string& ip) { +[[cpp11::register]] int ipFamily_(const std::string &ip) { int family = ip_family(ip); if (family == AF_INET6) return 6; @@ -694,19 +625,17 @@ int ipFamily(const std::string& ip) { return -1; } - // Given a List and an external pointer to a C++ function that takes a List, // invoke the function with the List as the single argument. This also clears // the external pointer so that the C++ function can't be called again. -// [[Rcpp::export]] -void invokeCppCallback(Rcpp::List data, SEXP callback_xptr) { +[[cpp11::register]] void invokeCppCallback(SEXP data, SEXP callback_xptr) { ASSERT_MAIN_THREAD() if (TYPEOF(callback_xptr) != EXTPTRSXP) { - throw Rcpp::exception("Expected external pointer."); + stop("Expected external pointer."); } - std::function* callback_wrapper = - (std::function*)(R_ExternalPtrAddr(callback_xptr)); + std::function *callback_wrapper = + (std::function *)(R_ExternalPtrAddr(callback_xptr)); (*callback_wrapper)(data); @@ -717,30 +646,15 @@ void invokeCppCallback(Rcpp::List data, SEXP callback_xptr) { R_ClearExternalPtr(callback_xptr); } -//' Apply the value of .Random.seed to R's internal RNG state -//' -//' This function is needed in unusual cases where a C++ function calls -//' an R function which sets the value of \code{.Random.seed}. This function -//' should be called at the end of the R function to ensure that the new value -//' \code{.Random.seed} is preserved. Otherwise, Rcpp may overwrite it with a -//' previous value. -//' -//' @keywords internal -//' @export -// [[Rcpp::export]] -void getRNGState() { - GetRNGstate(); -} +[[cpp11::register]] void getRNGState_() { GetRNGstate(); } // We are given an external pointer to a // std::shared_ptr. This returns a hexadecimal string // representing the address of the WebSocketConnection (not the shared_ptr to // it!). -// -//[[Rcpp::export]] -std::string wsconn_address(SEXP external_ptr) { - Rcpp::XPtr > xptr(external_ptr); +[[cpp11::register]] std::string wsconn_address(SEXP external_ptr) { + external_pointer> xptr(external_ptr); std::ostringstream os; - os << std::hex << reinterpret_cast(xptr.get()->get()); + os << std::hex << reinterpret_cast((*xptr).get()); return os.str(); } diff --git a/src/httpuv.h b/src/httpuv.h index 097fefb43..b77098926 100644 --- a/src/httpuv.h +++ b/src/httpuv.h @@ -1,11 +1,12 @@ #ifndef HTTPUV_HPP #define HTTPUV_HPP -#include +#include "cpp11.hpp" #include +using namespace cpp11; -void invokeCppCallback(Rcpp::List data, SEXP callback_xptr); +void invokeCppCallback(SEXP data, SEXP callback_xptr); std::string doEncodeURI(std::string value, bool encodeReserved); std::string doDecodeURI(std::string value, bool component); diff --git a/src/libuv/include/uv.h b/src/libuv/include/uv.h index 606083c87..7281fa6b6 100644 --- a/src/libuv/include/uv.h +++ b/src/libuv/include/uv.h @@ -32,23 +32,23 @@ extern "C" { #endif #ifdef _WIN32 - /* Windows - set up dll import/export decorators. */ -# if defined(BUILDING_UV_SHARED) - /* Building shared library. */ -# define UV_EXTERN __declspec(dllexport) -# elif defined(USING_UV_SHARED) - /* Using shared library. */ -# define UV_EXTERN __declspec(dllimport) -# else - /* Building static library. */ -# define UV_EXTERN /* nothing */ -# endif +/* Windows - set up dll import/export decorators. */ +#if defined(BUILDING_UV_SHARED) +/* Building shared library. */ +#define UV_EXTERN __declspec(dllexport) +#elif defined(USING_UV_SHARED) +/* Using shared library. */ +#define UV_EXTERN __declspec(dllimport) +#else +/* Building static library. */ +#define UV_EXTERN /* nothing */ +#endif #elif __GNUC__ >= 4 -# define UV_EXTERN __attribute__((visibility("default"))) +#define UV_EXTERN __attribute__((visibility("default"))) #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) /* Sun Studio >= 8 */ -# define UV_EXTERN __global +#define UV_EXTERN __global #else -# define UV_EXTERN /* nothing */ +#define UV_EXTERN /* nothing */ #endif #include "uv/errno.h" @@ -57,137 +57,137 @@ extern "C" { #include #if defined(_MSC_VER) && _MSC_VER < 1600 -# include "uv/stdint-msvc2008.h" +#include "uv/stdint-msvc2008.h" #else -# include +#include #endif #if defined(_WIN32) -# include "uv/win.h" +#include "uv/win.h" #else -# include "uv/unix.h" +#include "uv/unix.h" #endif /* Expand this list if necessary. */ -#define UV_ERRNO_MAP(XX) \ - XX(E2BIG, "argument list too long") \ - XX(EACCES, "permission denied") \ - XX(EADDRINUSE, "address already in use") \ - XX(EADDRNOTAVAIL, "address not available") \ - XX(EAFNOSUPPORT, "address family not supported") \ - XX(EAGAIN, "resource temporarily unavailable") \ - XX(EAI_ADDRFAMILY, "address family not supported") \ - XX(EAI_AGAIN, "temporary failure") \ - XX(EAI_BADFLAGS, "bad ai_flags value") \ - XX(EAI_BADHINTS, "invalid value for hints") \ - XX(EAI_CANCELED, "request canceled") \ - XX(EAI_FAIL, "permanent failure") \ - XX(EAI_FAMILY, "ai_family not supported") \ - XX(EAI_MEMORY, "out of memory") \ - XX(EAI_NODATA, "no address") \ - XX(EAI_NONAME, "unknown node or service") \ - XX(EAI_OVERFLOW, "argument buffer overflow") \ - XX(EAI_PROTOCOL, "resolved protocol is unknown") \ - XX(EAI_SERVICE, "service not available for socket type") \ - XX(EAI_SOCKTYPE, "socket type not supported") \ - XX(EALREADY, "connection already in progress") \ - XX(EBADF, "bad file descriptor") \ - XX(EBUSY, "resource busy or locked") \ - XX(ECANCELED, "operation canceled") \ - XX(ECHARSET, "invalid Unicode character") \ - XX(ECONNABORTED, "software caused connection abort") \ - XX(ECONNREFUSED, "connection refused") \ - XX(ECONNRESET, "connection reset by peer") \ - XX(EDESTADDRREQ, "destination address required") \ - XX(EEXIST, "file already exists") \ - XX(EFAULT, "bad address in system call argument") \ - XX(EFBIG, "file too large") \ - XX(EHOSTUNREACH, "host is unreachable") \ - XX(EINTR, "interrupted system call") \ - XX(EINVAL, "invalid argument") \ - XX(EIO, "i/o error") \ - XX(EISCONN, "socket is already connected") \ - XX(EISDIR, "illegal operation on a directory") \ - XX(ELOOP, "too many symbolic links encountered") \ - XX(EMFILE, "too many open files") \ - XX(EMSGSIZE, "message too long") \ - XX(ENAMETOOLONG, "name too long") \ - XX(ENETDOWN, "network is down") \ - XX(ENETUNREACH, "network is unreachable") \ - XX(ENFILE, "file table overflow") \ - XX(ENOBUFS, "no buffer space available") \ - XX(ENODEV, "no such device") \ - XX(ENOENT, "no such file or directory") \ - XX(ENOMEM, "not enough memory") \ - XX(ENONET, "machine is not on the network") \ - XX(ENOPROTOOPT, "protocol not available") \ - XX(ENOSPC, "no space left on device") \ - XX(ENOSYS, "function not implemented") \ - XX(ENOTCONN, "socket is not connected") \ - XX(ENOTDIR, "not a directory") \ - XX(ENOTEMPTY, "directory not empty") \ - XX(ENOTSOCK, "socket operation on non-socket") \ - XX(ENOTSUP, "operation not supported on socket") \ - XX(EOVERFLOW, "value too large for defined data type") \ - XX(EPERM, "operation not permitted") \ - XX(EPIPE, "broken pipe") \ - XX(EPROTO, "protocol error") \ - XX(EPROTONOSUPPORT, "protocol not supported") \ - XX(EPROTOTYPE, "protocol wrong type for socket") \ - XX(ERANGE, "result too large") \ - XX(EROFS, "read-only file system") \ - XX(ESHUTDOWN, "cannot send after transport endpoint shutdown") \ - XX(ESPIPE, "invalid seek") \ - XX(ESRCH, "no such process") \ - XX(ETIMEDOUT, "connection timed out") \ - XX(ETXTBSY, "text file is busy") \ - XX(EXDEV, "cross-device link not permitted") \ - XX(UNKNOWN, "unknown error") \ - XX(EOF, "end of file") \ - XX(ENXIO, "no such device or address") \ - XX(EMLINK, "too many links") \ - XX(EHOSTDOWN, "host is down") \ - XX(EREMOTEIO, "remote I/O error") \ - XX(ENOTTY, "inappropriate ioctl for device") \ - XX(EFTYPE, "inappropriate file type or format") \ - XX(EILSEQ, "illegal byte sequence") \ - XX(ESOCKTNOSUPPORT, "socket type not supported") \ - -#define UV_HANDLE_TYPE_MAP(XX) \ - XX(ASYNC, async) \ - XX(CHECK, check) \ - XX(FS_EVENT, fs_event) \ - XX(FS_POLL, fs_poll) \ - XX(HANDLE, handle) \ - XX(IDLE, idle) \ - XX(NAMED_PIPE, pipe) \ - XX(POLL, poll) \ - XX(PREPARE, prepare) \ - XX(PROCESS, process) \ - XX(STREAM, stream) \ - XX(TCP, tcp) \ - XX(TIMER, timer) \ - XX(TTY, tty) \ - XX(UDP, udp) \ - XX(SIGNAL, signal) \ - -#define UV_REQ_TYPE_MAP(XX) \ - XX(REQ, req) \ - XX(CONNECT, connect) \ - XX(WRITE, write) \ - XX(SHUTDOWN, shutdown) \ - XX(UDP_SEND, udp_send) \ - XX(FS, fs) \ - XX(WORK, work) \ - XX(GETADDRINFO, getaddrinfo) \ - XX(GETNAMEINFO, getnameinfo) \ - XX(RANDOM, random) \ +#define UV_ERRNO_MAP(XX) \ + XX(E2BIG, "argument list too long") \ + XX(EACCES, "permission denied") \ + XX(EADDRINUSE, "address already in use") \ + XX(EADDRNOTAVAIL, "address not available") \ + XX(EAFNOSUPPORT, "address family not supported") \ + XX(EAGAIN, "resource temporarily unavailable") \ + XX(EAI_ADDRFAMILY, "address family not supported") \ + XX(EAI_AGAIN, "temporary failure") \ + XX(EAI_BADFLAGS, "bad ai_flags value") \ + XX(EAI_BADHINTS, "invalid value for hints") \ + XX(EAI_CANCELED, "request canceled") \ + XX(EAI_FAIL, "permanent failure") \ + XX(EAI_FAMILY, "ai_family not supported") \ + XX(EAI_MEMORY, "out of memory") \ + XX(EAI_NODATA, "no address") \ + XX(EAI_NONAME, "unknown node or service") \ + XX(EAI_OVERFLOW, "argument buffer overflow") \ + XX(EAI_PROTOCOL, "resolved protocol is unknown") \ + XX(EAI_SERVICE, "service not available for socket type") \ + XX(EAI_SOCKTYPE, "socket type not supported") \ + XX(EALREADY, "connection already in progress") \ + XX(EBADF, "bad file descriptor") \ + XX(EBUSY, "resource busy or locked") \ + XX(ECANCELED, "operation canceled") \ + XX(ECHARSET, "invalid Unicode character") \ + XX(ECONNABORTED, "software caused connection abort") \ + XX(ECONNREFUSED, "connection refused") \ + XX(ECONNRESET, "connection reset by peer") \ + XX(EDESTADDRREQ, "destination address required") \ + XX(EEXIST, "file already exists") \ + XX(EFAULT, "bad address in system call argument") \ + XX(EFBIG, "file too large") \ + XX(EHOSTUNREACH, "host is unreachable") \ + XX(EINTR, "interrupted system call") \ + XX(EINVAL, "invalid argument") \ + XX(EIO, "i/o error") \ + XX(EISCONN, "socket is already connected") \ + XX(EISDIR, "illegal operation on a directory") \ + XX(ELOOP, "too many symbolic links encountered") \ + XX(EMFILE, "too many open files") \ + XX(EMSGSIZE, "message too long") \ + XX(ENAMETOOLONG, "name too long") \ + XX(ENETDOWN, "network is down") \ + XX(ENETUNREACH, "network is unreachable") \ + XX(ENFILE, "file table overflow") \ + XX(ENOBUFS, "no buffer space available") \ + XX(ENODEV, "no such device") \ + XX(ENOENT, "no such file or directory") \ + XX(ENOMEM, "not enough memory") \ + XX(ENONET, "machine is not on the network") \ + XX(ENOPROTOOPT, "protocol not available") \ + XX(ENOSPC, "no space left on device") \ + XX(ENOSYS, "function not implemented") \ + XX(ENOTCONN, "socket is not connected") \ + XX(ENOTDIR, "not a directory") \ + XX(ENOTEMPTY, "directory not empty") \ + XX(ENOTSOCK, "socket operation on non-socket") \ + XX(ENOTSUP, "operation not supported on socket") \ + XX(EOVERFLOW, "value too large for defined data type") \ + XX(EPERM, "operation not permitted") \ + XX(EPIPE, "broken pipe") \ + XX(EPROTO, "protocol error") \ + XX(EPROTONOSUPPORT, "protocol not supported") \ + XX(EPROTOTYPE, "protocol wrong type for socket") \ + XX(ERANGE, "result too large") \ + XX(EROFS, "read-only file system") \ + XX(ESHUTDOWN, "cannot send after transport endpoint shutdown") \ + XX(ESPIPE, "invalid seek") \ + XX(ESRCH, "no such process") \ + XX(ETIMEDOUT, "connection timed out") \ + XX(ETXTBSY, "text file is busy") \ + XX(EXDEV, "cross-device link not permitted") \ + XX(UNKNOWN, "unknown error") \ + XX(EOF, "end of file") \ + XX(ENXIO, "no such device or address") \ + XX(EMLINK, "too many links") \ + XX(EHOSTDOWN, "host is down") \ + XX(EREMOTEIO, "remote I/O error") \ + XX(ENOTTY, "inappropriate ioctl for device") \ + XX(EFTYPE, "inappropriate file type or format") \ + XX(EILSEQ, "illegal byte sequence") \ + XX(ESOCKTNOSUPPORT, "socket type not supported") + +#define UV_HANDLE_TYPE_MAP(XX) \ + XX(ASYNC, async) \ + XX(CHECK, check) \ + XX(FS_EVENT, fs_event) \ + XX(FS_POLL, fs_poll) \ + XX(HANDLE, handle) \ + XX(IDLE, idle) \ + XX(NAMED_PIPE, pipe) \ + XX(POLL, poll) \ + XX(PREPARE, prepare) \ + XX(PROCESS, process) \ + XX(STREAM, stream) \ + XX(TCP, tcp) \ + XX(TIMER, timer) \ + XX(TTY, tty) \ + XX(UDP, udp) \ + XX(SIGNAL, signal) + +#define UV_REQ_TYPE_MAP(XX) \ + XX(REQ, req) \ + XX(CONNECT, connect) \ + XX(WRITE, write) \ + XX(SHUTDOWN, shutdown) \ + XX(UDP_SEND, udp_send) \ + XX(FS, fs) \ + XX(WORK, work) \ + XX(GETADDRINFO, getaddrinfo) \ + XX(GETNAMEINFO, getnameinfo) \ + XX(RANDOM, random) typedef enum { -#define XX(code, _) UV_ ## code = UV__ ## code, +#define XX(code, _) UV_##code = UV__##code, UV_ERRNO_MAP(XX) #undef XX - UV_ERRNO_MAX = UV__EOF - 1 + UV_ERRNO_MAX = UV__EOF - 1 } uv_errno_t; typedef enum { @@ -195,7 +195,7 @@ typedef enum { #define XX(uc, lc) UV_##uc, UV_HANDLE_TYPE_MAP(XX) #undef XX - UV_FILE, + UV_FILE, UV_HANDLE_TYPE_MAX } uv_handle_type; @@ -204,11 +204,9 @@ typedef enum { #define XX(uc, lc) UV_##uc, UV_REQ_TYPE_MAP(XX) #undef XX - UV_REQ_TYPE_PRIVATE - UV_REQ_TYPE_MAX + UV_REQ_TYPE_PRIVATE UV_REQ_TYPE_MAX } uv_req_type; - /* Handle types. */ typedef struct uv_loop_s uv_loop_t; typedef struct uv_handle_s uv_handle_t; @@ -250,25 +248,17 @@ typedef struct uv_passwd_s uv_passwd_t; typedef struct uv_utsname_s uv_utsname_t; typedef struct uv_statfs_s uv_statfs_t; -typedef enum { - UV_LOOP_BLOCK_SIGNAL = 0, - UV_METRICS_IDLE_TIME -} uv_loop_option; - -typedef enum { - UV_RUN_DEFAULT = 0, - UV_RUN_ONCE, - UV_RUN_NOWAIT -} uv_run_mode; +typedef enum { UV_LOOP_BLOCK_SIGNAL = 0, UV_METRICS_IDLE_TIME } uv_loop_option; +typedef enum { UV_RUN_DEFAULT = 0, UV_RUN_ONCE, UV_RUN_NOWAIT } uv_run_mode; UV_EXTERN unsigned int uv_version(void); -UV_EXTERN const char* uv_version_string(void); +UV_EXTERN const char *uv_version_string(void); -typedef void* (*uv_malloc_func)(size_t size); -typedef void* (*uv_realloc_func)(void* ptr, size_t size); -typedef void* (*uv_calloc_func)(size_t count, size_t size); -typedef void (*uv_free_func)(void* ptr); +typedef void *(*uv_malloc_func)(size_t size); +typedef void *(*uv_realloc_func)(void *ptr, size_t size); +typedef void *(*uv_calloc_func)(size_t count, size_t size); +typedef void (*uv_free_func)(void *ptr); UV_EXTERN void uv_library_shutdown(void); @@ -277,71 +267,65 @@ UV_EXTERN int uv_replace_allocator(uv_malloc_func malloc_func, uv_calloc_func calloc_func, uv_free_func free_func); -UV_EXTERN uv_loop_t* uv_default_loop(void); -UV_EXTERN int uv_loop_init(uv_loop_t* loop); -UV_EXTERN int uv_loop_close(uv_loop_t* loop); +UV_EXTERN uv_loop_t *uv_default_loop(void); +UV_EXTERN int uv_loop_init(uv_loop_t *loop); +UV_EXTERN int uv_loop_close(uv_loop_t *loop); /* * NOTE: * This function is DEPRECATED (to be removed after 0.12), users should * allocate the loop manually and use uv_loop_init instead. */ -UV_EXTERN uv_loop_t* uv_loop_new(void); +UV_EXTERN uv_loop_t *uv_loop_new(void); /* * NOTE: * This function is DEPRECATED (to be removed after 0.12). Users should use * uv_loop_close and free the memory manually instead. */ -UV_EXTERN void uv_loop_delete(uv_loop_t*); +UV_EXTERN void uv_loop_delete(uv_loop_t *); UV_EXTERN size_t uv_loop_size(void); -UV_EXTERN int uv_loop_alive(const uv_loop_t* loop); -UV_EXTERN int uv_loop_configure(uv_loop_t* loop, uv_loop_option option, ...); -UV_EXTERN int uv_loop_fork(uv_loop_t* loop); - -UV_EXTERN int uv_run(uv_loop_t*, uv_run_mode mode); -UV_EXTERN void uv_stop(uv_loop_t*); - -UV_EXTERN void uv_ref(uv_handle_t*); -UV_EXTERN void uv_unref(uv_handle_t*); -UV_EXTERN int uv_has_ref(const uv_handle_t*); - -UV_EXTERN void uv_update_time(uv_loop_t*); -UV_EXTERN uint64_t uv_now(const uv_loop_t*); - -UV_EXTERN int uv_backend_fd(const uv_loop_t*); -UV_EXTERN int uv_backend_timeout(const uv_loop_t*); - -typedef void (*uv_alloc_cb)(uv_handle_t* handle, - size_t suggested_size, - uv_buf_t* buf); -typedef void (*uv_read_cb)(uv_stream_t* stream, - ssize_t nread, - const uv_buf_t* buf); -typedef void (*uv_write_cb)(uv_write_t* req, int status); -typedef void (*uv_connect_cb)(uv_connect_t* req, int status); -typedef void (*uv_shutdown_cb)(uv_shutdown_t* req, int status); -typedef void (*uv_connection_cb)(uv_stream_t* server, int status); -typedef void (*uv_close_cb)(uv_handle_t* handle); -typedef void (*uv_poll_cb)(uv_poll_t* handle, int status, int events); -typedef void (*uv_timer_cb)(uv_timer_t* handle); -typedef void (*uv_async_cb)(uv_async_t* handle); -typedef void (*uv_prepare_cb)(uv_prepare_t* handle); -typedef void (*uv_check_cb)(uv_check_t* handle); -typedef void (*uv_idle_cb)(uv_idle_t* handle); -typedef void (*uv_exit_cb)(uv_process_t*, int64_t exit_status, int term_signal); -typedef void (*uv_walk_cb)(uv_handle_t* handle, void* arg); -typedef void (*uv_fs_cb)(uv_fs_t* req); -typedef void (*uv_work_cb)(uv_work_t* req); -typedef void (*uv_after_work_cb)(uv_work_t* req, int status); -typedef void (*uv_getaddrinfo_cb)(uv_getaddrinfo_t* req, - int status, - struct addrinfo* res); -typedef void (*uv_getnameinfo_cb)(uv_getnameinfo_t* req, - int status, - const char* hostname, - const char* service); -typedef void (*uv_random_cb)(uv_random_t* req, - int status, - void* buf, +UV_EXTERN int uv_loop_alive(const uv_loop_t *loop); +UV_EXTERN int uv_loop_configure(uv_loop_t *loop, uv_loop_option option, ...); +UV_EXTERN int uv_loop_fork(uv_loop_t *loop); + +UV_EXTERN int uv_run(uv_loop_t *, uv_run_mode mode); +UV_EXTERN void uv_stop(uv_loop_t *); + +UV_EXTERN void uv_ref(uv_handle_t *); +UV_EXTERN void uv_unref(uv_handle_t *); +UV_EXTERN int uv_has_ref(const uv_handle_t *); + +UV_EXTERN void uv_update_time(uv_loop_t *); +UV_EXTERN uint64_t uv_now(const uv_loop_t *); + +UV_EXTERN int uv_backend_fd(const uv_loop_t *); +UV_EXTERN int uv_backend_timeout(const uv_loop_t *); + +typedef void (*uv_alloc_cb)(uv_handle_t *handle, size_t suggested_size, + uv_buf_t *buf); +typedef void (*uv_read_cb)(uv_stream_t *stream, ssize_t nread, + const uv_buf_t *buf); +typedef void (*uv_write_cb)(uv_write_t *req, int status); +typedef void (*uv_connect_cb)(uv_connect_t *req, int status); +typedef void (*uv_shutdown_cb)(uv_shutdown_t *req, int status); +typedef void (*uv_connection_cb)(uv_stream_t *server, int status); +typedef void (*uv_close_cb)(uv_handle_t *handle); +typedef void (*uv_poll_cb)(uv_poll_t *handle, int status, int events); +typedef void (*uv_timer_cb)(uv_timer_t *handle); +typedef void (*uv_async_cb)(uv_async_t *handle); +typedef void (*uv_prepare_cb)(uv_prepare_t *handle); +typedef void (*uv_check_cb)(uv_check_t *handle); +typedef void (*uv_idle_cb)(uv_idle_t *handle); +typedef void (*uv_exit_cb)(uv_process_t *, int64_t exit_status, + int term_signal); +typedef void (*uv_walk_cb)(uv_handle_t *handle, void *arg); +typedef void (*uv_fs_cb)(uv_fs_t *req); +typedef void (*uv_work_cb)(uv_work_t *req); +typedef void (*uv_after_work_cb)(uv_work_t *req, int status); +typedef void (*uv_getaddrinfo_cb)(uv_getaddrinfo_t *req, int status, + struct addrinfo *res); +typedef void (*uv_getnameinfo_cb)(uv_getnameinfo_t *req, int status, + const char *hostname, const char *service); +typedef void (*uv_random_cb)(uv_random_t *req, int status, void *buf, size_t buflen); typedef struct { @@ -349,7 +333,6 @@ typedef struct { long tv_nsec; } uv_timespec_t; - typedef struct { uint64_t st_dev; uint64_t st_mode; @@ -369,80 +352,65 @@ typedef struct { uv_timespec_t st_birthtim; } uv_stat_t; +typedef void (*uv_fs_event_cb)(uv_fs_event_t *handle, const char *filename, + int events, int status); -typedef void (*uv_fs_event_cb)(uv_fs_event_t* handle, - const char* filename, - int events, - int status); +typedef void (*uv_fs_poll_cb)(uv_fs_poll_t *handle, int status, + const uv_stat_t *prev, const uv_stat_t *curr); -typedef void (*uv_fs_poll_cb)(uv_fs_poll_t* handle, - int status, - const uv_stat_t* prev, - const uv_stat_t* curr); - -typedef void (*uv_signal_cb)(uv_signal_t* handle, int signum); - - -typedef enum { - UV_LEAVE_GROUP = 0, - UV_JOIN_GROUP -} uv_membership; +typedef void (*uv_signal_cb)(uv_signal_t *handle, int signum); +typedef enum { UV_LEAVE_GROUP = 0, UV_JOIN_GROUP } uv_membership; UV_EXTERN int uv_translate_sys_error(int sys_errno); -UV_EXTERN const char* uv_strerror(int err); -UV_EXTERN char* uv_strerror_r(int err, char* buf, size_t buflen); +UV_EXTERN const char *uv_strerror(int err); +UV_EXTERN char *uv_strerror_r(int err, char *buf, size_t buflen); -UV_EXTERN const char* uv_err_name(int err); -UV_EXTERN char* uv_err_name_r(int err, char* buf, size_t buflen); +UV_EXTERN const char *uv_err_name(int err); +UV_EXTERN char *uv_err_name_r(int err, char *buf, size_t buflen); - -#define UV_REQ_FIELDS \ - /* public */ \ - void* data; \ - /* read-only */ \ - uv_req_type type; \ - /* private */ \ - void* reserved[6]; \ - UV_REQ_PRIVATE_FIELDS \ +#define UV_REQ_FIELDS \ + /* public */ \ + void *data; \ + /* read-only */ \ + uv_req_type type; \ + /* private */ \ + void *reserved[6]; \ + UV_REQ_PRIVATE_FIELDS /* Abstract base class of all requests. */ struct uv_req_s { UV_REQ_FIELDS }; - /* Platform-specific request types. */ UV_PRIVATE_REQ_TYPES - -UV_EXTERN int uv_shutdown(uv_shutdown_t* req, - uv_stream_t* handle, +UV_EXTERN int uv_shutdown(uv_shutdown_t *req, uv_stream_t *handle, uv_shutdown_cb cb); struct uv_shutdown_s { UV_REQ_FIELDS - uv_stream_t* handle; + uv_stream_t *handle; uv_shutdown_cb cb; UV_SHUTDOWN_PRIVATE_FIELDS }; - -#define UV_HANDLE_FIELDS \ - /* public */ \ - void* data; \ - /* read-only */ \ - uv_loop_t* loop; \ - uv_handle_type type; \ - /* private */ \ - uv_close_cb close_cb; \ - void* handle_queue[2]; \ - union { \ - int fd; \ - void* reserved[4]; \ - } u; \ - UV_HANDLE_PRIVATE_FIELDS \ +#define UV_HANDLE_FIELDS \ + /* public */ \ + void *data; \ + /* read-only */ \ + uv_loop_t *loop; \ + uv_handle_type type; \ + /* private */ \ + uv_close_cb close_cb; \ + void *handle_queue[2]; \ + union { \ + int fd; \ + void *reserved[4]; \ + } u; \ + UV_HANDLE_PRIVATE_FIELDS /* The abstract base class of all handles. */ struct uv_handle_s { @@ -450,48 +418,46 @@ struct uv_handle_s { }; UV_EXTERN size_t uv_handle_size(uv_handle_type type); -UV_EXTERN uv_handle_type uv_handle_get_type(const uv_handle_t* handle); -UV_EXTERN const char* uv_handle_type_name(uv_handle_type type); -UV_EXTERN void* uv_handle_get_data(const uv_handle_t* handle); -UV_EXTERN uv_loop_t* uv_handle_get_loop(const uv_handle_t* handle); -UV_EXTERN void uv_handle_set_data(uv_handle_t* handle, void* data); +UV_EXTERN uv_handle_type uv_handle_get_type(const uv_handle_t *handle); +UV_EXTERN const char *uv_handle_type_name(uv_handle_type type); +UV_EXTERN void *uv_handle_get_data(const uv_handle_t *handle); +UV_EXTERN uv_loop_t *uv_handle_get_loop(const uv_handle_t *handle); +UV_EXTERN void uv_handle_set_data(uv_handle_t *handle, void *data); UV_EXTERN size_t uv_req_size(uv_req_type type); -UV_EXTERN void* uv_req_get_data(const uv_req_t* req); -UV_EXTERN void uv_req_set_data(uv_req_t* req, void* data); -UV_EXTERN uv_req_type uv_req_get_type(const uv_req_t* req); -UV_EXTERN const char* uv_req_type_name(uv_req_type type); +UV_EXTERN void *uv_req_get_data(const uv_req_t *req); +UV_EXTERN void uv_req_set_data(uv_req_t *req, void *data); +UV_EXTERN uv_req_type uv_req_get_type(const uv_req_t *req); +UV_EXTERN const char *uv_req_type_name(uv_req_type type); -UV_EXTERN int uv_is_active(const uv_handle_t* handle); +UV_EXTERN int uv_is_active(const uv_handle_t *handle); -UV_EXTERN void uv_walk(uv_loop_t* loop, uv_walk_cb walk_cb, void* arg); +UV_EXTERN void uv_walk(uv_loop_t *loop, uv_walk_cb walk_cb, void *arg); /* Helpers for ad hoc debugging, no API/ABI stability guaranteed. */ -UV_EXTERN void uv_print_all_handles(uv_loop_t* loop, FILE* stream); -UV_EXTERN void uv_print_active_handles(uv_loop_t* loop, FILE* stream); +UV_EXTERN void uv_print_all_handles(uv_loop_t *loop, FILE *stream); +UV_EXTERN void uv_print_active_handles(uv_loop_t *loop, FILE *stream); -UV_EXTERN void uv_close(uv_handle_t* handle, uv_close_cb close_cb); +UV_EXTERN void uv_close(uv_handle_t *handle, uv_close_cb close_cb); -UV_EXTERN int uv_send_buffer_size(uv_handle_t* handle, int* value); -UV_EXTERN int uv_recv_buffer_size(uv_handle_t* handle, int* value); +UV_EXTERN int uv_send_buffer_size(uv_handle_t *handle, int *value); +UV_EXTERN int uv_recv_buffer_size(uv_handle_t *handle, int *value); -UV_EXTERN int uv_fileno(const uv_handle_t* handle, uv_os_fd_t* fd); +UV_EXTERN int uv_fileno(const uv_handle_t *handle, uv_os_fd_t *fd); -UV_EXTERN uv_buf_t uv_buf_init(char* base, unsigned int len); +UV_EXTERN uv_buf_t uv_buf_init(char *base, unsigned int len); UV_EXTERN int uv_pipe(uv_file fds[2], int read_flags, int write_flags); -UV_EXTERN int uv_socketpair(int type, - int protocol, - uv_os_sock_t socket_vector[2], - int flags0, +UV_EXTERN int uv_socketpair(int type, int protocol, + uv_os_sock_t socket_vector[2], int flags0, int flags1); -#define UV_STREAM_FIELDS \ - /* number of bytes queued for writing */ \ - size_t write_queue_size; \ - uv_alloc_cb alloc_cb; \ - uv_read_cb read_cb; \ - /* private */ \ +#define UV_STREAM_FIELDS \ + /* number of bytes queued for writing */ \ + size_t write_queue_size; \ + uv_alloc_cb alloc_cb; \ + uv_read_cb read_cb; \ + /* private */ \ UV_STREAM_PRIVATE_FIELDS /* @@ -506,52 +472,41 @@ struct uv_stream_s { UV_STREAM_FIELDS }; -UV_EXTERN size_t uv_stream_get_write_queue_size(const uv_stream_t* stream); +UV_EXTERN size_t uv_stream_get_write_queue_size(const uv_stream_t *stream); -UV_EXTERN int uv_listen(uv_stream_t* stream, int backlog, uv_connection_cb cb); -UV_EXTERN int uv_accept(uv_stream_t* server, uv_stream_t* client); +UV_EXTERN int uv_listen(uv_stream_t *stream, int backlog, uv_connection_cb cb); +UV_EXTERN int uv_accept(uv_stream_t *server, uv_stream_t *client); -UV_EXTERN int uv_read_start(uv_stream_t*, - uv_alloc_cb alloc_cb, +UV_EXTERN int uv_read_start(uv_stream_t *, uv_alloc_cb alloc_cb, uv_read_cb read_cb); -UV_EXTERN int uv_read_stop(uv_stream_t*); +UV_EXTERN int uv_read_stop(uv_stream_t *); -UV_EXTERN int uv_write(uv_write_t* req, - uv_stream_t* handle, - const uv_buf_t bufs[], - unsigned int nbufs, +UV_EXTERN int uv_write(uv_write_t *req, uv_stream_t *handle, + const uv_buf_t bufs[], unsigned int nbufs, uv_write_cb cb); -UV_EXTERN int uv_write2(uv_write_t* req, - uv_stream_t* handle, - const uv_buf_t bufs[], - unsigned int nbufs, - uv_stream_t* send_handle, - uv_write_cb cb); -UV_EXTERN int uv_try_write(uv_stream_t* handle, - const uv_buf_t bufs[], +UV_EXTERN int uv_write2(uv_write_t *req, uv_stream_t *handle, + const uv_buf_t bufs[], unsigned int nbufs, + uv_stream_t *send_handle, uv_write_cb cb); +UV_EXTERN int uv_try_write(uv_stream_t *handle, const uv_buf_t bufs[], unsigned int nbufs); -UV_EXTERN int uv_try_write2(uv_stream_t* handle, - const uv_buf_t bufs[], - unsigned int nbufs, - uv_stream_t* send_handle); +UV_EXTERN int uv_try_write2(uv_stream_t *handle, const uv_buf_t bufs[], + unsigned int nbufs, uv_stream_t *send_handle); /* uv_write_t is a subclass of uv_req_t. */ struct uv_write_s { UV_REQ_FIELDS uv_write_cb cb; - uv_stream_t* send_handle; /* TODO: make private and unix-only in v2.x. */ - uv_stream_t* handle; + uv_stream_t *send_handle; /* TODO: make private and unix-only in v2.x. */ + uv_stream_t *handle; UV_WRITE_PRIVATE_FIELDS }; +UV_EXTERN int uv_is_readable(const uv_stream_t *handle); +UV_EXTERN int uv_is_writable(const uv_stream_t *handle); -UV_EXTERN int uv_is_readable(const uv_stream_t* handle); -UV_EXTERN int uv_is_writable(const uv_stream_t* handle); - -UV_EXTERN int uv_stream_set_blocking(uv_stream_t* handle, int blocking); - -UV_EXTERN int uv_is_closing(const uv_handle_t* handle); +UV_EXTERN int uv_stream_set_blocking(uv_stream_t *handle, int blocking); +UV_EXTERN int uv_is_closing(const uv_handle_t *handle); /* * uv_tcp_t is a subclass of uv_stream_t. @@ -564,44 +519,37 @@ struct uv_tcp_s { UV_TCP_PRIVATE_FIELDS }; -UV_EXTERN int uv_tcp_init(uv_loop_t*, uv_tcp_t* handle); -UV_EXTERN int uv_tcp_init_ex(uv_loop_t*, uv_tcp_t* handle, unsigned int flags); -UV_EXTERN int uv_tcp_open(uv_tcp_t* handle, uv_os_sock_t sock); -UV_EXTERN int uv_tcp_nodelay(uv_tcp_t* handle, int enable); -UV_EXTERN int uv_tcp_keepalive(uv_tcp_t* handle, - int enable, +UV_EXTERN int uv_tcp_init(uv_loop_t *, uv_tcp_t *handle); +UV_EXTERN int uv_tcp_init_ex(uv_loop_t *, uv_tcp_t *handle, unsigned int flags); +UV_EXTERN int uv_tcp_open(uv_tcp_t *handle, uv_os_sock_t sock); +UV_EXTERN int uv_tcp_nodelay(uv_tcp_t *handle, int enable); +UV_EXTERN int uv_tcp_keepalive(uv_tcp_t *handle, int enable, unsigned int delay); -UV_EXTERN int uv_tcp_simultaneous_accepts(uv_tcp_t* handle, int enable); +UV_EXTERN int uv_tcp_simultaneous_accepts(uv_tcp_t *handle, int enable); enum uv_tcp_flags { /* Used with uv_tcp_bind, when an IPv6 address is used. */ UV_TCP_IPV6ONLY = 1 }; -UV_EXTERN int uv_tcp_bind(uv_tcp_t* handle, - const struct sockaddr* addr, +UV_EXTERN int uv_tcp_bind(uv_tcp_t *handle, const struct sockaddr *addr, unsigned int flags); -UV_EXTERN int uv_tcp_getsockname(const uv_tcp_t* handle, - struct sockaddr* name, - int* namelen); -UV_EXTERN int uv_tcp_getpeername(const uv_tcp_t* handle, - struct sockaddr* name, - int* namelen); -UV_EXTERN int uv_tcp_close_reset(uv_tcp_t* handle, uv_close_cb close_cb); -UV_EXTERN int uv_tcp_connect(uv_connect_t* req, - uv_tcp_t* handle, - const struct sockaddr* addr, - uv_connect_cb cb); +UV_EXTERN int uv_tcp_getsockname(const uv_tcp_t *handle, struct sockaddr *name, + int *namelen); +UV_EXTERN int uv_tcp_getpeername(const uv_tcp_t *handle, struct sockaddr *name, + int *namelen); +UV_EXTERN int uv_tcp_close_reset(uv_tcp_t *handle, uv_close_cb close_cb); +UV_EXTERN int uv_tcp_connect(uv_connect_t *req, uv_tcp_t *handle, + const struct sockaddr *addr, uv_connect_cb cb); /* uv_connect_t is a subclass of uv_req_t. */ struct uv_connect_s { UV_REQ_FIELDS uv_connect_cb cb; - uv_stream_t* handle; + uv_stream_t *handle; UV_CONNECT_PRIVATE_FIELDS }; - /* * UDP support. */ @@ -648,11 +596,9 @@ enum uv_udp_flags { UV_UDP_RECVMMSG = 256 }; -typedef void (*uv_udp_send_cb)(uv_udp_send_t* req, int status); -typedef void (*uv_udp_recv_cb)(uv_udp_t* handle, - ssize_t nread, - const uv_buf_t* buf, - const struct sockaddr* addr, +typedef void (*uv_udp_send_cb)(uv_udp_send_t *req, int status); +typedef void (*uv_udp_recv_cb)(uv_udp_t *handle, ssize_t nread, + const uv_buf_t *buf, const struct sockaddr *addr, unsigned flags); /* uv_udp_t is a subclass of uv_handle_t. */ @@ -674,58 +620,48 @@ struct uv_udp_s { /* uv_udp_send_t is a subclass of uv_req_t. */ struct uv_udp_send_s { UV_REQ_FIELDS - uv_udp_t* handle; + uv_udp_t *handle; uv_udp_send_cb cb; UV_UDP_SEND_PRIVATE_FIELDS }; -UV_EXTERN int uv_udp_init(uv_loop_t*, uv_udp_t* handle); -UV_EXTERN int uv_udp_init_ex(uv_loop_t*, uv_udp_t* handle, unsigned int flags); -UV_EXTERN int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock); -UV_EXTERN int uv_udp_bind(uv_udp_t* handle, - const struct sockaddr* addr, +UV_EXTERN int uv_udp_init(uv_loop_t *, uv_udp_t *handle); +UV_EXTERN int uv_udp_init_ex(uv_loop_t *, uv_udp_t *handle, unsigned int flags); +UV_EXTERN int uv_udp_open(uv_udp_t *handle, uv_os_sock_t sock); +UV_EXTERN int uv_udp_bind(uv_udp_t *handle, const struct sockaddr *addr, unsigned int flags); -UV_EXTERN int uv_udp_connect(uv_udp_t* handle, const struct sockaddr* addr); - -UV_EXTERN int uv_udp_getpeername(const uv_udp_t* handle, - struct sockaddr* name, - int* namelen); -UV_EXTERN int uv_udp_getsockname(const uv_udp_t* handle, - struct sockaddr* name, - int* namelen); -UV_EXTERN int uv_udp_set_membership(uv_udp_t* handle, - const char* multicast_addr, - const char* interface_addr, +UV_EXTERN int uv_udp_connect(uv_udp_t *handle, const struct sockaddr *addr); + +UV_EXTERN int uv_udp_getpeername(const uv_udp_t *handle, struct sockaddr *name, + int *namelen); +UV_EXTERN int uv_udp_getsockname(const uv_udp_t *handle, struct sockaddr *name, + int *namelen); +UV_EXTERN int uv_udp_set_membership(uv_udp_t *handle, + const char *multicast_addr, + const char *interface_addr, uv_membership membership); -UV_EXTERN int uv_udp_set_source_membership(uv_udp_t* handle, - const char* multicast_addr, - const char* interface_addr, - const char* source_addr, +UV_EXTERN int uv_udp_set_source_membership(uv_udp_t *handle, + const char *multicast_addr, + const char *interface_addr, + const char *source_addr, uv_membership membership); -UV_EXTERN int uv_udp_set_multicast_loop(uv_udp_t* handle, int on); -UV_EXTERN int uv_udp_set_multicast_ttl(uv_udp_t* handle, int ttl); -UV_EXTERN int uv_udp_set_multicast_interface(uv_udp_t* handle, - const char* interface_addr); -UV_EXTERN int uv_udp_set_broadcast(uv_udp_t* handle, int on); -UV_EXTERN int uv_udp_set_ttl(uv_udp_t* handle, int ttl); -UV_EXTERN int uv_udp_send(uv_udp_send_t* req, - uv_udp_t* handle, - const uv_buf_t bufs[], - unsigned int nbufs, - const struct sockaddr* addr, - uv_udp_send_cb send_cb); -UV_EXTERN int uv_udp_try_send(uv_udp_t* handle, - const uv_buf_t bufs[], - unsigned int nbufs, - const struct sockaddr* addr); -UV_EXTERN int uv_udp_recv_start(uv_udp_t* handle, - uv_alloc_cb alloc_cb, +UV_EXTERN int uv_udp_set_multicast_loop(uv_udp_t *handle, int on); +UV_EXTERN int uv_udp_set_multicast_ttl(uv_udp_t *handle, int ttl); +UV_EXTERN int uv_udp_set_multicast_interface(uv_udp_t *handle, + const char *interface_addr); +UV_EXTERN int uv_udp_set_broadcast(uv_udp_t *handle, int on); +UV_EXTERN int uv_udp_set_ttl(uv_udp_t *handle, int ttl); +UV_EXTERN int uv_udp_send(uv_udp_send_t *req, uv_udp_t *handle, + const uv_buf_t bufs[], unsigned int nbufs, + const struct sockaddr *addr, uv_udp_send_cb send_cb); +UV_EXTERN int uv_udp_try_send(uv_udp_t *handle, const uv_buf_t bufs[], + unsigned int nbufs, const struct sockaddr *addr); +UV_EXTERN int uv_udp_recv_start(uv_udp_t *handle, uv_alloc_cb alloc_cb, uv_udp_recv_cb recv_cb); -UV_EXTERN int uv_udp_using_recvmmsg(const uv_udp_t* handle); -UV_EXTERN int uv_udp_recv_stop(uv_udp_t* handle); -UV_EXTERN size_t uv_udp_get_send_queue_size(const uv_udp_t* handle); -UV_EXTERN size_t uv_udp_get_send_queue_count(const uv_udp_t* handle); - +UV_EXTERN int uv_udp_using_recvmmsg(const uv_udp_t *handle); +UV_EXTERN int uv_udp_recv_stop(uv_udp_t *handle); +UV_EXTERN size_t uv_udp_get_send_queue_size(const uv_udp_t *handle); +UV_EXTERN size_t uv_udp_get_send_queue_count(const uv_udp_t *handle); /* * uv_tty_t is a subclass of uv_stream_t. @@ -759,21 +695,19 @@ typedef enum { UV_TTY_UNSUPPORTED } uv_tty_vtermstate_t; - -UV_EXTERN int uv_tty_init(uv_loop_t*, uv_tty_t*, uv_file fd, int readable); -UV_EXTERN int uv_tty_set_mode(uv_tty_t*, uv_tty_mode_t mode); +UV_EXTERN int uv_tty_init(uv_loop_t *, uv_tty_t *, uv_file fd, int readable); +UV_EXTERN int uv_tty_set_mode(uv_tty_t *, uv_tty_mode_t mode); UV_EXTERN int uv_tty_reset_mode(void); -UV_EXTERN int uv_tty_get_winsize(uv_tty_t*, int* width, int* height); +UV_EXTERN int uv_tty_get_winsize(uv_tty_t *, int *width, int *height); UV_EXTERN void uv_tty_set_vterm_state(uv_tty_vtermstate_t state); -UV_EXTERN int uv_tty_get_vterm_state(uv_tty_vtermstate_t* state); +UV_EXTERN int uv_tty_get_vterm_state(uv_tty_vtermstate_t *state); #ifdef __cplusplus extern "C++" { -inline int uv_tty_set_mode(uv_tty_t* handle, int mode) { +inline int uv_tty_set_mode(uv_tty_t *handle, int mode) { return uv_tty_set_mode(handle, static_cast(mode)); } - } #endif @@ -792,24 +726,19 @@ struct uv_pipe_s { UV_PIPE_PRIVATE_FIELDS }; -UV_EXTERN int uv_pipe_init(uv_loop_t*, uv_pipe_t* handle, int ipc); -UV_EXTERN int uv_pipe_open(uv_pipe_t*, uv_file file); -UV_EXTERN int uv_pipe_bind(uv_pipe_t* handle, const char* name); -UV_EXTERN void uv_pipe_connect(uv_connect_t* req, - uv_pipe_t* handle, - const char* name, - uv_connect_cb cb); -UV_EXTERN int uv_pipe_getsockname(const uv_pipe_t* handle, - char* buffer, - size_t* size); -UV_EXTERN int uv_pipe_getpeername(const uv_pipe_t* handle, - char* buffer, - size_t* size); -UV_EXTERN void uv_pipe_pending_instances(uv_pipe_t* handle, int count); -UV_EXTERN int uv_pipe_pending_count(uv_pipe_t* handle); -UV_EXTERN uv_handle_type uv_pipe_pending_type(uv_pipe_t* handle); -UV_EXTERN int uv_pipe_chmod(uv_pipe_t* handle, int flags); - +UV_EXTERN int uv_pipe_init(uv_loop_t *, uv_pipe_t *handle, int ipc); +UV_EXTERN int uv_pipe_open(uv_pipe_t *, uv_file file); +UV_EXTERN int uv_pipe_bind(uv_pipe_t *handle, const char *name); +UV_EXTERN void uv_pipe_connect(uv_connect_t *req, uv_pipe_t *handle, + const char *name, uv_connect_cb cb); +UV_EXTERN int uv_pipe_getsockname(const uv_pipe_t *handle, char *buffer, + size_t *size); +UV_EXTERN int uv_pipe_getpeername(const uv_pipe_t *handle, char *buffer, + size_t *size); +UV_EXTERN void uv_pipe_pending_instances(uv_pipe_t *handle, int count); +UV_EXTERN int uv_pipe_pending_count(uv_pipe_t *handle); +UV_EXTERN uv_handle_type uv_pipe_pending_type(uv_pipe_t *handle); +UV_EXTERN int uv_pipe_chmod(uv_pipe_t *handle, int flags); struct uv_poll_s { UV_HANDLE_FIELDS @@ -824,54 +753,47 @@ enum uv_poll_event { UV_PRIORITIZED = 8 }; -UV_EXTERN int uv_poll_init(uv_loop_t* loop, uv_poll_t* handle, int fd); -UV_EXTERN int uv_poll_init_socket(uv_loop_t* loop, - uv_poll_t* handle, +UV_EXTERN int uv_poll_init(uv_loop_t *loop, uv_poll_t *handle, int fd); +UV_EXTERN int uv_poll_init_socket(uv_loop_t *loop, uv_poll_t *handle, uv_os_sock_t socket); -UV_EXTERN int uv_poll_start(uv_poll_t* handle, int events, uv_poll_cb cb); -UV_EXTERN int uv_poll_stop(uv_poll_t* handle); - +UV_EXTERN int uv_poll_start(uv_poll_t *handle, int events, uv_poll_cb cb); +UV_EXTERN int uv_poll_stop(uv_poll_t *handle); struct uv_prepare_s { UV_HANDLE_FIELDS UV_PREPARE_PRIVATE_FIELDS }; -UV_EXTERN int uv_prepare_init(uv_loop_t*, uv_prepare_t* prepare); -UV_EXTERN int uv_prepare_start(uv_prepare_t* prepare, uv_prepare_cb cb); -UV_EXTERN int uv_prepare_stop(uv_prepare_t* prepare); - +UV_EXTERN int uv_prepare_init(uv_loop_t *, uv_prepare_t *prepare); +UV_EXTERN int uv_prepare_start(uv_prepare_t *prepare, uv_prepare_cb cb); +UV_EXTERN int uv_prepare_stop(uv_prepare_t *prepare); struct uv_check_s { UV_HANDLE_FIELDS UV_CHECK_PRIVATE_FIELDS }; -UV_EXTERN int uv_check_init(uv_loop_t*, uv_check_t* check); -UV_EXTERN int uv_check_start(uv_check_t* check, uv_check_cb cb); -UV_EXTERN int uv_check_stop(uv_check_t* check); - +UV_EXTERN int uv_check_init(uv_loop_t *, uv_check_t *check); +UV_EXTERN int uv_check_start(uv_check_t *check, uv_check_cb cb); +UV_EXTERN int uv_check_stop(uv_check_t *check); struct uv_idle_s { UV_HANDLE_FIELDS UV_IDLE_PRIVATE_FIELDS }; -UV_EXTERN int uv_idle_init(uv_loop_t*, uv_idle_t* idle); -UV_EXTERN int uv_idle_start(uv_idle_t* idle, uv_idle_cb cb); -UV_EXTERN int uv_idle_stop(uv_idle_t* idle); - +UV_EXTERN int uv_idle_init(uv_loop_t *, uv_idle_t *idle); +UV_EXTERN int uv_idle_start(uv_idle_t *idle, uv_idle_cb cb); +UV_EXTERN int uv_idle_stop(uv_idle_t *idle); struct uv_async_s { UV_HANDLE_FIELDS UV_ASYNC_PRIVATE_FIELDS }; -UV_EXTERN int uv_async_init(uv_loop_t*, - uv_async_t* async, +UV_EXTERN int uv_async_init(uv_loop_t *, uv_async_t *async, uv_async_cb async_cb); -UV_EXTERN int uv_async_send(uv_async_t* async); - +UV_EXTERN int uv_async_send(uv_async_t *async); /* * uv_timer_t is a subclass of uv_handle_t. @@ -883,17 +805,14 @@ struct uv_timer_s { UV_TIMER_PRIVATE_FIELDS }; -UV_EXTERN int uv_timer_init(uv_loop_t*, uv_timer_t* handle); -UV_EXTERN int uv_timer_start(uv_timer_t* handle, - uv_timer_cb cb, - uint64_t timeout, - uint64_t repeat); -UV_EXTERN int uv_timer_stop(uv_timer_t* handle); -UV_EXTERN int uv_timer_again(uv_timer_t* handle); -UV_EXTERN void uv_timer_set_repeat(uv_timer_t* handle, uint64_t repeat); -UV_EXTERN uint64_t uv_timer_get_repeat(const uv_timer_t* handle); -UV_EXTERN uint64_t uv_timer_get_due_in(const uv_timer_t* handle); - +UV_EXTERN int uv_timer_init(uv_loop_t *, uv_timer_t *handle); +UV_EXTERN int uv_timer_start(uv_timer_t *handle, uv_timer_cb cb, + uint64_t timeout, uint64_t repeat); +UV_EXTERN int uv_timer_stop(uv_timer_t *handle); +UV_EXTERN int uv_timer_again(uv_timer_t *handle); +UV_EXTERN void uv_timer_set_repeat(uv_timer_t *handle, uint64_t repeat); +UV_EXTERN uint64_t uv_timer_get_repeat(const uv_timer_t *handle); +UV_EXTERN uint64_t uv_timer_get_due_in(const uv_timer_t *handle); /* * uv_getaddrinfo_t is a subclass of uv_req_t. @@ -903,46 +822,38 @@ UV_EXTERN uint64_t uv_timer_get_due_in(const uv_timer_t* handle); struct uv_getaddrinfo_s { UV_REQ_FIELDS /* read-only */ - uv_loop_t* loop; + uv_loop_t *loop; /* struct addrinfo* addrinfo is marked as private, but it really isn't. */ UV_GETADDRINFO_PRIVATE_FIELDS }; - -UV_EXTERN int uv_getaddrinfo(uv_loop_t* loop, - uv_getaddrinfo_t* req, - uv_getaddrinfo_cb getaddrinfo_cb, - const char* node, - const char* service, - const struct addrinfo* hints); -UV_EXTERN void uv_freeaddrinfo(struct addrinfo* ai); - +UV_EXTERN int uv_getaddrinfo(uv_loop_t *loop, uv_getaddrinfo_t *req, + uv_getaddrinfo_cb getaddrinfo_cb, const char *node, + const char *service, const struct addrinfo *hints); +UV_EXTERN void uv_freeaddrinfo(struct addrinfo *ai); /* -* uv_getnameinfo_t is a subclass of uv_req_t. -* -* Request object for uv_getnameinfo. -*/ + * uv_getnameinfo_t is a subclass of uv_req_t. + * + * Request object for uv_getnameinfo. + */ struct uv_getnameinfo_s { UV_REQ_FIELDS /* read-only */ - uv_loop_t* loop; + uv_loop_t *loop; /* host and service are marked as private, but they really aren't. */ UV_GETNAMEINFO_PRIVATE_FIELDS }; -UV_EXTERN int uv_getnameinfo(uv_loop_t* loop, - uv_getnameinfo_t* req, +UV_EXTERN int uv_getnameinfo(uv_loop_t *loop, uv_getnameinfo_t *req, uv_getnameinfo_cb getnameinfo_cb, - const struct sockaddr* addr, - int flags); - + const struct sockaddr *addr, int flags); /* uv_spawn() options. */ typedef enum { - UV_IGNORE = 0x00, - UV_CREATE_PIPE = 0x01, - UV_INHERIT_FD = 0x02, + UV_IGNORE = 0x00, + UV_CREATE_PIPE = 0x01, + UV_INHERIT_FD = 0x02, UV_INHERIT_STREAM = 0x04, /* @@ -950,8 +861,8 @@ typedef enum { * determine the direction of flow, from the child process' perspective. Both * flags may be specified to create a duplex data stream. */ - UV_READABLE_PIPE = 0x10, - UV_WRITABLE_PIPE = 0x20, + UV_READABLE_PIPE = 0x10, + UV_WRITABLE_PIPE = 0x20, /* * When UV_CREATE_PIPE is specified, specifying UV_NONBLOCK_PIPE opens the @@ -959,7 +870,7 @@ typedef enum { * if the child is not designed to handle to encounter this mode, * but can also be significantly more efficient. */ - UV_NONBLOCK_PIPE = 0x40, + UV_NONBLOCK_PIPE = 0x40, UV_OVERLAPPED_PIPE = 0x40 /* old name, for compatibility */ } uv_stdio_flags; @@ -967,31 +878,31 @@ typedef struct uv_stdio_container_s { uv_stdio_flags flags; union { - uv_stream_t* stream; + uv_stream_t *stream; int fd; } data; } uv_stdio_container_t; typedef struct uv_process_options_s { uv_exit_cb exit_cb; /* Called after the process exits. */ - const char* file; /* Path to program to execute. */ + const char *file; /* Path to program to execute. */ /* * Command line arguments. args[0] should be the path to the program. On * Windows this uses CreateProcess which concatenates the arguments into a * string this can cause some strange errors. See the note at * windows_verbatim_arguments. */ - char** args; + char **args; /* * This will be set as the environ variable in the subprocess. If this is * NULL then the parents environ will be used. */ - char** env; + char **env; /* * If non-null this represents a directory the subprocess should execute * in. Stands for current working directory. */ - const char* cwd; + const char *cwd; /* * Various flags that control how uv_spawn() behaves. See the definition of * `enum uv_process_flags` below. @@ -1007,7 +918,7 @@ typedef struct uv_process_options_s { * child process only if the child processes uses the MSVCRT runtime. */ int stdio_count; - uv_stdio_container_t* stdio; + uv_stdio_container_t *stdio; /* * Libuv can change the child process' user/group id. This happens only when * the appropriate bits are set in the flags fields. This is not supported on @@ -1076,49 +987,44 @@ struct uv_process_s { UV_PROCESS_PRIVATE_FIELDS }; -UV_EXTERN int uv_spawn(uv_loop_t* loop, - uv_process_t* handle, - const uv_process_options_t* options); -UV_EXTERN int uv_process_kill(uv_process_t*, int signum); +UV_EXTERN int uv_spawn(uv_loop_t *loop, uv_process_t *handle, + const uv_process_options_t *options); +UV_EXTERN int uv_process_kill(uv_process_t *, int signum); UV_EXTERN int uv_kill(int pid, int signum); -UV_EXTERN uv_pid_t uv_process_get_pid(const uv_process_t*); - +UV_EXTERN uv_pid_t uv_process_get_pid(const uv_process_t *); /* * uv_work_t is a subclass of uv_req_t. */ struct uv_work_s { UV_REQ_FIELDS - uv_loop_t* loop; + uv_loop_t *loop; uv_work_cb work_cb; uv_after_work_cb after_work_cb; UV_WORK_PRIVATE_FIELDS }; -UV_EXTERN int uv_queue_work(uv_loop_t* loop, - uv_work_t* req, - uv_work_cb work_cb, +UV_EXTERN int uv_queue_work(uv_loop_t *loop, uv_work_t *req, uv_work_cb work_cb, uv_after_work_cb after_work_cb); -UV_EXTERN int uv_cancel(uv_req_t* req); - +UV_EXTERN int uv_cancel(uv_req_t *req); struct uv_cpu_times_s { uint64_t user; /* milliseconds */ uint64_t nice; /* milliseconds */ - uint64_t sys; /* milliseconds */ + uint64_t sys; /* milliseconds */ uint64_t idle; /* milliseconds */ - uint64_t irq; /* milliseconds */ + uint64_t irq; /* milliseconds */ }; struct uv_cpu_info_s { - char* model; + char *model; int speed; struct uv_cpu_times_s cpu_times; }; struct uv_interface_address_s { - char* name; + char *name; char phys_addr[6]; int is_internal; union { @@ -1132,11 +1038,11 @@ struct uv_interface_address_s { }; struct uv_passwd_s { - char* username; + char *username; long uid; long gid; - char* shell; - char* homedir; + char *shell; + char *homedir; }; struct uv_utsname_s { @@ -1172,15 +1078,15 @@ typedef enum { } uv_dirent_type_t; struct uv_dirent_s { - const char* name; + const char *name; uv_dirent_type_t type; }; -UV_EXTERN char** uv_setup_args(int argc, char** argv); -UV_EXTERN int uv_get_process_title(char* buffer, size_t size); -UV_EXTERN int uv_set_process_title(const char* title); -UV_EXTERN int uv_resident_set_memory(size_t* rss); -UV_EXTERN int uv_uptime(double* uptime); +UV_EXTERN char **uv_setup_args(int argc, char **argv); +UV_EXTERN int uv_get_process_title(char *buffer, size_t size); +UV_EXTERN int uv_set_process_title(const char *title); +UV_EXTERN int uv_resident_set_memory(size_t *rss); +UV_EXTERN int uv_uptime(double *uptime); UV_EXTERN uv_os_fd_t uv_get_osfhandle(int fd); UV_EXTERN int uv_open_osfhandle(uv_os_fd_t os_fd); @@ -1195,88 +1101,88 @@ typedef struct { } uv_timeval64_t; typedef struct { - uv_timeval_t ru_utime; /* user CPU time used */ - uv_timeval_t ru_stime; /* system CPU time used */ - uint64_t ru_maxrss; /* maximum resident set size */ - uint64_t ru_ixrss; /* integral shared memory size */ - uint64_t ru_idrss; /* integral unshared data size */ - uint64_t ru_isrss; /* integral unshared stack size */ - uint64_t ru_minflt; /* page reclaims (soft page faults) */ - uint64_t ru_majflt; /* page faults (hard page faults) */ - uint64_t ru_nswap; /* swaps */ - uint64_t ru_inblock; /* block input operations */ - uint64_t ru_oublock; /* block output operations */ - uint64_t ru_msgsnd; /* IPC messages sent */ - uint64_t ru_msgrcv; /* IPC messages received */ - uint64_t ru_nsignals; /* signals received */ - uint64_t ru_nvcsw; /* voluntary context switches */ - uint64_t ru_nivcsw; /* involuntary context switches */ + uv_timeval_t ru_utime; /* user CPU time used */ + uv_timeval_t ru_stime; /* system CPU time used */ + uint64_t ru_maxrss; /* maximum resident set size */ + uint64_t ru_ixrss; /* integral shared memory size */ + uint64_t ru_idrss; /* integral unshared data size */ + uint64_t ru_isrss; /* integral unshared stack size */ + uint64_t ru_minflt; /* page reclaims (soft page faults) */ + uint64_t ru_majflt; /* page faults (hard page faults) */ + uint64_t ru_nswap; /* swaps */ + uint64_t ru_inblock; /* block input operations */ + uint64_t ru_oublock; /* block output operations */ + uint64_t ru_msgsnd; /* IPC messages sent */ + uint64_t ru_msgrcv; /* IPC messages received */ + uint64_t ru_nsignals; /* signals received */ + uint64_t ru_nvcsw; /* voluntary context switches */ + uint64_t ru_nivcsw; /* involuntary context switches */ } uv_rusage_t; -UV_EXTERN int uv_getrusage(uv_rusage_t* rusage); +UV_EXTERN int uv_getrusage(uv_rusage_t *rusage); -UV_EXTERN int uv_os_homedir(char* buffer, size_t* size); -UV_EXTERN int uv_os_tmpdir(char* buffer, size_t* size); -UV_EXTERN int uv_os_get_passwd(uv_passwd_t* pwd); -UV_EXTERN void uv_os_free_passwd(uv_passwd_t* pwd); +UV_EXTERN int uv_os_homedir(char *buffer, size_t *size); +UV_EXTERN int uv_os_tmpdir(char *buffer, size_t *size); +UV_EXTERN int uv_os_get_passwd(uv_passwd_t *pwd); +UV_EXTERN void uv_os_free_passwd(uv_passwd_t *pwd); UV_EXTERN uv_pid_t uv_os_getpid(void); UV_EXTERN uv_pid_t uv_os_getppid(void); #if defined(__PASE__) /* On IBM i PASE, the highest process priority is -10 */ -# define UV_PRIORITY_LOW 39 /* RUNPTY(99) */ -# define UV_PRIORITY_BELOW_NORMAL 15 /* RUNPTY(50) */ -# define UV_PRIORITY_NORMAL 0 /* RUNPTY(20) */ -# define UV_PRIORITY_ABOVE_NORMAL -4 /* RUNTY(12) */ -# define UV_PRIORITY_HIGH -7 /* RUNPTY(6) */ -# define UV_PRIORITY_HIGHEST -10 /* RUNPTY(1) */ +#define UV_PRIORITY_LOW 39 /* RUNPTY(99) */ +#define UV_PRIORITY_BELOW_NORMAL 15 /* RUNPTY(50) */ +#define UV_PRIORITY_NORMAL 0 /* RUNPTY(20) */ +#define UV_PRIORITY_ABOVE_NORMAL -4 /* RUNTY(12) */ +#define UV_PRIORITY_HIGH -7 /* RUNPTY(6) */ +#define UV_PRIORITY_HIGHEST -10 /* RUNPTY(1) */ #else -# define UV_PRIORITY_LOW 19 -# define UV_PRIORITY_BELOW_NORMAL 10 -# define UV_PRIORITY_NORMAL 0 -# define UV_PRIORITY_ABOVE_NORMAL -7 -# define UV_PRIORITY_HIGH -14 -# define UV_PRIORITY_HIGHEST -20 +#define UV_PRIORITY_LOW 19 +#define UV_PRIORITY_BELOW_NORMAL 10 +#define UV_PRIORITY_NORMAL 0 +#define UV_PRIORITY_ABOVE_NORMAL -7 +#define UV_PRIORITY_HIGH -14 +#define UV_PRIORITY_HIGHEST -20 #endif -UV_EXTERN int uv_os_getpriority(uv_pid_t pid, int* priority); +UV_EXTERN int uv_os_getpriority(uv_pid_t pid, int *priority); UV_EXTERN int uv_os_setpriority(uv_pid_t pid, int priority); -UV_EXTERN int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count); -UV_EXTERN void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count); +UV_EXTERN int uv_cpu_info(uv_cpu_info_t **cpu_infos, int *count); +UV_EXTERN void uv_free_cpu_info(uv_cpu_info_t *cpu_infos, int count); -UV_EXTERN int uv_interface_addresses(uv_interface_address_t** addresses, - int* count); -UV_EXTERN void uv_free_interface_addresses(uv_interface_address_t* addresses, +UV_EXTERN int uv_interface_addresses(uv_interface_address_t **addresses, + int *count); +UV_EXTERN void uv_free_interface_addresses(uv_interface_address_t *addresses, int count); struct uv_env_item_s { - char* name; - char* value; + char *name; + char *value; }; -UV_EXTERN int uv_os_environ(uv_env_item_t** envitems, int* count); -UV_EXTERN void uv_os_free_environ(uv_env_item_t* envitems, int count); -UV_EXTERN int uv_os_getenv(const char* name, char* buffer, size_t* size); -UV_EXTERN int uv_os_setenv(const char* name, const char* value); -UV_EXTERN int uv_os_unsetenv(const char* name); +UV_EXTERN int uv_os_environ(uv_env_item_t **envitems, int *count); +UV_EXTERN void uv_os_free_environ(uv_env_item_t *envitems, int count); +UV_EXTERN int uv_os_getenv(const char *name, char *buffer, size_t *size); +UV_EXTERN int uv_os_setenv(const char *name, const char *value); +UV_EXTERN int uv_os_unsetenv(const char *name); #ifdef MAXHOSTNAMELEN -# define UV_MAXHOSTNAMESIZE (MAXHOSTNAMELEN + 1) +#define UV_MAXHOSTNAMESIZE (MAXHOSTNAMELEN + 1) #else - /* - Fallback for the maximum hostname size, including the null terminator. The - Windows gethostname() documentation states that 256 bytes will always be - large enough to hold the null-terminated hostname. - */ -# define UV_MAXHOSTNAMESIZE 256 +/* + Fallback for the maximum hostname size, including the null terminator. The + Windows gethostname() documentation states that 256 bytes will always be + large enough to hold the null-terminated hostname. +*/ +#define UV_MAXHOSTNAMESIZE 256 #endif -UV_EXTERN int uv_os_gethostname(char* buffer, size_t* size); +UV_EXTERN int uv_os_gethostname(char *buffer, size_t *size); -UV_EXTERN int uv_os_uname(uv_utsname_t* buffer); +UV_EXTERN int uv_os_uname(uv_utsname_t *buffer); -UV_EXTERN uint64_t uv_metrics_idle_time(uv_loop_t* loop); +UV_EXTERN uint64_t uv_metrics_idle_time(uv_loop_t *loop); typedef enum { UV_FS_UNKNOWN = -1, @@ -1320,9 +1226,9 @@ typedef enum { } uv_fs_type; struct uv_dir_s { - uv_dirent_t* dirents; + uv_dirent_t *dirents; size_t nentries; - void* reserved[4]; + void *reserved[4]; UV_DIR_PRIVATE_FIELDS }; @@ -1330,56 +1236,40 @@ struct uv_dir_s { struct uv_fs_s { UV_REQ_FIELDS uv_fs_type fs_type; - uv_loop_t* loop; + uv_loop_t *loop; uv_fs_cb cb; ssize_t result; - void* ptr; - const char* path; - uv_stat_t statbuf; /* Stores the result of uv_fs_stat() and uv_fs_fstat(). */ + void *ptr; + const char *path; + uv_stat_t statbuf; /* Stores the result of uv_fs_stat() and uv_fs_fstat(). */ UV_FS_PRIVATE_FIELDS }; -UV_EXTERN uv_fs_type uv_fs_get_type(const uv_fs_t*); -UV_EXTERN ssize_t uv_fs_get_result(const uv_fs_t*); -UV_EXTERN int uv_fs_get_system_error(const uv_fs_t*); -UV_EXTERN void* uv_fs_get_ptr(const uv_fs_t*); -UV_EXTERN const char* uv_fs_get_path(const uv_fs_t*); -UV_EXTERN uv_stat_t* uv_fs_get_statbuf(uv_fs_t*); - -UV_EXTERN void uv_fs_req_cleanup(uv_fs_t* req); -UV_EXTERN int uv_fs_close(uv_loop_t* loop, - uv_fs_t* req, - uv_file file, +UV_EXTERN uv_fs_type uv_fs_get_type(const uv_fs_t *); +UV_EXTERN ssize_t uv_fs_get_result(const uv_fs_t *); +UV_EXTERN int uv_fs_get_system_error(const uv_fs_t *); +UV_EXTERN void *uv_fs_get_ptr(const uv_fs_t *); +UV_EXTERN const char *uv_fs_get_path(const uv_fs_t *); +UV_EXTERN uv_stat_t *uv_fs_get_statbuf(uv_fs_t *); + +UV_EXTERN void uv_fs_req_cleanup(uv_fs_t *req); +UV_EXTERN int uv_fs_close(uv_loop_t *loop, uv_fs_t *req, uv_file file, uv_fs_cb cb); -UV_EXTERN int uv_fs_open(uv_loop_t* loop, - uv_fs_t* req, - const char* path, - int flags, - int mode, - uv_fs_cb cb); -UV_EXTERN int uv_fs_read(uv_loop_t* loop, - uv_fs_t* req, - uv_file file, - const uv_buf_t bufs[], - unsigned int nbufs, - int64_t offset, - uv_fs_cb cb); -UV_EXTERN int uv_fs_unlink(uv_loop_t* loop, - uv_fs_t* req, - const char* path, +UV_EXTERN int uv_fs_open(uv_loop_t *loop, uv_fs_t *req, const char *path, + int flags, int mode, uv_fs_cb cb); +UV_EXTERN int uv_fs_read(uv_loop_t *loop, uv_fs_t *req, uv_file file, + const uv_buf_t bufs[], unsigned int nbufs, + int64_t offset, uv_fs_cb cb); +UV_EXTERN int uv_fs_unlink(uv_loop_t *loop, uv_fs_t *req, const char *path, uv_fs_cb cb); -UV_EXTERN int uv_fs_write(uv_loop_t* loop, - uv_fs_t* req, - uv_file file, - const uv_buf_t bufs[], - unsigned int nbufs, - int64_t offset, - uv_fs_cb cb); +UV_EXTERN int uv_fs_write(uv_loop_t *loop, uv_fs_t *req, uv_file file, + const uv_buf_t bufs[], unsigned int nbufs, + int64_t offset, uv_fs_cb cb); /* * This flag can be used with uv_fs_copyfile() to return an error if the * destination already exists. */ -#define UV_FS_COPYFILE_EXCL 0x0001 +#define UV_FS_COPYFILE_EXCL 0x0001 /* * This flag can be used with uv_fs_copyfile() to attempt to create a reflink. @@ -1393,207 +1283,108 @@ UV_EXTERN int uv_fs_write(uv_loop_t* loop, */ #define UV_FS_COPYFILE_FICLONE_FORCE 0x0004 -UV_EXTERN int uv_fs_copyfile(uv_loop_t* loop, - uv_fs_t* req, - const char* path, - const char* new_path, - int flags, - uv_fs_cb cb); -UV_EXTERN int uv_fs_mkdir(uv_loop_t* loop, - uv_fs_t* req, - const char* path, - int mode, - uv_fs_cb cb); -UV_EXTERN int uv_fs_mkdtemp(uv_loop_t* loop, - uv_fs_t* req, - const char* tpl, +UV_EXTERN int uv_fs_copyfile(uv_loop_t *loop, uv_fs_t *req, const char *path, + const char *new_path, int flags, uv_fs_cb cb); +UV_EXTERN int uv_fs_mkdir(uv_loop_t *loop, uv_fs_t *req, const char *path, + int mode, uv_fs_cb cb); +UV_EXTERN int uv_fs_mkdtemp(uv_loop_t *loop, uv_fs_t *req, const char *tpl, uv_fs_cb cb); -UV_EXTERN int uv_fs_mkstemp(uv_loop_t* loop, - uv_fs_t* req, - const char* tpl, +UV_EXTERN int uv_fs_mkstemp(uv_loop_t *loop, uv_fs_t *req, const char *tpl, uv_fs_cb cb); -UV_EXTERN int uv_fs_rmdir(uv_loop_t* loop, - uv_fs_t* req, - const char* path, +UV_EXTERN int uv_fs_rmdir(uv_loop_t *loop, uv_fs_t *req, const char *path, uv_fs_cb cb); -UV_EXTERN int uv_fs_scandir(uv_loop_t* loop, - uv_fs_t* req, - const char* path, - int flags, +UV_EXTERN int uv_fs_scandir(uv_loop_t *loop, uv_fs_t *req, const char *path, + int flags, uv_fs_cb cb); +UV_EXTERN int uv_fs_scandir_next(uv_fs_t *req, uv_dirent_t *ent); +UV_EXTERN int uv_fs_opendir(uv_loop_t *loop, uv_fs_t *req, const char *path, uv_fs_cb cb); -UV_EXTERN int uv_fs_scandir_next(uv_fs_t* req, - uv_dirent_t* ent); -UV_EXTERN int uv_fs_opendir(uv_loop_t* loop, - uv_fs_t* req, - const char* path, +UV_EXTERN int uv_fs_readdir(uv_loop_t *loop, uv_fs_t *req, uv_dir_t *dir, uv_fs_cb cb); -UV_EXTERN int uv_fs_readdir(uv_loop_t* loop, - uv_fs_t* req, - uv_dir_t* dir, - uv_fs_cb cb); -UV_EXTERN int uv_fs_closedir(uv_loop_t* loop, - uv_fs_t* req, - uv_dir_t* dir, +UV_EXTERN int uv_fs_closedir(uv_loop_t *loop, uv_fs_t *req, uv_dir_t *dir, uv_fs_cb cb); -UV_EXTERN int uv_fs_stat(uv_loop_t* loop, - uv_fs_t* req, - const char* path, +UV_EXTERN int uv_fs_stat(uv_loop_t *loop, uv_fs_t *req, const char *path, uv_fs_cb cb); -UV_EXTERN int uv_fs_fstat(uv_loop_t* loop, - uv_fs_t* req, - uv_file file, +UV_EXTERN int uv_fs_fstat(uv_loop_t *loop, uv_fs_t *req, uv_file file, uv_fs_cb cb); -UV_EXTERN int uv_fs_rename(uv_loop_t* loop, - uv_fs_t* req, - const char* path, - const char* new_path, - uv_fs_cb cb); -UV_EXTERN int uv_fs_fsync(uv_loop_t* loop, - uv_fs_t* req, - uv_file file, +UV_EXTERN int uv_fs_rename(uv_loop_t *loop, uv_fs_t *req, const char *path, + const char *new_path, uv_fs_cb cb); +UV_EXTERN int uv_fs_fsync(uv_loop_t *loop, uv_fs_t *req, uv_file file, uv_fs_cb cb); -UV_EXTERN int uv_fs_fdatasync(uv_loop_t* loop, - uv_fs_t* req, - uv_file file, +UV_EXTERN int uv_fs_fdatasync(uv_loop_t *loop, uv_fs_t *req, uv_file file, uv_fs_cb cb); -UV_EXTERN int uv_fs_ftruncate(uv_loop_t* loop, - uv_fs_t* req, - uv_file file, - int64_t offset, - uv_fs_cb cb); -UV_EXTERN int uv_fs_sendfile(uv_loop_t* loop, - uv_fs_t* req, - uv_file out_fd, - uv_file in_fd, - int64_t in_offset, - size_t length, +UV_EXTERN int uv_fs_ftruncate(uv_loop_t *loop, uv_fs_t *req, uv_file file, + int64_t offset, uv_fs_cb cb); +UV_EXTERN int uv_fs_sendfile(uv_loop_t *loop, uv_fs_t *req, uv_file out_fd, + uv_file in_fd, int64_t in_offset, size_t length, uv_fs_cb cb); -UV_EXTERN int uv_fs_access(uv_loop_t* loop, - uv_fs_t* req, - const char* path, - int mode, - uv_fs_cb cb); -UV_EXTERN int uv_fs_chmod(uv_loop_t* loop, - uv_fs_t* req, - const char* path, - int mode, - uv_fs_cb cb); -UV_EXTERN int uv_fs_utime(uv_loop_t* loop, - uv_fs_t* req, - const char* path, - double atime, - double mtime, - uv_fs_cb cb); -UV_EXTERN int uv_fs_futime(uv_loop_t* loop, - uv_fs_t* req, - uv_file file, - double atime, - double mtime, - uv_fs_cb cb); -UV_EXTERN int uv_fs_lutime(uv_loop_t* loop, - uv_fs_t* req, - const char* path, - double atime, - double mtime, - uv_fs_cb cb); -UV_EXTERN int uv_fs_lstat(uv_loop_t* loop, - uv_fs_t* req, - const char* path, +UV_EXTERN int uv_fs_access(uv_loop_t *loop, uv_fs_t *req, const char *path, + int mode, uv_fs_cb cb); +UV_EXTERN int uv_fs_chmod(uv_loop_t *loop, uv_fs_t *req, const char *path, + int mode, uv_fs_cb cb); +UV_EXTERN int uv_fs_utime(uv_loop_t *loop, uv_fs_t *req, const char *path, + double atime, double mtime, uv_fs_cb cb); +UV_EXTERN int uv_fs_futime(uv_loop_t *loop, uv_fs_t *req, uv_file file, + double atime, double mtime, uv_fs_cb cb); +UV_EXTERN int uv_fs_lutime(uv_loop_t *loop, uv_fs_t *req, const char *path, + double atime, double mtime, uv_fs_cb cb); +UV_EXTERN int uv_fs_lstat(uv_loop_t *loop, uv_fs_t *req, const char *path, uv_fs_cb cb); -UV_EXTERN int uv_fs_link(uv_loop_t* loop, - uv_fs_t* req, - const char* path, - const char* new_path, - uv_fs_cb cb); +UV_EXTERN int uv_fs_link(uv_loop_t *loop, uv_fs_t *req, const char *path, + const char *new_path, uv_fs_cb cb); /* * This flag can be used with uv_fs_symlink() on Windows to specify whether * path argument points to a directory. */ -#define UV_FS_SYMLINK_DIR 0x0001 +#define UV_FS_SYMLINK_DIR 0x0001 /* * This flag can be used with uv_fs_symlink() on Windows to specify whether * the symlink is to be created using junction points. */ -#define UV_FS_SYMLINK_JUNCTION 0x0002 +#define UV_FS_SYMLINK_JUNCTION 0x0002 -UV_EXTERN int uv_fs_symlink(uv_loop_t* loop, - uv_fs_t* req, - const char* path, - const char* new_path, - int flags, - uv_fs_cb cb); -UV_EXTERN int uv_fs_readlink(uv_loop_t* loop, - uv_fs_t* req, - const char* path, +UV_EXTERN int uv_fs_symlink(uv_loop_t *loop, uv_fs_t *req, const char *path, + const char *new_path, int flags, uv_fs_cb cb); +UV_EXTERN int uv_fs_readlink(uv_loop_t *loop, uv_fs_t *req, const char *path, uv_fs_cb cb); -UV_EXTERN int uv_fs_realpath(uv_loop_t* loop, - uv_fs_t* req, - const char* path, +UV_EXTERN int uv_fs_realpath(uv_loop_t *loop, uv_fs_t *req, const char *path, uv_fs_cb cb); -UV_EXTERN int uv_fs_fchmod(uv_loop_t* loop, - uv_fs_t* req, - uv_file file, - int mode, - uv_fs_cb cb); -UV_EXTERN int uv_fs_chown(uv_loop_t* loop, - uv_fs_t* req, - const char* path, - uv_uid_t uid, - uv_gid_t gid, - uv_fs_cb cb); -UV_EXTERN int uv_fs_fchown(uv_loop_t* loop, - uv_fs_t* req, - uv_file file, - uv_uid_t uid, - uv_gid_t gid, - uv_fs_cb cb); -UV_EXTERN int uv_fs_lchown(uv_loop_t* loop, - uv_fs_t* req, - const char* path, - uv_uid_t uid, - uv_gid_t gid, - uv_fs_cb cb); -UV_EXTERN int uv_fs_statfs(uv_loop_t* loop, - uv_fs_t* req, - const char* path, +UV_EXTERN int uv_fs_fchmod(uv_loop_t *loop, uv_fs_t *req, uv_file file, + int mode, uv_fs_cb cb); +UV_EXTERN int uv_fs_chown(uv_loop_t *loop, uv_fs_t *req, const char *path, + uv_uid_t uid, uv_gid_t gid, uv_fs_cb cb); +UV_EXTERN int uv_fs_fchown(uv_loop_t *loop, uv_fs_t *req, uv_file file, + uv_uid_t uid, uv_gid_t gid, uv_fs_cb cb); +UV_EXTERN int uv_fs_lchown(uv_loop_t *loop, uv_fs_t *req, const char *path, + uv_uid_t uid, uv_gid_t gid, uv_fs_cb cb); +UV_EXTERN int uv_fs_statfs(uv_loop_t *loop, uv_fs_t *req, const char *path, uv_fs_cb cb); - -enum uv_fs_event { - UV_RENAME = 1, - UV_CHANGE = 2 -}; - +enum uv_fs_event { UV_RENAME = 1, UV_CHANGE = 2 }; struct uv_fs_event_s { UV_HANDLE_FIELDS /* private */ - char* path; + char *path; UV_FS_EVENT_PRIVATE_FIELDS }; - /* * uv_fs_stat() based polling file watcher. */ struct uv_fs_poll_s { UV_HANDLE_FIELDS /* Private, don't touch. */ - void* poll_ctx; + void *poll_ctx; }; -UV_EXTERN int uv_fs_poll_init(uv_loop_t* loop, uv_fs_poll_t* handle); -UV_EXTERN int uv_fs_poll_start(uv_fs_poll_t* handle, - uv_fs_poll_cb poll_cb, - const char* path, - unsigned int interval); -UV_EXTERN int uv_fs_poll_stop(uv_fs_poll_t* handle); -UV_EXTERN int uv_fs_poll_getpath(uv_fs_poll_t* handle, - char* buffer, - size_t* size); - +UV_EXTERN int uv_fs_poll_init(uv_loop_t *loop, uv_fs_poll_t *handle); +UV_EXTERN int uv_fs_poll_start(uv_fs_poll_t *handle, uv_fs_poll_cb poll_cb, + const char *path, unsigned int interval); +UV_EXTERN int uv_fs_poll_stop(uv_fs_poll_t *handle); +UV_EXTERN int uv_fs_poll_getpath(uv_fs_poll_t *handle, char *buffer, + size_t *size); struct uv_signal_s { UV_HANDLE_FIELDS @@ -1602,18 +1393,15 @@ struct uv_signal_s { UV_SIGNAL_PRIVATE_FIELDS }; -UV_EXTERN int uv_signal_init(uv_loop_t* loop, uv_signal_t* handle); -UV_EXTERN int uv_signal_start(uv_signal_t* handle, - uv_signal_cb signal_cb, +UV_EXTERN int uv_signal_init(uv_loop_t *loop, uv_signal_t *handle); +UV_EXTERN int uv_signal_start(uv_signal_t *handle, uv_signal_cb signal_cb, int signum); -UV_EXTERN int uv_signal_start_oneshot(uv_signal_t* handle, - uv_signal_cb signal_cb, - int signum); -UV_EXTERN int uv_signal_stop(uv_signal_t* handle); +UV_EXTERN int uv_signal_start_oneshot(uv_signal_t *handle, + uv_signal_cb signal_cb, int signum); +UV_EXTERN int uv_signal_stop(uv_signal_t *handle); UV_EXTERN void uv_loadavg(double avg[3]); - /* * Flags to be passed to uv_fs_event_start(). */ @@ -1644,67 +1432,60 @@ enum uv_fs_event_flags { UV_FS_EVENT_RECURSIVE = 4 }; +UV_EXTERN int uv_fs_event_init(uv_loop_t *loop, uv_fs_event_t *handle); +UV_EXTERN int uv_fs_event_start(uv_fs_event_t *handle, uv_fs_event_cb cb, + const char *path, unsigned int flags); +UV_EXTERN int uv_fs_event_stop(uv_fs_event_t *handle); +UV_EXTERN int uv_fs_event_getpath(uv_fs_event_t *handle, char *buffer, + size_t *size); -UV_EXTERN int uv_fs_event_init(uv_loop_t* loop, uv_fs_event_t* handle); -UV_EXTERN int uv_fs_event_start(uv_fs_event_t* handle, - uv_fs_event_cb cb, - const char* path, - unsigned int flags); -UV_EXTERN int uv_fs_event_stop(uv_fs_event_t* handle); -UV_EXTERN int uv_fs_event_getpath(uv_fs_event_t* handle, - char* buffer, - size_t* size); - -UV_EXTERN int uv_ip4_addr(const char* ip, int port, struct sockaddr_in* addr); -UV_EXTERN int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr); +UV_EXTERN int uv_ip4_addr(const char *ip, int port, struct sockaddr_in *addr); +UV_EXTERN int uv_ip6_addr(const char *ip, int port, struct sockaddr_in6 *addr); -UV_EXTERN int uv_ip4_name(const struct sockaddr_in* src, char* dst, size_t size); -UV_EXTERN int uv_ip6_name(const struct sockaddr_in6* src, char* dst, size_t size); -UV_EXTERN int uv_ip_name(const struct sockaddr* src, char* dst, size_t size); - -UV_EXTERN int uv_inet_ntop(int af, const void* src, char* dst, size_t size); -UV_EXTERN int uv_inet_pton(int af, const char* src, void* dst); +UV_EXTERN int uv_ip4_name(const struct sockaddr_in *src, char *dst, + size_t size); +UV_EXTERN int uv_ip6_name(const struct sockaddr_in6 *src, char *dst, + size_t size); +UV_EXTERN int uv_ip_name(const struct sockaddr *src, char *dst, size_t size); +UV_EXTERN int uv_inet_ntop(int af, const void *src, char *dst, size_t size); +UV_EXTERN int uv_inet_pton(int af, const char *src, void *dst); struct uv_random_s { UV_REQ_FIELDS /* read-only */ - uv_loop_t* loop; + uv_loop_t *loop; /* private */ int status; - void* buf; + void *buf; size_t buflen; uv_random_cb cb; struct uv__work work_req; }; -UV_EXTERN int uv_random(uv_loop_t* loop, - uv_random_t* req, - void *buf, +UV_EXTERN int uv_random(uv_loop_t *loop, uv_random_t *req, void *buf, size_t buflen, - unsigned flags, /* For future extension; must be 0. */ + unsigned flags, /* For future extension; must be 0. */ uv_random_cb cb); #if defined(IF_NAMESIZE) -# define UV_IF_NAMESIZE (IF_NAMESIZE + 1) +#define UV_IF_NAMESIZE (IF_NAMESIZE + 1) #elif defined(IFNAMSIZ) -# define UV_IF_NAMESIZE (IFNAMSIZ + 1) +#define UV_IF_NAMESIZE (IFNAMSIZ + 1) #else -# define UV_IF_NAMESIZE (16 + 1) +#define UV_IF_NAMESIZE (16 + 1) #endif -UV_EXTERN int uv_if_indextoname(unsigned int ifindex, - char* buffer, - size_t* size); -UV_EXTERN int uv_if_indextoiid(unsigned int ifindex, - char* buffer, - size_t* size); +UV_EXTERN int uv_if_indextoname(unsigned int ifindex, char *buffer, + size_t *size); +UV_EXTERN int uv_if_indextoiid(unsigned int ifindex, char *buffer, + size_t *size); -UV_EXTERN int uv_exepath(char* buffer, size_t* size); +UV_EXTERN int uv_exepath(char *buffer, size_t *size); -UV_EXTERN int uv_cwd(char* buffer, size_t* size); +UV_EXTERN int uv_cwd(char *buffer, size_t *size); -UV_EXTERN int uv_chdir(const char* dir); +UV_EXTERN int uv_chdir(const char *dir); UV_EXTERN uint64_t uv_get_free_memory(void); UV_EXTERN uint64_t uv_get_total_memory(void); @@ -1715,59 +1496,58 @@ UV_EXTERN void uv_sleep(unsigned int msec); UV_EXTERN void uv_disable_stdio_inheritance(void); -UV_EXTERN int uv_dlopen(const char* filename, uv_lib_t* lib); -UV_EXTERN void uv_dlclose(uv_lib_t* lib); -UV_EXTERN int uv_dlsym(uv_lib_t* lib, const char* name, void** ptr); -UV_EXTERN const char* uv_dlerror(const uv_lib_t* lib); - -UV_EXTERN int uv_mutex_init(uv_mutex_t* handle); -UV_EXTERN int uv_mutex_init_recursive(uv_mutex_t* handle); -UV_EXTERN void uv_mutex_destroy(uv_mutex_t* handle); -UV_EXTERN void uv_mutex_lock(uv_mutex_t* handle); -UV_EXTERN int uv_mutex_trylock(uv_mutex_t* handle); -UV_EXTERN void uv_mutex_unlock(uv_mutex_t* handle); - -UV_EXTERN int uv_rwlock_init(uv_rwlock_t* rwlock); -UV_EXTERN void uv_rwlock_destroy(uv_rwlock_t* rwlock); -UV_EXTERN void uv_rwlock_rdlock(uv_rwlock_t* rwlock); -UV_EXTERN int uv_rwlock_tryrdlock(uv_rwlock_t* rwlock); -UV_EXTERN void uv_rwlock_rdunlock(uv_rwlock_t* rwlock); -UV_EXTERN void uv_rwlock_wrlock(uv_rwlock_t* rwlock); -UV_EXTERN int uv_rwlock_trywrlock(uv_rwlock_t* rwlock); -UV_EXTERN void uv_rwlock_wrunlock(uv_rwlock_t* rwlock); - -UV_EXTERN int uv_sem_init(uv_sem_t* sem, unsigned int value); -UV_EXTERN void uv_sem_destroy(uv_sem_t* sem); -UV_EXTERN void uv_sem_post(uv_sem_t* sem); -UV_EXTERN void uv_sem_wait(uv_sem_t* sem); -UV_EXTERN int uv_sem_trywait(uv_sem_t* sem); - -UV_EXTERN int uv_cond_init(uv_cond_t* cond); -UV_EXTERN void uv_cond_destroy(uv_cond_t* cond); -UV_EXTERN void uv_cond_signal(uv_cond_t* cond); -UV_EXTERN void uv_cond_broadcast(uv_cond_t* cond); - -UV_EXTERN int uv_barrier_init(uv_barrier_t* barrier, unsigned int count); -UV_EXTERN void uv_barrier_destroy(uv_barrier_t* barrier); -UV_EXTERN int uv_barrier_wait(uv_barrier_t* barrier); - -UV_EXTERN void uv_cond_wait(uv_cond_t* cond, uv_mutex_t* mutex); -UV_EXTERN int uv_cond_timedwait(uv_cond_t* cond, - uv_mutex_t* mutex, +UV_EXTERN int uv_dlopen(const char *filename, uv_lib_t *lib); +UV_EXTERN void uv_dlclose(uv_lib_t *lib); +UV_EXTERN int uv_dlsym(uv_lib_t *lib, const char *name, void **ptr); +UV_EXTERN const char *uv_dlerror(const uv_lib_t *lib); + +UV_EXTERN int uv_mutex_init(uv_mutex_t *handle); +UV_EXTERN int uv_mutex_init_recursive(uv_mutex_t *handle); +UV_EXTERN void uv_mutex_destroy(uv_mutex_t *handle); +UV_EXTERN void uv_mutex_lock(uv_mutex_t *handle); +UV_EXTERN int uv_mutex_trylock(uv_mutex_t *handle); +UV_EXTERN void uv_mutex_unlock(uv_mutex_t *handle); + +UV_EXTERN int uv_rwlock_init(uv_rwlock_t *rwlock); +UV_EXTERN void uv_rwlock_destroy(uv_rwlock_t *rwlock); +UV_EXTERN void uv_rwlock_rdlock(uv_rwlock_t *rwlock); +UV_EXTERN int uv_rwlock_tryrdlock(uv_rwlock_t *rwlock); +UV_EXTERN void uv_rwlock_rdunlock(uv_rwlock_t *rwlock); +UV_EXTERN void uv_rwlock_wrlock(uv_rwlock_t *rwlock); +UV_EXTERN int uv_rwlock_trywrlock(uv_rwlock_t *rwlock); +UV_EXTERN void uv_rwlock_wrunlock(uv_rwlock_t *rwlock); + +UV_EXTERN int uv_sem_init(uv_sem_t *sem, unsigned int value); +UV_EXTERN void uv_sem_destroy(uv_sem_t *sem); +UV_EXTERN void uv_sem_post(uv_sem_t *sem); +UV_EXTERN void uv_sem_wait(uv_sem_t *sem); +UV_EXTERN int uv_sem_trywait(uv_sem_t *sem); + +UV_EXTERN int uv_cond_init(uv_cond_t *cond); +UV_EXTERN void uv_cond_destroy(uv_cond_t *cond); +UV_EXTERN void uv_cond_signal(uv_cond_t *cond); +UV_EXTERN void uv_cond_broadcast(uv_cond_t *cond); + +UV_EXTERN int uv_barrier_init(uv_barrier_t *barrier, unsigned int count); +UV_EXTERN void uv_barrier_destroy(uv_barrier_t *barrier); +UV_EXTERN int uv_barrier_wait(uv_barrier_t *barrier); + +UV_EXTERN void uv_cond_wait(uv_cond_t *cond, uv_mutex_t *mutex); +UV_EXTERN int uv_cond_timedwait(uv_cond_t *cond, uv_mutex_t *mutex, uint64_t timeout); -UV_EXTERN void uv_once(uv_once_t* guard, void (*callback)(void)); +UV_EXTERN void uv_once(uv_once_t *guard, void (*callback)(void)); -UV_EXTERN int uv_key_create(uv_key_t* key); -UV_EXTERN void uv_key_delete(uv_key_t* key); -UV_EXTERN void* uv_key_get(uv_key_t* key); -UV_EXTERN void uv_key_set(uv_key_t* key, void* value); +UV_EXTERN int uv_key_create(uv_key_t *key); +UV_EXTERN void uv_key_delete(uv_key_t *key); +UV_EXTERN void *uv_key_get(uv_key_t *key); +UV_EXTERN void uv_key_set(uv_key_t *key, void *value); -UV_EXTERN int uv_gettimeofday(uv_timeval64_t* tv); +UV_EXTERN int uv_gettimeofday(uv_timeval64_t *tv); -typedef void (*uv_thread_cb)(void* arg); +typedef void (*uv_thread_cb)(void *arg); -UV_EXTERN int uv_thread_create(uv_thread_t* tid, uv_thread_cb entry, void* arg); +UV_EXTERN int uv_thread_create(uv_thread_t *tid, uv_thread_cb entry, void *arg); typedef enum { UV_THREAD_NO_FLAGS = 0x00, @@ -1782,16 +1562,15 @@ struct uv_thread_options_s { typedef struct uv_thread_options_s uv_thread_options_t; -UV_EXTERN int uv_thread_create_ex(uv_thread_t* tid, - const uv_thread_options_t* params, - uv_thread_cb entry, - void* arg); +UV_EXTERN int uv_thread_create_ex(uv_thread_t *tid, + const uv_thread_options_t *params, + uv_thread_cb entry, void *arg); UV_EXTERN uv_thread_t uv_thread_self(void); UV_EXTERN int uv_thread_join(uv_thread_t *tid); -UV_EXTERN int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2); +UV_EXTERN int uv_thread_equal(const uv_thread_t *t1, const uv_thread_t *t2); /* The presence of these unions force similar struct layout. */ -#define XX(_, name) uv_ ## name ## _t name; +#define XX(_, name) uv_##name##_t name; union uv_any_handle { UV_HANDLE_TYPE_MAP(XX) }; @@ -1801,26 +1580,25 @@ union uv_any_req { }; #undef XX - struct uv_loop_s { /* User data - use this for whatever. */ - void* data; + void *data; /* Loop reference counting. */ unsigned int active_handles; - void* handle_queue[2]; + void *handle_queue[2]; union { - void* unused; + void *unused; unsigned int count; } active_reqs; /* Internal storage for future extensions. */ - void* internal_fields; + void *internal_fields; /* Internal flag to signal loop stop. */ unsigned int stop_flag; UV_LOOP_PRIVATE_FIELDS }; -UV_EXTERN void* uv_loop_get_data(const uv_loop_t*); -UV_EXTERN void uv_loop_set_data(uv_loop_t*, void* data); +UV_EXTERN void *uv_loop_get_data(const uv_loop_t *); +UV_EXTERN void uv_loop_set_data(uv_loop_t *, void *data); /* Don't export the private CPP symbols. */ #undef UV_HANDLE_TYPE_PRIVATE diff --git a/src/libuv/include/uv/aix.h b/src/libuv/include/uv/aix.h index 7dc992fa6..051b73840 100644 --- a/src/libuv/include/uv/aix.h +++ b/src/libuv/include/uv/aix.h @@ -22,11 +22,10 @@ #ifndef UV_AIX_H #define UV_AIX_H -#define UV_PLATFORM_LOOP_FIELDS \ - int fs_fd; \ +#define UV_PLATFORM_LOOP_FIELDS int fs_fd; -#define UV_PLATFORM_FS_EVENT_FIELDS \ - uv__io_t event_watcher; \ - char *dir_filename; \ +#define UV_PLATFORM_FS_EVENT_FIELDS \ + uv__io_t event_watcher; \ + char *dir_filename; #endif /* UV_AIX_H */ diff --git a/src/libuv/include/uv/android-ifaddrs.h b/src/libuv/include/uv/android-ifaddrs.h index 9cd19fec1..28720ae4f 100644 --- a/src/libuv/include/uv/android-ifaddrs.h +++ b/src/libuv/include/uv/android-ifaddrs.h @@ -23,25 +23,25 @@ * BSDI ifaddrs.h,v 2.5 2000/02/23 14:51:59 dab Exp */ -#ifndef _IFADDRS_H_ -#define _IFADDRS_H_ +#ifndef _IFADDRS_H_ +#define _IFADDRS_H_ struct ifaddrs { - struct ifaddrs *ifa_next; - char *ifa_name; - unsigned int ifa_flags; - struct sockaddr *ifa_addr; - struct sockaddr *ifa_netmask; - struct sockaddr *ifa_dstaddr; - void *ifa_data; + struct ifaddrs *ifa_next; + char *ifa_name; + unsigned int ifa_flags; + struct sockaddr *ifa_addr; + struct sockaddr *ifa_netmask; + struct sockaddr *ifa_dstaddr; + void *ifa_data; }; /* * This may have been defined in . Note that if is * to be included it must be included before this header file. */ -#ifndef ifa_broadaddr -#define ifa_broadaddr ifa_dstaddr /* broadcast address interface */ +#ifndef ifa_broadaddr +#define ifa_broadaddr ifa_dstaddr /* broadcast address interface */ #endif #include diff --git a/src/libuv/include/uv/bsd.h b/src/libuv/include/uv/bsd.h index 2d72b3d77..13fb5fa0c 100644 --- a/src/libuv/include/uv/bsd.h +++ b/src/libuv/include/uv/bsd.h @@ -22,12 +22,11 @@ #ifndef UV_BSD_H #define UV_BSD_H -#define UV_PLATFORM_FS_EVENT_FIELDS \ - uv__io_t event_watcher; \ +#define UV_PLATFORM_FS_EVENT_FIELDS uv__io_t event_watcher; -#define UV_IO_PRIVATE_PLATFORM_FIELDS \ - int rcount; \ - int wcount; \ +#define UV_IO_PRIVATE_PLATFORM_FIELDS \ + int rcount; \ + int wcount; #define UV_HAVE_KQUEUE 1 diff --git a/src/libuv/include/uv/darwin.h b/src/libuv/include/uv/darwin.h index d22641582..f58884ff3 100644 --- a/src/libuv/include/uv/darwin.h +++ b/src/libuv/include/uv/darwin.h @@ -23,38 +23,37 @@ #define UV_DARWIN_H #if defined(__APPLE__) && defined(__MACH__) -# include -# include -# include -# include -# define UV_PLATFORM_SEM_T semaphore_t +#include +#include +#include +#include +#define UV_PLATFORM_SEM_T semaphore_t #endif -#define UV_IO_PRIVATE_PLATFORM_FIELDS \ - int rcount; \ - int wcount; \ - -#define UV_PLATFORM_LOOP_FIELDS \ - uv_thread_t cf_thread; \ - void* _cf_reserved; \ - void* cf_state; \ - uv_mutex_t cf_mutex; \ - uv_sem_t cf_sem; \ - void* cf_signals[2]; \ - -#define UV_PLATFORM_FS_EVENT_FIELDS \ - uv__io_t event_watcher; \ - char* realpath; \ - int realpath_len; \ - int cf_flags; \ - uv_async_t* cf_cb; \ - void* cf_events[2]; \ - void* cf_member[2]; \ - int cf_error; \ - uv_mutex_t cf_mutex; \ - -#define UV_STREAM_PRIVATE_PLATFORM_FIELDS \ - void* select; \ +#define UV_IO_PRIVATE_PLATFORM_FIELDS \ + int rcount; \ + int wcount; + +#define UV_PLATFORM_LOOP_FIELDS \ + uv_thread_t cf_thread; \ + void *_cf_reserved; \ + void *cf_state; \ + uv_mutex_t cf_mutex; \ + uv_sem_t cf_sem; \ + void *cf_signals[2]; + +#define UV_PLATFORM_FS_EVENT_FIELDS \ + uv__io_t event_watcher; \ + char *realpath; \ + int realpath_len; \ + int cf_flags; \ + uv_async_t *cf_cb; \ + void *cf_events[2]; \ + void *cf_member[2]; \ + int cf_error; \ + uv_mutex_t cf_mutex; + +#define UV_STREAM_PRIVATE_PLATFORM_FIELDS void *select; #define UV_HAVE_KQUEUE 1 diff --git a/src/libuv/include/uv/errno.h b/src/libuv/include/uv/errno.h index 71906b3f5..f09458e74 100644 --- a/src/libuv/include/uv/errno.h +++ b/src/libuv/include/uv/errno.h @@ -24,384 +24,384 @@ #include #if EDOM > 0 -# define UV__ERR(x) (-(x)) +#define UV__ERR(x) (-(x)) #else -# define UV__ERR(x) (x) +#define UV__ERR(x) (x) #endif -#define UV__EOF (-4095) +#define UV__EOF (-4095) #define UV__UNKNOWN (-4094) -#define UV__EAI_ADDRFAMILY (-3000) -#define UV__EAI_AGAIN (-3001) -#define UV__EAI_BADFLAGS (-3002) -#define UV__EAI_CANCELED (-3003) -#define UV__EAI_FAIL (-3004) -#define UV__EAI_FAMILY (-3005) -#define UV__EAI_MEMORY (-3006) -#define UV__EAI_NODATA (-3007) -#define UV__EAI_NONAME (-3008) -#define UV__EAI_OVERFLOW (-3009) -#define UV__EAI_SERVICE (-3010) -#define UV__EAI_SOCKTYPE (-3011) -#define UV__EAI_BADHINTS (-3013) -#define UV__EAI_PROTOCOL (-3014) +#define UV__EAI_ADDRFAMILY (-3000) +#define UV__EAI_AGAIN (-3001) +#define UV__EAI_BADFLAGS (-3002) +#define UV__EAI_CANCELED (-3003) +#define UV__EAI_FAIL (-3004) +#define UV__EAI_FAMILY (-3005) +#define UV__EAI_MEMORY (-3006) +#define UV__EAI_NODATA (-3007) +#define UV__EAI_NONAME (-3008) +#define UV__EAI_OVERFLOW (-3009) +#define UV__EAI_SERVICE (-3010) +#define UV__EAI_SOCKTYPE (-3011) +#define UV__EAI_BADHINTS (-3013) +#define UV__EAI_PROTOCOL (-3014) /* Only map to the system errno on non-Windows platforms. It's apparently * a fairly common practice for Windows programmers to redefine errno codes. */ #if defined(E2BIG) && !defined(_WIN32) -# define UV__E2BIG UV__ERR(E2BIG) +#define UV__E2BIG UV__ERR(E2BIG) #else -# define UV__E2BIG (-4093) +#define UV__E2BIG (-4093) #endif #if defined(EACCES) && !defined(_WIN32) -# define UV__EACCES UV__ERR(EACCES) +#define UV__EACCES UV__ERR(EACCES) #else -# define UV__EACCES (-4092) +#define UV__EACCES (-4092) #endif #if defined(EADDRINUSE) && !defined(_WIN32) -# define UV__EADDRINUSE UV__ERR(EADDRINUSE) +#define UV__EADDRINUSE UV__ERR(EADDRINUSE) #else -# define UV__EADDRINUSE (-4091) +#define UV__EADDRINUSE (-4091) #endif #if defined(EADDRNOTAVAIL) && !defined(_WIN32) -# define UV__EADDRNOTAVAIL UV__ERR(EADDRNOTAVAIL) +#define UV__EADDRNOTAVAIL UV__ERR(EADDRNOTAVAIL) #else -# define UV__EADDRNOTAVAIL (-4090) +#define UV__EADDRNOTAVAIL (-4090) #endif #if defined(EAFNOSUPPORT) && !defined(_WIN32) -# define UV__EAFNOSUPPORT UV__ERR(EAFNOSUPPORT) +#define UV__EAFNOSUPPORT UV__ERR(EAFNOSUPPORT) #else -# define UV__EAFNOSUPPORT (-4089) +#define UV__EAFNOSUPPORT (-4089) #endif #if defined(EAGAIN) && !defined(_WIN32) -# define UV__EAGAIN UV__ERR(EAGAIN) +#define UV__EAGAIN UV__ERR(EAGAIN) #else -# define UV__EAGAIN (-4088) +#define UV__EAGAIN (-4088) #endif #if defined(EALREADY) && !defined(_WIN32) -# define UV__EALREADY UV__ERR(EALREADY) +#define UV__EALREADY UV__ERR(EALREADY) #else -# define UV__EALREADY (-4084) +#define UV__EALREADY (-4084) #endif #if defined(EBADF) && !defined(_WIN32) -# define UV__EBADF UV__ERR(EBADF) +#define UV__EBADF UV__ERR(EBADF) #else -# define UV__EBADF (-4083) +#define UV__EBADF (-4083) #endif #if defined(EBUSY) && !defined(_WIN32) -# define UV__EBUSY UV__ERR(EBUSY) +#define UV__EBUSY UV__ERR(EBUSY) #else -# define UV__EBUSY (-4082) +#define UV__EBUSY (-4082) #endif #if defined(ECANCELED) && !defined(_WIN32) -# define UV__ECANCELED UV__ERR(ECANCELED) +#define UV__ECANCELED UV__ERR(ECANCELED) #else -# define UV__ECANCELED (-4081) +#define UV__ECANCELED (-4081) #endif #if defined(ECHARSET) && !defined(_WIN32) -# define UV__ECHARSET UV__ERR(ECHARSET) +#define UV__ECHARSET UV__ERR(ECHARSET) #else -# define UV__ECHARSET (-4080) +#define UV__ECHARSET (-4080) #endif #if defined(ECONNABORTED) && !defined(_WIN32) -# define UV__ECONNABORTED UV__ERR(ECONNABORTED) +#define UV__ECONNABORTED UV__ERR(ECONNABORTED) #else -# define UV__ECONNABORTED (-4079) +#define UV__ECONNABORTED (-4079) #endif #if defined(ECONNREFUSED) && !defined(_WIN32) -# define UV__ECONNREFUSED UV__ERR(ECONNREFUSED) +#define UV__ECONNREFUSED UV__ERR(ECONNREFUSED) #else -# define UV__ECONNREFUSED (-4078) +#define UV__ECONNREFUSED (-4078) #endif #if defined(ECONNRESET) && !defined(_WIN32) -# define UV__ECONNRESET UV__ERR(ECONNRESET) +#define UV__ECONNRESET UV__ERR(ECONNRESET) #else -# define UV__ECONNRESET (-4077) +#define UV__ECONNRESET (-4077) #endif #if defined(EDESTADDRREQ) && !defined(_WIN32) -# define UV__EDESTADDRREQ UV__ERR(EDESTADDRREQ) +#define UV__EDESTADDRREQ UV__ERR(EDESTADDRREQ) #else -# define UV__EDESTADDRREQ (-4076) +#define UV__EDESTADDRREQ (-4076) #endif #if defined(EEXIST) && !defined(_WIN32) -# define UV__EEXIST UV__ERR(EEXIST) +#define UV__EEXIST UV__ERR(EEXIST) #else -# define UV__EEXIST (-4075) +#define UV__EEXIST (-4075) #endif #if defined(EFAULT) && !defined(_WIN32) -# define UV__EFAULT UV__ERR(EFAULT) +#define UV__EFAULT UV__ERR(EFAULT) #else -# define UV__EFAULT (-4074) +#define UV__EFAULT (-4074) #endif #if defined(EHOSTUNREACH) && !defined(_WIN32) -# define UV__EHOSTUNREACH UV__ERR(EHOSTUNREACH) +#define UV__EHOSTUNREACH UV__ERR(EHOSTUNREACH) #else -# define UV__EHOSTUNREACH (-4073) +#define UV__EHOSTUNREACH (-4073) #endif #if defined(EINTR) && !defined(_WIN32) -# define UV__EINTR UV__ERR(EINTR) +#define UV__EINTR UV__ERR(EINTR) #else -# define UV__EINTR (-4072) +#define UV__EINTR (-4072) #endif #if defined(EINVAL) && !defined(_WIN32) -# define UV__EINVAL UV__ERR(EINVAL) +#define UV__EINVAL UV__ERR(EINVAL) #else -# define UV__EINVAL (-4071) +#define UV__EINVAL (-4071) #endif #if defined(EIO) && !defined(_WIN32) -# define UV__EIO UV__ERR(EIO) +#define UV__EIO UV__ERR(EIO) #else -# define UV__EIO (-4070) +#define UV__EIO (-4070) #endif #if defined(EISCONN) && !defined(_WIN32) -# define UV__EISCONN UV__ERR(EISCONN) +#define UV__EISCONN UV__ERR(EISCONN) #else -# define UV__EISCONN (-4069) +#define UV__EISCONN (-4069) #endif #if defined(EISDIR) && !defined(_WIN32) -# define UV__EISDIR UV__ERR(EISDIR) +#define UV__EISDIR UV__ERR(EISDIR) #else -# define UV__EISDIR (-4068) +#define UV__EISDIR (-4068) #endif #if defined(ELOOP) && !defined(_WIN32) -# define UV__ELOOP UV__ERR(ELOOP) +#define UV__ELOOP UV__ERR(ELOOP) #else -# define UV__ELOOP (-4067) +#define UV__ELOOP (-4067) #endif #if defined(EMFILE) && !defined(_WIN32) -# define UV__EMFILE UV__ERR(EMFILE) +#define UV__EMFILE UV__ERR(EMFILE) #else -# define UV__EMFILE (-4066) +#define UV__EMFILE (-4066) #endif #if defined(EMSGSIZE) && !defined(_WIN32) -# define UV__EMSGSIZE UV__ERR(EMSGSIZE) +#define UV__EMSGSIZE UV__ERR(EMSGSIZE) #else -# define UV__EMSGSIZE (-4065) +#define UV__EMSGSIZE (-4065) #endif #if defined(ENAMETOOLONG) && !defined(_WIN32) -# define UV__ENAMETOOLONG UV__ERR(ENAMETOOLONG) +#define UV__ENAMETOOLONG UV__ERR(ENAMETOOLONG) #else -# define UV__ENAMETOOLONG (-4064) +#define UV__ENAMETOOLONG (-4064) #endif #if defined(ENETDOWN) && !defined(_WIN32) -# define UV__ENETDOWN UV__ERR(ENETDOWN) +#define UV__ENETDOWN UV__ERR(ENETDOWN) #else -# define UV__ENETDOWN (-4063) +#define UV__ENETDOWN (-4063) #endif #if defined(ENETUNREACH) && !defined(_WIN32) -# define UV__ENETUNREACH UV__ERR(ENETUNREACH) +#define UV__ENETUNREACH UV__ERR(ENETUNREACH) #else -# define UV__ENETUNREACH (-4062) +#define UV__ENETUNREACH (-4062) #endif #if defined(ENFILE) && !defined(_WIN32) -# define UV__ENFILE UV__ERR(ENFILE) +#define UV__ENFILE UV__ERR(ENFILE) #else -# define UV__ENFILE (-4061) +#define UV__ENFILE (-4061) #endif #if defined(ENOBUFS) && !defined(_WIN32) -# define UV__ENOBUFS UV__ERR(ENOBUFS) +#define UV__ENOBUFS UV__ERR(ENOBUFS) #else -# define UV__ENOBUFS (-4060) +#define UV__ENOBUFS (-4060) #endif #if defined(ENODEV) && !defined(_WIN32) -# define UV__ENODEV UV__ERR(ENODEV) +#define UV__ENODEV UV__ERR(ENODEV) #else -# define UV__ENODEV (-4059) +#define UV__ENODEV (-4059) #endif #if defined(ENOENT) && !defined(_WIN32) -# define UV__ENOENT UV__ERR(ENOENT) +#define UV__ENOENT UV__ERR(ENOENT) #else -# define UV__ENOENT (-4058) +#define UV__ENOENT (-4058) #endif #if defined(ENOMEM) && !defined(_WIN32) -# define UV__ENOMEM UV__ERR(ENOMEM) +#define UV__ENOMEM UV__ERR(ENOMEM) #else -# define UV__ENOMEM (-4057) +#define UV__ENOMEM (-4057) #endif #if defined(ENONET) && !defined(_WIN32) -# define UV__ENONET UV__ERR(ENONET) +#define UV__ENONET UV__ERR(ENONET) #else -# define UV__ENONET (-4056) +#define UV__ENONET (-4056) #endif #if defined(ENOSPC) && !defined(_WIN32) -# define UV__ENOSPC UV__ERR(ENOSPC) +#define UV__ENOSPC UV__ERR(ENOSPC) #else -# define UV__ENOSPC (-4055) +#define UV__ENOSPC (-4055) #endif #if defined(ENOSYS) && !defined(_WIN32) -# define UV__ENOSYS UV__ERR(ENOSYS) +#define UV__ENOSYS UV__ERR(ENOSYS) #else -# define UV__ENOSYS (-4054) +#define UV__ENOSYS (-4054) #endif #if defined(ENOTCONN) && !defined(_WIN32) -# define UV__ENOTCONN UV__ERR(ENOTCONN) +#define UV__ENOTCONN UV__ERR(ENOTCONN) #else -# define UV__ENOTCONN (-4053) +#define UV__ENOTCONN (-4053) #endif #if defined(ENOTDIR) && !defined(_WIN32) -# define UV__ENOTDIR UV__ERR(ENOTDIR) +#define UV__ENOTDIR UV__ERR(ENOTDIR) #else -# define UV__ENOTDIR (-4052) +#define UV__ENOTDIR (-4052) #endif #if defined(ENOTEMPTY) && !defined(_WIN32) -# define UV__ENOTEMPTY UV__ERR(ENOTEMPTY) +#define UV__ENOTEMPTY UV__ERR(ENOTEMPTY) #else -# define UV__ENOTEMPTY (-4051) +#define UV__ENOTEMPTY (-4051) #endif #if defined(ENOTSOCK) && !defined(_WIN32) -# define UV__ENOTSOCK UV__ERR(ENOTSOCK) +#define UV__ENOTSOCK UV__ERR(ENOTSOCK) #else -# define UV__ENOTSOCK (-4050) +#define UV__ENOTSOCK (-4050) #endif #if defined(ENOTSUP) && !defined(_WIN32) -# define UV__ENOTSUP UV__ERR(ENOTSUP) +#define UV__ENOTSUP UV__ERR(ENOTSUP) #else -# define UV__ENOTSUP (-4049) +#define UV__ENOTSUP (-4049) #endif #if defined(EPERM) && !defined(_WIN32) -# define UV__EPERM UV__ERR(EPERM) +#define UV__EPERM UV__ERR(EPERM) #else -# define UV__EPERM (-4048) +#define UV__EPERM (-4048) #endif #if defined(EPIPE) && !defined(_WIN32) -# define UV__EPIPE UV__ERR(EPIPE) +#define UV__EPIPE UV__ERR(EPIPE) #else -# define UV__EPIPE (-4047) +#define UV__EPIPE (-4047) #endif #if defined(EPROTO) && !defined(_WIN32) -# define UV__EPROTO UV__ERR(EPROTO) +#define UV__EPROTO UV__ERR(EPROTO) #else -# define UV__EPROTO (-4046) +#define UV__EPROTO (-4046) #endif #if defined(EPROTONOSUPPORT) && !defined(_WIN32) -# define UV__EPROTONOSUPPORT UV__ERR(EPROTONOSUPPORT) +#define UV__EPROTONOSUPPORT UV__ERR(EPROTONOSUPPORT) #else -# define UV__EPROTONOSUPPORT (-4045) +#define UV__EPROTONOSUPPORT (-4045) #endif #if defined(EPROTOTYPE) && !defined(_WIN32) -# define UV__EPROTOTYPE UV__ERR(EPROTOTYPE) +#define UV__EPROTOTYPE UV__ERR(EPROTOTYPE) #else -# define UV__EPROTOTYPE (-4044) +#define UV__EPROTOTYPE (-4044) #endif #if defined(EROFS) && !defined(_WIN32) -# define UV__EROFS UV__ERR(EROFS) +#define UV__EROFS UV__ERR(EROFS) #else -# define UV__EROFS (-4043) +#define UV__EROFS (-4043) #endif #if defined(ESHUTDOWN) && !defined(_WIN32) -# define UV__ESHUTDOWN UV__ERR(ESHUTDOWN) +#define UV__ESHUTDOWN UV__ERR(ESHUTDOWN) #else -# define UV__ESHUTDOWN (-4042) +#define UV__ESHUTDOWN (-4042) #endif #if defined(ESPIPE) && !defined(_WIN32) -# define UV__ESPIPE UV__ERR(ESPIPE) +#define UV__ESPIPE UV__ERR(ESPIPE) #else -# define UV__ESPIPE (-4041) +#define UV__ESPIPE (-4041) #endif #if defined(ESRCH) && !defined(_WIN32) -# define UV__ESRCH UV__ERR(ESRCH) +#define UV__ESRCH UV__ERR(ESRCH) #else -# define UV__ESRCH (-4040) +#define UV__ESRCH (-4040) #endif #if defined(ETIMEDOUT) && !defined(_WIN32) -# define UV__ETIMEDOUT UV__ERR(ETIMEDOUT) +#define UV__ETIMEDOUT UV__ERR(ETIMEDOUT) #else -# define UV__ETIMEDOUT (-4039) +#define UV__ETIMEDOUT (-4039) #endif #if defined(ETXTBSY) && !defined(_WIN32) -# define UV__ETXTBSY UV__ERR(ETXTBSY) +#define UV__ETXTBSY UV__ERR(ETXTBSY) #else -# define UV__ETXTBSY (-4038) +#define UV__ETXTBSY (-4038) #endif #if defined(EXDEV) && !defined(_WIN32) -# define UV__EXDEV UV__ERR(EXDEV) +#define UV__EXDEV UV__ERR(EXDEV) #else -# define UV__EXDEV (-4037) +#define UV__EXDEV (-4037) #endif #if defined(EFBIG) && !defined(_WIN32) -# define UV__EFBIG UV__ERR(EFBIG) +#define UV__EFBIG UV__ERR(EFBIG) #else -# define UV__EFBIG (-4036) +#define UV__EFBIG (-4036) #endif #if defined(ENOPROTOOPT) && !defined(_WIN32) -# define UV__ENOPROTOOPT UV__ERR(ENOPROTOOPT) +#define UV__ENOPROTOOPT UV__ERR(ENOPROTOOPT) #else -# define UV__ENOPROTOOPT (-4035) +#define UV__ENOPROTOOPT (-4035) #endif #if defined(ERANGE) && !defined(_WIN32) -# define UV__ERANGE UV__ERR(ERANGE) +#define UV__ERANGE UV__ERR(ERANGE) #else -# define UV__ERANGE (-4034) +#define UV__ERANGE (-4034) #endif #if defined(ENXIO) && !defined(_WIN32) -# define UV__ENXIO UV__ERR(ENXIO) +#define UV__ENXIO UV__ERR(ENXIO) #else -# define UV__ENXIO (-4033) +#define UV__ENXIO (-4033) #endif #if defined(EMLINK) && !defined(_WIN32) -# define UV__EMLINK UV__ERR(EMLINK) +#define UV__EMLINK UV__ERR(EMLINK) #else -# define UV__EMLINK (-4032) +#define UV__EMLINK (-4032) #endif /* EHOSTDOWN is not visible on BSD-like systems when _POSIX_C_SOURCE is @@ -409,52 +409,48 @@ * icky to hard-code it. */ #if defined(EHOSTDOWN) && !defined(_WIN32) -# define UV__EHOSTDOWN UV__ERR(EHOSTDOWN) -#elif defined(__APPLE__) || \ - defined(__DragonFly__) || \ - defined(__FreeBSD__) || \ - defined(__FreeBSD_kernel__) || \ - defined(__NetBSD__) || \ - defined(__OpenBSD__) -# define UV__EHOSTDOWN (-64) +#define UV__EHOSTDOWN UV__ERR(EHOSTDOWN) +#elif defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || \ + defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) +#define UV__EHOSTDOWN (-64) #else -# define UV__EHOSTDOWN (-4031) +#define UV__EHOSTDOWN (-4031) #endif #if defined(EREMOTEIO) && !defined(_WIN32) -# define UV__EREMOTEIO UV__ERR(EREMOTEIO) +#define UV__EREMOTEIO UV__ERR(EREMOTEIO) #else -# define UV__EREMOTEIO (-4030) +#define UV__EREMOTEIO (-4030) #endif #if defined(ENOTTY) && !defined(_WIN32) -# define UV__ENOTTY UV__ERR(ENOTTY) +#define UV__ENOTTY UV__ERR(ENOTTY) #else -# define UV__ENOTTY (-4029) +#define UV__ENOTTY (-4029) #endif #if defined(EFTYPE) && !defined(_WIN32) -# define UV__EFTYPE UV__ERR(EFTYPE) +#define UV__EFTYPE UV__ERR(EFTYPE) #else -# define UV__EFTYPE (-4028) +#define UV__EFTYPE (-4028) #endif #if defined(EILSEQ) && !defined(_WIN32) -# define UV__EILSEQ UV__ERR(EILSEQ) +#define UV__EILSEQ UV__ERR(EILSEQ) #else -# define UV__EILSEQ (-4027) +#define UV__EILSEQ (-4027) #endif #if defined(EOVERFLOW) && !defined(_WIN32) -# define UV__EOVERFLOW UV__ERR(EOVERFLOW) +#define UV__EOVERFLOW UV__ERR(EOVERFLOW) #else -# define UV__EOVERFLOW (-4026) +#define UV__EOVERFLOW (-4026) #endif #if defined(ESOCKTNOSUPPORT) && !defined(_WIN32) -# define UV__ESOCKTNOSUPPORT UV__ERR(ESOCKTNOSUPPORT) +#define UV__ESOCKTNOSUPPORT UV__ERR(ESOCKTNOSUPPORT) #else -# define UV__ESOCKTNOSUPPORT (-4025) +#define UV__ESOCKTNOSUPPORT (-4025) #endif #endif /* UV_ERRNO_H_ */ diff --git a/src/libuv/include/uv/linux.h b/src/libuv/include/uv/linux.h index 9b38405a1..99291a25a 100644 --- a/src/libuv/include/uv/linux.h +++ b/src/libuv/include/uv/linux.h @@ -22,13 +22,13 @@ #ifndef UV_LINUX_H #define UV_LINUX_H -#define UV_PLATFORM_LOOP_FIELDS \ - uv__io_t inotify_read_watcher; \ - void* inotify_watchers; \ - int inotify_fd; \ +#define UV_PLATFORM_LOOP_FIELDS \ + uv__io_t inotify_read_watcher; \ + void *inotify_watchers; \ + int inotify_fd; -#define UV_PLATFORM_FS_EVENT_FIELDS \ - void* watchers[2]; \ - int wd; \ +#define UV_PLATFORM_FS_EVENT_FIELDS \ + void *watchers[2]; \ + int wd; #endif /* UV_LINUX_H */ diff --git a/src/libuv/include/uv/os390.h b/src/libuv/include/uv/os390.h index 0267d74cb..e85b794e8 100644 --- a/src/libuv/include/uv/os390.h +++ b/src/libuv/include/uv/os390.h @@ -24,10 +24,8 @@ #define UV_PLATFORM_SEM_T long -#define UV_PLATFORM_LOOP_FIELDS \ - void* ep; \ +#define UV_PLATFORM_LOOP_FIELDS void *ep; -#define UV_PLATFORM_FS_EVENT_FIELDS \ - char rfis_rftok[8]; \ +#define UV_PLATFORM_FS_EVENT_FIELDS char rfis_rftok[8]; #endif /* UV_MVS_H */ diff --git a/src/libuv/include/uv/posix.h b/src/libuv/include/uv/posix.h index 9a96634db..11c8431d0 100644 --- a/src/libuv/include/uv/posix.h +++ b/src/libuv/include/uv/posix.h @@ -22,10 +22,10 @@ #ifndef UV_POSIX_H #define UV_POSIX_H -#define UV_PLATFORM_LOOP_FIELDS \ - struct pollfd* poll_fds; \ - size_t poll_fds_used; \ - size_t poll_fds_size; \ - unsigned char poll_fds_iterating; \ +#define UV_PLATFORM_LOOP_FIELDS \ + struct pollfd *poll_fds; \ + size_t poll_fds_used; \ + size_t poll_fds_size; \ + unsigned char poll_fds_iterating; #endif /* UV_POSIX_H */ diff --git a/src/libuv/include/uv/stdint-msvc2008.h b/src/libuv/include/uv/stdint-msvc2008.h index d02608a59..b3d2a71aa 100644 --- a/src/libuv/include/uv/stdint-msvc2008.h +++ b/src/libuv/include/uv/stdint-msvc2008.h @@ -1,32 +1,32 @@ // ISO C9x compliant stdint.h for Microsoft Visual Studio -// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 -// +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 +// // Copyright (c) 2006-2008 Alexander Chemeris -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: -// +// // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. -// +// // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // 3. The name of the author may be used to endorse or promote products // derived from this software without specific prior written permission. -// +// // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// +// /////////////////////////////////////////////////////////////////////////////// #ifndef _MSC_VER // [ @@ -49,20 +49,19 @@ #ifdef __cplusplus extern "C" { #endif -# include +#include #ifdef __cplusplus } #endif // Define _W64 macros to mark types changing their size, like intptr_t. #ifndef _W64 -# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 -# define _W64 __w64 -# else -# define _W64 -# endif +#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 +#define _W64 __w64 +#else +#define _W64 +#endif #endif - // 7.18.1 Integer types @@ -72,176 +71,175 @@ extern "C" { // realize that, e.g. char has the same size as __int8 // so we give up on __intX for them. #if (_MSC_VER < 1300) - typedef signed char int8_t; - typedef signed short int16_t; - typedef signed int int32_t; - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; +typedef signed char int8_t; +typedef signed short int16_t; +typedef signed int int32_t; +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; #else - typedef signed __int8 int8_t; - typedef signed __int16 int16_t; - typedef signed __int32 int32_t; - typedef unsigned __int8 uint8_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int32 uint32_t; +typedef signed __int8 int8_t; +typedef signed __int16 int16_t; +typedef signed __int32 int32_t; +typedef unsigned __int8 uint8_t; +typedef unsigned __int16 uint16_t; +typedef unsigned __int32 uint32_t; #endif -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; - +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; // 7.18.1.2 Minimum-width integer types -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_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; // 7.18.1.3 Fastest minimum-width integer types -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 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; // 7.18.1.4 Integer types capable of holding object pointers #ifdef _WIN64 // [ - typedef signed __int64 intptr_t; - typedef unsigned __int64 uintptr_t; -#else // _WIN64 ][ - typedef _W64 signed int intptr_t; - typedef _W64 unsigned int uintptr_t; +typedef signed __int64 intptr_t; +typedef unsigned __int64 uintptr_t; +#else // _WIN64 ][ +typedef _W64 signed int intptr_t; +typedef _W64 unsigned int uintptr_t; #endif // _WIN64 ] // 7.18.1.5 Greatest-width integer types -typedef int64_t intmax_t; -typedef uint64_t uintmax_t; - +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; // 7.18.2 Limits of specified-width integer types -#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 +#if !defined(__cplusplus) || \ + defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and + // footnote 221 at page 259 // 7.18.2.1 Limits of exact-width integer types -#define INT8_MIN ((int8_t)_I8_MIN) -#define INT8_MAX _I8_MAX -#define INT16_MIN ((int16_t)_I16_MIN) -#define INT16_MAX _I16_MAX -#define INT32_MIN ((int32_t)_I32_MIN) -#define INT32_MAX _I32_MAX -#define INT64_MIN ((int64_t)_I64_MIN) -#define INT64_MAX _I64_MAX -#define UINT8_MAX _UI8_MAX -#define UINT16_MAX _UI16_MAX -#define UINT32_MAX _UI32_MAX -#define UINT64_MAX _UI64_MAX +#define INT8_MIN ((int8_t)_I8_MIN) +#define INT8_MAX _I8_MAX +#define INT16_MIN ((int16_t)_I16_MIN) +#define INT16_MAX _I16_MAX +#define INT32_MIN ((int32_t)_I32_MIN) +#define INT32_MAX _I32_MAX +#define INT64_MIN ((int64_t)_I64_MIN) +#define INT64_MAX _I64_MAX +#define UINT8_MAX _UI8_MAX +#define UINT16_MAX _UI16_MAX +#define UINT32_MAX _UI32_MAX +#define UINT64_MAX _UI64_MAX // 7.18.2.2 Limits of minimum-width integer types -#define INT_LEAST8_MIN INT8_MIN -#define INT_LEAST8_MAX INT8_MAX -#define INT_LEAST16_MIN INT16_MIN -#define INT_LEAST16_MAX INT16_MAX -#define INT_LEAST32_MIN INT32_MIN -#define INT_LEAST32_MAX INT32_MAX -#define INT_LEAST64_MIN INT64_MIN -#define INT_LEAST64_MAX INT64_MAX -#define UINT_LEAST8_MAX UINT8_MAX -#define UINT_LEAST16_MAX UINT16_MAX -#define UINT_LEAST32_MAX UINT32_MAX -#define UINT_LEAST64_MAX UINT64_MAX +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MIN INT64_MIN +#define INT_LEAST64_MAX INT64_MAX +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX // 7.18.2.3 Limits of fastest minimum-width integer types -#define INT_FAST8_MIN INT8_MIN -#define INT_FAST8_MAX INT8_MAX -#define INT_FAST16_MIN INT16_MIN -#define INT_FAST16_MAX INT16_MAX -#define INT_FAST32_MIN INT32_MIN -#define INT_FAST32_MAX INT32_MAX -#define INT_FAST64_MIN INT64_MIN -#define INT_FAST64_MAX INT64_MAX -#define UINT_FAST8_MAX UINT8_MAX -#define UINT_FAST16_MAX UINT16_MAX -#define UINT_FAST32_MAX UINT32_MAX -#define UINT_FAST64_MAX UINT64_MAX +#define INT_FAST8_MIN INT8_MIN +#define INT_FAST8_MAX INT8_MAX +#define INT_FAST16_MIN INT16_MIN +#define INT_FAST16_MAX INT16_MAX +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MIN INT64_MIN +#define INT_FAST64_MAX INT64_MAX +#define UINT_FAST8_MAX UINT8_MAX +#define UINT_FAST16_MAX UINT16_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX // 7.18.2.4 Limits of integer types capable of holding object pointers #ifdef _WIN64 // [ -# define INTPTR_MIN INT64_MIN -# define INTPTR_MAX INT64_MAX -# define UINTPTR_MAX UINT64_MAX +#define INTPTR_MIN INT64_MIN +#define INTPTR_MAX INT64_MAX +#define UINTPTR_MAX UINT64_MAX #else // _WIN64 ][ -# define INTPTR_MIN INT32_MIN -# define INTPTR_MAX INT32_MAX -# define UINTPTR_MAX UINT32_MAX +#define INTPTR_MIN INT32_MIN +#define INTPTR_MAX INT32_MAX +#define UINTPTR_MAX UINT32_MAX #endif // _WIN64 ] // 7.18.2.5 Limits of greatest-width integer types -#define INTMAX_MIN INT64_MIN -#define INTMAX_MAX INT64_MAX -#define UINTMAX_MAX UINT64_MAX +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX // 7.18.3 Limits of other integer types #ifdef _WIN64 // [ -# define PTRDIFF_MIN _I64_MIN -# define PTRDIFF_MAX _I64_MAX -#else // _WIN64 ][ -# define PTRDIFF_MIN _I32_MIN -# define PTRDIFF_MAX _I32_MAX -#endif // _WIN64 ] +#define PTRDIFF_MIN _I64_MIN +#define PTRDIFF_MAX _I64_MAX +#else // _WIN64 ][ +#define PTRDIFF_MIN _I32_MIN +#define PTRDIFF_MAX _I32_MAX +#endif // _WIN64 ] -#define SIG_ATOMIC_MIN INT_MIN -#define SIG_ATOMIC_MAX INT_MAX +#define SIG_ATOMIC_MIN INT_MIN +#define SIG_ATOMIC_MAX INT_MAX #ifndef SIZE_MAX // [ -# ifdef _WIN64 // [ -# define SIZE_MAX _UI64_MAX -# else // _WIN64 ][ -# define SIZE_MAX _UI32_MAX -# endif // _WIN64 ] +#ifdef _WIN64 // [ +#define SIZE_MAX _UI64_MAX +#else // _WIN64 ][ +#define SIZE_MAX _UI32_MAX +#endif // _WIN64 ] #endif // SIZE_MAX ] // WCHAR_MIN and WCHAR_MAX are also defined in #ifndef WCHAR_MIN // [ -# define WCHAR_MIN 0 -#endif // WCHAR_MIN ] +#define WCHAR_MIN 0 +#endif // WCHAR_MIN ] #ifndef WCHAR_MAX // [ -# define WCHAR_MAX _UI16_MAX -#endif // WCHAR_MAX ] +#define WCHAR_MAX _UI16_MAX +#endif // WCHAR_MAX ] -#define WINT_MIN 0 -#define WINT_MAX _UI16_MAX +#define WINT_MIN 0 +#define WINT_MAX _UI16_MAX #endif // __STDC_LIMIT_MACROS ] - // 7.18.4 Limits of other integer types -#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 +#if !defined(__cplusplus) || \ + defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 // 7.18.4.1 Macros for minimum-width integer constants -#define INT8_C(val) val##i8 +#define INT8_C(val) val##i8 #define INT16_C(val) val##i16 #define INT32_C(val) val##i32 #define INT64_C(val) val##i64 -#define UINT8_C(val) val##ui8 +#define UINT8_C(val) val##ui8 #define UINT16_C(val) val##ui16 #define UINT32_C(val) val##ui32 #define UINT64_C(val) val##ui64 // 7.18.4.2 Macros for greatest-width integer constants -#define INTMAX_C INT64_C -#define UINTMAX_C UINT64_C +#define INTMAX_C INT64_C +#define UINTMAX_C UINT64_C #endif // __STDC_CONSTANT_MACROS ] - #endif // _MSC_STDINT_H_ ] diff --git a/src/libuv/include/uv/sunos.h b/src/libuv/include/uv/sunos.h index 042166424..3d8d8dd17 100644 --- a/src/libuv/include/uv/sunos.h +++ b/src/libuv/include/uv/sunos.h @@ -22,22 +22,22 @@ #ifndef UV_SUNOS_H #define UV_SUNOS_H -#include #include +#include /* For the sake of convenience and reduced #ifdef-ery in src/unix/sunos.c, * add the fs_event fields even when this version of SunOS doesn't support * file watching. */ -#define UV_PLATFORM_LOOP_FIELDS \ - uv__io_t fs_event_watcher; \ - int fs_fd; \ +#define UV_PLATFORM_LOOP_FIELDS \ + uv__io_t fs_event_watcher; \ + int fs_fd; #if defined(PORT_SOURCE_FILE) -# define UV_PLATFORM_FS_EVENT_FIELDS \ - file_obj_t fo; \ - int fd; \ +#define UV_PLATFORM_FS_EVENT_FIELDS \ + file_obj_t fo; \ + int fd; #endif /* defined(PORT_SOURCE_FILE) */ diff --git a/src/libuv/include/uv/threadpool.h b/src/libuv/include/uv/threadpool.h index 9708ebdd5..53c4e098f 100644 --- a/src/libuv/include/uv/threadpool.h +++ b/src/libuv/include/uv/threadpool.h @@ -30,8 +30,8 @@ struct uv__work { void (*work)(struct uv__work *w); void (*done)(struct uv__work *w, int status); - struct uv_loop_s* loop; - void* wq[2]; + struct uv_loop_s *loop; + void *wq[2]; }; #endif /* UV_THREADPOOL_H_ */ diff --git a/src/libuv/include/uv/tree.h b/src/libuv/include/uv/tree.h index 2b28835fd..b4badbbde 100644 --- a/src/libuv/include/uv/tree.h +++ b/src/libuv/include/uv/tree.h @@ -23,15 +23,15 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef UV_TREE_H_ -#define UV_TREE_H_ +#ifndef UV_TREE_H_ +#define UV_TREE_H_ #ifndef UV__UNUSED -# if __GNUC__ -# define UV__UNUSED __attribute__((unused)) -# else -# define UV__UNUSED -# endif +#if __GNUC__ +#define UV__UNUSED __attribute__((unused)) +#else +#define UV__UNUSED +#endif #endif /* @@ -61,708 +61,679 @@ * The maximum height of a red-black tree is 2lg (n+1). */ -#define SPLAY_HEAD(name, type) \ -struct name { \ - struct type *sph_root; /* root of the tree */ \ -} +#define SPLAY_HEAD(name, type) \ + struct name { \ + struct type *sph_root; /* root of the tree */ \ + } -#define SPLAY_INITIALIZER(root) \ - { NULL } +#define SPLAY_INITIALIZER(root) {NULL} -#define SPLAY_INIT(root) do { \ - (root)->sph_root = NULL; \ -} while (/*CONSTCOND*/ 0) +#define SPLAY_INIT(root) \ + do { \ + (root)->sph_root = NULL; \ + } while (/*CONSTCOND*/ 0) -#define SPLAY_ENTRY(type) \ -struct { \ - struct type *spe_left; /* left element */ \ - struct type *spe_right; /* right element */ \ -} +#define SPLAY_ENTRY(type) \ + struct { \ + struct type *spe_left; /* left element */ \ + struct type *spe_right; /* right element */ \ + } -#define SPLAY_LEFT(elm, field) (elm)->field.spe_left -#define SPLAY_RIGHT(elm, field) (elm)->field.spe_right -#define SPLAY_ROOT(head) (head)->sph_root -#define SPLAY_EMPTY(head) (SPLAY_ROOT(head) == NULL) +#define SPLAY_LEFT(elm, field) (elm)->field.spe_left +#define SPLAY_RIGHT(elm, field) (elm)->field.spe_right +#define SPLAY_ROOT(head) (head)->sph_root +#define SPLAY_EMPTY(head) (SPLAY_ROOT(head) == NULL) /* SPLAY_ROTATE_{LEFT,RIGHT} expect that tmp hold SPLAY_{RIGHT,LEFT} */ -#define SPLAY_ROTATE_RIGHT(head, tmp, field) do { \ - SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(tmp, field); \ - SPLAY_RIGHT(tmp, field) = (head)->sph_root; \ - (head)->sph_root = tmp; \ -} while (/*CONSTCOND*/ 0) - -#define SPLAY_ROTATE_LEFT(head, tmp, field) do { \ - SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field); \ - SPLAY_LEFT(tmp, field) = (head)->sph_root; \ - (head)->sph_root = tmp; \ -} while (/*CONSTCOND*/ 0) - -#define SPLAY_LINKLEFT(head, tmp, field) do { \ - SPLAY_LEFT(tmp, field) = (head)->sph_root; \ - tmp = (head)->sph_root; \ - (head)->sph_root = SPLAY_LEFT((head)->sph_root, field); \ -} while (/*CONSTCOND*/ 0) - -#define SPLAY_LINKRIGHT(head, tmp, field) do { \ - SPLAY_RIGHT(tmp, field) = (head)->sph_root; \ - tmp = (head)->sph_root; \ - (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field); \ -} while (/*CONSTCOND*/ 0) - -#define SPLAY_ASSEMBLE(head, node, left, right, field) do { \ - SPLAY_RIGHT(left, field) = SPLAY_LEFT((head)->sph_root, field); \ - SPLAY_LEFT(right, field) = SPLAY_RIGHT((head)->sph_root, field); \ - SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(node, field); \ - SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(node, field); \ -} while (/*CONSTCOND*/ 0) +#define SPLAY_ROTATE_RIGHT(head, tmp, field) \ + do { \ + SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(tmp, field); \ + SPLAY_RIGHT(tmp, field) = (head)->sph_root; \ + (head)->sph_root = tmp; \ + } while (/*CONSTCOND*/ 0) + +#define SPLAY_ROTATE_LEFT(head, tmp, field) \ + do { \ + SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field); \ + SPLAY_LEFT(tmp, field) = (head)->sph_root; \ + (head)->sph_root = tmp; \ + } while (/*CONSTCOND*/ 0) + +#define SPLAY_LINKLEFT(head, tmp, field) \ + do { \ + SPLAY_LEFT(tmp, field) = (head)->sph_root; \ + tmp = (head)->sph_root; \ + (head)->sph_root = SPLAY_LEFT((head)->sph_root, field); \ + } while (/*CONSTCOND*/ 0) + +#define SPLAY_LINKRIGHT(head, tmp, field) \ + do { \ + SPLAY_RIGHT(tmp, field) = (head)->sph_root; \ + tmp = (head)->sph_root; \ + (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field); \ + } while (/*CONSTCOND*/ 0) + +#define SPLAY_ASSEMBLE(head, node, left, right, field) \ + do { \ + SPLAY_RIGHT(left, field) = SPLAY_LEFT((head)->sph_root, field); \ + SPLAY_LEFT(right, field) = SPLAY_RIGHT((head)->sph_root, field); \ + SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(node, field); \ + SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(node, field); \ + } while (/*CONSTCOND*/ 0) /* Generates prototypes and inline functions */ -#define SPLAY_PROTOTYPE(name, type, field, cmp) \ -void name##_SPLAY(struct name *, struct type *); \ -void name##_SPLAY_MINMAX(struct name *, int); \ -struct type *name##_SPLAY_INSERT(struct name *, struct type *); \ -struct type *name##_SPLAY_REMOVE(struct name *, struct type *); \ - \ -/* Finds the node with the same key as elm */ \ -static __inline struct type * \ -name##_SPLAY_FIND(struct name *head, struct type *elm) \ -{ \ - if (SPLAY_EMPTY(head)) \ - return(NULL); \ - name##_SPLAY(head, elm); \ - if ((cmp)(elm, (head)->sph_root) == 0) \ - return (head->sph_root); \ - return (NULL); \ -} \ - \ -static __inline struct type * \ -name##_SPLAY_NEXT(struct name *head, struct type *elm) \ -{ \ - name##_SPLAY(head, elm); \ - if (SPLAY_RIGHT(elm, field) != NULL) { \ - elm = SPLAY_RIGHT(elm, field); \ - while (SPLAY_LEFT(elm, field) != NULL) { \ - elm = SPLAY_LEFT(elm, field); \ - } \ - } else \ - elm = NULL; \ - return (elm); \ -} \ - \ -static __inline struct type * \ -name##_SPLAY_MIN_MAX(struct name *head, int val) \ -{ \ - name##_SPLAY_MINMAX(head, val); \ - return (SPLAY_ROOT(head)); \ -} +#define SPLAY_PROTOTYPE(name, type, field, cmp) \ + void name##_SPLAY(struct name *, struct type *); \ + void name##_SPLAY_MINMAX(struct name *, int); \ + struct type *name##_SPLAY_INSERT(struct name *, struct type *); \ + struct type *name##_SPLAY_REMOVE(struct name *, struct type *); \ + \ + /* Finds the node with the same key as elm */ \ + static __inline struct type *name##_SPLAY_FIND(struct name *head, \ + struct type *elm) { \ + if (SPLAY_EMPTY(head)) \ + return (NULL); \ + name##_SPLAY(head, elm); \ + if ((cmp)(elm, (head)->sph_root) == 0) \ + return (head->sph_root); \ + return (NULL); \ + } \ + \ + static __inline struct type *name##_SPLAY_NEXT(struct name *head, \ + struct type *elm) { \ + name##_SPLAY(head, elm); \ + if (SPLAY_RIGHT(elm, field) != NULL) { \ + elm = SPLAY_RIGHT(elm, field); \ + while (SPLAY_LEFT(elm, field) != NULL) { \ + elm = SPLAY_LEFT(elm, field); \ + } \ + } else \ + elm = NULL; \ + return (elm); \ + } \ + \ + static __inline struct type *name##_SPLAY_MIN_MAX(struct name *head, \ + int val) { \ + name##_SPLAY_MINMAX(head, val); \ + return (SPLAY_ROOT(head)); \ + } /* Main splay operation. * Moves node close to the key of elm to top */ -#define SPLAY_GENERATE(name, type, field, cmp) \ -struct type * \ -name##_SPLAY_INSERT(struct name *head, struct type *elm) \ -{ \ - if (SPLAY_EMPTY(head)) { \ - SPLAY_LEFT(elm, field) = SPLAY_RIGHT(elm, field) = NULL; \ - } else { \ - int __comp; \ - name##_SPLAY(head, elm); \ - __comp = (cmp)(elm, (head)->sph_root); \ - if(__comp < 0) { \ - SPLAY_LEFT(elm, field) = SPLAY_LEFT((head)->sph_root, field); \ - SPLAY_RIGHT(elm, field) = (head)->sph_root; \ - SPLAY_LEFT((head)->sph_root, field) = NULL; \ - } else if (__comp > 0) { \ - SPLAY_RIGHT(elm, field) = SPLAY_RIGHT((head)->sph_root, field); \ - SPLAY_LEFT(elm, field) = (head)->sph_root; \ - SPLAY_RIGHT((head)->sph_root, field) = NULL; \ - } else \ - return ((head)->sph_root); \ - } \ - (head)->sph_root = (elm); \ - return (NULL); \ -} \ - \ -struct type * \ -name##_SPLAY_REMOVE(struct name *head, struct type *elm) \ -{ \ - struct type *__tmp; \ - if (SPLAY_EMPTY(head)) \ - return (NULL); \ - name##_SPLAY(head, elm); \ - if ((cmp)(elm, (head)->sph_root) == 0) { \ - if (SPLAY_LEFT((head)->sph_root, field) == NULL) { \ - (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field); \ - } else { \ - __tmp = SPLAY_RIGHT((head)->sph_root, field); \ - (head)->sph_root = SPLAY_LEFT((head)->sph_root, field); \ - name##_SPLAY(head, elm); \ - SPLAY_RIGHT((head)->sph_root, field) = __tmp; \ - } \ - return (elm); \ - } \ - return (NULL); \ -} \ - \ -void \ -name##_SPLAY(struct name *head, struct type *elm) \ -{ \ - struct type __node, *__left, *__right, *__tmp; \ - int __comp; \ - \ - SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL; \ - __left = __right = &__node; \ - \ - while ((__comp = (cmp)(elm, (head)->sph_root)) != 0) { \ - if (__comp < 0) { \ - __tmp = SPLAY_LEFT((head)->sph_root, field); \ - if (__tmp == NULL) \ - break; \ - if ((cmp)(elm, __tmp) < 0){ \ - SPLAY_ROTATE_RIGHT(head, __tmp, field); \ - if (SPLAY_LEFT((head)->sph_root, field) == NULL) \ - break; \ - } \ - SPLAY_LINKLEFT(head, __right, field); \ - } else if (__comp > 0) { \ - __tmp = SPLAY_RIGHT((head)->sph_root, field); \ - if (__tmp == NULL) \ - break; \ - if ((cmp)(elm, __tmp) > 0){ \ - SPLAY_ROTATE_LEFT(head, __tmp, field); \ - if (SPLAY_RIGHT((head)->sph_root, field) == NULL) \ - break; \ - } \ - SPLAY_LINKRIGHT(head, __left, field); \ - } \ - } \ - SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \ -} \ - \ -/* Splay with either the minimum or the maximum element \ - * Used to find minimum or maximum element in tree. \ - */ \ -void name##_SPLAY_MINMAX(struct name *head, int __comp) \ -{ \ - struct type __node, *__left, *__right, *__tmp; \ - \ - SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL; \ - __left = __right = &__node; \ - \ - for (;;) { \ - if (__comp < 0) { \ - __tmp = SPLAY_LEFT((head)->sph_root, field); \ - if (__tmp == NULL) \ - break; \ - if (__comp < 0){ \ - SPLAY_ROTATE_RIGHT(head, __tmp, field); \ - if (SPLAY_LEFT((head)->sph_root, field) == NULL) \ - break; \ - } \ - SPLAY_LINKLEFT(head, __right, field); \ - } else if (__comp > 0) { \ - __tmp = SPLAY_RIGHT((head)->sph_root, field); \ - if (__tmp == NULL) \ - break; \ - if (__comp > 0) { \ - SPLAY_ROTATE_LEFT(head, __tmp, field); \ - if (SPLAY_RIGHT((head)->sph_root, field) == NULL) \ - break; \ - } \ - SPLAY_LINKRIGHT(head, __left, field); \ - } \ - } \ - SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \ -} - -#define SPLAY_NEGINF -1 -#define SPLAY_INF 1 - -#define SPLAY_INSERT(name, x, y) name##_SPLAY_INSERT(x, y) -#define SPLAY_REMOVE(name, x, y) name##_SPLAY_REMOVE(x, y) -#define SPLAY_FIND(name, x, y) name##_SPLAY_FIND(x, y) -#define SPLAY_NEXT(name, x, y) name##_SPLAY_NEXT(x, y) -#define SPLAY_MIN(name, x) (SPLAY_EMPTY(x) ? NULL \ - : name##_SPLAY_MIN_MAX(x, SPLAY_NEGINF)) -#define SPLAY_MAX(name, x) (SPLAY_EMPTY(x) ? NULL \ - : name##_SPLAY_MIN_MAX(x, SPLAY_INF)) - -#define SPLAY_FOREACH(x, name, head) \ - for ((x) = SPLAY_MIN(name, head); \ - (x) != NULL; \ +#define SPLAY_GENERATE(name, type, field, cmp) \ + struct type *name##_SPLAY_INSERT(struct name *head, struct type *elm) { \ + if (SPLAY_EMPTY(head)) { \ + SPLAY_LEFT(elm, field) = SPLAY_RIGHT(elm, field) = NULL; \ + } else { \ + int __comp; \ + name##_SPLAY(head, elm); \ + __comp = (cmp)(elm, (head)->sph_root); \ + if (__comp < 0) { \ + SPLAY_LEFT(elm, field) = SPLAY_LEFT((head)->sph_root, field); \ + SPLAY_RIGHT(elm, field) = (head)->sph_root; \ + SPLAY_LEFT((head)->sph_root, field) = NULL; \ + } else if (__comp > 0) { \ + SPLAY_RIGHT(elm, field) = SPLAY_RIGHT((head)->sph_root, field); \ + SPLAY_LEFT(elm, field) = (head)->sph_root; \ + SPLAY_RIGHT((head)->sph_root, field) = NULL; \ + } else \ + return ((head)->sph_root); \ + } \ + (head)->sph_root = (elm); \ + return (NULL); \ + } \ + \ + struct type *name##_SPLAY_REMOVE(struct name *head, struct type *elm) { \ + struct type *__tmp; \ + if (SPLAY_EMPTY(head)) \ + return (NULL); \ + name##_SPLAY(head, elm); \ + if ((cmp)(elm, (head)->sph_root) == 0) { \ + if (SPLAY_LEFT((head)->sph_root, field) == NULL) { \ + (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field); \ + } else { \ + __tmp = SPLAY_RIGHT((head)->sph_root, field); \ + (head)->sph_root = SPLAY_LEFT((head)->sph_root, field); \ + name##_SPLAY(head, elm); \ + SPLAY_RIGHT((head)->sph_root, field) = __tmp; \ + } \ + return (elm); \ + } \ + return (NULL); \ + } \ + \ + void name##_SPLAY(struct name *head, struct type *elm) { \ + struct type __node, *__left, *__right, *__tmp; \ + int __comp; \ + \ + SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL; \ + __left = __right = &__node; \ + \ + while ((__comp = (cmp)(elm, (head)->sph_root)) != 0) { \ + if (__comp < 0) { \ + __tmp = SPLAY_LEFT((head)->sph_root, field); \ + if (__tmp == NULL) \ + break; \ + if ((cmp)(elm, __tmp) < 0) { \ + SPLAY_ROTATE_RIGHT(head, __tmp, field); \ + if (SPLAY_LEFT((head)->sph_root, field) == NULL) \ + break; \ + } \ + SPLAY_LINKLEFT(head, __right, field); \ + } else if (__comp > 0) { \ + __tmp = SPLAY_RIGHT((head)->sph_root, field); \ + if (__tmp == NULL) \ + break; \ + if ((cmp)(elm, __tmp) > 0) { \ + SPLAY_ROTATE_LEFT(head, __tmp, field); \ + if (SPLAY_RIGHT((head)->sph_root, field) == NULL) \ + break; \ + } \ + SPLAY_LINKRIGHT(head, __left, field); \ + } \ + } \ + SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \ + } \ + \ + /* Splay with either the minimum or the maximum element \ + * Used to find minimum or maximum element in tree. \ + */ \ + void name##_SPLAY_MINMAX(struct name *head, int __comp) { \ + struct type __node, *__left, *__right, *__tmp; \ + \ + SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL; \ + __left = __right = &__node; \ + \ + for (;;) { \ + if (__comp < 0) { \ + __tmp = SPLAY_LEFT((head)->sph_root, field); \ + if (__tmp == NULL) \ + break; \ + if (__comp < 0) { \ + SPLAY_ROTATE_RIGHT(head, __tmp, field); \ + if (SPLAY_LEFT((head)->sph_root, field) == NULL) \ + break; \ + } \ + SPLAY_LINKLEFT(head, __right, field); \ + } else if (__comp > 0) { \ + __tmp = SPLAY_RIGHT((head)->sph_root, field); \ + if (__tmp == NULL) \ + break; \ + if (__comp > 0) { \ + SPLAY_ROTATE_LEFT(head, __tmp, field); \ + if (SPLAY_RIGHT((head)->sph_root, field) == NULL) \ + break; \ + } \ + SPLAY_LINKRIGHT(head, __left, field); \ + } \ + } \ + SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \ + } + +#define SPLAY_NEGINF -1 +#define SPLAY_INF 1 + +#define SPLAY_INSERT(name, x, y) name##_SPLAY_INSERT(x, y) +#define SPLAY_REMOVE(name, x, y) name##_SPLAY_REMOVE(x, y) +#define SPLAY_FIND(name, x, y) name##_SPLAY_FIND(x, y) +#define SPLAY_NEXT(name, x, y) name##_SPLAY_NEXT(x, y) +#define SPLAY_MIN(name, x) \ + (SPLAY_EMPTY(x) ? NULL : name##_SPLAY_MIN_MAX(x, SPLAY_NEGINF)) +#define SPLAY_MAX(name, x) \ + (SPLAY_EMPTY(x) ? NULL : name##_SPLAY_MIN_MAX(x, SPLAY_INF)) + +#define SPLAY_FOREACH(x, name, head) \ + for ((x) = SPLAY_MIN(name, head); (x) != NULL; \ (x) = SPLAY_NEXT(name, head, x)) /* Macros that define a red-black tree */ -#define RB_HEAD(name, type) \ -struct name { \ - struct type *rbh_root; /* root of the tree */ \ -} - -#define RB_INITIALIZER(root) \ - { NULL } - -#define RB_INIT(root) do { \ - (root)->rbh_root = NULL; \ -} while (/*CONSTCOND*/ 0) - -#define RB_BLACK 0 -#define RB_RED 1 -#define RB_ENTRY(type) \ -struct { \ - struct type *rbe_left; /* left element */ \ - struct type *rbe_right; /* right element */ \ - struct type *rbe_parent; /* parent element */ \ - int rbe_color; /* node color */ \ -} - -#define RB_LEFT(elm, field) (elm)->field.rbe_left -#define RB_RIGHT(elm, field) (elm)->field.rbe_right -#define RB_PARENT(elm, field) (elm)->field.rbe_parent -#define RB_COLOR(elm, field) (elm)->field.rbe_color -#define RB_ROOT(head) (head)->rbh_root -#define RB_EMPTY(head) (RB_ROOT(head) == NULL) - -#define RB_SET(elm, parent, field) do { \ - RB_PARENT(elm, field) = parent; \ - RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL; \ - RB_COLOR(elm, field) = RB_RED; \ -} while (/*CONSTCOND*/ 0) - -#define RB_SET_BLACKRED(black, red, field) do { \ - RB_COLOR(black, field) = RB_BLACK; \ - RB_COLOR(red, field) = RB_RED; \ -} while (/*CONSTCOND*/ 0) +#define RB_HEAD(name, type) \ + struct name { \ + struct type *rbh_root; /* root of the tree */ \ + } + +#define RB_INITIALIZER(root) {NULL} + +#define RB_INIT(root) \ + do { \ + (root)->rbh_root = NULL; \ + } while (/*CONSTCOND*/ 0) + +#define RB_BLACK 0 +#define RB_RED 1 +#define RB_ENTRY(type) \ + struct { \ + struct type *rbe_left; /* left element */ \ + struct type *rbe_right; /* right element */ \ + struct type *rbe_parent; /* parent element */ \ + int rbe_color; /* node color */ \ + } + +#define RB_LEFT(elm, field) (elm)->field.rbe_left +#define RB_RIGHT(elm, field) (elm)->field.rbe_right +#define RB_PARENT(elm, field) (elm)->field.rbe_parent +#define RB_COLOR(elm, field) (elm)->field.rbe_color +#define RB_ROOT(head) (head)->rbh_root +#define RB_EMPTY(head) (RB_ROOT(head) == NULL) + +#define RB_SET(elm, parent, field) \ + do { \ + RB_PARENT(elm, field) = parent; \ + RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL; \ + RB_COLOR(elm, field) = RB_RED; \ + } while (/*CONSTCOND*/ 0) + +#define RB_SET_BLACKRED(black, red, field) \ + do { \ + RB_COLOR(black, field) = RB_BLACK; \ + RB_COLOR(red, field) = RB_RED; \ + } while (/*CONSTCOND*/ 0) #ifndef RB_AUGMENT -#define RB_AUGMENT(x) do {} while (0) +#define RB_AUGMENT(x) \ + do { \ + } while (0) #endif -#define RB_ROTATE_LEFT(head, elm, tmp, field) do { \ - (tmp) = RB_RIGHT(elm, field); \ - if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field)) != NULL) { \ - RB_PARENT(RB_LEFT(tmp, field), field) = (elm); \ - } \ - RB_AUGMENT(elm); \ - if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \ - if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \ - RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ - else \ - RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \ - } else \ - (head)->rbh_root = (tmp); \ - RB_LEFT(tmp, field) = (elm); \ - RB_PARENT(elm, field) = (tmp); \ - RB_AUGMENT(tmp); \ - if ((RB_PARENT(tmp, field))) \ - RB_AUGMENT(RB_PARENT(tmp, field)); \ -} while (/*CONSTCOND*/ 0) - -#define RB_ROTATE_RIGHT(head, elm, tmp, field) do { \ - (tmp) = RB_LEFT(elm, field); \ - if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field)) != NULL) { \ - RB_PARENT(RB_RIGHT(tmp, field), field) = (elm); \ - } \ - RB_AUGMENT(elm); \ - if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \ - if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \ - RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ - else \ - RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \ - } else \ - (head)->rbh_root = (tmp); \ - RB_RIGHT(tmp, field) = (elm); \ - RB_PARENT(elm, field) = (tmp); \ - RB_AUGMENT(tmp); \ - if ((RB_PARENT(tmp, field))) \ - RB_AUGMENT(RB_PARENT(tmp, field)); \ -} while (/*CONSTCOND*/ 0) +#define RB_ROTATE_LEFT(head, elm, tmp, field) \ + do { \ + (tmp) = RB_RIGHT(elm, field); \ + if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field)) != NULL) { \ + RB_PARENT(RB_LEFT(tmp, field), field) = (elm); \ + } \ + RB_AUGMENT(elm); \ + if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \ + if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \ + RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ + else \ + RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \ + } else \ + (head)->rbh_root = (tmp); \ + RB_LEFT(tmp, field) = (elm); \ + RB_PARENT(elm, field) = (tmp); \ + RB_AUGMENT(tmp); \ + if ((RB_PARENT(tmp, field))) \ + RB_AUGMENT(RB_PARENT(tmp, field)); \ + } while (/*CONSTCOND*/ 0) + +#define RB_ROTATE_RIGHT(head, elm, tmp, field) \ + do { \ + (tmp) = RB_LEFT(elm, field); \ + if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field)) != NULL) { \ + RB_PARENT(RB_RIGHT(tmp, field), field) = (elm); \ + } \ + RB_AUGMENT(elm); \ + if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \ + if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \ + RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ + else \ + RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \ + } else \ + (head)->rbh_root = (tmp); \ + RB_RIGHT(tmp, field) = (elm); \ + RB_PARENT(elm, field) = (tmp); \ + RB_AUGMENT(tmp); \ + if ((RB_PARENT(tmp, field))) \ + RB_AUGMENT(RB_PARENT(tmp, field)); \ + } while (/*CONSTCOND*/ 0) /* Generates prototypes and inline functions */ -#define RB_PROTOTYPE(name, type, field, cmp) \ - RB_PROTOTYPE_INTERNAL(name, type, field, cmp,) -#define RB_PROTOTYPE_STATIC(name, type, field, cmp) \ +#define RB_PROTOTYPE(name, type, field, cmp) \ + RB_PROTOTYPE_INTERNAL(name, type, field, cmp, ) +#define RB_PROTOTYPE_STATIC(name, type, field, cmp) \ RB_PROTOTYPE_INTERNAL(name, type, field, cmp, UV__UNUSED static) -#define RB_PROTOTYPE_INTERNAL(name, type, field, cmp, attr) \ -attr void name##_RB_INSERT_COLOR(struct name *, struct type *); \ -attr void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\ -attr struct type *name##_RB_REMOVE(struct name *, struct type *); \ -attr struct type *name##_RB_INSERT(struct name *, struct type *); \ -attr struct type *name##_RB_FIND(struct name *, struct type *); \ -attr struct type *name##_RB_NFIND(struct name *, struct type *); \ -attr struct type *name##_RB_NEXT(struct type *); \ -attr struct type *name##_RB_PREV(struct type *); \ -attr struct type *name##_RB_MINMAX(struct name *, int); \ - \ +#define RB_PROTOTYPE_INTERNAL(name, type, field, cmp, attr) \ + attr void name##_RB_INSERT_COLOR(struct name *, struct type *); \ + attr void name##_RB_REMOVE_COLOR(struct name *, struct type *, \ + struct type *); \ + attr struct type *name##_RB_REMOVE(struct name *, struct type *); \ + attr struct type *name##_RB_INSERT(struct name *, struct type *); \ + attr struct type *name##_RB_FIND(struct name *, struct type *); \ + attr struct type *name##_RB_NFIND(struct name *, struct type *); \ + attr struct type *name##_RB_NEXT(struct type *); \ + attr struct type *name##_RB_PREV(struct type *); \ + attr struct type *name##_RB_MINMAX(struct name *, int); /* Main rb operation. * Moves node close to the key of elm to top */ -#define RB_GENERATE(name, type, field, cmp) \ - RB_GENERATE_INTERNAL(name, type, field, cmp,) -#define RB_GENERATE_STATIC(name, type, field, cmp) \ +#define RB_GENERATE(name, type, field, cmp) \ + RB_GENERATE_INTERNAL(name, type, field, cmp, ) +#define RB_GENERATE_STATIC(name, type, field, cmp) \ RB_GENERATE_INTERNAL(name, type, field, cmp, UV__UNUSED static) -#define RB_GENERATE_INTERNAL(name, type, field, cmp, attr) \ -attr void \ -name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \ -{ \ - struct type *parent, *gparent, *tmp; \ - while ((parent = RB_PARENT(elm, field)) != NULL && \ - RB_COLOR(parent, field) == RB_RED) { \ - gparent = RB_PARENT(parent, field); \ - if (parent == RB_LEFT(gparent, field)) { \ - tmp = RB_RIGHT(gparent, field); \ - if (tmp && RB_COLOR(tmp, field) == RB_RED) { \ - RB_COLOR(tmp, field) = RB_BLACK; \ - RB_SET_BLACKRED(parent, gparent, field); \ - elm = gparent; \ - continue; \ - } \ - if (RB_RIGHT(parent, field) == elm) { \ - RB_ROTATE_LEFT(head, parent, tmp, field); \ - tmp = parent; \ - parent = elm; \ - elm = tmp; \ - } \ - RB_SET_BLACKRED(parent, gparent, field); \ - RB_ROTATE_RIGHT(head, gparent, tmp, field); \ - } else { \ - tmp = RB_LEFT(gparent, field); \ - if (tmp && RB_COLOR(tmp, field) == RB_RED) { \ - RB_COLOR(tmp, field) = RB_BLACK; \ - RB_SET_BLACKRED(parent, gparent, field); \ - elm = gparent; \ - continue; \ - } \ - if (RB_LEFT(parent, field) == elm) { \ - RB_ROTATE_RIGHT(head, parent, tmp, field); \ - tmp = parent; \ - parent = elm; \ - elm = tmp; \ - } \ - RB_SET_BLACKRED(parent, gparent, field); \ - RB_ROTATE_LEFT(head, gparent, tmp, field); \ - } \ - } \ - RB_COLOR(head->rbh_root, field) = RB_BLACK; \ -} \ - \ -attr void \ -name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, \ - struct type *elm) \ -{ \ - struct type *tmp; \ - while ((elm == NULL || RB_COLOR(elm, field) == RB_BLACK) && \ - elm != RB_ROOT(head)) { \ - if (RB_LEFT(parent, field) == elm) { \ - tmp = RB_RIGHT(parent, field); \ - if (RB_COLOR(tmp, field) == RB_RED) { \ - RB_SET_BLACKRED(tmp, parent, field); \ - RB_ROTATE_LEFT(head, parent, tmp, field); \ - tmp = RB_RIGHT(parent, field); \ - } \ - if ((RB_LEFT(tmp, field) == NULL || \ - RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) && \ - (RB_RIGHT(tmp, field) == NULL || \ - RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) { \ - RB_COLOR(tmp, field) = RB_RED; \ - elm = parent; \ - parent = RB_PARENT(elm, field); \ - } else { \ - if (RB_RIGHT(tmp, field) == NULL || \ - RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) { \ - struct type *oleft; \ - if ((oleft = RB_LEFT(tmp, field)) \ - != NULL) \ - RB_COLOR(oleft, field) = RB_BLACK; \ - RB_COLOR(tmp, field) = RB_RED; \ - RB_ROTATE_RIGHT(head, tmp, oleft, field); \ - tmp = RB_RIGHT(parent, field); \ - } \ - RB_COLOR(tmp, field) = RB_COLOR(parent, field); \ - RB_COLOR(parent, field) = RB_BLACK; \ - if (RB_RIGHT(tmp, field)) \ - RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK; \ - RB_ROTATE_LEFT(head, parent, tmp, field); \ - elm = RB_ROOT(head); \ - break; \ - } \ - } else { \ - tmp = RB_LEFT(parent, field); \ - if (RB_COLOR(tmp, field) == RB_RED) { \ - RB_SET_BLACKRED(tmp, parent, field); \ - RB_ROTATE_RIGHT(head, parent, tmp, field); \ - tmp = RB_LEFT(parent, field); \ - } \ - if ((RB_LEFT(tmp, field) == NULL || \ - RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) && \ - (RB_RIGHT(tmp, field) == NULL || \ - RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) { \ - RB_COLOR(tmp, field) = RB_RED; \ - elm = parent; \ - parent = RB_PARENT(elm, field); \ - } else { \ - if (RB_LEFT(tmp, field) == NULL || \ - RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) { \ - struct type *oright; \ - if ((oright = RB_RIGHT(tmp, field)) \ - != NULL) \ - RB_COLOR(oright, field) = RB_BLACK; \ - RB_COLOR(tmp, field) = RB_RED; \ - RB_ROTATE_LEFT(head, tmp, oright, field); \ - tmp = RB_LEFT(parent, field); \ - } \ - RB_COLOR(tmp, field) = RB_COLOR(parent, field); \ - RB_COLOR(parent, field) = RB_BLACK; \ - if (RB_LEFT(tmp, field)) \ - RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK; \ - RB_ROTATE_RIGHT(head, parent, tmp, field); \ - elm = RB_ROOT(head); \ - break; \ - } \ - } \ - } \ - if (elm) \ - RB_COLOR(elm, field) = RB_BLACK; \ -} \ - \ -attr struct type * \ -name##_RB_REMOVE(struct name *head, struct type *elm) \ -{ \ - struct type *child, *parent, *old = elm; \ - int color; \ - if (RB_LEFT(elm, field) == NULL) \ - child = RB_RIGHT(elm, field); \ - else if (RB_RIGHT(elm, field) == NULL) \ - child = RB_LEFT(elm, field); \ - else { \ - struct type *left; \ - elm = RB_RIGHT(elm, field); \ - while ((left = RB_LEFT(elm, field)) != NULL) \ - elm = left; \ - child = RB_RIGHT(elm, field); \ - parent = RB_PARENT(elm, field); \ - color = RB_COLOR(elm, field); \ - if (child) \ - RB_PARENT(child, field) = parent; \ - if (parent) { \ - if (RB_LEFT(parent, field) == elm) \ - RB_LEFT(parent, field) = child; \ - else \ - RB_RIGHT(parent, field) = child; \ - RB_AUGMENT(parent); \ - } else \ - RB_ROOT(head) = child; \ - if (RB_PARENT(elm, field) == old) \ - parent = elm; \ - (elm)->field = (old)->field; \ - if (RB_PARENT(old, field)) { \ - if (RB_LEFT(RB_PARENT(old, field), field) == old) \ - RB_LEFT(RB_PARENT(old, field), field) = elm; \ - else \ - RB_RIGHT(RB_PARENT(old, field), field) = elm; \ - RB_AUGMENT(RB_PARENT(old, field)); \ - } else \ - RB_ROOT(head) = elm; \ - RB_PARENT(RB_LEFT(old, field), field) = elm; \ - if (RB_RIGHT(old, field)) \ - RB_PARENT(RB_RIGHT(old, field), field) = elm; \ - if (parent) { \ - left = parent; \ - do { \ - RB_AUGMENT(left); \ - } while ((left = RB_PARENT(left, field)) != NULL); \ - } \ - goto color; \ - } \ - parent = RB_PARENT(elm, field); \ - color = RB_COLOR(elm, field); \ - if (child) \ - RB_PARENT(child, field) = parent; \ - if (parent) { \ - if (RB_LEFT(parent, field) == elm) \ - RB_LEFT(parent, field) = child; \ - else \ - RB_RIGHT(parent, field) = child; \ - RB_AUGMENT(parent); \ - } else \ - RB_ROOT(head) = child; \ -color: \ - if (color == RB_BLACK) \ - name##_RB_REMOVE_COLOR(head, parent, child); \ - return (old); \ -} \ - \ -/* Inserts a node into the RB tree */ \ -attr struct type * \ -name##_RB_INSERT(struct name *head, struct type *elm) \ -{ \ - struct type *tmp; \ - struct type *parent = NULL; \ - int comp = 0; \ - tmp = RB_ROOT(head); \ - while (tmp) { \ - parent = tmp; \ - comp = (cmp)(elm, parent); \ - if (comp < 0) \ - tmp = RB_LEFT(tmp, field); \ - else if (comp > 0) \ - tmp = RB_RIGHT(tmp, field); \ - else \ - return (tmp); \ - } \ - RB_SET(elm, parent, field); \ - if (parent != NULL) { \ - if (comp < 0) \ - RB_LEFT(parent, field) = elm; \ - else \ - RB_RIGHT(parent, field) = elm; \ - RB_AUGMENT(parent); \ - } else \ - RB_ROOT(head) = elm; \ - name##_RB_INSERT_COLOR(head, elm); \ - return (NULL); \ -} \ - \ -/* Finds the node with the same key as elm */ \ -attr struct type * \ -name##_RB_FIND(struct name *head, struct type *elm) \ -{ \ - struct type *tmp = RB_ROOT(head); \ - int comp; \ - while (tmp) { \ - comp = cmp(elm, tmp); \ - if (comp < 0) \ - tmp = RB_LEFT(tmp, field); \ - else if (comp > 0) \ - tmp = RB_RIGHT(tmp, field); \ - else \ - return (tmp); \ - } \ - return (NULL); \ -} \ - \ -/* Finds the first node greater than or equal to the search key */ \ -attr struct type * \ -name##_RB_NFIND(struct name *head, struct type *elm) \ -{ \ - struct type *tmp = RB_ROOT(head); \ - struct type *res = NULL; \ - int comp; \ - while (tmp) { \ - comp = cmp(elm, tmp); \ - if (comp < 0) { \ - res = tmp; \ - tmp = RB_LEFT(tmp, field); \ - } \ - else if (comp > 0) \ - tmp = RB_RIGHT(tmp, field); \ - else \ - return (tmp); \ - } \ - return (res); \ -} \ - \ -/* ARGSUSED */ \ -attr struct type * \ -name##_RB_NEXT(struct type *elm) \ -{ \ - if (RB_RIGHT(elm, field)) { \ - elm = RB_RIGHT(elm, field); \ - while (RB_LEFT(elm, field)) \ - elm = RB_LEFT(elm, field); \ - } else { \ - if (RB_PARENT(elm, field) && \ - (elm == RB_LEFT(RB_PARENT(elm, field), field))) \ - elm = RB_PARENT(elm, field); \ - else { \ - while (RB_PARENT(elm, field) && \ - (elm == RB_RIGHT(RB_PARENT(elm, field), field))) \ - elm = RB_PARENT(elm, field); \ - elm = RB_PARENT(elm, field); \ - } \ - } \ - return (elm); \ -} \ - \ -/* ARGSUSED */ \ -attr struct type * \ -name##_RB_PREV(struct type *elm) \ -{ \ - if (RB_LEFT(elm, field)) { \ - elm = RB_LEFT(elm, field); \ - while (RB_RIGHT(elm, field)) \ - elm = RB_RIGHT(elm, field); \ - } else { \ - if (RB_PARENT(elm, field) && \ - (elm == RB_RIGHT(RB_PARENT(elm, field), field))) \ - elm = RB_PARENT(elm, field); \ - else { \ - while (RB_PARENT(elm, field) && \ - (elm == RB_LEFT(RB_PARENT(elm, field), field))) \ - elm = RB_PARENT(elm, field); \ - elm = RB_PARENT(elm, field); \ - } \ - } \ - return (elm); \ -} \ - \ -attr struct type * \ -name##_RB_MINMAX(struct name *head, int val) \ -{ \ - struct type *tmp = RB_ROOT(head); \ - struct type *parent = NULL; \ - while (tmp) { \ - parent = tmp; \ - if (val < 0) \ - tmp = RB_LEFT(tmp, field); \ - else \ - tmp = RB_RIGHT(tmp, field); \ - } \ - return (parent); \ -} - -#define RB_NEGINF -1 -#define RB_INF 1 - -#define RB_INSERT(name, x, y) name##_RB_INSERT(x, y) -#define RB_REMOVE(name, x, y) name##_RB_REMOVE(x, y) -#define RB_FIND(name, x, y) name##_RB_FIND(x, y) -#define RB_NFIND(name, x, y) name##_RB_NFIND(x, y) -#define RB_NEXT(name, x, y) name##_RB_NEXT(y) -#define RB_PREV(name, x, y) name##_RB_PREV(y) -#define RB_MIN(name, x) name##_RB_MINMAX(x, RB_NEGINF) -#define RB_MAX(name, x) name##_RB_MINMAX(x, RB_INF) - -#define RB_FOREACH(x, name, head) \ - for ((x) = RB_MIN(name, head); \ - (x) != NULL; \ - (x) = name##_RB_NEXT(x)) - -#define RB_FOREACH_FROM(x, name, y) \ - for ((x) = (y); \ - ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL); \ +#define RB_GENERATE_INTERNAL(name, type, field, cmp, attr) \ + attr void name##_RB_INSERT_COLOR(struct name *head, struct type *elm) { \ + struct type *parent, *gparent, *tmp; \ + while ((parent = RB_PARENT(elm, field)) != NULL && \ + RB_COLOR(parent, field) == RB_RED) { \ + gparent = RB_PARENT(parent, field); \ + if (parent == RB_LEFT(gparent, field)) { \ + tmp = RB_RIGHT(gparent, field); \ + if (tmp && RB_COLOR(tmp, field) == RB_RED) { \ + RB_COLOR(tmp, field) = RB_BLACK; \ + RB_SET_BLACKRED(parent, gparent, field); \ + elm = gparent; \ + continue; \ + } \ + if (RB_RIGHT(parent, field) == elm) { \ + RB_ROTATE_LEFT(head, parent, tmp, field); \ + tmp = parent; \ + parent = elm; \ + elm = tmp; \ + } \ + RB_SET_BLACKRED(parent, gparent, field); \ + RB_ROTATE_RIGHT(head, gparent, tmp, field); \ + } else { \ + tmp = RB_LEFT(gparent, field); \ + if (tmp && RB_COLOR(tmp, field) == RB_RED) { \ + RB_COLOR(tmp, field) = RB_BLACK; \ + RB_SET_BLACKRED(parent, gparent, field); \ + elm = gparent; \ + continue; \ + } \ + if (RB_LEFT(parent, field) == elm) { \ + RB_ROTATE_RIGHT(head, parent, tmp, field); \ + tmp = parent; \ + parent = elm; \ + elm = tmp; \ + } \ + RB_SET_BLACKRED(parent, gparent, field); \ + RB_ROTATE_LEFT(head, gparent, tmp, field); \ + } \ + } \ + RB_COLOR(head->rbh_root, field) = RB_BLACK; \ + } \ + \ + attr void name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, \ + struct type *elm) { \ + struct type *tmp; \ + while ((elm == NULL || RB_COLOR(elm, field) == RB_BLACK) && \ + elm != RB_ROOT(head)) { \ + if (RB_LEFT(parent, field) == elm) { \ + tmp = RB_RIGHT(parent, field); \ + if (RB_COLOR(tmp, field) == RB_RED) { \ + RB_SET_BLACKRED(tmp, parent, field); \ + RB_ROTATE_LEFT(head, parent, tmp, field); \ + tmp = RB_RIGHT(parent, field); \ + } \ + if ((RB_LEFT(tmp, field) == NULL || \ + RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) && \ + (RB_RIGHT(tmp, field) == NULL || \ + RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) { \ + RB_COLOR(tmp, field) = RB_RED; \ + elm = parent; \ + parent = RB_PARENT(elm, field); \ + } else { \ + if (RB_RIGHT(tmp, field) == NULL || \ + RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) { \ + struct type *oleft; \ + if ((oleft = RB_LEFT(tmp, field)) != NULL) \ + RB_COLOR(oleft, field) = RB_BLACK; \ + RB_COLOR(tmp, field) = RB_RED; \ + RB_ROTATE_RIGHT(head, tmp, oleft, field); \ + tmp = RB_RIGHT(parent, field); \ + } \ + RB_COLOR(tmp, field) = RB_COLOR(parent, field); \ + RB_COLOR(parent, field) = RB_BLACK; \ + if (RB_RIGHT(tmp, field)) \ + RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK; \ + RB_ROTATE_LEFT(head, parent, tmp, field); \ + elm = RB_ROOT(head); \ + break; \ + } \ + } else { \ + tmp = RB_LEFT(parent, field); \ + if (RB_COLOR(tmp, field) == RB_RED) { \ + RB_SET_BLACKRED(tmp, parent, field); \ + RB_ROTATE_RIGHT(head, parent, tmp, field); \ + tmp = RB_LEFT(parent, field); \ + } \ + if ((RB_LEFT(tmp, field) == NULL || \ + RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) && \ + (RB_RIGHT(tmp, field) == NULL || \ + RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) { \ + RB_COLOR(tmp, field) = RB_RED; \ + elm = parent; \ + parent = RB_PARENT(elm, field); \ + } else { \ + if (RB_LEFT(tmp, field) == NULL || \ + RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) { \ + struct type *oright; \ + if ((oright = RB_RIGHT(tmp, field)) != NULL) \ + RB_COLOR(oright, field) = RB_BLACK; \ + RB_COLOR(tmp, field) = RB_RED; \ + RB_ROTATE_LEFT(head, tmp, oright, field); \ + tmp = RB_LEFT(parent, field); \ + } \ + RB_COLOR(tmp, field) = RB_COLOR(parent, field); \ + RB_COLOR(parent, field) = RB_BLACK; \ + if (RB_LEFT(tmp, field)) \ + RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK; \ + RB_ROTATE_RIGHT(head, parent, tmp, field); \ + elm = RB_ROOT(head); \ + break; \ + } \ + } \ + } \ + if (elm) \ + RB_COLOR(elm, field) = RB_BLACK; \ + } \ + \ + attr struct type *name##_RB_REMOVE(struct name *head, struct type *elm) { \ + struct type *child, *parent, *old = elm; \ + int color; \ + if (RB_LEFT(elm, field) == NULL) \ + child = RB_RIGHT(elm, field); \ + else if (RB_RIGHT(elm, field) == NULL) \ + child = RB_LEFT(elm, field); \ + else { \ + struct type *left; \ + elm = RB_RIGHT(elm, field); \ + while ((left = RB_LEFT(elm, field)) != NULL) \ + elm = left; \ + child = RB_RIGHT(elm, field); \ + parent = RB_PARENT(elm, field); \ + color = RB_COLOR(elm, field); \ + if (child) \ + RB_PARENT(child, field) = parent; \ + if (parent) { \ + if (RB_LEFT(parent, field) == elm) \ + RB_LEFT(parent, field) = child; \ + else \ + RB_RIGHT(parent, field) = child; \ + RB_AUGMENT(parent); \ + } else \ + RB_ROOT(head) = child; \ + if (RB_PARENT(elm, field) == old) \ + parent = elm; \ + (elm)->field = (old)->field; \ + if (RB_PARENT(old, field)) { \ + if (RB_LEFT(RB_PARENT(old, field), field) == old) \ + RB_LEFT(RB_PARENT(old, field), field) = elm; \ + else \ + RB_RIGHT(RB_PARENT(old, field), field) = elm; \ + RB_AUGMENT(RB_PARENT(old, field)); \ + } else \ + RB_ROOT(head) = elm; \ + RB_PARENT(RB_LEFT(old, field), field) = elm; \ + if (RB_RIGHT(old, field)) \ + RB_PARENT(RB_RIGHT(old, field), field) = elm; \ + if (parent) { \ + left = parent; \ + do { \ + RB_AUGMENT(left); \ + } while ((left = RB_PARENT(left, field)) != NULL); \ + } \ + goto color; \ + } \ + parent = RB_PARENT(elm, field); \ + color = RB_COLOR(elm, field); \ + if (child) \ + RB_PARENT(child, field) = parent; \ + if (parent) { \ + if (RB_LEFT(parent, field) == elm) \ + RB_LEFT(parent, field) = child; \ + else \ + RB_RIGHT(parent, field) = child; \ + RB_AUGMENT(parent); \ + } else \ + RB_ROOT(head) = child; \ + color: \ + if (color == RB_BLACK) \ + name##_RB_REMOVE_COLOR(head, parent, child); \ + return (old); \ + } \ + \ + /* Inserts a node into the RB tree */ \ + attr struct type *name##_RB_INSERT(struct name *head, struct type *elm) { \ + struct type *tmp; \ + struct type *parent = NULL; \ + int comp = 0; \ + tmp = RB_ROOT(head); \ + while (tmp) { \ + parent = tmp; \ + comp = (cmp)(elm, parent); \ + if (comp < 0) \ + tmp = RB_LEFT(tmp, field); \ + else if (comp > 0) \ + tmp = RB_RIGHT(tmp, field); \ + else \ + return (tmp); \ + } \ + RB_SET(elm, parent, field); \ + if (parent != NULL) { \ + if (comp < 0) \ + RB_LEFT(parent, field) = elm; \ + else \ + RB_RIGHT(parent, field) = elm; \ + RB_AUGMENT(parent); \ + } else \ + RB_ROOT(head) = elm; \ + name##_RB_INSERT_COLOR(head, elm); \ + return (NULL); \ + } \ + \ + /* Finds the node with the same key as elm */ \ + attr struct type *name##_RB_FIND(struct name *head, struct type *elm) { \ + struct type *tmp = RB_ROOT(head); \ + int comp; \ + while (tmp) { \ + comp = cmp(elm, tmp); \ + if (comp < 0) \ + tmp = RB_LEFT(tmp, field); \ + else if (comp > 0) \ + tmp = RB_RIGHT(tmp, field); \ + else \ + return (tmp); \ + } \ + return (NULL); \ + } \ + \ + /* Finds the first node greater than or equal to the search key */ \ + attr struct type *name##_RB_NFIND(struct name *head, struct type *elm) { \ + struct type *tmp = RB_ROOT(head); \ + struct type *res = NULL; \ + int comp; \ + while (tmp) { \ + comp = cmp(elm, tmp); \ + if (comp < 0) { \ + res = tmp; \ + tmp = RB_LEFT(tmp, field); \ + } else if (comp > 0) \ + tmp = RB_RIGHT(tmp, field); \ + else \ + return (tmp); \ + } \ + return (res); \ + } \ + \ + /* ARGSUSED */ \ + attr struct type *name##_RB_NEXT(struct type *elm) { \ + if (RB_RIGHT(elm, field)) { \ + elm = RB_RIGHT(elm, field); \ + while (RB_LEFT(elm, field)) \ + elm = RB_LEFT(elm, field); \ + } else { \ + if (RB_PARENT(elm, field) && \ + (elm == RB_LEFT(RB_PARENT(elm, field), field))) \ + elm = RB_PARENT(elm, field); \ + else { \ + while (RB_PARENT(elm, field) && \ + (elm == RB_RIGHT(RB_PARENT(elm, field), field))) \ + elm = RB_PARENT(elm, field); \ + elm = RB_PARENT(elm, field); \ + } \ + } \ + return (elm); \ + } \ + \ + /* ARGSUSED */ \ + attr struct type *name##_RB_PREV(struct type *elm) { \ + if (RB_LEFT(elm, field)) { \ + elm = RB_LEFT(elm, field); \ + while (RB_RIGHT(elm, field)) \ + elm = RB_RIGHT(elm, field); \ + } else { \ + if (RB_PARENT(elm, field) && \ + (elm == RB_RIGHT(RB_PARENT(elm, field), field))) \ + elm = RB_PARENT(elm, field); \ + else { \ + while (RB_PARENT(elm, field) && \ + (elm == RB_LEFT(RB_PARENT(elm, field), field))) \ + elm = RB_PARENT(elm, field); \ + elm = RB_PARENT(elm, field); \ + } \ + } \ + return (elm); \ + } \ + \ + attr struct type *name##_RB_MINMAX(struct name *head, int val) { \ + struct type *tmp = RB_ROOT(head); \ + struct type *parent = NULL; \ + while (tmp) { \ + parent = tmp; \ + if (val < 0) \ + tmp = RB_LEFT(tmp, field); \ + else \ + tmp = RB_RIGHT(tmp, field); \ + } \ + return (parent); \ + } + +#define RB_NEGINF -1 +#define RB_INF 1 + +#define RB_INSERT(name, x, y) name##_RB_INSERT(x, y) +#define RB_REMOVE(name, x, y) name##_RB_REMOVE(x, y) +#define RB_FIND(name, x, y) name##_RB_FIND(x, y) +#define RB_NFIND(name, x, y) name##_RB_NFIND(x, y) +#define RB_NEXT(name, x, y) name##_RB_NEXT(y) +#define RB_PREV(name, x, y) name##_RB_PREV(y) +#define RB_MIN(name, x) name##_RB_MINMAX(x, RB_NEGINF) +#define RB_MAX(name, x) name##_RB_MINMAX(x, RB_INF) + +#define RB_FOREACH(x, name, head) \ + for ((x) = RB_MIN(name, head); (x) != NULL; (x) = name##_RB_NEXT(x)) + +#define RB_FOREACH_FROM(x, name, y) \ + for ((x) = (y); ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL); \ (x) = (y)) -#define RB_FOREACH_SAFE(x, name, head, y) \ - for ((x) = RB_MIN(name, head); \ - ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL); \ - (x) = (y)) +#define RB_FOREACH_SAFE(x, name, head, y) \ + for ((x) = RB_MIN(name, head); \ + ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL); (x) = (y)) -#define RB_FOREACH_REVERSE(x, name, head) \ - for ((x) = RB_MAX(name, head); \ - (x) != NULL; \ - (x) = name##_RB_PREV(x)) +#define RB_FOREACH_REVERSE(x, name, head) \ + for ((x) = RB_MAX(name, head); (x) != NULL; (x) = name##_RB_PREV(x)) -#define RB_FOREACH_REVERSE_FROM(x, name, y) \ - for ((x) = (y); \ - ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL); \ +#define RB_FOREACH_REVERSE_FROM(x, name, y) \ + for ((x) = (y); ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL); \ (x) = (y)) -#define RB_FOREACH_REVERSE_SAFE(x, name, head, y) \ - for ((x) = RB_MAX(name, head); \ - ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL); \ - (x) = (y)) +#define RB_FOREACH_REVERSE_SAFE(x, name, head, y) \ + for ((x) = RB_MAX(name, head); \ + ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL); (x) = (y)) -#endif /* UV_TREE_H_ */ +#endif /* UV_TREE_H_ */ diff --git a/src/libuv/include/uv/unix.h b/src/libuv/include/uv/unix.h index ea37d7876..c5725dcf6 100644 --- a/src/libuv/include/uv/unix.h +++ b/src/libuv/include/uv/unix.h @@ -22,19 +22,19 @@ #ifndef UV_UNIX_H #define UV_UNIX_H -#include -#include -#include #include +#include +#include +#include -#include +#include +#include /* MAXHOSTNAMELEN on Solaris */ #include #include -#include -#include /* MAXHOSTNAMELEN on Solaris */ +#include -#include #include +#include #if !defined(__MVS__) #include @@ -46,55 +46,48 @@ #include "uv/threadpool.h" #if defined(__linux__) -# include "uv/linux.h" -#elif defined (__MVS__) -# include "uv/os390.h" -#elif defined(__PASE__) /* __PASE__ and _AIX are both defined on IBM i */ -# include "uv/posix.h" /* IBM i needs uv/posix.h, not uv/aix.h */ +#include "uv/linux.h" +#elif defined(__MVS__) +#include "uv/os390.h" +#elif defined(__PASE__) /* __PASE__ and _AIX are both defined on IBM i */ +#include "uv/posix.h" /* IBM i needs uv/posix.h, not uv/aix.h */ #elif defined(_AIX) -# include "uv/aix.h" +#include "uv/aix.h" #elif defined(__sun) -# include "uv/sunos.h" +#include "uv/sunos.h" #elif defined(__APPLE__) -# include "uv/darwin.h" -#elif defined(__DragonFly__) || \ - defined(__FreeBSD__) || \ - defined(__FreeBSD_kernel__) || \ - defined(__OpenBSD__) || \ - defined(__NetBSD__) -# include "uv/bsd.h" -#elif defined(__CYGWIN__) || \ - defined(__MSYS__) || \ - defined(__HAIKU__) || \ - defined(__QNX__) || \ - defined(__GNU__) -# include "uv/posix.h" +#include "uv/darwin.h" +#elif defined(__DragonFly__) || defined(__FreeBSD__) || \ + defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__NetBSD__) +#include "uv/bsd.h" +#elif defined(__CYGWIN__) || defined(__MSYS__) || defined(__HAIKU__) || \ + defined(__QNX__) || defined(__GNU__) +#include "uv/posix.h" #endif #ifndef NI_MAXHOST -# define NI_MAXHOST 1025 +#define NI_MAXHOST 1025 #endif #ifndef NI_MAXSERV -# define NI_MAXSERV 32 +#define NI_MAXSERV 32 #endif #ifndef UV_IO_PRIVATE_PLATFORM_FIELDS -# define UV_IO_PRIVATE_PLATFORM_FIELDS /* empty */ +#define UV_IO_PRIVATE_PLATFORM_FIELDS /* empty */ #endif struct uv__io_s; struct uv_loop_s; -typedef void (*uv__io_cb)(struct uv_loop_s* loop, - struct uv__io_s* w, +typedef void (*uv__io_cb)(struct uv_loop_s *loop, struct uv__io_s *w, unsigned int events); typedef struct uv__io_s uv__io_t; struct uv__io_s { uv__io_cb cb; - void* pending_queue[2]; - void* watcher_queue[2]; + void *pending_queue[2]; + void *watcher_queue[2]; unsigned int pevents; /* Pending event mask i.e. mask at next tick. */ unsigned int events; /* Current event mask. */ int fd; @@ -102,24 +95,24 @@ struct uv__io_s { }; #ifndef UV_PLATFORM_SEM_T -# define UV_PLATFORM_SEM_T sem_t +#define UV_PLATFORM_SEM_T sem_t #endif #ifndef UV_PLATFORM_LOOP_FIELDS -# define UV_PLATFORM_LOOP_FIELDS /* empty */ +#define UV_PLATFORM_LOOP_FIELDS /* empty */ #endif #ifndef UV_PLATFORM_FS_EVENT_FIELDS -# define UV_PLATFORM_FS_EVENT_FIELDS /* empty */ +#define UV_PLATFORM_FS_EVENT_FIELDS /* empty */ #endif #ifndef UV_STREAM_PRIVATE_PLATFORM_FIELDS -# define UV_STREAM_PRIVATE_PLATFORM_FIELDS /* empty */ +#define UV_STREAM_PRIVATE_PLATFORM_FIELDS /* empty */ #endif /* Note: May be cast to struct iovec. See writev(2). */ typedef struct uv_buf_t { - char* base; + char *base; size_t len; } uv_buf_t; @@ -139,8 +132,7 @@ typedef pthread_cond_t uv_cond_t; typedef pthread_key_t uv_key_t; /* Note: guard clauses should match uv_barrier_init's in src/unix/thread.c. */ -#if defined(_AIX) || \ - defined(__OpenBSD__) || \ +#if defined(_AIX) || defined(__OpenBSD__) || \ !defined(PTHREAD_BARRIER_SERIAL_THREAD) /* TODO(bnoordhuis) Merge into uv_barrier_t in v2. */ struct _uv_barrier { @@ -152,11 +144,11 @@ struct _uv_barrier { }; typedef struct { - struct _uv_barrier* b; -# if defined(PTHREAD_BARRIER_SERIAL_THREAD) + struct _uv_barrier *b; +#if defined(PTHREAD_BARRIER_SERIAL_THREAD) /* TODO(bnoordhuis) Remove padding in v2. */ - char pad[sizeof(pthread_barrier_t) - sizeof(struct _uv_barrier*)]; -# endif + char pad[sizeof(pthread_barrier_t) - sizeof(struct _uv_barrier *)]; +#endif } uv_barrier_t; #else typedef pthread_barrier_t uv_barrier_t; @@ -168,338 +160,333 @@ typedef uid_t uv_uid_t; typedef struct dirent uv__dirent_t; -#define UV_DIR_PRIVATE_FIELDS \ - DIR* dir; +#define UV_DIR_PRIVATE_FIELDS DIR *dir; #if defined(DT_UNKNOWN) -# define HAVE_DIRENT_TYPES -# if defined(DT_REG) -# define UV__DT_FILE DT_REG -# else -# define UV__DT_FILE -1 -# endif -# if defined(DT_DIR) -# define UV__DT_DIR DT_DIR -# else -# define UV__DT_DIR -2 -# endif -# if defined(DT_LNK) -# define UV__DT_LINK DT_LNK -# else -# define UV__DT_LINK -3 -# endif -# if defined(DT_FIFO) -# define UV__DT_FIFO DT_FIFO -# else -# define UV__DT_FIFO -4 -# endif -# if defined(DT_SOCK) -# define UV__DT_SOCKET DT_SOCK -# else -# define UV__DT_SOCKET -5 -# endif -# if defined(DT_CHR) -# define UV__DT_CHAR DT_CHR -# else -# define UV__DT_CHAR -6 -# endif -# if defined(DT_BLK) -# define UV__DT_BLOCK DT_BLK -# else -# define UV__DT_BLOCK -7 -# endif +#define HAVE_DIRENT_TYPES +#if defined(DT_REG) +#define UV__DT_FILE DT_REG +#else +#define UV__DT_FILE -1 +#endif +#if defined(DT_DIR) +#define UV__DT_DIR DT_DIR +#else +#define UV__DT_DIR -2 +#endif +#if defined(DT_LNK) +#define UV__DT_LINK DT_LNK +#else +#define UV__DT_LINK -3 +#endif +#if defined(DT_FIFO) +#define UV__DT_FIFO DT_FIFO +#else +#define UV__DT_FIFO -4 +#endif +#if defined(DT_SOCK) +#define UV__DT_SOCKET DT_SOCK +#else +#define UV__DT_SOCKET -5 +#endif +#if defined(DT_CHR) +#define UV__DT_CHAR DT_CHR +#else +#define UV__DT_CHAR -6 +#endif +#if defined(DT_BLK) +#define UV__DT_BLOCK DT_BLK +#else +#define UV__DT_BLOCK -7 +#endif #endif /* Platform-specific definitions for uv_dlopen support. */ #define UV_DYNAMIC /* empty */ typedef struct { - void* handle; - char* errmsg; + void *handle; + char *errmsg; } uv_lib_t; -#define UV_LOOP_PRIVATE_FIELDS \ - unsigned long flags; \ - int backend_fd; \ - void* pending_queue[2]; \ - void* watcher_queue[2]; \ - uv__io_t** watchers; \ - unsigned int nwatchers; \ - unsigned int nfds; \ - void* wq[2]; \ - uv_mutex_t wq_mutex; \ - uv_async_t wq_async; \ - uv_rwlock_t cloexec_lock; \ - uv_handle_t* closing_handles; \ - void* process_handles[2]; \ - void* prepare_handles[2]; \ - void* check_handles[2]; \ - void* idle_handles[2]; \ - void* async_handles[2]; \ - void (*async_unused)(void); /* TODO(bnoordhuis) Remove in libuv v2. */ \ - uv__io_t async_io_watcher; \ - int async_wfd; \ - struct { \ - void* min; \ - unsigned int nelts; \ - } timer_heap; \ - uint64_t timer_counter; \ - uint64_t time; \ - int signal_pipefd[2]; \ - uv__io_t signal_io_watcher; \ - uv_signal_t child_watcher; \ - int emfile_fd; \ - UV_PLATFORM_LOOP_FIELDS \ +#define UV_LOOP_PRIVATE_FIELDS \ + unsigned long flags; \ + int backend_fd; \ + void *pending_queue[2]; \ + void *watcher_queue[2]; \ + uv__io_t **watchers; \ + unsigned int nwatchers; \ + unsigned int nfds; \ + void *wq[2]; \ + uv_mutex_t wq_mutex; \ + uv_async_t wq_async; \ + uv_rwlock_t cloexec_lock; \ + uv_handle_t *closing_handles; \ + void *process_handles[2]; \ + void *prepare_handles[2]; \ + void *check_handles[2]; \ + void *idle_handles[2]; \ + void *async_handles[2]; \ + void (*async_unused)(void); /* TODO(bnoordhuis) Remove in libuv v2. */ \ + uv__io_t async_io_watcher; \ + int async_wfd; \ + struct { \ + void *min; \ + unsigned int nelts; \ + } timer_heap; \ + uint64_t timer_counter; \ + uint64_t time; \ + int signal_pipefd[2]; \ + uv__io_t signal_io_watcher; \ + uv_signal_t child_watcher; \ + int emfile_fd; \ + UV_PLATFORM_LOOP_FIELDS #define UV_REQ_TYPE_PRIVATE /* empty */ -#define UV_REQ_PRIVATE_FIELDS /* empty */ +#define UV_REQ_PRIVATE_FIELDS /* empty */ #define UV_PRIVATE_REQ_TYPES /* empty */ -#define UV_WRITE_PRIVATE_FIELDS \ - void* queue[2]; \ - unsigned int write_index; \ - uv_buf_t* bufs; \ - unsigned int nbufs; \ - int error; \ - uv_buf_t bufsml[4]; \ +#define UV_WRITE_PRIVATE_FIELDS \ + void *queue[2]; \ + unsigned int write_index; \ + uv_buf_t *bufs; \ + unsigned int nbufs; \ + int error; \ + uv_buf_t bufsml[4]; -#define UV_CONNECT_PRIVATE_FIELDS \ - void* queue[2]; \ +#define UV_CONNECT_PRIVATE_FIELDS void *queue[2]; #define UV_SHUTDOWN_PRIVATE_FIELDS /* empty */ -#define UV_UDP_SEND_PRIVATE_FIELDS \ - void* queue[2]; \ - struct sockaddr_storage addr; \ - unsigned int nbufs; \ - uv_buf_t* bufs; \ - ssize_t status; \ - uv_udp_send_cb send_cb; \ - uv_buf_t bufsml[4]; \ - -#define UV_HANDLE_PRIVATE_FIELDS \ - uv_handle_t* next_closing; \ - unsigned int flags; \ - -#define UV_STREAM_PRIVATE_FIELDS \ - uv_connect_t *connect_req; \ - uv_shutdown_t *shutdown_req; \ - uv__io_t io_watcher; \ - void* write_queue[2]; \ - void* write_completed_queue[2]; \ - uv_connection_cb connection_cb; \ - int delayed_error; \ - int accepted_fd; \ - void* queued_fds; \ - UV_STREAM_PRIVATE_PLATFORM_FIELDS \ +#define UV_UDP_SEND_PRIVATE_FIELDS \ + void *queue[2]; \ + struct sockaddr_storage addr; \ + unsigned int nbufs; \ + uv_buf_t *bufs; \ + ssize_t status; \ + uv_udp_send_cb send_cb; \ + uv_buf_t bufsml[4]; + +#define UV_HANDLE_PRIVATE_FIELDS \ + uv_handle_t *next_closing; \ + unsigned int flags; + +#define UV_STREAM_PRIVATE_FIELDS \ + uv_connect_t *connect_req; \ + uv_shutdown_t *shutdown_req; \ + uv__io_t io_watcher; \ + void *write_queue[2]; \ + void *write_completed_queue[2]; \ + uv_connection_cb connection_cb; \ + int delayed_error; \ + int accepted_fd; \ + void *queued_fds; \ + UV_STREAM_PRIVATE_PLATFORM_FIELDS #define UV_TCP_PRIVATE_FIELDS /* empty */ -#define UV_UDP_PRIVATE_FIELDS \ - uv_alloc_cb alloc_cb; \ - uv_udp_recv_cb recv_cb; \ - uv__io_t io_watcher; \ - void* write_queue[2]; \ - void* write_completed_queue[2]; \ - -#define UV_PIPE_PRIVATE_FIELDS \ - const char* pipe_fname; /* strdup'ed */ - -#define UV_POLL_PRIVATE_FIELDS \ - uv__io_t io_watcher; - -#define UV_PREPARE_PRIVATE_FIELDS \ - uv_prepare_cb prepare_cb; \ - void* queue[2]; \ - -#define UV_CHECK_PRIVATE_FIELDS \ - uv_check_cb check_cb; \ - void* queue[2]; \ - -#define UV_IDLE_PRIVATE_FIELDS \ - uv_idle_cb idle_cb; \ - void* queue[2]; \ - -#define UV_ASYNC_PRIVATE_FIELDS \ - uv_async_cb async_cb; \ - void* queue[2]; \ - int pending; \ - -#define UV_TIMER_PRIVATE_FIELDS \ - uv_timer_cb timer_cb; \ - void* heap_node[3]; \ - uint64_t timeout; \ - uint64_t repeat; \ +#define UV_UDP_PRIVATE_FIELDS \ + uv_alloc_cb alloc_cb; \ + uv_udp_recv_cb recv_cb; \ + uv__io_t io_watcher; \ + void *write_queue[2]; \ + void *write_completed_queue[2]; + +#define UV_PIPE_PRIVATE_FIELDS const char *pipe_fname; /* strdup'ed */ + +#define UV_POLL_PRIVATE_FIELDS uv__io_t io_watcher; + +#define UV_PREPARE_PRIVATE_FIELDS \ + uv_prepare_cb prepare_cb; \ + void *queue[2]; + +#define UV_CHECK_PRIVATE_FIELDS \ + uv_check_cb check_cb; \ + void *queue[2]; + +#define UV_IDLE_PRIVATE_FIELDS \ + uv_idle_cb idle_cb; \ + void *queue[2]; + +#define UV_ASYNC_PRIVATE_FIELDS \ + uv_async_cb async_cb; \ + void *queue[2]; \ + int pending; + +#define UV_TIMER_PRIVATE_FIELDS \ + uv_timer_cb timer_cb; \ + void *heap_node[3]; \ + uint64_t timeout; \ + uint64_t repeat; \ uint64_t start_id; -#define UV_GETADDRINFO_PRIVATE_FIELDS \ - struct uv__work work_req; \ - uv_getaddrinfo_cb cb; \ - struct addrinfo* hints; \ - char* hostname; \ - char* service; \ - struct addrinfo* addrinfo; \ +#define UV_GETADDRINFO_PRIVATE_FIELDS \ + struct uv__work work_req; \ + uv_getaddrinfo_cb cb; \ + struct addrinfo *hints; \ + char *hostname; \ + char *service; \ + struct addrinfo *addrinfo; \ int retcode; -#define UV_GETNAMEINFO_PRIVATE_FIELDS \ - struct uv__work work_req; \ - uv_getnameinfo_cb getnameinfo_cb; \ - struct sockaddr_storage storage; \ - int flags; \ - char host[NI_MAXHOST]; \ - char service[NI_MAXSERV]; \ +#define UV_GETNAMEINFO_PRIVATE_FIELDS \ + struct uv__work work_req; \ + uv_getnameinfo_cb getnameinfo_cb; \ + struct sockaddr_storage storage; \ + int flags; \ + char host[NI_MAXHOST]; \ + char service[NI_MAXSERV]; \ int retcode; -#define UV_PROCESS_PRIVATE_FIELDS \ - void* queue[2]; \ - int status; \ - -#define UV_FS_PRIVATE_FIELDS \ - const char *new_path; \ - uv_file file; \ - int flags; \ - mode_t mode; \ - unsigned int nbufs; \ - uv_buf_t* bufs; \ - off_t off; \ - uv_uid_t uid; \ - uv_gid_t gid; \ - double atime; \ - double mtime; \ - struct uv__work work_req; \ - uv_buf_t bufsml[4]; \ - -#define UV_WORK_PRIVATE_FIELDS \ - struct uv__work work_req; - -#define UV_TTY_PRIVATE_FIELDS \ - struct termios orig_termios; \ +#define UV_PROCESS_PRIVATE_FIELDS \ + void *queue[2]; \ + int status; + +#define UV_FS_PRIVATE_FIELDS \ + const char *new_path; \ + uv_file file; \ + int flags; \ + mode_t mode; \ + unsigned int nbufs; \ + uv_buf_t *bufs; \ + off_t off; \ + uv_uid_t uid; \ + uv_gid_t gid; \ + double atime; \ + double mtime; \ + struct uv__work work_req; \ + uv_buf_t bufsml[4]; + +#define UV_WORK_PRIVATE_FIELDS struct uv__work work_req; + +#define UV_TTY_PRIVATE_FIELDS \ + struct termios orig_termios; \ int mode; -#define UV_SIGNAL_PRIVATE_FIELDS \ - /* RB_ENTRY(uv_signal_s) tree_entry; */ \ - struct { \ - struct uv_signal_s* rbe_left; \ - struct uv_signal_s* rbe_right; \ - struct uv_signal_s* rbe_parent; \ - int rbe_color; \ - } tree_entry; \ - /* Use two counters here so we don have to fiddle with atomics. */ \ - unsigned int caught_signals; \ +#define UV_SIGNAL_PRIVATE_FIELDS \ + /* RB_ENTRY(uv_signal_s) tree_entry; */ \ + struct { \ + struct uv_signal_s *rbe_left; \ + struct uv_signal_s *rbe_right; \ + struct uv_signal_s *rbe_parent; \ + int rbe_color; \ + } tree_entry; \ + /* Use two counters here so we don have to fiddle with atomics. */ \ + unsigned int caught_signals; \ unsigned int dispatched_signals; -#define UV_FS_EVENT_PRIVATE_FIELDS \ - uv_fs_event_cb cb; \ - UV_PLATFORM_FS_EVENT_FIELDS \ +#define UV_FS_EVENT_PRIVATE_FIELDS \ + uv_fs_event_cb cb; \ + UV_PLATFORM_FS_EVENT_FIELDS /* fs open() flags supported on this platform: */ #if defined(O_APPEND) -# define UV_FS_O_APPEND O_APPEND +#define UV_FS_O_APPEND O_APPEND #else -# define UV_FS_O_APPEND 0 +#define UV_FS_O_APPEND 0 #endif #if defined(O_CREAT) -# define UV_FS_O_CREAT O_CREAT +#define UV_FS_O_CREAT O_CREAT #else -# define UV_FS_O_CREAT 0 +#define UV_FS_O_CREAT 0 #endif #if defined(__linux__) && defined(__arm__) -# define UV_FS_O_DIRECT 0x10000 +#define UV_FS_O_DIRECT 0x10000 #elif defined(__linux__) && defined(__m68k__) -# define UV_FS_O_DIRECT 0x10000 +#define UV_FS_O_DIRECT 0x10000 #elif defined(__linux__) && defined(__mips__) -# define UV_FS_O_DIRECT 0x08000 +#define UV_FS_O_DIRECT 0x08000 #elif defined(__linux__) && defined(__powerpc__) -# define UV_FS_O_DIRECT 0x20000 +#define UV_FS_O_DIRECT 0x20000 #elif defined(__linux__) && defined(__s390x__) -# define UV_FS_O_DIRECT 0x04000 +#define UV_FS_O_DIRECT 0x04000 #elif defined(__linux__) && defined(__x86_64__) -# define UV_FS_O_DIRECT 0x04000 +#define UV_FS_O_DIRECT 0x04000 #elif defined(O_DIRECT) -# define UV_FS_O_DIRECT O_DIRECT +#define UV_FS_O_DIRECT O_DIRECT #else -# define UV_FS_O_DIRECT 0 +#define UV_FS_O_DIRECT 0 #endif #if defined(O_DIRECTORY) -# define UV_FS_O_DIRECTORY O_DIRECTORY +#define UV_FS_O_DIRECTORY O_DIRECTORY #else -# define UV_FS_O_DIRECTORY 0 +#define UV_FS_O_DIRECTORY 0 #endif #if defined(O_DSYNC) -# define UV_FS_O_DSYNC O_DSYNC +#define UV_FS_O_DSYNC O_DSYNC #else -# define UV_FS_O_DSYNC 0 +#define UV_FS_O_DSYNC 0 #endif #if defined(O_EXCL) -# define UV_FS_O_EXCL O_EXCL +#define UV_FS_O_EXCL O_EXCL #else -# define UV_FS_O_EXCL 0 +#define UV_FS_O_EXCL 0 #endif #if defined(O_EXLOCK) -# define UV_FS_O_EXLOCK O_EXLOCK +#define UV_FS_O_EXLOCK O_EXLOCK #else -# define UV_FS_O_EXLOCK 0 +#define UV_FS_O_EXLOCK 0 #endif #if defined(O_NOATIME) -# define UV_FS_O_NOATIME O_NOATIME +#define UV_FS_O_NOATIME O_NOATIME #else -# define UV_FS_O_NOATIME 0 +#define UV_FS_O_NOATIME 0 #endif #if defined(O_NOCTTY) -# define UV_FS_O_NOCTTY O_NOCTTY +#define UV_FS_O_NOCTTY O_NOCTTY #else -# define UV_FS_O_NOCTTY 0 +#define UV_FS_O_NOCTTY 0 #endif #if defined(O_NOFOLLOW) -# define UV_FS_O_NOFOLLOW O_NOFOLLOW +#define UV_FS_O_NOFOLLOW O_NOFOLLOW #else -# define UV_FS_O_NOFOLLOW 0 +#define UV_FS_O_NOFOLLOW 0 #endif #if defined(O_NONBLOCK) -# define UV_FS_O_NONBLOCK O_NONBLOCK +#define UV_FS_O_NONBLOCK O_NONBLOCK #else -# define UV_FS_O_NONBLOCK 0 +#define UV_FS_O_NONBLOCK 0 #endif #if defined(O_RDONLY) -# define UV_FS_O_RDONLY O_RDONLY +#define UV_FS_O_RDONLY O_RDONLY #else -# define UV_FS_O_RDONLY 0 +#define UV_FS_O_RDONLY 0 #endif #if defined(O_RDWR) -# define UV_FS_O_RDWR O_RDWR +#define UV_FS_O_RDWR O_RDWR #else -# define UV_FS_O_RDWR 0 +#define UV_FS_O_RDWR 0 #endif #if defined(O_SYMLINK) -# define UV_FS_O_SYMLINK O_SYMLINK +#define UV_FS_O_SYMLINK O_SYMLINK #else -# define UV_FS_O_SYMLINK 0 +#define UV_FS_O_SYMLINK 0 #endif #if defined(O_SYNC) -# define UV_FS_O_SYNC O_SYNC +#define UV_FS_O_SYNC O_SYNC #else -# define UV_FS_O_SYNC 0 +#define UV_FS_O_SYNC 0 #endif #if defined(O_TRUNC) -# define UV_FS_O_TRUNC O_TRUNC +#define UV_FS_O_TRUNC O_TRUNC #else -# define UV_FS_O_TRUNC 0 +#define UV_FS_O_TRUNC 0 #endif #if defined(O_WRONLY) -# define UV_FS_O_WRONLY O_WRONLY +#define UV_FS_O_WRONLY O_WRONLY #else -# define UV_FS_O_WRONLY 0 +#define UV_FS_O_WRONLY 0 #endif /* fs open() flags supported on other platforms: */ -#define UV_FS_O_FILEMAP 0 -#define UV_FS_O_RANDOM 0 -#define UV_FS_O_SHORT_LIVED 0 -#define UV_FS_O_SEQUENTIAL 0 -#define UV_FS_O_TEMPORARY 0 +#define UV_FS_O_FILEMAP 0 +#define UV_FS_O_RANDOM 0 +#define UV_FS_O_SHORT_LIVED 0 +#define UV_FS_O_SEQUENTIAL 0 +#define UV_FS_O_TEMPORARY 0 #endif /* UV_UNIX_H */ diff --git a/src/libuv/include/uv/version.h b/src/libuv/include/uv/version.h index 46f469296..357007138 100644 --- a/src/libuv/include/uv/version.h +++ b/src/libuv/include/uv/version.h @@ -22,7 +22,7 @@ #ifndef UV_VERSION_H #define UV_VERSION_H - /* +/* * Versions with the same major number are ABI stable. API is allowed to * evolve between minor releases, but only in a backwards compatible way. * Make sure you update the -soname directives in configure.ac @@ -36,8 +36,7 @@ #define UV_VERSION_IS_RELEASE 1 #define UV_VERSION_SUFFIX "" -#define UV_VERSION_HEX ((UV_VERSION_MAJOR << 16) | \ - (UV_VERSION_MINOR << 8) | \ - (UV_VERSION_PATCH)) +#define UV_VERSION_HEX \ + ((UV_VERSION_MAJOR << 16) | (UV_VERSION_MINOR << 8) | (UV_VERSION_PATCH)) #endif /* UV_VERSION_H */ diff --git a/src/libuv/include/uv/win.h b/src/libuv/include/uv/win.h index 5fecf4bf6..1dbf9f66d 100644 --- a/src/libuv/include/uv/win.h +++ b/src/libuv/include/uv/win.h @@ -20,14 +20,14 @@ */ #ifndef _WIN32_WINNT -# define _WIN32_WINNT 0x0600 +#define _WIN32_WINNT 0x0600 #endif #if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED) typedef intptr_t ssize_t; -# define SSIZE_MAX INTPTR_MAX -# define _SSIZE_T_ -# define _SSIZE_T_DEFINED +#define SSIZE_MAX INTPTR_MAX +#define _SSIZE_T_ +#define _SSIZE_T_DEFINED #endif #include @@ -35,13 +35,13 @@ typedef intptr_t ssize_t; #if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) typedef struct pollfd { SOCKET fd; - short events; - short revents; + short events; + short revents; } WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD; #endif #ifndef LOCALE_INVARIANT -# define LOCALE_INVARIANT 0x007f +#define LOCALE_INVARIANT 0x007f #endif #include @@ -55,24 +55,24 @@ typedef struct pollfd { #undef PTCP_INITIAL_RTO_PARAMETERS #include +#include #include #include -#include #include #if defined(_MSC_VER) && _MSC_VER < 1600 -# include "uv/stdint-msvc2008.h" +#include "uv/stdint-msvc2008.h" #else -# include +#include #endif -#include "uv/tree.h" #include "uv/threadpool.h" +#include "uv/tree.h" #define MAX_PIPENAME_LEN 256 #ifndef S_IFLNK -# define S_IFLNK 0xA000 +#define S_IFLNK 0xA000 #endif /* Additional signals supported by uv_signal and or uv_kill. The CRT defines @@ -90,22 +90,22 @@ typedef struct pollfd { * The additional signals have values that are common on other Unix * variants (Linux and Darwin) */ -#define SIGHUP 1 -#define SIGKILL 9 -#define SIGWINCH 28 +#define SIGHUP 1 +#define SIGKILL 9 +#define SIGWINCH 28 /* Redefine NSIG to take SIGWINCH into consideration */ #if defined(NSIG) && NSIG <= SIGWINCH -# undef NSIG +#undef NSIG #endif #ifndef NSIG -# define NSIG SIGWINCH + 1 +#define NSIG SIGWINCH + 1 #endif /* The CRT defines SIGABRT_COMPAT as 6, which equals SIGABRT on many unix-like * platforms. However MinGW doesn't define it, so we do. */ #ifndef SIGABRT_COMPAT -# define SIGABRT_COMPAT 6 +#define SIGABRT_COMPAT 6 #endif /* @@ -113,101 +113,72 @@ typedef struct pollfd { * Mingw32 doesn't have these :-( */ #ifndef WSAID_ACCEPTEX -# define WSAID_ACCEPTEX \ - {0xb5367df1, 0xcbac, 0x11cf, \ - {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}} - -# define WSAID_CONNECTEX \ - {0x25a207b9, 0xddf3, 0x4660, \ - {0x8e, 0xe9, 0x76, 0xe5, 0x8c, 0x74, 0x06, 0x3e}} - -# define WSAID_GETACCEPTEXSOCKADDRS \ - {0xb5367df2, 0xcbac, 0x11cf, \ - {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}} - -# define WSAID_DISCONNECTEX \ - {0x7fda2e11, 0x8630, 0x436f, \ - {0xa0, 0x31, 0xf5, 0x36, 0xa6, 0xee, 0xc1, 0x57}} - -# define WSAID_TRANSMITFILE \ - {0xb5367df0, 0xcbac, 0x11cf, \ - {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}} - - typedef BOOL (PASCAL *LPFN_ACCEPTEX) - (SOCKET sListenSocket, - SOCKET sAcceptSocket, - PVOID lpOutputBuffer, - DWORD dwReceiveDataLength, - DWORD dwLocalAddressLength, - DWORD dwRemoteAddressLength, - LPDWORD lpdwBytesReceived, - LPOVERLAPPED lpOverlapped); - - typedef BOOL (PASCAL *LPFN_CONNECTEX) - (SOCKET s, - const struct sockaddr* name, - int namelen, - PVOID lpSendBuffer, - DWORD dwSendDataLength, - LPDWORD lpdwBytesSent, - LPOVERLAPPED lpOverlapped); - - typedef void (PASCAL *LPFN_GETACCEPTEXSOCKADDRS) - (PVOID lpOutputBuffer, - DWORD dwReceiveDataLength, - DWORD dwLocalAddressLength, - DWORD dwRemoteAddressLength, - LPSOCKADDR* LocalSockaddr, - LPINT LocalSockaddrLength, - LPSOCKADDR* RemoteSockaddr, - LPINT RemoteSockaddrLength); - - typedef BOOL (PASCAL *LPFN_DISCONNECTEX) - (SOCKET hSocket, - LPOVERLAPPED lpOverlapped, - DWORD dwFlags, - DWORD reserved); - - typedef BOOL (PASCAL *LPFN_TRANSMITFILE) - (SOCKET hSocket, - HANDLE hFile, - DWORD nNumberOfBytesToWrite, - DWORD nNumberOfBytesPerSend, - LPOVERLAPPED lpOverlapped, - LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers, - DWORD dwFlags); - - typedef PVOID RTL_SRWLOCK; - typedef RTL_SRWLOCK SRWLOCK, *PSRWLOCK; +#define WSAID_ACCEPTEX \ + {0xb5367df1, 0xcbac, 0x11cf, {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}} + +#define WSAID_CONNECTEX \ + {0x25a207b9, 0xddf3, 0x4660, {0x8e, 0xe9, 0x76, 0xe5, 0x8c, 0x74, 0x06, 0x3e}} + +#define WSAID_GETACCEPTEXSOCKADDRS \ + {0xb5367df2, 0xcbac, 0x11cf, {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}} + +#define WSAID_DISCONNECTEX \ + {0x7fda2e11, 0x8630, 0x436f, {0xa0, 0x31, 0xf5, 0x36, 0xa6, 0xee, 0xc1, 0x57}} + +#define WSAID_TRANSMITFILE \ + {0xb5367df0, 0xcbac, 0x11cf, {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}} + +typedef BOOL(PASCAL *LPFN_ACCEPTEX)(SOCKET sListenSocket, SOCKET sAcceptSocket, + PVOID lpOutputBuffer, + DWORD dwReceiveDataLength, + DWORD dwLocalAddressLength, + DWORD dwRemoteAddressLength, + LPDWORD lpdwBytesReceived, + LPOVERLAPPED lpOverlapped); + +typedef BOOL(PASCAL *LPFN_CONNECTEX)(SOCKET s, const struct sockaddr *name, + int namelen, PVOID lpSendBuffer, + DWORD dwSendDataLength, + LPDWORD lpdwBytesSent, + LPOVERLAPPED lpOverlapped); + +typedef void(PASCAL *LPFN_GETACCEPTEXSOCKADDRS)( + PVOID lpOutputBuffer, DWORD dwReceiveDataLength, DWORD dwLocalAddressLength, + DWORD dwRemoteAddressLength, LPSOCKADDR *LocalSockaddr, + LPINT LocalSockaddrLength, LPSOCKADDR *RemoteSockaddr, + LPINT RemoteSockaddrLength); + +typedef BOOL(PASCAL *LPFN_DISCONNECTEX)(SOCKET hSocket, + LPOVERLAPPED lpOverlapped, + DWORD dwFlags, DWORD reserved); + +typedef BOOL(PASCAL *LPFN_TRANSMITFILE)( + SOCKET hSocket, HANDLE hFile, DWORD nNumberOfBytesToWrite, + DWORD nNumberOfBytesPerSend, LPOVERLAPPED lpOverlapped, + LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers, DWORD dwFlags); + +typedef PVOID RTL_SRWLOCK; +typedef RTL_SRWLOCK SRWLOCK, *PSRWLOCK; #endif -typedef int (WSAAPI* LPFN_WSARECV) - (SOCKET socket, - LPWSABUF buffers, - DWORD buffer_count, - LPDWORD bytes, - LPDWORD flags, - LPWSAOVERLAPPED overlapped, - LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine); - -typedef int (WSAAPI* LPFN_WSARECVFROM) - (SOCKET socket, - LPWSABUF buffers, - DWORD buffer_count, - LPDWORD bytes, - LPDWORD flags, - struct sockaddr* addr, - LPINT addr_len, - LPWSAOVERLAPPED overlapped, - LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine); +typedef int(WSAAPI *LPFN_WSARECV)( + SOCKET socket, LPWSABUF buffers, DWORD buffer_count, LPDWORD bytes, + LPDWORD flags, LPWSAOVERLAPPED overlapped, + LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine); + +typedef int(WSAAPI *LPFN_WSARECVFROM)( + SOCKET socket, LPWSABUF buffers, DWORD buffer_count, LPDWORD bytes, + LPDWORD flags, struct sockaddr *addr, LPINT addr_len, + LPWSAOVERLAPPED overlapped, + LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine); #ifndef _NTDEF_ - typedef LONG NTSTATUS; - typedef NTSTATUS *PNTSTATUS; +typedef LONG NTSTATUS; +typedef NTSTATUS *PNTSTATUS; #endif #ifndef RTL_CONDITION_VARIABLE_INIT - typedef PVOID CONDITION_VARIABLE, *PCONDITION_VARIABLE; +typedef PVOID CONDITION_VARIABLE, *PCONDITION_VARIABLE; #endif typedef struct _AFD_POLL_HANDLE_INFO { @@ -225,14 +196,13 @@ typedef struct _AFD_POLL_INFO { #define UV_MSAFD_PROVIDER_COUNT 3 - /** * It should be possible to cast uv_buf_t[] to WSABUF[] * see http://msdn.microsoft.com/en-us/library/ms741542(v=vs.85).aspx */ typedef struct uv_buf_t { ULONG len; - char* base; + char *base; } uv_buf_t; typedef int uv_file; @@ -292,7 +262,7 @@ typedef struct { DWORD tls_index; } uv_key_t; -#define UV_ONCE_INIT { 0, NULL } +#define UV_ONCE_INIT {0, NULL} typedef struct uv_once_s { unsigned char ran; @@ -308,354 +278,355 @@ typedef struct uv__dirent_s { char d_name[1]; } uv__dirent_t; -#define UV_DIR_PRIVATE_FIELDS \ - HANDLE dir_handle; \ - WIN32_FIND_DATAW find_data; \ +#define UV_DIR_PRIVATE_FIELDS \ + HANDLE dir_handle; \ + WIN32_FIND_DATAW find_data; \ BOOL need_find_call; #define HAVE_DIRENT_TYPES -#define UV__DT_DIR UV_DIRENT_DIR -#define UV__DT_FILE UV_DIRENT_FILE -#define UV__DT_LINK UV_DIRENT_LINK -#define UV__DT_FIFO UV_DIRENT_FIFO -#define UV__DT_SOCKET UV_DIRENT_SOCKET -#define UV__DT_CHAR UV_DIRENT_CHAR -#define UV__DT_BLOCK UV_DIRENT_BLOCK +#define UV__DT_DIR UV_DIRENT_DIR +#define UV__DT_FILE UV_DIRENT_FILE +#define UV__DT_LINK UV_DIRENT_LINK +#define UV__DT_FIFO UV_DIRENT_FIFO +#define UV__DT_SOCKET UV_DIRENT_SOCKET +#define UV__DT_CHAR UV_DIRENT_CHAR +#define UV__DT_BLOCK UV_DIRENT_BLOCK /* Platform-specific definitions for uv_dlopen support. */ #define UV_DYNAMIC FAR WINAPI typedef struct { HMODULE handle; - char* errmsg; + char *errmsg; } uv_lib_t; -#define UV_LOOP_PRIVATE_FIELDS \ - /* The loop's I/O completion port */ \ - HANDLE iocp; \ - /* The current time according to the event loop. in msecs. */ \ - uint64_t time; \ - /* Tail of a single-linked circular queue of pending reqs. If the queue */ \ - /* is empty, tail_ is NULL. If there is only one item, */ \ - /* tail_->next_req == tail_ */ \ - uv_req_t* pending_reqs_tail; \ - /* Head of a single-linked list of closed handles */ \ - uv_handle_t* endgame_handles; \ - /* TODO(bnoordhuis) Stop heap-allocating |timer_heap| in libuv v2.x. */ \ - void* timer_heap; \ - /* Lists of active loop (prepare / check / idle) watchers */ \ - uv_prepare_t* prepare_handles; \ - uv_check_t* check_handles; \ - uv_idle_t* idle_handles; \ - /* This pointer will refer to the prepare/check/idle handle whose */ \ - /* callback is scheduled to be called next. This is needed to allow */ \ - /* safe removal from one of the lists above while that list being */ \ - /* iterated over. */ \ - uv_prepare_t* next_prepare_handle; \ - uv_check_t* next_check_handle; \ - uv_idle_t* next_idle_handle; \ - /* This handle holds the peer sockets for the fast variant of uv_poll_t */ \ - SOCKET poll_peer_sockets[UV_MSAFD_PROVIDER_COUNT]; \ - /* Counter to keep track of active tcp streams */ \ - unsigned int active_tcp_streams; \ - /* Counter to keep track of active udp streams */ \ - unsigned int active_udp_streams; \ - /* Counter to started timer */ \ - uint64_t timer_counter; \ - /* Threadpool */ \ - void* wq[2]; \ - uv_mutex_t wq_mutex; \ +#define UV_LOOP_PRIVATE_FIELDS \ + /* The loop's I/O completion port */ \ + HANDLE iocp; \ + /* The current time according to the event loop. in msecs. */ \ + uint64_t time; \ + /* Tail of a single-linked circular queue of pending reqs. If the queue */ \ + /* is empty, tail_ is NULL. If there is only one item, */ \ + /* tail_->next_req == tail_ */ \ + uv_req_t *pending_reqs_tail; \ + /* Head of a single-linked list of closed handles */ \ + uv_handle_t *endgame_handles; \ + /* TODO(bnoordhuis) Stop heap-allocating |timer_heap| in libuv v2.x. */ \ + void *timer_heap; \ + /* Lists of active loop (prepare / check / idle) watchers */ \ + uv_prepare_t *prepare_handles; \ + uv_check_t *check_handles; \ + uv_idle_t *idle_handles; \ + /* This pointer will refer to the prepare/check/idle handle whose */ \ + /* callback is scheduled to be called next. This is needed to allow */ \ + /* safe removal from one of the lists above while that list being */ \ + /* iterated over. */ \ + uv_prepare_t *next_prepare_handle; \ + uv_check_t *next_check_handle; \ + uv_idle_t *next_idle_handle; \ + /* This handle holds the peer sockets for the fast variant of uv_poll_t */ \ + SOCKET poll_peer_sockets[UV_MSAFD_PROVIDER_COUNT]; \ + /* Counter to keep track of active tcp streams */ \ + unsigned int active_tcp_streams; \ + /* Counter to keep track of active udp streams */ \ + unsigned int active_udp_streams; \ + /* Counter to started timer */ \ + uint64_t timer_counter; \ + /* Threadpool */ \ + void *wq[2]; \ + uv_mutex_t wq_mutex; \ uv_async_t wq_async; -#define UV_REQ_TYPE_PRIVATE \ - /* TODO: remove the req suffix */ \ - UV_ACCEPT, \ - UV_FS_EVENT_REQ, \ - UV_POLL_REQ, \ - UV_PROCESS_EXIT, \ - UV_READ, \ - UV_UDP_RECV, \ - UV_WAKEUP, \ - UV_SIGNAL_REQ, - -#define UV_REQ_PRIVATE_FIELDS \ - union { \ - /* Used by I/O operations */ \ - struct { \ - OVERLAPPED overlapped; \ - size_t queued_bytes; \ - } io; \ - } u; \ - struct uv_req_s* next_req; - -#define UV_WRITE_PRIVATE_FIELDS \ - int coalesced; \ - uv_buf_t write_buffer; \ - HANDLE event_handle; \ +#define UV_REQ_TYPE_PRIVATE \ + /* TODO: remove the req suffix */ \ + UV_ACCEPT, UV_FS_EVENT_REQ, UV_POLL_REQ, UV_PROCESS_EXIT, UV_READ, \ + UV_UDP_RECV, UV_WAKEUP, UV_SIGNAL_REQ, + +#define UV_REQ_PRIVATE_FIELDS \ + union { \ + /* Used by I/O operations */ \ + struct { \ + OVERLAPPED overlapped; \ + size_t queued_bytes; \ + } io; \ + } u; \ + struct uv_req_s *next_req; + +#define UV_WRITE_PRIVATE_FIELDS \ + int coalesced; \ + uv_buf_t write_buffer; \ + HANDLE event_handle; \ HANDLE wait_handle; -#define UV_CONNECT_PRIVATE_FIELDS \ - /* empty */ - -#define UV_SHUTDOWN_PRIVATE_FIELDS \ - /* empty */ - -#define UV_UDP_SEND_PRIVATE_FIELDS \ - /* empty */ - -#define UV_PRIVATE_REQ_TYPES \ - typedef struct uv_pipe_accept_s { \ - UV_REQ_FIELDS \ - HANDLE pipeHandle; \ - struct uv_pipe_accept_s* next_pending; \ - } uv_pipe_accept_t; \ - \ - typedef struct uv_tcp_accept_s { \ - UV_REQ_FIELDS \ - SOCKET accept_socket; \ - char accept_buffer[sizeof(struct sockaddr_storage) * 2 + 32]; \ - HANDLE event_handle; \ - HANDLE wait_handle; \ - struct uv_tcp_accept_s* next_pending; \ - } uv_tcp_accept_t; \ - \ - typedef struct uv_read_s { \ - UV_REQ_FIELDS \ - HANDLE event_handle; \ - HANDLE wait_handle; \ +#define UV_CONNECT_PRIVATE_FIELDS /* empty */ + +#define UV_SHUTDOWN_PRIVATE_FIELDS /* empty */ + +#define UV_UDP_SEND_PRIVATE_FIELDS /* empty */ + +#define UV_PRIVATE_REQ_TYPES \ + typedef struct uv_pipe_accept_s { \ + UV_REQ_FIELDS \ + HANDLE pipeHandle; \ + struct uv_pipe_accept_s *next_pending; \ + } uv_pipe_accept_t; \ + \ + typedef struct uv_tcp_accept_s { \ + UV_REQ_FIELDS \ + SOCKET accept_socket; \ + char accept_buffer[sizeof(struct sockaddr_storage) * 2 + 32]; \ + HANDLE event_handle; \ + HANDLE wait_handle; \ + struct uv_tcp_accept_s *next_pending; \ + } uv_tcp_accept_t; \ + \ + typedef struct uv_read_s { \ + UV_REQ_FIELDS \ + HANDLE event_handle; \ + HANDLE wait_handle; \ } uv_read_t; -#define uv_stream_connection_fields \ - unsigned int write_reqs_pending; \ - uv_shutdown_t* shutdown_req; - -#define uv_stream_server_fields \ - uv_connection_cb connection_cb; - -#define UV_STREAM_PRIVATE_FIELDS \ - unsigned int reqs_pending; \ - int activecnt; \ - uv_read_t read_req; \ - union { \ - struct { uv_stream_connection_fields } conn; \ - struct { uv_stream_server_fields } serv; \ +#define uv_stream_connection_fields \ + unsigned int write_reqs_pending; \ + uv_shutdown_t *shutdown_req; + +#define uv_stream_server_fields uv_connection_cb connection_cb; + +#define UV_STREAM_PRIVATE_FIELDS \ + unsigned int reqs_pending; \ + int activecnt; \ + uv_read_t read_req; \ + union { \ + struct { \ + uv_stream_connection_fields \ + } conn; \ + struct { \ + uv_stream_server_fields \ + } serv; \ } stream; -#define uv_tcp_server_fields \ - uv_tcp_accept_t* accept_reqs; \ - unsigned int processed_accepts; \ - uv_tcp_accept_t* pending_accepts; \ +#define uv_tcp_server_fields \ + uv_tcp_accept_t *accept_reqs; \ + unsigned int processed_accepts; \ + uv_tcp_accept_t *pending_accepts; \ LPFN_ACCEPTEX func_acceptex; -#define uv_tcp_connection_fields \ - uv_buf_t read_buffer; \ +#define uv_tcp_connection_fields \ + uv_buf_t read_buffer; \ LPFN_CONNECTEX func_connectex; -#define UV_TCP_PRIVATE_FIELDS \ - SOCKET socket; \ - int delayed_error; \ - union { \ - struct { uv_tcp_server_fields } serv; \ - struct { uv_tcp_connection_fields } conn; \ +#define UV_TCP_PRIVATE_FIELDS \ + SOCKET socket; \ + int delayed_error; \ + union { \ + struct { \ + uv_tcp_server_fields \ + } serv; \ + struct { \ + uv_tcp_connection_fields \ + } conn; \ } tcp; -#define UV_UDP_PRIVATE_FIELDS \ - SOCKET socket; \ - unsigned int reqs_pending; \ - int activecnt; \ - uv_req_t recv_req; \ - uv_buf_t recv_buffer; \ - struct sockaddr_storage recv_from; \ - int recv_from_len; \ - uv_udp_recv_cb recv_cb; \ - uv_alloc_cb alloc_cb; \ - LPFN_WSARECV func_wsarecv; \ +#define UV_UDP_PRIVATE_FIELDS \ + SOCKET socket; \ + unsigned int reqs_pending; \ + int activecnt; \ + uv_req_t recv_req; \ + uv_buf_t recv_buffer; \ + struct sockaddr_storage recv_from; \ + int recv_from_len; \ + uv_udp_recv_cb recv_cb; \ + uv_alloc_cb alloc_cb; \ + LPFN_WSARECV func_wsarecv; \ LPFN_WSARECVFROM func_wsarecvfrom; -#define uv_pipe_server_fields \ - int pending_instances; \ - uv_pipe_accept_t* accept_reqs; \ - uv_pipe_accept_t* pending_accepts; - -#define uv_pipe_connection_fields \ - uv_timer_t* eof_timer; \ - uv_write_t dummy; /* TODO: retained for ABI compat; remove this in v2.x. */ \ - DWORD ipc_remote_pid; \ - union { \ - uint32_t payload_remaining; \ - uint64_t dummy; /* TODO: retained for ABI compat; remove this in v2.x. */ \ - } ipc_data_frame; \ - void* ipc_xfer_queue[2]; \ - int ipc_xfer_queue_length; \ - uv_write_t* non_overlapped_writes_tail; \ - CRITICAL_SECTION readfile_thread_lock; \ +#define uv_pipe_server_fields \ + int pending_instances; \ + uv_pipe_accept_t *accept_reqs; \ + uv_pipe_accept_t *pending_accepts; + +#define uv_pipe_connection_fields \ + uv_timer_t *eof_timer; \ + uv_write_t dummy; /* TODO: retained for ABI compat; remove this in v2.x. */ \ + DWORD ipc_remote_pid; \ + union { \ + uint32_t payload_remaining; \ + uint64_t dummy; /* TODO: retained for ABI compat; remove this in v2.x. */ \ + } ipc_data_frame; \ + void *ipc_xfer_queue[2]; \ + int ipc_xfer_queue_length; \ + uv_write_t *non_overlapped_writes_tail; \ + CRITICAL_SECTION readfile_thread_lock; \ volatile HANDLE readfile_thread_handle; -#define UV_PIPE_PRIVATE_FIELDS \ - HANDLE handle; \ - WCHAR* name; \ - union { \ - struct { uv_pipe_server_fields } serv; \ - struct { uv_pipe_connection_fields } conn; \ +#define UV_PIPE_PRIVATE_FIELDS \ + HANDLE handle; \ + WCHAR *name; \ + union { \ + struct { \ + uv_pipe_server_fields \ + } serv; \ + struct { \ + uv_pipe_connection_fields \ + } conn; \ } pipe; /* TODO: put the parser states in an union - TTY handles are always half-duplex * so read-state can safely overlap write-state. */ -#define UV_TTY_PRIVATE_FIELDS \ - HANDLE handle; \ - union { \ - struct { \ - /* Used for readable TTY handles */ \ - /* TODO: remove me in v2.x. */ \ - HANDLE unused_; \ - uv_buf_t read_line_buffer; \ - HANDLE read_raw_wait; \ - /* Fields used for translating win keystrokes into vt100 characters */ \ - char last_key[8]; \ - unsigned char last_key_offset; \ - unsigned char last_key_len; \ - WCHAR last_utf16_high_surrogate; \ - INPUT_RECORD last_input_record; \ - } rd; \ - struct { \ - /* Used for writable TTY handles */ \ - /* utf8-to-utf16 conversion state */ \ - unsigned int utf8_codepoint; \ - unsigned char utf8_bytes_left; \ - /* eol conversion state */ \ - unsigned char previous_eol; \ - /* ansi parser state */ \ - unsigned short ansi_parser_state; \ - unsigned char ansi_csi_argc; \ - unsigned short ansi_csi_argv[4]; \ - COORD saved_position; \ - WORD saved_attributes; \ - } wr; \ +#define UV_TTY_PRIVATE_FIELDS \ + HANDLE handle; \ + union { \ + struct { \ + /* Used for readable TTY handles */ \ + /* TODO: remove me in v2.x. */ \ + HANDLE unused_; \ + uv_buf_t read_line_buffer; \ + HANDLE read_raw_wait; \ + /* Fields used for translating win keystrokes into vt100 characters */ \ + char last_key[8]; \ + unsigned char last_key_offset; \ + unsigned char last_key_len; \ + WCHAR last_utf16_high_surrogate; \ + INPUT_RECORD last_input_record; \ + } rd; \ + struct { \ + /* Used for writable TTY handles */ \ + /* utf8-to-utf16 conversion state */ \ + unsigned int utf8_codepoint; \ + unsigned char utf8_bytes_left; \ + /* eol conversion state */ \ + unsigned char previous_eol; \ + /* ansi parser state */ \ + unsigned short ansi_parser_state; \ + unsigned char ansi_csi_argc; \ + unsigned short ansi_csi_argv[4]; \ + COORD saved_position; \ + WORD saved_attributes; \ + } wr; \ } tty; -#define UV_POLL_PRIVATE_FIELDS \ - SOCKET socket; \ - /* Used in fast mode */ \ - SOCKET peer_socket; \ - AFD_POLL_INFO afd_poll_info_1; \ - AFD_POLL_INFO afd_poll_info_2; \ - /* Used in fast and slow mode. */ \ - uv_req_t poll_req_1; \ - uv_req_t poll_req_2; \ - unsigned char submitted_events_1; \ - unsigned char submitted_events_2; \ - unsigned char mask_events_1; \ - unsigned char mask_events_2; \ +#define UV_POLL_PRIVATE_FIELDS \ + SOCKET socket; \ + /* Used in fast mode */ \ + SOCKET peer_socket; \ + AFD_POLL_INFO afd_poll_info_1; \ + AFD_POLL_INFO afd_poll_info_2; \ + /* Used in fast and slow mode. */ \ + uv_req_t poll_req_1; \ + uv_req_t poll_req_2; \ + unsigned char submitted_events_1; \ + unsigned char submitted_events_2; \ + unsigned char mask_events_1; \ + unsigned char mask_events_2; \ unsigned char events; -#define UV_TIMER_PRIVATE_FIELDS \ - void* heap_node[3]; \ - int unused; \ - uint64_t timeout; \ - uint64_t repeat; \ - uint64_t start_id; \ +#define UV_TIMER_PRIVATE_FIELDS \ + void *heap_node[3]; \ + int unused; \ + uint64_t timeout; \ + uint64_t repeat; \ + uint64_t start_id; \ uv_timer_cb timer_cb; -#define UV_ASYNC_PRIVATE_FIELDS \ - struct uv_req_s async_req; \ - uv_async_cb async_cb; \ - /* char to avoid alignment issues */ \ +#define UV_ASYNC_PRIVATE_FIELDS \ + struct uv_req_s async_req; \ + uv_async_cb async_cb; \ + /* char to avoid alignment issues */ \ char volatile async_sent; -#define UV_PREPARE_PRIVATE_FIELDS \ - uv_prepare_t* prepare_prev; \ - uv_prepare_t* prepare_next; \ +#define UV_PREPARE_PRIVATE_FIELDS \ + uv_prepare_t *prepare_prev; \ + uv_prepare_t *prepare_next; \ uv_prepare_cb prepare_cb; -#define UV_CHECK_PRIVATE_FIELDS \ - uv_check_t* check_prev; \ - uv_check_t* check_next; \ +#define UV_CHECK_PRIVATE_FIELDS \ + uv_check_t *check_prev; \ + uv_check_t *check_next; \ uv_check_cb check_cb; -#define UV_IDLE_PRIVATE_FIELDS \ - uv_idle_t* idle_prev; \ - uv_idle_t* idle_next; \ +#define UV_IDLE_PRIVATE_FIELDS \ + uv_idle_t *idle_prev; \ + uv_idle_t *idle_next; \ uv_idle_cb idle_cb; -#define UV_HANDLE_PRIVATE_FIELDS \ - uv_handle_t* endgame_next; \ +#define UV_HANDLE_PRIVATE_FIELDS \ + uv_handle_t *endgame_next; \ unsigned int flags; -#define UV_GETADDRINFO_PRIVATE_FIELDS \ - struct uv__work work_req; \ - uv_getaddrinfo_cb getaddrinfo_cb; \ - void* alloc; \ - WCHAR* node; \ - WCHAR* service; \ - /* The addrinfoW field is used to store a pointer to the hints, and */ \ - /* later on to store the result of GetAddrInfoW. The final result will */ \ - /* be converted to struct addrinfo* and stored in the addrinfo field. */ \ - struct addrinfoW* addrinfow; \ - struct addrinfo* addrinfo; \ +#define UV_GETADDRINFO_PRIVATE_FIELDS \ + struct uv__work work_req; \ + uv_getaddrinfo_cb getaddrinfo_cb; \ + void *alloc; \ + WCHAR *node; \ + WCHAR *service; \ + /* The addrinfoW field is used to store a pointer to the hints, and */ \ + /* later on to store the result of GetAddrInfoW. The final result will */ \ + /* be converted to struct addrinfo* and stored in the addrinfo field. */ \ + struct addrinfoW *addrinfow; \ + struct addrinfo *addrinfo; \ int retcode; -#define UV_GETNAMEINFO_PRIVATE_FIELDS \ - struct uv__work work_req; \ - uv_getnameinfo_cb getnameinfo_cb; \ - struct sockaddr_storage storage; \ - int flags; \ - char host[NI_MAXHOST]; \ - char service[NI_MAXSERV]; \ +#define UV_GETNAMEINFO_PRIVATE_FIELDS \ + struct uv__work work_req; \ + uv_getnameinfo_cb getnameinfo_cb; \ + struct sockaddr_storage storage; \ + int flags; \ + char host[NI_MAXHOST]; \ + char service[NI_MAXSERV]; \ int retcode; -#define UV_PROCESS_PRIVATE_FIELDS \ - struct uv_process_exit_s { \ - UV_REQ_FIELDS \ - } exit_req; \ - BYTE* child_stdio_buffer; \ - int exit_signal; \ - HANDLE wait_handle; \ - HANDLE process_handle; \ +#define UV_PROCESS_PRIVATE_FIELDS \ + struct uv_process_exit_s { \ + UV_REQ_FIELDS \ + } exit_req; \ + BYTE *child_stdio_buffer; \ + int exit_signal; \ + HANDLE wait_handle; \ + HANDLE process_handle; \ volatile char exit_cb_pending; -#define UV_FS_PRIVATE_FIELDS \ - struct uv__work work_req; \ - int flags; \ - DWORD sys_errno_; \ - union { \ - /* TODO: remove me in 0.9. */ \ - WCHAR* pathw; \ - int fd; \ - } file; \ - union { \ - struct { \ - int mode; \ - WCHAR* new_pathw; \ - int file_flags; \ - int fd_out; \ - unsigned int nbufs; \ - uv_buf_t* bufs; \ - int64_t offset; \ - uv_buf_t bufsml[4]; \ - } info; \ - struct { \ - double atime; \ - double mtime; \ - } time; \ +#define UV_FS_PRIVATE_FIELDS \ + struct uv__work work_req; \ + int flags; \ + DWORD sys_errno_; \ + union { \ + /* TODO: remove me in 0.9. */ \ + WCHAR *pathw; \ + int fd; \ + } file; \ + union { \ + struct { \ + int mode; \ + WCHAR *new_pathw; \ + int file_flags; \ + int fd_out; \ + unsigned int nbufs; \ + uv_buf_t *bufs; \ + int64_t offset; \ + uv_buf_t bufsml[4]; \ + } info; \ + struct { \ + double atime; \ + double mtime; \ + } time; \ } fs; -#define UV_WORK_PRIVATE_FIELDS \ - struct uv__work work_req; - -#define UV_FS_EVENT_PRIVATE_FIELDS \ - struct uv_fs_event_req_s { \ - UV_REQ_FIELDS \ - } req; \ - HANDLE dir_handle; \ - int req_pending; \ - uv_fs_event_cb cb; \ - WCHAR* filew; \ - WCHAR* short_filew; \ - WCHAR* dirw; \ - char* buffer; - -#define UV_SIGNAL_PRIVATE_FIELDS \ - RB_ENTRY(uv_signal_s) tree_entry; \ - struct uv_req_s signal_req; \ +#define UV_WORK_PRIVATE_FIELDS struct uv__work work_req; + +#define UV_FS_EVENT_PRIVATE_FIELDS \ + struct uv_fs_event_req_s { \ + UV_REQ_FIELDS \ + } req; \ + HANDLE dir_handle; \ + int req_pending; \ + uv_fs_event_cb cb; \ + WCHAR *filew; \ + WCHAR *short_filew; \ + WCHAR *dirw; \ + char *buffer; + +#define UV_SIGNAL_PRIVATE_FIELDS \ + RB_ENTRY(uv_signal_s) tree_entry; \ + struct uv_req_s signal_req; \ unsigned long pending_signum; #ifndef F_OK @@ -672,27 +643,27 @@ typedef struct { #endif /* fs open() flags supported on this platform: */ -#define UV_FS_O_APPEND _O_APPEND -#define UV_FS_O_CREAT _O_CREAT -#define UV_FS_O_EXCL _O_EXCL -#define UV_FS_O_FILEMAP 0x20000000 -#define UV_FS_O_RANDOM _O_RANDOM -#define UV_FS_O_RDONLY _O_RDONLY -#define UV_FS_O_RDWR _O_RDWR -#define UV_FS_O_SEQUENTIAL _O_SEQUENTIAL -#define UV_FS_O_SHORT_LIVED _O_SHORT_LIVED -#define UV_FS_O_TEMPORARY _O_TEMPORARY -#define UV_FS_O_TRUNC _O_TRUNC -#define UV_FS_O_WRONLY _O_WRONLY +#define UV_FS_O_APPEND _O_APPEND +#define UV_FS_O_CREAT _O_CREAT +#define UV_FS_O_EXCL _O_EXCL +#define UV_FS_O_FILEMAP 0x20000000 +#define UV_FS_O_RANDOM _O_RANDOM +#define UV_FS_O_RDONLY _O_RDONLY +#define UV_FS_O_RDWR _O_RDWR +#define UV_FS_O_SEQUENTIAL _O_SEQUENTIAL +#define UV_FS_O_SHORT_LIVED _O_SHORT_LIVED +#define UV_FS_O_TEMPORARY _O_TEMPORARY +#define UV_FS_O_TRUNC _O_TRUNC +#define UV_FS_O_WRONLY _O_WRONLY /* fs open() flags supported on other platforms (or mapped on this platform): */ -#define UV_FS_O_DIRECT 0x02000000 /* FILE_FLAG_NO_BUFFERING */ -#define UV_FS_O_DIRECTORY 0 -#define UV_FS_O_DSYNC 0x04000000 /* FILE_FLAG_WRITE_THROUGH */ -#define UV_FS_O_EXLOCK 0x10000000 /* EXCLUSIVE SHARING MODE */ -#define UV_FS_O_NOATIME 0 -#define UV_FS_O_NOCTTY 0 -#define UV_FS_O_NOFOLLOW 0 -#define UV_FS_O_NONBLOCK 0 -#define UV_FS_O_SYMLINK 0 -#define UV_FS_O_SYNC 0x08000000 /* FILE_FLAG_WRITE_THROUGH */ +#define UV_FS_O_DIRECT 0x02000000 /* FILE_FLAG_NO_BUFFERING */ +#define UV_FS_O_DIRECTORY 0 +#define UV_FS_O_DSYNC 0x04000000 /* FILE_FLAG_WRITE_THROUGH */ +#define UV_FS_O_EXLOCK 0x10000000 /* EXCLUSIVE SHARING MODE */ +#define UV_FS_O_NOATIME 0 +#define UV_FS_O_NOCTTY 0 +#define UV_FS_O_NOFOLLOW 0 +#define UV_FS_O_NONBLOCK 0 +#define UV_FS_O_SYMLINK 0 +#define UV_FS_O_SYNC 0x08000000 /* FILE_FLAG_WRITE_THROUGH */ diff --git a/src/libuv/src/heap-inl.h b/src/libuv/src/heap-inl.h index 1e2ed60e0..9702bcd34 100644 --- a/src/libuv/src/heap-inl.h +++ b/src/libuv/src/heap-inl.h @@ -16,18 +16,18 @@ #ifndef UV_SRC_HEAP_H_ #define UV_SRC_HEAP_H_ -#include /* NULL */ +#include /* NULL */ #if defined(__GNUC__) -# define HEAP_EXPORT(declaration) __attribute__((unused)) static declaration +#define HEAP_EXPORT(declaration) __attribute__((unused)) static declaration #else -# define HEAP_EXPORT(declaration) static declaration +#define HEAP_EXPORT(declaration) static declaration #endif struct heap_node { - struct heap_node* left; - struct heap_node* right; - struct heap_node* parent; + struct heap_node *left; + struct heap_node *right; + struct heap_node *parent; }; /* A binary min heap. The usual properties hold: the root is the lowest @@ -38,41 +38,38 @@ struct heap_node { * of a minor reduction in performance. Compile with -DNDEBUG to disable. */ struct heap { - struct heap_node* min; + struct heap_node *min; unsigned int nelts; }; /* Return non-zero if a < b. */ -typedef int (*heap_compare_fn)(const struct heap_node* a, - const struct heap_node* b); +typedef int (*heap_compare_fn)(const struct heap_node *a, + const struct heap_node *b); /* Public functions. */ -HEAP_EXPORT(void heap_init(struct heap* heap)); -HEAP_EXPORT(struct heap_node* heap_min(const struct heap* heap)); -HEAP_EXPORT(void heap_insert(struct heap* heap, - struct heap_node* newnode, +HEAP_EXPORT(void heap_init(struct heap *heap)); +HEAP_EXPORT(struct heap_node *heap_min(const struct heap *heap)); +HEAP_EXPORT(void heap_insert(struct heap *heap, struct heap_node *newnode, heap_compare_fn less_than)); -HEAP_EXPORT(void heap_remove(struct heap* heap, - struct heap_node* node, +HEAP_EXPORT(void heap_remove(struct heap *heap, struct heap_node *node, heap_compare_fn less_than)); -HEAP_EXPORT(void heap_dequeue(struct heap* heap, heap_compare_fn less_than)); +HEAP_EXPORT(void heap_dequeue(struct heap *heap, heap_compare_fn less_than)); /* Implementation follows. */ -HEAP_EXPORT(void heap_init(struct heap* heap)) { +HEAP_EXPORT(void heap_init(struct heap *heap)) { heap->min = NULL; heap->nelts = 0; } -HEAP_EXPORT(struct heap_node* heap_min(const struct heap* heap)) { +HEAP_EXPORT(struct heap_node *heap_min(const struct heap *heap)) { return heap->min; } /* Swap parent with child. Child moves closer to the root, parent moves away. */ -static void heap_node_swap(struct heap* heap, - struct heap_node* parent, - struct heap_node* child) { - struct heap_node* sibling; +static void heap_node_swap(struct heap *heap, struct heap_node *parent, + struct heap_node *child) { + struct heap_node *sibling; struct heap_node t; t = *parent; @@ -103,11 +100,10 @@ static void heap_node_swap(struct heap* heap, child->parent->right = child; } -HEAP_EXPORT(void heap_insert(struct heap* heap, - struct heap_node* newnode, +HEAP_EXPORT(void heap_insert(struct heap *heap, struct heap_node *newnode, heap_compare_fn less_than)) { - struct heap_node** parent; - struct heap_node** child; + struct heap_node **parent; + struct heap_node **child; unsigned int path; unsigned int n; unsigned int k; @@ -147,12 +143,11 @@ HEAP_EXPORT(void heap_insert(struct heap* heap, heap_node_swap(heap, newnode->parent, newnode); } -HEAP_EXPORT(void heap_remove(struct heap* heap, - struct heap_node* node, +HEAP_EXPORT(void heap_remove(struct heap *heap, struct heap_node *node, heap_compare_fn less_than)) { - struct heap_node* smallest; - struct heap_node** max; - struct heap_node* child; + struct heap_node *smallest; + struct heap_node **max; + struct heap_node *child; unsigned int path; unsigned int k; unsigned int n; @@ -236,10 +231,10 @@ HEAP_EXPORT(void heap_remove(struct heap* heap, heap_node_swap(heap, child->parent, child); } -HEAP_EXPORT(void heap_dequeue(struct heap* heap, heap_compare_fn less_than)) { +HEAP_EXPORT(void heap_dequeue(struct heap *heap, heap_compare_fn less_than)) { heap_remove(heap, heap->min, less_than); } #undef HEAP_EXPORT -#endif /* UV_SRC_HEAP_H_ */ +#endif /* UV_SRC_HEAP_H_ */ diff --git a/src/libuv/src/idna.h b/src/libuv/src/idna.h index 8e0c592fe..082494434 100644 --- a/src/libuv/src/idna.h +++ b/src/libuv/src/idna.h @@ -20,12 +20,12 @@ * |p| is updated on success _and_ error, i.e., bad multi-byte sequences are * skipped in their entirety, not just the first bad byte. */ -unsigned uv__utf8_decode1(const char** p, const char* pe); +unsigned uv__utf8_decode1(const char **p, const char *pe); /* Convert a UTF-8 domain name to IDNA 2008 / Punycode. A return value >= 0 * is the number of bytes written to |d|, including the trailing nul byte. * A return value < 0 is a libuv error code. |s| and |d| can not overlap. */ -long uv__idna_toascii(const char* s, const char* se, char* d, char* de); +long uv__idna_toascii(const char *s, const char *se, char *d, char *de); -#endif /* UV_SRC_IDNA_H_ */ +#endif /* UV_SRC_IDNA_H_ */ diff --git a/src/libuv/src/queue.h b/src/libuv/src/queue.h index ff3540a0a..c6bf4847a 100644 --- a/src/libuv/src/queue.h +++ b/src/libuv/src/queue.h @@ -21,88 +21,79 @@ typedef void *QUEUE[2]; /* Private macros. */ -#define QUEUE_NEXT(q) (*(QUEUE **) &((*(q))[0])) -#define QUEUE_PREV(q) (*(QUEUE **) &((*(q))[1])) -#define QUEUE_PREV_NEXT(q) (QUEUE_NEXT(QUEUE_PREV(q))) -#define QUEUE_NEXT_PREV(q) (QUEUE_PREV(QUEUE_NEXT(q))) +#define QUEUE_NEXT(q) (*(QUEUE **)&((*(q))[0])) +#define QUEUE_PREV(q) (*(QUEUE **)&((*(q))[1])) +#define QUEUE_PREV_NEXT(q) (QUEUE_NEXT(QUEUE_PREV(q))) +#define QUEUE_NEXT_PREV(q) (QUEUE_PREV(QUEUE_NEXT(q))) /* Public macros. */ -#define QUEUE_DATA(ptr, type, field) \ - ((type *) ((char *) (ptr) - offsetof(type, field))) +#define QUEUE_DATA(ptr, type, field) \ + ((type *)((char *)(ptr) - offsetof(type, field))) /* Important note: mutating the list while QUEUE_FOREACH is * iterating over its elements results in undefined behavior. */ -#define QUEUE_FOREACH(q, h) \ +#define QUEUE_FOREACH(q, h) \ for ((q) = QUEUE_NEXT(h); (q) != (h); (q) = QUEUE_NEXT(q)) -#define QUEUE_EMPTY(q) \ - ((const QUEUE *) (q) == (const QUEUE *) QUEUE_NEXT(q)) - -#define QUEUE_HEAD(q) \ - (QUEUE_NEXT(q)) - -#define QUEUE_INIT(q) \ - do { \ - QUEUE_NEXT(q) = (q); \ - QUEUE_PREV(q) = (q); \ - } \ - while (0) - -#define QUEUE_ADD(h, n) \ - do { \ - QUEUE_PREV_NEXT(h) = QUEUE_NEXT(n); \ - QUEUE_NEXT_PREV(n) = QUEUE_PREV(h); \ - QUEUE_PREV(h) = QUEUE_PREV(n); \ - QUEUE_PREV_NEXT(h) = (h); \ - } \ - while (0) - -#define QUEUE_SPLIT(h, q, n) \ - do { \ - QUEUE_PREV(n) = QUEUE_PREV(h); \ - QUEUE_PREV_NEXT(n) = (n); \ - QUEUE_NEXT(n) = (q); \ - QUEUE_PREV(h) = QUEUE_PREV(q); \ - QUEUE_PREV_NEXT(h) = (h); \ - QUEUE_PREV(q) = (n); \ - } \ - while (0) - -#define QUEUE_MOVE(h, n) \ - do { \ - if (QUEUE_EMPTY(h)) \ - QUEUE_INIT(n); \ - else { \ - QUEUE* q = QUEUE_HEAD(h); \ - QUEUE_SPLIT(h, q, n); \ - } \ - } \ - while (0) - -#define QUEUE_INSERT_HEAD(h, q) \ - do { \ - QUEUE_NEXT(q) = QUEUE_NEXT(h); \ - QUEUE_PREV(q) = (h); \ - QUEUE_NEXT_PREV(q) = (q); \ - QUEUE_NEXT(h) = (q); \ - } \ - while (0) - -#define QUEUE_INSERT_TAIL(h, q) \ - do { \ - QUEUE_NEXT(q) = (h); \ - QUEUE_PREV(q) = QUEUE_PREV(h); \ - QUEUE_PREV_NEXT(q) = (q); \ - QUEUE_PREV(h) = (q); \ - } \ - while (0) - -#define QUEUE_REMOVE(q) \ - do { \ - QUEUE_PREV_NEXT(q) = QUEUE_NEXT(q); \ - QUEUE_NEXT_PREV(q) = QUEUE_PREV(q); \ - } \ - while (0) +#define QUEUE_EMPTY(q) ((const QUEUE *)(q) == (const QUEUE *)QUEUE_NEXT(q)) + +#define QUEUE_HEAD(q) (QUEUE_NEXT(q)) + +#define QUEUE_INIT(q) \ + do { \ + QUEUE_NEXT(q) = (q); \ + QUEUE_PREV(q) = (q); \ + } while (0) + +#define QUEUE_ADD(h, n) \ + do { \ + QUEUE_PREV_NEXT(h) = QUEUE_NEXT(n); \ + QUEUE_NEXT_PREV(n) = QUEUE_PREV(h); \ + QUEUE_PREV(h) = QUEUE_PREV(n); \ + QUEUE_PREV_NEXT(h) = (h); \ + } while (0) + +#define QUEUE_SPLIT(h, q, n) \ + do { \ + QUEUE_PREV(n) = QUEUE_PREV(h); \ + QUEUE_PREV_NEXT(n) = (n); \ + QUEUE_NEXT(n) = (q); \ + QUEUE_PREV(h) = QUEUE_PREV(q); \ + QUEUE_PREV_NEXT(h) = (h); \ + QUEUE_PREV(q) = (n); \ + } while (0) + +#define QUEUE_MOVE(h, n) \ + do { \ + if (QUEUE_EMPTY(h)) \ + QUEUE_INIT(n); \ + else { \ + QUEUE *q = QUEUE_HEAD(h); \ + QUEUE_SPLIT(h, q, n); \ + } \ + } while (0) + +#define QUEUE_INSERT_HEAD(h, q) \ + do { \ + QUEUE_NEXT(q) = QUEUE_NEXT(h); \ + QUEUE_PREV(q) = (h); \ + QUEUE_NEXT_PREV(q) = (q); \ + QUEUE_NEXT(h) = (q); \ + } while (0) + +#define QUEUE_INSERT_TAIL(h, q) \ + do { \ + QUEUE_NEXT(q) = (h); \ + QUEUE_PREV(q) = QUEUE_PREV(h); \ + QUEUE_PREV_NEXT(q) = (q); \ + QUEUE_PREV(h) = (q); \ + } while (0) + +#define QUEUE_REMOVE(q) \ + do { \ + QUEUE_PREV_NEXT(q) = QUEUE_NEXT(q); \ + QUEUE_NEXT_PREV(q) = QUEUE_PREV(q); \ + } while (0) #endif /* QUEUE_H_ */ diff --git a/src/libuv/src/strscpy.h b/src/libuv/src/strscpy.h index cc78149db..97947d047 100644 --- a/src/libuv/src/strscpy.h +++ b/src/libuv/src/strscpy.h @@ -34,6 +34,6 @@ * * See https://www.kernel.org/doc/htmldocs/kernel-api/API-strscpy.html */ -ssize_t uv__strscpy(char* d, const char* s, size_t n); +ssize_t uv__strscpy(char *d, const char *s, size_t n); -#endif /* UV_STRSCPY_H_ */ +#endif /* UV_STRSCPY_H_ */ diff --git a/src/libuv/src/unix/atomic-ops.h b/src/libuv/src/unix/atomic-ops.h index c48d05843..41c44de17 100644 --- a/src/libuv/src/unix/atomic-ops.h +++ b/src/libuv/src/unix/atomic-ops.h @@ -16,30 +16,30 @@ #ifndef UV_ATOMIC_OPS_H_ #define UV_ATOMIC_OPS_H_ -#include "internal.h" /* UV_UNUSED */ +#include "internal.h" /* UV_UNUSED */ #if defined(__SUNPRO_C) || defined(__SUNPRO_CC) #include #endif -UV_UNUSED(static int cmpxchgi(int* ptr, int oldval, int newval)); +UV_UNUSED(static int cmpxchgi(int *ptr, int oldval, int newval)); UV_UNUSED(static void cpu_relax(void)); /* Prefer hand-rolled assembly over the gcc builtins because the latter also * issue full memory barriers. */ -UV_UNUSED(static int cmpxchgi(int* ptr, int oldval, int newval)) { +UV_UNUSED(static int cmpxchgi(int *ptr, int oldval, int newval)) { #if defined(__i386__) || defined(__x86_64__) int out; - __asm__ __volatile__ ("lock; cmpxchg %2, %1;" - : "=a" (out), "+m" (*(volatile int*) ptr) - : "r" (newval), "0" (oldval) - : "memory"); + __asm__ __volatile__("lock; cmpxchg %2, %1;" + : "=a"(out), "+m"(*(volatile int *)ptr) + : "r"(newval), "0"(oldval) + : "memory"); return out; #elif defined(__MVS__) unsigned int op4; - if (__plo_CSST(ptr, (unsigned int*) &oldval, newval, - (unsigned int*) ptr, *ptr, &op4)) + if (__plo_CSST(ptr, (unsigned int *)&oldval, newval, (unsigned int *)ptr, + *ptr, &op4)) return oldval; else return op4; @@ -52,12 +52,12 @@ UV_UNUSED(static int cmpxchgi(int* ptr, int oldval, int newval)) { UV_UNUSED(static void cpu_relax(void)) { #if defined(__i386__) || defined(__x86_64__) - __asm__ __volatile__ ("rep; nop" ::: "memory"); /* a.k.a. PAUSE */ + __asm__ __volatile__("rep; nop" ::: "memory"); /* a.k.a. PAUSE */ #elif (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__) - __asm__ __volatile__ ("yield" ::: "memory"); + __asm__ __volatile__("yield" ::: "memory"); #elif defined(__powerpc64__) || defined(__ppc64__) || defined(__PPC64__) - __asm__ __volatile__ ("or 1,1,1; or 2,2,2" ::: "memory"); + __asm__ __volatile__("or 1,1,1; or 2,2,2" ::: "memory"); #endif } -#endif /* UV_ATOMIC_OPS_H_ */ +#endif /* UV_ATOMIC_OPS_H_ */ diff --git a/src/libuv/src/unix/darwin-stub.h b/src/libuv/src/unix/darwin-stub.h index 433e3efa7..0570adb47 100644 --- a/src/libuv/src/unix/darwin-stub.h +++ b/src/libuv/src/unix/darwin-stub.h @@ -40,18 +40,18 @@ typedef struct FSEventStreamContext FSEventStreamContext; typedef uint32_t FSEventStreamCreateFlags; typedef uint64_t FSEventStreamEventId; typedef unsigned CFStringEncoding; -typedef void* CFAllocatorRef; -typedef void* CFArrayRef; -typedef void* CFBundleRef; -typedef void* CFDataRef; -typedef void* CFDictionaryRef; -typedef void* CFMutableDictionaryRef; +typedef void *CFAllocatorRef; +typedef void *CFArrayRef; +typedef void *CFBundleRef; +typedef void *CFDataRef; +typedef void *CFDictionaryRef; +typedef void *CFMutableDictionaryRef; typedef struct CFRange CFRange; -typedef void* CFRunLoopRef; -typedef void* CFRunLoopSourceRef; -typedef void* CFStringRef; -typedef void* CFTypeRef; -typedef void* FSEventStreamRef; +typedef void *CFRunLoopRef; +typedef void *CFRunLoopSourceRef; +typedef void *CFStringRef; +typedef void *CFTypeRef; +typedef void *FSEventStreamRef; typedef uint32_t IOOptionBits; typedef unsigned int io_iterator_t; @@ -59,25 +59,21 @@ typedef unsigned int io_object_t; typedef unsigned int io_service_t; typedef unsigned int io_registry_entry_t; - -typedef void (*FSEventStreamCallback)(const FSEventStreamRef, - void*, - size_t, - void*, - const FSEventStreamEventFlags*, - const FSEventStreamEventId*); +typedef void (*FSEventStreamCallback)(const FSEventStreamRef, void *, size_t, + void *, const FSEventStreamEventFlags *, + const FSEventStreamEventId *); struct CFRunLoopSourceContext { CFIndex version; - void* info; - void* pad[7]; - void (*perform)(void*); + void *info; + void *pad[7]; + void (*perform)(void *); }; struct FSEventStreamContext { CFIndex version; - void* info; - void* pad[3]; + void *info; + void *pad[3]; }; struct CFRange { @@ -110,4 +106,4 @@ static const int kFSEventStreamEventFlagRootChanged = 32; static const int kFSEventStreamEventFlagUnmount = 128; static const int kFSEventStreamEventFlagUserDropped = 2; -#endif /* UV_DARWIN_STUB_H_ */ +#endif /* UV_DARWIN_STUB_H_ */ diff --git a/src/libuv/src/unix/internal.h b/src/libuv/src/unix/internal.h index 12d4da936..b2ecb7f51 100644 --- a/src/libuv/src/unix/internal.h +++ b/src/libuv/src/unix/internal.h @@ -25,41 +25,41 @@ #include "uv-common.h" #include +#include +#include /* O_CLOEXEC and O_NONBLOCK, if supported. */ #include /* _POSIX_PATH_MAX, PATH_MAX */ +#include #include /* abort */ #include /* strrchr */ -#include /* O_CLOEXEC and O_NONBLOCK, if supported. */ -#include -#include #include #if defined(__STRICT_ANSI__) -# define inline __inline +#define inline __inline #endif #if defined(__linux__) -# include "linux-syscalls.h" +#include "linux-syscalls.h" #endif /* __linux__ */ #if defined(__MVS__) -# include "os390-syscalls.h" +#include "os390-syscalls.h" #endif /* __MVS__ */ #if defined(__sun) -# include -# include +#include +#include #endif /* __sun */ #if defined(_AIX) -# define reqevents events -# define rtnevents revents -# include +#define reqevents events +#define rtnevents revents +#include #else -# include +#include #endif /* _AIX */ #if defined(__APPLE__) && !TARGET_OS_IPHONE -# include +#include #endif /* @@ -68,69 +68,65 @@ * - gcc-7+ uses __SANITIZE_THREAD__ */ #if defined(__has_feature) -# if __has_feature(thread_sanitizer) -# define __SANITIZE_THREAD__ 1 -# endif +#if __has_feature(thread_sanitizer) +#define __SANITIZE_THREAD__ 1 +#endif #endif #if defined(PATH_MAX) -# define UV__PATH_MAX PATH_MAX +#define UV__PATH_MAX PATH_MAX #else -# define UV__PATH_MAX 8192 +#define UV__PATH_MAX 8192 #endif #if defined(__ANDROID__) -int uv__pthread_sigmask(int how, const sigset_t* set, sigset_t* oset); -# ifdef pthread_sigmask -# undef pthread_sigmask -# endif -# define pthread_sigmask(how, set, oldset) uv__pthread_sigmask(how, set, oldset) +int uv__pthread_sigmask(int how, const sigset_t *set, sigset_t *oset); +#ifdef pthread_sigmask +#undef pthread_sigmask +#endif +#define pthread_sigmask(how, set, oldset) uv__pthread_sigmask(how, set, oldset) #endif -#define ACCESS_ONCE(type, var) \ - (*(volatile type*) &(var)) +#define ACCESS_ONCE(type, var) (*(volatile type *)&(var)) -#define ROUND_UP(a, b) \ - ((a) % (b) ? ((a) + (b)) - ((a) % (b)) : (a)) +#define ROUND_UP(a, b) ((a) % (b) ? ((a) + (b)) - ((a) % (b)) : (a)) -#define UNREACHABLE() \ - do { \ - assert(0 && "unreachable code"); \ - abort(); \ - } \ - while (0) +#define UNREACHABLE() \ + do { \ + assert(0 && "unreachable code"); \ + abort(); \ + } while (0) -#define SAVE_ERRNO(block) \ - do { \ - int _saved_errno = errno; \ - do { block; } while (0); \ - errno = _saved_errno; \ - } \ - while (0) +#define SAVE_ERRNO(block) \ + do { \ + int _saved_errno = errno; \ + do { \ + block; \ + } while (0); \ + errno = _saved_errno; \ + } while (0) /* The __clang__ and __INTEL_COMPILER checks are superfluous because they * define __GNUC__. They are here to convey to you, dear reader, that these * macros are enabled when compiling with clang or icc. */ -#if defined(__clang__) || \ - defined(__GNUC__) || \ - defined(__INTEL_COMPILER) -# define UV_UNUSED(declaration) __attribute__((unused)) declaration +#if defined(__clang__) || defined(__GNUC__) || defined(__INTEL_COMPILER) +#define UV_UNUSED(declaration) __attribute__((unused)) declaration #else -# define UV_UNUSED(declaration) declaration +#define UV_UNUSED(declaration) declaration #endif /* Leans on the fact that, on Linux, POLLRDHUP == EPOLLRDHUP. */ #ifdef POLLRDHUP -# define UV__POLLRDHUP POLLRDHUP +#define UV__POLLRDHUP POLLRDHUP #else -# define UV__POLLRDHUP 0x2000 +#define UV__POLLRDHUP 0x2000 #endif #ifdef POLLPRI -# define UV__POLLPRI POLLPRI +#define UV__POLLPRI POLLPRI #else -# define UV__POLLPRI 0 +#define UV__POLLPRI 0 #endif #if !defined(O_CLOEXEC) && defined(__FreeBSD__) @@ -138,25 +134,20 @@ int uv__pthread_sigmask(int how, const sigset_t* set, sigset_t* oset); * It may be that we are just missing `__POSIX_VISIBLE >= 200809`. * Try using fixed value const and give up, if it doesn't work */ -# define O_CLOEXEC 0x00100000 +#define O_CLOEXEC 0x00100000 #endif typedef struct uv__stream_queued_fds_s uv__stream_queued_fds_t; /* loop flags */ -enum { - UV_LOOP_BLOCK_SIGPROF = 1 -}; +enum { UV_LOOP_BLOCK_SIGPROF = 1 }; /* flags of excluding ifaddr */ -enum { - UV__EXCLUDE_IFPHYS, - UV__EXCLUDE_IFADDR -}; +enum { UV__EXCLUDE_IFPHYS, UV__EXCLUDE_IFADDR }; typedef enum { - UV_CLOCK_PRECISE = 0, /* Use the highest resolution clock available. */ - UV_CLOCK_FAST = 1 /* Use the fastest clock with <= 1ms granularity. */ + UV_CLOCK_PRECISE = 0, /* Use the highest resolution clock available. */ + UV_CLOCK_FAST = 1 /* Use the fastest clock with <= 1ms granularity. */ } uv_clocktype_t; struct uv__stream_queued_fds_s { @@ -165,15 +156,9 @@ struct uv__stream_queued_fds_s { int fds[1]; }; - -#if defined(_AIX) || \ - defined(__APPLE__) || \ - defined(__DragonFly__) || \ - defined(__FreeBSD__) || \ - defined(__FreeBSD_kernel__) || \ - defined(__linux__) || \ - defined(__OpenBSD__) || \ - defined(__NetBSD__) +#if defined(_AIX) || defined(__APPLE__) || defined(__DragonFly__) || \ + defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ + defined(__linux__) || defined(__OpenBSD__) || defined(__NetBSD__) #define uv__cloexec uv__cloexec_ioctl #define uv__nonblock uv__nonblock_ioctl #define UV__NONBLOCK_IS_IOCTL 1 @@ -205,94 +190,92 @@ int uv__close_nocheckstdio(int fd); int uv__close_nocancel(int fd); int uv__socket(int domain, int type, int protocol); ssize_t uv__recvmsg(int fd, struct msghdr *msg, int flags); -void uv__make_close_pending(uv_handle_t* handle); +void uv__make_close_pending(uv_handle_t *handle); int uv__getiovmax(void); -void uv__io_init(uv__io_t* w, uv__io_cb cb, int fd); -void uv__io_start(uv_loop_t* loop, uv__io_t* w, unsigned int events); -void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events); -void uv__io_close(uv_loop_t* loop, uv__io_t* w); -void uv__io_feed(uv_loop_t* loop, uv__io_t* w); -int uv__io_active(const uv__io_t* w, unsigned int events); -int uv__io_check_fd(uv_loop_t* loop, int fd); -void uv__io_poll(uv_loop_t* loop, int timeout); /* in milliseconds or -1 */ -int uv__io_fork(uv_loop_t* loop); -int uv__fd_exists(uv_loop_t* loop, int fd); +void uv__io_init(uv__io_t *w, uv__io_cb cb, int fd); +void uv__io_start(uv_loop_t *loop, uv__io_t *w, unsigned int events); +void uv__io_stop(uv_loop_t *loop, uv__io_t *w, unsigned int events); +void uv__io_close(uv_loop_t *loop, uv__io_t *w); +void uv__io_feed(uv_loop_t *loop, uv__io_t *w); +int uv__io_active(const uv__io_t *w, unsigned int events); +int uv__io_check_fd(uv_loop_t *loop, int fd); +void uv__io_poll(uv_loop_t *loop, int timeout); /* in milliseconds or -1 */ +int uv__io_fork(uv_loop_t *loop); +int uv__fd_exists(uv_loop_t *loop, int fd); /* async */ -void uv__async_stop(uv_loop_t* loop); -int uv__async_fork(uv_loop_t* loop); - +void uv__async_stop(uv_loop_t *loop); +int uv__async_fork(uv_loop_t *loop); /* loop */ -void uv__run_idle(uv_loop_t* loop); -void uv__run_check(uv_loop_t* loop); -void uv__run_prepare(uv_loop_t* loop); +void uv__run_idle(uv_loop_t *loop); +void uv__run_check(uv_loop_t *loop); +void uv__run_prepare(uv_loop_t *loop); /* stream */ -void uv__stream_init(uv_loop_t* loop, uv_stream_t* stream, - uv_handle_type type); -int uv__stream_open(uv_stream_t*, int fd, int flags); -void uv__stream_destroy(uv_stream_t* stream); +void uv__stream_init(uv_loop_t *loop, uv_stream_t *stream, uv_handle_type type); +int uv__stream_open(uv_stream_t *, int fd, int flags); +void uv__stream_destroy(uv_stream_t *stream); #if defined(__APPLE__) -int uv__stream_try_select(uv_stream_t* stream, int* fd); +int uv__stream_try_select(uv_stream_t *stream, int *fd); #endif /* defined(__APPLE__) */ -void uv__server_io(uv_loop_t* loop, uv__io_t* w, unsigned int events); +void uv__server_io(uv_loop_t *loop, uv__io_t *w, unsigned int events); int uv__accept(int sockfd); int uv__dup2_cloexec(int oldfd, int newfd); -int uv__open_cloexec(const char* path, int flags); +int uv__open_cloexec(const char *path, int flags); /* tcp */ -int uv_tcp_listen(uv_tcp_t* tcp, int backlog, uv_connection_cb cb); +int uv_tcp_listen(uv_tcp_t *tcp, int backlog, uv_connection_cb cb); int uv__tcp_nodelay(int fd, int on); int uv__tcp_keepalive(int fd, int on, unsigned int delay); /* pipe */ -int uv_pipe_listen(uv_pipe_t* handle, int backlog, uv_connection_cb cb); +int uv_pipe_listen(uv_pipe_t *handle, int backlog, uv_connection_cb cb); /* signal */ -void uv__signal_close(uv_signal_t* handle); +void uv__signal_close(uv_signal_t *handle); void uv__signal_global_once_init(void); -void uv__signal_loop_cleanup(uv_loop_t* loop); -int uv__signal_loop_fork(uv_loop_t* loop); +void uv__signal_loop_cleanup(uv_loop_t *loop); +int uv__signal_loop_fork(uv_loop_t *loop); /* platform specific */ uint64_t uv__hrtime(uv_clocktype_t type); -int uv__kqueue_init(uv_loop_t* loop); -int uv__epoll_init(uv_loop_t* loop); -int uv__platform_loop_init(uv_loop_t* loop); -void uv__platform_loop_delete(uv_loop_t* loop); -void uv__platform_invalidate_fd(uv_loop_t* loop, int fd); +int uv__kqueue_init(uv_loop_t *loop); +int uv__epoll_init(uv_loop_t *loop); +int uv__platform_loop_init(uv_loop_t *loop); +void uv__platform_loop_delete(uv_loop_t *loop); +void uv__platform_invalidate_fd(uv_loop_t *loop, int fd); /* various */ -void uv__async_close(uv_async_t* handle); -void uv__check_close(uv_check_t* handle); -void uv__fs_event_close(uv_fs_event_t* handle); -void uv__idle_close(uv_idle_t* handle); -void uv__pipe_close(uv_pipe_t* handle); -void uv__poll_close(uv_poll_t* handle); -void uv__prepare_close(uv_prepare_t* handle); -void uv__process_close(uv_process_t* handle); -void uv__stream_close(uv_stream_t* handle); -void uv__tcp_close(uv_tcp_t* handle); +void uv__async_close(uv_async_t *handle); +void uv__check_close(uv_check_t *handle); +void uv__fs_event_close(uv_fs_event_t *handle); +void uv__idle_close(uv_idle_t *handle); +void uv__pipe_close(uv_pipe_t *handle); +void uv__poll_close(uv_poll_t *handle); +void uv__prepare_close(uv_prepare_t *handle); +void uv__process_close(uv_process_t *handle); +void uv__stream_close(uv_stream_t *handle); +void uv__tcp_close(uv_tcp_t *handle); size_t uv__thread_stack_size(void); -void uv__udp_close(uv_udp_t* handle); -void uv__udp_finish_close(uv_udp_t* handle); +void uv__udp_close(uv_udp_t *handle); +void uv__udp_finish_close(uv_udp_t *handle); uv_handle_type uv__handle_type(int fd); -FILE* uv__open_file(const char* path); -int uv__getpwuid_r(uv_passwd_t* pwd); -int uv__search_path(const char* prog, char* buf, size_t* buflen); +FILE *uv__open_file(const char *path); +int uv__getpwuid_r(uv_passwd_t *pwd); +int uv__search_path(const char *prog, char *buf, size_t *buflen); /* random */ -int uv__random_devurandom(void* buf, size_t buflen); -int uv__random_getrandom(void* buf, size_t buflen); -int uv__random_getentropy(void* buf, size_t buflen); -int uv__random_readpath(const char* path, void* buf, size_t buflen); -int uv__random_sysctl(void* buf, size_t buflen); +int uv__random_devurandom(void *buf, size_t buflen); +int uv__random_getrandom(void *buf, size_t buflen); +int uv__random_getentropy(void *buf, size_t buflen); +int uv__random_readpath(const char *path, void *buf, size_t buflen); +int uv__random_sysctl(void *buf, size_t buflen); #if defined(__APPLE__) -int uv___stream_fd(const uv_stream_t* handle); -#define uv__stream_fd(handle) (uv___stream_fd((const uv_stream_t*) (handle))) +int uv___stream_fd(const uv_stream_t *handle); +#define uv__stream_fd(handle) (uv___stream_fd((const uv_stream_t *)(handle))) #else #define uv__stream_fd(handle) ((handle)->io_watcher.fd) #endif /* defined(__APPLE__) */ @@ -301,60 +284,55 @@ int uv__make_pipe(int fds[2], int flags); #if defined(__APPLE__) -int uv__fsevents_init(uv_fs_event_t* handle); -int uv__fsevents_close(uv_fs_event_t* handle); -void uv__fsevents_loop_delete(uv_loop_t* loop); +int uv__fsevents_init(uv_fs_event_t *handle); +int uv__fsevents_close(uv_fs_event_t *handle); +void uv__fsevents_loop_delete(uv_loop_t *loop); #endif /* defined(__APPLE__) */ -UV_UNUSED(static void uv__update_time(uv_loop_t* loop)) { +UV_UNUSED(static void uv__update_time(uv_loop_t *loop)) { /* Use a fast time source if available. We only need millisecond precision. */ loop->time = uv__hrtime(UV_CLOCK_FAST) / 1000000; } -UV_UNUSED(static char* uv__basename_r(const char* path)) { - char* s; +UV_UNUSED(static char *uv__basename_r(const char *path)) { + char *s; s = strrchr(path, '/'); if (s == NULL) - return (char*) path; + return (char *)path; return s + 1; } #if defined(__linux__) -int uv__inotify_fork(uv_loop_t* loop, void* old_watchers); +int uv__inotify_fork(uv_loop_t *loop, void *old_watchers); #endif -typedef int (*uv__peersockfunc)(int, struct sockaddr*, socklen_t*); +typedef int (*uv__peersockfunc)(int, struct sockaddr *, socklen_t *); -int uv__getsockpeername(const uv_handle_t* handle, - uv__peersockfunc func, - struct sockaddr* name, - int* namelen); +int uv__getsockpeername(const uv_handle_t *handle, uv__peersockfunc func, + struct sockaddr *name, int *namelen); -#if defined(__linux__) || \ - defined(__FreeBSD__) || \ - defined(__FreeBSD_kernel__) || \ - defined(__DragonFly__) +#if defined(__linux__) || defined(__FreeBSD__) || \ + defined(__FreeBSD_kernel__) || defined(__DragonFly__) #define HAVE_MMSG 1 struct uv__mmsghdr { struct msghdr msg_hdr; unsigned int msg_len; }; -int uv__recvmmsg(int fd, struct uv__mmsghdr* mmsg, unsigned int vlen); -int uv__sendmmsg(int fd, struct uv__mmsghdr* mmsg, unsigned int vlen); +int uv__recvmmsg(int fd, struct uv__mmsghdr *mmsg, unsigned int vlen); +int uv__sendmmsg(int fd, struct uv__mmsghdr *mmsg, unsigned int vlen); #else #define HAVE_MMSG 0 #endif #if defined(__sun) #if !defined(_POSIX_VERSION) || _POSIX_VERSION < 200809L -size_t strnlen(const char* s, size_t maxlen); +size_t strnlen(const char *s, size_t maxlen); #endif #endif - #endif /* UV_UNIX_INTERNAL_H_ */ diff --git a/src/libuv/src/unix/linux-syscalls.h b/src/libuv/src/unix/linux-syscalls.h index b4d9082d4..6e93db66c 100644 --- a/src/libuv/src/unix/linux-syscalls.h +++ b/src/libuv/src/unix/linux-syscalls.h @@ -22,11 +22,11 @@ #ifndef UV_LINUX_SYSCALL_H_ #define UV_LINUX_SYSCALL_H_ -#include #include -#include -#include +#include #include +#include +#include struct uv__statx_timestamp { int64_t tv_sec; @@ -59,20 +59,13 @@ struct uv__statx { }; ssize_t uv__preadv(int fd, const struct iovec *iov, int iovcnt, int64_t offset); -ssize_t uv__pwritev(int fd, const struct iovec *iov, int iovcnt, int64_t offset); +ssize_t uv__pwritev(int fd, const struct iovec *iov, int iovcnt, + int64_t offset); int uv__dup3(int oldfd, int newfd, int flags); -ssize_t -uv__fs_copy_file_range(int fd_in, - off_t* off_in, - int fd_out, - off_t* off_out, - size_t len, - unsigned int flags); -int uv__statx(int dirfd, - const char* path, - int flags, - unsigned int mask, - struct uv__statx* statxbuf); -ssize_t uv__getrandom(void* buf, size_t buflen, unsigned flags); +ssize_t uv__fs_copy_file_range(int fd_in, off_t *off_in, int fd_out, + off_t *off_out, size_t len, unsigned int flags); +int uv__statx(int dirfd, const char *path, int flags, unsigned int mask, + struct uv__statx *statxbuf); +ssize_t uv__getrandom(void *buf, size_t buflen, unsigned flags); #endif /* UV_LINUX_SYSCALL_H_ */ diff --git a/src/libuv/src/unix/os390-syscalls.h b/src/libuv/src/unix/os390-syscalls.h index 9f504171d..ca6df115c 100644 --- a/src/libuv/src/unix/os390-syscalls.h +++ b/src/libuv/src/unix/os390-syscalls.h @@ -19,24 +19,23 @@ * IN THE SOFTWARE. */ - #ifndef UV_OS390_SYSCALL_H_ #define UV_OS390_SYSCALL_H_ -#include "uv.h" #include "internal.h" +#include "uv.h" +#include "zos-base.h" #include #include #include -#include "zos-base.h" -#define EPOLL_CTL_ADD 1 -#define EPOLL_CTL_DEL 2 -#define EPOLL_CTL_MOD 3 -#define MAX_EPOLL_INSTANCES 256 -#define MAX_ITEMS_PER_EPOLL 1024 +#define EPOLL_CTL_ADD 1 +#define EPOLL_CTL_DEL 2 +#define EPOLL_CTL_MOD 3 +#define MAX_EPOLL_INSTANCES 256 +#define MAX_ITEMS_PER_EPOLL 1024 -#define UV__O_CLOEXEC 0x80000 +#define UV__O_CLOEXEC 0x80000 struct epoll_event { int events; @@ -46,30 +45,30 @@ struct epoll_event { typedef struct { QUEUE member; - struct pollfd* items; + struct pollfd *items; unsigned long size; int msg_queue; } uv__os390_epoll; /* epoll api */ -uv__os390_epoll* epoll_create1(int flags); -int epoll_ctl(uv__os390_epoll* ep, int op, int fd, struct epoll_event *event); -int epoll_wait(uv__os390_epoll* ep, struct epoll_event *events, int maxevents, int timeout); +uv__os390_epoll *epoll_create1(int flags); +int epoll_ctl(uv__os390_epoll *ep, int op, int fd, struct epoll_event *event); +int epoll_wait(uv__os390_epoll *ep, struct epoll_event *events, int maxevents, + int timeout); int epoll_file_close(int fd); /* utility functions */ -int scandir(const char* maindir, struct dirent*** namelist, +int scandir(const char *maindir, struct dirent ***namelist, int (*filter)(const struct dirent *), - int (*compar)(const struct dirent **, - const struct dirent **)); -char *mkdtemp(char* path); -ssize_t os390_readlink(const char* path, char* buf, size_t len); -size_t strnlen(const char* str, size_t maxlen); -int sem_init(UV_PLATFORM_SEM_T* semid, int pshared, unsigned int value); -int sem_destroy(UV_PLATFORM_SEM_T* semid); -int sem_post(UV_PLATFORM_SEM_T* semid); -int sem_trywait(UV_PLATFORM_SEM_T* semid); -int sem_wait(UV_PLATFORM_SEM_T* semid); + int (*compar)(const struct dirent **, const struct dirent **)); +char *mkdtemp(char *path); +ssize_t os390_readlink(const char *path, char *buf, size_t len); +size_t strnlen(const char *str, size_t maxlen); +int sem_init(UV_PLATFORM_SEM_T *semid, int pshared, unsigned int value); +int sem_destroy(UV_PLATFORM_SEM_T *semid); +int sem_post(UV_PLATFORM_SEM_T *semid); +int sem_trywait(UV_PLATFORM_SEM_T *semid); +int sem_wait(UV_PLATFORM_SEM_T *semid); void uv__os390_cleanup(void); #endif /* UV_OS390_SYSCALL_H_ */ diff --git a/src/libuv/src/unix/spinlock.h b/src/libuv/src/unix/spinlock.h index a20c83cc6..ab24d8f85 100644 --- a/src/libuv/src/unix/spinlock.h +++ b/src/libuv/src/unix/spinlock.h @@ -16,33 +16,34 @@ #ifndef UV_SPINLOCK_H_ #define UV_SPINLOCK_H_ -#include "internal.h" /* ACCESS_ONCE, UV_UNUSED */ #include "atomic-ops.h" +#include "internal.h" /* ACCESS_ONCE, UV_UNUSED */ -#define UV_SPINLOCK_INITIALIZER { 0 } +#define UV_SPINLOCK_INITIALIZER {0} typedef struct { int lock; } uv_spinlock_t; -UV_UNUSED(static void uv_spinlock_init(uv_spinlock_t* spinlock)); -UV_UNUSED(static void uv_spinlock_lock(uv_spinlock_t* spinlock)); -UV_UNUSED(static void uv_spinlock_unlock(uv_spinlock_t* spinlock)); -UV_UNUSED(static int uv_spinlock_trylock(uv_spinlock_t* spinlock)); +UV_UNUSED(static void uv_spinlock_init(uv_spinlock_t *spinlock)); +UV_UNUSED(static void uv_spinlock_lock(uv_spinlock_t *spinlock)); +UV_UNUSED(static void uv_spinlock_unlock(uv_spinlock_t *spinlock)); +UV_UNUSED(static int uv_spinlock_trylock(uv_spinlock_t *spinlock)); -UV_UNUSED(static void uv_spinlock_init(uv_spinlock_t* spinlock)) { +UV_UNUSED(static void uv_spinlock_init(uv_spinlock_t *spinlock)) { ACCESS_ONCE(int, spinlock->lock) = 0; } -UV_UNUSED(static void uv_spinlock_lock(uv_spinlock_t* spinlock)) { - while (!uv_spinlock_trylock(spinlock)) cpu_relax(); +UV_UNUSED(static void uv_spinlock_lock(uv_spinlock_t *spinlock)) { + while (!uv_spinlock_trylock(spinlock)) + cpu_relax(); } -UV_UNUSED(static void uv_spinlock_unlock(uv_spinlock_t* spinlock)) { +UV_UNUSED(static void uv_spinlock_unlock(uv_spinlock_t *spinlock)) { ACCESS_ONCE(int, spinlock->lock) = 0; } -UV_UNUSED(static int uv_spinlock_trylock(uv_spinlock_t* spinlock)) { +UV_UNUSED(static int uv_spinlock_trylock(uv_spinlock_t *spinlock)) { /* TODO(bnoordhuis) Maybe change to a ticket lock to guarantee fair queueing. * Not really critical until we have locks that are (frequently) contended * for by several threads. @@ -50,4 +51,4 @@ UV_UNUSED(static int uv_spinlock_trylock(uv_spinlock_t* spinlock)) { return 0 == cmpxchgi(&spinlock->lock, 0, 1); } -#endif /* UV_SPINLOCK_H_ */ +#endif /* UV_SPINLOCK_H_ */ diff --git a/src/libuv/src/uv-common.h b/src/libuv/src/uv-common.h index 8a190bf8f..adc5f0cdb 100644 --- a/src/libuv/src/uv-common.h +++ b/src/libuv/src/uv-common.h @@ -32,32 +32,32 @@ #include #if defined(_MSC_VER) && _MSC_VER < 1600 -# include "uv/stdint-msvc2008.h" +#include "uv/stdint-msvc2008.h" #else -# include +#include #endif -#include "uv.h" -#include "uv/tree.h" #include "queue.h" #include "strscpy.h" +#include "uv.h" +#include "uv/tree.h" #if EDOM > 0 -# define UV__ERR(x) (-(x)) +#define UV__ERR(x) (-(x)) #else -# define UV__ERR(x) (x) +#define UV__ERR(x) (x) #endif #if !defined(snprintf) && defined(_MSC_VER) && _MSC_VER < 1900 -extern int snprintf(char*, size_t, const char*, ...); +extern int snprintf(char *, size_t, const char *, ...); #endif #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) -#define container_of(ptr, type, member) \ - ((type *) ((char *) (ptr) - offsetof(type, member))) +#define container_of(ptr, type, member) \ + ((type *)((char *)(ptr) - offsetof(type, member))) -#define STATIC_ASSERT(expr) \ +#define STATIC_ASSERT(expr) \ void uv__static_assert(int static_assert_failed[1 - 2 * !(expr)]) #if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 7) @@ -65,7 +65,10 @@ extern int snprintf(char*, size_t, const char*, ...); #define uv__store_relaxed(p, v) __atomic_store_n(p, v, __ATOMIC_RELAXED) #else #define uv__load_relaxed(p) (*p) -#define uv__store_relaxed(p, v) do *p = v; while (0) +#define uv__store_relaxed(p, v) \ + do \ + *p = v; \ + while (0) #endif #define UV__UDP_DGRAM_MAXSIZE (64 * 1024) @@ -73,285 +76,257 @@ extern int snprintf(char*, size_t, const char*, ...); /* Handle flags. Some flags are specific to Windows or UNIX. */ enum { /* Used by all handles. */ - UV_HANDLE_CLOSING = 0x00000001, - UV_HANDLE_CLOSED = 0x00000002, - UV_HANDLE_ACTIVE = 0x00000004, - UV_HANDLE_REF = 0x00000008, - UV_HANDLE_INTERNAL = 0x00000010, - UV_HANDLE_ENDGAME_QUEUED = 0x00000020, + UV_HANDLE_CLOSING = 0x00000001, + UV_HANDLE_CLOSED = 0x00000002, + UV_HANDLE_ACTIVE = 0x00000004, + UV_HANDLE_REF = 0x00000008, + UV_HANDLE_INTERNAL = 0x00000010, + UV_HANDLE_ENDGAME_QUEUED = 0x00000020, /* Used by streams. */ - UV_HANDLE_LISTENING = 0x00000040, - UV_HANDLE_CONNECTION = 0x00000080, - UV_HANDLE_SHUTTING = 0x00000100, - UV_HANDLE_SHUT = 0x00000200, - UV_HANDLE_READ_PARTIAL = 0x00000400, - UV_HANDLE_READ_EOF = 0x00000800, + UV_HANDLE_LISTENING = 0x00000040, + UV_HANDLE_CONNECTION = 0x00000080, + UV_HANDLE_SHUTTING = 0x00000100, + UV_HANDLE_SHUT = 0x00000200, + UV_HANDLE_READ_PARTIAL = 0x00000400, + UV_HANDLE_READ_EOF = 0x00000800, /* Used by streams and UDP handles. */ - UV_HANDLE_READING = 0x00001000, - UV_HANDLE_BOUND = 0x00002000, - UV_HANDLE_READABLE = 0x00004000, - UV_HANDLE_WRITABLE = 0x00008000, - UV_HANDLE_READ_PENDING = 0x00010000, - UV_HANDLE_SYNC_BYPASS_IOCP = 0x00020000, - UV_HANDLE_ZERO_READ = 0x00040000, - UV_HANDLE_EMULATE_IOCP = 0x00080000, - UV_HANDLE_BLOCKING_WRITES = 0x00100000, - UV_HANDLE_CANCELLATION_PENDING = 0x00200000, + UV_HANDLE_READING = 0x00001000, + UV_HANDLE_BOUND = 0x00002000, + UV_HANDLE_READABLE = 0x00004000, + UV_HANDLE_WRITABLE = 0x00008000, + UV_HANDLE_READ_PENDING = 0x00010000, + UV_HANDLE_SYNC_BYPASS_IOCP = 0x00020000, + UV_HANDLE_ZERO_READ = 0x00040000, + UV_HANDLE_EMULATE_IOCP = 0x00080000, + UV_HANDLE_BLOCKING_WRITES = 0x00100000, + UV_HANDLE_CANCELLATION_PENDING = 0x00200000, /* Used by uv_tcp_t and uv_udp_t handles */ - UV_HANDLE_IPV6 = 0x00400000, + UV_HANDLE_IPV6 = 0x00400000, /* Only used by uv_tcp_t handles. */ - UV_HANDLE_TCP_NODELAY = 0x01000000, - UV_HANDLE_TCP_KEEPALIVE = 0x02000000, - UV_HANDLE_TCP_SINGLE_ACCEPT = 0x04000000, - UV_HANDLE_TCP_ACCEPT_STATE_CHANGING = 0x08000000, - UV_HANDLE_SHARED_TCP_SOCKET = 0x10000000, + UV_HANDLE_TCP_NODELAY = 0x01000000, + UV_HANDLE_TCP_KEEPALIVE = 0x02000000, + UV_HANDLE_TCP_SINGLE_ACCEPT = 0x04000000, + UV_HANDLE_TCP_ACCEPT_STATE_CHANGING = 0x08000000, + UV_HANDLE_SHARED_TCP_SOCKET = 0x10000000, /* Only used by uv_udp_t handles. */ - UV_HANDLE_UDP_PROCESSING = 0x01000000, - UV_HANDLE_UDP_CONNECTED = 0x02000000, - UV_HANDLE_UDP_RECVMMSG = 0x04000000, + UV_HANDLE_UDP_PROCESSING = 0x01000000, + UV_HANDLE_UDP_CONNECTED = 0x02000000, + UV_HANDLE_UDP_RECVMMSG = 0x04000000, /* Only used by uv_pipe_t handles. */ - UV_HANDLE_NON_OVERLAPPED_PIPE = 0x01000000, - UV_HANDLE_PIPESERVER = 0x02000000, + UV_HANDLE_NON_OVERLAPPED_PIPE = 0x01000000, + UV_HANDLE_PIPESERVER = 0x02000000, /* Only used by uv_tty_t handles. */ - UV_HANDLE_TTY_READABLE = 0x01000000, - UV_HANDLE_TTY_RAW = 0x02000000, - UV_HANDLE_TTY_SAVED_POSITION = 0x04000000, - UV_HANDLE_TTY_SAVED_ATTRIBUTES = 0x08000000, + UV_HANDLE_TTY_READABLE = 0x01000000, + UV_HANDLE_TTY_RAW = 0x02000000, + UV_HANDLE_TTY_SAVED_POSITION = 0x04000000, + UV_HANDLE_TTY_SAVED_ATTRIBUTES = 0x08000000, /* Only used by uv_signal_t handles. */ - UV_SIGNAL_ONE_SHOT_DISPATCHED = 0x01000000, - UV_SIGNAL_ONE_SHOT = 0x02000000, + UV_SIGNAL_ONE_SHOT_DISPATCHED = 0x01000000, + UV_SIGNAL_ONE_SHOT = 0x02000000, /* Only used by uv_poll_t handles. */ - UV_HANDLE_POLL_SLOW = 0x01000000 + UV_HANDLE_POLL_SLOW = 0x01000000 }; -int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap); +int uv__loop_configure(uv_loop_t *loop, uv_loop_option option, va_list ap); -void uv__loop_close(uv_loop_t* loop); +void uv__loop_close(uv_loop_t *loop); -int uv__read_start(uv_stream_t* stream, - uv_alloc_cb alloc_cb, +int uv__read_start(uv_stream_t *stream, uv_alloc_cb alloc_cb, uv_read_cb read_cb); -int uv__tcp_bind(uv_tcp_t* tcp, - const struct sockaddr* addr, - unsigned int addrlen, - unsigned int flags); +int uv__tcp_bind(uv_tcp_t *tcp, const struct sockaddr *addr, + unsigned int addrlen, unsigned int flags); -int uv__tcp_connect(uv_connect_t* req, - uv_tcp_t* handle, - const struct sockaddr* addr, - unsigned int addrlen, - uv_connect_cb cb); +int uv__tcp_connect(uv_connect_t *req, uv_tcp_t *handle, + const struct sockaddr *addr, unsigned int addrlen, + uv_connect_cb cb); -int uv__udp_init_ex(uv_loop_t* loop, - uv_udp_t* handle, - unsigned flags, +int uv__udp_init_ex(uv_loop_t *loop, uv_udp_t *handle, unsigned flags, int domain); -int uv__udp_bind(uv_udp_t* handle, - const struct sockaddr* addr, - unsigned int addrlen, - unsigned int flags); +int uv__udp_bind(uv_udp_t *handle, const struct sockaddr *addr, + unsigned int addrlen, unsigned int flags); -int uv__udp_connect(uv_udp_t* handle, - const struct sockaddr* addr, +int uv__udp_connect(uv_udp_t *handle, const struct sockaddr *addr, unsigned int addrlen); -int uv__udp_disconnect(uv_udp_t* handle); +int uv__udp_disconnect(uv_udp_t *handle); -int uv__udp_is_connected(uv_udp_t* handle); +int uv__udp_is_connected(uv_udp_t *handle); -int uv__udp_send(uv_udp_send_t* req, - uv_udp_t* handle, - const uv_buf_t bufs[], - unsigned int nbufs, - const struct sockaddr* addr, - unsigned int addrlen, - uv_udp_send_cb send_cb); +int uv__udp_send(uv_udp_send_t *req, uv_udp_t *handle, const uv_buf_t bufs[], + unsigned int nbufs, const struct sockaddr *addr, + unsigned int addrlen, uv_udp_send_cb send_cb); -int uv__udp_try_send(uv_udp_t* handle, - const uv_buf_t bufs[], - unsigned int nbufs, - const struct sockaddr* addr, +int uv__udp_try_send(uv_udp_t *handle, const uv_buf_t bufs[], + unsigned int nbufs, const struct sockaddr *addr, unsigned int addrlen); -int uv__udp_recv_start(uv_udp_t* handle, uv_alloc_cb alloccb, +int uv__udp_recv_start(uv_udp_t *handle, uv_alloc_cb alloccb, uv_udp_recv_cb recv_cb); -int uv__udp_recv_stop(uv_udp_t* handle); +int uv__udp_recv_stop(uv_udp_t *handle); -void uv__fs_poll_close(uv_fs_poll_t* handle); +void uv__fs_poll_close(uv_fs_poll_t *handle); -int uv__getaddrinfo_translate_error(int sys_err); /* EAI_* error. */ +int uv__getaddrinfo_translate_error(int sys_err); /* EAI_* error. */ -enum uv__work_kind { - UV__WORK_CPU, - UV__WORK_FAST_IO, - UV__WORK_SLOW_IO -}; +enum uv__work_kind { UV__WORK_CPU, UV__WORK_FAST_IO, UV__WORK_SLOW_IO }; -void uv__work_submit(uv_loop_t* loop, - struct uv__work *w, - enum uv__work_kind kind, - void (*work)(struct uv__work *w), +void uv__work_submit(uv_loop_t *loop, struct uv__work *w, + enum uv__work_kind kind, void (*work)(struct uv__work *w), void (*done)(struct uv__work *w, int status)); -void uv__work_done(uv_async_t* handle); +void uv__work_done(uv_async_t *handle); size_t uv__count_bufs(const uv_buf_t bufs[], unsigned int nbufs); -int uv__socket_sockopt(uv_handle_t* handle, int optname, int* value); +int uv__socket_sockopt(uv_handle_t *handle, int optname, int *value); -void uv__fs_scandir_cleanup(uv_fs_t* req); -void uv__fs_readdir_cleanup(uv_fs_t* req); -uv_dirent_type_t uv__fs_get_dirent_type(uv__dirent_t* dent); +void uv__fs_scandir_cleanup(uv_fs_t *req); +void uv__fs_readdir_cleanup(uv_fs_t *req); +uv_dirent_type_t uv__fs_get_dirent_type(uv__dirent_t *dent); -int uv__next_timeout(const uv_loop_t* loop); -void uv__run_timers(uv_loop_t* loop); -void uv__timer_close(uv_timer_t* handle); +int uv__next_timeout(const uv_loop_t *loop); +void uv__run_timers(uv_loop_t *loop); +void uv__timer_close(uv_timer_t *handle); void uv__process_title_cleanup(void); void uv__signal_cleanup(void); void uv__threadpool_cleanup(void); -#define uv__has_active_reqs(loop) \ - ((loop)->active_reqs.count > 0) +#define uv__has_active_reqs(loop) ((loop)->active_reqs.count > 0) -#define uv__req_register(loop, req) \ - do { \ - (loop)->active_reqs.count++; \ - } \ - while (0) +#define uv__req_register(loop, req) \ + do { \ + (loop)->active_reqs.count++; \ + } while (0) -#define uv__req_unregister(loop, req) \ - do { \ - assert(uv__has_active_reqs(loop)); \ - (loop)->active_reqs.count--; \ - } \ - while (0) +#define uv__req_unregister(loop, req) \ + do { \ + assert(uv__has_active_reqs(loop)); \ + (loop)->active_reqs.count--; \ + } while (0) -#define uv__has_active_handles(loop) \ - ((loop)->active_handles > 0) +#define uv__has_active_handles(loop) ((loop)->active_handles > 0) -#define uv__active_handle_add(h) \ - do { \ - (h)->loop->active_handles++; \ - } \ - while (0) +#define uv__active_handle_add(h) \ + do { \ + (h)->loop->active_handles++; \ + } while (0) -#define uv__active_handle_rm(h) \ - do { \ - (h)->loop->active_handles--; \ - } \ - while (0) +#define uv__active_handle_rm(h) \ + do { \ + (h)->loop->active_handles--; \ + } while (0) -#define uv__is_active(h) \ - (((h)->flags & UV_HANDLE_ACTIVE) != 0) +#define uv__is_active(h) (((h)->flags & UV_HANDLE_ACTIVE) != 0) -#define uv__is_closing(h) \ +#define uv__is_closing(h) \ (((h)->flags & (UV_HANDLE_CLOSING | UV_HANDLE_CLOSED)) != 0) -#define uv__handle_start(h) \ - do { \ - if (((h)->flags & UV_HANDLE_ACTIVE) != 0) break; \ - (h)->flags |= UV_HANDLE_ACTIVE; \ - if (((h)->flags & UV_HANDLE_REF) != 0) uv__active_handle_add(h); \ - } \ - while (0) - -#define uv__handle_stop(h) \ - do { \ - if (((h)->flags & UV_HANDLE_ACTIVE) == 0) break; \ - (h)->flags &= ~UV_HANDLE_ACTIVE; \ - if (((h)->flags & UV_HANDLE_REF) != 0) uv__active_handle_rm(h); \ - } \ - while (0) - -#define uv__handle_ref(h) \ - do { \ - if (((h)->flags & UV_HANDLE_REF) != 0) break; \ - (h)->flags |= UV_HANDLE_REF; \ - if (((h)->flags & UV_HANDLE_CLOSING) != 0) break; \ - if (((h)->flags & UV_HANDLE_ACTIVE) != 0) uv__active_handle_add(h); \ - } \ - while (0) - -#define uv__handle_unref(h) \ - do { \ - if (((h)->flags & UV_HANDLE_REF) == 0) break; \ - (h)->flags &= ~UV_HANDLE_REF; \ - if (((h)->flags & UV_HANDLE_CLOSING) != 0) break; \ - if (((h)->flags & UV_HANDLE_ACTIVE) != 0) uv__active_handle_rm(h); \ - } \ - while (0) - -#define uv__has_ref(h) \ - (((h)->flags & UV_HANDLE_REF) != 0) +#define uv__handle_start(h) \ + do { \ + if (((h)->flags & UV_HANDLE_ACTIVE) != 0) \ + break; \ + (h)->flags |= UV_HANDLE_ACTIVE; \ + if (((h)->flags & UV_HANDLE_REF) != 0) \ + uv__active_handle_add(h); \ + } while (0) + +#define uv__handle_stop(h) \ + do { \ + if (((h)->flags & UV_HANDLE_ACTIVE) == 0) \ + break; \ + (h)->flags &= ~UV_HANDLE_ACTIVE; \ + if (((h)->flags & UV_HANDLE_REF) != 0) \ + uv__active_handle_rm(h); \ + } while (0) + +#define uv__handle_ref(h) \ + do { \ + if (((h)->flags & UV_HANDLE_REF) != 0) \ + break; \ + (h)->flags |= UV_HANDLE_REF; \ + if (((h)->flags & UV_HANDLE_CLOSING) != 0) \ + break; \ + if (((h)->flags & UV_HANDLE_ACTIVE) != 0) \ + uv__active_handle_add(h); \ + } while (0) + +#define uv__handle_unref(h) \ + do { \ + if (((h)->flags & UV_HANDLE_REF) == 0) \ + break; \ + (h)->flags &= ~UV_HANDLE_REF; \ + if (((h)->flags & UV_HANDLE_CLOSING) != 0) \ + break; \ + if (((h)->flags & UV_HANDLE_ACTIVE) != 0) \ + uv__active_handle_rm(h); \ + } while (0) + +#define uv__has_ref(h) (((h)->flags & UV_HANDLE_REF) != 0) #if defined(_WIN32) -# define uv__handle_platform_init(h) ((h)->u.fd = -1) +#define uv__handle_platform_init(h) ((h)->u.fd = -1) #else -# define uv__handle_platform_init(h) ((h)->next_closing = NULL) +#define uv__handle_platform_init(h) ((h)->next_closing = NULL) #endif -#define uv__handle_init(loop_, h, type_) \ - do { \ - (h)->loop = (loop_); \ - (h)->type = (type_); \ - (h)->flags = UV_HANDLE_REF; /* Ref the loop when active. */ \ - QUEUE_INSERT_TAIL(&(loop_)->handle_queue, &(h)->handle_queue); \ - uv__handle_platform_init(h); \ - } \ - while (0) +#define uv__handle_init(loop_, h, type_) \ + do { \ + (h)->loop = (loop_); \ + (h)->type = (type_); \ + (h)->flags = UV_HANDLE_REF; /* Ref the loop when active. */ \ + QUEUE_INSERT_TAIL(&(loop_)->handle_queue, &(h)->handle_queue); \ + uv__handle_platform_init(h); \ + } while (0) /* Note: uses an open-coded version of SET_REQ_SUCCESS() because of * a circular dependency between src/uv-common.h and src/win/internal.h. */ #if defined(_WIN32) -# define UV_REQ_INIT(req, typ) \ - do { \ - (req)->type = (typ); \ - (req)->u.io.overlapped.Internal = 0; /* SET_REQ_SUCCESS() */ \ - } \ - while (0) +#define UV_REQ_INIT(req, typ) \ + do { \ + (req)->type = (typ); \ + (req)->u.io.overlapped.Internal = 0; /* SET_REQ_SUCCESS() */ \ + } while (0) #else -# define UV_REQ_INIT(req, typ) \ - do { \ - (req)->type = (typ); \ - } \ - while (0) +#define UV_REQ_INIT(req, typ) \ + do { \ + (req)->type = (typ); \ + } while (0) #endif -#define uv__req_init(loop, req, typ) \ - do { \ - UV_REQ_INIT(req, typ); \ - uv__req_register(loop, req); \ - } \ - while (0) +#define uv__req_init(loop, req, typ) \ + do { \ + UV_REQ_INIT(req, typ); \ + uv__req_register(loop, req); \ + } while (0) -#define uv__get_internal_fields(loop) \ - ((uv__loop_internal_fields_t*) loop->internal_fields) +#define uv__get_internal_fields(loop) \ + ((uv__loop_internal_fields_t *)loop->internal_fields) -#define uv__get_loop_metrics(loop) \ +#define uv__get_loop_metrics(loop) \ (&uv__get_internal_fields(loop)->loop_metrics) /* Allocator prototypes */ void *uv__calloc(size_t count, size_t size); -char *uv__strdup(const char* s); -char *uv__strndup(const char* s, size_t n); -void* uv__malloc(size_t size); -void uv__free(void* ptr); -void* uv__realloc(void* ptr, size_t size); -void* uv__reallocf(void* ptr, size_t size); +char *uv__strdup(const char *s); +char *uv__strndup(const char *s, size_t n); +void *uv__malloc(size_t size); +void uv__free(void *ptr); +void *uv__realloc(void *ptr, size_t size); +void *uv__reallocf(void *ptr, size_t size); typedef struct uv__loop_metrics_s uv__loop_metrics_t; typedef struct uv__loop_internal_fields_s uv__loop_internal_fields_t; @@ -362,8 +337,8 @@ struct uv__loop_metrics_s { uv_mutex_t lock; }; -void uv__metrics_update_idle_time(uv_loop_t* loop); -void uv__metrics_set_provider_entry_time(uv_loop_t* loop); +void uv__metrics_update_idle_time(uv_loop_t *loop); +void uv__metrics_set_provider_entry_time(uv_loop_t *loop); struct uv__loop_internal_fields_s { unsigned int flags; diff --git a/src/libuv/src/win/atomicops-inl.h b/src/libuv/src/win/atomicops-inl.h index 2f984c6db..3ada875c4 100644 --- a/src/libuv/src/win/atomicops-inl.h +++ b/src/libuv/src/win/atomicops-inl.h @@ -22,9 +22,8 @@ #ifndef UV_WIN_ATOMICOPS_INL_H_ #define UV_WIN_ATOMICOPS_INL_H_ -#include "uv.h" #include "internal.h" - +#include "uv.h" /* Atomic set operation on char */ #ifdef _MSC_VER /* MSVC */ @@ -35,21 +34,21 @@ * aligned. */ #pragma intrinsic(_InterlockedOr8) -static char INLINE uv__atomic_exchange_set(char volatile* target) { +static char INLINE uv__atomic_exchange_set(char volatile *target) { return _InterlockedOr8(target, 1); } #else /* GCC, Clang in mingw mode */ -static inline char uv__atomic_exchange_set(char volatile* target) { +static inline char uv__atomic_exchange_set(char volatile *target) { #if defined(__i386__) || defined(__x86_64__) /* Mingw-32 version, hopefully this works for 64-bit gcc as well. */ const char one = 1; char old_value; - __asm__ __volatile__ ("lock xchgb %0, %1\n\t" - : "=r"(old_value), "=m"(*target) - : "0"(one), "m"(*target) - : "memory"); + __asm__ __volatile__("lock xchgb %0, %1\n\t" + : "=r"(old_value), "=m"(*target) + : "0"(one), "m"(*target) + : "memory"); return old_value; #else return __sync_fetch_and_or(target, 1); diff --git a/src/libuv/src/win/fs-fd-hash-inl.h b/src/libuv/src/win/fs-fd-hash-inl.h index 0b532af12..2af27a90e 100644 --- a/src/libuv/src/win/fs-fd-hash-inl.h +++ b/src/libuv/src/win/fs-fd-hash-inl.h @@ -22,8 +22,8 @@ #ifndef UV_WIN_FS_FD_HASH_INL_H_ #define UV_WIN_FS_FD_HASH_INL_H_ -#include "uv.h" #include "internal.h" +#include "uv.h" /* Files are only inserted in uv__fd_hash when the UV_FS_O_FILEMAP flag is * specified. Thus, when uv__fd_hash_get returns true, the file mapping in the @@ -38,7 +38,6 @@ * kept to minimize allocations. A statically allocated memory buffer is kept * for the first array in each bucket. */ - #define UV__FD_HASH_SIZE 256 #define UV__FD_HASH_GROUP_SIZE 16 @@ -57,22 +56,20 @@ struct uv__fd_hash_entry_s { struct uv__fd_hash_entry_group_s { struct uv__fd_hash_entry_s entries[UV__FD_HASH_GROUP_SIZE]; - struct uv__fd_hash_entry_group_s* next; + struct uv__fd_hash_entry_group_s *next; }; struct uv__fd_hash_bucket_s { size_t size; - struct uv__fd_hash_entry_group_s* data; + struct uv__fd_hash_entry_group_s *data; }; - static uv_mutex_t uv__fd_hash_mutex; static struct uv__fd_hash_entry_group_s - uv__fd_hash_entry_initial[UV__FD_HASH_SIZE * UV__FD_HASH_GROUP_SIZE]; + uv__fd_hash_entry_initial[UV__FD_HASH_SIZE * UV__FD_HASH_GROUP_SIZE]; static struct uv__fd_hash_bucket_s uv__fd_hash[UV__FD_HASH_SIZE]; - INLINE static void uv__fd_hash_init(void) { size_t i; int err; @@ -89,37 +86,36 @@ INLINE static void uv__fd_hash_init(void) { } } -#define FIND_COMMON_VARIABLES \ - unsigned i; \ - unsigned bucket = fd % ARRAY_SIZE(uv__fd_hash); \ - struct uv__fd_hash_entry_s* entry_ptr = NULL; \ - struct uv__fd_hash_entry_group_s* group_ptr; \ - struct uv__fd_hash_bucket_s* bucket_ptr = &uv__fd_hash[bucket]; - -#define FIND_IN_GROUP_PTR(group_size) \ - do { \ - for (i = 0; i < group_size; ++i) { \ - if (group_ptr->entries[i].fd == fd) { \ - entry_ptr = &group_ptr->entries[i]; \ - break; \ - } \ - } \ +#define FIND_COMMON_VARIABLES \ + unsigned i; \ + unsigned bucket = fd % ARRAY_SIZE(uv__fd_hash); \ + struct uv__fd_hash_entry_s *entry_ptr = NULL; \ + struct uv__fd_hash_entry_group_s *group_ptr; \ + struct uv__fd_hash_bucket_s *bucket_ptr = &uv__fd_hash[bucket]; + +#define FIND_IN_GROUP_PTR(group_size) \ + do { \ + for (i = 0; i < group_size; ++i) { \ + if (group_ptr->entries[i].fd == fd) { \ + entry_ptr = &group_ptr->entries[i]; \ + break; \ + } \ + } \ } while (0) -#define FIND_IN_BUCKET_PTR() \ - do { \ - size_t first_group_size = bucket_ptr->size % UV__FD_HASH_GROUP_SIZE; \ - if (bucket_ptr->size != 0 && first_group_size == 0) \ - first_group_size = UV__FD_HASH_GROUP_SIZE; \ - group_ptr = bucket_ptr->data; \ - FIND_IN_GROUP_PTR(first_group_size); \ - for (group_ptr = group_ptr->next; \ - group_ptr != NULL && entry_ptr == NULL; \ - group_ptr = group_ptr->next) \ - FIND_IN_GROUP_PTR(UV__FD_HASH_GROUP_SIZE); \ +#define FIND_IN_BUCKET_PTR() \ + do { \ + size_t first_group_size = bucket_ptr->size % UV__FD_HASH_GROUP_SIZE; \ + if (bucket_ptr->size != 0 && first_group_size == 0) \ + first_group_size = UV__FD_HASH_GROUP_SIZE; \ + group_ptr = bucket_ptr->data; \ + FIND_IN_GROUP_PTR(first_group_size); \ + for (group_ptr = group_ptr->next; group_ptr != NULL && entry_ptr == NULL; \ + group_ptr = group_ptr->next) \ + FIND_IN_GROUP_PTR(UV__FD_HASH_GROUP_SIZE); \ } while (0) -INLINE static int uv__fd_hash_get(int fd, struct uv__fd_info_s* info) { +INLINE static int uv__fd_hash_get(int fd, struct uv__fd_info_s *info) { FIND_COMMON_VARIABLES uv_mutex_lock(&uv__fd_hash_mutex); @@ -134,7 +130,7 @@ INLINE static int uv__fd_hash_get(int fd, struct uv__fd_info_s* info) { return entry_ptr != NULL; } -INLINE static void uv__fd_hash_add(int fd, struct uv__fd_info_s* info) { +INLINE static void uv__fd_hash_add(int fd, struct uv__fd_info_s *info) { FIND_COMMON_VARIABLES uv_mutex_lock(&uv__fd_hash_mutex); @@ -145,8 +141,8 @@ INLINE static void uv__fd_hash_add(int fd, struct uv__fd_info_s* info) { i = bucket_ptr->size % UV__FD_HASH_GROUP_SIZE; if (bucket_ptr->size != 0 && i == 0) { - struct uv__fd_hash_entry_group_s* new_group_ptr = - uv__malloc(sizeof(*new_group_ptr)); + struct uv__fd_hash_entry_group_s *new_group_ptr = + uv__malloc(sizeof(*new_group_ptr)); if (new_group_ptr == NULL) { uv_fatal_error(ERROR_OUTOFMEMORY, "uv__malloc"); } @@ -164,7 +160,7 @@ INLINE static void uv__fd_hash_add(int fd, struct uv__fd_info_s* info) { uv_mutex_unlock(&uv__fd_hash_mutex); } -INLINE static int uv__fd_hash_remove(int fd, struct uv__fd_info_s* info) { +INLINE static int uv__fd_hash_remove(int fd, struct uv__fd_info_s *info) { FIND_COMMON_VARIABLES uv_mutex_lock(&uv__fd_hash_mutex); @@ -183,7 +179,7 @@ INLINE static int uv__fd_hash_remove(int fd, struct uv__fd_info_s* info) { if (bucket_ptr->size != 0 && bucket_ptr->size % UV__FD_HASH_GROUP_SIZE == 0) { - struct uv__fd_hash_entry_group_s* old_group_ptr = bucket_ptr->data; + struct uv__fd_hash_entry_group_s *old_group_ptr = bucket_ptr->data; bucket_ptr->data = old_group_ptr->next; uv__free(old_group_ptr); } diff --git a/src/libuv/src/win/handle-inl.h b/src/libuv/src/win/handle-inl.h index 82c657d57..9b47d5d60 100644 --- a/src/libuv/src/win/handle-inl.h +++ b/src/libuv/src/win/handle-inl.h @@ -25,67 +25,60 @@ #include #include -#include "uv.h" #include "internal.h" +#include "uv.h" - -#define DECREASE_ACTIVE_COUNT(loop, handle) \ - do { \ - if (--(handle)->activecnt == 0 && \ - !((handle)->flags & UV_HANDLE_CLOSING)) { \ - uv__handle_stop((handle)); \ - } \ - assert((handle)->activecnt >= 0); \ +#define DECREASE_ACTIVE_COUNT(loop, handle) \ + do { \ + if (--(handle)->activecnt == 0 && \ + !((handle)->flags & UV_HANDLE_CLOSING)) { \ + uv__handle_stop((handle)); \ + } \ + assert((handle)->activecnt >= 0); \ } while (0) - -#define INCREASE_ACTIVE_COUNT(loop, handle) \ - do { \ - if ((handle)->activecnt++ == 0) { \ - uv__handle_start((handle)); \ - } \ - assert((handle)->activecnt > 0); \ +#define INCREASE_ACTIVE_COUNT(loop, handle) \ + do { \ + if ((handle)->activecnt++ == 0) { \ + uv__handle_start((handle)); \ + } \ + assert((handle)->activecnt > 0); \ } while (0) - -#define DECREASE_PENDING_REQ_COUNT(handle) \ - do { \ - assert(handle->reqs_pending > 0); \ - handle->reqs_pending--; \ - \ - if (handle->flags & UV_HANDLE_CLOSING && \ - handle->reqs_pending == 0) { \ - uv_want_endgame(loop, (uv_handle_t*)handle); \ - } \ +#define DECREASE_PENDING_REQ_COUNT(handle) \ + do { \ + assert(handle->reqs_pending > 0); \ + handle->reqs_pending--; \ + \ + if (handle->flags & UV_HANDLE_CLOSING && handle->reqs_pending == 0) { \ + uv_want_endgame(loop, (uv_handle_t *)handle); \ + } \ } while (0) - -#define uv__handle_closing(handle) \ - do { \ - assert(!((handle)->flags & UV_HANDLE_CLOSING)); \ - \ - if (!(((handle)->flags & UV_HANDLE_ACTIVE) && \ - ((handle)->flags & UV_HANDLE_REF))) \ - uv__active_handle_add((uv_handle_t*) (handle)); \ - \ - (handle)->flags |= UV_HANDLE_CLOSING; \ - (handle)->flags &= ~UV_HANDLE_ACTIVE; \ +#define uv__handle_closing(handle) \ + do { \ + assert(!((handle)->flags & UV_HANDLE_CLOSING)); \ + \ + if (!(((handle)->flags & UV_HANDLE_ACTIVE) && \ + ((handle)->flags & UV_HANDLE_REF))) \ + uv__active_handle_add((uv_handle_t *)(handle)); \ + \ + (handle)->flags |= UV_HANDLE_CLOSING; \ + (handle)->flags &= ~UV_HANDLE_ACTIVE; \ } while (0) - -#define uv__handle_close(handle) \ - do { \ - QUEUE_REMOVE(&(handle)->handle_queue); \ - uv__active_handle_rm((uv_handle_t*) (handle)); \ - \ - (handle)->flags |= UV_HANDLE_CLOSED; \ - \ - if ((handle)->close_cb) \ - (handle)->close_cb((uv_handle_t*) (handle)); \ +#define uv__handle_close(handle) \ + do { \ + QUEUE_REMOVE(&(handle)->handle_queue); \ + uv__active_handle_rm((uv_handle_t *)(handle)); \ + \ + (handle)->flags |= UV_HANDLE_CLOSED; \ + \ + if ((handle)->close_cb) \ + (handle)->close_cb((uv_handle_t *)(handle)); \ } while (0) - -INLINE static void uv_want_endgame(uv_loop_t* loop, uv_handle_t* handle) { +INLINE static void uv_want_endgame(uv_loop_t *loop, uv_handle_t *handle) { if (!(handle->flags & UV_HANDLE_ENDGAME_QUEUED)) { handle->flags |= UV_HANDLE_ENDGAME_QUEUED; @@ -94,9 +87,8 @@ INLINE static void uv_want_endgame(uv_loop_t* loop, uv_handle_t* handle) { } } - -INLINE static void uv_process_endgames(uv_loop_t* loop) { - uv_handle_t* handle; +INLINE static void uv_process_endgames(uv_loop_t *loop) { + uv_handle_t *handle; while (loop->endgame_handles) { handle = loop->endgame_handles; @@ -105,66 +97,65 @@ INLINE static void uv_process_endgames(uv_loop_t* loop) { handle->flags &= ~UV_HANDLE_ENDGAME_QUEUED; switch (handle->type) { - case UV_TCP: - uv_tcp_endgame(loop, (uv_tcp_t*) handle); - break; - - case UV_NAMED_PIPE: - uv_pipe_endgame(loop, (uv_pipe_t*) handle); - break; - - case UV_TTY: - uv_tty_endgame(loop, (uv_tty_t*) handle); - break; - - case UV_UDP: - uv_udp_endgame(loop, (uv_udp_t*) handle); - break; - - case UV_POLL: - uv_poll_endgame(loop, (uv_poll_t*) handle); - break; - - case UV_TIMER: - uv__timer_close((uv_timer_t*) handle); - uv__handle_close(handle); - break; - - case UV_PREPARE: - case UV_CHECK: - case UV_IDLE: - uv_loop_watcher_endgame(loop, handle); - break; - - case UV_ASYNC: - uv_async_endgame(loop, (uv_async_t*) handle); - break; - - case UV_SIGNAL: - uv_signal_endgame(loop, (uv_signal_t*) handle); - break; - - case UV_PROCESS: - uv_process_endgame(loop, (uv_process_t*) handle); - break; - - case UV_FS_EVENT: - uv_fs_event_endgame(loop, (uv_fs_event_t*) handle); - break; - - case UV_FS_POLL: - uv__fs_poll_endgame(loop, (uv_fs_poll_t*) handle); - break; - - default: - assert(0); - break; + case UV_TCP: + uv_tcp_endgame(loop, (uv_tcp_t *)handle); + break; + + case UV_NAMED_PIPE: + uv_pipe_endgame(loop, (uv_pipe_t *)handle); + break; + + case UV_TTY: + uv_tty_endgame(loop, (uv_tty_t *)handle); + break; + + case UV_UDP: + uv_udp_endgame(loop, (uv_udp_t *)handle); + break; + + case UV_POLL: + uv_poll_endgame(loop, (uv_poll_t *)handle); + break; + + case UV_TIMER: + uv__timer_close((uv_timer_t *)handle); + uv__handle_close(handle); + break; + + case UV_PREPARE: + case UV_CHECK: + case UV_IDLE: + uv_loop_watcher_endgame(loop, handle); + break; + + case UV_ASYNC: + uv_async_endgame(loop, (uv_async_t *)handle); + break; + + case UV_SIGNAL: + uv_signal_endgame(loop, (uv_signal_t *)handle); + break; + + case UV_PROCESS: + uv_process_endgame(loop, (uv_process_t *)handle); + break; + + case UV_FS_EVENT: + uv_fs_event_endgame(loop, (uv_fs_event_t *)handle); + break; + + case UV_FS_POLL: + uv__fs_poll_endgame(loop, (uv_fs_poll_t *)handle); + break; + + default: + assert(0); + break; } } } -INLINE static HANDLE uv__get_osfhandle(int fd) -{ +INLINE static HANDLE uv__get_osfhandle(int fd) { /* _get_osfhandle() raises an assert in debug builds if the FD is invalid. * But it also correctly checks the FD and returns INVALID_HANDLE_VALUE for * invalid FDs in release builds (or if you let the assert continue). So this @@ -172,7 +163,7 @@ INLINE static HANDLE uv__get_osfhandle(int fd) HANDLE handle; UV_BEGIN_DISABLE_CRT_ASSERT(); - handle = (HANDLE) _get_osfhandle(fd); + handle = (HANDLE)_get_osfhandle(fd); UV_END_DISABLE_CRT_ASSERT(); return handle; } diff --git a/src/libuv/src/win/internal.h b/src/libuv/src/win/internal.h index b1b25b4c7..3100242ce 100644 --- a/src/libuv/src/win/internal.h +++ b/src/libuv/src/win/internal.h @@ -22,34 +22,32 @@ #ifndef UV_WIN_INTERNAL_H_ #define UV_WIN_INTERNAL_H_ -#include "uv.h" #include "../uv-common.h" +#include "uv.h" #include "uv/tree.h" #include "winapi.h" #include "winsock.h" #ifdef _MSC_VER -# define INLINE __inline -# define UV_THREAD_LOCAL __declspec( thread ) +#define INLINE __inline +#define UV_THREAD_LOCAL __declspec(thread) #else -# define INLINE inline -# define UV_THREAD_LOCAL __thread +#define INLINE inline +#define UV_THREAD_LOCAL __thread #endif - #ifdef _DEBUG extern UV_THREAD_LOCAL int uv__crt_assert_enabled; -#define UV_BEGIN_DISABLE_CRT_ASSERT() \ - { \ - int uv__saved_crt_assert_enabled = uv__crt_assert_enabled; \ +#define UV_BEGIN_DISABLE_CRT_ASSERT() \ + { \ + int uv__saved_crt_assert_enabled = uv__crt_assert_enabled; \ uv__crt_assert_enabled = FALSE; - -#define UV_END_DISABLE_CRT_ASSERT() \ - uv__crt_assert_enabled = uv__saved_crt_assert_enabled; \ +#define UV_END_DISABLE_CRT_ASSERT() \ + uv__crt_assert_enabled = uv__saved_crt_assert_enabled; \ } #else @@ -72,146 +70,131 @@ typedef struct { uint32_t delayed_error; } uv__ipc_socket_xfer_info_t; -int uv_tcp_listen(uv_tcp_t* handle, int backlog, uv_connection_cb cb); -int uv_tcp_accept(uv_tcp_t* server, uv_tcp_t* client); -int uv_tcp_read_start(uv_tcp_t* handle, uv_alloc_cb alloc_cb, - uv_read_cb read_cb); -int uv_tcp_write(uv_loop_t* loop, uv_write_t* req, uv_tcp_t* handle, - const uv_buf_t bufs[], unsigned int nbufs, uv_write_cb cb); -int uv__tcp_try_write(uv_tcp_t* handle, const uv_buf_t bufs[], - unsigned int nbufs); - -void uv_process_tcp_read_req(uv_loop_t* loop, uv_tcp_t* handle, uv_req_t* req); -void uv_process_tcp_write_req(uv_loop_t* loop, uv_tcp_t* handle, - uv_write_t* req); -void uv_process_tcp_accept_req(uv_loop_t* loop, uv_tcp_t* handle, - uv_req_t* req); -void uv_process_tcp_connect_req(uv_loop_t* loop, uv_tcp_t* handle, - uv_connect_t* req); - -void uv_tcp_close(uv_loop_t* loop, uv_tcp_t* tcp); -void uv_tcp_endgame(uv_loop_t* loop, uv_tcp_t* handle); - -int uv__tcp_xfer_export(uv_tcp_t* handle, - int pid, - uv__ipc_socket_xfer_type_t* xfer_type, - uv__ipc_socket_xfer_info_t* xfer_info); -int uv__tcp_xfer_import(uv_tcp_t* tcp, - uv__ipc_socket_xfer_type_t xfer_type, - uv__ipc_socket_xfer_info_t* xfer_info); - +int uv_tcp_listen(uv_tcp_t *handle, int backlog, uv_connection_cb cb); +int uv_tcp_accept(uv_tcp_t *server, uv_tcp_t *client); +int uv_tcp_read_start(uv_tcp_t *handle, uv_alloc_cb alloc_cb, + uv_read_cb read_cb); +int uv_tcp_write(uv_loop_t *loop, uv_write_t *req, uv_tcp_t *handle, + const uv_buf_t bufs[], unsigned int nbufs, uv_write_cb cb); +int uv__tcp_try_write(uv_tcp_t *handle, const uv_buf_t bufs[], + unsigned int nbufs); + +void uv_process_tcp_read_req(uv_loop_t *loop, uv_tcp_t *handle, uv_req_t *req); +void uv_process_tcp_write_req(uv_loop_t *loop, uv_tcp_t *handle, + uv_write_t *req); +void uv_process_tcp_accept_req(uv_loop_t *loop, uv_tcp_t *handle, + uv_req_t *req); +void uv_process_tcp_connect_req(uv_loop_t *loop, uv_tcp_t *handle, + uv_connect_t *req); + +void uv_tcp_close(uv_loop_t *loop, uv_tcp_t *tcp); +void uv_tcp_endgame(uv_loop_t *loop, uv_tcp_t *handle); + +int uv__tcp_xfer_export(uv_tcp_t *handle, int pid, + uv__ipc_socket_xfer_type_t *xfer_type, + uv__ipc_socket_xfer_info_t *xfer_info); +int uv__tcp_xfer_import(uv_tcp_t *tcp, uv__ipc_socket_xfer_type_t xfer_type, + uv__ipc_socket_xfer_info_t *xfer_info); /* * UDP */ -void uv_process_udp_recv_req(uv_loop_t* loop, uv_udp_t* handle, uv_req_t* req); -void uv_process_udp_send_req(uv_loop_t* loop, uv_udp_t* handle, - uv_udp_send_t* req); - -void uv_udp_close(uv_loop_t* loop, uv_udp_t* handle); -void uv_udp_endgame(uv_loop_t* loop, uv_udp_t* handle); +void uv_process_udp_recv_req(uv_loop_t *loop, uv_udp_t *handle, uv_req_t *req); +void uv_process_udp_send_req(uv_loop_t *loop, uv_udp_t *handle, + uv_udp_send_t *req); +void uv_udp_close(uv_loop_t *loop, uv_udp_t *handle); +void uv_udp_endgame(uv_loop_t *loop, uv_udp_t *handle); /* * Pipes */ -int uv__create_stdio_pipe_pair(uv_loop_t* loop, - uv_pipe_t* parent_pipe, HANDLE* child_pipe_ptr, unsigned int flags); - -int uv_pipe_listen(uv_pipe_t* handle, int backlog, uv_connection_cb cb); -int uv_pipe_accept(uv_pipe_t* server, uv_stream_t* client); -int uv_pipe_read_start(uv_pipe_t* handle, uv_alloc_cb alloc_cb, - uv_read_cb read_cb); -void uv__pipe_read_stop(uv_pipe_t* handle); -int uv__pipe_write(uv_loop_t* loop, - uv_write_t* req, - uv_pipe_t* handle, - const uv_buf_t bufs[], - size_t nbufs, - uv_stream_t* send_handle, - uv_write_cb cb); - -void uv_process_pipe_read_req(uv_loop_t* loop, uv_pipe_t* handle, - uv_req_t* req); -void uv_process_pipe_write_req(uv_loop_t* loop, uv_pipe_t* handle, - uv_write_t* req); -void uv_process_pipe_accept_req(uv_loop_t* loop, uv_pipe_t* handle, - uv_req_t* raw_req); -void uv_process_pipe_connect_req(uv_loop_t* loop, uv_pipe_t* handle, - uv_connect_t* req); -void uv_process_pipe_shutdown_req(uv_loop_t* loop, uv_pipe_t* handle, - uv_shutdown_t* req); - -void uv_pipe_close(uv_loop_t* loop, uv_pipe_t* handle); -void uv_pipe_cleanup(uv_loop_t* loop, uv_pipe_t* handle); -void uv_pipe_endgame(uv_loop_t* loop, uv_pipe_t* handle); - +int uv__create_stdio_pipe_pair(uv_loop_t *loop, uv_pipe_t *parent_pipe, + HANDLE *child_pipe_ptr, unsigned int flags); + +int uv_pipe_listen(uv_pipe_t *handle, int backlog, uv_connection_cb cb); +int uv_pipe_accept(uv_pipe_t *server, uv_stream_t *client); +int uv_pipe_read_start(uv_pipe_t *handle, uv_alloc_cb alloc_cb, + uv_read_cb read_cb); +void uv__pipe_read_stop(uv_pipe_t *handle); +int uv__pipe_write(uv_loop_t *loop, uv_write_t *req, uv_pipe_t *handle, + const uv_buf_t bufs[], size_t nbufs, + uv_stream_t *send_handle, uv_write_cb cb); + +void uv_process_pipe_read_req(uv_loop_t *loop, uv_pipe_t *handle, + uv_req_t *req); +void uv_process_pipe_write_req(uv_loop_t *loop, uv_pipe_t *handle, + uv_write_t *req); +void uv_process_pipe_accept_req(uv_loop_t *loop, uv_pipe_t *handle, + uv_req_t *raw_req); +void uv_process_pipe_connect_req(uv_loop_t *loop, uv_pipe_t *handle, + uv_connect_t *req); +void uv_process_pipe_shutdown_req(uv_loop_t *loop, uv_pipe_t *handle, + uv_shutdown_t *req); + +void uv_pipe_close(uv_loop_t *loop, uv_pipe_t *handle); +void uv_pipe_cleanup(uv_loop_t *loop, uv_pipe_t *handle); +void uv_pipe_endgame(uv_loop_t *loop, uv_pipe_t *handle); /* * TTY */ void uv_console_init(void); -int uv_tty_read_start(uv_tty_t* handle, uv_alloc_cb alloc_cb, - uv_read_cb read_cb); -int uv_tty_read_stop(uv_tty_t* handle); -int uv_tty_write(uv_loop_t* loop, uv_write_t* req, uv_tty_t* handle, - const uv_buf_t bufs[], unsigned int nbufs, uv_write_cb cb); -int uv__tty_try_write(uv_tty_t* handle, const uv_buf_t bufs[], - unsigned int nbufs); -void uv_tty_close(uv_tty_t* handle); - -void uv_process_tty_read_req(uv_loop_t* loop, uv_tty_t* handle, - uv_req_t* req); -void uv_process_tty_write_req(uv_loop_t* loop, uv_tty_t* handle, - uv_write_t* req); +int uv_tty_read_start(uv_tty_t *handle, uv_alloc_cb alloc_cb, + uv_read_cb read_cb); +int uv_tty_read_stop(uv_tty_t *handle); +int uv_tty_write(uv_loop_t *loop, uv_write_t *req, uv_tty_t *handle, + const uv_buf_t bufs[], unsigned int nbufs, uv_write_cb cb); +int uv__tty_try_write(uv_tty_t *handle, const uv_buf_t bufs[], + unsigned int nbufs); +void uv_tty_close(uv_tty_t *handle); + +void uv_process_tty_read_req(uv_loop_t *loop, uv_tty_t *handle, uv_req_t *req); +void uv_process_tty_write_req(uv_loop_t *loop, uv_tty_t *handle, + uv_write_t *req); /* * uv_process_tty_accept_req() is a stub to keep DELEGATE_STREAM_REQ working * TODO: find a way to remove it */ -void uv_process_tty_accept_req(uv_loop_t* loop, uv_tty_t* handle, - uv_req_t* raw_req); +void uv_process_tty_accept_req(uv_loop_t *loop, uv_tty_t *handle, + uv_req_t *raw_req); /* * uv_process_tty_connect_req() is a stub to keep DELEGATE_STREAM_REQ working * TODO: find a way to remove it */ -void uv_process_tty_connect_req(uv_loop_t* loop, uv_tty_t* handle, - uv_connect_t* req); - -void uv_tty_endgame(uv_loop_t* loop, uv_tty_t* handle); +void uv_process_tty_connect_req(uv_loop_t *loop, uv_tty_t *handle, + uv_connect_t *req); +void uv_tty_endgame(uv_loop_t *loop, uv_tty_t *handle); /* * Poll watchers */ -void uv_process_poll_req(uv_loop_t* loop, uv_poll_t* handle, - uv_req_t* req); - -int uv_poll_close(uv_loop_t* loop, uv_poll_t* handle); -void uv_poll_endgame(uv_loop_t* loop, uv_poll_t* handle); +void uv_process_poll_req(uv_loop_t *loop, uv_poll_t *handle, uv_req_t *req); +int uv_poll_close(uv_loop_t *loop, uv_poll_t *handle); +void uv_poll_endgame(uv_loop_t *loop, uv_poll_t *handle); /* * Loop watchers */ -void uv_loop_watcher_endgame(uv_loop_t* loop, uv_handle_t* handle); +void uv_loop_watcher_endgame(uv_loop_t *loop, uv_handle_t *handle); -void uv_prepare_invoke(uv_loop_t* loop); -void uv_check_invoke(uv_loop_t* loop); -void uv_idle_invoke(uv_loop_t* loop); +void uv_prepare_invoke(uv_loop_t *loop); +void uv_check_invoke(uv_loop_t *loop); +void uv_idle_invoke(uv_loop_t *loop); void uv__once_init(void); - /* * Async watcher */ -void uv_async_close(uv_loop_t* loop, uv_async_t* handle); -void uv_async_endgame(uv_loop_t* loop, uv_async_t* handle); - -void uv_process_async_wakeup_req(uv_loop_t* loop, uv_async_t* handle, - uv_req_t* req); +void uv_async_close(uv_loop_t *loop, uv_async_t *handle); +void uv_async_endgame(uv_loop_t *loop, uv_async_t *handle); +void uv_process_async_wakeup_req(uv_loop_t *loop, uv_async_t *handle, + uv_req_t *req); /* * Signal watcher @@ -219,47 +202,40 @@ void uv_process_async_wakeup_req(uv_loop_t* loop, uv_async_t* handle, void uv_signals_init(void); int uv__signal_dispatch(int signum); -void uv_signal_close(uv_loop_t* loop, uv_signal_t* handle); -void uv_signal_endgame(uv_loop_t* loop, uv_signal_t* handle); - -void uv_process_signal_req(uv_loop_t* loop, uv_signal_t* handle, - uv_req_t* req); +void uv_signal_close(uv_loop_t *loop, uv_signal_t *handle); +void uv_signal_endgame(uv_loop_t *loop, uv_signal_t *handle); +void uv_process_signal_req(uv_loop_t *loop, uv_signal_t *handle, uv_req_t *req); /* * Spawn */ -void uv_process_proc_exit(uv_loop_t* loop, uv_process_t* handle); -void uv_process_close(uv_loop_t* loop, uv_process_t* handle); -void uv_process_endgame(uv_loop_t* loop, uv_process_t* handle); - +void uv_process_proc_exit(uv_loop_t *loop, uv_process_t *handle); +void uv_process_close(uv_loop_t *loop, uv_process_t *handle); +void uv_process_endgame(uv_loop_t *loop, uv_process_t *handle); /* * Error */ int uv_translate_sys_error(int sys_errno); - /* * FS */ void uv_fs_init(void); - /* * FS Event */ -void uv_process_fs_event_req(uv_loop_t* loop, uv_req_t* req, - uv_fs_event_t* handle); -void uv_fs_event_close(uv_loop_t* loop, uv_fs_event_t* handle); -void uv_fs_event_endgame(uv_loop_t* loop, uv_fs_event_t* handle); - +void uv_process_fs_event_req(uv_loop_t *loop, uv_req_t *req, + uv_fs_event_t *handle); +void uv_fs_event_close(uv_loop_t *loop, uv_fs_event_t *handle); +void uv_fs_event_endgame(uv_loop_t *loop, uv_fs_event_t *handle); /* * Stat poller. */ -void uv__fs_poll_endgame(uv_loop_t* loop, uv_fs_poll_t* handle); - +void uv__fs_poll_endgame(uv_loop_t *loop, uv_fs_poll_t *handle); /* * Utilities. @@ -267,41 +243,35 @@ void uv__fs_poll_endgame(uv_loop_t* loop, uv_fs_poll_t* handle); void uv__util_init(void); uint64_t uv__hrtime(unsigned int scale); -__declspec(noreturn) void uv_fatal_error(const int errorno, const char* syscall); -int uv__getpwuid_r(uv_passwd_t* pwd); -int uv__convert_utf16_to_utf8(const WCHAR* utf16, int utf16len, char** utf8); -int uv__convert_utf8_to_utf16(const char* utf8, int utf8len, WCHAR** utf16); +__declspec(noreturn) void uv_fatal_error(const int errorno, + const char *syscall); +int uv__getpwuid_r(uv_passwd_t *pwd); +int uv__convert_utf16_to_utf8(const WCHAR *utf16, int utf16len, char **utf8); +int uv__convert_utf8_to_utf16(const char *utf8, int utf8len, WCHAR **utf16); -typedef int (WINAPI *uv__peersockfunc)(SOCKET, struct sockaddr*, int*); +typedef int(WINAPI *uv__peersockfunc)(SOCKET, struct sockaddr *, int *); -int uv__getsockpeername(const uv_handle_t* handle, - uv__peersockfunc func, - struct sockaddr* name, - int* namelen, - int delayed_error); - -int uv__random_rtlgenrandom(void* buf, size_t buflen); +int uv__getsockpeername(const uv_handle_t *handle, uv__peersockfunc func, + struct sockaddr *name, int *namelen, int delayed_error); +int uv__random_rtlgenrandom(void *buf, size_t buflen); /* * Process stdio handles. */ -int uv__stdio_create(uv_loop_t* loop, - const uv_process_options_t* options, - BYTE** buffer_ptr); -void uv__stdio_destroy(BYTE* buffer); -void uv__stdio_noinherit(BYTE* buffer); -int uv__stdio_verify(BYTE* buffer, WORD size); -WORD uv__stdio_size(BYTE* buffer); -HANDLE uv__stdio_handle(BYTE* buffer, int fd); - +int uv__stdio_create(uv_loop_t *loop, const uv_process_options_t *options, + BYTE **buffer_ptr); +void uv__stdio_destroy(BYTE *buffer); +void uv__stdio_noinherit(BYTE *buffer); +int uv__stdio_verify(BYTE *buffer, WORD size); +WORD uv__stdio_size(BYTE *buffer); +HANDLE uv__stdio_handle(BYTE *buffer, int fd); /* * Winapi and ntapi utility functions */ void uv_winapi_init(void); - /* * Winsock utility functions */ @@ -309,19 +279,21 @@ void uv_winsock_init(void); int uv_ntstatus_to_winsock_error(NTSTATUS status); -BOOL uv_get_acceptex_function(SOCKET socket, LPFN_ACCEPTEX* target); -BOOL uv_get_connectex_function(SOCKET socket, LPFN_CONNECTEX* target); - -int WSAAPI uv_wsarecv_workaround(SOCKET socket, WSABUF* buffers, - DWORD buffer_count, DWORD* bytes, DWORD* flags, WSAOVERLAPPED *overlapped, - LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine); -int WSAAPI uv_wsarecvfrom_workaround(SOCKET socket, WSABUF* buffers, - DWORD buffer_count, DWORD* bytes, DWORD* flags, struct sockaddr* addr, - int* addr_len, WSAOVERLAPPED *overlapped, +BOOL uv_get_acceptex_function(SOCKET socket, LPFN_ACCEPTEX *target); +BOOL uv_get_connectex_function(SOCKET socket, LPFN_CONNECTEX *target); + +int WSAAPI +uv_wsarecv_workaround(SOCKET socket, WSABUF *buffers, DWORD buffer_count, + DWORD *bytes, DWORD *flags, WSAOVERLAPPED *overlapped, + LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine); +int WSAAPI uv_wsarecvfrom_workaround( + SOCKET socket, WSABUF *buffers, DWORD buffer_count, DWORD *bytes, + DWORD *flags, struct sockaddr *addr, int *addr_len, + WSAOVERLAPPED *overlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine); -int WSAAPI uv_msafd_poll(SOCKET socket, AFD_POLL_INFO* info_in, - AFD_POLL_INFO* info_out, OVERLAPPED* overlapped); +int WSAAPI uv_msafd_poll(SOCKET socket, AFD_POLL_INFO *info_in, + AFD_POLL_INFO *info_out, OVERLAPPED *overlapped); /* Whether there are any non-IFS LSPs stacked on TCP */ extern int uv_tcp_non_ifs_lsp_ipv4; diff --git a/src/libuv/src/win/req-inl.h b/src/libuv/src/win/req-inl.h index f2513b7d3..75ca2e093 100644 --- a/src/libuv/src/win/req-inl.h +++ b/src/libuv/src/win/req-inl.h @@ -24,81 +24,69 @@ #include -#include "uv.h" #include "internal.h" +#include "uv.h" +#define SET_REQ_STATUS(req, status) \ + (req)->u.io.overlapped.Internal = (ULONG_PTR)(status) -#define SET_REQ_STATUS(req, status) \ - (req)->u.io.overlapped.Internal = (ULONG_PTR) (status) - -#define SET_REQ_ERROR(req, error) \ +#define SET_REQ_ERROR(req, error) \ SET_REQ_STATUS((req), NTSTATUS_FROM_WIN32((error))) /* Note: used open-coded in UV_REQ_INIT() because of a circular dependency * between src/uv-common.h and src/win/internal.h. */ -#define SET_REQ_SUCCESS(req) \ - SET_REQ_STATUS((req), STATUS_SUCCESS) +#define SET_REQ_SUCCESS(req) SET_REQ_STATUS((req), STATUS_SUCCESS) -#define GET_REQ_STATUS(req) \ - ((NTSTATUS) (req)->u.io.overlapped.Internal) +#define GET_REQ_STATUS(req) ((NTSTATUS)(req)->u.io.overlapped.Internal) -#define REQ_SUCCESS(req) \ - (NT_SUCCESS(GET_REQ_STATUS((req)))) +#define REQ_SUCCESS(req) (NT_SUCCESS(GET_REQ_STATUS((req)))) -#define GET_REQ_ERROR(req) \ - (pRtlNtStatusToDosError(GET_REQ_STATUS((req)))) +#define GET_REQ_ERROR(req) (pRtlNtStatusToDosError(GET_REQ_STATUS((req)))) -#define GET_REQ_SOCK_ERROR(req) \ +#define GET_REQ_SOCK_ERROR(req) \ (uv_ntstatus_to_winsock_error(GET_REQ_STATUS((req)))) - -#define REGISTER_HANDLE_REQ(loop, handle, req) \ - do { \ - INCREASE_ACTIVE_COUNT((loop), (handle)); \ - uv__req_register((loop), (req)); \ +#define REGISTER_HANDLE_REQ(loop, handle, req) \ + do { \ + INCREASE_ACTIVE_COUNT((loop), (handle)); \ + uv__req_register((loop), (req)); \ } while (0) -#define UNREGISTER_HANDLE_REQ(loop, handle, req) \ - do { \ - DECREASE_ACTIVE_COUNT((loop), (handle)); \ - uv__req_unregister((loop), (req)); \ +#define UNREGISTER_HANDLE_REQ(loop, handle, req) \ + do { \ + DECREASE_ACTIVE_COUNT((loop), (handle)); \ + uv__req_unregister((loop), (req)); \ } while (0) - -#define UV_SUCCEEDED_WITHOUT_IOCP(result) \ +#define UV_SUCCEEDED_WITHOUT_IOCP(result) \ ((result) && (handle->flags & UV_HANDLE_SYNC_BYPASS_IOCP)) -#define UV_SUCCEEDED_WITH_IOCP(result) \ +#define UV_SUCCEEDED_WITH_IOCP(result) \ ((result) || (GetLastError() == ERROR_IO_PENDING)) - -#define POST_COMPLETION_FOR_REQ(loop, req) \ - if (!PostQueuedCompletionStatus((loop)->iocp, \ - 0, \ - 0, \ - &((req)->u.io.overlapped))) { \ - uv_fatal_error(GetLastError(), "PostQueuedCompletionStatus"); \ +#define POST_COMPLETION_FOR_REQ(loop, req) \ + if (!PostQueuedCompletionStatus((loop)->iocp, 0, 0, \ + &((req)->u.io.overlapped))) { \ + uv_fatal_error(GetLastError(), "PostQueuedCompletionStatus"); \ } - -INLINE static uv_req_t* uv_overlapped_to_req(OVERLAPPED* overlapped) { +INLINE static uv_req_t *uv_overlapped_to_req(OVERLAPPED *overlapped) { return CONTAINING_RECORD(overlapped, uv_req_t, u.io.overlapped); } - -INLINE static void uv_insert_pending_req(uv_loop_t* loop, uv_req_t* req) { +INLINE static void uv_insert_pending_req(uv_loop_t *loop, uv_req_t *req) { req->next_req = NULL; if (loop->pending_reqs_tail) { #ifdef _DEBUG /* Ensure the request is not already in the queue, or the queue * will get corrupted. */ - uv_req_t* current = loop->pending_reqs_tail; + uv_req_t *current = loop->pending_reqs_tail; do { assert(req != current); current = current->next_req; - } while(current != loop->pending_reqs_tail); + } while (current != loop->pending_reqs_tail); #endif req->next_req = loop->pending_reqs_tail->next_req; @@ -110,38 +98,33 @@ INLINE static void uv_insert_pending_req(uv_loop_t* loop, uv_req_t* req) { } } - -#define DELEGATE_STREAM_REQ(loop, req, method, handle_at) \ - do { \ - switch (((uv_handle_t*) (req)->handle_at)->type) { \ - case UV_TCP: \ - uv_process_tcp_##method##_req(loop, \ - (uv_tcp_t*) ((req)->handle_at), \ - req); \ - break; \ - \ - case UV_NAMED_PIPE: \ - uv_process_pipe_##method##_req(loop, \ - (uv_pipe_t*) ((req)->handle_at), \ - req); \ - break; \ - \ - case UV_TTY: \ - uv_process_tty_##method##_req(loop, \ - (uv_tty_t*) ((req)->handle_at), \ - req); \ - break; \ - \ - default: \ - assert(0); \ - } \ +#define DELEGATE_STREAM_REQ(loop, req, method, handle_at) \ + do { \ + switch (((uv_handle_t *)(req)->handle_at)->type) { \ + case UV_TCP: \ + uv_process_tcp_##method##_req(loop, (uv_tcp_t *)((req)->handle_at), \ + req); \ + break; \ + \ + case UV_NAMED_PIPE: \ + uv_process_pipe_##method##_req(loop, (uv_pipe_t *)((req)->handle_at), \ + req); \ + break; \ + \ + case UV_TTY: \ + uv_process_tty_##method##_req(loop, (uv_tty_t *)((req)->handle_at), \ + req); \ + break; \ + \ + default: \ + assert(0); \ + } \ } while (0) - -INLINE static int uv_process_reqs(uv_loop_t* loop) { - uv_req_t* req; - uv_req_t* first; - uv_req_t* next; +INLINE static int uv_process_reqs(uv_loop_t *loop) { + uv_req_t *req; + uv_req_t *first; + uv_req_t *next; if (loop->pending_reqs_tail == NULL) return 0; @@ -155,63 +138,61 @@ INLINE static int uv_process_reqs(uv_loop_t* loop) { next = req->next_req != first ? req->next_req : NULL; switch (req->type) { - case UV_READ: - DELEGATE_STREAM_REQ(loop, req, read, data); - break; - - case UV_WRITE: - DELEGATE_STREAM_REQ(loop, (uv_write_t*) req, write, handle); - break; - - case UV_ACCEPT: - DELEGATE_STREAM_REQ(loop, req, accept, data); - break; - - case UV_CONNECT: - DELEGATE_STREAM_REQ(loop, (uv_connect_t*) req, connect, handle); - break; - - case UV_SHUTDOWN: - /* Tcp shutdown requests don't come here. */ - assert(((uv_shutdown_t*) req)->handle->type == UV_NAMED_PIPE); - uv_process_pipe_shutdown_req( - loop, - (uv_pipe_t*) ((uv_shutdown_t*) req)->handle, - (uv_shutdown_t*) req); - break; - - case UV_UDP_RECV: - uv_process_udp_recv_req(loop, (uv_udp_t*) req->data, req); - break; - - case UV_UDP_SEND: - uv_process_udp_send_req(loop, - ((uv_udp_send_t*) req)->handle, - (uv_udp_send_t*) req); - break; - - case UV_WAKEUP: - uv_process_async_wakeup_req(loop, (uv_async_t*) req->data, req); - break; - - case UV_SIGNAL_REQ: - uv_process_signal_req(loop, (uv_signal_t*) req->data, req); - break; - - case UV_POLL_REQ: - uv_process_poll_req(loop, (uv_poll_t*) req->data, req); - break; - - case UV_PROCESS_EXIT: - uv_process_proc_exit(loop, (uv_process_t*) req->data); - break; - - case UV_FS_EVENT_REQ: - uv_process_fs_event_req(loop, req, (uv_fs_event_t*) req->data); - break; - - default: - assert(0); + case UV_READ: + DELEGATE_STREAM_REQ(loop, req, read, data); + break; + + case UV_WRITE: + DELEGATE_STREAM_REQ(loop, (uv_write_t *)req, write, handle); + break; + + case UV_ACCEPT: + DELEGATE_STREAM_REQ(loop, req, accept, data); + break; + + case UV_CONNECT: + DELEGATE_STREAM_REQ(loop, (uv_connect_t *)req, connect, handle); + break; + + case UV_SHUTDOWN: + /* Tcp shutdown requests don't come here. */ + assert(((uv_shutdown_t *)req)->handle->type == UV_NAMED_PIPE); + uv_process_pipe_shutdown_req(loop, + (uv_pipe_t *)((uv_shutdown_t *)req)->handle, + (uv_shutdown_t *)req); + break; + + case UV_UDP_RECV: + uv_process_udp_recv_req(loop, (uv_udp_t *)req->data, req); + break; + + case UV_UDP_SEND: + uv_process_udp_send_req(loop, ((uv_udp_send_t *)req)->handle, + (uv_udp_send_t *)req); + break; + + case UV_WAKEUP: + uv_process_async_wakeup_req(loop, (uv_async_t *)req->data, req); + break; + + case UV_SIGNAL_REQ: + uv_process_signal_req(loop, (uv_signal_t *)req->data, req); + break; + + case UV_POLL_REQ: + uv_process_poll_req(loop, (uv_poll_t *)req->data, req); + break; + + case UV_PROCESS_EXIT: + uv_process_proc_exit(loop, (uv_process_t *)req->data); + break; + + case UV_FS_EVENT_REQ: + uv_process_fs_event_req(loop, req, (uv_fs_event_t *)req->data); + break; + + default: + assert(0); } } diff --git a/src/libuv/src/win/stream-inl.h b/src/libuv/src/win/stream-inl.h index 40f5ddd51..d47f3337a 100644 --- a/src/libuv/src/win/stream-inl.h +++ b/src/libuv/src/win/stream-inl.h @@ -24,16 +24,14 @@ #include -#include "uv.h" -#include "internal.h" #include "handle-inl.h" +#include "internal.h" #include "req-inl.h" +#include "uv.h" - -INLINE static void uv_stream_init(uv_loop_t* loop, - uv_stream_t* handle, +INLINE static void uv_stream_init(uv_loop_t *loop, uv_stream_t *handle, uv_handle_type type) { - uv__handle_init(loop, (uv_handle_t*) handle, type); + uv__handle_init(loop, (uv_handle_t *)handle, type); handle->write_queue_size = 0; handle->activecnt = 0; handle->stream.conn.shutdown_req = NULL; @@ -45,10 +43,8 @@ INLINE static void uv_stream_init(uv_loop_t* loop, handle->read_req.data = handle; } - -INLINE static void uv_connection_init(uv_stream_t* handle) { +INLINE static void uv_connection_init(uv_stream_t *handle) { handle->flags |= UV_HANDLE_CONNECTION; } - #endif /* UV_WIN_STREAM_INL_H_ */ diff --git a/src/libuv/src/win/winapi.h b/src/libuv/src/win/winapi.h index 3e075f097..948010db3 100644 --- a/src/libuv/src/win/winapi.h +++ b/src/libuv/src/win/winapi.h @@ -24,4088 +24,4097 @@ #include - /* * Ntdll headers */ #ifndef STATUS_SEVERITY_SUCCESS -# define STATUS_SEVERITY_SUCCESS 0x0 +#define STATUS_SEVERITY_SUCCESS 0x0 #endif #ifndef STATUS_SEVERITY_INFORMATIONAL -# define STATUS_SEVERITY_INFORMATIONAL 0x1 +#define STATUS_SEVERITY_INFORMATIONAL 0x1 #endif #ifndef STATUS_SEVERITY_WARNING -# define STATUS_SEVERITY_WARNING 0x2 +#define STATUS_SEVERITY_WARNING 0x2 #endif #ifndef STATUS_SEVERITY_ERROR -# define STATUS_SEVERITY_ERROR 0x3 +#define STATUS_SEVERITY_ERROR 0x3 #endif #ifndef FACILITY_NTWIN32 -# define FACILITY_NTWIN32 0x7 +#define FACILITY_NTWIN32 0x7 #endif #ifndef NT_SUCCESS -# define NT_SUCCESS(status) (((NTSTATUS) (status)) >= 0) +#define NT_SUCCESS(status) (((NTSTATUS)(status)) >= 0) #endif #ifndef NT_INFORMATION -# define NT_INFORMATION(status) ((((ULONG) (status)) >> 30) == 1) +#define NT_INFORMATION(status) ((((ULONG)(status)) >> 30) == 1) #endif #ifndef NT_WARNING -# define NT_WARNING(status) ((((ULONG) (status)) >> 30) == 2) +#define NT_WARNING(status) ((((ULONG)(status)) >> 30) == 2) #endif #ifndef NT_ERROR -# define NT_ERROR(status) ((((ULONG) (status)) >> 30) == 3) +#define NT_ERROR(status) ((((ULONG)(status)) >> 30) == 3) #endif #ifndef STATUS_SUCCESS -# define STATUS_SUCCESS ((NTSTATUS) 0x00000000L) +#define STATUS_SUCCESS ((NTSTATUS)0x00000000L) #endif #ifndef STATUS_WAIT_0 -# define STATUS_WAIT_0 ((NTSTATUS) 0x00000000L) +#define STATUS_WAIT_0 ((NTSTATUS)0x00000000L) #endif #ifndef STATUS_WAIT_1 -# define STATUS_WAIT_1 ((NTSTATUS) 0x00000001L) +#define STATUS_WAIT_1 ((NTSTATUS)0x00000001L) #endif #ifndef STATUS_WAIT_2 -# define STATUS_WAIT_2 ((NTSTATUS) 0x00000002L) +#define STATUS_WAIT_2 ((NTSTATUS)0x00000002L) #endif #ifndef STATUS_WAIT_3 -# define STATUS_WAIT_3 ((NTSTATUS) 0x00000003L) +#define STATUS_WAIT_3 ((NTSTATUS)0x00000003L) #endif #ifndef STATUS_WAIT_63 -# define STATUS_WAIT_63 ((NTSTATUS) 0x0000003FL) +#define STATUS_WAIT_63 ((NTSTATUS)0x0000003FL) #endif #ifndef STATUS_ABANDONED -# define STATUS_ABANDONED ((NTSTATUS) 0x00000080L) +#define STATUS_ABANDONED ((NTSTATUS)0x00000080L) #endif #ifndef STATUS_ABANDONED_WAIT_0 -# define STATUS_ABANDONED_WAIT_0 ((NTSTATUS) 0x00000080L) +#define STATUS_ABANDONED_WAIT_0 ((NTSTATUS)0x00000080L) #endif #ifndef STATUS_ABANDONED_WAIT_63 -# define STATUS_ABANDONED_WAIT_63 ((NTSTATUS) 0x000000BFL) +#define STATUS_ABANDONED_WAIT_63 ((NTSTATUS)0x000000BFL) #endif #ifndef STATUS_USER_APC -# define STATUS_USER_APC ((NTSTATUS) 0x000000C0L) +#define STATUS_USER_APC ((NTSTATUS)0x000000C0L) #endif #ifndef STATUS_KERNEL_APC -# define STATUS_KERNEL_APC ((NTSTATUS) 0x00000100L) +#define STATUS_KERNEL_APC ((NTSTATUS)0x00000100L) #endif #ifndef STATUS_ALERTED -# define STATUS_ALERTED ((NTSTATUS) 0x00000101L) +#define STATUS_ALERTED ((NTSTATUS)0x00000101L) #endif #ifndef STATUS_TIMEOUT -# define STATUS_TIMEOUT ((NTSTATUS) 0x00000102L) +#define STATUS_TIMEOUT ((NTSTATUS)0x00000102L) #endif #ifndef STATUS_PENDING -# define STATUS_PENDING ((NTSTATUS) 0x00000103L) +#define STATUS_PENDING ((NTSTATUS)0x00000103L) #endif #ifndef STATUS_REPARSE -# define STATUS_REPARSE ((NTSTATUS) 0x00000104L) +#define STATUS_REPARSE ((NTSTATUS)0x00000104L) #endif #ifndef STATUS_MORE_ENTRIES -# define STATUS_MORE_ENTRIES ((NTSTATUS) 0x00000105L) +#define STATUS_MORE_ENTRIES ((NTSTATUS)0x00000105L) #endif #ifndef STATUS_NOT_ALL_ASSIGNED -# define STATUS_NOT_ALL_ASSIGNED ((NTSTATUS) 0x00000106L) +#define STATUS_NOT_ALL_ASSIGNED ((NTSTATUS)0x00000106L) #endif #ifndef STATUS_SOME_NOT_MAPPED -# define STATUS_SOME_NOT_MAPPED ((NTSTATUS) 0x00000107L) +#define STATUS_SOME_NOT_MAPPED ((NTSTATUS)0x00000107L) #endif #ifndef STATUS_OPLOCK_BREAK_IN_PROGRESS -# define STATUS_OPLOCK_BREAK_IN_PROGRESS ((NTSTATUS) 0x00000108L) +#define STATUS_OPLOCK_BREAK_IN_PROGRESS ((NTSTATUS)0x00000108L) #endif #ifndef STATUS_VOLUME_MOUNTED -# define STATUS_VOLUME_MOUNTED ((NTSTATUS) 0x00000109L) +#define STATUS_VOLUME_MOUNTED ((NTSTATUS)0x00000109L) #endif #ifndef STATUS_RXACT_COMMITTED -# define STATUS_RXACT_COMMITTED ((NTSTATUS) 0x0000010AL) +#define STATUS_RXACT_COMMITTED ((NTSTATUS)0x0000010AL) #endif #ifndef STATUS_NOTIFY_CLEANUP -# define STATUS_NOTIFY_CLEANUP ((NTSTATUS) 0x0000010BL) +#define STATUS_NOTIFY_CLEANUP ((NTSTATUS)0x0000010BL) #endif #ifndef STATUS_NOTIFY_ENUM_DIR -# define STATUS_NOTIFY_ENUM_DIR ((NTSTATUS) 0x0000010CL) +#define STATUS_NOTIFY_ENUM_DIR ((NTSTATUS)0x0000010CL) #endif #ifndef STATUS_NO_QUOTAS_FOR_ACCOUNT -# define STATUS_NO_QUOTAS_FOR_ACCOUNT ((NTSTATUS) 0x0000010DL) +#define STATUS_NO_QUOTAS_FOR_ACCOUNT ((NTSTATUS)0x0000010DL) #endif #ifndef STATUS_PRIMARY_TRANSPORT_CONNECT_FAILED -# define STATUS_PRIMARY_TRANSPORT_CONNECT_FAILED ((NTSTATUS) 0x0000010EL) +#define STATUS_PRIMARY_TRANSPORT_CONNECT_FAILED ((NTSTATUS)0x0000010EL) #endif #ifndef STATUS_PAGE_FAULT_TRANSITION -# define STATUS_PAGE_FAULT_TRANSITION ((NTSTATUS) 0x00000110L) +#define STATUS_PAGE_FAULT_TRANSITION ((NTSTATUS)0x00000110L) #endif #ifndef STATUS_PAGE_FAULT_DEMAND_ZERO -# define STATUS_PAGE_FAULT_DEMAND_ZERO ((NTSTATUS) 0x00000111L) +#define STATUS_PAGE_FAULT_DEMAND_ZERO ((NTSTATUS)0x00000111L) #endif #ifndef STATUS_PAGE_FAULT_COPY_ON_WRITE -# define STATUS_PAGE_FAULT_COPY_ON_WRITE ((NTSTATUS) 0x00000112L) +#define STATUS_PAGE_FAULT_COPY_ON_WRITE ((NTSTATUS)0x00000112L) #endif #ifndef STATUS_PAGE_FAULT_GUARD_PAGE -# define STATUS_PAGE_FAULT_GUARD_PAGE ((NTSTATUS) 0x00000113L) +#define STATUS_PAGE_FAULT_GUARD_PAGE ((NTSTATUS)0x00000113L) #endif #ifndef STATUS_PAGE_FAULT_PAGING_FILE -# define STATUS_PAGE_FAULT_PAGING_FILE ((NTSTATUS) 0x00000114L) +#define STATUS_PAGE_FAULT_PAGING_FILE ((NTSTATUS)0x00000114L) #endif #ifndef STATUS_CACHE_PAGE_LOCKED -# define STATUS_CACHE_PAGE_LOCKED ((NTSTATUS) 0x00000115L) +#define STATUS_CACHE_PAGE_LOCKED ((NTSTATUS)0x00000115L) #endif #ifndef STATUS_CRASH_DUMP -# define STATUS_CRASH_DUMP ((NTSTATUS) 0x00000116L) +#define STATUS_CRASH_DUMP ((NTSTATUS)0x00000116L) #endif #ifndef STATUS_BUFFER_ALL_ZEROS -# define STATUS_BUFFER_ALL_ZEROS ((NTSTATUS) 0x00000117L) +#define STATUS_BUFFER_ALL_ZEROS ((NTSTATUS)0x00000117L) #endif #ifndef STATUS_REPARSE_OBJECT -# define STATUS_REPARSE_OBJECT ((NTSTATUS) 0x00000118L) +#define STATUS_REPARSE_OBJECT ((NTSTATUS)0x00000118L) #endif #ifndef STATUS_RESOURCE_REQUIREMENTS_CHANGED -# define STATUS_RESOURCE_REQUIREMENTS_CHANGED ((NTSTATUS) 0x00000119L) +#define STATUS_RESOURCE_REQUIREMENTS_CHANGED ((NTSTATUS)0x00000119L) #endif #ifndef STATUS_TRANSLATION_COMPLETE -# define STATUS_TRANSLATION_COMPLETE ((NTSTATUS) 0x00000120L) +#define STATUS_TRANSLATION_COMPLETE ((NTSTATUS)0x00000120L) #endif #ifndef STATUS_DS_MEMBERSHIP_EVALUATED_LOCALLY -# define STATUS_DS_MEMBERSHIP_EVALUATED_LOCALLY ((NTSTATUS) 0x00000121L) +#define STATUS_DS_MEMBERSHIP_EVALUATED_LOCALLY ((NTSTATUS)0x00000121L) #endif #ifndef STATUS_NOTHING_TO_TERMINATE -# define STATUS_NOTHING_TO_TERMINATE ((NTSTATUS) 0x00000122L) +#define STATUS_NOTHING_TO_TERMINATE ((NTSTATUS)0x00000122L) #endif #ifndef STATUS_PROCESS_NOT_IN_JOB -# define STATUS_PROCESS_NOT_IN_JOB ((NTSTATUS) 0x00000123L) +#define STATUS_PROCESS_NOT_IN_JOB ((NTSTATUS)0x00000123L) #endif #ifndef STATUS_PROCESS_IN_JOB -# define STATUS_PROCESS_IN_JOB ((NTSTATUS) 0x00000124L) +#define STATUS_PROCESS_IN_JOB ((NTSTATUS)0x00000124L) #endif #ifndef STATUS_VOLSNAP_HIBERNATE_READY -# define STATUS_VOLSNAP_HIBERNATE_READY ((NTSTATUS) 0x00000125L) +#define STATUS_VOLSNAP_HIBERNATE_READY ((NTSTATUS)0x00000125L) #endif #ifndef STATUS_FSFILTER_OP_COMPLETED_SUCCESSFULLY -# define STATUS_FSFILTER_OP_COMPLETED_SUCCESSFULLY ((NTSTATUS) 0x00000126L) +#define STATUS_FSFILTER_OP_COMPLETED_SUCCESSFULLY ((NTSTATUS)0x00000126L) #endif #ifndef STATUS_INTERRUPT_VECTOR_ALREADY_CONNECTED -# define STATUS_INTERRUPT_VECTOR_ALREADY_CONNECTED ((NTSTATUS) 0x00000127L) +#define STATUS_INTERRUPT_VECTOR_ALREADY_CONNECTED ((NTSTATUS)0x00000127L) #endif #ifndef STATUS_INTERRUPT_STILL_CONNECTED -# define STATUS_INTERRUPT_STILL_CONNECTED ((NTSTATUS) 0x00000128L) +#define STATUS_INTERRUPT_STILL_CONNECTED ((NTSTATUS)0x00000128L) #endif #ifndef STATUS_PROCESS_CLONED -# define STATUS_PROCESS_CLONED ((NTSTATUS) 0x00000129L) +#define STATUS_PROCESS_CLONED ((NTSTATUS)0x00000129L) #endif #ifndef STATUS_FILE_LOCKED_WITH_ONLY_READERS -# define STATUS_FILE_LOCKED_WITH_ONLY_READERS ((NTSTATUS) 0x0000012AL) +#define STATUS_FILE_LOCKED_WITH_ONLY_READERS ((NTSTATUS)0x0000012AL) #endif #ifndef STATUS_FILE_LOCKED_WITH_WRITERS -# define STATUS_FILE_LOCKED_WITH_WRITERS ((NTSTATUS) 0x0000012BL) +#define STATUS_FILE_LOCKED_WITH_WRITERS ((NTSTATUS)0x0000012BL) #endif #ifndef STATUS_RESOURCEMANAGER_READ_ONLY -# define STATUS_RESOURCEMANAGER_READ_ONLY ((NTSTATUS) 0x00000202L) +#define STATUS_RESOURCEMANAGER_READ_ONLY ((NTSTATUS)0x00000202L) #endif #ifndef STATUS_RING_PREVIOUSLY_EMPTY -# define STATUS_RING_PREVIOUSLY_EMPTY ((NTSTATUS) 0x00000210L) +#define STATUS_RING_PREVIOUSLY_EMPTY ((NTSTATUS)0x00000210L) #endif #ifndef STATUS_RING_PREVIOUSLY_FULL -# define STATUS_RING_PREVIOUSLY_FULL ((NTSTATUS) 0x00000211L) +#define STATUS_RING_PREVIOUSLY_FULL ((NTSTATUS)0x00000211L) #endif #ifndef STATUS_RING_PREVIOUSLY_ABOVE_QUOTA -# define STATUS_RING_PREVIOUSLY_ABOVE_QUOTA ((NTSTATUS) 0x00000212L) +#define STATUS_RING_PREVIOUSLY_ABOVE_QUOTA ((NTSTATUS)0x00000212L) #endif #ifndef STATUS_RING_NEWLY_EMPTY -# define STATUS_RING_NEWLY_EMPTY ((NTSTATUS) 0x00000213L) +#define STATUS_RING_NEWLY_EMPTY ((NTSTATUS)0x00000213L) #endif #ifndef STATUS_RING_SIGNAL_OPPOSITE_ENDPOINT -# define STATUS_RING_SIGNAL_OPPOSITE_ENDPOINT ((NTSTATUS) 0x00000214L) +#define STATUS_RING_SIGNAL_OPPOSITE_ENDPOINT ((NTSTATUS)0x00000214L) #endif #ifndef STATUS_OPLOCK_SWITCHED_TO_NEW_HANDLE -# define STATUS_OPLOCK_SWITCHED_TO_NEW_HANDLE ((NTSTATUS) 0x00000215L) +#define STATUS_OPLOCK_SWITCHED_TO_NEW_HANDLE ((NTSTATUS)0x00000215L) #endif #ifndef STATUS_OPLOCK_HANDLE_CLOSED -# define STATUS_OPLOCK_HANDLE_CLOSED ((NTSTATUS) 0x00000216L) +#define STATUS_OPLOCK_HANDLE_CLOSED ((NTSTATUS)0x00000216L) #endif #ifndef STATUS_WAIT_FOR_OPLOCK -# define STATUS_WAIT_FOR_OPLOCK ((NTSTATUS) 0x00000367L) +#define STATUS_WAIT_FOR_OPLOCK ((NTSTATUS)0x00000367L) #endif #ifndef STATUS_OBJECT_NAME_EXISTS -# define STATUS_OBJECT_NAME_EXISTS ((NTSTATUS) 0x40000000L) +#define STATUS_OBJECT_NAME_EXISTS ((NTSTATUS)0x40000000L) #endif #ifndef STATUS_THREAD_WAS_SUSPENDED -# define STATUS_THREAD_WAS_SUSPENDED ((NTSTATUS) 0x40000001L) +#define STATUS_THREAD_WAS_SUSPENDED ((NTSTATUS)0x40000001L) #endif #ifndef STATUS_WORKING_SET_LIMIT_RANGE -# define STATUS_WORKING_SET_LIMIT_RANGE ((NTSTATUS) 0x40000002L) +#define STATUS_WORKING_SET_LIMIT_RANGE ((NTSTATUS)0x40000002L) #endif #ifndef STATUS_IMAGE_NOT_AT_BASE -# define STATUS_IMAGE_NOT_AT_BASE ((NTSTATUS) 0x40000003L) +#define STATUS_IMAGE_NOT_AT_BASE ((NTSTATUS)0x40000003L) #endif #ifndef STATUS_RXACT_STATE_CREATED -# define STATUS_RXACT_STATE_CREATED ((NTSTATUS) 0x40000004L) +#define STATUS_RXACT_STATE_CREATED ((NTSTATUS)0x40000004L) #endif #ifndef STATUS_SEGMENT_NOTIFICATION -# define STATUS_SEGMENT_NOTIFICATION ((NTSTATUS) 0x40000005L) +#define STATUS_SEGMENT_NOTIFICATION ((NTSTATUS)0x40000005L) #endif #ifndef STATUS_LOCAL_USER_SESSION_KEY -# define STATUS_LOCAL_USER_SESSION_KEY ((NTSTATUS) 0x40000006L) +#define STATUS_LOCAL_USER_SESSION_KEY ((NTSTATUS)0x40000006L) #endif #ifndef STATUS_BAD_CURRENT_DIRECTORY -# define STATUS_BAD_CURRENT_DIRECTORY ((NTSTATUS) 0x40000007L) +#define STATUS_BAD_CURRENT_DIRECTORY ((NTSTATUS)0x40000007L) #endif #ifndef STATUS_SERIAL_MORE_WRITES -# define STATUS_SERIAL_MORE_WRITES ((NTSTATUS) 0x40000008L) +#define STATUS_SERIAL_MORE_WRITES ((NTSTATUS)0x40000008L) #endif #ifndef STATUS_REGISTRY_RECOVERED -# define STATUS_REGISTRY_RECOVERED ((NTSTATUS) 0x40000009L) +#define STATUS_REGISTRY_RECOVERED ((NTSTATUS)0x40000009L) #endif #ifndef STATUS_FT_READ_RECOVERY_FROM_BACKUP -# define STATUS_FT_READ_RECOVERY_FROM_BACKUP ((NTSTATUS) 0x4000000AL) +#define STATUS_FT_READ_RECOVERY_FROM_BACKUP ((NTSTATUS)0x4000000AL) #endif #ifndef STATUS_FT_WRITE_RECOVERY -# define STATUS_FT_WRITE_RECOVERY ((NTSTATUS) 0x4000000BL) +#define STATUS_FT_WRITE_RECOVERY ((NTSTATUS)0x4000000BL) #endif #ifndef STATUS_SERIAL_COUNTER_TIMEOUT -# define STATUS_SERIAL_COUNTER_TIMEOUT ((NTSTATUS) 0x4000000CL) +#define STATUS_SERIAL_COUNTER_TIMEOUT ((NTSTATUS)0x4000000CL) #endif #ifndef STATUS_NULL_LM_PASSWORD -# define STATUS_NULL_LM_PASSWORD ((NTSTATUS) 0x4000000DL) +#define STATUS_NULL_LM_PASSWORD ((NTSTATUS)0x4000000DL) #endif #ifndef STATUS_IMAGE_MACHINE_TYPE_MISMATCH -# define STATUS_IMAGE_MACHINE_TYPE_MISMATCH ((NTSTATUS) 0x4000000EL) +#define STATUS_IMAGE_MACHINE_TYPE_MISMATCH ((NTSTATUS)0x4000000EL) #endif #ifndef STATUS_RECEIVE_PARTIAL -# define STATUS_RECEIVE_PARTIAL ((NTSTATUS) 0x4000000FL) +#define STATUS_RECEIVE_PARTIAL ((NTSTATUS)0x4000000FL) #endif #ifndef STATUS_RECEIVE_EXPEDITED -# define STATUS_RECEIVE_EXPEDITED ((NTSTATUS) 0x40000010L) +#define STATUS_RECEIVE_EXPEDITED ((NTSTATUS)0x40000010L) #endif #ifndef STATUS_RECEIVE_PARTIAL_EXPEDITED -# define STATUS_RECEIVE_PARTIAL_EXPEDITED ((NTSTATUS) 0x40000011L) +#define STATUS_RECEIVE_PARTIAL_EXPEDITED ((NTSTATUS)0x40000011L) #endif #ifndef STATUS_EVENT_DONE -# define STATUS_EVENT_DONE ((NTSTATUS) 0x40000012L) +#define STATUS_EVENT_DONE ((NTSTATUS)0x40000012L) #endif #ifndef STATUS_EVENT_PENDING -# define STATUS_EVENT_PENDING ((NTSTATUS) 0x40000013L) +#define STATUS_EVENT_PENDING ((NTSTATUS)0x40000013L) #endif #ifndef STATUS_CHECKING_FILE_SYSTEM -# define STATUS_CHECKING_FILE_SYSTEM ((NTSTATUS) 0x40000014L) +#define STATUS_CHECKING_FILE_SYSTEM ((NTSTATUS)0x40000014L) #endif #ifndef STATUS_FATAL_APP_EXIT -# define STATUS_FATAL_APP_EXIT ((NTSTATUS) 0x40000015L) +#define STATUS_FATAL_APP_EXIT ((NTSTATUS)0x40000015L) #endif #ifndef STATUS_PREDEFINED_HANDLE -# define STATUS_PREDEFINED_HANDLE ((NTSTATUS) 0x40000016L) +#define STATUS_PREDEFINED_HANDLE ((NTSTATUS)0x40000016L) #endif #ifndef STATUS_WAS_UNLOCKED -# define STATUS_WAS_UNLOCKED ((NTSTATUS) 0x40000017L) +#define STATUS_WAS_UNLOCKED ((NTSTATUS)0x40000017L) #endif #ifndef STATUS_SERVICE_NOTIFICATION -# define STATUS_SERVICE_NOTIFICATION ((NTSTATUS) 0x40000018L) +#define STATUS_SERVICE_NOTIFICATION ((NTSTATUS)0x40000018L) #endif #ifndef STATUS_WAS_LOCKED -# define STATUS_WAS_LOCKED ((NTSTATUS) 0x40000019L) +#define STATUS_WAS_LOCKED ((NTSTATUS)0x40000019L) #endif #ifndef STATUS_LOG_HARD_ERROR -# define STATUS_LOG_HARD_ERROR ((NTSTATUS) 0x4000001AL) +#define STATUS_LOG_HARD_ERROR ((NTSTATUS)0x4000001AL) #endif #ifndef STATUS_ALREADY_WIN32 -# define STATUS_ALREADY_WIN32 ((NTSTATUS) 0x4000001BL) +#define STATUS_ALREADY_WIN32 ((NTSTATUS)0x4000001BL) #endif #ifndef STATUS_WX86_UNSIMULATE -# define STATUS_WX86_UNSIMULATE ((NTSTATUS) 0x4000001CL) +#define STATUS_WX86_UNSIMULATE ((NTSTATUS)0x4000001CL) #endif #ifndef STATUS_WX86_CONTINUE -# define STATUS_WX86_CONTINUE ((NTSTATUS) 0x4000001DL) +#define STATUS_WX86_CONTINUE ((NTSTATUS)0x4000001DL) #endif #ifndef STATUS_WX86_SINGLE_STEP -# define STATUS_WX86_SINGLE_STEP ((NTSTATUS) 0x4000001EL) +#define STATUS_WX86_SINGLE_STEP ((NTSTATUS)0x4000001EL) #endif #ifndef STATUS_WX86_BREAKPOINT -# define STATUS_WX86_BREAKPOINT ((NTSTATUS) 0x4000001FL) +#define STATUS_WX86_BREAKPOINT ((NTSTATUS)0x4000001FL) #endif #ifndef STATUS_WX86_EXCEPTION_CONTINUE -# define STATUS_WX86_EXCEPTION_CONTINUE ((NTSTATUS) 0x40000020L) +#define STATUS_WX86_EXCEPTION_CONTINUE ((NTSTATUS)0x40000020L) #endif #ifndef STATUS_WX86_EXCEPTION_LASTCHANCE -# define STATUS_WX86_EXCEPTION_LASTCHANCE ((NTSTATUS) 0x40000021L) +#define STATUS_WX86_EXCEPTION_LASTCHANCE ((NTSTATUS)0x40000021L) #endif #ifndef STATUS_WX86_EXCEPTION_CHAIN -# define STATUS_WX86_EXCEPTION_CHAIN ((NTSTATUS) 0x40000022L) +#define STATUS_WX86_EXCEPTION_CHAIN ((NTSTATUS)0x40000022L) #endif #ifndef STATUS_IMAGE_MACHINE_TYPE_MISMATCH_EXE -# define STATUS_IMAGE_MACHINE_TYPE_MISMATCH_EXE ((NTSTATUS) 0x40000023L) +#define STATUS_IMAGE_MACHINE_TYPE_MISMATCH_EXE ((NTSTATUS)0x40000023L) #endif #ifndef STATUS_NO_YIELD_PERFORMED -# define STATUS_NO_YIELD_PERFORMED ((NTSTATUS) 0x40000024L) +#define STATUS_NO_YIELD_PERFORMED ((NTSTATUS)0x40000024L) #endif #ifndef STATUS_TIMER_RESUME_IGNORED -# define STATUS_TIMER_RESUME_IGNORED ((NTSTATUS) 0x40000025L) +#define STATUS_TIMER_RESUME_IGNORED ((NTSTATUS)0x40000025L) #endif #ifndef STATUS_ARBITRATION_UNHANDLED -# define STATUS_ARBITRATION_UNHANDLED ((NTSTATUS) 0x40000026L) +#define STATUS_ARBITRATION_UNHANDLED ((NTSTATUS)0x40000026L) #endif #ifndef STATUS_CARDBUS_NOT_SUPPORTED -# define STATUS_CARDBUS_NOT_SUPPORTED ((NTSTATUS) 0x40000027L) +#define STATUS_CARDBUS_NOT_SUPPORTED ((NTSTATUS)0x40000027L) #endif #ifndef STATUS_WX86_CREATEWX86TIB -# define STATUS_WX86_CREATEWX86TIB ((NTSTATUS) 0x40000028L) +#define STATUS_WX86_CREATEWX86TIB ((NTSTATUS)0x40000028L) #endif #ifndef STATUS_MP_PROCESSOR_MISMATCH -# define STATUS_MP_PROCESSOR_MISMATCH ((NTSTATUS) 0x40000029L) +#define STATUS_MP_PROCESSOR_MISMATCH ((NTSTATUS)0x40000029L) #endif #ifndef STATUS_HIBERNATED -# define STATUS_HIBERNATED ((NTSTATUS) 0x4000002AL) +#define STATUS_HIBERNATED ((NTSTATUS)0x4000002AL) #endif #ifndef STATUS_RESUME_HIBERNATION -# define STATUS_RESUME_HIBERNATION ((NTSTATUS) 0x4000002BL) +#define STATUS_RESUME_HIBERNATION ((NTSTATUS)0x4000002BL) #endif #ifndef STATUS_FIRMWARE_UPDATED -# define STATUS_FIRMWARE_UPDATED ((NTSTATUS) 0x4000002CL) +#define STATUS_FIRMWARE_UPDATED ((NTSTATUS)0x4000002CL) #endif #ifndef STATUS_DRIVERS_LEAKING_LOCKED_PAGES -# define STATUS_DRIVERS_LEAKING_LOCKED_PAGES ((NTSTATUS) 0x4000002DL) +#define STATUS_DRIVERS_LEAKING_LOCKED_PAGES ((NTSTATUS)0x4000002DL) #endif #ifndef STATUS_MESSAGE_RETRIEVED -# define STATUS_MESSAGE_RETRIEVED ((NTSTATUS) 0x4000002EL) +#define STATUS_MESSAGE_RETRIEVED ((NTSTATUS)0x4000002EL) #endif #ifndef STATUS_SYSTEM_POWERSTATE_TRANSITION -# define STATUS_SYSTEM_POWERSTATE_TRANSITION ((NTSTATUS) 0x4000002FL) +#define STATUS_SYSTEM_POWERSTATE_TRANSITION ((NTSTATUS)0x4000002FL) #endif #ifndef STATUS_ALPC_CHECK_COMPLETION_LIST -# define STATUS_ALPC_CHECK_COMPLETION_LIST ((NTSTATUS) 0x40000030L) +#define STATUS_ALPC_CHECK_COMPLETION_LIST ((NTSTATUS)0x40000030L) #endif #ifndef STATUS_SYSTEM_POWERSTATE_COMPLEX_TRANSITION -# define STATUS_SYSTEM_POWERSTATE_COMPLEX_TRANSITION ((NTSTATUS) 0x40000031L) +#define STATUS_SYSTEM_POWERSTATE_COMPLEX_TRANSITION ((NTSTATUS)0x40000031L) #endif #ifndef STATUS_ACCESS_AUDIT_BY_POLICY -# define STATUS_ACCESS_AUDIT_BY_POLICY ((NTSTATUS) 0x40000032L) +#define STATUS_ACCESS_AUDIT_BY_POLICY ((NTSTATUS)0x40000032L) #endif #ifndef STATUS_ABANDON_HIBERFILE -# define STATUS_ABANDON_HIBERFILE ((NTSTATUS) 0x40000033L) +#define STATUS_ABANDON_HIBERFILE ((NTSTATUS)0x40000033L) #endif #ifndef STATUS_BIZRULES_NOT_ENABLED -# define STATUS_BIZRULES_NOT_ENABLED ((NTSTATUS) 0x40000034L) +#define STATUS_BIZRULES_NOT_ENABLED ((NTSTATUS)0x40000034L) #endif #ifndef STATUS_GUARD_PAGE_VIOLATION -# define STATUS_GUARD_PAGE_VIOLATION ((NTSTATUS) 0x80000001L) +#define STATUS_GUARD_PAGE_VIOLATION ((NTSTATUS)0x80000001L) #endif #ifndef STATUS_DATATYPE_MISALIGNMENT -# define STATUS_DATATYPE_MISALIGNMENT ((NTSTATUS) 0x80000002L) +#define STATUS_DATATYPE_MISALIGNMENT ((NTSTATUS)0x80000002L) #endif #ifndef STATUS_BREAKPOINT -# define STATUS_BREAKPOINT ((NTSTATUS) 0x80000003L) +#define STATUS_BREAKPOINT ((NTSTATUS)0x80000003L) #endif #ifndef STATUS_SINGLE_STEP -# define STATUS_SINGLE_STEP ((NTSTATUS) 0x80000004L) +#define STATUS_SINGLE_STEP ((NTSTATUS)0x80000004L) #endif #ifndef STATUS_BUFFER_OVERFLOW -# define STATUS_BUFFER_OVERFLOW ((NTSTATUS) 0x80000005L) +#define STATUS_BUFFER_OVERFLOW ((NTSTATUS)0x80000005L) #endif #ifndef STATUS_NO_MORE_FILES -# define STATUS_NO_MORE_FILES ((NTSTATUS) 0x80000006L) +#define STATUS_NO_MORE_FILES ((NTSTATUS)0x80000006L) #endif #ifndef STATUS_WAKE_SYSTEM_DEBUGGER -# define STATUS_WAKE_SYSTEM_DEBUGGER ((NTSTATUS) 0x80000007L) +#define STATUS_WAKE_SYSTEM_DEBUGGER ((NTSTATUS)0x80000007L) #endif #ifndef STATUS_HANDLES_CLOSED -# define STATUS_HANDLES_CLOSED ((NTSTATUS) 0x8000000AL) +#define STATUS_HANDLES_CLOSED ((NTSTATUS)0x8000000AL) #endif #ifndef STATUS_NO_INHERITANCE -# define STATUS_NO_INHERITANCE ((NTSTATUS) 0x8000000BL) +#define STATUS_NO_INHERITANCE ((NTSTATUS)0x8000000BL) #endif #ifndef STATUS_GUID_SUBSTITUTION_MADE -# define STATUS_GUID_SUBSTITUTION_MADE ((NTSTATUS) 0x8000000CL) +#define STATUS_GUID_SUBSTITUTION_MADE ((NTSTATUS)0x8000000CL) #endif #ifndef STATUS_PARTIAL_COPY -# define STATUS_PARTIAL_COPY ((NTSTATUS) 0x8000000DL) +#define STATUS_PARTIAL_COPY ((NTSTATUS)0x8000000DL) #endif #ifndef STATUS_DEVICE_PAPER_EMPTY -# define STATUS_DEVICE_PAPER_EMPTY ((NTSTATUS) 0x8000000EL) +#define STATUS_DEVICE_PAPER_EMPTY ((NTSTATUS)0x8000000EL) #endif #ifndef STATUS_DEVICE_POWERED_OFF -# define STATUS_DEVICE_POWERED_OFF ((NTSTATUS) 0x8000000FL) +#define STATUS_DEVICE_POWERED_OFF ((NTSTATUS)0x8000000FL) #endif #ifndef STATUS_DEVICE_OFF_LINE -# define STATUS_DEVICE_OFF_LINE ((NTSTATUS) 0x80000010L) +#define STATUS_DEVICE_OFF_LINE ((NTSTATUS)0x80000010L) #endif #ifndef STATUS_DEVICE_BUSY -# define STATUS_DEVICE_BUSY ((NTSTATUS) 0x80000011L) +#define STATUS_DEVICE_BUSY ((NTSTATUS)0x80000011L) #endif #ifndef STATUS_NO_MORE_EAS -# define STATUS_NO_MORE_EAS ((NTSTATUS) 0x80000012L) +#define STATUS_NO_MORE_EAS ((NTSTATUS)0x80000012L) #endif #ifndef STATUS_INVALID_EA_NAME -# define STATUS_INVALID_EA_NAME ((NTSTATUS) 0x80000013L) +#define STATUS_INVALID_EA_NAME ((NTSTATUS)0x80000013L) #endif #ifndef STATUS_EA_LIST_INCONSISTENT -# define STATUS_EA_LIST_INCONSISTENT ((NTSTATUS) 0x80000014L) +#define STATUS_EA_LIST_INCONSISTENT ((NTSTATUS)0x80000014L) #endif #ifndef STATUS_INVALID_EA_FLAG -# define STATUS_INVALID_EA_FLAG ((NTSTATUS) 0x80000015L) +#define STATUS_INVALID_EA_FLAG ((NTSTATUS)0x80000015L) #endif #ifndef STATUS_VERIFY_REQUIRED -# define STATUS_VERIFY_REQUIRED ((NTSTATUS) 0x80000016L) +#define STATUS_VERIFY_REQUIRED ((NTSTATUS)0x80000016L) #endif #ifndef STATUS_EXTRANEOUS_INFORMATION -# define STATUS_EXTRANEOUS_INFORMATION ((NTSTATUS) 0x80000017L) +#define STATUS_EXTRANEOUS_INFORMATION ((NTSTATUS)0x80000017L) #endif #ifndef STATUS_RXACT_COMMIT_NECESSARY -# define STATUS_RXACT_COMMIT_NECESSARY ((NTSTATUS) 0x80000018L) +#define STATUS_RXACT_COMMIT_NECESSARY ((NTSTATUS)0x80000018L) #endif #ifndef STATUS_NO_MORE_ENTRIES -# define STATUS_NO_MORE_ENTRIES ((NTSTATUS) 0x8000001AL) +#define STATUS_NO_MORE_ENTRIES ((NTSTATUS)0x8000001AL) #endif #ifndef STATUS_FILEMARK_DETECTED -# define STATUS_FILEMARK_DETECTED ((NTSTATUS) 0x8000001BL) +#define STATUS_FILEMARK_DETECTED ((NTSTATUS)0x8000001BL) #endif #ifndef STATUS_MEDIA_CHANGED -# define STATUS_MEDIA_CHANGED ((NTSTATUS) 0x8000001CL) +#define STATUS_MEDIA_CHANGED ((NTSTATUS)0x8000001CL) #endif #ifndef STATUS_BUS_RESET -# define STATUS_BUS_RESET ((NTSTATUS) 0x8000001DL) +#define STATUS_BUS_RESET ((NTSTATUS)0x8000001DL) #endif #ifndef STATUS_END_OF_MEDIA -# define STATUS_END_OF_MEDIA ((NTSTATUS) 0x8000001EL) +#define STATUS_END_OF_MEDIA ((NTSTATUS)0x8000001EL) #endif #ifndef STATUS_BEGINNING_OF_MEDIA -# define STATUS_BEGINNING_OF_MEDIA ((NTSTATUS) 0x8000001FL) +#define STATUS_BEGINNING_OF_MEDIA ((NTSTATUS)0x8000001FL) #endif #ifndef STATUS_MEDIA_CHECK -# define STATUS_MEDIA_CHECK ((NTSTATUS) 0x80000020L) +#define STATUS_MEDIA_CHECK ((NTSTATUS)0x80000020L) #endif #ifndef STATUS_SETMARK_DETECTED -# define STATUS_SETMARK_DETECTED ((NTSTATUS) 0x80000021L) +#define STATUS_SETMARK_DETECTED ((NTSTATUS)0x80000021L) #endif #ifndef STATUS_NO_DATA_DETECTED -# define STATUS_NO_DATA_DETECTED ((NTSTATUS) 0x80000022L) +#define STATUS_NO_DATA_DETECTED ((NTSTATUS)0x80000022L) #endif #ifndef STATUS_REDIRECTOR_HAS_OPEN_HANDLES -# define STATUS_REDIRECTOR_HAS_OPEN_HANDLES ((NTSTATUS) 0x80000023L) +#define STATUS_REDIRECTOR_HAS_OPEN_HANDLES ((NTSTATUS)0x80000023L) #endif #ifndef STATUS_SERVER_HAS_OPEN_HANDLES -# define STATUS_SERVER_HAS_OPEN_HANDLES ((NTSTATUS) 0x80000024L) +#define STATUS_SERVER_HAS_OPEN_HANDLES ((NTSTATUS)0x80000024L) #endif #ifndef STATUS_ALREADY_DISCONNECTED -# define STATUS_ALREADY_DISCONNECTED ((NTSTATUS) 0x80000025L) +#define STATUS_ALREADY_DISCONNECTED ((NTSTATUS)0x80000025L) #endif #ifndef STATUS_LONGJUMP -# define STATUS_LONGJUMP ((NTSTATUS) 0x80000026L) +#define STATUS_LONGJUMP ((NTSTATUS)0x80000026L) #endif #ifndef STATUS_CLEANER_CARTRIDGE_INSTALLED -# define STATUS_CLEANER_CARTRIDGE_INSTALLED ((NTSTATUS) 0x80000027L) +#define STATUS_CLEANER_CARTRIDGE_INSTALLED ((NTSTATUS)0x80000027L) #endif #ifndef STATUS_PLUGPLAY_QUERY_VETOED -# define STATUS_PLUGPLAY_QUERY_VETOED ((NTSTATUS) 0x80000028L) +#define STATUS_PLUGPLAY_QUERY_VETOED ((NTSTATUS)0x80000028L) #endif #ifndef STATUS_UNWIND_CONSOLIDATE -# define STATUS_UNWIND_CONSOLIDATE ((NTSTATUS) 0x80000029L) +#define STATUS_UNWIND_CONSOLIDATE ((NTSTATUS)0x80000029L) #endif #ifndef STATUS_REGISTRY_HIVE_RECOVERED -# define STATUS_REGISTRY_HIVE_RECOVERED ((NTSTATUS) 0x8000002AL) +#define STATUS_REGISTRY_HIVE_RECOVERED ((NTSTATUS)0x8000002AL) #endif #ifndef STATUS_DLL_MIGHT_BE_INSECURE -# define STATUS_DLL_MIGHT_BE_INSECURE ((NTSTATUS) 0x8000002BL) +#define STATUS_DLL_MIGHT_BE_INSECURE ((NTSTATUS)0x8000002BL) #endif #ifndef STATUS_DLL_MIGHT_BE_INCOMPATIBLE -# define STATUS_DLL_MIGHT_BE_INCOMPATIBLE ((NTSTATUS) 0x8000002CL) +#define STATUS_DLL_MIGHT_BE_INCOMPATIBLE ((NTSTATUS)0x8000002CL) #endif #ifndef STATUS_STOPPED_ON_SYMLINK -# define STATUS_STOPPED_ON_SYMLINK ((NTSTATUS) 0x8000002DL) +#define STATUS_STOPPED_ON_SYMLINK ((NTSTATUS)0x8000002DL) #endif #ifndef STATUS_CANNOT_GRANT_REQUESTED_OPLOCK -# define STATUS_CANNOT_GRANT_REQUESTED_OPLOCK ((NTSTATUS) 0x8000002EL) +#define STATUS_CANNOT_GRANT_REQUESTED_OPLOCK ((NTSTATUS)0x8000002EL) #endif #ifndef STATUS_NO_ACE_CONDITION -# define STATUS_NO_ACE_CONDITION ((NTSTATUS) 0x8000002FL) +#define STATUS_NO_ACE_CONDITION ((NTSTATUS)0x8000002FL) #endif #ifndef STATUS_UNSUCCESSFUL -# define STATUS_UNSUCCESSFUL ((NTSTATUS) 0xC0000001L) +#define STATUS_UNSUCCESSFUL ((NTSTATUS)0xC0000001L) #endif #ifndef STATUS_NOT_IMPLEMENTED -# define STATUS_NOT_IMPLEMENTED ((NTSTATUS) 0xC0000002L) +#define STATUS_NOT_IMPLEMENTED ((NTSTATUS)0xC0000002L) #endif #ifndef STATUS_INVALID_INFO_CLASS -# define STATUS_INVALID_INFO_CLASS ((NTSTATUS) 0xC0000003L) +#define STATUS_INVALID_INFO_CLASS ((NTSTATUS)0xC0000003L) #endif #ifndef STATUS_INFO_LENGTH_MISMATCH -# define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS) 0xC0000004L) +#define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004L) #endif #ifndef STATUS_ACCESS_VIOLATION -# define STATUS_ACCESS_VIOLATION ((NTSTATUS) 0xC0000005L) +#define STATUS_ACCESS_VIOLATION ((NTSTATUS)0xC0000005L) #endif #ifndef STATUS_IN_PAGE_ERROR -# define STATUS_IN_PAGE_ERROR ((NTSTATUS) 0xC0000006L) +#define STATUS_IN_PAGE_ERROR ((NTSTATUS)0xC0000006L) #endif #ifndef STATUS_PAGEFILE_QUOTA -# define STATUS_PAGEFILE_QUOTA ((NTSTATUS) 0xC0000007L) +#define STATUS_PAGEFILE_QUOTA ((NTSTATUS)0xC0000007L) #endif #ifndef STATUS_INVALID_HANDLE -# define STATUS_INVALID_HANDLE ((NTSTATUS) 0xC0000008L) +#define STATUS_INVALID_HANDLE ((NTSTATUS)0xC0000008L) #endif #ifndef STATUS_BAD_INITIAL_STACK -# define STATUS_BAD_INITIAL_STACK ((NTSTATUS) 0xC0000009L) +#define STATUS_BAD_INITIAL_STACK ((NTSTATUS)0xC0000009L) #endif #ifndef STATUS_BAD_INITIAL_PC -# define STATUS_BAD_INITIAL_PC ((NTSTATUS) 0xC000000AL) +#define STATUS_BAD_INITIAL_PC ((NTSTATUS)0xC000000AL) #endif #ifndef STATUS_INVALID_CID -# define STATUS_INVALID_CID ((NTSTATUS) 0xC000000BL) +#define STATUS_INVALID_CID ((NTSTATUS)0xC000000BL) #endif #ifndef STATUS_TIMER_NOT_CANCELED -# define STATUS_TIMER_NOT_CANCELED ((NTSTATUS) 0xC000000CL) +#define STATUS_TIMER_NOT_CANCELED ((NTSTATUS)0xC000000CL) #endif #ifndef STATUS_INVALID_PARAMETER -# define STATUS_INVALID_PARAMETER ((NTSTATUS) 0xC000000DL) +#define STATUS_INVALID_PARAMETER ((NTSTATUS)0xC000000DL) #endif #ifndef STATUS_NO_SUCH_DEVICE -# define STATUS_NO_SUCH_DEVICE ((NTSTATUS) 0xC000000EL) +#define STATUS_NO_SUCH_DEVICE ((NTSTATUS)0xC000000EL) #endif #ifndef STATUS_NO_SUCH_FILE -# define STATUS_NO_SUCH_FILE ((NTSTATUS) 0xC000000FL) +#define STATUS_NO_SUCH_FILE ((NTSTATUS)0xC000000FL) #endif #ifndef STATUS_INVALID_DEVICE_REQUEST -# define STATUS_INVALID_DEVICE_REQUEST ((NTSTATUS) 0xC0000010L) +#define STATUS_INVALID_DEVICE_REQUEST ((NTSTATUS)0xC0000010L) #endif #ifndef STATUS_END_OF_FILE -# define STATUS_END_OF_FILE ((NTSTATUS) 0xC0000011L) +#define STATUS_END_OF_FILE ((NTSTATUS)0xC0000011L) #endif #ifndef STATUS_WRONG_VOLUME -# define STATUS_WRONG_VOLUME ((NTSTATUS) 0xC0000012L) +#define STATUS_WRONG_VOLUME ((NTSTATUS)0xC0000012L) #endif #ifndef STATUS_NO_MEDIA_IN_DEVICE -# define STATUS_NO_MEDIA_IN_DEVICE ((NTSTATUS) 0xC0000013L) +#define STATUS_NO_MEDIA_IN_DEVICE ((NTSTATUS)0xC0000013L) #endif #ifndef STATUS_UNRECOGNIZED_MEDIA -# define STATUS_UNRECOGNIZED_MEDIA ((NTSTATUS) 0xC0000014L) +#define STATUS_UNRECOGNIZED_MEDIA ((NTSTATUS)0xC0000014L) #endif #ifndef STATUS_NONEXISTENT_SECTOR -# define STATUS_NONEXISTENT_SECTOR ((NTSTATUS) 0xC0000015L) +#define STATUS_NONEXISTENT_SECTOR ((NTSTATUS)0xC0000015L) #endif #ifndef STATUS_MORE_PROCESSING_REQUIRED -# define STATUS_MORE_PROCESSING_REQUIRED ((NTSTATUS) 0xC0000016L) +#define STATUS_MORE_PROCESSING_REQUIRED ((NTSTATUS)0xC0000016L) #endif #ifndef STATUS_NO_MEMORY -# define STATUS_NO_MEMORY ((NTSTATUS) 0xC0000017L) +#define STATUS_NO_MEMORY ((NTSTATUS)0xC0000017L) #endif #ifndef STATUS_CONFLICTING_ADDRESSES -# define STATUS_CONFLICTING_ADDRESSES ((NTSTATUS) 0xC0000018L) +#define STATUS_CONFLICTING_ADDRESSES ((NTSTATUS)0xC0000018L) #endif #ifndef STATUS_NOT_MAPPED_VIEW -# define STATUS_NOT_MAPPED_VIEW ((NTSTATUS) 0xC0000019L) +#define STATUS_NOT_MAPPED_VIEW ((NTSTATUS)0xC0000019L) #endif #ifndef STATUS_UNABLE_TO_FREE_VM -# define STATUS_UNABLE_TO_FREE_VM ((NTSTATUS) 0xC000001AL) +#define STATUS_UNABLE_TO_FREE_VM ((NTSTATUS)0xC000001AL) #endif #ifndef STATUS_UNABLE_TO_DELETE_SECTION -# define STATUS_UNABLE_TO_DELETE_SECTION ((NTSTATUS) 0xC000001BL) +#define STATUS_UNABLE_TO_DELETE_SECTION ((NTSTATUS)0xC000001BL) #endif #ifndef STATUS_INVALID_SYSTEM_SERVICE -# define STATUS_INVALID_SYSTEM_SERVICE ((NTSTATUS) 0xC000001CL) +#define STATUS_INVALID_SYSTEM_SERVICE ((NTSTATUS)0xC000001CL) #endif #ifndef STATUS_ILLEGAL_INSTRUCTION -# define STATUS_ILLEGAL_INSTRUCTION ((NTSTATUS) 0xC000001DL) +#define STATUS_ILLEGAL_INSTRUCTION ((NTSTATUS)0xC000001DL) #endif #ifndef STATUS_INVALID_LOCK_SEQUENCE -# define STATUS_INVALID_LOCK_SEQUENCE ((NTSTATUS) 0xC000001EL) +#define STATUS_INVALID_LOCK_SEQUENCE ((NTSTATUS)0xC000001EL) #endif #ifndef STATUS_INVALID_VIEW_SIZE -# define STATUS_INVALID_VIEW_SIZE ((NTSTATUS) 0xC000001FL) +#define STATUS_INVALID_VIEW_SIZE ((NTSTATUS)0xC000001FL) #endif #ifndef STATUS_INVALID_FILE_FOR_SECTION -# define STATUS_INVALID_FILE_FOR_SECTION ((NTSTATUS) 0xC0000020L) +#define STATUS_INVALID_FILE_FOR_SECTION ((NTSTATUS)0xC0000020L) #endif #ifndef STATUS_ALREADY_COMMITTED -# define STATUS_ALREADY_COMMITTED ((NTSTATUS) 0xC0000021L) +#define STATUS_ALREADY_COMMITTED ((NTSTATUS)0xC0000021L) #endif #ifndef STATUS_ACCESS_DENIED -# define STATUS_ACCESS_DENIED ((NTSTATUS) 0xC0000022L) +#define STATUS_ACCESS_DENIED ((NTSTATUS)0xC0000022L) #endif #ifndef STATUS_BUFFER_TOO_SMALL -# define STATUS_BUFFER_TOO_SMALL ((NTSTATUS) 0xC0000023L) +#define STATUS_BUFFER_TOO_SMALL ((NTSTATUS)0xC0000023L) #endif #ifndef STATUS_OBJECT_TYPE_MISMATCH -# define STATUS_OBJECT_TYPE_MISMATCH ((NTSTATUS) 0xC0000024L) +#define STATUS_OBJECT_TYPE_MISMATCH ((NTSTATUS)0xC0000024L) #endif #ifndef STATUS_NONCONTINUABLE_EXCEPTION -# define STATUS_NONCONTINUABLE_EXCEPTION ((NTSTATUS) 0xC0000025L) +#define STATUS_NONCONTINUABLE_EXCEPTION ((NTSTATUS)0xC0000025L) #endif #ifndef STATUS_INVALID_DISPOSITION -# define STATUS_INVALID_DISPOSITION ((NTSTATUS) 0xC0000026L) +#define STATUS_INVALID_DISPOSITION ((NTSTATUS)0xC0000026L) #endif #ifndef STATUS_UNWIND -# define STATUS_UNWIND ((NTSTATUS) 0xC0000027L) +#define STATUS_UNWIND ((NTSTATUS)0xC0000027L) #endif #ifndef STATUS_BAD_STACK -# define STATUS_BAD_STACK ((NTSTATUS) 0xC0000028L) +#define STATUS_BAD_STACK ((NTSTATUS)0xC0000028L) #endif #ifndef STATUS_INVALID_UNWIND_TARGET -# define STATUS_INVALID_UNWIND_TARGET ((NTSTATUS) 0xC0000029L) +#define STATUS_INVALID_UNWIND_TARGET ((NTSTATUS)0xC0000029L) #endif #ifndef STATUS_NOT_LOCKED -# define STATUS_NOT_LOCKED ((NTSTATUS) 0xC000002AL) +#define STATUS_NOT_LOCKED ((NTSTATUS)0xC000002AL) #endif #ifndef STATUS_PARITY_ERROR -# define STATUS_PARITY_ERROR ((NTSTATUS) 0xC000002BL) +#define STATUS_PARITY_ERROR ((NTSTATUS)0xC000002BL) #endif #ifndef STATUS_UNABLE_TO_DECOMMIT_VM -# define STATUS_UNABLE_TO_DECOMMIT_VM ((NTSTATUS) 0xC000002CL) +#define STATUS_UNABLE_TO_DECOMMIT_VM ((NTSTATUS)0xC000002CL) #endif #ifndef STATUS_NOT_COMMITTED -# define STATUS_NOT_COMMITTED ((NTSTATUS) 0xC000002DL) +#define STATUS_NOT_COMMITTED ((NTSTATUS)0xC000002DL) #endif #ifndef STATUS_INVALID_PORT_ATTRIBUTES -# define STATUS_INVALID_PORT_ATTRIBUTES ((NTSTATUS) 0xC000002EL) +#define STATUS_INVALID_PORT_ATTRIBUTES ((NTSTATUS)0xC000002EL) #endif #ifndef STATUS_PORT_MESSAGE_TOO_LONG -# define STATUS_PORT_MESSAGE_TOO_LONG ((NTSTATUS) 0xC000002FL) +#define STATUS_PORT_MESSAGE_TOO_LONG ((NTSTATUS)0xC000002FL) #endif #ifndef STATUS_INVALID_PARAMETER_MIX -# define STATUS_INVALID_PARAMETER_MIX ((NTSTATUS) 0xC0000030L) +#define STATUS_INVALID_PARAMETER_MIX ((NTSTATUS)0xC0000030L) #endif #ifndef STATUS_INVALID_QUOTA_LOWER -# define STATUS_INVALID_QUOTA_LOWER ((NTSTATUS) 0xC0000031L) +#define STATUS_INVALID_QUOTA_LOWER ((NTSTATUS)0xC0000031L) #endif #ifndef STATUS_DISK_CORRUPT_ERROR -# define STATUS_DISK_CORRUPT_ERROR ((NTSTATUS) 0xC0000032L) +#define STATUS_DISK_CORRUPT_ERROR ((NTSTATUS)0xC0000032L) #endif #ifndef STATUS_OBJECT_NAME_INVALID -# define STATUS_OBJECT_NAME_INVALID ((NTSTATUS) 0xC0000033L) +#define STATUS_OBJECT_NAME_INVALID ((NTSTATUS)0xC0000033L) #endif #ifndef STATUS_OBJECT_NAME_NOT_FOUND -# define STATUS_OBJECT_NAME_NOT_FOUND ((NTSTATUS) 0xC0000034L) +#define STATUS_OBJECT_NAME_NOT_FOUND ((NTSTATUS)0xC0000034L) #endif #ifndef STATUS_OBJECT_NAME_COLLISION -# define STATUS_OBJECT_NAME_COLLISION ((NTSTATUS) 0xC0000035L) +#define STATUS_OBJECT_NAME_COLLISION ((NTSTATUS)0xC0000035L) #endif #ifndef STATUS_PORT_DISCONNECTED -# define STATUS_PORT_DISCONNECTED ((NTSTATUS) 0xC0000037L) +#define STATUS_PORT_DISCONNECTED ((NTSTATUS)0xC0000037L) #endif #ifndef STATUS_DEVICE_ALREADY_ATTACHED -# define STATUS_DEVICE_ALREADY_ATTACHED ((NTSTATUS) 0xC0000038L) +#define STATUS_DEVICE_ALREADY_ATTACHED ((NTSTATUS)0xC0000038L) #endif #ifndef STATUS_OBJECT_PATH_INVALID -# define STATUS_OBJECT_PATH_INVALID ((NTSTATUS) 0xC0000039L) +#define STATUS_OBJECT_PATH_INVALID ((NTSTATUS)0xC0000039L) #endif #ifndef STATUS_OBJECT_PATH_NOT_FOUND -# define STATUS_OBJECT_PATH_NOT_FOUND ((NTSTATUS) 0xC000003AL) +#define STATUS_OBJECT_PATH_NOT_FOUND ((NTSTATUS)0xC000003AL) #endif #ifndef STATUS_OBJECT_PATH_SYNTAX_BAD -# define STATUS_OBJECT_PATH_SYNTAX_BAD ((NTSTATUS) 0xC000003BL) +#define STATUS_OBJECT_PATH_SYNTAX_BAD ((NTSTATUS)0xC000003BL) #endif #ifndef STATUS_DATA_OVERRUN -# define STATUS_DATA_OVERRUN ((NTSTATUS) 0xC000003CL) +#define STATUS_DATA_OVERRUN ((NTSTATUS)0xC000003CL) #endif #ifndef STATUS_DATA_LATE_ERROR -# define STATUS_DATA_LATE_ERROR ((NTSTATUS) 0xC000003DL) +#define STATUS_DATA_LATE_ERROR ((NTSTATUS)0xC000003DL) #endif #ifndef STATUS_DATA_ERROR -# define STATUS_DATA_ERROR ((NTSTATUS) 0xC000003EL) +#define STATUS_DATA_ERROR ((NTSTATUS)0xC000003EL) #endif #ifndef STATUS_CRC_ERROR -# define STATUS_CRC_ERROR ((NTSTATUS) 0xC000003FL) +#define STATUS_CRC_ERROR ((NTSTATUS)0xC000003FL) #endif #ifndef STATUS_SECTION_TOO_BIG -# define STATUS_SECTION_TOO_BIG ((NTSTATUS) 0xC0000040L) +#define STATUS_SECTION_TOO_BIG ((NTSTATUS)0xC0000040L) #endif #ifndef STATUS_PORT_CONNECTION_REFUSED -# define STATUS_PORT_CONNECTION_REFUSED ((NTSTATUS) 0xC0000041L) +#define STATUS_PORT_CONNECTION_REFUSED ((NTSTATUS)0xC0000041L) #endif #ifndef STATUS_INVALID_PORT_HANDLE -# define STATUS_INVALID_PORT_HANDLE ((NTSTATUS) 0xC0000042L) +#define STATUS_INVALID_PORT_HANDLE ((NTSTATUS)0xC0000042L) #endif #ifndef STATUS_SHARING_VIOLATION -# define STATUS_SHARING_VIOLATION ((NTSTATUS) 0xC0000043L) +#define STATUS_SHARING_VIOLATION ((NTSTATUS)0xC0000043L) #endif #ifndef STATUS_QUOTA_EXCEEDED -# define STATUS_QUOTA_EXCEEDED ((NTSTATUS) 0xC0000044L) +#define STATUS_QUOTA_EXCEEDED ((NTSTATUS)0xC0000044L) #endif #ifndef STATUS_INVALID_PAGE_PROTECTION -# define STATUS_INVALID_PAGE_PROTECTION ((NTSTATUS) 0xC0000045L) +#define STATUS_INVALID_PAGE_PROTECTION ((NTSTATUS)0xC0000045L) #endif #ifndef STATUS_MUTANT_NOT_OWNED -# define STATUS_MUTANT_NOT_OWNED ((NTSTATUS) 0xC0000046L) +#define STATUS_MUTANT_NOT_OWNED ((NTSTATUS)0xC0000046L) #endif #ifndef STATUS_SEMAPHORE_LIMIT_EXCEEDED -# define STATUS_SEMAPHORE_LIMIT_EXCEEDED ((NTSTATUS) 0xC0000047L) +#define STATUS_SEMAPHORE_LIMIT_EXCEEDED ((NTSTATUS)0xC0000047L) #endif #ifndef STATUS_PORT_ALREADY_SET -# define STATUS_PORT_ALREADY_SET ((NTSTATUS) 0xC0000048L) +#define STATUS_PORT_ALREADY_SET ((NTSTATUS)0xC0000048L) #endif #ifndef STATUS_SECTION_NOT_IMAGE -# define STATUS_SECTION_NOT_IMAGE ((NTSTATUS) 0xC0000049L) +#define STATUS_SECTION_NOT_IMAGE ((NTSTATUS)0xC0000049L) #endif #ifndef STATUS_SUSPEND_COUNT_EXCEEDED -# define STATUS_SUSPEND_COUNT_EXCEEDED ((NTSTATUS) 0xC000004AL) +#define STATUS_SUSPEND_COUNT_EXCEEDED ((NTSTATUS)0xC000004AL) #endif #ifndef STATUS_THREAD_IS_TERMINATING -# define STATUS_THREAD_IS_TERMINATING ((NTSTATUS) 0xC000004BL) +#define STATUS_THREAD_IS_TERMINATING ((NTSTATUS)0xC000004BL) #endif #ifndef STATUS_BAD_WORKING_SET_LIMIT -# define STATUS_BAD_WORKING_SET_LIMIT ((NTSTATUS) 0xC000004CL) +#define STATUS_BAD_WORKING_SET_LIMIT ((NTSTATUS)0xC000004CL) #endif #ifndef STATUS_INCOMPATIBLE_FILE_MAP -# define STATUS_INCOMPATIBLE_FILE_MAP ((NTSTATUS) 0xC000004DL) +#define STATUS_INCOMPATIBLE_FILE_MAP ((NTSTATUS)0xC000004DL) #endif #ifndef STATUS_SECTION_PROTECTION -# define STATUS_SECTION_PROTECTION ((NTSTATUS) 0xC000004EL) +#define STATUS_SECTION_PROTECTION ((NTSTATUS)0xC000004EL) #endif #ifndef STATUS_EAS_NOT_SUPPORTED -# define STATUS_EAS_NOT_SUPPORTED ((NTSTATUS) 0xC000004FL) +#define STATUS_EAS_NOT_SUPPORTED ((NTSTATUS)0xC000004FL) #endif #ifndef STATUS_EA_TOO_LARGE -# define STATUS_EA_TOO_LARGE ((NTSTATUS) 0xC0000050L) +#define STATUS_EA_TOO_LARGE ((NTSTATUS)0xC0000050L) #endif #ifndef STATUS_NONEXISTENT_EA_ENTRY -# define STATUS_NONEXISTENT_EA_ENTRY ((NTSTATUS) 0xC0000051L) +#define STATUS_NONEXISTENT_EA_ENTRY ((NTSTATUS)0xC0000051L) #endif #ifndef STATUS_NO_EAS_ON_FILE -# define STATUS_NO_EAS_ON_FILE ((NTSTATUS) 0xC0000052L) +#define STATUS_NO_EAS_ON_FILE ((NTSTATUS)0xC0000052L) #endif #ifndef STATUS_EA_CORRUPT_ERROR -# define STATUS_EA_CORRUPT_ERROR ((NTSTATUS) 0xC0000053L) +#define STATUS_EA_CORRUPT_ERROR ((NTSTATUS)0xC0000053L) #endif #ifndef STATUS_FILE_LOCK_CONFLICT -# define STATUS_FILE_LOCK_CONFLICT ((NTSTATUS) 0xC0000054L) +#define STATUS_FILE_LOCK_CONFLICT ((NTSTATUS)0xC0000054L) #endif #ifndef STATUS_LOCK_NOT_GRANTED -# define STATUS_LOCK_NOT_GRANTED ((NTSTATUS) 0xC0000055L) +#define STATUS_LOCK_NOT_GRANTED ((NTSTATUS)0xC0000055L) #endif #ifndef STATUS_DELETE_PENDING -# define STATUS_DELETE_PENDING ((NTSTATUS) 0xC0000056L) +#define STATUS_DELETE_PENDING ((NTSTATUS)0xC0000056L) #endif #ifndef STATUS_CTL_FILE_NOT_SUPPORTED -# define STATUS_CTL_FILE_NOT_SUPPORTED ((NTSTATUS) 0xC0000057L) +#define STATUS_CTL_FILE_NOT_SUPPORTED ((NTSTATUS)0xC0000057L) #endif #ifndef STATUS_UNKNOWN_REVISION -# define STATUS_UNKNOWN_REVISION ((NTSTATUS) 0xC0000058L) +#define STATUS_UNKNOWN_REVISION ((NTSTATUS)0xC0000058L) #endif #ifndef STATUS_REVISION_MISMATCH -# define STATUS_REVISION_MISMATCH ((NTSTATUS) 0xC0000059L) +#define STATUS_REVISION_MISMATCH ((NTSTATUS)0xC0000059L) #endif #ifndef STATUS_INVALID_OWNER -# define STATUS_INVALID_OWNER ((NTSTATUS) 0xC000005AL) +#define STATUS_INVALID_OWNER ((NTSTATUS)0xC000005AL) #endif #ifndef STATUS_INVALID_PRIMARY_GROUP -# define STATUS_INVALID_PRIMARY_GROUP ((NTSTATUS) 0xC000005BL) +#define STATUS_INVALID_PRIMARY_GROUP ((NTSTATUS)0xC000005BL) #endif #ifndef STATUS_NO_IMPERSONATION_TOKEN -# define STATUS_NO_IMPERSONATION_TOKEN ((NTSTATUS) 0xC000005CL) +#define STATUS_NO_IMPERSONATION_TOKEN ((NTSTATUS)0xC000005CL) #endif #ifndef STATUS_CANT_DISABLE_MANDATORY -# define STATUS_CANT_DISABLE_MANDATORY ((NTSTATUS) 0xC000005DL) +#define STATUS_CANT_DISABLE_MANDATORY ((NTSTATUS)0xC000005DL) #endif #ifndef STATUS_NO_LOGON_SERVERS -# define STATUS_NO_LOGON_SERVERS ((NTSTATUS) 0xC000005EL) +#define STATUS_NO_LOGON_SERVERS ((NTSTATUS)0xC000005EL) #endif #ifndef STATUS_NO_SUCH_LOGON_SESSION -# define STATUS_NO_SUCH_LOGON_SESSION ((NTSTATUS) 0xC000005FL) +#define STATUS_NO_SUCH_LOGON_SESSION ((NTSTATUS)0xC000005FL) #endif #ifndef STATUS_NO_SUCH_PRIVILEGE -# define STATUS_NO_SUCH_PRIVILEGE ((NTSTATUS) 0xC0000060L) +#define STATUS_NO_SUCH_PRIVILEGE ((NTSTATUS)0xC0000060L) #endif #ifndef STATUS_PRIVILEGE_NOT_HELD -# define STATUS_PRIVILEGE_NOT_HELD ((NTSTATUS) 0xC0000061L) +#define STATUS_PRIVILEGE_NOT_HELD ((NTSTATUS)0xC0000061L) #endif #ifndef STATUS_INVALID_ACCOUNT_NAME -# define STATUS_INVALID_ACCOUNT_NAME ((NTSTATUS) 0xC0000062L) +#define STATUS_INVALID_ACCOUNT_NAME ((NTSTATUS)0xC0000062L) #endif #ifndef STATUS_USER_EXISTS -# define STATUS_USER_EXISTS ((NTSTATUS) 0xC0000063L) +#define STATUS_USER_EXISTS ((NTSTATUS)0xC0000063L) #endif #ifndef STATUS_NO_SUCH_USER -# define STATUS_NO_SUCH_USER ((NTSTATUS) 0xC0000064L) +#define STATUS_NO_SUCH_USER ((NTSTATUS)0xC0000064L) #endif #ifndef STATUS_GROUP_EXISTS -# define STATUS_GROUP_EXISTS ((NTSTATUS) 0xC0000065L) +#define STATUS_GROUP_EXISTS ((NTSTATUS)0xC0000065L) #endif #ifndef STATUS_NO_SUCH_GROUP -# define STATUS_NO_SUCH_GROUP ((NTSTATUS) 0xC0000066L) +#define STATUS_NO_SUCH_GROUP ((NTSTATUS)0xC0000066L) #endif #ifndef STATUS_MEMBER_IN_GROUP -# define STATUS_MEMBER_IN_GROUP ((NTSTATUS) 0xC0000067L) +#define STATUS_MEMBER_IN_GROUP ((NTSTATUS)0xC0000067L) #endif #ifndef STATUS_MEMBER_NOT_IN_GROUP -# define STATUS_MEMBER_NOT_IN_GROUP ((NTSTATUS) 0xC0000068L) +#define STATUS_MEMBER_NOT_IN_GROUP ((NTSTATUS)0xC0000068L) #endif #ifndef STATUS_LAST_ADMIN -# define STATUS_LAST_ADMIN ((NTSTATUS) 0xC0000069L) +#define STATUS_LAST_ADMIN ((NTSTATUS)0xC0000069L) #endif #ifndef STATUS_WRONG_PASSWORD -# define STATUS_WRONG_PASSWORD ((NTSTATUS) 0xC000006AL) +#define STATUS_WRONG_PASSWORD ((NTSTATUS)0xC000006AL) #endif #ifndef STATUS_ILL_FORMED_PASSWORD -# define STATUS_ILL_FORMED_PASSWORD ((NTSTATUS) 0xC000006BL) +#define STATUS_ILL_FORMED_PASSWORD ((NTSTATUS)0xC000006BL) #endif #ifndef STATUS_PASSWORD_RESTRICTION -# define STATUS_PASSWORD_RESTRICTION ((NTSTATUS) 0xC000006CL) +#define STATUS_PASSWORD_RESTRICTION ((NTSTATUS)0xC000006CL) #endif #ifndef STATUS_LOGON_FAILURE -# define STATUS_LOGON_FAILURE ((NTSTATUS) 0xC000006DL) +#define STATUS_LOGON_FAILURE ((NTSTATUS)0xC000006DL) #endif #ifndef STATUS_ACCOUNT_RESTRICTION -# define STATUS_ACCOUNT_RESTRICTION ((NTSTATUS) 0xC000006EL) +#define STATUS_ACCOUNT_RESTRICTION ((NTSTATUS)0xC000006EL) #endif #ifndef STATUS_INVALID_LOGON_HOURS -# define STATUS_INVALID_LOGON_HOURS ((NTSTATUS) 0xC000006FL) +#define STATUS_INVALID_LOGON_HOURS ((NTSTATUS)0xC000006FL) #endif #ifndef STATUS_INVALID_WORKSTATION -# define STATUS_INVALID_WORKSTATION ((NTSTATUS) 0xC0000070L) +#define STATUS_INVALID_WORKSTATION ((NTSTATUS)0xC0000070L) #endif #ifndef STATUS_PASSWORD_EXPIRED -# define STATUS_PASSWORD_EXPIRED ((NTSTATUS) 0xC0000071L) +#define STATUS_PASSWORD_EXPIRED ((NTSTATUS)0xC0000071L) #endif #ifndef STATUS_ACCOUNT_DISABLED -# define STATUS_ACCOUNT_DISABLED ((NTSTATUS) 0xC0000072L) +#define STATUS_ACCOUNT_DISABLED ((NTSTATUS)0xC0000072L) #endif #ifndef STATUS_NONE_MAPPED -# define STATUS_NONE_MAPPED ((NTSTATUS) 0xC0000073L) +#define STATUS_NONE_MAPPED ((NTSTATUS)0xC0000073L) #endif #ifndef STATUS_TOO_MANY_LUIDS_REQUESTED -# define STATUS_TOO_MANY_LUIDS_REQUESTED ((NTSTATUS) 0xC0000074L) +#define STATUS_TOO_MANY_LUIDS_REQUESTED ((NTSTATUS)0xC0000074L) #endif #ifndef STATUS_LUIDS_EXHAUSTED -# define STATUS_LUIDS_EXHAUSTED ((NTSTATUS) 0xC0000075L) +#define STATUS_LUIDS_EXHAUSTED ((NTSTATUS)0xC0000075L) #endif #ifndef STATUS_INVALID_SUB_AUTHORITY -# define STATUS_INVALID_SUB_AUTHORITY ((NTSTATUS) 0xC0000076L) +#define STATUS_INVALID_SUB_AUTHORITY ((NTSTATUS)0xC0000076L) #endif #ifndef STATUS_INVALID_ACL -# define STATUS_INVALID_ACL ((NTSTATUS) 0xC0000077L) +#define STATUS_INVALID_ACL ((NTSTATUS)0xC0000077L) #endif #ifndef STATUS_INVALID_SID -# define STATUS_INVALID_SID ((NTSTATUS) 0xC0000078L) +#define STATUS_INVALID_SID ((NTSTATUS)0xC0000078L) #endif #ifndef STATUS_INVALID_SECURITY_DESCR -# define STATUS_INVALID_SECURITY_DESCR ((NTSTATUS) 0xC0000079L) +#define STATUS_INVALID_SECURITY_DESCR ((NTSTATUS)0xC0000079L) #endif #ifndef STATUS_PROCEDURE_NOT_FOUND -# define STATUS_PROCEDURE_NOT_FOUND ((NTSTATUS) 0xC000007AL) +#define STATUS_PROCEDURE_NOT_FOUND ((NTSTATUS)0xC000007AL) #endif #ifndef STATUS_INVALID_IMAGE_FORMAT -# define STATUS_INVALID_IMAGE_FORMAT ((NTSTATUS) 0xC000007BL) +#define STATUS_INVALID_IMAGE_FORMAT ((NTSTATUS)0xC000007BL) #endif #ifndef STATUS_NO_TOKEN -# define STATUS_NO_TOKEN ((NTSTATUS) 0xC000007CL) +#define STATUS_NO_TOKEN ((NTSTATUS)0xC000007CL) #endif #ifndef STATUS_BAD_INHERITANCE_ACL -# define STATUS_BAD_INHERITANCE_ACL ((NTSTATUS) 0xC000007DL) +#define STATUS_BAD_INHERITANCE_ACL ((NTSTATUS)0xC000007DL) #endif #ifndef STATUS_RANGE_NOT_LOCKED -# define STATUS_RANGE_NOT_LOCKED ((NTSTATUS) 0xC000007EL) +#define STATUS_RANGE_NOT_LOCKED ((NTSTATUS)0xC000007EL) #endif #ifndef STATUS_DISK_FULL -# define STATUS_DISK_FULL ((NTSTATUS) 0xC000007FL) +#define STATUS_DISK_FULL ((NTSTATUS)0xC000007FL) #endif #ifndef STATUS_SERVER_DISABLED -# define STATUS_SERVER_DISABLED ((NTSTATUS) 0xC0000080L) +#define STATUS_SERVER_DISABLED ((NTSTATUS)0xC0000080L) #endif #ifndef STATUS_SERVER_NOT_DISABLED -# define STATUS_SERVER_NOT_DISABLED ((NTSTATUS) 0xC0000081L) +#define STATUS_SERVER_NOT_DISABLED ((NTSTATUS)0xC0000081L) #endif #ifndef STATUS_TOO_MANY_GUIDS_REQUESTED -# define STATUS_TOO_MANY_GUIDS_REQUESTED ((NTSTATUS) 0xC0000082L) +#define STATUS_TOO_MANY_GUIDS_REQUESTED ((NTSTATUS)0xC0000082L) #endif #ifndef STATUS_GUIDS_EXHAUSTED -# define STATUS_GUIDS_EXHAUSTED ((NTSTATUS) 0xC0000083L) +#define STATUS_GUIDS_EXHAUSTED ((NTSTATUS)0xC0000083L) #endif #ifndef STATUS_INVALID_ID_AUTHORITY -# define STATUS_INVALID_ID_AUTHORITY ((NTSTATUS) 0xC0000084L) +#define STATUS_INVALID_ID_AUTHORITY ((NTSTATUS)0xC0000084L) #endif #ifndef STATUS_AGENTS_EXHAUSTED -# define STATUS_AGENTS_EXHAUSTED ((NTSTATUS) 0xC0000085L) +#define STATUS_AGENTS_EXHAUSTED ((NTSTATUS)0xC0000085L) #endif #ifndef STATUS_INVALID_VOLUME_LABEL -# define STATUS_INVALID_VOLUME_LABEL ((NTSTATUS) 0xC0000086L) +#define STATUS_INVALID_VOLUME_LABEL ((NTSTATUS)0xC0000086L) #endif #ifndef STATUS_SECTION_NOT_EXTENDED -# define STATUS_SECTION_NOT_EXTENDED ((NTSTATUS) 0xC0000087L) +#define STATUS_SECTION_NOT_EXTENDED ((NTSTATUS)0xC0000087L) #endif #ifndef STATUS_NOT_MAPPED_DATA -# define STATUS_NOT_MAPPED_DATA ((NTSTATUS) 0xC0000088L) +#define STATUS_NOT_MAPPED_DATA ((NTSTATUS)0xC0000088L) #endif #ifndef STATUS_RESOURCE_DATA_NOT_FOUND -# define STATUS_RESOURCE_DATA_NOT_FOUND ((NTSTATUS) 0xC0000089L) +#define STATUS_RESOURCE_DATA_NOT_FOUND ((NTSTATUS)0xC0000089L) #endif #ifndef STATUS_RESOURCE_TYPE_NOT_FOUND -# define STATUS_RESOURCE_TYPE_NOT_FOUND ((NTSTATUS) 0xC000008AL) +#define STATUS_RESOURCE_TYPE_NOT_FOUND ((NTSTATUS)0xC000008AL) #endif #ifndef STATUS_RESOURCE_NAME_NOT_FOUND -# define STATUS_RESOURCE_NAME_NOT_FOUND ((NTSTATUS) 0xC000008BL) +#define STATUS_RESOURCE_NAME_NOT_FOUND ((NTSTATUS)0xC000008BL) #endif #ifndef STATUS_ARRAY_BOUNDS_EXCEEDED -# define STATUS_ARRAY_BOUNDS_EXCEEDED ((NTSTATUS) 0xC000008CL) +#define STATUS_ARRAY_BOUNDS_EXCEEDED ((NTSTATUS)0xC000008CL) #endif #ifndef STATUS_FLOAT_DENORMAL_OPERAND -# define STATUS_FLOAT_DENORMAL_OPERAND ((NTSTATUS) 0xC000008DL) +#define STATUS_FLOAT_DENORMAL_OPERAND ((NTSTATUS)0xC000008DL) #endif #ifndef STATUS_FLOAT_DIVIDE_BY_ZERO -# define STATUS_FLOAT_DIVIDE_BY_ZERO ((NTSTATUS) 0xC000008EL) +#define STATUS_FLOAT_DIVIDE_BY_ZERO ((NTSTATUS)0xC000008EL) #endif #ifndef STATUS_FLOAT_INEXACT_RESULT -# define STATUS_FLOAT_INEXACT_RESULT ((NTSTATUS) 0xC000008FL) +#define STATUS_FLOAT_INEXACT_RESULT ((NTSTATUS)0xC000008FL) #endif #ifndef STATUS_FLOAT_INVALID_OPERATION -# define STATUS_FLOAT_INVALID_OPERATION ((NTSTATUS) 0xC0000090L) +#define STATUS_FLOAT_INVALID_OPERATION ((NTSTATUS)0xC0000090L) #endif #ifndef STATUS_FLOAT_OVERFLOW -# define STATUS_FLOAT_OVERFLOW ((NTSTATUS) 0xC0000091L) +#define STATUS_FLOAT_OVERFLOW ((NTSTATUS)0xC0000091L) #endif #ifndef STATUS_FLOAT_STACK_CHECK -# define STATUS_FLOAT_STACK_CHECK ((NTSTATUS) 0xC0000092L) +#define STATUS_FLOAT_STACK_CHECK ((NTSTATUS)0xC0000092L) #endif #ifndef STATUS_FLOAT_UNDERFLOW -# define STATUS_FLOAT_UNDERFLOW ((NTSTATUS) 0xC0000093L) +#define STATUS_FLOAT_UNDERFLOW ((NTSTATUS)0xC0000093L) #endif #ifndef STATUS_INTEGER_DIVIDE_BY_ZERO -# define STATUS_INTEGER_DIVIDE_BY_ZERO ((NTSTATUS) 0xC0000094L) +#define STATUS_INTEGER_DIVIDE_BY_ZERO ((NTSTATUS)0xC0000094L) #endif #ifndef STATUS_INTEGER_OVERFLOW -# define STATUS_INTEGER_OVERFLOW ((NTSTATUS) 0xC0000095L) +#define STATUS_INTEGER_OVERFLOW ((NTSTATUS)0xC0000095L) #endif #ifndef STATUS_PRIVILEGED_INSTRUCTION -# define STATUS_PRIVILEGED_INSTRUCTION ((NTSTATUS) 0xC0000096L) +#define STATUS_PRIVILEGED_INSTRUCTION ((NTSTATUS)0xC0000096L) #endif #ifndef STATUS_TOO_MANY_PAGING_FILES -# define STATUS_TOO_MANY_PAGING_FILES ((NTSTATUS) 0xC0000097L) +#define STATUS_TOO_MANY_PAGING_FILES ((NTSTATUS)0xC0000097L) #endif #ifndef STATUS_FILE_INVALID -# define STATUS_FILE_INVALID ((NTSTATUS) 0xC0000098L) +#define STATUS_FILE_INVALID ((NTSTATUS)0xC0000098L) #endif #ifndef STATUS_ALLOTTED_SPACE_EXCEEDED -# define STATUS_ALLOTTED_SPACE_EXCEEDED ((NTSTATUS) 0xC0000099L) +#define STATUS_ALLOTTED_SPACE_EXCEEDED ((NTSTATUS)0xC0000099L) #endif #ifndef STATUS_INSUFFICIENT_RESOURCES -# define STATUS_INSUFFICIENT_RESOURCES ((NTSTATUS) 0xC000009AL) +#define STATUS_INSUFFICIENT_RESOURCES ((NTSTATUS)0xC000009AL) #endif #ifndef STATUS_DFS_EXIT_PATH_FOUND -# define STATUS_DFS_EXIT_PATH_FOUND ((NTSTATUS) 0xC000009BL) +#define STATUS_DFS_EXIT_PATH_FOUND ((NTSTATUS)0xC000009BL) #endif #ifndef STATUS_DEVICE_DATA_ERROR -# define STATUS_DEVICE_DATA_ERROR ((NTSTATUS) 0xC000009CL) +#define STATUS_DEVICE_DATA_ERROR ((NTSTATUS)0xC000009CL) #endif #ifndef STATUS_DEVICE_NOT_CONNECTED -# define STATUS_DEVICE_NOT_CONNECTED ((NTSTATUS) 0xC000009DL) +#define STATUS_DEVICE_NOT_CONNECTED ((NTSTATUS)0xC000009DL) #endif #ifndef STATUS_DEVICE_POWER_FAILURE -# define STATUS_DEVICE_POWER_FAILURE ((NTSTATUS) 0xC000009EL) +#define STATUS_DEVICE_POWER_FAILURE ((NTSTATUS)0xC000009EL) #endif #ifndef STATUS_FREE_VM_NOT_AT_BASE -# define STATUS_FREE_VM_NOT_AT_BASE ((NTSTATUS) 0xC000009FL) +#define STATUS_FREE_VM_NOT_AT_BASE ((NTSTATUS)0xC000009FL) #endif #ifndef STATUS_MEMORY_NOT_ALLOCATED -# define STATUS_MEMORY_NOT_ALLOCATED ((NTSTATUS) 0xC00000A0L) +#define STATUS_MEMORY_NOT_ALLOCATED ((NTSTATUS)0xC00000A0L) #endif #ifndef STATUS_WORKING_SET_QUOTA -# define STATUS_WORKING_SET_QUOTA ((NTSTATUS) 0xC00000A1L) +#define STATUS_WORKING_SET_QUOTA ((NTSTATUS)0xC00000A1L) #endif #ifndef STATUS_MEDIA_WRITE_PROTECTED -# define STATUS_MEDIA_WRITE_PROTECTED ((NTSTATUS) 0xC00000A2L) +#define STATUS_MEDIA_WRITE_PROTECTED ((NTSTATUS)0xC00000A2L) #endif #ifndef STATUS_DEVICE_NOT_READY -# define STATUS_DEVICE_NOT_READY ((NTSTATUS) 0xC00000A3L) +#define STATUS_DEVICE_NOT_READY ((NTSTATUS)0xC00000A3L) #endif #ifndef STATUS_INVALID_GROUP_ATTRIBUTES -# define STATUS_INVALID_GROUP_ATTRIBUTES ((NTSTATUS) 0xC00000A4L) +#define STATUS_INVALID_GROUP_ATTRIBUTES ((NTSTATUS)0xC00000A4L) #endif #ifndef STATUS_BAD_IMPERSONATION_LEVEL -# define STATUS_BAD_IMPERSONATION_LEVEL ((NTSTATUS) 0xC00000A5L) +#define STATUS_BAD_IMPERSONATION_LEVEL ((NTSTATUS)0xC00000A5L) #endif #ifndef STATUS_CANT_OPEN_ANONYMOUS -# define STATUS_CANT_OPEN_ANONYMOUS ((NTSTATUS) 0xC00000A6L) +#define STATUS_CANT_OPEN_ANONYMOUS ((NTSTATUS)0xC00000A6L) #endif #ifndef STATUS_BAD_VALIDATION_CLASS -# define STATUS_BAD_VALIDATION_CLASS ((NTSTATUS) 0xC00000A7L) +#define STATUS_BAD_VALIDATION_CLASS ((NTSTATUS)0xC00000A7L) #endif #ifndef STATUS_BAD_TOKEN_TYPE -# define STATUS_BAD_TOKEN_TYPE ((NTSTATUS) 0xC00000A8L) +#define STATUS_BAD_TOKEN_TYPE ((NTSTATUS)0xC00000A8L) #endif #ifndef STATUS_BAD_MASTER_BOOT_RECORD -# define STATUS_BAD_MASTER_BOOT_RECORD ((NTSTATUS) 0xC00000A9L) +#define STATUS_BAD_MASTER_BOOT_RECORD ((NTSTATUS)0xC00000A9L) #endif #ifndef STATUS_INSTRUCTION_MISALIGNMENT -# define STATUS_INSTRUCTION_MISALIGNMENT ((NTSTATUS) 0xC00000AAL) +#define STATUS_INSTRUCTION_MISALIGNMENT ((NTSTATUS)0xC00000AAL) #endif #ifndef STATUS_INSTANCE_NOT_AVAILABLE -# define STATUS_INSTANCE_NOT_AVAILABLE ((NTSTATUS) 0xC00000ABL) +#define STATUS_INSTANCE_NOT_AVAILABLE ((NTSTATUS)0xC00000ABL) #endif #ifndef STATUS_PIPE_NOT_AVAILABLE -# define STATUS_PIPE_NOT_AVAILABLE ((NTSTATUS) 0xC00000ACL) +#define STATUS_PIPE_NOT_AVAILABLE ((NTSTATUS)0xC00000ACL) #endif #ifndef STATUS_INVALID_PIPE_STATE -# define STATUS_INVALID_PIPE_STATE ((NTSTATUS) 0xC00000ADL) +#define STATUS_INVALID_PIPE_STATE ((NTSTATUS)0xC00000ADL) #endif #ifndef STATUS_PIPE_BUSY -# define STATUS_PIPE_BUSY ((NTSTATUS) 0xC00000AEL) +#define STATUS_PIPE_BUSY ((NTSTATUS)0xC00000AEL) #endif #ifndef STATUS_ILLEGAL_FUNCTION -# define STATUS_ILLEGAL_FUNCTION ((NTSTATUS) 0xC00000AFL) +#define STATUS_ILLEGAL_FUNCTION ((NTSTATUS)0xC00000AFL) #endif #ifndef STATUS_PIPE_DISCONNECTED -# define STATUS_PIPE_DISCONNECTED ((NTSTATUS) 0xC00000B0L) +#define STATUS_PIPE_DISCONNECTED ((NTSTATUS)0xC00000B0L) #endif #ifndef STATUS_PIPE_CLOSING -# define STATUS_PIPE_CLOSING ((NTSTATUS) 0xC00000B1L) +#define STATUS_PIPE_CLOSING ((NTSTATUS)0xC00000B1L) #endif #ifndef STATUS_PIPE_CONNECTED -# define STATUS_PIPE_CONNECTED ((NTSTATUS) 0xC00000B2L) +#define STATUS_PIPE_CONNECTED ((NTSTATUS)0xC00000B2L) #endif #ifndef STATUS_PIPE_LISTENING -# define STATUS_PIPE_LISTENING ((NTSTATUS) 0xC00000B3L) +#define STATUS_PIPE_LISTENING ((NTSTATUS)0xC00000B3L) #endif #ifndef STATUS_INVALID_READ_MODE -# define STATUS_INVALID_READ_MODE ((NTSTATUS) 0xC00000B4L) +#define STATUS_INVALID_READ_MODE ((NTSTATUS)0xC00000B4L) #endif #ifndef STATUS_IO_TIMEOUT -# define STATUS_IO_TIMEOUT ((NTSTATUS) 0xC00000B5L) +#define STATUS_IO_TIMEOUT ((NTSTATUS)0xC00000B5L) #endif #ifndef STATUS_FILE_FORCED_CLOSED -# define STATUS_FILE_FORCED_CLOSED ((NTSTATUS) 0xC00000B6L) +#define STATUS_FILE_FORCED_CLOSED ((NTSTATUS)0xC00000B6L) #endif #ifndef STATUS_PROFILING_NOT_STARTED -# define STATUS_PROFILING_NOT_STARTED ((NTSTATUS) 0xC00000B7L) +#define STATUS_PROFILING_NOT_STARTED ((NTSTATUS)0xC00000B7L) #endif #ifndef STATUS_PROFILING_NOT_STOPPED -# define STATUS_PROFILING_NOT_STOPPED ((NTSTATUS) 0xC00000B8L) +#define STATUS_PROFILING_NOT_STOPPED ((NTSTATUS)0xC00000B8L) #endif #ifndef STATUS_COULD_NOT_INTERPRET -# define STATUS_COULD_NOT_INTERPRET ((NTSTATUS) 0xC00000B9L) +#define STATUS_COULD_NOT_INTERPRET ((NTSTATUS)0xC00000B9L) #endif #ifndef STATUS_FILE_IS_A_DIRECTORY -# define STATUS_FILE_IS_A_DIRECTORY ((NTSTATUS) 0xC00000BAL) +#define STATUS_FILE_IS_A_DIRECTORY ((NTSTATUS)0xC00000BAL) #endif #ifndef STATUS_NOT_SUPPORTED -# define STATUS_NOT_SUPPORTED ((NTSTATUS) 0xC00000BBL) +#define STATUS_NOT_SUPPORTED ((NTSTATUS)0xC00000BBL) #endif #ifndef STATUS_REMOTE_NOT_LISTENING -# define STATUS_REMOTE_NOT_LISTENING ((NTSTATUS) 0xC00000BCL) +#define STATUS_REMOTE_NOT_LISTENING ((NTSTATUS)0xC00000BCL) #endif #ifndef STATUS_DUPLICATE_NAME -# define STATUS_DUPLICATE_NAME ((NTSTATUS) 0xC00000BDL) +#define STATUS_DUPLICATE_NAME ((NTSTATUS)0xC00000BDL) #endif #ifndef STATUS_BAD_NETWORK_PATH -# define STATUS_BAD_NETWORK_PATH ((NTSTATUS) 0xC00000BEL) +#define STATUS_BAD_NETWORK_PATH ((NTSTATUS)0xC00000BEL) #endif #ifndef STATUS_NETWORK_BUSY -# define STATUS_NETWORK_BUSY ((NTSTATUS) 0xC00000BFL) +#define STATUS_NETWORK_BUSY ((NTSTATUS)0xC00000BFL) #endif #ifndef STATUS_DEVICE_DOES_NOT_EXIST -# define STATUS_DEVICE_DOES_NOT_EXIST ((NTSTATUS) 0xC00000C0L) +#define STATUS_DEVICE_DOES_NOT_EXIST ((NTSTATUS)0xC00000C0L) #endif #ifndef STATUS_TOO_MANY_COMMANDS -# define STATUS_TOO_MANY_COMMANDS ((NTSTATUS) 0xC00000C1L) +#define STATUS_TOO_MANY_COMMANDS ((NTSTATUS)0xC00000C1L) #endif #ifndef STATUS_ADAPTER_HARDWARE_ERROR -# define STATUS_ADAPTER_HARDWARE_ERROR ((NTSTATUS) 0xC00000C2L) +#define STATUS_ADAPTER_HARDWARE_ERROR ((NTSTATUS)0xC00000C2L) #endif #ifndef STATUS_INVALID_NETWORK_RESPONSE -# define STATUS_INVALID_NETWORK_RESPONSE ((NTSTATUS) 0xC00000C3L) +#define STATUS_INVALID_NETWORK_RESPONSE ((NTSTATUS)0xC00000C3L) #endif #ifndef STATUS_UNEXPECTED_NETWORK_ERROR -# define STATUS_UNEXPECTED_NETWORK_ERROR ((NTSTATUS) 0xC00000C4L) +#define STATUS_UNEXPECTED_NETWORK_ERROR ((NTSTATUS)0xC00000C4L) #endif #ifndef STATUS_BAD_REMOTE_ADAPTER -# define STATUS_BAD_REMOTE_ADAPTER ((NTSTATUS) 0xC00000C5L) +#define STATUS_BAD_REMOTE_ADAPTER ((NTSTATUS)0xC00000C5L) #endif #ifndef STATUS_PRINT_QUEUE_FULL -# define STATUS_PRINT_QUEUE_FULL ((NTSTATUS) 0xC00000C6L) +#define STATUS_PRINT_QUEUE_FULL ((NTSTATUS)0xC00000C6L) #endif #ifndef STATUS_NO_SPOOL_SPACE -# define STATUS_NO_SPOOL_SPACE ((NTSTATUS) 0xC00000C7L) +#define STATUS_NO_SPOOL_SPACE ((NTSTATUS)0xC00000C7L) #endif #ifndef STATUS_PRINT_CANCELLED -# define STATUS_PRINT_CANCELLED ((NTSTATUS) 0xC00000C8L) +#define STATUS_PRINT_CANCELLED ((NTSTATUS)0xC00000C8L) #endif #ifndef STATUS_NETWORK_NAME_DELETED -# define STATUS_NETWORK_NAME_DELETED ((NTSTATUS) 0xC00000C9L) +#define STATUS_NETWORK_NAME_DELETED ((NTSTATUS)0xC00000C9L) #endif #ifndef STATUS_NETWORK_ACCESS_DENIED -# define STATUS_NETWORK_ACCESS_DENIED ((NTSTATUS) 0xC00000CAL) +#define STATUS_NETWORK_ACCESS_DENIED ((NTSTATUS)0xC00000CAL) #endif #ifndef STATUS_BAD_DEVICE_TYPE -# define STATUS_BAD_DEVICE_TYPE ((NTSTATUS) 0xC00000CBL) +#define STATUS_BAD_DEVICE_TYPE ((NTSTATUS)0xC00000CBL) #endif #ifndef STATUS_BAD_NETWORK_NAME -# define STATUS_BAD_NETWORK_NAME ((NTSTATUS) 0xC00000CCL) +#define STATUS_BAD_NETWORK_NAME ((NTSTATUS)0xC00000CCL) #endif #ifndef STATUS_TOO_MANY_NAMES -# define STATUS_TOO_MANY_NAMES ((NTSTATUS) 0xC00000CDL) +#define STATUS_TOO_MANY_NAMES ((NTSTATUS)0xC00000CDL) #endif #ifndef STATUS_TOO_MANY_SESSIONS -# define STATUS_TOO_MANY_SESSIONS ((NTSTATUS) 0xC00000CEL) +#define STATUS_TOO_MANY_SESSIONS ((NTSTATUS)0xC00000CEL) #endif #ifndef STATUS_SHARING_PAUSED -# define STATUS_SHARING_PAUSED ((NTSTATUS) 0xC00000CFL) +#define STATUS_SHARING_PAUSED ((NTSTATUS)0xC00000CFL) #endif #ifndef STATUS_REQUEST_NOT_ACCEPTED -# define STATUS_REQUEST_NOT_ACCEPTED ((NTSTATUS) 0xC00000D0L) +#define STATUS_REQUEST_NOT_ACCEPTED ((NTSTATUS)0xC00000D0L) #endif #ifndef STATUS_REDIRECTOR_PAUSED -# define STATUS_REDIRECTOR_PAUSED ((NTSTATUS) 0xC00000D1L) +#define STATUS_REDIRECTOR_PAUSED ((NTSTATUS)0xC00000D1L) #endif #ifndef STATUS_NET_WRITE_FAULT -# define STATUS_NET_WRITE_FAULT ((NTSTATUS) 0xC00000D2L) +#define STATUS_NET_WRITE_FAULT ((NTSTATUS)0xC00000D2L) #endif #ifndef STATUS_PROFILING_AT_LIMIT -# define STATUS_PROFILING_AT_LIMIT ((NTSTATUS) 0xC00000D3L) +#define STATUS_PROFILING_AT_LIMIT ((NTSTATUS)0xC00000D3L) #endif #ifndef STATUS_NOT_SAME_DEVICE -# define STATUS_NOT_SAME_DEVICE ((NTSTATUS) 0xC00000D4L) +#define STATUS_NOT_SAME_DEVICE ((NTSTATUS)0xC00000D4L) #endif #ifndef STATUS_FILE_RENAMED -# define STATUS_FILE_RENAMED ((NTSTATUS) 0xC00000D5L) +#define STATUS_FILE_RENAMED ((NTSTATUS)0xC00000D5L) #endif #ifndef STATUS_VIRTUAL_CIRCUIT_CLOSED -# define STATUS_VIRTUAL_CIRCUIT_CLOSED ((NTSTATUS) 0xC00000D6L) +#define STATUS_VIRTUAL_CIRCUIT_CLOSED ((NTSTATUS)0xC00000D6L) #endif #ifndef STATUS_NO_SECURITY_ON_OBJECT -# define STATUS_NO_SECURITY_ON_OBJECT ((NTSTATUS) 0xC00000D7L) +#define STATUS_NO_SECURITY_ON_OBJECT ((NTSTATUS)0xC00000D7L) #endif #ifndef STATUS_CANT_WAIT -# define STATUS_CANT_WAIT ((NTSTATUS) 0xC00000D8L) +#define STATUS_CANT_WAIT ((NTSTATUS)0xC00000D8L) #endif #ifndef STATUS_PIPE_EMPTY -# define STATUS_PIPE_EMPTY ((NTSTATUS) 0xC00000D9L) +#define STATUS_PIPE_EMPTY ((NTSTATUS)0xC00000D9L) #endif #ifndef STATUS_CANT_ACCESS_DOMAIN_INFO -# define STATUS_CANT_ACCESS_DOMAIN_INFO ((NTSTATUS) 0xC00000DAL) +#define STATUS_CANT_ACCESS_DOMAIN_INFO ((NTSTATUS)0xC00000DAL) #endif #ifndef STATUS_CANT_TERMINATE_SELF -# define STATUS_CANT_TERMINATE_SELF ((NTSTATUS) 0xC00000DBL) +#define STATUS_CANT_TERMINATE_SELF ((NTSTATUS)0xC00000DBL) #endif #ifndef STATUS_INVALID_SERVER_STATE -# define STATUS_INVALID_SERVER_STATE ((NTSTATUS) 0xC00000DCL) +#define STATUS_INVALID_SERVER_STATE ((NTSTATUS)0xC00000DCL) #endif #ifndef STATUS_INVALID_DOMAIN_STATE -# define STATUS_INVALID_DOMAIN_STATE ((NTSTATUS) 0xC00000DDL) +#define STATUS_INVALID_DOMAIN_STATE ((NTSTATUS)0xC00000DDL) #endif #ifndef STATUS_INVALID_DOMAIN_ROLE -# define STATUS_INVALID_DOMAIN_ROLE ((NTSTATUS) 0xC00000DEL) +#define STATUS_INVALID_DOMAIN_ROLE ((NTSTATUS)0xC00000DEL) #endif #ifndef STATUS_NO_SUCH_DOMAIN -# define STATUS_NO_SUCH_DOMAIN ((NTSTATUS) 0xC00000DFL) +#define STATUS_NO_SUCH_DOMAIN ((NTSTATUS)0xC00000DFL) #endif #ifndef STATUS_DOMAIN_EXISTS -# define STATUS_DOMAIN_EXISTS ((NTSTATUS) 0xC00000E0L) +#define STATUS_DOMAIN_EXISTS ((NTSTATUS)0xC00000E0L) #endif #ifndef STATUS_DOMAIN_LIMIT_EXCEEDED -# define STATUS_DOMAIN_LIMIT_EXCEEDED ((NTSTATUS) 0xC00000E1L) +#define STATUS_DOMAIN_LIMIT_EXCEEDED ((NTSTATUS)0xC00000E1L) #endif #ifndef STATUS_OPLOCK_NOT_GRANTED -# define STATUS_OPLOCK_NOT_GRANTED ((NTSTATUS) 0xC00000E2L) +#define STATUS_OPLOCK_NOT_GRANTED ((NTSTATUS)0xC00000E2L) #endif #ifndef STATUS_INVALID_OPLOCK_PROTOCOL -# define STATUS_INVALID_OPLOCK_PROTOCOL ((NTSTATUS) 0xC00000E3L) +#define STATUS_INVALID_OPLOCK_PROTOCOL ((NTSTATUS)0xC00000E3L) #endif #ifndef STATUS_INTERNAL_DB_CORRUPTION -# define STATUS_INTERNAL_DB_CORRUPTION ((NTSTATUS) 0xC00000E4L) +#define STATUS_INTERNAL_DB_CORRUPTION ((NTSTATUS)0xC00000E4L) #endif #ifndef STATUS_INTERNAL_ERROR -# define STATUS_INTERNAL_ERROR ((NTSTATUS) 0xC00000E5L) +#define STATUS_INTERNAL_ERROR ((NTSTATUS)0xC00000E5L) #endif #ifndef STATUS_GENERIC_NOT_MAPPED -# define STATUS_GENERIC_NOT_MAPPED ((NTSTATUS) 0xC00000E6L) +#define STATUS_GENERIC_NOT_MAPPED ((NTSTATUS)0xC00000E6L) #endif #ifndef STATUS_BAD_DESCRIPTOR_FORMAT -# define STATUS_BAD_DESCRIPTOR_FORMAT ((NTSTATUS) 0xC00000E7L) +#define STATUS_BAD_DESCRIPTOR_FORMAT ((NTSTATUS)0xC00000E7L) #endif #ifndef STATUS_INVALID_USER_BUFFER -# define STATUS_INVALID_USER_BUFFER ((NTSTATUS) 0xC00000E8L) +#define STATUS_INVALID_USER_BUFFER ((NTSTATUS)0xC00000E8L) #endif #ifndef STATUS_UNEXPECTED_IO_ERROR -# define STATUS_UNEXPECTED_IO_ERROR ((NTSTATUS) 0xC00000E9L) +#define STATUS_UNEXPECTED_IO_ERROR ((NTSTATUS)0xC00000E9L) #endif #ifndef STATUS_UNEXPECTED_MM_CREATE_ERR -# define STATUS_UNEXPECTED_MM_CREATE_ERR ((NTSTATUS) 0xC00000EAL) +#define STATUS_UNEXPECTED_MM_CREATE_ERR ((NTSTATUS)0xC00000EAL) #endif #ifndef STATUS_UNEXPECTED_MM_MAP_ERROR -# define STATUS_UNEXPECTED_MM_MAP_ERROR ((NTSTATUS) 0xC00000EBL) +#define STATUS_UNEXPECTED_MM_MAP_ERROR ((NTSTATUS)0xC00000EBL) #endif #ifndef STATUS_UNEXPECTED_MM_EXTEND_ERR -# define STATUS_UNEXPECTED_MM_EXTEND_ERR ((NTSTATUS) 0xC00000ECL) +#define STATUS_UNEXPECTED_MM_EXTEND_ERR ((NTSTATUS)0xC00000ECL) #endif #ifndef STATUS_NOT_LOGON_PROCESS -# define STATUS_NOT_LOGON_PROCESS ((NTSTATUS) 0xC00000EDL) +#define STATUS_NOT_LOGON_PROCESS ((NTSTATUS)0xC00000EDL) #endif #ifndef STATUS_LOGON_SESSION_EXISTS -# define STATUS_LOGON_SESSION_EXISTS ((NTSTATUS) 0xC00000EEL) +#define STATUS_LOGON_SESSION_EXISTS ((NTSTATUS)0xC00000EEL) #endif #ifndef STATUS_INVALID_PARAMETER_1 -# define STATUS_INVALID_PARAMETER_1 ((NTSTATUS) 0xC00000EFL) +#define STATUS_INVALID_PARAMETER_1 ((NTSTATUS)0xC00000EFL) #endif #ifndef STATUS_INVALID_PARAMETER_2 -# define STATUS_INVALID_PARAMETER_2 ((NTSTATUS) 0xC00000F0L) +#define STATUS_INVALID_PARAMETER_2 ((NTSTATUS)0xC00000F0L) #endif #ifndef STATUS_INVALID_PARAMETER_3 -# define STATUS_INVALID_PARAMETER_3 ((NTSTATUS) 0xC00000F1L) +#define STATUS_INVALID_PARAMETER_3 ((NTSTATUS)0xC00000F1L) #endif #ifndef STATUS_INVALID_PARAMETER_4 -# define STATUS_INVALID_PARAMETER_4 ((NTSTATUS) 0xC00000F2L) +#define STATUS_INVALID_PARAMETER_4 ((NTSTATUS)0xC00000F2L) #endif #ifndef STATUS_INVALID_PARAMETER_5 -# define STATUS_INVALID_PARAMETER_5 ((NTSTATUS) 0xC00000F3L) +#define STATUS_INVALID_PARAMETER_5 ((NTSTATUS)0xC00000F3L) #endif #ifndef STATUS_INVALID_PARAMETER_6 -# define STATUS_INVALID_PARAMETER_6 ((NTSTATUS) 0xC00000F4L) +#define STATUS_INVALID_PARAMETER_6 ((NTSTATUS)0xC00000F4L) #endif #ifndef STATUS_INVALID_PARAMETER_7 -# define STATUS_INVALID_PARAMETER_7 ((NTSTATUS) 0xC00000F5L) +#define STATUS_INVALID_PARAMETER_7 ((NTSTATUS)0xC00000F5L) #endif #ifndef STATUS_INVALID_PARAMETER_8 -# define STATUS_INVALID_PARAMETER_8 ((NTSTATUS) 0xC00000F6L) +#define STATUS_INVALID_PARAMETER_8 ((NTSTATUS)0xC00000F6L) #endif #ifndef STATUS_INVALID_PARAMETER_9 -# define STATUS_INVALID_PARAMETER_9 ((NTSTATUS) 0xC00000F7L) +#define STATUS_INVALID_PARAMETER_9 ((NTSTATUS)0xC00000F7L) #endif #ifndef STATUS_INVALID_PARAMETER_10 -# define STATUS_INVALID_PARAMETER_10 ((NTSTATUS) 0xC00000F8L) +#define STATUS_INVALID_PARAMETER_10 ((NTSTATUS)0xC00000F8L) #endif #ifndef STATUS_INVALID_PARAMETER_11 -# define STATUS_INVALID_PARAMETER_11 ((NTSTATUS) 0xC00000F9L) +#define STATUS_INVALID_PARAMETER_11 ((NTSTATUS)0xC00000F9L) #endif #ifndef STATUS_INVALID_PARAMETER_12 -# define STATUS_INVALID_PARAMETER_12 ((NTSTATUS) 0xC00000FAL) +#define STATUS_INVALID_PARAMETER_12 ((NTSTATUS)0xC00000FAL) #endif #ifndef STATUS_REDIRECTOR_NOT_STARTED -# define STATUS_REDIRECTOR_NOT_STARTED ((NTSTATUS) 0xC00000FBL) +#define STATUS_REDIRECTOR_NOT_STARTED ((NTSTATUS)0xC00000FBL) #endif #ifndef STATUS_REDIRECTOR_STARTED -# define STATUS_REDIRECTOR_STARTED ((NTSTATUS) 0xC00000FCL) +#define STATUS_REDIRECTOR_STARTED ((NTSTATUS)0xC00000FCL) #endif #ifndef STATUS_STACK_OVERFLOW -# define STATUS_STACK_OVERFLOW ((NTSTATUS) 0xC00000FDL) +#define STATUS_STACK_OVERFLOW ((NTSTATUS)0xC00000FDL) #endif #ifndef STATUS_NO_SUCH_PACKAGE -# define STATUS_NO_SUCH_PACKAGE ((NTSTATUS) 0xC00000FEL) +#define STATUS_NO_SUCH_PACKAGE ((NTSTATUS)0xC00000FEL) #endif #ifndef STATUS_BAD_FUNCTION_TABLE -# define STATUS_BAD_FUNCTION_TABLE ((NTSTATUS) 0xC00000FFL) +#define STATUS_BAD_FUNCTION_TABLE ((NTSTATUS)0xC00000FFL) #endif #ifndef STATUS_VARIABLE_NOT_FOUND -# define STATUS_VARIABLE_NOT_FOUND ((NTSTATUS) 0xC0000100L) +#define STATUS_VARIABLE_NOT_FOUND ((NTSTATUS)0xC0000100L) #endif #ifndef STATUS_DIRECTORY_NOT_EMPTY -# define STATUS_DIRECTORY_NOT_EMPTY ((NTSTATUS) 0xC0000101L) +#define STATUS_DIRECTORY_NOT_EMPTY ((NTSTATUS)0xC0000101L) #endif #ifndef STATUS_FILE_CORRUPT_ERROR -# define STATUS_FILE_CORRUPT_ERROR ((NTSTATUS) 0xC0000102L) +#define STATUS_FILE_CORRUPT_ERROR ((NTSTATUS)0xC0000102L) #endif #ifndef STATUS_NOT_A_DIRECTORY -# define STATUS_NOT_A_DIRECTORY ((NTSTATUS) 0xC0000103L) +#define STATUS_NOT_A_DIRECTORY ((NTSTATUS)0xC0000103L) #endif #ifndef STATUS_BAD_LOGON_SESSION_STATE -# define STATUS_BAD_LOGON_SESSION_STATE ((NTSTATUS) 0xC0000104L) +#define STATUS_BAD_LOGON_SESSION_STATE ((NTSTATUS)0xC0000104L) #endif #ifndef STATUS_LOGON_SESSION_COLLISION -# define STATUS_LOGON_SESSION_COLLISION ((NTSTATUS) 0xC0000105L) +#define STATUS_LOGON_SESSION_COLLISION ((NTSTATUS)0xC0000105L) #endif #ifndef STATUS_NAME_TOO_LONG -# define STATUS_NAME_TOO_LONG ((NTSTATUS) 0xC0000106L) +#define STATUS_NAME_TOO_LONG ((NTSTATUS)0xC0000106L) #endif #ifndef STATUS_FILES_OPEN -# define STATUS_FILES_OPEN ((NTSTATUS) 0xC0000107L) +#define STATUS_FILES_OPEN ((NTSTATUS)0xC0000107L) #endif #ifndef STATUS_CONNECTION_IN_USE -# define STATUS_CONNECTION_IN_USE ((NTSTATUS) 0xC0000108L) +#define STATUS_CONNECTION_IN_USE ((NTSTATUS)0xC0000108L) #endif #ifndef STATUS_MESSAGE_NOT_FOUND -# define STATUS_MESSAGE_NOT_FOUND ((NTSTATUS) 0xC0000109L) +#define STATUS_MESSAGE_NOT_FOUND ((NTSTATUS)0xC0000109L) #endif #ifndef STATUS_PROCESS_IS_TERMINATING -# define STATUS_PROCESS_IS_TERMINATING ((NTSTATUS) 0xC000010AL) +#define STATUS_PROCESS_IS_TERMINATING ((NTSTATUS)0xC000010AL) #endif #ifndef STATUS_INVALID_LOGON_TYPE -# define STATUS_INVALID_LOGON_TYPE ((NTSTATUS) 0xC000010BL) +#define STATUS_INVALID_LOGON_TYPE ((NTSTATUS)0xC000010BL) #endif #ifndef STATUS_NO_GUID_TRANSLATION -# define STATUS_NO_GUID_TRANSLATION ((NTSTATUS) 0xC000010CL) +#define STATUS_NO_GUID_TRANSLATION ((NTSTATUS)0xC000010CL) #endif #ifndef STATUS_CANNOT_IMPERSONATE -# define STATUS_CANNOT_IMPERSONATE ((NTSTATUS) 0xC000010DL) +#define STATUS_CANNOT_IMPERSONATE ((NTSTATUS)0xC000010DL) #endif #ifndef STATUS_IMAGE_ALREADY_LOADED -# define STATUS_IMAGE_ALREADY_LOADED ((NTSTATUS) 0xC000010EL) +#define STATUS_IMAGE_ALREADY_LOADED ((NTSTATUS)0xC000010EL) #endif #ifndef STATUS_ABIOS_NOT_PRESENT -# define STATUS_ABIOS_NOT_PRESENT ((NTSTATUS) 0xC000010FL) +#define STATUS_ABIOS_NOT_PRESENT ((NTSTATUS)0xC000010FL) #endif #ifndef STATUS_ABIOS_LID_NOT_EXIST -# define STATUS_ABIOS_LID_NOT_EXIST ((NTSTATUS) 0xC0000110L) +#define STATUS_ABIOS_LID_NOT_EXIST ((NTSTATUS)0xC0000110L) #endif #ifndef STATUS_ABIOS_LID_ALREADY_OWNED -# define STATUS_ABIOS_LID_ALREADY_OWNED ((NTSTATUS) 0xC0000111L) +#define STATUS_ABIOS_LID_ALREADY_OWNED ((NTSTATUS)0xC0000111L) #endif #ifndef STATUS_ABIOS_NOT_LID_OWNER -# define STATUS_ABIOS_NOT_LID_OWNER ((NTSTATUS) 0xC0000112L) +#define STATUS_ABIOS_NOT_LID_OWNER ((NTSTATUS)0xC0000112L) #endif #ifndef STATUS_ABIOS_INVALID_COMMAND -# define STATUS_ABIOS_INVALID_COMMAND ((NTSTATUS) 0xC0000113L) +#define STATUS_ABIOS_INVALID_COMMAND ((NTSTATUS)0xC0000113L) #endif #ifndef STATUS_ABIOS_INVALID_LID -# define STATUS_ABIOS_INVALID_LID ((NTSTATUS) 0xC0000114L) +#define STATUS_ABIOS_INVALID_LID ((NTSTATUS)0xC0000114L) #endif #ifndef STATUS_ABIOS_SELECTOR_NOT_AVAILABLE -# define STATUS_ABIOS_SELECTOR_NOT_AVAILABLE ((NTSTATUS) 0xC0000115L) +#define STATUS_ABIOS_SELECTOR_NOT_AVAILABLE ((NTSTATUS)0xC0000115L) #endif #ifndef STATUS_ABIOS_INVALID_SELECTOR -# define STATUS_ABIOS_INVALID_SELECTOR ((NTSTATUS) 0xC0000116L) +#define STATUS_ABIOS_INVALID_SELECTOR ((NTSTATUS)0xC0000116L) #endif #ifndef STATUS_NO_LDT -# define STATUS_NO_LDT ((NTSTATUS) 0xC0000117L) +#define STATUS_NO_LDT ((NTSTATUS)0xC0000117L) #endif #ifndef STATUS_INVALID_LDT_SIZE -# define STATUS_INVALID_LDT_SIZE ((NTSTATUS) 0xC0000118L) +#define STATUS_INVALID_LDT_SIZE ((NTSTATUS)0xC0000118L) #endif #ifndef STATUS_INVALID_LDT_OFFSET -# define STATUS_INVALID_LDT_OFFSET ((NTSTATUS) 0xC0000119L) +#define STATUS_INVALID_LDT_OFFSET ((NTSTATUS)0xC0000119L) #endif #ifndef STATUS_INVALID_LDT_DESCRIPTOR -# define STATUS_INVALID_LDT_DESCRIPTOR ((NTSTATUS) 0xC000011AL) +#define STATUS_INVALID_LDT_DESCRIPTOR ((NTSTATUS)0xC000011AL) #endif #ifndef STATUS_INVALID_IMAGE_NE_FORMAT -# define STATUS_INVALID_IMAGE_NE_FORMAT ((NTSTATUS) 0xC000011BL) +#define STATUS_INVALID_IMAGE_NE_FORMAT ((NTSTATUS)0xC000011BL) #endif #ifndef STATUS_RXACT_INVALID_STATE -# define STATUS_RXACT_INVALID_STATE ((NTSTATUS) 0xC000011CL) +#define STATUS_RXACT_INVALID_STATE ((NTSTATUS)0xC000011CL) #endif #ifndef STATUS_RXACT_COMMIT_FAILURE -# define STATUS_RXACT_COMMIT_FAILURE ((NTSTATUS) 0xC000011DL) +#define STATUS_RXACT_COMMIT_FAILURE ((NTSTATUS)0xC000011DL) #endif #ifndef STATUS_MAPPED_FILE_SIZE_ZERO -# define STATUS_MAPPED_FILE_SIZE_ZERO ((NTSTATUS) 0xC000011EL) +#define STATUS_MAPPED_FILE_SIZE_ZERO ((NTSTATUS)0xC000011EL) #endif #ifndef STATUS_TOO_MANY_OPENED_FILES -# define STATUS_TOO_MANY_OPENED_FILES ((NTSTATUS) 0xC000011FL) +#define STATUS_TOO_MANY_OPENED_FILES ((NTSTATUS)0xC000011FL) #endif #ifndef STATUS_CANCELLED -# define STATUS_CANCELLED ((NTSTATUS) 0xC0000120L) +#define STATUS_CANCELLED ((NTSTATUS)0xC0000120L) #endif #ifndef STATUS_CANNOT_DELETE -# define STATUS_CANNOT_DELETE ((NTSTATUS) 0xC0000121L) +#define STATUS_CANNOT_DELETE ((NTSTATUS)0xC0000121L) #endif #ifndef STATUS_INVALID_COMPUTER_NAME -# define STATUS_INVALID_COMPUTER_NAME ((NTSTATUS) 0xC0000122L) +#define STATUS_INVALID_COMPUTER_NAME ((NTSTATUS)0xC0000122L) #endif #ifndef STATUS_FILE_DELETED -# define STATUS_FILE_DELETED ((NTSTATUS) 0xC0000123L) +#define STATUS_FILE_DELETED ((NTSTATUS)0xC0000123L) #endif #ifndef STATUS_SPECIAL_ACCOUNT -# define STATUS_SPECIAL_ACCOUNT ((NTSTATUS) 0xC0000124L) +#define STATUS_SPECIAL_ACCOUNT ((NTSTATUS)0xC0000124L) #endif #ifndef STATUS_SPECIAL_GROUP -# define STATUS_SPECIAL_GROUP ((NTSTATUS) 0xC0000125L) +#define STATUS_SPECIAL_GROUP ((NTSTATUS)0xC0000125L) #endif #ifndef STATUS_SPECIAL_USER -# define STATUS_SPECIAL_USER ((NTSTATUS) 0xC0000126L) +#define STATUS_SPECIAL_USER ((NTSTATUS)0xC0000126L) #endif #ifndef STATUS_MEMBERS_PRIMARY_GROUP -# define STATUS_MEMBERS_PRIMARY_GROUP ((NTSTATUS) 0xC0000127L) +#define STATUS_MEMBERS_PRIMARY_GROUP ((NTSTATUS)0xC0000127L) #endif #ifndef STATUS_FILE_CLOSED -# define STATUS_FILE_CLOSED ((NTSTATUS) 0xC0000128L) +#define STATUS_FILE_CLOSED ((NTSTATUS)0xC0000128L) #endif #ifndef STATUS_TOO_MANY_THREADS -# define STATUS_TOO_MANY_THREADS ((NTSTATUS) 0xC0000129L) +#define STATUS_TOO_MANY_THREADS ((NTSTATUS)0xC0000129L) #endif #ifndef STATUS_THREAD_NOT_IN_PROCESS -# define STATUS_THREAD_NOT_IN_PROCESS ((NTSTATUS) 0xC000012AL) +#define STATUS_THREAD_NOT_IN_PROCESS ((NTSTATUS)0xC000012AL) #endif #ifndef STATUS_TOKEN_ALREADY_IN_USE -# define STATUS_TOKEN_ALREADY_IN_USE ((NTSTATUS) 0xC000012BL) +#define STATUS_TOKEN_ALREADY_IN_USE ((NTSTATUS)0xC000012BL) #endif #ifndef STATUS_PAGEFILE_QUOTA_EXCEEDED -# define STATUS_PAGEFILE_QUOTA_EXCEEDED ((NTSTATUS) 0xC000012CL) +#define STATUS_PAGEFILE_QUOTA_EXCEEDED ((NTSTATUS)0xC000012CL) #endif #ifndef STATUS_COMMITMENT_LIMIT -# define STATUS_COMMITMENT_LIMIT ((NTSTATUS) 0xC000012DL) +#define STATUS_COMMITMENT_LIMIT ((NTSTATUS)0xC000012DL) #endif #ifndef STATUS_INVALID_IMAGE_LE_FORMAT -# define STATUS_INVALID_IMAGE_LE_FORMAT ((NTSTATUS) 0xC000012EL) +#define STATUS_INVALID_IMAGE_LE_FORMAT ((NTSTATUS)0xC000012EL) #endif #ifndef STATUS_INVALID_IMAGE_NOT_MZ -# define STATUS_INVALID_IMAGE_NOT_MZ ((NTSTATUS) 0xC000012FL) +#define STATUS_INVALID_IMAGE_NOT_MZ ((NTSTATUS)0xC000012FL) #endif #ifndef STATUS_INVALID_IMAGE_PROTECT -# define STATUS_INVALID_IMAGE_PROTECT ((NTSTATUS) 0xC0000130L) +#define STATUS_INVALID_IMAGE_PROTECT ((NTSTATUS)0xC0000130L) #endif #ifndef STATUS_INVALID_IMAGE_WIN_16 -# define STATUS_INVALID_IMAGE_WIN_16 ((NTSTATUS) 0xC0000131L) +#define STATUS_INVALID_IMAGE_WIN_16 ((NTSTATUS)0xC0000131L) #endif #ifndef STATUS_LOGON_SERVER_CONFLICT -# define STATUS_LOGON_SERVER_CONFLICT ((NTSTATUS) 0xC0000132L) +#define STATUS_LOGON_SERVER_CONFLICT ((NTSTATUS)0xC0000132L) #endif #ifndef STATUS_TIME_DIFFERENCE_AT_DC -# define STATUS_TIME_DIFFERENCE_AT_DC ((NTSTATUS) 0xC0000133L) +#define STATUS_TIME_DIFFERENCE_AT_DC ((NTSTATUS)0xC0000133L) #endif #ifndef STATUS_SYNCHRONIZATION_REQUIRED -# define STATUS_SYNCHRONIZATION_REQUIRED ((NTSTATUS) 0xC0000134L) +#define STATUS_SYNCHRONIZATION_REQUIRED ((NTSTATUS)0xC0000134L) #endif #ifndef STATUS_DLL_NOT_FOUND -# define STATUS_DLL_NOT_FOUND ((NTSTATUS) 0xC0000135L) +#define STATUS_DLL_NOT_FOUND ((NTSTATUS)0xC0000135L) #endif #ifndef STATUS_OPEN_FAILED -# define STATUS_OPEN_FAILED ((NTSTATUS) 0xC0000136L) +#define STATUS_OPEN_FAILED ((NTSTATUS)0xC0000136L) #endif #ifndef STATUS_IO_PRIVILEGE_FAILED -# define STATUS_IO_PRIVILEGE_FAILED ((NTSTATUS) 0xC0000137L) +#define STATUS_IO_PRIVILEGE_FAILED ((NTSTATUS)0xC0000137L) #endif #ifndef STATUS_ORDINAL_NOT_FOUND -# define STATUS_ORDINAL_NOT_FOUND ((NTSTATUS) 0xC0000138L) +#define STATUS_ORDINAL_NOT_FOUND ((NTSTATUS)0xC0000138L) #endif #ifndef STATUS_ENTRYPOINT_NOT_FOUND -# define STATUS_ENTRYPOINT_NOT_FOUND ((NTSTATUS) 0xC0000139L) +#define STATUS_ENTRYPOINT_NOT_FOUND ((NTSTATUS)0xC0000139L) #endif #ifndef STATUS_CONTROL_C_EXIT -# define STATUS_CONTROL_C_EXIT ((NTSTATUS) 0xC000013AL) +#define STATUS_CONTROL_C_EXIT ((NTSTATUS)0xC000013AL) #endif #ifndef STATUS_LOCAL_DISCONNECT -# define STATUS_LOCAL_DISCONNECT ((NTSTATUS) 0xC000013BL) +#define STATUS_LOCAL_DISCONNECT ((NTSTATUS)0xC000013BL) #endif #ifndef STATUS_REMOTE_DISCONNECT -# define STATUS_REMOTE_DISCONNECT ((NTSTATUS) 0xC000013CL) +#define STATUS_REMOTE_DISCONNECT ((NTSTATUS)0xC000013CL) #endif #ifndef STATUS_REMOTE_RESOURCES -# define STATUS_REMOTE_RESOURCES ((NTSTATUS) 0xC000013DL) +#define STATUS_REMOTE_RESOURCES ((NTSTATUS)0xC000013DL) #endif #ifndef STATUS_LINK_FAILED -# define STATUS_LINK_FAILED ((NTSTATUS) 0xC000013EL) +#define STATUS_LINK_FAILED ((NTSTATUS)0xC000013EL) #endif #ifndef STATUS_LINK_TIMEOUT -# define STATUS_LINK_TIMEOUT ((NTSTATUS) 0xC000013FL) +#define STATUS_LINK_TIMEOUT ((NTSTATUS)0xC000013FL) #endif #ifndef STATUS_INVALID_CONNECTION -# define STATUS_INVALID_CONNECTION ((NTSTATUS) 0xC0000140L) +#define STATUS_INVALID_CONNECTION ((NTSTATUS)0xC0000140L) #endif #ifndef STATUS_INVALID_ADDRESS -# define STATUS_INVALID_ADDRESS ((NTSTATUS) 0xC0000141L) +#define STATUS_INVALID_ADDRESS ((NTSTATUS)0xC0000141L) #endif #ifndef STATUS_DLL_INIT_FAILED -# define STATUS_DLL_INIT_FAILED ((NTSTATUS) 0xC0000142L) +#define STATUS_DLL_INIT_FAILED ((NTSTATUS)0xC0000142L) #endif #ifndef STATUS_MISSING_SYSTEMFILE -# define STATUS_MISSING_SYSTEMFILE ((NTSTATUS) 0xC0000143L) +#define STATUS_MISSING_SYSTEMFILE ((NTSTATUS)0xC0000143L) #endif #ifndef STATUS_UNHANDLED_EXCEPTION -# define STATUS_UNHANDLED_EXCEPTION ((NTSTATUS) 0xC0000144L) +#define STATUS_UNHANDLED_EXCEPTION ((NTSTATUS)0xC0000144L) #endif #ifndef STATUS_APP_INIT_FAILURE -# define STATUS_APP_INIT_FAILURE ((NTSTATUS) 0xC0000145L) +#define STATUS_APP_INIT_FAILURE ((NTSTATUS)0xC0000145L) #endif #ifndef STATUS_PAGEFILE_CREATE_FAILED -# define STATUS_PAGEFILE_CREATE_FAILED ((NTSTATUS) 0xC0000146L) +#define STATUS_PAGEFILE_CREATE_FAILED ((NTSTATUS)0xC0000146L) #endif #ifndef STATUS_NO_PAGEFILE -# define STATUS_NO_PAGEFILE ((NTSTATUS) 0xC0000147L) +#define STATUS_NO_PAGEFILE ((NTSTATUS)0xC0000147L) #endif #ifndef STATUS_INVALID_LEVEL -# define STATUS_INVALID_LEVEL ((NTSTATUS) 0xC0000148L) +#define STATUS_INVALID_LEVEL ((NTSTATUS)0xC0000148L) #endif #ifndef STATUS_WRONG_PASSWORD_CORE -# define STATUS_WRONG_PASSWORD_CORE ((NTSTATUS) 0xC0000149L) +#define STATUS_WRONG_PASSWORD_CORE ((NTSTATUS)0xC0000149L) #endif #ifndef STATUS_ILLEGAL_FLOAT_CONTEXT -# define STATUS_ILLEGAL_FLOAT_CONTEXT ((NTSTATUS) 0xC000014AL) +#define STATUS_ILLEGAL_FLOAT_CONTEXT ((NTSTATUS)0xC000014AL) #endif #ifndef STATUS_PIPE_BROKEN -# define STATUS_PIPE_BROKEN ((NTSTATUS) 0xC000014BL) +#define STATUS_PIPE_BROKEN ((NTSTATUS)0xC000014BL) #endif #ifndef STATUS_REGISTRY_CORRUPT -# define STATUS_REGISTRY_CORRUPT ((NTSTATUS) 0xC000014CL) +#define STATUS_REGISTRY_CORRUPT ((NTSTATUS)0xC000014CL) #endif #ifndef STATUS_REGISTRY_IO_FAILED -# define STATUS_REGISTRY_IO_FAILED ((NTSTATUS) 0xC000014DL) +#define STATUS_REGISTRY_IO_FAILED ((NTSTATUS)0xC000014DL) #endif #ifndef STATUS_NO_EVENT_PAIR -# define STATUS_NO_EVENT_PAIR ((NTSTATUS) 0xC000014EL) +#define STATUS_NO_EVENT_PAIR ((NTSTATUS)0xC000014EL) #endif #ifndef STATUS_UNRECOGNIZED_VOLUME -# define STATUS_UNRECOGNIZED_VOLUME ((NTSTATUS) 0xC000014FL) +#define STATUS_UNRECOGNIZED_VOLUME ((NTSTATUS)0xC000014FL) #endif #ifndef STATUS_SERIAL_NO_DEVICE_INITED -# define STATUS_SERIAL_NO_DEVICE_INITED ((NTSTATUS) 0xC0000150L) +#define STATUS_SERIAL_NO_DEVICE_INITED ((NTSTATUS)0xC0000150L) #endif #ifndef STATUS_NO_SUCH_ALIAS -# define STATUS_NO_SUCH_ALIAS ((NTSTATUS) 0xC0000151L) +#define STATUS_NO_SUCH_ALIAS ((NTSTATUS)0xC0000151L) #endif #ifndef STATUS_MEMBER_NOT_IN_ALIAS -# define STATUS_MEMBER_NOT_IN_ALIAS ((NTSTATUS) 0xC0000152L) +#define STATUS_MEMBER_NOT_IN_ALIAS ((NTSTATUS)0xC0000152L) #endif #ifndef STATUS_MEMBER_IN_ALIAS -# define STATUS_MEMBER_IN_ALIAS ((NTSTATUS) 0xC0000153L) +#define STATUS_MEMBER_IN_ALIAS ((NTSTATUS)0xC0000153L) #endif #ifndef STATUS_ALIAS_EXISTS -# define STATUS_ALIAS_EXISTS ((NTSTATUS) 0xC0000154L) +#define STATUS_ALIAS_EXISTS ((NTSTATUS)0xC0000154L) #endif #ifndef STATUS_LOGON_NOT_GRANTED -# define STATUS_LOGON_NOT_GRANTED ((NTSTATUS) 0xC0000155L) +#define STATUS_LOGON_NOT_GRANTED ((NTSTATUS)0xC0000155L) #endif #ifndef STATUS_TOO_MANY_SECRETS -# define STATUS_TOO_MANY_SECRETS ((NTSTATUS) 0xC0000156L) +#define STATUS_TOO_MANY_SECRETS ((NTSTATUS)0xC0000156L) #endif #ifndef STATUS_SECRET_TOO_LONG -# define STATUS_SECRET_TOO_LONG ((NTSTATUS) 0xC0000157L) +#define STATUS_SECRET_TOO_LONG ((NTSTATUS)0xC0000157L) #endif #ifndef STATUS_INTERNAL_DB_ERROR -# define STATUS_INTERNAL_DB_ERROR ((NTSTATUS) 0xC0000158L) +#define STATUS_INTERNAL_DB_ERROR ((NTSTATUS)0xC0000158L) #endif #ifndef STATUS_FULLSCREEN_MODE -# define STATUS_FULLSCREEN_MODE ((NTSTATUS) 0xC0000159L) +#define STATUS_FULLSCREEN_MODE ((NTSTATUS)0xC0000159L) #endif #ifndef STATUS_TOO_MANY_CONTEXT_IDS -# define STATUS_TOO_MANY_CONTEXT_IDS ((NTSTATUS) 0xC000015AL) +#define STATUS_TOO_MANY_CONTEXT_IDS ((NTSTATUS)0xC000015AL) #endif #ifndef STATUS_LOGON_TYPE_NOT_GRANTED -# define STATUS_LOGON_TYPE_NOT_GRANTED ((NTSTATUS) 0xC000015BL) +#define STATUS_LOGON_TYPE_NOT_GRANTED ((NTSTATUS)0xC000015BL) #endif #ifndef STATUS_NOT_REGISTRY_FILE -# define STATUS_NOT_REGISTRY_FILE ((NTSTATUS) 0xC000015CL) +#define STATUS_NOT_REGISTRY_FILE ((NTSTATUS)0xC000015CL) #endif #ifndef STATUS_NT_CROSS_ENCRYPTION_REQUIRED -# define STATUS_NT_CROSS_ENCRYPTION_REQUIRED ((NTSTATUS) 0xC000015DL) +#define STATUS_NT_CROSS_ENCRYPTION_REQUIRED ((NTSTATUS)0xC000015DL) #endif #ifndef STATUS_DOMAIN_CTRLR_CONFIG_ERROR -# define STATUS_DOMAIN_CTRLR_CONFIG_ERROR ((NTSTATUS) 0xC000015EL) +#define STATUS_DOMAIN_CTRLR_CONFIG_ERROR ((NTSTATUS)0xC000015EL) #endif #ifndef STATUS_FT_MISSING_MEMBER -# define STATUS_FT_MISSING_MEMBER ((NTSTATUS) 0xC000015FL) +#define STATUS_FT_MISSING_MEMBER ((NTSTATUS)0xC000015FL) #endif #ifndef STATUS_ILL_FORMED_SERVICE_ENTRY -# define STATUS_ILL_FORMED_SERVICE_ENTRY ((NTSTATUS) 0xC0000160L) +#define STATUS_ILL_FORMED_SERVICE_ENTRY ((NTSTATUS)0xC0000160L) #endif #ifndef STATUS_ILLEGAL_CHARACTER -# define STATUS_ILLEGAL_CHARACTER ((NTSTATUS) 0xC0000161L) +#define STATUS_ILLEGAL_CHARACTER ((NTSTATUS)0xC0000161L) #endif #ifndef STATUS_UNMAPPABLE_CHARACTER -# define STATUS_UNMAPPABLE_CHARACTER ((NTSTATUS) 0xC0000162L) +#define STATUS_UNMAPPABLE_CHARACTER ((NTSTATUS)0xC0000162L) #endif #ifndef STATUS_UNDEFINED_CHARACTER -# define STATUS_UNDEFINED_CHARACTER ((NTSTATUS) 0xC0000163L) +#define STATUS_UNDEFINED_CHARACTER ((NTSTATUS)0xC0000163L) #endif #ifndef STATUS_FLOPPY_VOLUME -# define STATUS_FLOPPY_VOLUME ((NTSTATUS) 0xC0000164L) +#define STATUS_FLOPPY_VOLUME ((NTSTATUS)0xC0000164L) #endif #ifndef STATUS_FLOPPY_ID_MARK_NOT_FOUND -# define STATUS_FLOPPY_ID_MARK_NOT_FOUND ((NTSTATUS) 0xC0000165L) +#define STATUS_FLOPPY_ID_MARK_NOT_FOUND ((NTSTATUS)0xC0000165L) #endif #ifndef STATUS_FLOPPY_WRONG_CYLINDER -# define STATUS_FLOPPY_WRONG_CYLINDER ((NTSTATUS) 0xC0000166L) +#define STATUS_FLOPPY_WRONG_CYLINDER ((NTSTATUS)0xC0000166L) #endif #ifndef STATUS_FLOPPY_UNKNOWN_ERROR -# define STATUS_FLOPPY_UNKNOWN_ERROR ((NTSTATUS) 0xC0000167L) +#define STATUS_FLOPPY_UNKNOWN_ERROR ((NTSTATUS)0xC0000167L) #endif #ifndef STATUS_FLOPPY_BAD_REGISTERS -# define STATUS_FLOPPY_BAD_REGISTERS ((NTSTATUS) 0xC0000168L) +#define STATUS_FLOPPY_BAD_REGISTERS ((NTSTATUS)0xC0000168L) #endif #ifndef STATUS_DISK_RECALIBRATE_FAILED -# define STATUS_DISK_RECALIBRATE_FAILED ((NTSTATUS) 0xC0000169L) +#define STATUS_DISK_RECALIBRATE_FAILED ((NTSTATUS)0xC0000169L) #endif #ifndef STATUS_DISK_OPERATION_FAILED -# define STATUS_DISK_OPERATION_FAILED ((NTSTATUS) 0xC000016AL) +#define STATUS_DISK_OPERATION_FAILED ((NTSTATUS)0xC000016AL) #endif #ifndef STATUS_DISK_RESET_FAILED -# define STATUS_DISK_RESET_FAILED ((NTSTATUS) 0xC000016BL) +#define STATUS_DISK_RESET_FAILED ((NTSTATUS)0xC000016BL) #endif #ifndef STATUS_SHARED_IRQ_BUSY -# define STATUS_SHARED_IRQ_BUSY ((NTSTATUS) 0xC000016CL) +#define STATUS_SHARED_IRQ_BUSY ((NTSTATUS)0xC000016CL) #endif #ifndef STATUS_FT_ORPHANING -# define STATUS_FT_ORPHANING ((NTSTATUS) 0xC000016DL) +#define STATUS_FT_ORPHANING ((NTSTATUS)0xC000016DL) #endif #ifndef STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT -# define STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT ((NTSTATUS) 0xC000016EL) +#define STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT ((NTSTATUS)0xC000016EL) #endif #ifndef STATUS_PARTITION_FAILURE -# define STATUS_PARTITION_FAILURE ((NTSTATUS) 0xC0000172L) +#define STATUS_PARTITION_FAILURE ((NTSTATUS)0xC0000172L) #endif #ifndef STATUS_INVALID_BLOCK_LENGTH -# define STATUS_INVALID_BLOCK_LENGTH ((NTSTATUS) 0xC0000173L) +#define STATUS_INVALID_BLOCK_LENGTH ((NTSTATUS)0xC0000173L) #endif #ifndef STATUS_DEVICE_NOT_PARTITIONED -# define STATUS_DEVICE_NOT_PARTITIONED ((NTSTATUS) 0xC0000174L) +#define STATUS_DEVICE_NOT_PARTITIONED ((NTSTATUS)0xC0000174L) #endif #ifndef STATUS_UNABLE_TO_LOCK_MEDIA -# define STATUS_UNABLE_TO_LOCK_MEDIA ((NTSTATUS) 0xC0000175L) +#define STATUS_UNABLE_TO_LOCK_MEDIA ((NTSTATUS)0xC0000175L) #endif #ifndef STATUS_UNABLE_TO_UNLOAD_MEDIA -# define STATUS_UNABLE_TO_UNLOAD_MEDIA ((NTSTATUS) 0xC0000176L) +#define STATUS_UNABLE_TO_UNLOAD_MEDIA ((NTSTATUS)0xC0000176L) #endif #ifndef STATUS_EOM_OVERFLOW -# define STATUS_EOM_OVERFLOW ((NTSTATUS) 0xC0000177L) +#define STATUS_EOM_OVERFLOW ((NTSTATUS)0xC0000177L) #endif #ifndef STATUS_NO_MEDIA -# define STATUS_NO_MEDIA ((NTSTATUS) 0xC0000178L) +#define STATUS_NO_MEDIA ((NTSTATUS)0xC0000178L) #endif #ifndef STATUS_NO_SUCH_MEMBER -# define STATUS_NO_SUCH_MEMBER ((NTSTATUS) 0xC000017AL) +#define STATUS_NO_SUCH_MEMBER ((NTSTATUS)0xC000017AL) #endif #ifndef STATUS_INVALID_MEMBER -# define STATUS_INVALID_MEMBER ((NTSTATUS) 0xC000017BL) +#define STATUS_INVALID_MEMBER ((NTSTATUS)0xC000017BL) #endif #ifndef STATUS_KEY_DELETED -# define STATUS_KEY_DELETED ((NTSTATUS) 0xC000017CL) +#define STATUS_KEY_DELETED ((NTSTATUS)0xC000017CL) #endif #ifndef STATUS_NO_LOG_SPACE -# define STATUS_NO_LOG_SPACE ((NTSTATUS) 0xC000017DL) +#define STATUS_NO_LOG_SPACE ((NTSTATUS)0xC000017DL) #endif #ifndef STATUS_TOO_MANY_SIDS -# define STATUS_TOO_MANY_SIDS ((NTSTATUS) 0xC000017EL) +#define STATUS_TOO_MANY_SIDS ((NTSTATUS)0xC000017EL) #endif #ifndef STATUS_LM_CROSS_ENCRYPTION_REQUIRED -# define STATUS_LM_CROSS_ENCRYPTION_REQUIRED ((NTSTATUS) 0xC000017FL) +#define STATUS_LM_CROSS_ENCRYPTION_REQUIRED ((NTSTATUS)0xC000017FL) #endif #ifndef STATUS_KEY_HAS_CHILDREN -# define STATUS_KEY_HAS_CHILDREN ((NTSTATUS) 0xC0000180L) +#define STATUS_KEY_HAS_CHILDREN ((NTSTATUS)0xC0000180L) #endif #ifndef STATUS_CHILD_MUST_BE_VOLATILE -# define STATUS_CHILD_MUST_BE_VOLATILE ((NTSTATUS) 0xC0000181L) +#define STATUS_CHILD_MUST_BE_VOLATILE ((NTSTATUS)0xC0000181L) #endif #ifndef STATUS_DEVICE_CONFIGURATION_ERROR -# define STATUS_DEVICE_CONFIGURATION_ERROR ((NTSTATUS) 0xC0000182L) +#define STATUS_DEVICE_CONFIGURATION_ERROR ((NTSTATUS)0xC0000182L) #endif #ifndef STATUS_DRIVER_INTERNAL_ERROR -# define STATUS_DRIVER_INTERNAL_ERROR ((NTSTATUS) 0xC0000183L) +#define STATUS_DRIVER_INTERNAL_ERROR ((NTSTATUS)0xC0000183L) #endif #ifndef STATUS_INVALID_DEVICE_STATE -# define STATUS_INVALID_DEVICE_STATE ((NTSTATUS) 0xC0000184L) +#define STATUS_INVALID_DEVICE_STATE ((NTSTATUS)0xC0000184L) #endif #ifndef STATUS_IO_DEVICE_ERROR -# define STATUS_IO_DEVICE_ERROR ((NTSTATUS) 0xC0000185L) +#define STATUS_IO_DEVICE_ERROR ((NTSTATUS)0xC0000185L) #endif #ifndef STATUS_DEVICE_PROTOCOL_ERROR -# define STATUS_DEVICE_PROTOCOL_ERROR ((NTSTATUS) 0xC0000186L) +#define STATUS_DEVICE_PROTOCOL_ERROR ((NTSTATUS)0xC0000186L) #endif #ifndef STATUS_BACKUP_CONTROLLER -# define STATUS_BACKUP_CONTROLLER ((NTSTATUS) 0xC0000187L) +#define STATUS_BACKUP_CONTROLLER ((NTSTATUS)0xC0000187L) #endif #ifndef STATUS_LOG_FILE_FULL -# define STATUS_LOG_FILE_FULL ((NTSTATUS) 0xC0000188L) +#define STATUS_LOG_FILE_FULL ((NTSTATUS)0xC0000188L) #endif #ifndef STATUS_TOO_LATE -# define STATUS_TOO_LATE ((NTSTATUS) 0xC0000189L) +#define STATUS_TOO_LATE ((NTSTATUS)0xC0000189L) #endif #ifndef STATUS_NO_TRUST_LSA_SECRET -# define STATUS_NO_TRUST_LSA_SECRET ((NTSTATUS) 0xC000018AL) +#define STATUS_NO_TRUST_LSA_SECRET ((NTSTATUS)0xC000018AL) #endif #ifndef STATUS_NO_TRUST_SAM_ACCOUNT -# define STATUS_NO_TRUST_SAM_ACCOUNT ((NTSTATUS) 0xC000018BL) +#define STATUS_NO_TRUST_SAM_ACCOUNT ((NTSTATUS)0xC000018BL) #endif #ifndef STATUS_TRUSTED_DOMAIN_FAILURE -# define STATUS_TRUSTED_DOMAIN_FAILURE ((NTSTATUS) 0xC000018CL) +#define STATUS_TRUSTED_DOMAIN_FAILURE ((NTSTATUS)0xC000018CL) #endif #ifndef STATUS_TRUSTED_RELATIONSHIP_FAILURE -# define STATUS_TRUSTED_RELATIONSHIP_FAILURE ((NTSTATUS) 0xC000018DL) +#define STATUS_TRUSTED_RELATIONSHIP_FAILURE ((NTSTATUS)0xC000018DL) #endif #ifndef STATUS_EVENTLOG_FILE_CORRUPT -# define STATUS_EVENTLOG_FILE_CORRUPT ((NTSTATUS) 0xC000018EL) +#define STATUS_EVENTLOG_FILE_CORRUPT ((NTSTATUS)0xC000018EL) #endif #ifndef STATUS_EVENTLOG_CANT_START -# define STATUS_EVENTLOG_CANT_START ((NTSTATUS) 0xC000018FL) +#define STATUS_EVENTLOG_CANT_START ((NTSTATUS)0xC000018FL) #endif #ifndef STATUS_TRUST_FAILURE -# define STATUS_TRUST_FAILURE ((NTSTATUS) 0xC0000190L) +#define STATUS_TRUST_FAILURE ((NTSTATUS)0xC0000190L) #endif #ifndef STATUS_MUTANT_LIMIT_EXCEEDED -# define STATUS_MUTANT_LIMIT_EXCEEDED ((NTSTATUS) 0xC0000191L) +#define STATUS_MUTANT_LIMIT_EXCEEDED ((NTSTATUS)0xC0000191L) #endif #ifndef STATUS_NETLOGON_NOT_STARTED -# define STATUS_NETLOGON_NOT_STARTED ((NTSTATUS) 0xC0000192L) +#define STATUS_NETLOGON_NOT_STARTED ((NTSTATUS)0xC0000192L) #endif #ifndef STATUS_ACCOUNT_EXPIRED -# define STATUS_ACCOUNT_EXPIRED ((NTSTATUS) 0xC0000193L) +#define STATUS_ACCOUNT_EXPIRED ((NTSTATUS)0xC0000193L) #endif #ifndef STATUS_POSSIBLE_DEADLOCK -# define STATUS_POSSIBLE_DEADLOCK ((NTSTATUS) 0xC0000194L) +#define STATUS_POSSIBLE_DEADLOCK ((NTSTATUS)0xC0000194L) #endif #ifndef STATUS_NETWORK_CREDENTIAL_CONFLICT -# define STATUS_NETWORK_CREDENTIAL_CONFLICT ((NTSTATUS) 0xC0000195L) +#define STATUS_NETWORK_CREDENTIAL_CONFLICT ((NTSTATUS)0xC0000195L) #endif #ifndef STATUS_REMOTE_SESSION_LIMIT -# define STATUS_REMOTE_SESSION_LIMIT ((NTSTATUS) 0xC0000196L) +#define STATUS_REMOTE_SESSION_LIMIT ((NTSTATUS)0xC0000196L) #endif #ifndef STATUS_EVENTLOG_FILE_CHANGED -# define STATUS_EVENTLOG_FILE_CHANGED ((NTSTATUS) 0xC0000197L) +#define STATUS_EVENTLOG_FILE_CHANGED ((NTSTATUS)0xC0000197L) #endif #ifndef STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT -# define STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT ((NTSTATUS) 0xC0000198L) +#define STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT ((NTSTATUS)0xC0000198L) #endif #ifndef STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT -# define STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT ((NTSTATUS) 0xC0000199L) +#define STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT ((NTSTATUS)0xC0000199L) #endif #ifndef STATUS_NOLOGON_SERVER_TRUST_ACCOUNT -# define STATUS_NOLOGON_SERVER_TRUST_ACCOUNT ((NTSTATUS) 0xC000019AL) +#define STATUS_NOLOGON_SERVER_TRUST_ACCOUNT ((NTSTATUS)0xC000019AL) #endif #ifndef STATUS_DOMAIN_TRUST_INCONSISTENT -# define STATUS_DOMAIN_TRUST_INCONSISTENT ((NTSTATUS) 0xC000019BL) +#define STATUS_DOMAIN_TRUST_INCONSISTENT ((NTSTATUS)0xC000019BL) #endif #ifndef STATUS_FS_DRIVER_REQUIRED -# define STATUS_FS_DRIVER_REQUIRED ((NTSTATUS) 0xC000019CL) +#define STATUS_FS_DRIVER_REQUIRED ((NTSTATUS)0xC000019CL) #endif #ifndef STATUS_IMAGE_ALREADY_LOADED_AS_DLL -# define STATUS_IMAGE_ALREADY_LOADED_AS_DLL ((NTSTATUS) 0xC000019DL) +#define STATUS_IMAGE_ALREADY_LOADED_AS_DLL ((NTSTATUS)0xC000019DL) #endif #ifndef STATUS_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING -# define STATUS_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING ((NTSTATUS) 0xC000019EL) +#define STATUS_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING \ + ((NTSTATUS)0xC000019EL) #endif #ifndef STATUS_SHORT_NAMES_NOT_ENABLED_ON_VOLUME -# define STATUS_SHORT_NAMES_NOT_ENABLED_ON_VOLUME ((NTSTATUS) 0xC000019FL) +#define STATUS_SHORT_NAMES_NOT_ENABLED_ON_VOLUME ((NTSTATUS)0xC000019FL) #endif #ifndef STATUS_SECURITY_STREAM_IS_INCONSISTENT -# define STATUS_SECURITY_STREAM_IS_INCONSISTENT ((NTSTATUS) 0xC00001A0L) +#define STATUS_SECURITY_STREAM_IS_INCONSISTENT ((NTSTATUS)0xC00001A0L) #endif #ifndef STATUS_INVALID_LOCK_RANGE -# define STATUS_INVALID_LOCK_RANGE ((NTSTATUS) 0xC00001A1L) +#define STATUS_INVALID_LOCK_RANGE ((NTSTATUS)0xC00001A1L) #endif #ifndef STATUS_INVALID_ACE_CONDITION -# define STATUS_INVALID_ACE_CONDITION ((NTSTATUS) 0xC00001A2L) +#define STATUS_INVALID_ACE_CONDITION ((NTSTATUS)0xC00001A2L) #endif #ifndef STATUS_IMAGE_SUBSYSTEM_NOT_PRESENT -# define STATUS_IMAGE_SUBSYSTEM_NOT_PRESENT ((NTSTATUS) 0xC00001A3L) +#define STATUS_IMAGE_SUBSYSTEM_NOT_PRESENT ((NTSTATUS)0xC00001A3L) #endif #ifndef STATUS_NOTIFICATION_GUID_ALREADY_DEFINED -# define STATUS_NOTIFICATION_GUID_ALREADY_DEFINED ((NTSTATUS) 0xC00001A4L) +#define STATUS_NOTIFICATION_GUID_ALREADY_DEFINED ((NTSTATUS)0xC00001A4L) #endif #ifndef STATUS_NETWORK_OPEN_RESTRICTION -# define STATUS_NETWORK_OPEN_RESTRICTION ((NTSTATUS) 0xC0000201L) +#define STATUS_NETWORK_OPEN_RESTRICTION ((NTSTATUS)0xC0000201L) #endif #ifndef STATUS_NO_USER_SESSION_KEY -# define STATUS_NO_USER_SESSION_KEY ((NTSTATUS) 0xC0000202L) +#define STATUS_NO_USER_SESSION_KEY ((NTSTATUS)0xC0000202L) #endif #ifndef STATUS_USER_SESSION_DELETED -# define STATUS_USER_SESSION_DELETED ((NTSTATUS) 0xC0000203L) +#define STATUS_USER_SESSION_DELETED ((NTSTATUS)0xC0000203L) #endif #ifndef STATUS_RESOURCE_LANG_NOT_FOUND -# define STATUS_RESOURCE_LANG_NOT_FOUND ((NTSTATUS) 0xC0000204L) +#define STATUS_RESOURCE_LANG_NOT_FOUND ((NTSTATUS)0xC0000204L) #endif #ifndef STATUS_INSUFF_SERVER_RESOURCES -# define STATUS_INSUFF_SERVER_RESOURCES ((NTSTATUS) 0xC0000205L) +#define STATUS_INSUFF_SERVER_RESOURCES ((NTSTATUS)0xC0000205L) #endif #ifndef STATUS_INVALID_BUFFER_SIZE -# define STATUS_INVALID_BUFFER_SIZE ((NTSTATUS) 0xC0000206L) +#define STATUS_INVALID_BUFFER_SIZE ((NTSTATUS)0xC0000206L) #endif #ifndef STATUS_INVALID_ADDRESS_COMPONENT -# define STATUS_INVALID_ADDRESS_COMPONENT ((NTSTATUS) 0xC0000207L) +#define STATUS_INVALID_ADDRESS_COMPONENT ((NTSTATUS)0xC0000207L) #endif #ifndef STATUS_INVALID_ADDRESS_WILDCARD -# define STATUS_INVALID_ADDRESS_WILDCARD ((NTSTATUS) 0xC0000208L) +#define STATUS_INVALID_ADDRESS_WILDCARD ((NTSTATUS)0xC0000208L) #endif #ifndef STATUS_TOO_MANY_ADDRESSES -# define STATUS_TOO_MANY_ADDRESSES ((NTSTATUS) 0xC0000209L) +#define STATUS_TOO_MANY_ADDRESSES ((NTSTATUS)0xC0000209L) #endif #ifndef STATUS_ADDRESS_ALREADY_EXISTS -# define STATUS_ADDRESS_ALREADY_EXISTS ((NTSTATUS) 0xC000020AL) +#define STATUS_ADDRESS_ALREADY_EXISTS ((NTSTATUS)0xC000020AL) #endif #ifndef STATUS_ADDRESS_CLOSED -# define STATUS_ADDRESS_CLOSED ((NTSTATUS) 0xC000020BL) +#define STATUS_ADDRESS_CLOSED ((NTSTATUS)0xC000020BL) #endif #ifndef STATUS_CONNECTION_DISCONNECTED -# define STATUS_CONNECTION_DISCONNECTED ((NTSTATUS) 0xC000020CL) +#define STATUS_CONNECTION_DISCONNECTED ((NTSTATUS)0xC000020CL) #endif #ifndef STATUS_CONNECTION_RESET -# define STATUS_CONNECTION_RESET ((NTSTATUS) 0xC000020DL) +#define STATUS_CONNECTION_RESET ((NTSTATUS)0xC000020DL) #endif #ifndef STATUS_TOO_MANY_NODES -# define STATUS_TOO_MANY_NODES ((NTSTATUS) 0xC000020EL) +#define STATUS_TOO_MANY_NODES ((NTSTATUS)0xC000020EL) #endif #ifndef STATUS_TRANSACTION_ABORTED -# define STATUS_TRANSACTION_ABORTED ((NTSTATUS) 0xC000020FL) +#define STATUS_TRANSACTION_ABORTED ((NTSTATUS)0xC000020FL) #endif #ifndef STATUS_TRANSACTION_TIMED_OUT -# define STATUS_TRANSACTION_TIMED_OUT ((NTSTATUS) 0xC0000210L) +#define STATUS_TRANSACTION_TIMED_OUT ((NTSTATUS)0xC0000210L) #endif #ifndef STATUS_TRANSACTION_NO_RELEASE -# define STATUS_TRANSACTION_NO_RELEASE ((NTSTATUS) 0xC0000211L) +#define STATUS_TRANSACTION_NO_RELEASE ((NTSTATUS)0xC0000211L) #endif #ifndef STATUS_TRANSACTION_NO_MATCH -# define STATUS_TRANSACTION_NO_MATCH ((NTSTATUS) 0xC0000212L) +#define STATUS_TRANSACTION_NO_MATCH ((NTSTATUS)0xC0000212L) #endif #ifndef STATUS_TRANSACTION_RESPONDED -# define STATUS_TRANSACTION_RESPONDED ((NTSTATUS) 0xC0000213L) +#define STATUS_TRANSACTION_RESPONDED ((NTSTATUS)0xC0000213L) #endif #ifndef STATUS_TRANSACTION_INVALID_ID -# define STATUS_TRANSACTION_INVALID_ID ((NTSTATUS) 0xC0000214L) +#define STATUS_TRANSACTION_INVALID_ID ((NTSTATUS)0xC0000214L) #endif #ifndef STATUS_TRANSACTION_INVALID_TYPE -# define STATUS_TRANSACTION_INVALID_TYPE ((NTSTATUS) 0xC0000215L) +#define STATUS_TRANSACTION_INVALID_TYPE ((NTSTATUS)0xC0000215L) #endif #ifndef STATUS_NOT_SERVER_SESSION -# define STATUS_NOT_SERVER_SESSION ((NTSTATUS) 0xC0000216L) +#define STATUS_NOT_SERVER_SESSION ((NTSTATUS)0xC0000216L) #endif #ifndef STATUS_NOT_CLIENT_SESSION -# define STATUS_NOT_CLIENT_SESSION ((NTSTATUS) 0xC0000217L) +#define STATUS_NOT_CLIENT_SESSION ((NTSTATUS)0xC0000217L) #endif #ifndef STATUS_CANNOT_LOAD_REGISTRY_FILE -# define STATUS_CANNOT_LOAD_REGISTRY_FILE ((NTSTATUS) 0xC0000218L) +#define STATUS_CANNOT_LOAD_REGISTRY_FILE ((NTSTATUS)0xC0000218L) #endif #ifndef STATUS_DEBUG_ATTACH_FAILED -# define STATUS_DEBUG_ATTACH_FAILED ((NTSTATUS) 0xC0000219L) +#define STATUS_DEBUG_ATTACH_FAILED ((NTSTATUS)0xC0000219L) #endif #ifndef STATUS_SYSTEM_PROCESS_TERMINATED -# define STATUS_SYSTEM_PROCESS_TERMINATED ((NTSTATUS) 0xC000021AL) +#define STATUS_SYSTEM_PROCESS_TERMINATED ((NTSTATUS)0xC000021AL) #endif #ifndef STATUS_DATA_NOT_ACCEPTED -# define STATUS_DATA_NOT_ACCEPTED ((NTSTATUS) 0xC000021BL) +#define STATUS_DATA_NOT_ACCEPTED ((NTSTATUS)0xC000021BL) #endif #ifndef STATUS_NO_BROWSER_SERVERS_FOUND -# define STATUS_NO_BROWSER_SERVERS_FOUND ((NTSTATUS) 0xC000021CL) +#define STATUS_NO_BROWSER_SERVERS_FOUND ((NTSTATUS)0xC000021CL) #endif #ifndef STATUS_VDM_HARD_ERROR -# define STATUS_VDM_HARD_ERROR ((NTSTATUS) 0xC000021DL) +#define STATUS_VDM_HARD_ERROR ((NTSTATUS)0xC000021DL) #endif #ifndef STATUS_DRIVER_CANCEL_TIMEOUT -# define STATUS_DRIVER_CANCEL_TIMEOUT ((NTSTATUS) 0xC000021EL) +#define STATUS_DRIVER_CANCEL_TIMEOUT ((NTSTATUS)0xC000021EL) #endif #ifndef STATUS_REPLY_MESSAGE_MISMATCH -# define STATUS_REPLY_MESSAGE_MISMATCH ((NTSTATUS) 0xC000021FL) +#define STATUS_REPLY_MESSAGE_MISMATCH ((NTSTATUS)0xC000021FL) #endif #ifndef STATUS_MAPPED_ALIGNMENT -# define STATUS_MAPPED_ALIGNMENT ((NTSTATUS) 0xC0000220L) +#define STATUS_MAPPED_ALIGNMENT ((NTSTATUS)0xC0000220L) #endif #ifndef STATUS_IMAGE_CHECKSUM_MISMATCH -# define STATUS_IMAGE_CHECKSUM_MISMATCH ((NTSTATUS) 0xC0000221L) +#define STATUS_IMAGE_CHECKSUM_MISMATCH ((NTSTATUS)0xC0000221L) #endif #ifndef STATUS_LOST_WRITEBEHIND_DATA -# define STATUS_LOST_WRITEBEHIND_DATA ((NTSTATUS) 0xC0000222L) +#define STATUS_LOST_WRITEBEHIND_DATA ((NTSTATUS)0xC0000222L) #endif #ifndef STATUS_CLIENT_SERVER_PARAMETERS_INVALID -# define STATUS_CLIENT_SERVER_PARAMETERS_INVALID ((NTSTATUS) 0xC0000223L) +#define STATUS_CLIENT_SERVER_PARAMETERS_INVALID ((NTSTATUS)0xC0000223L) #endif #ifndef STATUS_PASSWORD_MUST_CHANGE -# define STATUS_PASSWORD_MUST_CHANGE ((NTSTATUS) 0xC0000224L) +#define STATUS_PASSWORD_MUST_CHANGE ((NTSTATUS)0xC0000224L) #endif #ifndef STATUS_NOT_FOUND -# define STATUS_NOT_FOUND ((NTSTATUS) 0xC0000225L) +#define STATUS_NOT_FOUND ((NTSTATUS)0xC0000225L) #endif #ifndef STATUS_NOT_TINY_STREAM -# define STATUS_NOT_TINY_STREAM ((NTSTATUS) 0xC0000226L) +#define STATUS_NOT_TINY_STREAM ((NTSTATUS)0xC0000226L) #endif #ifndef STATUS_RECOVERY_FAILURE -# define STATUS_RECOVERY_FAILURE ((NTSTATUS) 0xC0000227L) +#define STATUS_RECOVERY_FAILURE ((NTSTATUS)0xC0000227L) #endif #ifndef STATUS_STACK_OVERFLOW_READ -# define STATUS_STACK_OVERFLOW_READ ((NTSTATUS) 0xC0000228L) +#define STATUS_STACK_OVERFLOW_READ ((NTSTATUS)0xC0000228L) #endif #ifndef STATUS_FAIL_CHECK -# define STATUS_FAIL_CHECK ((NTSTATUS) 0xC0000229L) +#define STATUS_FAIL_CHECK ((NTSTATUS)0xC0000229L) #endif #ifndef STATUS_DUPLICATE_OBJECTID -# define STATUS_DUPLICATE_OBJECTID ((NTSTATUS) 0xC000022AL) +#define STATUS_DUPLICATE_OBJECTID ((NTSTATUS)0xC000022AL) #endif #ifndef STATUS_OBJECTID_EXISTS -# define STATUS_OBJECTID_EXISTS ((NTSTATUS) 0xC000022BL) +#define STATUS_OBJECTID_EXISTS ((NTSTATUS)0xC000022BL) #endif #ifndef STATUS_CONVERT_TO_LARGE -# define STATUS_CONVERT_TO_LARGE ((NTSTATUS) 0xC000022CL) +#define STATUS_CONVERT_TO_LARGE ((NTSTATUS)0xC000022CL) #endif #ifndef STATUS_RETRY -# define STATUS_RETRY ((NTSTATUS) 0xC000022DL) +#define STATUS_RETRY ((NTSTATUS)0xC000022DL) #endif #ifndef STATUS_FOUND_OUT_OF_SCOPE -# define STATUS_FOUND_OUT_OF_SCOPE ((NTSTATUS) 0xC000022EL) +#define STATUS_FOUND_OUT_OF_SCOPE ((NTSTATUS)0xC000022EL) #endif #ifndef STATUS_ALLOCATE_BUCKET -# define STATUS_ALLOCATE_BUCKET ((NTSTATUS) 0xC000022FL) +#define STATUS_ALLOCATE_BUCKET ((NTSTATUS)0xC000022FL) #endif #ifndef STATUS_PROPSET_NOT_FOUND -# define STATUS_PROPSET_NOT_FOUND ((NTSTATUS) 0xC0000230L) +#define STATUS_PROPSET_NOT_FOUND ((NTSTATUS)0xC0000230L) #endif #ifndef STATUS_MARSHALL_OVERFLOW -# define STATUS_MARSHALL_OVERFLOW ((NTSTATUS) 0xC0000231L) +#define STATUS_MARSHALL_OVERFLOW ((NTSTATUS)0xC0000231L) #endif #ifndef STATUS_INVALID_VARIANT -# define STATUS_INVALID_VARIANT ((NTSTATUS) 0xC0000232L) +#define STATUS_INVALID_VARIANT ((NTSTATUS)0xC0000232L) #endif #ifndef STATUS_DOMAIN_CONTROLLER_NOT_FOUND -# define STATUS_DOMAIN_CONTROLLER_NOT_FOUND ((NTSTATUS) 0xC0000233L) +#define STATUS_DOMAIN_CONTROLLER_NOT_FOUND ((NTSTATUS)0xC0000233L) #endif #ifndef STATUS_ACCOUNT_LOCKED_OUT -# define STATUS_ACCOUNT_LOCKED_OUT ((NTSTATUS) 0xC0000234L) +#define STATUS_ACCOUNT_LOCKED_OUT ((NTSTATUS)0xC0000234L) #endif #ifndef STATUS_HANDLE_NOT_CLOSABLE -# define STATUS_HANDLE_NOT_CLOSABLE ((NTSTATUS) 0xC0000235L) +#define STATUS_HANDLE_NOT_CLOSABLE ((NTSTATUS)0xC0000235L) #endif #ifndef STATUS_CONNECTION_REFUSED -# define STATUS_CONNECTION_REFUSED ((NTSTATUS) 0xC0000236L) +#define STATUS_CONNECTION_REFUSED ((NTSTATUS)0xC0000236L) #endif #ifndef STATUS_GRACEFUL_DISCONNECT -# define STATUS_GRACEFUL_DISCONNECT ((NTSTATUS) 0xC0000237L) +#define STATUS_GRACEFUL_DISCONNECT ((NTSTATUS)0xC0000237L) #endif #ifndef STATUS_ADDRESS_ALREADY_ASSOCIATED -# define STATUS_ADDRESS_ALREADY_ASSOCIATED ((NTSTATUS) 0xC0000238L) +#define STATUS_ADDRESS_ALREADY_ASSOCIATED ((NTSTATUS)0xC0000238L) #endif #ifndef STATUS_ADDRESS_NOT_ASSOCIATED -# define STATUS_ADDRESS_NOT_ASSOCIATED ((NTSTATUS) 0xC0000239L) +#define STATUS_ADDRESS_NOT_ASSOCIATED ((NTSTATUS)0xC0000239L) #endif #ifndef STATUS_CONNECTION_INVALID -# define STATUS_CONNECTION_INVALID ((NTSTATUS) 0xC000023AL) +#define STATUS_CONNECTION_INVALID ((NTSTATUS)0xC000023AL) #endif #ifndef STATUS_CONNECTION_ACTIVE -# define STATUS_CONNECTION_ACTIVE ((NTSTATUS) 0xC000023BL) +#define STATUS_CONNECTION_ACTIVE ((NTSTATUS)0xC000023BL) #endif #ifndef STATUS_NETWORK_UNREACHABLE -# define STATUS_NETWORK_UNREACHABLE ((NTSTATUS) 0xC000023CL) +#define STATUS_NETWORK_UNREACHABLE ((NTSTATUS)0xC000023CL) #endif #ifndef STATUS_HOST_UNREACHABLE -# define STATUS_HOST_UNREACHABLE ((NTSTATUS) 0xC000023DL) +#define STATUS_HOST_UNREACHABLE ((NTSTATUS)0xC000023DL) #endif #ifndef STATUS_PROTOCOL_UNREACHABLE -# define STATUS_PROTOCOL_UNREACHABLE ((NTSTATUS) 0xC000023EL) +#define STATUS_PROTOCOL_UNREACHABLE ((NTSTATUS)0xC000023EL) #endif #ifndef STATUS_PORT_UNREACHABLE -# define STATUS_PORT_UNREACHABLE ((NTSTATUS) 0xC000023FL) +#define STATUS_PORT_UNREACHABLE ((NTSTATUS)0xC000023FL) #endif #ifndef STATUS_REQUEST_ABORTED -# define STATUS_REQUEST_ABORTED ((NTSTATUS) 0xC0000240L) +#define STATUS_REQUEST_ABORTED ((NTSTATUS)0xC0000240L) #endif #ifndef STATUS_CONNECTION_ABORTED -# define STATUS_CONNECTION_ABORTED ((NTSTATUS) 0xC0000241L) +#define STATUS_CONNECTION_ABORTED ((NTSTATUS)0xC0000241L) #endif #ifndef STATUS_BAD_COMPRESSION_BUFFER -# define STATUS_BAD_COMPRESSION_BUFFER ((NTSTATUS) 0xC0000242L) +#define STATUS_BAD_COMPRESSION_BUFFER ((NTSTATUS)0xC0000242L) #endif #ifndef STATUS_USER_MAPPED_FILE -# define STATUS_USER_MAPPED_FILE ((NTSTATUS) 0xC0000243L) +#define STATUS_USER_MAPPED_FILE ((NTSTATUS)0xC0000243L) #endif #ifndef STATUS_AUDIT_FAILED -# define STATUS_AUDIT_FAILED ((NTSTATUS) 0xC0000244L) +#define STATUS_AUDIT_FAILED ((NTSTATUS)0xC0000244L) #endif #ifndef STATUS_TIMER_RESOLUTION_NOT_SET -# define STATUS_TIMER_RESOLUTION_NOT_SET ((NTSTATUS) 0xC0000245L) +#define STATUS_TIMER_RESOLUTION_NOT_SET ((NTSTATUS)0xC0000245L) #endif #ifndef STATUS_CONNECTION_COUNT_LIMIT -# define STATUS_CONNECTION_COUNT_LIMIT ((NTSTATUS) 0xC0000246L) +#define STATUS_CONNECTION_COUNT_LIMIT ((NTSTATUS)0xC0000246L) #endif #ifndef STATUS_LOGIN_TIME_RESTRICTION -# define STATUS_LOGIN_TIME_RESTRICTION ((NTSTATUS) 0xC0000247L) +#define STATUS_LOGIN_TIME_RESTRICTION ((NTSTATUS)0xC0000247L) #endif #ifndef STATUS_LOGIN_WKSTA_RESTRICTION -# define STATUS_LOGIN_WKSTA_RESTRICTION ((NTSTATUS) 0xC0000248L) +#define STATUS_LOGIN_WKSTA_RESTRICTION ((NTSTATUS)0xC0000248L) #endif #ifndef STATUS_IMAGE_MP_UP_MISMATCH -# define STATUS_IMAGE_MP_UP_MISMATCH ((NTSTATUS) 0xC0000249L) +#define STATUS_IMAGE_MP_UP_MISMATCH ((NTSTATUS)0xC0000249L) #endif #ifndef STATUS_INSUFFICIENT_LOGON_INFO -# define STATUS_INSUFFICIENT_LOGON_INFO ((NTSTATUS) 0xC0000250L) +#define STATUS_INSUFFICIENT_LOGON_INFO ((NTSTATUS)0xC0000250L) #endif #ifndef STATUS_BAD_DLL_ENTRYPOINT -# define STATUS_BAD_DLL_ENTRYPOINT ((NTSTATUS) 0xC0000251L) +#define STATUS_BAD_DLL_ENTRYPOINT ((NTSTATUS)0xC0000251L) #endif #ifndef STATUS_BAD_SERVICE_ENTRYPOINT -# define STATUS_BAD_SERVICE_ENTRYPOINT ((NTSTATUS) 0xC0000252L) +#define STATUS_BAD_SERVICE_ENTRYPOINT ((NTSTATUS)0xC0000252L) #endif #ifndef STATUS_LPC_REPLY_LOST -# define STATUS_LPC_REPLY_LOST ((NTSTATUS) 0xC0000253L) +#define STATUS_LPC_REPLY_LOST ((NTSTATUS)0xC0000253L) #endif #ifndef STATUS_IP_ADDRESS_CONFLICT1 -# define STATUS_IP_ADDRESS_CONFLICT1 ((NTSTATUS) 0xC0000254L) +#define STATUS_IP_ADDRESS_CONFLICT1 ((NTSTATUS)0xC0000254L) #endif #ifndef STATUS_IP_ADDRESS_CONFLICT2 -# define STATUS_IP_ADDRESS_CONFLICT2 ((NTSTATUS) 0xC0000255L) +#define STATUS_IP_ADDRESS_CONFLICT2 ((NTSTATUS)0xC0000255L) #endif #ifndef STATUS_REGISTRY_QUOTA_LIMIT -# define STATUS_REGISTRY_QUOTA_LIMIT ((NTSTATUS) 0xC0000256L) +#define STATUS_REGISTRY_QUOTA_LIMIT ((NTSTATUS)0xC0000256L) #endif #ifndef STATUS_PATH_NOT_COVERED -# define STATUS_PATH_NOT_COVERED ((NTSTATUS) 0xC0000257L) +#define STATUS_PATH_NOT_COVERED ((NTSTATUS)0xC0000257L) #endif #ifndef STATUS_NO_CALLBACK_ACTIVE -# define STATUS_NO_CALLBACK_ACTIVE ((NTSTATUS) 0xC0000258L) +#define STATUS_NO_CALLBACK_ACTIVE ((NTSTATUS)0xC0000258L) #endif #ifndef STATUS_LICENSE_QUOTA_EXCEEDED -# define STATUS_LICENSE_QUOTA_EXCEEDED ((NTSTATUS) 0xC0000259L) +#define STATUS_LICENSE_QUOTA_EXCEEDED ((NTSTATUS)0xC0000259L) #endif #ifndef STATUS_PWD_TOO_SHORT -# define STATUS_PWD_TOO_SHORT ((NTSTATUS) 0xC000025AL) +#define STATUS_PWD_TOO_SHORT ((NTSTATUS)0xC000025AL) #endif #ifndef STATUS_PWD_TOO_RECENT -# define STATUS_PWD_TOO_RECENT ((NTSTATUS) 0xC000025BL) +#define STATUS_PWD_TOO_RECENT ((NTSTATUS)0xC000025BL) #endif #ifndef STATUS_PWD_HISTORY_CONFLICT -# define STATUS_PWD_HISTORY_CONFLICT ((NTSTATUS) 0xC000025CL) +#define STATUS_PWD_HISTORY_CONFLICT ((NTSTATUS)0xC000025CL) #endif #ifndef STATUS_PLUGPLAY_NO_DEVICE -# define STATUS_PLUGPLAY_NO_DEVICE ((NTSTATUS) 0xC000025EL) +#define STATUS_PLUGPLAY_NO_DEVICE ((NTSTATUS)0xC000025EL) #endif #ifndef STATUS_UNSUPPORTED_COMPRESSION -# define STATUS_UNSUPPORTED_COMPRESSION ((NTSTATUS) 0xC000025FL) +#define STATUS_UNSUPPORTED_COMPRESSION ((NTSTATUS)0xC000025FL) #endif #ifndef STATUS_INVALID_HW_PROFILE -# define STATUS_INVALID_HW_PROFILE ((NTSTATUS) 0xC0000260L) +#define STATUS_INVALID_HW_PROFILE ((NTSTATUS)0xC0000260L) #endif #ifndef STATUS_INVALID_PLUGPLAY_DEVICE_PATH -# define STATUS_INVALID_PLUGPLAY_DEVICE_PATH ((NTSTATUS) 0xC0000261L) +#define STATUS_INVALID_PLUGPLAY_DEVICE_PATH ((NTSTATUS)0xC0000261L) #endif #ifndef STATUS_DRIVER_ORDINAL_NOT_FOUND -# define STATUS_DRIVER_ORDINAL_NOT_FOUND ((NTSTATUS) 0xC0000262L) +#define STATUS_DRIVER_ORDINAL_NOT_FOUND ((NTSTATUS)0xC0000262L) #endif #ifndef STATUS_DRIVER_ENTRYPOINT_NOT_FOUND -# define STATUS_DRIVER_ENTRYPOINT_NOT_FOUND ((NTSTATUS) 0xC0000263L) +#define STATUS_DRIVER_ENTRYPOINT_NOT_FOUND ((NTSTATUS)0xC0000263L) #endif #ifndef STATUS_RESOURCE_NOT_OWNED -# define STATUS_RESOURCE_NOT_OWNED ((NTSTATUS) 0xC0000264L) +#define STATUS_RESOURCE_NOT_OWNED ((NTSTATUS)0xC0000264L) #endif #ifndef STATUS_TOO_MANY_LINKS -# define STATUS_TOO_MANY_LINKS ((NTSTATUS) 0xC0000265L) +#define STATUS_TOO_MANY_LINKS ((NTSTATUS)0xC0000265L) #endif #ifndef STATUS_QUOTA_LIST_INCONSISTENT -# define STATUS_QUOTA_LIST_INCONSISTENT ((NTSTATUS) 0xC0000266L) +#define STATUS_QUOTA_LIST_INCONSISTENT ((NTSTATUS)0xC0000266L) #endif #ifndef STATUS_FILE_IS_OFFLINE -# define STATUS_FILE_IS_OFFLINE ((NTSTATUS) 0xC0000267L) +#define STATUS_FILE_IS_OFFLINE ((NTSTATUS)0xC0000267L) #endif #ifndef STATUS_EVALUATION_EXPIRATION -# define STATUS_EVALUATION_EXPIRATION ((NTSTATUS) 0xC0000268L) +#define STATUS_EVALUATION_EXPIRATION ((NTSTATUS)0xC0000268L) #endif #ifndef STATUS_ILLEGAL_DLL_RELOCATION -# define STATUS_ILLEGAL_DLL_RELOCATION ((NTSTATUS) 0xC0000269L) +#define STATUS_ILLEGAL_DLL_RELOCATION ((NTSTATUS)0xC0000269L) #endif #ifndef STATUS_LICENSE_VIOLATION -# define STATUS_LICENSE_VIOLATION ((NTSTATUS) 0xC000026AL) +#define STATUS_LICENSE_VIOLATION ((NTSTATUS)0xC000026AL) #endif #ifndef STATUS_DLL_INIT_FAILED_LOGOFF -# define STATUS_DLL_INIT_FAILED_LOGOFF ((NTSTATUS) 0xC000026BL) +#define STATUS_DLL_INIT_FAILED_LOGOFF ((NTSTATUS)0xC000026BL) #endif #ifndef STATUS_DRIVER_UNABLE_TO_LOAD -# define STATUS_DRIVER_UNABLE_TO_LOAD ((NTSTATUS) 0xC000026CL) +#define STATUS_DRIVER_UNABLE_TO_LOAD ((NTSTATUS)0xC000026CL) #endif #ifndef STATUS_DFS_UNAVAILABLE -# define STATUS_DFS_UNAVAILABLE ((NTSTATUS) 0xC000026DL) +#define STATUS_DFS_UNAVAILABLE ((NTSTATUS)0xC000026DL) #endif #ifndef STATUS_VOLUME_DISMOUNTED -# define STATUS_VOLUME_DISMOUNTED ((NTSTATUS) 0xC000026EL) +#define STATUS_VOLUME_DISMOUNTED ((NTSTATUS)0xC000026EL) #endif #ifndef STATUS_WX86_INTERNAL_ERROR -# define STATUS_WX86_INTERNAL_ERROR ((NTSTATUS) 0xC000026FL) +#define STATUS_WX86_INTERNAL_ERROR ((NTSTATUS)0xC000026FL) #endif #ifndef STATUS_WX86_FLOAT_STACK_CHECK -# define STATUS_WX86_FLOAT_STACK_CHECK ((NTSTATUS) 0xC0000270L) +#define STATUS_WX86_FLOAT_STACK_CHECK ((NTSTATUS)0xC0000270L) #endif #ifndef STATUS_VALIDATE_CONTINUE -# define STATUS_VALIDATE_CONTINUE ((NTSTATUS) 0xC0000271L) +#define STATUS_VALIDATE_CONTINUE ((NTSTATUS)0xC0000271L) #endif #ifndef STATUS_NO_MATCH -# define STATUS_NO_MATCH ((NTSTATUS) 0xC0000272L) +#define STATUS_NO_MATCH ((NTSTATUS)0xC0000272L) #endif #ifndef STATUS_NO_MORE_MATCHES -# define STATUS_NO_MORE_MATCHES ((NTSTATUS) 0xC0000273L) +#define STATUS_NO_MORE_MATCHES ((NTSTATUS)0xC0000273L) #endif #ifndef STATUS_NOT_A_REPARSE_POINT -# define STATUS_NOT_A_REPARSE_POINT ((NTSTATUS) 0xC0000275L) +#define STATUS_NOT_A_REPARSE_POINT ((NTSTATUS)0xC0000275L) #endif #ifndef STATUS_IO_REPARSE_TAG_INVALID -# define STATUS_IO_REPARSE_TAG_INVALID ((NTSTATUS) 0xC0000276L) +#define STATUS_IO_REPARSE_TAG_INVALID ((NTSTATUS)0xC0000276L) #endif #ifndef STATUS_IO_REPARSE_TAG_MISMATCH -# define STATUS_IO_REPARSE_TAG_MISMATCH ((NTSTATUS) 0xC0000277L) +#define STATUS_IO_REPARSE_TAG_MISMATCH ((NTSTATUS)0xC0000277L) #endif #ifndef STATUS_IO_REPARSE_DATA_INVALID -# define STATUS_IO_REPARSE_DATA_INVALID ((NTSTATUS) 0xC0000278L) +#define STATUS_IO_REPARSE_DATA_INVALID ((NTSTATUS)0xC0000278L) #endif #ifndef STATUS_IO_REPARSE_TAG_NOT_HANDLED -# define STATUS_IO_REPARSE_TAG_NOT_HANDLED ((NTSTATUS) 0xC0000279L) +#define STATUS_IO_REPARSE_TAG_NOT_HANDLED ((NTSTATUS)0xC0000279L) #endif #ifndef STATUS_REPARSE_POINT_NOT_RESOLVED -# define STATUS_REPARSE_POINT_NOT_RESOLVED ((NTSTATUS) 0xC0000280L) +#define STATUS_REPARSE_POINT_NOT_RESOLVED ((NTSTATUS)0xC0000280L) #endif #ifndef STATUS_DIRECTORY_IS_A_REPARSE_POINT -# define STATUS_DIRECTORY_IS_A_REPARSE_POINT ((NTSTATUS) 0xC0000281L) +#define STATUS_DIRECTORY_IS_A_REPARSE_POINT ((NTSTATUS)0xC0000281L) #endif #ifndef STATUS_RANGE_LIST_CONFLICT -# define STATUS_RANGE_LIST_CONFLICT ((NTSTATUS) 0xC0000282L) +#define STATUS_RANGE_LIST_CONFLICT ((NTSTATUS)0xC0000282L) #endif #ifndef STATUS_SOURCE_ELEMENT_EMPTY -# define STATUS_SOURCE_ELEMENT_EMPTY ((NTSTATUS) 0xC0000283L) +#define STATUS_SOURCE_ELEMENT_EMPTY ((NTSTATUS)0xC0000283L) #endif #ifndef STATUS_DESTINATION_ELEMENT_FULL -# define STATUS_DESTINATION_ELEMENT_FULL ((NTSTATUS) 0xC0000284L) +#define STATUS_DESTINATION_ELEMENT_FULL ((NTSTATUS)0xC0000284L) #endif #ifndef STATUS_ILLEGAL_ELEMENT_ADDRESS -# define STATUS_ILLEGAL_ELEMENT_ADDRESS ((NTSTATUS) 0xC0000285L) +#define STATUS_ILLEGAL_ELEMENT_ADDRESS ((NTSTATUS)0xC0000285L) #endif #ifndef STATUS_MAGAZINE_NOT_PRESENT -# define STATUS_MAGAZINE_NOT_PRESENT ((NTSTATUS) 0xC0000286L) +#define STATUS_MAGAZINE_NOT_PRESENT ((NTSTATUS)0xC0000286L) #endif #ifndef STATUS_REINITIALIZATION_NEEDED -# define STATUS_REINITIALIZATION_NEEDED ((NTSTATUS) 0xC0000287L) +#define STATUS_REINITIALIZATION_NEEDED ((NTSTATUS)0xC0000287L) #endif #ifndef STATUS_DEVICE_REQUIRES_CLEANING -# define STATUS_DEVICE_REQUIRES_CLEANING ((NTSTATUS) 0x80000288L) +#define STATUS_DEVICE_REQUIRES_CLEANING ((NTSTATUS)0x80000288L) #endif #ifndef STATUS_DEVICE_DOOR_OPEN -# define STATUS_DEVICE_DOOR_OPEN ((NTSTATUS) 0x80000289L) +#define STATUS_DEVICE_DOOR_OPEN ((NTSTATUS)0x80000289L) #endif #ifndef STATUS_ENCRYPTION_FAILED -# define STATUS_ENCRYPTION_FAILED ((NTSTATUS) 0xC000028AL) +#define STATUS_ENCRYPTION_FAILED ((NTSTATUS)0xC000028AL) #endif #ifndef STATUS_DECRYPTION_FAILED -# define STATUS_DECRYPTION_FAILED ((NTSTATUS) 0xC000028BL) +#define STATUS_DECRYPTION_FAILED ((NTSTATUS)0xC000028BL) #endif #ifndef STATUS_RANGE_NOT_FOUND -# define STATUS_RANGE_NOT_FOUND ((NTSTATUS) 0xC000028CL) +#define STATUS_RANGE_NOT_FOUND ((NTSTATUS)0xC000028CL) #endif #ifndef STATUS_NO_RECOVERY_POLICY -# define STATUS_NO_RECOVERY_POLICY ((NTSTATUS) 0xC000028DL) +#define STATUS_NO_RECOVERY_POLICY ((NTSTATUS)0xC000028DL) #endif #ifndef STATUS_NO_EFS -# define STATUS_NO_EFS ((NTSTATUS) 0xC000028EL) +#define STATUS_NO_EFS ((NTSTATUS)0xC000028EL) #endif #ifndef STATUS_WRONG_EFS -# define STATUS_WRONG_EFS ((NTSTATUS) 0xC000028FL) +#define STATUS_WRONG_EFS ((NTSTATUS)0xC000028FL) #endif #ifndef STATUS_NO_USER_KEYS -# define STATUS_NO_USER_KEYS ((NTSTATUS) 0xC0000290L) +#define STATUS_NO_USER_KEYS ((NTSTATUS)0xC0000290L) #endif #ifndef STATUS_FILE_NOT_ENCRYPTED -# define STATUS_FILE_NOT_ENCRYPTED ((NTSTATUS) 0xC0000291L) +#define STATUS_FILE_NOT_ENCRYPTED ((NTSTATUS)0xC0000291L) #endif #ifndef STATUS_NOT_EXPORT_FORMAT -# define STATUS_NOT_EXPORT_FORMAT ((NTSTATUS) 0xC0000292L) +#define STATUS_NOT_EXPORT_FORMAT ((NTSTATUS)0xC0000292L) #endif #ifndef STATUS_FILE_ENCRYPTED -# define STATUS_FILE_ENCRYPTED ((NTSTATUS) 0xC0000293L) +#define STATUS_FILE_ENCRYPTED ((NTSTATUS)0xC0000293L) #endif #ifndef STATUS_WAKE_SYSTEM -# define STATUS_WAKE_SYSTEM ((NTSTATUS) 0x40000294L) +#define STATUS_WAKE_SYSTEM ((NTSTATUS)0x40000294L) #endif #ifndef STATUS_WMI_GUID_NOT_FOUND -# define STATUS_WMI_GUID_NOT_FOUND ((NTSTATUS) 0xC0000295L) +#define STATUS_WMI_GUID_NOT_FOUND ((NTSTATUS)0xC0000295L) #endif #ifndef STATUS_WMI_INSTANCE_NOT_FOUND -# define STATUS_WMI_INSTANCE_NOT_FOUND ((NTSTATUS) 0xC0000296L) +#define STATUS_WMI_INSTANCE_NOT_FOUND ((NTSTATUS)0xC0000296L) #endif #ifndef STATUS_WMI_ITEMID_NOT_FOUND -# define STATUS_WMI_ITEMID_NOT_FOUND ((NTSTATUS) 0xC0000297L) +#define STATUS_WMI_ITEMID_NOT_FOUND ((NTSTATUS)0xC0000297L) #endif #ifndef STATUS_WMI_TRY_AGAIN -# define STATUS_WMI_TRY_AGAIN ((NTSTATUS) 0xC0000298L) +#define STATUS_WMI_TRY_AGAIN ((NTSTATUS)0xC0000298L) #endif #ifndef STATUS_SHARED_POLICY -# define STATUS_SHARED_POLICY ((NTSTATUS) 0xC0000299L) +#define STATUS_SHARED_POLICY ((NTSTATUS)0xC0000299L) #endif #ifndef STATUS_POLICY_OBJECT_NOT_FOUND -# define STATUS_POLICY_OBJECT_NOT_FOUND ((NTSTATUS) 0xC000029AL) +#define STATUS_POLICY_OBJECT_NOT_FOUND ((NTSTATUS)0xC000029AL) #endif #ifndef STATUS_POLICY_ONLY_IN_DS -# define STATUS_POLICY_ONLY_IN_DS ((NTSTATUS) 0xC000029BL) +#define STATUS_POLICY_ONLY_IN_DS ((NTSTATUS)0xC000029BL) #endif #ifndef STATUS_VOLUME_NOT_UPGRADED -# define STATUS_VOLUME_NOT_UPGRADED ((NTSTATUS) 0xC000029CL) +#define STATUS_VOLUME_NOT_UPGRADED ((NTSTATUS)0xC000029CL) #endif #ifndef STATUS_REMOTE_STORAGE_NOT_ACTIVE -# define STATUS_REMOTE_STORAGE_NOT_ACTIVE ((NTSTATUS) 0xC000029DL) +#define STATUS_REMOTE_STORAGE_NOT_ACTIVE ((NTSTATUS)0xC000029DL) #endif #ifndef STATUS_REMOTE_STORAGE_MEDIA_ERROR -# define STATUS_REMOTE_STORAGE_MEDIA_ERROR ((NTSTATUS) 0xC000029EL) +#define STATUS_REMOTE_STORAGE_MEDIA_ERROR ((NTSTATUS)0xC000029EL) #endif #ifndef STATUS_NO_TRACKING_SERVICE -# define STATUS_NO_TRACKING_SERVICE ((NTSTATUS) 0xC000029FL) +#define STATUS_NO_TRACKING_SERVICE ((NTSTATUS)0xC000029FL) #endif #ifndef STATUS_SERVER_SID_MISMATCH -# define STATUS_SERVER_SID_MISMATCH ((NTSTATUS) 0xC00002A0L) +#define STATUS_SERVER_SID_MISMATCH ((NTSTATUS)0xC00002A0L) #endif #ifndef STATUS_DS_NO_ATTRIBUTE_OR_VALUE -# define STATUS_DS_NO_ATTRIBUTE_OR_VALUE ((NTSTATUS) 0xC00002A1L) +#define STATUS_DS_NO_ATTRIBUTE_OR_VALUE ((NTSTATUS)0xC00002A1L) #endif #ifndef STATUS_DS_INVALID_ATTRIBUTE_SYNTAX -# define STATUS_DS_INVALID_ATTRIBUTE_SYNTAX ((NTSTATUS) 0xC00002A2L) +#define STATUS_DS_INVALID_ATTRIBUTE_SYNTAX ((NTSTATUS)0xC00002A2L) #endif #ifndef STATUS_DS_ATTRIBUTE_TYPE_UNDEFINED -# define STATUS_DS_ATTRIBUTE_TYPE_UNDEFINED ((NTSTATUS) 0xC00002A3L) +#define STATUS_DS_ATTRIBUTE_TYPE_UNDEFINED ((NTSTATUS)0xC00002A3L) #endif #ifndef STATUS_DS_ATTRIBUTE_OR_VALUE_EXISTS -# define STATUS_DS_ATTRIBUTE_OR_VALUE_EXISTS ((NTSTATUS) 0xC00002A4L) +#define STATUS_DS_ATTRIBUTE_OR_VALUE_EXISTS ((NTSTATUS)0xC00002A4L) #endif #ifndef STATUS_DS_BUSY -# define STATUS_DS_BUSY ((NTSTATUS) 0xC00002A5L) +#define STATUS_DS_BUSY ((NTSTATUS)0xC00002A5L) #endif #ifndef STATUS_DS_UNAVAILABLE -# define STATUS_DS_UNAVAILABLE ((NTSTATUS) 0xC00002A6L) +#define STATUS_DS_UNAVAILABLE ((NTSTATUS)0xC00002A6L) #endif #ifndef STATUS_DS_NO_RIDS_ALLOCATED -# define STATUS_DS_NO_RIDS_ALLOCATED ((NTSTATUS) 0xC00002A7L) +#define STATUS_DS_NO_RIDS_ALLOCATED ((NTSTATUS)0xC00002A7L) #endif #ifndef STATUS_DS_NO_MORE_RIDS -# define STATUS_DS_NO_MORE_RIDS ((NTSTATUS) 0xC00002A8L) +#define STATUS_DS_NO_MORE_RIDS ((NTSTATUS)0xC00002A8L) #endif #ifndef STATUS_DS_INCORRECT_ROLE_OWNER -# define STATUS_DS_INCORRECT_ROLE_OWNER ((NTSTATUS) 0xC00002A9L) +#define STATUS_DS_INCORRECT_ROLE_OWNER ((NTSTATUS)0xC00002A9L) #endif #ifndef STATUS_DS_RIDMGR_INIT_ERROR -# define STATUS_DS_RIDMGR_INIT_ERROR ((NTSTATUS) 0xC00002AAL) +#define STATUS_DS_RIDMGR_INIT_ERROR ((NTSTATUS)0xC00002AAL) #endif #ifndef STATUS_DS_OBJ_CLASS_VIOLATION -# define STATUS_DS_OBJ_CLASS_VIOLATION ((NTSTATUS) 0xC00002ABL) +#define STATUS_DS_OBJ_CLASS_VIOLATION ((NTSTATUS)0xC00002ABL) #endif #ifndef STATUS_DS_CANT_ON_NON_LEAF -# define STATUS_DS_CANT_ON_NON_LEAF ((NTSTATUS) 0xC00002ACL) +#define STATUS_DS_CANT_ON_NON_LEAF ((NTSTATUS)0xC00002ACL) #endif #ifndef STATUS_DS_CANT_ON_RDN -# define STATUS_DS_CANT_ON_RDN ((NTSTATUS) 0xC00002ADL) +#define STATUS_DS_CANT_ON_RDN ((NTSTATUS)0xC00002ADL) #endif #ifndef STATUS_DS_CANT_MOD_OBJ_CLASS -# define STATUS_DS_CANT_MOD_OBJ_CLASS ((NTSTATUS) 0xC00002AEL) +#define STATUS_DS_CANT_MOD_OBJ_CLASS ((NTSTATUS)0xC00002AEL) #endif #ifndef STATUS_DS_CROSS_DOM_MOVE_FAILED -# define STATUS_DS_CROSS_DOM_MOVE_FAILED ((NTSTATUS) 0xC00002AFL) +#define STATUS_DS_CROSS_DOM_MOVE_FAILED ((NTSTATUS)0xC00002AFL) #endif #ifndef STATUS_DS_GC_NOT_AVAILABLE -# define STATUS_DS_GC_NOT_AVAILABLE ((NTSTATUS) 0xC00002B0L) +#define STATUS_DS_GC_NOT_AVAILABLE ((NTSTATUS)0xC00002B0L) #endif #ifndef STATUS_DIRECTORY_SERVICE_REQUIRED -# define STATUS_DIRECTORY_SERVICE_REQUIRED ((NTSTATUS) 0xC00002B1L) +#define STATUS_DIRECTORY_SERVICE_REQUIRED ((NTSTATUS)0xC00002B1L) #endif #ifndef STATUS_REPARSE_ATTRIBUTE_CONFLICT -# define STATUS_REPARSE_ATTRIBUTE_CONFLICT ((NTSTATUS) 0xC00002B2L) +#define STATUS_REPARSE_ATTRIBUTE_CONFLICT ((NTSTATUS)0xC00002B2L) #endif #ifndef STATUS_CANT_ENABLE_DENY_ONLY -# define STATUS_CANT_ENABLE_DENY_ONLY ((NTSTATUS) 0xC00002B3L) +#define STATUS_CANT_ENABLE_DENY_ONLY ((NTSTATUS)0xC00002B3L) #endif #ifndef STATUS_FLOAT_MULTIPLE_FAULTS -# define STATUS_FLOAT_MULTIPLE_FAULTS ((NTSTATUS) 0xC00002B4L) +#define STATUS_FLOAT_MULTIPLE_FAULTS ((NTSTATUS)0xC00002B4L) #endif #ifndef STATUS_FLOAT_MULTIPLE_TRAPS -# define STATUS_FLOAT_MULTIPLE_TRAPS ((NTSTATUS) 0xC00002B5L) +#define STATUS_FLOAT_MULTIPLE_TRAPS ((NTSTATUS)0xC00002B5L) #endif #ifndef STATUS_DEVICE_REMOVED -# define STATUS_DEVICE_REMOVED ((NTSTATUS) 0xC00002B6L) +#define STATUS_DEVICE_REMOVED ((NTSTATUS)0xC00002B6L) #endif #ifndef STATUS_JOURNAL_DELETE_IN_PROGRESS -# define STATUS_JOURNAL_DELETE_IN_PROGRESS ((NTSTATUS) 0xC00002B7L) +#define STATUS_JOURNAL_DELETE_IN_PROGRESS ((NTSTATUS)0xC00002B7L) #endif #ifndef STATUS_JOURNAL_NOT_ACTIVE -# define STATUS_JOURNAL_NOT_ACTIVE ((NTSTATUS) 0xC00002B8L) +#define STATUS_JOURNAL_NOT_ACTIVE ((NTSTATUS)0xC00002B8L) #endif #ifndef STATUS_NOINTERFACE -# define STATUS_NOINTERFACE ((NTSTATUS) 0xC00002B9L) +#define STATUS_NOINTERFACE ((NTSTATUS)0xC00002B9L) #endif #ifndef STATUS_DS_ADMIN_LIMIT_EXCEEDED -# define STATUS_DS_ADMIN_LIMIT_EXCEEDED ((NTSTATUS) 0xC00002C1L) +#define STATUS_DS_ADMIN_LIMIT_EXCEEDED ((NTSTATUS)0xC00002C1L) #endif #ifndef STATUS_DRIVER_FAILED_SLEEP -# define STATUS_DRIVER_FAILED_SLEEP ((NTSTATUS) 0xC00002C2L) +#define STATUS_DRIVER_FAILED_SLEEP ((NTSTATUS)0xC00002C2L) #endif #ifndef STATUS_MUTUAL_AUTHENTICATION_FAILED -# define STATUS_MUTUAL_AUTHENTICATION_FAILED ((NTSTATUS) 0xC00002C3L) +#define STATUS_MUTUAL_AUTHENTICATION_FAILED ((NTSTATUS)0xC00002C3L) #endif #ifndef STATUS_CORRUPT_SYSTEM_FILE -# define STATUS_CORRUPT_SYSTEM_FILE ((NTSTATUS) 0xC00002C4L) +#define STATUS_CORRUPT_SYSTEM_FILE ((NTSTATUS)0xC00002C4L) #endif #ifndef STATUS_DATATYPE_MISALIGNMENT_ERROR -# define STATUS_DATATYPE_MISALIGNMENT_ERROR ((NTSTATUS) 0xC00002C5L) +#define STATUS_DATATYPE_MISALIGNMENT_ERROR ((NTSTATUS)0xC00002C5L) #endif #ifndef STATUS_WMI_READ_ONLY -# define STATUS_WMI_READ_ONLY ((NTSTATUS) 0xC00002C6L) +#define STATUS_WMI_READ_ONLY ((NTSTATUS)0xC00002C6L) #endif #ifndef STATUS_WMI_SET_FAILURE -# define STATUS_WMI_SET_FAILURE ((NTSTATUS) 0xC00002C7L) +#define STATUS_WMI_SET_FAILURE ((NTSTATUS)0xC00002C7L) #endif #ifndef STATUS_COMMITMENT_MINIMUM -# define STATUS_COMMITMENT_MINIMUM ((NTSTATUS) 0xC00002C8L) +#define STATUS_COMMITMENT_MINIMUM ((NTSTATUS)0xC00002C8L) #endif #ifndef STATUS_REG_NAT_CONSUMPTION -# define STATUS_REG_NAT_CONSUMPTION ((NTSTATUS) 0xC00002C9L) +#define STATUS_REG_NAT_CONSUMPTION ((NTSTATUS)0xC00002C9L) #endif #ifndef STATUS_TRANSPORT_FULL -# define STATUS_TRANSPORT_FULL ((NTSTATUS) 0xC00002CAL) +#define STATUS_TRANSPORT_FULL ((NTSTATUS)0xC00002CAL) #endif #ifndef STATUS_DS_SAM_INIT_FAILURE -# define STATUS_DS_SAM_INIT_FAILURE ((NTSTATUS) 0xC00002CBL) +#define STATUS_DS_SAM_INIT_FAILURE ((NTSTATUS)0xC00002CBL) #endif #ifndef STATUS_ONLY_IF_CONNECTED -# define STATUS_ONLY_IF_CONNECTED ((NTSTATUS) 0xC00002CCL) +#define STATUS_ONLY_IF_CONNECTED ((NTSTATUS)0xC00002CCL) #endif #ifndef STATUS_DS_SENSITIVE_GROUP_VIOLATION -# define STATUS_DS_SENSITIVE_GROUP_VIOLATION ((NTSTATUS) 0xC00002CDL) +#define STATUS_DS_SENSITIVE_GROUP_VIOLATION ((NTSTATUS)0xC00002CDL) #endif #ifndef STATUS_PNP_RESTART_ENUMERATION -# define STATUS_PNP_RESTART_ENUMERATION ((NTSTATUS) 0xC00002CEL) +#define STATUS_PNP_RESTART_ENUMERATION ((NTSTATUS)0xC00002CEL) #endif #ifndef STATUS_JOURNAL_ENTRY_DELETED -# define STATUS_JOURNAL_ENTRY_DELETED ((NTSTATUS) 0xC00002CFL) +#define STATUS_JOURNAL_ENTRY_DELETED ((NTSTATUS)0xC00002CFL) #endif #ifndef STATUS_DS_CANT_MOD_PRIMARYGROUPID -# define STATUS_DS_CANT_MOD_PRIMARYGROUPID ((NTSTATUS) 0xC00002D0L) +#define STATUS_DS_CANT_MOD_PRIMARYGROUPID ((NTSTATUS)0xC00002D0L) #endif #ifndef STATUS_SYSTEM_IMAGE_BAD_SIGNATURE -# define STATUS_SYSTEM_IMAGE_BAD_SIGNATURE ((NTSTATUS) 0xC00002D1L) +#define STATUS_SYSTEM_IMAGE_BAD_SIGNATURE ((NTSTATUS)0xC00002D1L) #endif #ifndef STATUS_PNP_REBOOT_REQUIRED -# define STATUS_PNP_REBOOT_REQUIRED ((NTSTATUS) 0xC00002D2L) +#define STATUS_PNP_REBOOT_REQUIRED ((NTSTATUS)0xC00002D2L) #endif #ifndef STATUS_POWER_STATE_INVALID -# define STATUS_POWER_STATE_INVALID ((NTSTATUS) 0xC00002D3L) +#define STATUS_POWER_STATE_INVALID ((NTSTATUS)0xC00002D3L) #endif #ifndef STATUS_DS_INVALID_GROUP_TYPE -# define STATUS_DS_INVALID_GROUP_TYPE ((NTSTATUS) 0xC00002D4L) +#define STATUS_DS_INVALID_GROUP_TYPE ((NTSTATUS)0xC00002D4L) #endif #ifndef STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN -# define STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN ((NTSTATUS) 0xC00002D5L) +#define STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN ((NTSTATUS)0xC00002D5L) #endif #ifndef STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN -# define STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN ((NTSTATUS) 0xC00002D6L) +#define STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN ((NTSTATUS)0xC00002D6L) #endif #ifndef STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER -# define STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER ((NTSTATUS) 0xC00002D7L) +#define STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER ((NTSTATUS)0xC00002D7L) #endif #ifndef STATUS_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER -# define STATUS_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER ((NTSTATUS) 0xC00002D8L) +#define STATUS_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER ((NTSTATUS)0xC00002D8L) #endif #ifndef STATUS_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER -# define STATUS_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER ((NTSTATUS) 0xC00002D9L) +#define STATUS_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER ((NTSTATUS)0xC00002D9L) #endif #ifndef STATUS_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER -# define STATUS_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER ((NTSTATUS) 0xC00002DAL) +#define STATUS_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER ((NTSTATUS)0xC00002DAL) #endif #ifndef STATUS_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER -# define STATUS_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER ((NTSTATUS) 0xC00002DBL) +#define STATUS_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER \ + ((NTSTATUS)0xC00002DBL) #endif #ifndef STATUS_DS_HAVE_PRIMARY_MEMBERS -# define STATUS_DS_HAVE_PRIMARY_MEMBERS ((NTSTATUS) 0xC00002DCL) +#define STATUS_DS_HAVE_PRIMARY_MEMBERS ((NTSTATUS)0xC00002DCL) #endif #ifndef STATUS_WMI_NOT_SUPPORTED -# define STATUS_WMI_NOT_SUPPORTED ((NTSTATUS) 0xC00002DDL) +#define STATUS_WMI_NOT_SUPPORTED ((NTSTATUS)0xC00002DDL) #endif #ifndef STATUS_INSUFFICIENT_POWER -# define STATUS_INSUFFICIENT_POWER ((NTSTATUS) 0xC00002DEL) +#define STATUS_INSUFFICIENT_POWER ((NTSTATUS)0xC00002DEL) #endif #ifndef STATUS_SAM_NEED_BOOTKEY_PASSWORD -# define STATUS_SAM_NEED_BOOTKEY_PASSWORD ((NTSTATUS) 0xC00002DFL) +#define STATUS_SAM_NEED_BOOTKEY_PASSWORD ((NTSTATUS)0xC00002DFL) #endif #ifndef STATUS_SAM_NEED_BOOTKEY_FLOPPY -# define STATUS_SAM_NEED_BOOTKEY_FLOPPY ((NTSTATUS) 0xC00002E0L) +#define STATUS_SAM_NEED_BOOTKEY_FLOPPY ((NTSTATUS)0xC00002E0L) #endif #ifndef STATUS_DS_CANT_START -# define STATUS_DS_CANT_START ((NTSTATUS) 0xC00002E1L) +#define STATUS_DS_CANT_START ((NTSTATUS)0xC00002E1L) #endif #ifndef STATUS_DS_INIT_FAILURE -# define STATUS_DS_INIT_FAILURE ((NTSTATUS) 0xC00002E2L) +#define STATUS_DS_INIT_FAILURE ((NTSTATUS)0xC00002E2L) #endif #ifndef STATUS_SAM_INIT_FAILURE -# define STATUS_SAM_INIT_FAILURE ((NTSTATUS) 0xC00002E3L) +#define STATUS_SAM_INIT_FAILURE ((NTSTATUS)0xC00002E3L) #endif #ifndef STATUS_DS_GC_REQUIRED -# define STATUS_DS_GC_REQUIRED ((NTSTATUS) 0xC00002E4L) +#define STATUS_DS_GC_REQUIRED ((NTSTATUS)0xC00002E4L) #endif #ifndef STATUS_DS_LOCAL_MEMBER_OF_LOCAL_ONLY -# define STATUS_DS_LOCAL_MEMBER_OF_LOCAL_ONLY ((NTSTATUS) 0xC00002E5L) +#define STATUS_DS_LOCAL_MEMBER_OF_LOCAL_ONLY ((NTSTATUS)0xC00002E5L) #endif #ifndef STATUS_DS_NO_FPO_IN_UNIVERSAL_GROUPS -# define STATUS_DS_NO_FPO_IN_UNIVERSAL_GROUPS ((NTSTATUS) 0xC00002E6L) +#define STATUS_DS_NO_FPO_IN_UNIVERSAL_GROUPS ((NTSTATUS)0xC00002E6L) #endif #ifndef STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED -# define STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED ((NTSTATUS) 0xC00002E7L) +#define STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED ((NTSTATUS)0xC00002E7L) #endif #ifndef STATUS_MULTIPLE_FAULT_VIOLATION -# define STATUS_MULTIPLE_FAULT_VIOLATION ((NTSTATUS) 0xC00002E8L) +#define STATUS_MULTIPLE_FAULT_VIOLATION ((NTSTATUS)0xC00002E8L) #endif #ifndef STATUS_CURRENT_DOMAIN_NOT_ALLOWED -# define STATUS_CURRENT_DOMAIN_NOT_ALLOWED ((NTSTATUS) 0xC00002E9L) +#define STATUS_CURRENT_DOMAIN_NOT_ALLOWED ((NTSTATUS)0xC00002E9L) #endif #ifndef STATUS_CANNOT_MAKE -# define STATUS_CANNOT_MAKE ((NTSTATUS) 0xC00002EAL) +#define STATUS_CANNOT_MAKE ((NTSTATUS)0xC00002EAL) #endif #ifndef STATUS_SYSTEM_SHUTDOWN -# define STATUS_SYSTEM_SHUTDOWN ((NTSTATUS) 0xC00002EBL) +#define STATUS_SYSTEM_SHUTDOWN ((NTSTATUS)0xC00002EBL) #endif #ifndef STATUS_DS_INIT_FAILURE_CONSOLE -# define STATUS_DS_INIT_FAILURE_CONSOLE ((NTSTATUS) 0xC00002ECL) +#define STATUS_DS_INIT_FAILURE_CONSOLE ((NTSTATUS)0xC00002ECL) #endif #ifndef STATUS_DS_SAM_INIT_FAILURE_CONSOLE -# define STATUS_DS_SAM_INIT_FAILURE_CONSOLE ((NTSTATUS) 0xC00002EDL) +#define STATUS_DS_SAM_INIT_FAILURE_CONSOLE ((NTSTATUS)0xC00002EDL) #endif #ifndef STATUS_UNFINISHED_CONTEXT_DELETED -# define STATUS_UNFINISHED_CONTEXT_DELETED ((NTSTATUS) 0xC00002EEL) +#define STATUS_UNFINISHED_CONTEXT_DELETED ((NTSTATUS)0xC00002EEL) #endif #ifndef STATUS_NO_TGT_REPLY -# define STATUS_NO_TGT_REPLY ((NTSTATUS) 0xC00002EFL) +#define STATUS_NO_TGT_REPLY ((NTSTATUS)0xC00002EFL) #endif #ifndef STATUS_OBJECTID_NOT_FOUND -# define STATUS_OBJECTID_NOT_FOUND ((NTSTATUS) 0xC00002F0L) +#define STATUS_OBJECTID_NOT_FOUND ((NTSTATUS)0xC00002F0L) #endif #ifndef STATUS_NO_IP_ADDRESSES -# define STATUS_NO_IP_ADDRESSES ((NTSTATUS) 0xC00002F1L) +#define STATUS_NO_IP_ADDRESSES ((NTSTATUS)0xC00002F1L) #endif #ifndef STATUS_WRONG_CREDENTIAL_HANDLE -# define STATUS_WRONG_CREDENTIAL_HANDLE ((NTSTATUS) 0xC00002F2L) +#define STATUS_WRONG_CREDENTIAL_HANDLE ((NTSTATUS)0xC00002F2L) #endif #ifndef STATUS_CRYPTO_SYSTEM_INVALID -# define STATUS_CRYPTO_SYSTEM_INVALID ((NTSTATUS) 0xC00002F3L) +#define STATUS_CRYPTO_SYSTEM_INVALID ((NTSTATUS)0xC00002F3L) #endif #ifndef STATUS_MAX_REFERRALS_EXCEEDED -# define STATUS_MAX_REFERRALS_EXCEEDED ((NTSTATUS) 0xC00002F4L) +#define STATUS_MAX_REFERRALS_EXCEEDED ((NTSTATUS)0xC00002F4L) #endif #ifndef STATUS_MUST_BE_KDC -# define STATUS_MUST_BE_KDC ((NTSTATUS) 0xC00002F5L) +#define STATUS_MUST_BE_KDC ((NTSTATUS)0xC00002F5L) #endif #ifndef STATUS_STRONG_CRYPTO_NOT_SUPPORTED -# define STATUS_STRONG_CRYPTO_NOT_SUPPORTED ((NTSTATUS) 0xC00002F6L) +#define STATUS_STRONG_CRYPTO_NOT_SUPPORTED ((NTSTATUS)0xC00002F6L) #endif #ifndef STATUS_TOO_MANY_PRINCIPALS -# define STATUS_TOO_MANY_PRINCIPALS ((NTSTATUS) 0xC00002F7L) +#define STATUS_TOO_MANY_PRINCIPALS ((NTSTATUS)0xC00002F7L) #endif #ifndef STATUS_NO_PA_DATA -# define STATUS_NO_PA_DATA ((NTSTATUS) 0xC00002F8L) +#define STATUS_NO_PA_DATA ((NTSTATUS)0xC00002F8L) #endif #ifndef STATUS_PKINIT_NAME_MISMATCH -# define STATUS_PKINIT_NAME_MISMATCH ((NTSTATUS) 0xC00002F9L) +#define STATUS_PKINIT_NAME_MISMATCH ((NTSTATUS)0xC00002F9L) #endif #ifndef STATUS_SMARTCARD_LOGON_REQUIRED -# define STATUS_SMARTCARD_LOGON_REQUIRED ((NTSTATUS) 0xC00002FAL) +#define STATUS_SMARTCARD_LOGON_REQUIRED ((NTSTATUS)0xC00002FAL) #endif #ifndef STATUS_KDC_INVALID_REQUEST -# define STATUS_KDC_INVALID_REQUEST ((NTSTATUS) 0xC00002FBL) +#define STATUS_KDC_INVALID_REQUEST ((NTSTATUS)0xC00002FBL) #endif #ifndef STATUS_KDC_UNABLE_TO_REFER -# define STATUS_KDC_UNABLE_TO_REFER ((NTSTATUS) 0xC00002FCL) +#define STATUS_KDC_UNABLE_TO_REFER ((NTSTATUS)0xC00002FCL) #endif #ifndef STATUS_KDC_UNKNOWN_ETYPE -# define STATUS_KDC_UNKNOWN_ETYPE ((NTSTATUS) 0xC00002FDL) +#define STATUS_KDC_UNKNOWN_ETYPE ((NTSTATUS)0xC00002FDL) #endif #ifndef STATUS_SHUTDOWN_IN_PROGRESS -# define STATUS_SHUTDOWN_IN_PROGRESS ((NTSTATUS) 0xC00002FEL) +#define STATUS_SHUTDOWN_IN_PROGRESS ((NTSTATUS)0xC00002FEL) #endif #ifndef STATUS_SERVER_SHUTDOWN_IN_PROGRESS -# define STATUS_SERVER_SHUTDOWN_IN_PROGRESS ((NTSTATUS) 0xC00002FFL) +#define STATUS_SERVER_SHUTDOWN_IN_PROGRESS ((NTSTATUS)0xC00002FFL) #endif #ifndef STATUS_NOT_SUPPORTED_ON_SBS -# define STATUS_NOT_SUPPORTED_ON_SBS ((NTSTATUS) 0xC0000300L) +#define STATUS_NOT_SUPPORTED_ON_SBS ((NTSTATUS)0xC0000300L) #endif #ifndef STATUS_WMI_GUID_DISCONNECTED -# define STATUS_WMI_GUID_DISCONNECTED ((NTSTATUS) 0xC0000301L) +#define STATUS_WMI_GUID_DISCONNECTED ((NTSTATUS)0xC0000301L) #endif #ifndef STATUS_WMI_ALREADY_DISABLED -# define STATUS_WMI_ALREADY_DISABLED ((NTSTATUS) 0xC0000302L) +#define STATUS_WMI_ALREADY_DISABLED ((NTSTATUS)0xC0000302L) #endif #ifndef STATUS_WMI_ALREADY_ENABLED -# define STATUS_WMI_ALREADY_ENABLED ((NTSTATUS) 0xC0000303L) +#define STATUS_WMI_ALREADY_ENABLED ((NTSTATUS)0xC0000303L) #endif #ifndef STATUS_MFT_TOO_FRAGMENTED -# define STATUS_MFT_TOO_FRAGMENTED ((NTSTATUS) 0xC0000304L) +#define STATUS_MFT_TOO_FRAGMENTED ((NTSTATUS)0xC0000304L) #endif #ifndef STATUS_COPY_PROTECTION_FAILURE -# define STATUS_COPY_PROTECTION_FAILURE ((NTSTATUS) 0xC0000305L) +#define STATUS_COPY_PROTECTION_FAILURE ((NTSTATUS)0xC0000305L) #endif #ifndef STATUS_CSS_AUTHENTICATION_FAILURE -# define STATUS_CSS_AUTHENTICATION_FAILURE ((NTSTATUS) 0xC0000306L) +#define STATUS_CSS_AUTHENTICATION_FAILURE ((NTSTATUS)0xC0000306L) #endif #ifndef STATUS_CSS_KEY_NOT_PRESENT -# define STATUS_CSS_KEY_NOT_PRESENT ((NTSTATUS) 0xC0000307L) +#define STATUS_CSS_KEY_NOT_PRESENT ((NTSTATUS)0xC0000307L) #endif #ifndef STATUS_CSS_KEY_NOT_ESTABLISHED -# define STATUS_CSS_KEY_NOT_ESTABLISHED ((NTSTATUS) 0xC0000308L) +#define STATUS_CSS_KEY_NOT_ESTABLISHED ((NTSTATUS)0xC0000308L) #endif #ifndef STATUS_CSS_SCRAMBLED_SECTOR -# define STATUS_CSS_SCRAMBLED_SECTOR ((NTSTATUS) 0xC0000309L) +#define STATUS_CSS_SCRAMBLED_SECTOR ((NTSTATUS)0xC0000309L) #endif #ifndef STATUS_CSS_REGION_MISMATCH -# define STATUS_CSS_REGION_MISMATCH ((NTSTATUS) 0xC000030AL) +#define STATUS_CSS_REGION_MISMATCH ((NTSTATUS)0xC000030AL) #endif #ifndef STATUS_CSS_RESETS_EXHAUSTED -# define STATUS_CSS_RESETS_EXHAUSTED ((NTSTATUS) 0xC000030BL) +#define STATUS_CSS_RESETS_EXHAUSTED ((NTSTATUS)0xC000030BL) #endif #ifndef STATUS_PKINIT_FAILURE -# define STATUS_PKINIT_FAILURE ((NTSTATUS) 0xC0000320L) +#define STATUS_PKINIT_FAILURE ((NTSTATUS)0xC0000320L) #endif #ifndef STATUS_SMARTCARD_SUBSYSTEM_FAILURE -# define STATUS_SMARTCARD_SUBSYSTEM_FAILURE ((NTSTATUS) 0xC0000321L) +#define STATUS_SMARTCARD_SUBSYSTEM_FAILURE ((NTSTATUS)0xC0000321L) #endif #ifndef STATUS_NO_KERB_KEY -# define STATUS_NO_KERB_KEY ((NTSTATUS) 0xC0000322L) +#define STATUS_NO_KERB_KEY ((NTSTATUS)0xC0000322L) #endif #ifndef STATUS_HOST_DOWN -# define STATUS_HOST_DOWN ((NTSTATUS) 0xC0000350L) +#define STATUS_HOST_DOWN ((NTSTATUS)0xC0000350L) #endif #ifndef STATUS_UNSUPPORTED_PREAUTH -# define STATUS_UNSUPPORTED_PREAUTH ((NTSTATUS) 0xC0000351L) +#define STATUS_UNSUPPORTED_PREAUTH ((NTSTATUS)0xC0000351L) #endif #ifndef STATUS_EFS_ALG_BLOB_TOO_BIG -# define STATUS_EFS_ALG_BLOB_TOO_BIG ((NTSTATUS) 0xC0000352L) +#define STATUS_EFS_ALG_BLOB_TOO_BIG ((NTSTATUS)0xC0000352L) #endif #ifndef STATUS_PORT_NOT_SET -# define STATUS_PORT_NOT_SET ((NTSTATUS) 0xC0000353L) +#define STATUS_PORT_NOT_SET ((NTSTATUS)0xC0000353L) #endif #ifndef STATUS_DEBUGGER_INACTIVE -# define STATUS_DEBUGGER_INACTIVE ((NTSTATUS) 0xC0000354L) +#define STATUS_DEBUGGER_INACTIVE ((NTSTATUS)0xC0000354L) #endif #ifndef STATUS_DS_VERSION_CHECK_FAILURE -# define STATUS_DS_VERSION_CHECK_FAILURE ((NTSTATUS) 0xC0000355L) +#define STATUS_DS_VERSION_CHECK_FAILURE ((NTSTATUS)0xC0000355L) #endif #ifndef STATUS_AUDITING_DISABLED -# define STATUS_AUDITING_DISABLED ((NTSTATUS) 0xC0000356L) +#define STATUS_AUDITING_DISABLED ((NTSTATUS)0xC0000356L) #endif #ifndef STATUS_PRENT4_MACHINE_ACCOUNT -# define STATUS_PRENT4_MACHINE_ACCOUNT ((NTSTATUS) 0xC0000357L) +#define STATUS_PRENT4_MACHINE_ACCOUNT ((NTSTATUS)0xC0000357L) #endif #ifndef STATUS_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER -# define STATUS_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER ((NTSTATUS) 0xC0000358L) +#define STATUS_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER ((NTSTATUS)0xC0000358L) #endif #ifndef STATUS_INVALID_IMAGE_WIN_32 -# define STATUS_INVALID_IMAGE_WIN_32 ((NTSTATUS) 0xC0000359L) +#define STATUS_INVALID_IMAGE_WIN_32 ((NTSTATUS)0xC0000359L) #endif #ifndef STATUS_INVALID_IMAGE_WIN_64 -# define STATUS_INVALID_IMAGE_WIN_64 ((NTSTATUS) 0xC000035AL) +#define STATUS_INVALID_IMAGE_WIN_64 ((NTSTATUS)0xC000035AL) #endif #ifndef STATUS_BAD_BINDINGS -# define STATUS_BAD_BINDINGS ((NTSTATUS) 0xC000035BL) +#define STATUS_BAD_BINDINGS ((NTSTATUS)0xC000035BL) #endif #ifndef STATUS_NETWORK_SESSION_EXPIRED -# define STATUS_NETWORK_SESSION_EXPIRED ((NTSTATUS) 0xC000035CL) +#define STATUS_NETWORK_SESSION_EXPIRED ((NTSTATUS)0xC000035CL) #endif #ifndef STATUS_APPHELP_BLOCK -# define STATUS_APPHELP_BLOCK ((NTSTATUS) 0xC000035DL) +#define STATUS_APPHELP_BLOCK ((NTSTATUS)0xC000035DL) #endif #ifndef STATUS_ALL_SIDS_FILTERED -# define STATUS_ALL_SIDS_FILTERED ((NTSTATUS) 0xC000035EL) +#define STATUS_ALL_SIDS_FILTERED ((NTSTATUS)0xC000035EL) #endif #ifndef STATUS_NOT_SAFE_MODE_DRIVER -# define STATUS_NOT_SAFE_MODE_DRIVER ((NTSTATUS) 0xC000035FL) +#define STATUS_NOT_SAFE_MODE_DRIVER ((NTSTATUS)0xC000035FL) #endif #ifndef STATUS_ACCESS_DISABLED_BY_POLICY_DEFAULT -# define STATUS_ACCESS_DISABLED_BY_POLICY_DEFAULT ((NTSTATUS) 0xC0000361L) +#define STATUS_ACCESS_DISABLED_BY_POLICY_DEFAULT ((NTSTATUS)0xC0000361L) #endif #ifndef STATUS_ACCESS_DISABLED_BY_POLICY_PATH -# define STATUS_ACCESS_DISABLED_BY_POLICY_PATH ((NTSTATUS) 0xC0000362L) +#define STATUS_ACCESS_DISABLED_BY_POLICY_PATH ((NTSTATUS)0xC0000362L) #endif #ifndef STATUS_ACCESS_DISABLED_BY_POLICY_PUBLISHER -# define STATUS_ACCESS_DISABLED_BY_POLICY_PUBLISHER ((NTSTATUS) 0xC0000363L) +#define STATUS_ACCESS_DISABLED_BY_POLICY_PUBLISHER ((NTSTATUS)0xC0000363L) #endif #ifndef STATUS_ACCESS_DISABLED_BY_POLICY_OTHER -# define STATUS_ACCESS_DISABLED_BY_POLICY_OTHER ((NTSTATUS) 0xC0000364L) +#define STATUS_ACCESS_DISABLED_BY_POLICY_OTHER ((NTSTATUS)0xC0000364L) #endif #ifndef STATUS_FAILED_DRIVER_ENTRY -# define STATUS_FAILED_DRIVER_ENTRY ((NTSTATUS) 0xC0000365L) +#define STATUS_FAILED_DRIVER_ENTRY ((NTSTATUS)0xC0000365L) #endif #ifndef STATUS_DEVICE_ENUMERATION_ERROR -# define STATUS_DEVICE_ENUMERATION_ERROR ((NTSTATUS) 0xC0000366L) +#define STATUS_DEVICE_ENUMERATION_ERROR ((NTSTATUS)0xC0000366L) #endif #ifndef STATUS_MOUNT_POINT_NOT_RESOLVED -# define STATUS_MOUNT_POINT_NOT_RESOLVED ((NTSTATUS) 0xC0000368L) +#define STATUS_MOUNT_POINT_NOT_RESOLVED ((NTSTATUS)0xC0000368L) #endif #ifndef STATUS_INVALID_DEVICE_OBJECT_PARAMETER -# define STATUS_INVALID_DEVICE_OBJECT_PARAMETER ((NTSTATUS) 0xC0000369L) +#define STATUS_INVALID_DEVICE_OBJECT_PARAMETER ((NTSTATUS)0xC0000369L) #endif #ifndef STATUS_MCA_OCCURED -# define STATUS_MCA_OCCURED ((NTSTATUS) 0xC000036AL) +#define STATUS_MCA_OCCURED ((NTSTATUS)0xC000036AL) #endif #ifndef STATUS_DRIVER_BLOCKED_CRITICAL -# define STATUS_DRIVER_BLOCKED_CRITICAL ((NTSTATUS) 0xC000036BL) +#define STATUS_DRIVER_BLOCKED_CRITICAL ((NTSTATUS)0xC000036BL) #endif #ifndef STATUS_DRIVER_BLOCKED -# define STATUS_DRIVER_BLOCKED ((NTSTATUS) 0xC000036CL) +#define STATUS_DRIVER_BLOCKED ((NTSTATUS)0xC000036CL) #endif #ifndef STATUS_DRIVER_DATABASE_ERROR -# define STATUS_DRIVER_DATABASE_ERROR ((NTSTATUS) 0xC000036DL) +#define STATUS_DRIVER_DATABASE_ERROR ((NTSTATUS)0xC000036DL) #endif #ifndef STATUS_SYSTEM_HIVE_TOO_LARGE -# define STATUS_SYSTEM_HIVE_TOO_LARGE ((NTSTATUS) 0xC000036EL) +#define STATUS_SYSTEM_HIVE_TOO_LARGE ((NTSTATUS)0xC000036EL) #endif #ifndef STATUS_INVALID_IMPORT_OF_NON_DLL -# define STATUS_INVALID_IMPORT_OF_NON_DLL ((NTSTATUS) 0xC000036FL) +#define STATUS_INVALID_IMPORT_OF_NON_DLL ((NTSTATUS)0xC000036FL) #endif #ifndef STATUS_DS_SHUTTING_DOWN -# define STATUS_DS_SHUTTING_DOWN ((NTSTATUS) 0x40000370L) +#define STATUS_DS_SHUTTING_DOWN ((NTSTATUS)0x40000370L) #endif #ifndef STATUS_NO_SECRETS -# define STATUS_NO_SECRETS ((NTSTATUS) 0xC0000371L) +#define STATUS_NO_SECRETS ((NTSTATUS)0xC0000371L) #endif #ifndef STATUS_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY -# define STATUS_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY ((NTSTATUS) 0xC0000372L) +#define STATUS_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY ((NTSTATUS)0xC0000372L) #endif #ifndef STATUS_FAILED_STACK_SWITCH -# define STATUS_FAILED_STACK_SWITCH ((NTSTATUS) 0xC0000373L) +#define STATUS_FAILED_STACK_SWITCH ((NTSTATUS)0xC0000373L) #endif #ifndef STATUS_HEAP_CORRUPTION -# define STATUS_HEAP_CORRUPTION ((NTSTATUS) 0xC0000374L) +#define STATUS_HEAP_CORRUPTION ((NTSTATUS)0xC0000374L) #endif #ifndef STATUS_SMARTCARD_WRONG_PIN -# define STATUS_SMARTCARD_WRONG_PIN ((NTSTATUS) 0xC0000380L) +#define STATUS_SMARTCARD_WRONG_PIN ((NTSTATUS)0xC0000380L) #endif #ifndef STATUS_SMARTCARD_CARD_BLOCKED -# define STATUS_SMARTCARD_CARD_BLOCKED ((NTSTATUS) 0xC0000381L) +#define STATUS_SMARTCARD_CARD_BLOCKED ((NTSTATUS)0xC0000381L) #endif #ifndef STATUS_SMARTCARD_CARD_NOT_AUTHENTICATED -# define STATUS_SMARTCARD_CARD_NOT_AUTHENTICATED ((NTSTATUS) 0xC0000382L) +#define STATUS_SMARTCARD_CARD_NOT_AUTHENTICATED ((NTSTATUS)0xC0000382L) #endif #ifndef STATUS_SMARTCARD_NO_CARD -# define STATUS_SMARTCARD_NO_CARD ((NTSTATUS) 0xC0000383L) +#define STATUS_SMARTCARD_NO_CARD ((NTSTATUS)0xC0000383L) #endif #ifndef STATUS_SMARTCARD_NO_KEY_CONTAINER -# define STATUS_SMARTCARD_NO_KEY_CONTAINER ((NTSTATUS) 0xC0000384L) +#define STATUS_SMARTCARD_NO_KEY_CONTAINER ((NTSTATUS)0xC0000384L) #endif #ifndef STATUS_SMARTCARD_NO_CERTIFICATE -# define STATUS_SMARTCARD_NO_CERTIFICATE ((NTSTATUS) 0xC0000385L) +#define STATUS_SMARTCARD_NO_CERTIFICATE ((NTSTATUS)0xC0000385L) #endif #ifndef STATUS_SMARTCARD_NO_KEYSET -# define STATUS_SMARTCARD_NO_KEYSET ((NTSTATUS) 0xC0000386L) +#define STATUS_SMARTCARD_NO_KEYSET ((NTSTATUS)0xC0000386L) #endif #ifndef STATUS_SMARTCARD_IO_ERROR -# define STATUS_SMARTCARD_IO_ERROR ((NTSTATUS) 0xC0000387L) +#define STATUS_SMARTCARD_IO_ERROR ((NTSTATUS)0xC0000387L) #endif #ifndef STATUS_DOWNGRADE_DETECTED -# define STATUS_DOWNGRADE_DETECTED ((NTSTATUS) 0xC0000388L) +#define STATUS_DOWNGRADE_DETECTED ((NTSTATUS)0xC0000388L) #endif #ifndef STATUS_SMARTCARD_CERT_REVOKED -# define STATUS_SMARTCARD_CERT_REVOKED ((NTSTATUS) 0xC0000389L) +#define STATUS_SMARTCARD_CERT_REVOKED ((NTSTATUS)0xC0000389L) #endif #ifndef STATUS_ISSUING_CA_UNTRUSTED -# define STATUS_ISSUING_CA_UNTRUSTED ((NTSTATUS) 0xC000038AL) +#define STATUS_ISSUING_CA_UNTRUSTED ((NTSTATUS)0xC000038AL) #endif #ifndef STATUS_REVOCATION_OFFLINE_C -# define STATUS_REVOCATION_OFFLINE_C ((NTSTATUS) 0xC000038BL) +#define STATUS_REVOCATION_OFFLINE_C ((NTSTATUS)0xC000038BL) #endif #ifndef STATUS_PKINIT_CLIENT_FAILURE -# define STATUS_PKINIT_CLIENT_FAILURE ((NTSTATUS) 0xC000038CL) +#define STATUS_PKINIT_CLIENT_FAILURE ((NTSTATUS)0xC000038CL) #endif #ifndef STATUS_SMARTCARD_CERT_EXPIRED -# define STATUS_SMARTCARD_CERT_EXPIRED ((NTSTATUS) 0xC000038DL) +#define STATUS_SMARTCARD_CERT_EXPIRED ((NTSTATUS)0xC000038DL) #endif #ifndef STATUS_DRIVER_FAILED_PRIOR_UNLOAD -# define STATUS_DRIVER_FAILED_PRIOR_UNLOAD ((NTSTATUS) 0xC000038EL) +#define STATUS_DRIVER_FAILED_PRIOR_UNLOAD ((NTSTATUS)0xC000038EL) #endif #ifndef STATUS_SMARTCARD_SILENT_CONTEXT -# define STATUS_SMARTCARD_SILENT_CONTEXT ((NTSTATUS) 0xC000038FL) +#define STATUS_SMARTCARD_SILENT_CONTEXT ((NTSTATUS)0xC000038FL) #endif #ifndef STATUS_PER_USER_TRUST_QUOTA_EXCEEDED -# define STATUS_PER_USER_TRUST_QUOTA_EXCEEDED ((NTSTATUS) 0xC0000401L) +#define STATUS_PER_USER_TRUST_QUOTA_EXCEEDED ((NTSTATUS)0xC0000401L) #endif #ifndef STATUS_ALL_USER_TRUST_QUOTA_EXCEEDED -# define STATUS_ALL_USER_TRUST_QUOTA_EXCEEDED ((NTSTATUS) 0xC0000402L) +#define STATUS_ALL_USER_TRUST_QUOTA_EXCEEDED ((NTSTATUS)0xC0000402L) #endif #ifndef STATUS_USER_DELETE_TRUST_QUOTA_EXCEEDED -# define STATUS_USER_DELETE_TRUST_QUOTA_EXCEEDED ((NTSTATUS) 0xC0000403L) +#define STATUS_USER_DELETE_TRUST_QUOTA_EXCEEDED ((NTSTATUS)0xC0000403L) #endif #ifndef STATUS_DS_NAME_NOT_UNIQUE -# define STATUS_DS_NAME_NOT_UNIQUE ((NTSTATUS) 0xC0000404L) +#define STATUS_DS_NAME_NOT_UNIQUE ((NTSTATUS)0xC0000404L) #endif #ifndef STATUS_DS_DUPLICATE_ID_FOUND -# define STATUS_DS_DUPLICATE_ID_FOUND ((NTSTATUS) 0xC0000405L) +#define STATUS_DS_DUPLICATE_ID_FOUND ((NTSTATUS)0xC0000405L) #endif #ifndef STATUS_DS_GROUP_CONVERSION_ERROR -# define STATUS_DS_GROUP_CONVERSION_ERROR ((NTSTATUS) 0xC0000406L) +#define STATUS_DS_GROUP_CONVERSION_ERROR ((NTSTATUS)0xC0000406L) #endif #ifndef STATUS_VOLSNAP_PREPARE_HIBERNATE -# define STATUS_VOLSNAP_PREPARE_HIBERNATE ((NTSTATUS) 0xC0000407L) +#define STATUS_VOLSNAP_PREPARE_HIBERNATE ((NTSTATUS)0xC0000407L) #endif #ifndef STATUS_USER2USER_REQUIRED -# define STATUS_USER2USER_REQUIRED ((NTSTATUS) 0xC0000408L) +#define STATUS_USER2USER_REQUIRED ((NTSTATUS)0xC0000408L) #endif #ifndef STATUS_STACK_BUFFER_OVERRUN -# define STATUS_STACK_BUFFER_OVERRUN ((NTSTATUS) 0xC0000409L) +#define STATUS_STACK_BUFFER_OVERRUN ((NTSTATUS)0xC0000409L) #endif #ifndef STATUS_NO_S4U_PROT_SUPPORT -# define STATUS_NO_S4U_PROT_SUPPORT ((NTSTATUS) 0xC000040AL) +#define STATUS_NO_S4U_PROT_SUPPORT ((NTSTATUS)0xC000040AL) #endif #ifndef STATUS_CROSSREALM_DELEGATION_FAILURE -# define STATUS_CROSSREALM_DELEGATION_FAILURE ((NTSTATUS) 0xC000040BL) +#define STATUS_CROSSREALM_DELEGATION_FAILURE ((NTSTATUS)0xC000040BL) #endif #ifndef STATUS_REVOCATION_OFFLINE_KDC -# define STATUS_REVOCATION_OFFLINE_KDC ((NTSTATUS) 0xC000040CL) +#define STATUS_REVOCATION_OFFLINE_KDC ((NTSTATUS)0xC000040CL) #endif #ifndef STATUS_ISSUING_CA_UNTRUSTED_KDC -# define STATUS_ISSUING_CA_UNTRUSTED_KDC ((NTSTATUS) 0xC000040DL) +#define STATUS_ISSUING_CA_UNTRUSTED_KDC ((NTSTATUS)0xC000040DL) #endif #ifndef STATUS_KDC_CERT_EXPIRED -# define STATUS_KDC_CERT_EXPIRED ((NTSTATUS) 0xC000040EL) +#define STATUS_KDC_CERT_EXPIRED ((NTSTATUS)0xC000040EL) #endif #ifndef STATUS_KDC_CERT_REVOKED -# define STATUS_KDC_CERT_REVOKED ((NTSTATUS) 0xC000040FL) +#define STATUS_KDC_CERT_REVOKED ((NTSTATUS)0xC000040FL) #endif #ifndef STATUS_PARAMETER_QUOTA_EXCEEDED -# define STATUS_PARAMETER_QUOTA_EXCEEDED ((NTSTATUS) 0xC0000410L) +#define STATUS_PARAMETER_QUOTA_EXCEEDED ((NTSTATUS)0xC0000410L) #endif #ifndef STATUS_HIBERNATION_FAILURE -# define STATUS_HIBERNATION_FAILURE ((NTSTATUS) 0xC0000411L) +#define STATUS_HIBERNATION_FAILURE ((NTSTATUS)0xC0000411L) #endif #ifndef STATUS_DELAY_LOAD_FAILED -# define STATUS_DELAY_LOAD_FAILED ((NTSTATUS) 0xC0000412L) +#define STATUS_DELAY_LOAD_FAILED ((NTSTATUS)0xC0000412L) #endif #ifndef STATUS_AUTHENTICATION_FIREWALL_FAILED -# define STATUS_AUTHENTICATION_FIREWALL_FAILED ((NTSTATUS) 0xC0000413L) +#define STATUS_AUTHENTICATION_FIREWALL_FAILED ((NTSTATUS)0xC0000413L) #endif #ifndef STATUS_VDM_DISALLOWED -# define STATUS_VDM_DISALLOWED ((NTSTATUS) 0xC0000414L) +#define STATUS_VDM_DISALLOWED ((NTSTATUS)0xC0000414L) #endif #ifndef STATUS_HUNG_DISPLAY_DRIVER_THREAD -# define STATUS_HUNG_DISPLAY_DRIVER_THREAD ((NTSTATUS) 0xC0000415L) +#define STATUS_HUNG_DISPLAY_DRIVER_THREAD ((NTSTATUS)0xC0000415L) #endif #ifndef STATUS_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE -# define STATUS_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE ((NTSTATUS) 0xC0000416L) +#define STATUS_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE \ + ((NTSTATUS)0xC0000416L) #endif #ifndef STATUS_INVALID_CRUNTIME_PARAMETER -# define STATUS_INVALID_CRUNTIME_PARAMETER ((NTSTATUS) 0xC0000417L) +#define STATUS_INVALID_CRUNTIME_PARAMETER ((NTSTATUS)0xC0000417L) #endif #ifndef STATUS_NTLM_BLOCKED -# define STATUS_NTLM_BLOCKED ((NTSTATUS) 0xC0000418L) +#define STATUS_NTLM_BLOCKED ((NTSTATUS)0xC0000418L) #endif #ifndef STATUS_DS_SRC_SID_EXISTS_IN_FOREST -# define STATUS_DS_SRC_SID_EXISTS_IN_FOREST ((NTSTATUS) 0xC0000419L) +#define STATUS_DS_SRC_SID_EXISTS_IN_FOREST ((NTSTATUS)0xC0000419L) #endif #ifndef STATUS_DS_DOMAIN_NAME_EXISTS_IN_FOREST -# define STATUS_DS_DOMAIN_NAME_EXISTS_IN_FOREST ((NTSTATUS) 0xC000041AL) +#define STATUS_DS_DOMAIN_NAME_EXISTS_IN_FOREST ((NTSTATUS)0xC000041AL) #endif #ifndef STATUS_DS_FLAT_NAME_EXISTS_IN_FOREST -# define STATUS_DS_FLAT_NAME_EXISTS_IN_FOREST ((NTSTATUS) 0xC000041BL) +#define STATUS_DS_FLAT_NAME_EXISTS_IN_FOREST ((NTSTATUS)0xC000041BL) #endif #ifndef STATUS_INVALID_USER_PRINCIPAL_NAME -# define STATUS_INVALID_USER_PRINCIPAL_NAME ((NTSTATUS) 0xC000041CL) +#define STATUS_INVALID_USER_PRINCIPAL_NAME ((NTSTATUS)0xC000041CL) #endif #ifndef STATUS_FATAL_USER_CALLBACK_EXCEPTION -# define STATUS_FATAL_USER_CALLBACK_EXCEPTION ((NTSTATUS) 0xC000041DL) +#define STATUS_FATAL_USER_CALLBACK_EXCEPTION ((NTSTATUS)0xC000041DL) #endif #ifndef STATUS_ASSERTION_FAILURE -# define STATUS_ASSERTION_FAILURE ((NTSTATUS) 0xC0000420L) +#define STATUS_ASSERTION_FAILURE ((NTSTATUS)0xC0000420L) #endif #ifndef STATUS_VERIFIER_STOP -# define STATUS_VERIFIER_STOP ((NTSTATUS) 0xC0000421L) +#define STATUS_VERIFIER_STOP ((NTSTATUS)0xC0000421L) #endif #ifndef STATUS_CALLBACK_POP_STACK -# define STATUS_CALLBACK_POP_STACK ((NTSTATUS) 0xC0000423L) +#define STATUS_CALLBACK_POP_STACK ((NTSTATUS)0xC0000423L) #endif #ifndef STATUS_INCOMPATIBLE_DRIVER_BLOCKED -# define STATUS_INCOMPATIBLE_DRIVER_BLOCKED ((NTSTATUS) 0xC0000424L) +#define STATUS_INCOMPATIBLE_DRIVER_BLOCKED ((NTSTATUS)0xC0000424L) #endif #ifndef STATUS_HIVE_UNLOADED -# define STATUS_HIVE_UNLOADED ((NTSTATUS) 0xC0000425L) +#define STATUS_HIVE_UNLOADED ((NTSTATUS)0xC0000425L) #endif #ifndef STATUS_COMPRESSION_DISABLED -# define STATUS_COMPRESSION_DISABLED ((NTSTATUS) 0xC0000426L) +#define STATUS_COMPRESSION_DISABLED ((NTSTATUS)0xC0000426L) #endif #ifndef STATUS_FILE_SYSTEM_LIMITATION -# define STATUS_FILE_SYSTEM_LIMITATION ((NTSTATUS) 0xC0000427L) +#define STATUS_FILE_SYSTEM_LIMITATION ((NTSTATUS)0xC0000427L) #endif #ifndef STATUS_INVALID_IMAGE_HASH -# define STATUS_INVALID_IMAGE_HASH ((NTSTATUS) 0xC0000428L) +#define STATUS_INVALID_IMAGE_HASH ((NTSTATUS)0xC0000428L) #endif #ifndef STATUS_NOT_CAPABLE -# define STATUS_NOT_CAPABLE ((NTSTATUS) 0xC0000429L) +#define STATUS_NOT_CAPABLE ((NTSTATUS)0xC0000429L) #endif #ifndef STATUS_REQUEST_OUT_OF_SEQUENCE -# define STATUS_REQUEST_OUT_OF_SEQUENCE ((NTSTATUS) 0xC000042AL) +#define STATUS_REQUEST_OUT_OF_SEQUENCE ((NTSTATUS)0xC000042AL) #endif #ifndef STATUS_IMPLEMENTATION_LIMIT -# define STATUS_IMPLEMENTATION_LIMIT ((NTSTATUS) 0xC000042BL) +#define STATUS_IMPLEMENTATION_LIMIT ((NTSTATUS)0xC000042BL) #endif #ifndef STATUS_ELEVATION_REQUIRED -# define STATUS_ELEVATION_REQUIRED ((NTSTATUS) 0xC000042CL) +#define STATUS_ELEVATION_REQUIRED ((NTSTATUS)0xC000042CL) #endif #ifndef STATUS_NO_SECURITY_CONTEXT -# define STATUS_NO_SECURITY_CONTEXT ((NTSTATUS) 0xC000042DL) +#define STATUS_NO_SECURITY_CONTEXT ((NTSTATUS)0xC000042DL) #endif #ifndef STATUS_PKU2U_CERT_FAILURE -# define STATUS_PKU2U_CERT_FAILURE ((NTSTATUS) 0xC000042FL) +#define STATUS_PKU2U_CERT_FAILURE ((NTSTATUS)0xC000042FL) #endif #ifndef STATUS_BEYOND_VDL -# define STATUS_BEYOND_VDL ((NTSTATUS) 0xC0000432L) +#define STATUS_BEYOND_VDL ((NTSTATUS)0xC0000432L) #endif #ifndef STATUS_ENCOUNTERED_WRITE_IN_PROGRESS -# define STATUS_ENCOUNTERED_WRITE_IN_PROGRESS ((NTSTATUS) 0xC0000433L) +#define STATUS_ENCOUNTERED_WRITE_IN_PROGRESS ((NTSTATUS)0xC0000433L) #endif #ifndef STATUS_PTE_CHANGED -# define STATUS_PTE_CHANGED ((NTSTATUS) 0xC0000434L) +#define STATUS_PTE_CHANGED ((NTSTATUS)0xC0000434L) #endif #ifndef STATUS_PURGE_FAILED -# define STATUS_PURGE_FAILED ((NTSTATUS) 0xC0000435L) +#define STATUS_PURGE_FAILED ((NTSTATUS)0xC0000435L) #endif #ifndef STATUS_CRED_REQUIRES_CONFIRMATION -# define STATUS_CRED_REQUIRES_CONFIRMATION ((NTSTATUS) 0xC0000440L) +#define STATUS_CRED_REQUIRES_CONFIRMATION ((NTSTATUS)0xC0000440L) #endif #ifndef STATUS_CS_ENCRYPTION_INVALID_SERVER_RESPONSE -# define STATUS_CS_ENCRYPTION_INVALID_SERVER_RESPONSE ((NTSTATUS) 0xC0000441L) +#define STATUS_CS_ENCRYPTION_INVALID_SERVER_RESPONSE ((NTSTATUS)0xC0000441L) #endif #ifndef STATUS_CS_ENCRYPTION_UNSUPPORTED_SERVER -# define STATUS_CS_ENCRYPTION_UNSUPPORTED_SERVER ((NTSTATUS) 0xC0000442L) +#define STATUS_CS_ENCRYPTION_UNSUPPORTED_SERVER ((NTSTATUS)0xC0000442L) #endif #ifndef STATUS_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE -# define STATUS_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE ((NTSTATUS) 0xC0000443L) +#define STATUS_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE ((NTSTATUS)0xC0000443L) #endif #ifndef STATUS_CS_ENCRYPTION_NEW_ENCRYPTED_FILE -# define STATUS_CS_ENCRYPTION_NEW_ENCRYPTED_FILE ((NTSTATUS) 0xC0000444L) +#define STATUS_CS_ENCRYPTION_NEW_ENCRYPTED_FILE ((NTSTATUS)0xC0000444L) #endif #ifndef STATUS_CS_ENCRYPTION_FILE_NOT_CSE -# define STATUS_CS_ENCRYPTION_FILE_NOT_CSE ((NTSTATUS) 0xC0000445L) +#define STATUS_CS_ENCRYPTION_FILE_NOT_CSE ((NTSTATUS)0xC0000445L) #endif #ifndef STATUS_INVALID_LABEL -# define STATUS_INVALID_LABEL ((NTSTATUS) 0xC0000446L) +#define STATUS_INVALID_LABEL ((NTSTATUS)0xC0000446L) #endif #ifndef STATUS_DRIVER_PROCESS_TERMINATED -# define STATUS_DRIVER_PROCESS_TERMINATED ((NTSTATUS) 0xC0000450L) +#define STATUS_DRIVER_PROCESS_TERMINATED ((NTSTATUS)0xC0000450L) #endif #ifndef STATUS_AMBIGUOUS_SYSTEM_DEVICE -# define STATUS_AMBIGUOUS_SYSTEM_DEVICE ((NTSTATUS) 0xC0000451L) +#define STATUS_AMBIGUOUS_SYSTEM_DEVICE ((NTSTATUS)0xC0000451L) #endif #ifndef STATUS_SYSTEM_DEVICE_NOT_FOUND -# define STATUS_SYSTEM_DEVICE_NOT_FOUND ((NTSTATUS) 0xC0000452L) +#define STATUS_SYSTEM_DEVICE_NOT_FOUND ((NTSTATUS)0xC0000452L) #endif #ifndef STATUS_RESTART_BOOT_APPLICATION -# define STATUS_RESTART_BOOT_APPLICATION ((NTSTATUS) 0xC0000453L) +#define STATUS_RESTART_BOOT_APPLICATION ((NTSTATUS)0xC0000453L) #endif #ifndef STATUS_INSUFFICIENT_NVRAM_RESOURCES -# define STATUS_INSUFFICIENT_NVRAM_RESOURCES ((NTSTATUS) 0xC0000454L) +#define STATUS_INSUFFICIENT_NVRAM_RESOURCES ((NTSTATUS)0xC0000454L) #endif #ifndef STATUS_INVALID_TASK_NAME -# define STATUS_INVALID_TASK_NAME ((NTSTATUS) 0xC0000500L) +#define STATUS_INVALID_TASK_NAME ((NTSTATUS)0xC0000500L) #endif #ifndef STATUS_INVALID_TASK_INDEX -# define STATUS_INVALID_TASK_INDEX ((NTSTATUS) 0xC0000501L) +#define STATUS_INVALID_TASK_INDEX ((NTSTATUS)0xC0000501L) #endif #ifndef STATUS_THREAD_ALREADY_IN_TASK -# define STATUS_THREAD_ALREADY_IN_TASK ((NTSTATUS) 0xC0000502L) +#define STATUS_THREAD_ALREADY_IN_TASK ((NTSTATUS)0xC0000502L) #endif #ifndef STATUS_CALLBACK_BYPASS -# define STATUS_CALLBACK_BYPASS ((NTSTATUS) 0xC0000503L) +#define STATUS_CALLBACK_BYPASS ((NTSTATUS)0xC0000503L) #endif #ifndef STATUS_FAIL_FAST_EXCEPTION -# define STATUS_FAIL_FAST_EXCEPTION ((NTSTATUS) 0xC0000602L) +#define STATUS_FAIL_FAST_EXCEPTION ((NTSTATUS)0xC0000602L) #endif #ifndef STATUS_IMAGE_CERT_REVOKED -# define STATUS_IMAGE_CERT_REVOKED ((NTSTATUS) 0xC0000603L) +#define STATUS_IMAGE_CERT_REVOKED ((NTSTATUS)0xC0000603L) #endif #ifndef STATUS_PORT_CLOSED -# define STATUS_PORT_CLOSED ((NTSTATUS) 0xC0000700L) +#define STATUS_PORT_CLOSED ((NTSTATUS)0xC0000700L) #endif #ifndef STATUS_MESSAGE_LOST -# define STATUS_MESSAGE_LOST ((NTSTATUS) 0xC0000701L) +#define STATUS_MESSAGE_LOST ((NTSTATUS)0xC0000701L) #endif #ifndef STATUS_INVALID_MESSAGE -# define STATUS_INVALID_MESSAGE ((NTSTATUS) 0xC0000702L) +#define STATUS_INVALID_MESSAGE ((NTSTATUS)0xC0000702L) #endif #ifndef STATUS_REQUEST_CANCELED -# define STATUS_REQUEST_CANCELED ((NTSTATUS) 0xC0000703L) +#define STATUS_REQUEST_CANCELED ((NTSTATUS)0xC0000703L) #endif #ifndef STATUS_RECURSIVE_DISPATCH -# define STATUS_RECURSIVE_DISPATCH ((NTSTATUS) 0xC0000704L) +#define STATUS_RECURSIVE_DISPATCH ((NTSTATUS)0xC0000704L) #endif #ifndef STATUS_LPC_RECEIVE_BUFFER_EXPECTED -# define STATUS_LPC_RECEIVE_BUFFER_EXPECTED ((NTSTATUS) 0xC0000705L) +#define STATUS_LPC_RECEIVE_BUFFER_EXPECTED ((NTSTATUS)0xC0000705L) #endif #ifndef STATUS_LPC_INVALID_CONNECTION_USAGE -# define STATUS_LPC_INVALID_CONNECTION_USAGE ((NTSTATUS) 0xC0000706L) +#define STATUS_LPC_INVALID_CONNECTION_USAGE ((NTSTATUS)0xC0000706L) #endif #ifndef STATUS_LPC_REQUESTS_NOT_ALLOWED -# define STATUS_LPC_REQUESTS_NOT_ALLOWED ((NTSTATUS) 0xC0000707L) +#define STATUS_LPC_REQUESTS_NOT_ALLOWED ((NTSTATUS)0xC0000707L) #endif #ifndef STATUS_RESOURCE_IN_USE -# define STATUS_RESOURCE_IN_USE ((NTSTATUS) 0xC0000708L) +#define STATUS_RESOURCE_IN_USE ((NTSTATUS)0xC0000708L) #endif #ifndef STATUS_HARDWARE_MEMORY_ERROR -# define STATUS_HARDWARE_MEMORY_ERROR ((NTSTATUS) 0xC0000709L) +#define STATUS_HARDWARE_MEMORY_ERROR ((NTSTATUS)0xC0000709L) #endif #ifndef STATUS_THREADPOOL_HANDLE_EXCEPTION -# define STATUS_THREADPOOL_HANDLE_EXCEPTION ((NTSTATUS) 0xC000070AL) +#define STATUS_THREADPOOL_HANDLE_EXCEPTION ((NTSTATUS)0xC000070AL) #endif #ifndef STATUS_THREADPOOL_SET_EVENT_ON_COMPLETION_FAILED -# define STATUS_THREADPOOL_SET_EVENT_ON_COMPLETION_FAILED ((NTSTATUS) 0xC000070BL) +#define STATUS_THREADPOOL_SET_EVENT_ON_COMPLETION_FAILED ((NTSTATUS)0xC000070BL) #endif #ifndef STATUS_THREADPOOL_RELEASE_SEMAPHORE_ON_COMPLETION_FAILED -# define STATUS_THREADPOOL_RELEASE_SEMAPHORE_ON_COMPLETION_FAILED ((NTSTATUS) 0xC000070CL) +#define STATUS_THREADPOOL_RELEASE_SEMAPHORE_ON_COMPLETION_FAILED \ + ((NTSTATUS)0xC000070CL) #endif #ifndef STATUS_THREADPOOL_RELEASE_MUTEX_ON_COMPLETION_FAILED -# define STATUS_THREADPOOL_RELEASE_MUTEX_ON_COMPLETION_FAILED ((NTSTATUS) 0xC000070DL) +#define STATUS_THREADPOOL_RELEASE_MUTEX_ON_COMPLETION_FAILED \ + ((NTSTATUS)0xC000070DL) #endif #ifndef STATUS_THREADPOOL_FREE_LIBRARY_ON_COMPLETION_FAILED -# define STATUS_THREADPOOL_FREE_LIBRARY_ON_COMPLETION_FAILED ((NTSTATUS) 0xC000070EL) +#define STATUS_THREADPOOL_FREE_LIBRARY_ON_COMPLETION_FAILED \ + ((NTSTATUS)0xC000070EL) #endif #ifndef STATUS_THREADPOOL_RELEASED_DURING_OPERATION -# define STATUS_THREADPOOL_RELEASED_DURING_OPERATION ((NTSTATUS) 0xC000070FL) +#define STATUS_THREADPOOL_RELEASED_DURING_OPERATION ((NTSTATUS)0xC000070FL) #endif #ifndef STATUS_CALLBACK_RETURNED_WHILE_IMPERSONATING -# define STATUS_CALLBACK_RETURNED_WHILE_IMPERSONATING ((NTSTATUS) 0xC0000710L) +#define STATUS_CALLBACK_RETURNED_WHILE_IMPERSONATING ((NTSTATUS)0xC0000710L) #endif #ifndef STATUS_APC_RETURNED_WHILE_IMPERSONATING -# define STATUS_APC_RETURNED_WHILE_IMPERSONATING ((NTSTATUS) 0xC0000711L) +#define STATUS_APC_RETURNED_WHILE_IMPERSONATING ((NTSTATUS)0xC0000711L) #endif #ifndef STATUS_PROCESS_IS_PROTECTED -# define STATUS_PROCESS_IS_PROTECTED ((NTSTATUS) 0xC0000712L) +#define STATUS_PROCESS_IS_PROTECTED ((NTSTATUS)0xC0000712L) #endif #ifndef STATUS_MCA_EXCEPTION -# define STATUS_MCA_EXCEPTION ((NTSTATUS) 0xC0000713L) +#define STATUS_MCA_EXCEPTION ((NTSTATUS)0xC0000713L) #endif #ifndef STATUS_CERTIFICATE_MAPPING_NOT_UNIQUE -# define STATUS_CERTIFICATE_MAPPING_NOT_UNIQUE ((NTSTATUS) 0xC0000714L) +#define STATUS_CERTIFICATE_MAPPING_NOT_UNIQUE ((NTSTATUS)0xC0000714L) #endif #ifndef STATUS_SYMLINK_CLASS_DISABLED -# define STATUS_SYMLINK_CLASS_DISABLED ((NTSTATUS) 0xC0000715L) +#define STATUS_SYMLINK_CLASS_DISABLED ((NTSTATUS)0xC0000715L) #endif #ifndef STATUS_INVALID_IDN_NORMALIZATION -# define STATUS_INVALID_IDN_NORMALIZATION ((NTSTATUS) 0xC0000716L) +#define STATUS_INVALID_IDN_NORMALIZATION ((NTSTATUS)0xC0000716L) #endif #ifndef STATUS_NO_UNICODE_TRANSLATION -# define STATUS_NO_UNICODE_TRANSLATION ((NTSTATUS) 0xC0000717L) +#define STATUS_NO_UNICODE_TRANSLATION ((NTSTATUS)0xC0000717L) #endif #ifndef STATUS_ALREADY_REGISTERED -# define STATUS_ALREADY_REGISTERED ((NTSTATUS) 0xC0000718L) +#define STATUS_ALREADY_REGISTERED ((NTSTATUS)0xC0000718L) #endif #ifndef STATUS_CONTEXT_MISMATCH -# define STATUS_CONTEXT_MISMATCH ((NTSTATUS) 0xC0000719L) +#define STATUS_CONTEXT_MISMATCH ((NTSTATUS)0xC0000719L) #endif #ifndef STATUS_PORT_ALREADY_HAS_COMPLETION_LIST -# define STATUS_PORT_ALREADY_HAS_COMPLETION_LIST ((NTSTATUS) 0xC000071AL) +#define STATUS_PORT_ALREADY_HAS_COMPLETION_LIST ((NTSTATUS)0xC000071AL) #endif #ifndef STATUS_CALLBACK_RETURNED_THREAD_PRIORITY -# define STATUS_CALLBACK_RETURNED_THREAD_PRIORITY ((NTSTATUS) 0xC000071BL) +#define STATUS_CALLBACK_RETURNED_THREAD_PRIORITY ((NTSTATUS)0xC000071BL) #endif #ifndef STATUS_INVALID_THREAD -# define STATUS_INVALID_THREAD ((NTSTATUS) 0xC000071CL) +#define STATUS_INVALID_THREAD ((NTSTATUS)0xC000071CL) #endif #ifndef STATUS_CALLBACK_RETURNED_TRANSACTION -# define STATUS_CALLBACK_RETURNED_TRANSACTION ((NTSTATUS) 0xC000071DL) +#define STATUS_CALLBACK_RETURNED_TRANSACTION ((NTSTATUS)0xC000071DL) #endif #ifndef STATUS_CALLBACK_RETURNED_LDR_LOCK -# define STATUS_CALLBACK_RETURNED_LDR_LOCK ((NTSTATUS) 0xC000071EL) +#define STATUS_CALLBACK_RETURNED_LDR_LOCK ((NTSTATUS)0xC000071EL) #endif #ifndef STATUS_CALLBACK_RETURNED_LANG -# define STATUS_CALLBACK_RETURNED_LANG ((NTSTATUS) 0xC000071FL) +#define STATUS_CALLBACK_RETURNED_LANG ((NTSTATUS)0xC000071FL) #endif #ifndef STATUS_CALLBACK_RETURNED_PRI_BACK -# define STATUS_CALLBACK_RETURNED_PRI_BACK ((NTSTATUS) 0xC0000720L) +#define STATUS_CALLBACK_RETURNED_PRI_BACK ((NTSTATUS)0xC0000720L) #endif #ifndef STATUS_CALLBACK_RETURNED_THREAD_AFFINITY -# define STATUS_CALLBACK_RETURNED_THREAD_AFFINITY ((NTSTATUS) 0xC0000721L) +#define STATUS_CALLBACK_RETURNED_THREAD_AFFINITY ((NTSTATUS)0xC0000721L) #endif #ifndef STATUS_DISK_REPAIR_DISABLED -# define STATUS_DISK_REPAIR_DISABLED ((NTSTATUS) 0xC0000800L) +#define STATUS_DISK_REPAIR_DISABLED ((NTSTATUS)0xC0000800L) #endif #ifndef STATUS_DS_DOMAIN_RENAME_IN_PROGRESS -# define STATUS_DS_DOMAIN_RENAME_IN_PROGRESS ((NTSTATUS) 0xC0000801L) +#define STATUS_DS_DOMAIN_RENAME_IN_PROGRESS ((NTSTATUS)0xC0000801L) #endif #ifndef STATUS_DISK_QUOTA_EXCEEDED -# define STATUS_DISK_QUOTA_EXCEEDED ((NTSTATUS) 0xC0000802L) +#define STATUS_DISK_QUOTA_EXCEEDED ((NTSTATUS)0xC0000802L) #endif #ifndef STATUS_DATA_LOST_REPAIR -# define STATUS_DATA_LOST_REPAIR ((NTSTATUS) 0x80000803L) +#define STATUS_DATA_LOST_REPAIR ((NTSTATUS)0x80000803L) #endif #ifndef STATUS_CONTENT_BLOCKED -# define STATUS_CONTENT_BLOCKED ((NTSTATUS) 0xC0000804L) +#define STATUS_CONTENT_BLOCKED ((NTSTATUS)0xC0000804L) #endif #ifndef STATUS_BAD_CLUSTERS -# define STATUS_BAD_CLUSTERS ((NTSTATUS) 0xC0000805L) +#define STATUS_BAD_CLUSTERS ((NTSTATUS)0xC0000805L) #endif #ifndef STATUS_VOLUME_DIRTY -# define STATUS_VOLUME_DIRTY ((NTSTATUS) 0xC0000806L) +#define STATUS_VOLUME_DIRTY ((NTSTATUS)0xC0000806L) #endif #ifndef STATUS_FILE_CHECKED_OUT -# define STATUS_FILE_CHECKED_OUT ((NTSTATUS) 0xC0000901L) +#define STATUS_FILE_CHECKED_OUT ((NTSTATUS)0xC0000901L) #endif #ifndef STATUS_CHECKOUT_REQUIRED -# define STATUS_CHECKOUT_REQUIRED ((NTSTATUS) 0xC0000902L) +#define STATUS_CHECKOUT_REQUIRED ((NTSTATUS)0xC0000902L) #endif #ifndef STATUS_BAD_FILE_TYPE -# define STATUS_BAD_FILE_TYPE ((NTSTATUS) 0xC0000903L) +#define STATUS_BAD_FILE_TYPE ((NTSTATUS)0xC0000903L) #endif #ifndef STATUS_FILE_TOO_LARGE -# define STATUS_FILE_TOO_LARGE ((NTSTATUS) 0xC0000904L) +#define STATUS_FILE_TOO_LARGE ((NTSTATUS)0xC0000904L) #endif #ifndef STATUS_FORMS_AUTH_REQUIRED -# define STATUS_FORMS_AUTH_REQUIRED ((NTSTATUS) 0xC0000905L) +#define STATUS_FORMS_AUTH_REQUIRED ((NTSTATUS)0xC0000905L) #endif #ifndef STATUS_VIRUS_INFECTED -# define STATUS_VIRUS_INFECTED ((NTSTATUS) 0xC0000906L) +#define STATUS_VIRUS_INFECTED ((NTSTATUS)0xC0000906L) #endif #ifndef STATUS_VIRUS_DELETED -# define STATUS_VIRUS_DELETED ((NTSTATUS) 0xC0000907L) +#define STATUS_VIRUS_DELETED ((NTSTATUS)0xC0000907L) #endif #ifndef STATUS_BAD_MCFG_TABLE -# define STATUS_BAD_MCFG_TABLE ((NTSTATUS) 0xC0000908L) +#define STATUS_BAD_MCFG_TABLE ((NTSTATUS)0xC0000908L) #endif #ifndef STATUS_CANNOT_BREAK_OPLOCK -# define STATUS_CANNOT_BREAK_OPLOCK ((NTSTATUS) 0xC0000909L) +#define STATUS_CANNOT_BREAK_OPLOCK ((NTSTATUS)0xC0000909L) #endif #ifndef STATUS_WOW_ASSERTION -# define STATUS_WOW_ASSERTION ((NTSTATUS) 0xC0009898L) +#define STATUS_WOW_ASSERTION ((NTSTATUS)0xC0009898L) #endif #ifndef STATUS_INVALID_SIGNATURE -# define STATUS_INVALID_SIGNATURE ((NTSTATUS) 0xC000A000L) +#define STATUS_INVALID_SIGNATURE ((NTSTATUS)0xC000A000L) #endif #ifndef STATUS_HMAC_NOT_SUPPORTED -# define STATUS_HMAC_NOT_SUPPORTED ((NTSTATUS) 0xC000A001L) +#define STATUS_HMAC_NOT_SUPPORTED ((NTSTATUS)0xC000A001L) #endif #ifndef STATUS_AUTH_TAG_MISMATCH -# define STATUS_AUTH_TAG_MISMATCH ((NTSTATUS) 0xC000A002L) +#define STATUS_AUTH_TAG_MISMATCH ((NTSTATUS)0xC000A002L) #endif #ifndef STATUS_IPSEC_QUEUE_OVERFLOW -# define STATUS_IPSEC_QUEUE_OVERFLOW ((NTSTATUS) 0xC000A010L) +#define STATUS_IPSEC_QUEUE_OVERFLOW ((NTSTATUS)0xC000A010L) #endif #ifndef STATUS_ND_QUEUE_OVERFLOW -# define STATUS_ND_QUEUE_OVERFLOW ((NTSTATUS) 0xC000A011L) +#define STATUS_ND_QUEUE_OVERFLOW ((NTSTATUS)0xC000A011L) #endif #ifndef STATUS_HOPLIMIT_EXCEEDED -# define STATUS_HOPLIMIT_EXCEEDED ((NTSTATUS) 0xC000A012L) +#define STATUS_HOPLIMIT_EXCEEDED ((NTSTATUS)0xC000A012L) #endif #ifndef STATUS_PROTOCOL_NOT_SUPPORTED -# define STATUS_PROTOCOL_NOT_SUPPORTED ((NTSTATUS) 0xC000A013L) +#define STATUS_PROTOCOL_NOT_SUPPORTED ((NTSTATUS)0xC000A013L) #endif #ifndef STATUS_FASTPATH_REJECTED -# define STATUS_FASTPATH_REJECTED ((NTSTATUS) 0xC000A014L) +#define STATUS_FASTPATH_REJECTED ((NTSTATUS)0xC000A014L) #endif #ifndef STATUS_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED -# define STATUS_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED ((NTSTATUS) 0xC000A080L) +#define STATUS_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED \ + ((NTSTATUS)0xC000A080L) #endif #ifndef STATUS_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR -# define STATUS_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR ((NTSTATUS) 0xC000A081L) +#define STATUS_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR \ + ((NTSTATUS)0xC000A081L) #endif #ifndef STATUS_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR -# define STATUS_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR ((NTSTATUS) 0xC000A082L) +#define STATUS_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR ((NTSTATUS)0xC000A082L) #endif #ifndef STATUS_XML_PARSE_ERROR -# define STATUS_XML_PARSE_ERROR ((NTSTATUS) 0xC000A083L) +#define STATUS_XML_PARSE_ERROR ((NTSTATUS)0xC000A083L) #endif #ifndef STATUS_XMLDSIG_ERROR -# define STATUS_XMLDSIG_ERROR ((NTSTATUS) 0xC000A084L) +#define STATUS_XMLDSIG_ERROR ((NTSTATUS)0xC000A084L) #endif #ifndef STATUS_WRONG_COMPARTMENT -# define STATUS_WRONG_COMPARTMENT ((NTSTATUS) 0xC000A085L) +#define STATUS_WRONG_COMPARTMENT ((NTSTATUS)0xC000A085L) #endif #ifndef STATUS_AUTHIP_FAILURE -# define STATUS_AUTHIP_FAILURE ((NTSTATUS) 0xC000A086L) +#define STATUS_AUTHIP_FAILURE ((NTSTATUS)0xC000A086L) #endif #ifndef STATUS_DS_OID_MAPPED_GROUP_CANT_HAVE_MEMBERS -# define STATUS_DS_OID_MAPPED_GROUP_CANT_HAVE_MEMBERS ((NTSTATUS) 0xC000A087L) +#define STATUS_DS_OID_MAPPED_GROUP_CANT_HAVE_MEMBERS ((NTSTATUS)0xC000A087L) #endif #ifndef STATUS_DS_OID_NOT_FOUND -# define STATUS_DS_OID_NOT_FOUND ((NTSTATUS) 0xC000A088L) +#define STATUS_DS_OID_NOT_FOUND ((NTSTATUS)0xC000A088L) #endif #ifndef STATUS_HASH_NOT_SUPPORTED -# define STATUS_HASH_NOT_SUPPORTED ((NTSTATUS) 0xC000A100L) +#define STATUS_HASH_NOT_SUPPORTED ((NTSTATUS)0xC000A100L) #endif #ifndef STATUS_HASH_NOT_PRESENT -# define STATUS_HASH_NOT_PRESENT ((NTSTATUS) 0xC000A101L) +#define STATUS_HASH_NOT_PRESENT ((NTSTATUS)0xC000A101L) #endif /* This is not the NTSTATUS_FROM_WIN32 that the DDK provides, because the DDK * got it wrong! */ #ifdef NTSTATUS_FROM_WIN32 -# undef NTSTATUS_FROM_WIN32 +#undef NTSTATUS_FROM_WIN32 #endif -#define NTSTATUS_FROM_WIN32(error) ((NTSTATUS) (error) <= 0 ? \ - ((NTSTATUS) (error)) : ((NTSTATUS) (((error) & 0x0000FFFF) | \ - (FACILITY_NTWIN32 << 16) | ERROR_SEVERITY_WARNING))) +#define NTSTATUS_FROM_WIN32(error) \ + ((NTSTATUS)(error) <= 0 \ + ? ((NTSTATUS)(error)) \ + : ((NTSTATUS)(((error) & 0x0000FFFF) | (FACILITY_NTWIN32 << 16) | \ + ERROR_SEVERITY_WARNING))) #ifndef JOB_OBJECT_LIMIT_PROCESS_MEMORY -# define JOB_OBJECT_LIMIT_PROCESS_MEMORY 0x00000100 +#define JOB_OBJECT_LIMIT_PROCESS_MEMORY 0x00000100 #endif #ifndef JOB_OBJECT_LIMIT_JOB_MEMORY -# define JOB_OBJECT_LIMIT_JOB_MEMORY 0x00000200 +#define JOB_OBJECT_LIMIT_JOB_MEMORY 0x00000200 #endif #ifndef JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION -# define JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION 0x00000400 +#define JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION 0x00000400 #endif #ifndef JOB_OBJECT_LIMIT_BREAKAWAY_OK -# define JOB_OBJECT_LIMIT_BREAKAWAY_OK 0x00000800 +#define JOB_OBJECT_LIMIT_BREAKAWAY_OK 0x00000800 #endif #ifndef JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK -# define JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK 0x00001000 +#define JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK 0x00001000 #endif #ifndef JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE -# define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE 0x00002000 +#define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE 0x00002000 #endif #ifndef SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE -# define SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE 0x00000002 +#define SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE 0x00000002 #endif /* from winternl.h */ @@ -4115,49 +4124,49 @@ typedef struct _UNICODE_STRING { USHORT Length; USHORT MaximumLength; - PWSTR Buffer; + PWSTR Buffer; } UNICODE_STRING, *PUNICODE_STRING; typedef const UNICODE_STRING *PCUNICODE_STRING; /* from ntifs.h */ #ifndef DEVICE_TYPE -# define DEVICE_TYPE DWORD +#define DEVICE_TYPE DWORD #endif /* MinGW already has a definition for REPARSE_DATA_BUFFER, but mingw-w64 does * not. */ #if defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR) - typedef struct _REPARSE_DATA_BUFFER { - ULONG ReparseTag; - USHORT ReparseDataLength; - USHORT Reserved; - union { - struct { - USHORT SubstituteNameOffset; - USHORT SubstituteNameLength; - USHORT PrintNameOffset; - USHORT PrintNameLength; - ULONG Flags; - WCHAR PathBuffer[1]; - } SymbolicLinkReparseBuffer; - struct { - USHORT SubstituteNameOffset; - USHORT SubstituteNameLength; - USHORT PrintNameOffset; - USHORT PrintNameLength; - WCHAR PathBuffer[1]; - } MountPointReparseBuffer; - struct { - UCHAR DataBuffer[1]; - } GenericReparseBuffer; - struct { - ULONG StringCount; - WCHAR StringList[1]; - } AppExecLinkReparseBuffer; - } u; - } REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER; +typedef struct _REPARSE_DATA_BUFFER { + ULONG ReparseTag; + USHORT ReparseDataLength; + USHORT Reserved; + union { + struct { + USHORT SubstituteNameOffset; + USHORT SubstituteNameLength; + USHORT PrintNameOffset; + USHORT PrintNameLength; + ULONG Flags; + WCHAR PathBuffer[1]; + } SymbolicLinkReparseBuffer; + struct { + USHORT SubstituteNameOffset; + USHORT SubstituteNameLength; + USHORT PrintNameOffset; + USHORT PrintNameLength; + WCHAR PathBuffer[1]; + } MountPointReparseBuffer; + struct { + UCHAR DataBuffer[1]; + } GenericReparseBuffer; + struct { + ULONG StringCount; + WCHAR StringList[1]; + } AppExecLinkReparseBuffer; + } u; +} REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER; #endif typedef struct _IO_STATUS_BLOCK { @@ -4225,7 +4234,8 @@ typedef enum _FILE_INFORMATION_CLASS { FileStandardLinkInformation, FileRemoteProtocolInformation, FileMaximumInformation -} FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS; +} FILE_INFORMATION_CLASS, + *PFILE_INFORMATION_CLASS; typedef struct _FILE_DIRECTORY_INFORMATION { ULONG NextEntryOffset; @@ -4269,9 +4279,9 @@ typedef struct _FILE_BASIC_INFORMATION { typedef struct _FILE_STANDARD_INFORMATION { LARGE_INTEGER AllocationSize; LARGE_INTEGER EndOfFile; - ULONG NumberOfLinks; - BOOLEAN DeletePending; - BOOLEAN Directory; + ULONG NumberOfLinks; + BOOLEAN DeletePending; + BOOLEAN Directory; } FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION; typedef struct _FILE_INTERNAL_INFORMATION { @@ -4304,19 +4314,19 @@ typedef struct _FILE_NAME_INFORMATION { } FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION; typedef struct _FILE_END_OF_FILE_INFORMATION { - LARGE_INTEGER EndOfFile; + LARGE_INTEGER EndOfFile; } FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION; typedef struct _FILE_ALL_INFORMATION { - FILE_BASIC_INFORMATION BasicInformation; - FILE_STANDARD_INFORMATION StandardInformation; - FILE_INTERNAL_INFORMATION InternalInformation; - FILE_EA_INFORMATION EaInformation; - FILE_ACCESS_INFORMATION AccessInformation; - FILE_POSITION_INFORMATION PositionInformation; - FILE_MODE_INFORMATION ModeInformation; + FILE_BASIC_INFORMATION BasicInformation; + FILE_STANDARD_INFORMATION StandardInformation; + FILE_INTERNAL_INFORMATION InternalInformation; + FILE_EA_INFORMATION EaInformation; + FILE_ACCESS_INFORMATION AccessInformation; + FILE_POSITION_INFORMATION PositionInformation; + FILE_MODE_INFORMATION ModeInformation; FILE_ALIGNMENT_INFORMATION AlignmentInformation; - FILE_NAME_INFORMATION NameInformation; + FILE_NAME_INFORMATION NameInformation; } FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION; typedef struct _FILE_DISPOSITION_INFORMATION { @@ -4336,29 +4346,30 @@ typedef struct _FILE_PIPE_LOCAL_INFORMATION { ULONG NamedPipeEnd; } FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION; -#define FILE_SYNCHRONOUS_IO_ALERT 0x00000010 -#define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020 +#define FILE_SYNCHRONOUS_IO_ALERT 0x00000010 +#define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020 typedef enum _FS_INFORMATION_CLASS { - FileFsVolumeInformation = 1, - FileFsLabelInformation = 2, - FileFsSizeInformation = 3, - FileFsDeviceInformation = 4, - FileFsAttributeInformation = 5, - FileFsControlInformation = 6, - FileFsFullSizeInformation = 7, - FileFsObjectIdInformation = 8, - FileFsDriverPathInformation = 9, - FileFsVolumeFlagsInformation = 10, - FileFsSectorSizeInformation = 11 -} FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS; + FileFsVolumeInformation = 1, + FileFsLabelInformation = 2, + FileFsSizeInformation = 3, + FileFsDeviceInformation = 4, + FileFsAttributeInformation = 5, + FileFsControlInformation = 6, + FileFsFullSizeInformation = 7, + FileFsObjectIdInformation = 8, + FileFsDriverPathInformation = 9, + FileFsVolumeFlagsInformation = 10, + FileFsSectorSizeInformation = 11 +} FS_INFORMATION_CLASS, + *PFS_INFORMATION_CLASS; typedef struct _FILE_FS_VOLUME_INFORMATION { LARGE_INTEGER VolumeCreationTime; - ULONG VolumeSerialNumber; - ULONG VolumeLabelLength; - BOOLEAN SupportsObjects; - WCHAR VolumeLabel[1]; + ULONG VolumeSerialNumber; + ULONG VolumeLabelLength; + BOOLEAN SupportsObjects; + WCHAR VolumeLabel[1]; } FILE_FS_VOLUME_INFORMATION, *PFILE_FS_VOLUME_INFORMATION; typedef struct _FILE_FS_LABEL_INFORMATION { @@ -4369,18 +4380,18 @@ typedef struct _FILE_FS_LABEL_INFORMATION { typedef struct _FILE_FS_SIZE_INFORMATION { LARGE_INTEGER TotalAllocationUnits; LARGE_INTEGER AvailableAllocationUnits; - ULONG SectorsPerAllocationUnit; - ULONG BytesPerSector; + ULONG SectorsPerAllocationUnit; + ULONG BytesPerSector; } FILE_FS_SIZE_INFORMATION, *PFILE_FS_SIZE_INFORMATION; typedef struct _FILE_FS_DEVICE_INFORMATION { DEVICE_TYPE DeviceType; - ULONG Characteristics; + ULONG Characteristics; } FILE_FS_DEVICE_INFORMATION, *PFILE_FS_DEVICE_INFORMATION; typedef struct _FILE_FS_ATTRIBUTE_INFORMATION { ULONG FileSystemAttributes; - LONG MaximumComponentNameLength; + LONG MaximumComponentNameLength; ULONG FileSystemNameLength; WCHAR FileSystemName[1]; } FILE_FS_ATTRIBUTE_INFORMATION, *PFILE_FS_ATTRIBUTE_INFORMATION; @@ -4391,15 +4402,15 @@ typedef struct _FILE_FS_CONTROL_INFORMATION { LARGE_INTEGER FreeSpaceStopFiltering; LARGE_INTEGER DefaultQuotaThreshold; LARGE_INTEGER DefaultQuotaLimit; - ULONG FileSystemControlFlags; + ULONG FileSystemControlFlags; } FILE_FS_CONTROL_INFORMATION, *PFILE_FS_CONTROL_INFORMATION; typedef struct _FILE_FS_FULL_SIZE_INFORMATION { LARGE_INTEGER TotalAllocationUnits; LARGE_INTEGER CallerAvailableAllocationUnits; LARGE_INTEGER ActualAvailableAllocationUnits; - ULONG SectorsPerAllocationUnit; - ULONG BytesPerSector; + ULONG SectorsPerAllocationUnit; + ULONG BytesPerSector; } FILE_FS_FULL_SIZE_INFORMATION, *PFILE_FS_FULL_SIZE_INFORMATION; typedef struct _FILE_FS_OBJECTID_INFORMATION { @@ -4409,8 +4420,8 @@ typedef struct _FILE_FS_OBJECTID_INFORMATION { typedef struct _FILE_FS_DRIVER_PATH_INFORMATION { BOOLEAN DriverInPath; - ULONG DriverNameLength; - WCHAR DriverName[1]; + ULONG DriverNameLength; + WCHAR DriverName[1]; } FILE_FS_DRIVER_PATH_INFORMATION, *PFILE_FS_DRIVER_PATH_INFORMATION; typedef struct _FILE_FS_VOLUME_FLAGS_INFORMATION { @@ -4428,40 +4439,41 @@ typedef struct _FILE_FS_SECTOR_SIZE_INFORMATION { } FILE_FS_SECTOR_SIZE_INFORMATION, *PFILE_FS_SECTOR_SIZE_INFORMATION; typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION { - LARGE_INTEGER IdleTime; - LARGE_INTEGER KernelTime; - LARGE_INTEGER UserTime; - LARGE_INTEGER DpcTime; - LARGE_INTEGER InterruptTime; - ULONG InterruptCount; -} SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION; + LARGE_INTEGER IdleTime; + LARGE_INTEGER KernelTime; + LARGE_INTEGER UserTime; + LARGE_INTEGER DpcTime; + LARGE_INTEGER InterruptTime; + ULONG InterruptCount; +} SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, + *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION; #ifndef SystemProcessorPerformanceInformation -# define SystemProcessorPerformanceInformation 8 +#define SystemProcessorPerformanceInformation 8 #endif #ifndef ProcessConsoleHostProcess -# define ProcessConsoleHostProcess 49 +#define ProcessConsoleHostProcess 49 #endif #ifndef FILE_DEVICE_FILE_SYSTEM -# define FILE_DEVICE_FILE_SYSTEM 0x00000009 +#define FILE_DEVICE_FILE_SYSTEM 0x00000009 #endif #ifndef FILE_DEVICE_NETWORK -# define FILE_DEVICE_NETWORK 0x00000012 +#define FILE_DEVICE_NETWORK 0x00000012 #endif #ifndef METHOD_BUFFERED -# define METHOD_BUFFERED 0 +#define METHOD_BUFFERED 0 #endif #ifndef METHOD_IN_DIRECT -# define METHOD_IN_DIRECT 1 +#define METHOD_IN_DIRECT 1 #endif #ifndef METHOD_OUT_DIRECT -# define METHOD_OUT_DIRECT 2 +#define METHOD_OUT_DIRECT 2 #endif #ifndef METHOD_NEITHER @@ -4469,230 +4481,189 @@ typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION { #endif #ifndef METHOD_DIRECT_TO_HARDWARE -# define METHOD_DIRECT_TO_HARDWARE METHOD_IN_DIRECT +#define METHOD_DIRECT_TO_HARDWARE METHOD_IN_DIRECT #endif #ifndef METHOD_DIRECT_FROM_HARDWARE -# define METHOD_DIRECT_FROM_HARDWARE METHOD_OUT_DIRECT +#define METHOD_DIRECT_FROM_HARDWARE METHOD_OUT_DIRECT #endif #ifndef FILE_ANY_ACCESS -# define FILE_ANY_ACCESS 0 +#define FILE_ANY_ACCESS 0 #endif #ifndef FILE_SPECIAL_ACCESS -# define FILE_SPECIAL_ACCESS (FILE_ANY_ACCESS) +#define FILE_SPECIAL_ACCESS (FILE_ANY_ACCESS) #endif #ifndef FILE_READ_ACCESS -# define FILE_READ_ACCESS 0x0001 +#define FILE_READ_ACCESS 0x0001 #endif #ifndef FILE_WRITE_ACCESS -# define FILE_WRITE_ACCESS 0x0002 +#define FILE_WRITE_ACCESS 0x0002 #endif #ifndef CTL_CODE -# define CTL_CODE(device_type, function, method, access) \ - (((device_type) << 16) | ((access) << 14) | ((function) << 2) | (method)) +#define CTL_CODE(device_type, function, method, access) \ + (((device_type) << 16) | ((access) << 14) | ((function) << 2) | (method)) #endif #ifndef FSCTL_SET_REPARSE_POINT -# define FSCTL_SET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, \ - 41, \ - METHOD_BUFFERED, \ - FILE_SPECIAL_ACCESS) +#define FSCTL_SET_REPARSE_POINT \ + CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) #endif #ifndef FSCTL_GET_REPARSE_POINT -# define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, \ - 42, \ - METHOD_BUFFERED, \ - FILE_ANY_ACCESS) +#define FSCTL_GET_REPARSE_POINT \ + CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS) #endif #ifndef FSCTL_DELETE_REPARSE_POINT -# define FSCTL_DELETE_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, \ - 43, \ - METHOD_BUFFERED, \ - FILE_SPECIAL_ACCESS) +#define FSCTL_DELETE_REPARSE_POINT \ + CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 43, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) #endif #ifndef IO_REPARSE_TAG_SYMLINK -# define IO_REPARSE_TAG_SYMLINK (0xA000000CL) +#define IO_REPARSE_TAG_SYMLINK (0xA000000CL) #endif #ifndef IO_REPARSE_TAG_APPEXECLINK -# define IO_REPARSE_TAG_APPEXECLINK (0x8000001BL) -#endif - -typedef VOID (NTAPI *PIO_APC_ROUTINE) - (PVOID ApcContext, - PIO_STATUS_BLOCK IoStatusBlock, - ULONG Reserved); - -typedef NTSTATUS (NTAPI *sRtlGetVersion) - (PRTL_OSVERSIONINFOW lpVersionInformation); - -typedef ULONG (NTAPI *sRtlNtStatusToDosError) - (NTSTATUS Status); - -typedef NTSTATUS (NTAPI *sNtDeviceIoControlFile) - (HANDLE FileHandle, - HANDLE Event, - PIO_APC_ROUTINE ApcRoutine, - PVOID ApcContext, - PIO_STATUS_BLOCK IoStatusBlock, - ULONG IoControlCode, - PVOID InputBuffer, - ULONG InputBufferLength, - PVOID OutputBuffer, - ULONG OutputBufferLength); - -typedef NTSTATUS (NTAPI *sNtQueryInformationFile) - (HANDLE FileHandle, - PIO_STATUS_BLOCK IoStatusBlock, - PVOID FileInformation, - ULONG Length, - FILE_INFORMATION_CLASS FileInformationClass); - -typedef NTSTATUS (NTAPI *sNtSetInformationFile) - (HANDLE FileHandle, - PIO_STATUS_BLOCK IoStatusBlock, - PVOID FileInformation, - ULONG Length, - FILE_INFORMATION_CLASS FileInformationClass); - -typedef NTSTATUS (NTAPI *sNtQueryVolumeInformationFile) - (HANDLE FileHandle, - PIO_STATUS_BLOCK IoStatusBlock, - PVOID FsInformation, - ULONG Length, - FS_INFORMATION_CLASS FsInformationClass); - -typedef NTSTATUS (NTAPI *sNtQuerySystemInformation) - (UINT SystemInformationClass, - PVOID SystemInformation, - ULONG SystemInformationLength, - PULONG ReturnLength); - -typedef NTSTATUS (NTAPI *sNtQueryDirectoryFile) - (HANDLE FileHandle, - HANDLE Event, - PIO_APC_ROUTINE ApcRoutine, - PVOID ApcContext, - PIO_STATUS_BLOCK IoStatusBlock, - PVOID FileInformation, - ULONG Length, - FILE_INFORMATION_CLASS FileInformationClass, - BOOLEAN ReturnSingleEntry, - PUNICODE_STRING FileName, - BOOLEAN RestartScan - ); - -typedef NTSTATUS (NTAPI *sNtQueryInformationProcess) - (HANDLE ProcessHandle, - UINT ProcessInformationClass, - PVOID ProcessInformation, - ULONG Length, - PULONG ReturnLength); +#define IO_REPARSE_TAG_APPEXECLINK (0x8000001BL) +#endif + +typedef VOID(NTAPI *PIO_APC_ROUTINE)(PVOID ApcContext, + PIO_STATUS_BLOCK IoStatusBlock, + ULONG Reserved); + +typedef NTSTATUS(NTAPI *sRtlGetVersion)( + PRTL_OSVERSIONINFOW lpVersionInformation); + +typedef ULONG(NTAPI *sRtlNtStatusToDosError)(NTSTATUS Status); + +typedef NTSTATUS(NTAPI *sNtDeviceIoControlFile)( + HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, + PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, ULONG IoControlCode, + PVOID InputBuffer, ULONG InputBufferLength, PVOID OutputBuffer, + ULONG OutputBufferLength); + +typedef NTSTATUS(NTAPI *sNtQueryInformationFile)( + HANDLE FileHandle, PIO_STATUS_BLOCK IoStatusBlock, PVOID FileInformation, + ULONG Length, FILE_INFORMATION_CLASS FileInformationClass); + +typedef NTSTATUS(NTAPI *sNtSetInformationFile)( + HANDLE FileHandle, PIO_STATUS_BLOCK IoStatusBlock, PVOID FileInformation, + ULONG Length, FILE_INFORMATION_CLASS FileInformationClass); + +typedef NTSTATUS(NTAPI *sNtQueryVolumeInformationFile)( + HANDLE FileHandle, PIO_STATUS_BLOCK IoStatusBlock, PVOID FsInformation, + ULONG Length, FS_INFORMATION_CLASS FsInformationClass); + +typedef NTSTATUS(NTAPI *sNtQuerySystemInformation)( + UINT SystemInformationClass, PVOID SystemInformation, + ULONG SystemInformationLength, PULONG ReturnLength); + +typedef NTSTATUS(NTAPI *sNtQueryDirectoryFile)( + HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, + PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, PVOID FileInformation, + ULONG Length, FILE_INFORMATION_CLASS FileInformationClass, + BOOLEAN ReturnSingleEntry, PUNICODE_STRING FileName, BOOLEAN RestartScan); + +typedef NTSTATUS(NTAPI *sNtQueryInformationProcess)( + HANDLE ProcessHandle, UINT ProcessInformationClass, + PVOID ProcessInformation, ULONG Length, PULONG ReturnLength); /* * Kernel32 headers */ #ifndef FILE_SKIP_COMPLETION_PORT_ON_SUCCESS -# define FILE_SKIP_COMPLETION_PORT_ON_SUCCESS 0x1 +#define FILE_SKIP_COMPLETION_PORT_ON_SUCCESS 0x1 #endif #ifndef FILE_SKIP_SET_EVENT_ON_HANDLE -# define FILE_SKIP_SET_EVENT_ON_HANDLE 0x2 +#define FILE_SKIP_SET_EVENT_ON_HANDLE 0x2 #endif #ifndef SYMBOLIC_LINK_FLAG_DIRECTORY -# define SYMBOLIC_LINK_FLAG_DIRECTORY 0x1 +#define SYMBOLIC_LINK_FLAG_DIRECTORY 0x1 #endif #if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) - typedef struct _OVERLAPPED_ENTRY { - ULONG_PTR lpCompletionKey; - LPOVERLAPPED lpOverlapped; - ULONG_PTR Internal; - DWORD dwNumberOfBytesTransferred; - } OVERLAPPED_ENTRY, *LPOVERLAPPED_ENTRY; +typedef struct _OVERLAPPED_ENTRY { + ULONG_PTR lpCompletionKey; + LPOVERLAPPED lpOverlapped; + ULONG_PTR Internal; + DWORD dwNumberOfBytesTransferred; +} OVERLAPPED_ENTRY, *LPOVERLAPPED_ENTRY; #endif /* from wincon.h */ #ifndef ENABLE_INSERT_MODE -# define ENABLE_INSERT_MODE 0x20 +#define ENABLE_INSERT_MODE 0x20 #endif #ifndef ENABLE_QUICK_EDIT_MODE -# define ENABLE_QUICK_EDIT_MODE 0x40 +#define ENABLE_QUICK_EDIT_MODE 0x40 #endif #ifndef ENABLE_EXTENDED_FLAGS -# define ENABLE_EXTENDED_FLAGS 0x80 +#define ENABLE_EXTENDED_FLAGS 0x80 #endif /* from winerror.h */ #ifndef ERROR_ELEVATION_REQUIRED -# define ERROR_ELEVATION_REQUIRED 740 +#define ERROR_ELEVATION_REQUIRED 740 #endif #ifndef ERROR_SYMLINK_NOT_SUPPORTED -# define ERROR_SYMLINK_NOT_SUPPORTED 1464 +#define ERROR_SYMLINK_NOT_SUPPORTED 1464 #endif #ifndef ERROR_MUI_FILE_NOT_FOUND -# define ERROR_MUI_FILE_NOT_FOUND 15100 +#define ERROR_MUI_FILE_NOT_FOUND 15100 #endif #ifndef ERROR_MUI_INVALID_FILE -# define ERROR_MUI_INVALID_FILE 15101 +#define ERROR_MUI_INVALID_FILE 15101 #endif #ifndef ERROR_MUI_INVALID_RC_CONFIG -# define ERROR_MUI_INVALID_RC_CONFIG 15102 +#define ERROR_MUI_INVALID_RC_CONFIG 15102 #endif #ifndef ERROR_MUI_INVALID_LOCALE_NAME -# define ERROR_MUI_INVALID_LOCALE_NAME 15103 +#define ERROR_MUI_INVALID_LOCALE_NAME 15103 #endif #ifndef ERROR_MUI_INVALID_ULTIMATEFALLBACK_NAME -# define ERROR_MUI_INVALID_ULTIMATEFALLBACK_NAME 15104 +#define ERROR_MUI_INVALID_ULTIMATEFALLBACK_NAME 15104 #endif #ifndef ERROR_MUI_FILE_NOT_LOADED -# define ERROR_MUI_FILE_NOT_LOADED 15105 +#define ERROR_MUI_FILE_NOT_LOADED 15105 #endif -typedef BOOL (WINAPI *sGetQueuedCompletionStatusEx) - (HANDLE CompletionPort, - LPOVERLAPPED_ENTRY lpCompletionPortEntries, - ULONG ulCount, - PULONG ulNumEntriesRemoved, - DWORD dwMilliseconds, - BOOL fAlertable); +typedef BOOL(WINAPI *sGetQueuedCompletionStatusEx)( + HANDLE CompletionPort, LPOVERLAPPED_ENTRY lpCompletionPortEntries, + ULONG ulCount, PULONG ulNumEntriesRemoved, DWORD dwMilliseconds, + BOOL fAlertable); /* from powerbase.h */ #ifndef DEVICE_NOTIFY_CALLBACK -# define DEVICE_NOTIFY_CALLBACK 2 +#define DEVICE_NOTIFY_CALLBACK 2 #endif #ifndef PBT_APMRESUMEAUTOMATIC -# define PBT_APMRESUMEAUTOMATIC 18 +#define PBT_APMRESUMEAUTOMATIC 18 #endif #ifndef PBT_APMRESUMESUSPEND -# define PBT_APMRESUMESUSPEND 7 +#define PBT_APMRESUMESUSPEND 7 #endif -typedef ULONG CALLBACK _DEVICE_NOTIFY_CALLBACK_ROUTINE( - PVOID Context, - ULONG Type, - PVOID Setting -); -typedef _DEVICE_NOTIFY_CALLBACK_ROUTINE* _PDEVICE_NOTIFY_CALLBACK_ROUTINE; +typedef ULONG CALLBACK _DEVICE_NOTIFY_CALLBACK_ROUTINE(PVOID Context, + ULONG Type, + PVOID Setting); +typedef _DEVICE_NOTIFY_CALLBACK_ROUTINE *_PDEVICE_NOTIFY_CALLBACK_ROUTINE; typedef struct _DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS { _PDEVICE_NOTIFY_CALLBACK_ROUTINE Callback; @@ -4702,41 +4673,31 @@ typedef struct _DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS { typedef PVOID _HPOWERNOTIFY; typedef _HPOWERNOTIFY *_PHPOWERNOTIFY; -typedef DWORD (WINAPI *sPowerRegisterSuspendResumeNotification) - (DWORD Flags, - HANDLE Recipient, - _PHPOWERNOTIFY RegistrationHandle); +typedef DWORD(WINAPI *sPowerRegisterSuspendResumeNotification)( + DWORD Flags, HANDLE Recipient, _PHPOWERNOTIFY RegistrationHandle); /* from Winuser.h */ -typedef VOID (CALLBACK* WINEVENTPROC) - (HWINEVENTHOOK hWinEventHook, - DWORD event, - HWND hwnd, - LONG idObject, - LONG idChild, - DWORD idEventThread, - DWORD dwmsEventTime); - -typedef HWINEVENTHOOK (WINAPI *sSetWinEventHook) - (UINT eventMin, - UINT eventMax, - HMODULE hmodWinEventProc, - WINEVENTPROC lpfnWinEventProc, - DWORD idProcess, - DWORD idThread, - UINT dwflags); +typedef VOID(CALLBACK *WINEVENTPROC)(HWINEVENTHOOK hWinEventHook, DWORD event, + HWND hwnd, LONG idObject, LONG idChild, + DWORD idEventThread, DWORD dwmsEventTime); + +typedef HWINEVENTHOOK(WINAPI *sSetWinEventHook)(UINT eventMin, UINT eventMax, + HMODULE hmodWinEventProc, + WINEVENTPROC lpfnWinEventProc, + DWORD idProcess, DWORD idThread, + UINT dwflags); /* From mstcpip.h */ typedef struct _TCP_INITIAL_RTO_PARAMETERS { USHORT Rtt; - UCHAR MaxSynRetransmissions; + UCHAR MaxSynRetransmissions; } TCP_INITIAL_RTO_PARAMETERS, *PTCP_INITIAL_RTO_PARAMETERS; #ifndef TCP_INITIAL_RTO_NO_SYN_RETRANSMISSIONS -# define TCP_INITIAL_RTO_NO_SYN_RETRANSMISSIONS ((UCHAR) -2) +#define TCP_INITIAL_RTO_NO_SYN_RETRANSMISSIONS ((UCHAR) - 2) #endif #ifndef SIO_TCP_INITIAL_RTO -# define SIO_TCP_INITIAL_RTO _WSAIOW(IOC_VENDOR,17) +#define SIO_TCP_INITIAL_RTO _WSAIOW(IOC_VENDOR, 17) #endif /* Ntdll function pointers */ @@ -4754,16 +4715,15 @@ extern sNtQueryInformationProcess pNtQueryInformationProcess; extern sGetQueuedCompletionStatusEx pGetQueuedCompletionStatusEx; /* Powrprof.dll function pointer */ -extern sPowerRegisterSuspendResumeNotification pPowerRegisterSuspendResumeNotification; +extern sPowerRegisterSuspendResumeNotification + pPowerRegisterSuspendResumeNotification; /* User32.dll function pointer */ extern sSetWinEventHook pSetWinEventHook; /* ws2_32.dll function pointer */ /* mingw doesn't have this definition, so let's declare it here locally */ -typedef int (WINAPI *uv_sGetHostNameW) - (PWSTR, - int); +typedef int(WINAPI *uv_sGetHostNameW)(PWSTR, int); extern uv_sGetHostNameW pGetHostNameW; #endif /* UV_WIN_WINAPI_H_ */ diff --git a/src/libuv/src/win/winsock.h b/src/libuv/src/win/winsock.h index 2af958870..6147833d0 100644 --- a/src/libuv/src/win/winsock.h +++ b/src/libuv/src/win/winsock.h @@ -22,44 +22,43 @@ #ifndef UV_WIN_WINSOCK_H_ #define UV_WIN_WINSOCK_H_ -#include #include #include -#include #include +#include +#include #include "winapi.h" - /* * MinGW is missing these too */ #ifndef SO_UPDATE_CONNECT_CONTEXT -# define SO_UPDATE_CONNECT_CONTEXT 0x7010 +#define SO_UPDATE_CONNECT_CONTEXT 0x7010 #endif #ifndef TCP_KEEPALIVE -# define TCP_KEEPALIVE 3 +#define TCP_KEEPALIVE 3 #endif #ifndef IPV6_V6ONLY -# define IPV6_V6ONLY 27 +#define IPV6_V6ONLY 27 #endif #ifndef IPV6_HOPLIMIT -# define IPV6_HOPLIMIT 21 +#define IPV6_HOPLIMIT 21 #endif #ifndef SIO_BASE_HANDLE -# define SIO_BASE_HANDLE 0x48000022 +#define SIO_BASE_HANDLE 0x48000022 #endif #ifndef MCAST_JOIN_SOURCE_GROUP -# define MCAST_JOIN_SOURCE_GROUP 45 +#define MCAST_JOIN_SOURCE_GROUP 45 #endif #ifndef MCAST_LEAVE_SOURCE_GROUP -# define MCAST_LEAVE_SOURCE_GROUP 46 +#define MCAST_LEAVE_SOURCE_GROUP 46 #endif /* @@ -67,19 +66,19 @@ * We only need receive flags so far. */ #ifndef TDI_RECEIVE_NORMAL - #define TDI_RECEIVE_BROADCAST 0x00000004 - #define TDI_RECEIVE_MULTICAST 0x00000008 - #define TDI_RECEIVE_PARTIAL 0x00000010 - #define TDI_RECEIVE_NORMAL 0x00000020 - #define TDI_RECEIVE_EXPEDITED 0x00000040 - #define TDI_RECEIVE_PEEK 0x00000080 - #define TDI_RECEIVE_NO_RESPONSE_EXP 0x00000100 - #define TDI_RECEIVE_COPY_LOOKAHEAD 0x00000200 - #define TDI_RECEIVE_ENTIRE_MESSAGE 0x00000400 - #define TDI_RECEIVE_AT_DISPATCH_LEVEL 0x00000800 - #define TDI_RECEIVE_CONTROL_INFO 0x00001000 - #define TDI_RECEIVE_FORCE_INDICATION 0x00002000 - #define TDI_RECEIVE_NO_PUSH 0x00004000 +#define TDI_RECEIVE_BROADCAST 0x00000004 +#define TDI_RECEIVE_MULTICAST 0x00000008 +#define TDI_RECEIVE_PARTIAL 0x00000010 +#define TDI_RECEIVE_NORMAL 0x00000020 +#define TDI_RECEIVE_EXPEDITED 0x00000040 +#define TDI_RECEIVE_PEEK 0x00000080 +#define TDI_RECEIVE_NO_RESPONSE_EXP 0x00000100 +#define TDI_RECEIVE_COPY_LOOKAHEAD 0x00000200 +#define TDI_RECEIVE_ENTIRE_MESSAGE 0x00000400 +#define TDI_RECEIVE_AT_DISPATCH_LEVEL 0x00000800 +#define TDI_RECEIVE_CONTROL_INFO 0x00001000 +#define TDI_RECEIVE_FORCE_INDICATION 0x00002000 +#define TDI_RECEIVE_NO_PUSH 0x00004000 #endif /* @@ -89,70 +88,67 @@ * call directly, avoiding a bug in winsock's recvfrom implementation. */ -#define AFD_NO_FAST_IO 0x00000001 -#define AFD_OVERLAPPED 0x00000002 -#define AFD_IMMEDIATE 0x00000004 - -#define AFD_POLL_RECEIVE_BIT 0 -#define AFD_POLL_RECEIVE (1 << AFD_POLL_RECEIVE_BIT) -#define AFD_POLL_RECEIVE_EXPEDITED_BIT 1 -#define AFD_POLL_RECEIVE_EXPEDITED (1 << AFD_POLL_RECEIVE_EXPEDITED_BIT) -#define AFD_POLL_SEND_BIT 2 -#define AFD_POLL_SEND (1 << AFD_POLL_SEND_BIT) -#define AFD_POLL_DISCONNECT_BIT 3 -#define AFD_POLL_DISCONNECT (1 << AFD_POLL_DISCONNECT_BIT) -#define AFD_POLL_ABORT_BIT 4 -#define AFD_POLL_ABORT (1 << AFD_POLL_ABORT_BIT) -#define AFD_POLL_LOCAL_CLOSE_BIT 5 -#define AFD_POLL_LOCAL_CLOSE (1 << AFD_POLL_LOCAL_CLOSE_BIT) -#define AFD_POLL_CONNECT_BIT 6 -#define AFD_POLL_CONNECT (1 << AFD_POLL_CONNECT_BIT) -#define AFD_POLL_ACCEPT_BIT 7 -#define AFD_POLL_ACCEPT (1 << AFD_POLL_ACCEPT_BIT) -#define AFD_POLL_CONNECT_FAIL_BIT 8 -#define AFD_POLL_CONNECT_FAIL (1 << AFD_POLL_CONNECT_FAIL_BIT) -#define AFD_POLL_QOS_BIT 9 -#define AFD_POLL_QOS (1 << AFD_POLL_QOS_BIT) -#define AFD_POLL_GROUP_QOS_BIT 10 -#define AFD_POLL_GROUP_QOS (1 << AFD_POLL_GROUP_QOS_BIT) - -#define AFD_NUM_POLL_EVENTS 11 -#define AFD_POLL_ALL ((1 << AFD_NUM_POLL_EVENTS) - 1) +#define AFD_NO_FAST_IO 0x00000001 +#define AFD_OVERLAPPED 0x00000002 +#define AFD_IMMEDIATE 0x00000004 + +#define AFD_POLL_RECEIVE_BIT 0 +#define AFD_POLL_RECEIVE (1 << AFD_POLL_RECEIVE_BIT) +#define AFD_POLL_RECEIVE_EXPEDITED_BIT 1 +#define AFD_POLL_RECEIVE_EXPEDITED (1 << AFD_POLL_RECEIVE_EXPEDITED_BIT) +#define AFD_POLL_SEND_BIT 2 +#define AFD_POLL_SEND (1 << AFD_POLL_SEND_BIT) +#define AFD_POLL_DISCONNECT_BIT 3 +#define AFD_POLL_DISCONNECT (1 << AFD_POLL_DISCONNECT_BIT) +#define AFD_POLL_ABORT_BIT 4 +#define AFD_POLL_ABORT (1 << AFD_POLL_ABORT_BIT) +#define AFD_POLL_LOCAL_CLOSE_BIT 5 +#define AFD_POLL_LOCAL_CLOSE (1 << AFD_POLL_LOCAL_CLOSE_BIT) +#define AFD_POLL_CONNECT_BIT 6 +#define AFD_POLL_CONNECT (1 << AFD_POLL_CONNECT_BIT) +#define AFD_POLL_ACCEPT_BIT 7 +#define AFD_POLL_ACCEPT (1 << AFD_POLL_ACCEPT_BIT) +#define AFD_POLL_CONNECT_FAIL_BIT 8 +#define AFD_POLL_CONNECT_FAIL (1 << AFD_POLL_CONNECT_FAIL_BIT) +#define AFD_POLL_QOS_BIT 9 +#define AFD_POLL_QOS (1 << AFD_POLL_QOS_BIT) +#define AFD_POLL_GROUP_QOS_BIT 10 +#define AFD_POLL_GROUP_QOS (1 << AFD_POLL_GROUP_QOS_BIT) + +#define AFD_NUM_POLL_EVENTS 11 +#define AFD_POLL_ALL ((1 << AFD_NUM_POLL_EVENTS) - 1) typedef struct _AFD_RECV_DATAGRAM_INFO { - LPWSABUF BufferArray; - ULONG BufferCount; - ULONG AfdFlags; - ULONG TdiFlags; - struct sockaddr* Address; - int* AddressLength; + LPWSABUF BufferArray; + ULONG BufferCount; + ULONG AfdFlags; + ULONG TdiFlags; + struct sockaddr *Address; + int *AddressLength; } AFD_RECV_DATAGRAM_INFO, *PAFD_RECV_DATAGRAM_INFO; typedef struct _AFD_RECV_INFO { - LPWSABUF BufferArray; - ULONG BufferCount; - ULONG AfdFlags; - ULONG TdiFlags; + LPWSABUF BufferArray; + ULONG BufferCount; + ULONG AfdFlags; + ULONG TdiFlags; } AFD_RECV_INFO, *PAFD_RECV_INFO; - -#define _AFD_CONTROL_CODE(operation, method) \ - ((FSCTL_AFD_BASE) << 12 | (operation << 2) | method) +#define _AFD_CONTROL_CODE(operation, method) \ + ((FSCTL_AFD_BASE) << 12 | (operation << 2) | method) #define FSCTL_AFD_BASE FILE_DEVICE_NETWORK -#define AFD_RECEIVE 5 -#define AFD_RECEIVE_DATAGRAM 6 -#define AFD_POLL 9 +#define AFD_RECEIVE 5 +#define AFD_RECEIVE_DATAGRAM 6 +#define AFD_POLL 9 -#define IOCTL_AFD_RECEIVE \ - _AFD_CONTROL_CODE(AFD_RECEIVE, METHOD_NEITHER) +#define IOCTL_AFD_RECEIVE _AFD_CONTROL_CODE(AFD_RECEIVE, METHOD_NEITHER) -#define IOCTL_AFD_RECEIVE_DATAGRAM \ - _AFD_CONTROL_CODE(AFD_RECEIVE_DATAGRAM, METHOD_NEITHER) +#define IOCTL_AFD_RECEIVE_DATAGRAM \ + _AFD_CONTROL_CODE(AFD_RECEIVE_DATAGRAM, METHOD_NEITHER) -#define IOCTL_AFD_POLL \ - _AFD_CONTROL_CODE(AFD_POLL, METHOD_BUFFERED) +#define IOCTL_AFD_POLL _AFD_CONTROL_CODE(AFD_POLL, METHOD_BUFFERED) #if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) typedef struct _IP_ADAPTER_UNICAST_ADDRESS_XP { @@ -172,7 +168,7 @@ typedef struct _IP_ADAPTER_UNICAST_ADDRESS_XP { ULONG ValidLifetime; ULONG PreferredLifetime; ULONG LeaseLifetime; -} IP_ADAPTER_UNICAST_ADDRESS_XP,*PIP_ADAPTER_UNICAST_ADDRESS_XP; +} IP_ADAPTER_UNICAST_ADDRESS_XP, *PIP_ADAPTER_UNICAST_ADDRESS_XP; typedef struct _IP_ADAPTER_UNICAST_ADDRESS_LH { union { @@ -191,11 +187,11 @@ typedef struct _IP_ADAPTER_UNICAST_ADDRESS_LH { ULONG PreferredLifetime; ULONG LeaseLifetime; UINT8 OnLinkPrefixLength; -} IP_ADAPTER_UNICAST_ADDRESS_LH,*PIP_ADAPTER_UNICAST_ADDRESS_LH; +} IP_ADAPTER_UNICAST_ADDRESS_LH, *PIP_ADAPTER_UNICAST_ADDRESS_LH; #endif -int uv__convert_to_localhost_if_unspecified(const struct sockaddr* addr, - struct sockaddr_storage* storage); +int uv__convert_to_localhost_if_unspecified(const struct sockaddr *addr, + struct sockaddr_storage *storage); #endif /* UV_WIN_WINSOCK_H_ */ diff --git a/src/libuv/test/benchmark-list.h b/src/libuv/test/benchmark-list.h index 71e4eab9a..8cbd864d7 100644 --- a/src/libuv/test/benchmark-list.h +++ b/src/libuv/test/benchmark-list.h @@ -19,145 +19,145 @@ * IN THE SOFTWARE. */ -BENCHMARK_DECLARE (sizes) -BENCHMARK_DECLARE (loop_count) -BENCHMARK_DECLARE (loop_count_timed) -BENCHMARK_DECLARE (ping_pongs) -BENCHMARK_DECLARE (ping_udp) -BENCHMARK_DECLARE (tcp_write_batch) -BENCHMARK_DECLARE (tcp4_pound_100) -BENCHMARK_DECLARE (tcp4_pound_1000) -BENCHMARK_DECLARE (pipe_pound_100) -BENCHMARK_DECLARE (pipe_pound_1000) -BENCHMARK_DECLARE (tcp_pump100_client) -BENCHMARK_DECLARE (tcp_pump1_client) -BENCHMARK_DECLARE (pipe_pump100_client) -BENCHMARK_DECLARE (pipe_pump1_client) - -BENCHMARK_DECLARE (tcp_multi_accept2) -BENCHMARK_DECLARE (tcp_multi_accept4) -BENCHMARK_DECLARE (tcp_multi_accept8) +BENCHMARK_DECLARE(sizes) +BENCHMARK_DECLARE(loop_count) +BENCHMARK_DECLARE(loop_count_timed) +BENCHMARK_DECLARE(ping_pongs) +BENCHMARK_DECLARE(ping_udp) +BENCHMARK_DECLARE(tcp_write_batch) +BENCHMARK_DECLARE(tcp4_pound_100) +BENCHMARK_DECLARE(tcp4_pound_1000) +BENCHMARK_DECLARE(pipe_pound_100) +BENCHMARK_DECLARE(pipe_pound_1000) +BENCHMARK_DECLARE(tcp_pump100_client) +BENCHMARK_DECLARE(tcp_pump1_client) +BENCHMARK_DECLARE(pipe_pump100_client) +BENCHMARK_DECLARE(pipe_pump1_client) + +BENCHMARK_DECLARE(tcp_multi_accept2) +BENCHMARK_DECLARE(tcp_multi_accept4) +BENCHMARK_DECLARE(tcp_multi_accept8) /* Run until X packets have been sent/received. */ -BENCHMARK_DECLARE (udp_pummel_1v1) -BENCHMARK_DECLARE (udp_pummel_1v10) -BENCHMARK_DECLARE (udp_pummel_1v100) -BENCHMARK_DECLARE (udp_pummel_1v1000) -BENCHMARK_DECLARE (udp_pummel_10v10) -BENCHMARK_DECLARE (udp_pummel_10v100) -BENCHMARK_DECLARE (udp_pummel_10v1000) -BENCHMARK_DECLARE (udp_pummel_100v100) -BENCHMARK_DECLARE (udp_pummel_100v1000) -BENCHMARK_DECLARE (udp_pummel_1000v1000) +BENCHMARK_DECLARE(udp_pummel_1v1) +BENCHMARK_DECLARE(udp_pummel_1v10) +BENCHMARK_DECLARE(udp_pummel_1v100) +BENCHMARK_DECLARE(udp_pummel_1v1000) +BENCHMARK_DECLARE(udp_pummel_10v10) +BENCHMARK_DECLARE(udp_pummel_10v100) +BENCHMARK_DECLARE(udp_pummel_10v1000) +BENCHMARK_DECLARE(udp_pummel_100v100) +BENCHMARK_DECLARE(udp_pummel_100v1000) +BENCHMARK_DECLARE(udp_pummel_1000v1000) /* Run until X seconds have elapsed. */ -BENCHMARK_DECLARE (udp_timed_pummel_1v1) -BENCHMARK_DECLARE (udp_timed_pummel_1v10) -BENCHMARK_DECLARE (udp_timed_pummel_1v100) -BENCHMARK_DECLARE (udp_timed_pummel_1v1000) -BENCHMARK_DECLARE (udp_timed_pummel_10v10) -BENCHMARK_DECLARE (udp_timed_pummel_10v100) -BENCHMARK_DECLARE (udp_timed_pummel_10v1000) -BENCHMARK_DECLARE (udp_timed_pummel_100v100) -BENCHMARK_DECLARE (udp_timed_pummel_100v1000) -BENCHMARK_DECLARE (udp_timed_pummel_1000v1000) - -BENCHMARK_DECLARE (getaddrinfo) -BENCHMARK_DECLARE (fs_stat) -BENCHMARK_DECLARE (async1) -BENCHMARK_DECLARE (async2) -BENCHMARK_DECLARE (async4) -BENCHMARK_DECLARE (async8) -BENCHMARK_DECLARE (async_pummel_1) -BENCHMARK_DECLARE (async_pummel_2) -BENCHMARK_DECLARE (async_pummel_4) -BENCHMARK_DECLARE (async_pummel_8) -BENCHMARK_DECLARE (spawn) -BENCHMARK_DECLARE (thread_create) -BENCHMARK_DECLARE (million_async) -BENCHMARK_DECLARE (million_timers) -HELPER_DECLARE (tcp4_blackhole_server) -HELPER_DECLARE (tcp_pump_server) -HELPER_DECLARE (pipe_pump_server) -HELPER_DECLARE (tcp4_echo_server) -HELPER_DECLARE (pipe_echo_server) +BENCHMARK_DECLARE(udp_timed_pummel_1v1) +BENCHMARK_DECLARE(udp_timed_pummel_1v10) +BENCHMARK_DECLARE(udp_timed_pummel_1v100) +BENCHMARK_DECLARE(udp_timed_pummel_1v1000) +BENCHMARK_DECLARE(udp_timed_pummel_10v10) +BENCHMARK_DECLARE(udp_timed_pummel_10v100) +BENCHMARK_DECLARE(udp_timed_pummel_10v1000) +BENCHMARK_DECLARE(udp_timed_pummel_100v100) +BENCHMARK_DECLARE(udp_timed_pummel_100v1000) +BENCHMARK_DECLARE(udp_timed_pummel_1000v1000) + +BENCHMARK_DECLARE(getaddrinfo) +BENCHMARK_DECLARE(fs_stat) +BENCHMARK_DECLARE(async1) +BENCHMARK_DECLARE(async2) +BENCHMARK_DECLARE(async4) +BENCHMARK_DECLARE(async8) +BENCHMARK_DECLARE(async_pummel_1) +BENCHMARK_DECLARE(async_pummel_2) +BENCHMARK_DECLARE(async_pummel_4) +BENCHMARK_DECLARE(async_pummel_8) +BENCHMARK_DECLARE(spawn) +BENCHMARK_DECLARE(thread_create) +BENCHMARK_DECLARE(million_async) +BENCHMARK_DECLARE(million_timers) +HELPER_DECLARE(tcp4_blackhole_server) +HELPER_DECLARE(tcp_pump_server) +HELPER_DECLARE(pipe_pump_server) +HELPER_DECLARE(tcp4_echo_server) +HELPER_DECLARE(pipe_echo_server) TASK_LIST_START - BENCHMARK_ENTRY (sizes) - BENCHMARK_ENTRY (loop_count) - BENCHMARK_ENTRY (loop_count_timed) - - BENCHMARK_ENTRY (ping_pongs) - BENCHMARK_HELPER (ping_pongs, tcp4_echo_server) - - BENCHMARK_ENTRY (tcp_write_batch) - BENCHMARK_HELPER (tcp_write_batch, tcp4_blackhole_server) - - BENCHMARK_ENTRY (tcp_pump100_client) - BENCHMARK_HELPER (tcp_pump100_client, tcp_pump_server) - - BENCHMARK_ENTRY (tcp_pump1_client) - BENCHMARK_HELPER (tcp_pump1_client, tcp_pump_server) - - BENCHMARK_ENTRY (tcp4_pound_100) - BENCHMARK_HELPER (tcp4_pound_100, tcp4_echo_server) - - BENCHMARK_ENTRY (tcp4_pound_1000) - BENCHMARK_HELPER (tcp4_pound_1000, tcp4_echo_server) - - BENCHMARK_ENTRY (pipe_pump100_client) - BENCHMARK_HELPER (pipe_pump100_client, pipe_pump_server) - - BENCHMARK_ENTRY (pipe_pump1_client) - BENCHMARK_HELPER (pipe_pump1_client, pipe_pump_server) - - BENCHMARK_ENTRY (pipe_pound_100) - BENCHMARK_HELPER (pipe_pound_100, pipe_echo_server) - - BENCHMARK_ENTRY (pipe_pound_1000) - BENCHMARK_HELPER (pipe_pound_1000, pipe_echo_server) - - BENCHMARK_ENTRY (tcp_multi_accept2) - BENCHMARK_ENTRY (tcp_multi_accept4) - BENCHMARK_ENTRY (tcp_multi_accept8) - - BENCHMARK_ENTRY (udp_pummel_1v1) - BENCHMARK_ENTRY (udp_pummel_1v10) - BENCHMARK_ENTRY (udp_pummel_1v100) - BENCHMARK_ENTRY (udp_pummel_1v1000) - BENCHMARK_ENTRY (udp_pummel_10v10) - BENCHMARK_ENTRY (udp_pummel_10v100) - BENCHMARK_ENTRY (udp_pummel_10v1000) - BENCHMARK_ENTRY (udp_pummel_100v100) - BENCHMARK_ENTRY (udp_pummel_100v1000) - BENCHMARK_ENTRY (udp_pummel_1000v1000) - - BENCHMARK_ENTRY (udp_timed_pummel_1v1) - BENCHMARK_ENTRY (udp_timed_pummel_1v10) - BENCHMARK_ENTRY (udp_timed_pummel_1v100) - BENCHMARK_ENTRY (udp_timed_pummel_1v1000) - BENCHMARK_ENTRY (udp_timed_pummel_10v10) - BENCHMARK_ENTRY (udp_timed_pummel_10v100) - BENCHMARK_ENTRY (udp_timed_pummel_10v1000) - BENCHMARK_ENTRY (udp_timed_pummel_100v100) - BENCHMARK_ENTRY (udp_timed_pummel_100v1000) - BENCHMARK_ENTRY (udp_timed_pummel_1000v1000) - - BENCHMARK_ENTRY (getaddrinfo) - - BENCHMARK_ENTRY (fs_stat) - - BENCHMARK_ENTRY (async1) - BENCHMARK_ENTRY (async2) - BENCHMARK_ENTRY (async4) - BENCHMARK_ENTRY (async8) - BENCHMARK_ENTRY (async_pummel_1) - BENCHMARK_ENTRY (async_pummel_2) - BENCHMARK_ENTRY (async_pummel_4) - BENCHMARK_ENTRY (async_pummel_8) - - BENCHMARK_ENTRY (spawn) - BENCHMARK_ENTRY (thread_create) - BENCHMARK_ENTRY (million_async) - BENCHMARK_ENTRY (million_timers) +BENCHMARK_ENTRY(sizes) +BENCHMARK_ENTRY(loop_count) +BENCHMARK_ENTRY(loop_count_timed) + +BENCHMARK_ENTRY(ping_pongs) +BENCHMARK_HELPER(ping_pongs, tcp4_echo_server) + +BENCHMARK_ENTRY(tcp_write_batch) +BENCHMARK_HELPER(tcp_write_batch, tcp4_blackhole_server) + +BENCHMARK_ENTRY(tcp_pump100_client) +BENCHMARK_HELPER(tcp_pump100_client, tcp_pump_server) + +BENCHMARK_ENTRY(tcp_pump1_client) +BENCHMARK_HELPER(tcp_pump1_client, tcp_pump_server) + +BENCHMARK_ENTRY(tcp4_pound_100) +BENCHMARK_HELPER(tcp4_pound_100, tcp4_echo_server) + +BENCHMARK_ENTRY(tcp4_pound_1000) +BENCHMARK_HELPER(tcp4_pound_1000, tcp4_echo_server) + +BENCHMARK_ENTRY(pipe_pump100_client) +BENCHMARK_HELPER(pipe_pump100_client, pipe_pump_server) + +BENCHMARK_ENTRY(pipe_pump1_client) +BENCHMARK_HELPER(pipe_pump1_client, pipe_pump_server) + +BENCHMARK_ENTRY(pipe_pound_100) +BENCHMARK_HELPER(pipe_pound_100, pipe_echo_server) + +BENCHMARK_ENTRY(pipe_pound_1000) +BENCHMARK_HELPER(pipe_pound_1000, pipe_echo_server) + +BENCHMARK_ENTRY(tcp_multi_accept2) +BENCHMARK_ENTRY(tcp_multi_accept4) +BENCHMARK_ENTRY(tcp_multi_accept8) + +BENCHMARK_ENTRY(udp_pummel_1v1) +BENCHMARK_ENTRY(udp_pummel_1v10) +BENCHMARK_ENTRY(udp_pummel_1v100) +BENCHMARK_ENTRY(udp_pummel_1v1000) +BENCHMARK_ENTRY(udp_pummel_10v10) +BENCHMARK_ENTRY(udp_pummel_10v100) +BENCHMARK_ENTRY(udp_pummel_10v1000) +BENCHMARK_ENTRY(udp_pummel_100v100) +BENCHMARK_ENTRY(udp_pummel_100v1000) +BENCHMARK_ENTRY(udp_pummel_1000v1000) + +BENCHMARK_ENTRY(udp_timed_pummel_1v1) +BENCHMARK_ENTRY(udp_timed_pummel_1v10) +BENCHMARK_ENTRY(udp_timed_pummel_1v100) +BENCHMARK_ENTRY(udp_timed_pummel_1v1000) +BENCHMARK_ENTRY(udp_timed_pummel_10v10) +BENCHMARK_ENTRY(udp_timed_pummel_10v100) +BENCHMARK_ENTRY(udp_timed_pummel_10v1000) +BENCHMARK_ENTRY(udp_timed_pummel_100v100) +BENCHMARK_ENTRY(udp_timed_pummel_100v1000) +BENCHMARK_ENTRY(udp_timed_pummel_1000v1000) + +BENCHMARK_ENTRY(getaddrinfo) + +BENCHMARK_ENTRY(fs_stat) + +BENCHMARK_ENTRY(async1) +BENCHMARK_ENTRY(async2) +BENCHMARK_ENTRY(async4) +BENCHMARK_ENTRY(async8) +BENCHMARK_ENTRY(async_pummel_1) +BENCHMARK_ENTRY(async_pummel_2) +BENCHMARK_ENTRY(async_pummel_4) +BENCHMARK_ENTRY(async_pummel_8) + +BENCHMARK_ENTRY(spawn) +BENCHMARK_ENTRY(thread_create) +BENCHMARK_ENTRY(million_async) +BENCHMARK_ENTRY(million_timers) TASK_LIST_END diff --git a/src/libuv/test/runner-unix.h b/src/libuv/test/runner-unix.h index e21847f92..b9e46f34a 100644 --- a/src/libuv/test/runner-unix.h +++ b/src/libuv/test/runner-unix.h @@ -22,15 +22,15 @@ #ifndef TEST_RUNNER_UNIX_H #define TEST_RUNNER_UNIX_H -#include #include /* FILE */ +#include typedef struct { - FILE* stdout_file; + FILE *stdout_file; pid_t pid; - char* name; + char *name; int status; int terminated; } process_info_t; -#endif /* TEST_RUNNER_UNIX_H */ +#endif /* TEST_RUNNER_UNIX_H */ diff --git a/src/libuv/test/runner-win.h b/src/libuv/test/runner-win.h index 975eed793..c81ce398a 100644 --- a/src/libuv/test/runner-win.h +++ b/src/libuv/test/runner-win.h @@ -24,13 +24,12 @@ #pragma warning(disable : 4996) #endif - -#include -#include #include +#include +#include #if !defined(snprintf) && defined(_MSC_VER) && _MSC_VER < 1900 -extern int snprintf(char*, size_t, const char*, ...); +extern int snprintf(char *, size_t, const char *, ...); #endif typedef struct { diff --git a/src/libuv/test/runner.h b/src/libuv/test/runner.h index 6801564f9..8c255d5af 100644 --- a/src/libuv/test/runner.h +++ b/src/libuv/test/runner.h @@ -23,8 +23,7 @@ #define RUNNER_H_ #include /* PATH_MAX */ -#include /* FILE */ - +#include /* FILE */ /* * The maximum number of processes (main + helpers) that a test / benchmark @@ -32,7 +31,6 @@ */ #define MAX_PROCESSES 8 - /* * Struct to store both tests and to define helper processes for tasks. */ @@ -49,40 +47,35 @@ typedef struct { int timeout; } task_entry_t, bench_entry_t; - /* * Macros used by test-list.h and benchmark-list.h. */ -#define TASK_LIST_START \ - task_entry_t TASKS[] = { +#define TASK_LIST_START task_entry_t TASKS[] = { -#define TASK_LIST_END \ +#define TASK_LIST_END \ { 0, 0, 0, 0, 0, 0 } \ - }; + } \ + ; -#define TEST_DECLARE(name) \ - int run_test_##name(void); +#define TEST_DECLARE(name) int run_test_##name(void); -#define TEST_ENTRY(name) \ - { #name, #name, &run_test_##name, 0, 0, 5000 }, +#define TEST_ENTRY(name) {#name, #name, &run_test_##name, 0, 0, 5000}, -#define TEST_ENTRY_CUSTOM(name, is_helper, show_output, timeout) \ - { #name, #name, &run_test_##name, is_helper, show_output, timeout }, +#define TEST_ENTRY_CUSTOM(name, is_helper, show_output, timeout) \ + {#name, #name, &run_test_##name, is_helper, show_output, timeout}, -#define BENCHMARK_DECLARE(name) \ - int run_benchmark_##name(void); +#define BENCHMARK_DECLARE(name) int run_benchmark_##name(void); -#define BENCHMARK_ENTRY(name) \ - { #name, #name, &run_benchmark_##name, 0, 0, 60000 }, +#define BENCHMARK_ENTRY(name) \ + {#name, #name, &run_benchmark_##name, 0, 0, 60000}, -#define HELPER_DECLARE(name) \ - int run_helper_##name(void); +#define HELPER_DECLARE(name) int run_helper_##name(void); -#define HELPER_ENTRY(task_name, name) \ - { #task_name, #name, &run_helper_##name, 1, 0, 0 }, +#define HELPER_ENTRY(task_name, name) \ + {#task_name, #name, &run_helper_##name, 1, 0, 0}, -#define TEST_HELPER HELPER_ENTRY -#define BENCHMARK_HELPER HELPER_ENTRY +#define TEST_HELPER HELPER_ENTRY +#define BENCHMARK_HELPER HELPER_ENTRY extern char executable_path[4096]; @@ -90,12 +83,11 @@ extern char executable_path[4096]; * Include platform-dependent definitions */ #ifdef _WIN32 -# include "runner-win.h" +#include "runner-win.h" #else -# include "runner-unix.h" +#include "runner-unix.h" #endif - /* The array that is filled by test-list.h or benchmark-list.h */ extern task_entry_t TASKS[]; @@ -107,23 +99,20 @@ int run_tests(int benchmark_output); /* * Run a single test. Starts up any helpers. */ -int run_test(const char* test, - int benchmark_output, - int test_count); +int run_test(const char *test, int benchmark_output, int test_count); /* * Run a test part, i.e. the test or one of its helpers. */ -int run_test_part(const char* test, const char* part); - +int run_test_part(const char *test, const char *part); /* * Print tests in sorted order to `stream`. Used by `./run-tests --list`. */ -void print_tests(FILE* stream); +void print_tests(FILE *stream); /* Print lines in |buffer| as TAP diagnostics to |stream|. */ -void print_lines(const char* buffer, size_t size, FILE* stream); +void print_lines(const char *buffer, size_t size, FILE *stream); /* * Stuff that should be implemented by test-runner-.h @@ -132,11 +121,11 @@ void print_lines(const char* buffer, size_t size, FILE* stream); */ /* Do platform-specific initialization. */ -void platform_init(int argc, char** argv); +void platform_init(int argc, char **argv); /* Invoke "argv[0] test-name [test-part]". Store process info in *p. Make sure * that all stdio output of the processes is buffered up. */ -int process_start(char *name, char* part, process_info_t *p, int is_helper); +int process_start(char *name, char *part, process_info_t *p, int is_helper); /* Wait for all `n` processes in `vec` to terminate. Time out after `timeout` * msec, or never if timeout == -1. Return 0 if all processes are terminated, @@ -147,15 +136,13 @@ int process_wait(process_info_t *vec, int n, int timeout); long int process_output_size(process_info_t *p); /* Copy the contents of the stdio output buffer to `stream`. */ -int process_copy_output(process_info_t* p, FILE* stream); +int process_copy_output(process_info_t *p, FILE *stream); /* Copy the last line of the stdio output buffer to `buffer` */ -int process_read_last_line(process_info_t *p, - char * buffer, - size_t buffer_len); +int process_read_last_line(process_info_t *p, char *buffer, size_t buffer_len); /* Return the name that was specified when `p` was started by process_start */ -char* process_get_name(process_info_t *p); +char *process_get_name(process_info_t *p); /* Terminate process `p`. */ int process_terminate(process_info_t *p); diff --git a/src/libuv/test/task.h b/src/libuv/test/task.h index 925f1b1c0..60a3ba6d8 100644 --- a/src/libuv/test/task.h +++ b/src/libuv/test/task.h @@ -24,30 +24,30 @@ #include "uv.h" -#include +#include #include +#include #include #include -#include #if defined(_MSC_VER) && _MSC_VER < 1600 -# include "uv/stdint-msvc2008.h" +#include "uv/stdint-msvc2008.h" #else -# include +#include #endif #if !defined(_WIN32) -# include -# include /* setrlimit() */ +#include /* setrlimit() */ +#include #endif #ifdef __clang__ -# pragma clang diagnostic ignored "-Wvariadic-macros" -# pragma clang diagnostic ignored "-Wc99-extensions" +#pragma clang diagnostic ignored "-Wvariadic-macros" +#pragma clang diagnostic ignored "-Wc99-extensions" #endif #ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wvariadic-macros" +#pragma GCC diagnostic ignored "-Wvariadic-macros" #endif #define TEST_PORT 9123 @@ -55,147 +55,114 @@ #define TEST_PORT_3 9125 #ifdef _WIN32 -# define TEST_PIPENAME "\\\\?\\pipe\\uv-test" -# define TEST_PIPENAME_2 "\\\\?\\pipe\\uv-test2" -# define TEST_PIPENAME_3 "\\\\?\\pipe\\uv-test3" +#define TEST_PIPENAME "\\\\?\\pipe\\uv-test" +#define TEST_PIPENAME_2 "\\\\?\\pipe\\uv-test2" +#define TEST_PIPENAME_3 "\\\\?\\pipe\\uv-test3" #else -# define TEST_PIPENAME "/tmp/uv-test-sock" -# define TEST_PIPENAME_2 "/tmp/uv-test-sock2" -# define TEST_PIPENAME_3 "/tmp/uv-test-sock3" +#define TEST_PIPENAME "/tmp/uv-test-sock" +#define TEST_PIPENAME_2 "/tmp/uv-test-sock2" +#define TEST_PIPENAME_3 "/tmp/uv-test-sock3" #endif #ifdef _WIN32 -# include -# ifndef S_IRUSR -# define S_IRUSR _S_IREAD -# endif -# ifndef S_IWUSR -# define S_IWUSR _S_IWRITE -# endif +#include +#ifndef S_IRUSR +#define S_IRUSR _S_IREAD +#endif +#ifndef S_IWUSR +#define S_IWUSR _S_IWRITE +#endif #endif #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) -#define container_of(ptr, type, member) \ - ((type *) ((char *) (ptr) - offsetof(type, member))) +#define container_of(ptr, type, member) \ + ((type *)((char *)(ptr) - offsetof(type, member))) -typedef enum { - TCP = 0, - UDP, - PIPE -} stream_type; +typedef enum { TCP = 0, UDP, PIPE } stream_type; /* Die with fatal error. */ -#define FATAL(msg) \ - do { \ - fprintf(stderr, \ - "Fatal error in %s on line %d: %s\n", \ - __FILE__, \ - __LINE__, \ - msg); \ - fflush(stderr); \ - abort(); \ +#define FATAL(msg) \ + do { \ + fprintf(stderr, "Fatal error in %s on line %d: %s\n", __FILE__, __LINE__, \ + msg); \ + fflush(stderr); \ + abort(); \ } while (0) /* Have our own assert, so we are sure it does not get optimized away in * a release build. */ -#define ASSERT(expr) \ - do { \ - if (!(expr)) { \ - fprintf(stderr, \ - "Assertion failed in %s on line %d: %s\n", \ - __FILE__, \ - __LINE__, \ - #expr); \ - abort(); \ - } \ - } while (0) - -#define ASSERT_BASE(a, operator, b, type, conv) \ - do { \ - volatile type eval_a = (type) (a); \ - volatile type eval_b = (type) (b); \ - if (!(eval_a operator eval_b)) { \ - fprintf(stderr, \ - "Assertion failed in %s on line %d: `%s %s %s` " \ - "(%"conv" %s %"conv")\n", \ - __FILE__, \ - __LINE__, \ - #a, \ - #operator, \ - #b, \ - eval_a, \ - #operator, \ - eval_b); \ - abort(); \ - } \ - } while (0) - -#define ASSERT_BASE_STR(expr, a, operator, b, type, conv) \ - do { \ - if (!(expr)) { \ - fprintf(stderr, \ - "Assertion failed in %s on line %d: `%s %s %s` " \ - "(%"conv" %s %"conv")\n", \ - __FILE__, \ - __LINE__, \ - #a, \ - #operator, \ - #b, \ - (type)a, \ - #operator, \ - (type)b); \ - abort(); \ - } \ - } while (0) - -#define ASSERT_BASE_LEN(expr, a, operator, b, conv, len) \ - do { \ - if (!(expr)) { \ - fprintf(stderr, \ - "Assertion failed in %s on line %d: `%s %s %s` " \ - "(%.*"#conv" %s %.*"#conv")\n", \ - __FILE__, \ - __LINE__, \ - #a, \ - #operator, \ - #b, \ - (int)len, \ - a, \ - #operator, \ - (int)len, \ - b); \ - abort(); \ - } \ - } while (0) - -#define ASSERT_BASE_HEX(expr, a, operator, b, size) \ - do { \ - if (!(expr)) { \ - int i; \ - unsigned char* a_ = (unsigned char*)a; \ - unsigned char* b_ = (unsigned char*)b; \ - fprintf(stderr, \ - "Assertion failed in %s on line %d: `%s %s %s` (", \ - __FILE__, \ - __LINE__, \ - #a, \ - #operator, \ - #b); \ - for (i = 0; i < size; ++i) { \ - if (i > 0) fprintf(stderr, ":"); \ - fprintf(stderr, "%02X", a_[i]); \ - } \ - fprintf(stderr, " %s ", #operator); \ - for (i = 0; i < size; ++i) { \ - if (i > 0) fprintf(stderr, ":"); \ - fprintf(stderr, "%02X", b_[i]); \ - } \ - fprintf(stderr, ")\n"); \ - abort(); \ - } \ - } while (0) +#define ASSERT(expr) \ + do { \ + if (!(expr)) { \ + fprintf(stderr, "Assertion failed in %s on line %d: %s\n", __FILE__, \ + __LINE__, #expr); \ + abort(); \ + } \ + } while (0) + +#define ASSERT_BASE(a, operator, b, type, conv) \ + do { \ + volatile type eval_a = (type)(a); \ + volatile type eval_b = (type)(b); \ + if (!(eval_a operator eval_b)) { \ + fprintf(stderr, \ + "Assertion failed in %s on line %d: `%s %s %s` " \ + "(%" conv " %s %" conv ")\n", \ + __FILE__, __LINE__, #a, #operator, #b, eval_a, #operator, \ + eval_b); \ + abort(); \ + } \ + } while (0) + +#define ASSERT_BASE_STR(expr, a, operator, b, type, conv) \ + do { \ + if (!(expr)) { \ + fprintf(stderr, \ + "Assertion failed in %s on line %d: `%s %s %s` " \ + "(%" conv " %s %" conv ")\n", \ + __FILE__, __LINE__, #a, #operator, #b, (type)a, \ + #operator,(type) b); \ + abort(); \ + } \ + } while (0) + +#define ASSERT_BASE_LEN(expr, a, operator, b, conv, len) \ + do { \ + if (!(expr)) { \ + fprintf(stderr, \ + "Assertion failed in %s on line %d: `%s %s %s` " \ + "(%.*" #conv " %s %.*" #conv ")\n", \ + __FILE__, __LINE__, #a, #operator, #b, (int)len, a, \ + #operator,(int) len, b); \ + abort(); \ + } \ + } while (0) + +#define ASSERT_BASE_HEX(expr, a, operator, b, size) \ + do { \ + if (!(expr)) { \ + int i; \ + unsigned char *a_ = (unsigned char *)a; \ + unsigned char *b_ = (unsigned char *)b; \ + fprintf(stderr, "Assertion failed in %s on line %d: `%s %s %s` (", \ + __FILE__, __LINE__, #a, #operator, #b); \ + for (i = 0; i < size; ++i) { \ + if (i > 0) \ + fprintf(stderr, ":"); \ + fprintf(stderr, "%02X", a_[i]); \ + } \ + fprintf(stderr, " %s ", #operator); \ + for (i = 0; i < size; ++i) { \ + if (i > 0) \ + fprintf(stderr, ":"); \ + fprintf(stderr, "%02X", b_[i]); \ + } \ + fprintf(stderr, ")\n"); \ + abort(); \ + } \ + } while (0) #define ASSERT_EQ(a, b) ASSERT_BASE(a, ==, b, int64_t, PRId64) #define ASSERT_GE(a, b) ASSERT_BASE(a, >=, b, int64_t, PRId64) @@ -218,134 +185,127 @@ typedef enum { #define ASSERT_DOUBLE_LT(a, b) ASSERT_BASE(a, <, b, double, "f") #define ASSERT_DOUBLE_NE(a, b) ASSERT_BASE(a, !=, b, double, "f") -#define ASSERT_STR_EQ(a, b) \ - ASSERT_BASE_STR(strcmp(a, b) == 0, a, == , b, char*, "s") +#define ASSERT_STR_EQ(a, b) \ + ASSERT_BASE_STR(strcmp(a, b) == 0, a, ==, b, char *, "s") -#define ASSERT_STR_NE(a, b) \ - ASSERT_BASE_STR(strcmp(a, b) != 0, a, !=, b, char*, "s") +#define ASSERT_STR_NE(a, b) \ + ASSERT_BASE_STR(strcmp(a, b) != 0, a, !=, b, char *, "s") -#define ASSERT_MEM_EQ(a, b, size) \ +#define ASSERT_MEM_EQ(a, b, size) \ ASSERT_BASE_LEN(memcmp(a, b, size) == 0, a, ==, b, s, size) -#define ASSERT_MEM_NE(a, b, size) \ +#define ASSERT_MEM_NE(a, b, size) \ ASSERT_BASE_LEN(memcmp(a, b, size) != 0, a, !=, b, s, size) -#define ASSERT_MEM_HEX_EQ(a, b, size) \ +#define ASSERT_MEM_HEX_EQ(a, b, size) \ ASSERT_BASE_HEX(memcmp(a, b, size) == 0, a, ==, b, size) -#define ASSERT_MEM_HEX_NE(a, b, size) \ +#define ASSERT_MEM_HEX_NE(a, b, size) \ ASSERT_BASE_HEX(memcmp(a, b, size) != 0, a, !=, b, size) -#define ASSERT_NULL(a) \ - ASSERT_BASE(a, ==, NULL, void*, "p") +#define ASSERT_NULL(a) ASSERT_BASE(a, ==, NULL, void *, "p") -#define ASSERT_NOT_NULL(a) \ - ASSERT_BASE(a, !=, NULL, void*, "p") +#define ASSERT_NOT_NULL(a) ASSERT_BASE(a, !=, NULL, void *, "p") -#define ASSERT_PTR_EQ(a, b) \ - ASSERT_BASE(a, ==, b, void*, "p") +#define ASSERT_PTR_EQ(a, b) ASSERT_BASE(a, ==, b, void *, "p") -#define ASSERT_PTR_NE(a, b) \ - ASSERT_BASE(a, !=, b, void*, "p") +#define ASSERT_PTR_NE(a, b) ASSERT_BASE(a, !=, b, void *, "p") /* This macro cleans up the main loop. This is used to avoid valgrind * warnings about memory being "leaked" by the main event loop. */ -#define MAKE_VALGRIND_HAPPY() \ - do { \ - close_loop(uv_default_loop()); \ - ASSERT(0 == uv_loop_close(uv_default_loop())); \ - uv_library_shutdown(); \ +#define MAKE_VALGRIND_HAPPY() \ + do { \ + close_loop(uv_default_loop()); \ + ASSERT(0 == uv_loop_close(uv_default_loop())); \ + uv_library_shutdown(); \ } while (0) /* Just sugar for wrapping the main() for a task or helper. */ -#define TEST_IMPL(name) \ - int run_test_##name(void); \ +#define TEST_IMPL(name) \ + int run_test_##name(void); \ int run_test_##name(void) -#define BENCHMARK_IMPL(name) \ - int run_benchmark_##name(void); \ +#define BENCHMARK_IMPL(name) \ + int run_benchmark_##name(void); \ int run_benchmark_##name(void) -#define HELPER_IMPL(name) \ - int run_helper_##name(void); \ +#define HELPER_IMPL(name) \ + int run_helper_##name(void); \ int run_helper_##name(void) /* Format big numbers nicely. WARNING: leaks memory. */ -const char* fmt(double d); +const char *fmt(double d); /* Reserved test exit codes. */ -enum test_status { - TEST_OK = 0, - TEST_SKIP = 7 -}; - -#define RETURN_OK() \ - do { \ - return TEST_OK; \ +enum test_status { TEST_OK = 0, TEST_SKIP = 7 }; + +#define RETURN_OK() \ + do { \ + return TEST_OK; \ } while (0) -#define RETURN_SKIP(explanation) \ - do { \ - fprintf(stderr, "%s\n", explanation); \ - fflush(stderr); \ - return TEST_SKIP; \ +#define RETURN_SKIP(explanation) \ + do { \ + fprintf(stderr, "%s\n", explanation); \ + fflush(stderr); \ + return TEST_SKIP; \ } while (0) #if !defined(_WIN32) -# define TEST_FILE_LIMIT(num) \ - do { \ - struct rlimit lim; \ - lim.rlim_cur = (num); \ - lim.rlim_max = lim.rlim_cur; \ - if (setrlimit(RLIMIT_NOFILE, &lim)) \ - RETURN_SKIP("File descriptor limit too low."); \ - } while (0) +#define TEST_FILE_LIMIT(num) \ + do { \ + struct rlimit lim; \ + lim.rlim_cur = (num); \ + lim.rlim_max = lim.rlim_cur; \ + if (setrlimit(RLIMIT_NOFILE, &lim)) \ + RETURN_SKIP("File descriptor limit too low."); \ + } while (0) -#else /* defined(_WIN32) */ +#else /* defined(_WIN32) */ -# define TEST_FILE_LIMIT(num) do {} while (0) +#define TEST_FILE_LIMIT(num) \ + do { \ + } while (0) #endif #if !defined(snprintf) && defined(_MSC_VER) && _MSC_VER < 1900 -extern int snprintf(char*, size_t, const char*, ...); +extern int snprintf(char *, size_t, const char *, ...); #endif -#if defined(__clang__) || \ - defined(__GNUC__) || \ - defined(__INTEL_COMPILER) -# define UNUSED __attribute__((unused)) +#if defined(__clang__) || defined(__GNUC__) || defined(__INTEL_COMPILER) +#define UNUSED __attribute__((unused)) #else -# define UNUSED +#define UNUSED #endif #if defined(_WIN32) -#define notify_parent_process() ((void) 0) +#define notify_parent_process() ((void)0) #else extern void notify_parent_process(void); #endif /* Fully close a loop */ -static void close_walk_cb(uv_handle_t* handle, void* arg) { +static void close_walk_cb(uv_handle_t *handle, void *arg) { if (!uv_is_closing(handle)) uv_close(handle, NULL); } -UNUSED static void close_loop(uv_loop_t* loop) { +UNUSED static void close_loop(uv_loop_t *loop) { uv_walk(loop, close_walk_cb, NULL); uv_run(loop, UV_RUN_DEFAULT); } UNUSED static int can_ipv6(void) { - uv_interface_address_t* addr; + uv_interface_address_t *addr; int supported; int count; int i; if (uv_interface_addresses(&addr, &count)) - return 0; /* Assume no IPv6 support on failure. */ + return 0; /* Assume no IPv6 support on failure. */ supported = 0; for (i = 0; supported == 0 && i < count; i += 1) @@ -356,22 +316,21 @@ UNUSED static int can_ipv6(void) { } #if defined(__CYGWIN__) || defined(__MSYS__) || defined(__PASE__) -# define NO_FS_EVENTS "Filesystem watching not supported on this platform." +#define NO_FS_EVENTS "Filesystem watching not supported on this platform." #endif #if defined(__MSYS__) -# define NO_SEND_HANDLE_ON_PIPE \ +#define NO_SEND_HANDLE_ON_PIPE \ "MSYS2 runtime does not support sending handles on pipes." #elif defined(__CYGWIN__) -# define NO_SEND_HANDLE_ON_PIPE \ +#define NO_SEND_HANDLE_ON_PIPE \ "Cygwin runtime does not support sending handles on pipes." #endif #if defined(__MSYS__) -# define NO_SELF_CONNECT \ - "MSYS2 runtime hangs on listen+connect in same process." +#define NO_SELF_CONNECT "MSYS2 runtime hangs on listen+connect in same process." #elif defined(__CYGWIN__) -# define NO_SELF_CONNECT \ +#define NO_SELF_CONNECT \ "Cygwin runtime hangs on listen+connect in same process." #endif diff --git a/src/libuv/test/test-list.h b/src/libuv/test/test-list.h index 1f566861a..b5df43aed 100644 --- a/src/libuv/test/test-list.h +++ b/src/libuv/test/test-list.h @@ -21,1140 +21,1140 @@ #include "uv.h" -TEST_DECLARE (platform_output) -TEST_DECLARE (callback_order) -TEST_DECLARE (close_order) -TEST_DECLARE (run_once) -TEST_DECLARE (run_nowait) -TEST_DECLARE (loop_alive) -TEST_DECLARE (loop_close) -TEST_DECLARE (loop_instant_close) -TEST_DECLARE (loop_stop) -TEST_DECLARE (loop_update_time) -TEST_DECLARE (loop_backend_timeout) -TEST_DECLARE (loop_configure) -TEST_DECLARE (default_loop_close) -TEST_DECLARE (barrier_1) -TEST_DECLARE (barrier_2) -TEST_DECLARE (barrier_3) -TEST_DECLARE (barrier_serial_thread) -TEST_DECLARE (barrier_serial_thread_single) -TEST_DECLARE (condvar_1) -TEST_DECLARE (condvar_2) -TEST_DECLARE (condvar_3) -TEST_DECLARE (condvar_4) -TEST_DECLARE (condvar_5) -TEST_DECLARE (semaphore_1) -TEST_DECLARE (semaphore_2) -TEST_DECLARE (semaphore_3) -TEST_DECLARE (tty) +TEST_DECLARE(platform_output) +TEST_DECLARE(callback_order) +TEST_DECLARE(close_order) +TEST_DECLARE(run_once) +TEST_DECLARE(run_nowait) +TEST_DECLARE(loop_alive) +TEST_DECLARE(loop_close) +TEST_DECLARE(loop_instant_close) +TEST_DECLARE(loop_stop) +TEST_DECLARE(loop_update_time) +TEST_DECLARE(loop_backend_timeout) +TEST_DECLARE(loop_configure) +TEST_DECLARE(default_loop_close) +TEST_DECLARE(barrier_1) +TEST_DECLARE(barrier_2) +TEST_DECLARE(barrier_3) +TEST_DECLARE(barrier_serial_thread) +TEST_DECLARE(barrier_serial_thread_single) +TEST_DECLARE(condvar_1) +TEST_DECLARE(condvar_2) +TEST_DECLARE(condvar_3) +TEST_DECLARE(condvar_4) +TEST_DECLARE(condvar_5) +TEST_DECLARE(semaphore_1) +TEST_DECLARE(semaphore_2) +TEST_DECLARE(semaphore_3) +TEST_DECLARE(tty) #ifdef _WIN32 -TEST_DECLARE (tty_raw) -TEST_DECLARE (tty_empty_write) -TEST_DECLARE (tty_large_write) -TEST_DECLARE (tty_raw_cancel) -TEST_DECLARE (tty_duplicate_vt100_fn_key) -TEST_DECLARE (tty_duplicate_alt_modifier_key) -TEST_DECLARE (tty_composing_character) -TEST_DECLARE (tty_cursor_up) -TEST_DECLARE (tty_cursor_down) -TEST_DECLARE (tty_cursor_forward) -TEST_DECLARE (tty_cursor_back) -TEST_DECLARE (tty_cursor_next_line) -TEST_DECLARE (tty_cursor_previous_line) -TEST_DECLARE (tty_cursor_horizontal_move_absolute) -TEST_DECLARE (tty_cursor_move_absolute) -TEST_DECLARE (tty_hide_show_cursor) -TEST_DECLARE (tty_set_cursor_shape) -TEST_DECLARE (tty_erase) -TEST_DECLARE (tty_erase_line) -TEST_DECLARE (tty_set_style) -TEST_DECLARE (tty_save_restore_cursor_position) -TEST_DECLARE (tty_full_reset) -TEST_DECLARE (tty_escape_sequence_processing) +TEST_DECLARE(tty_raw) +TEST_DECLARE(tty_empty_write) +TEST_DECLARE(tty_large_write) +TEST_DECLARE(tty_raw_cancel) +TEST_DECLARE(tty_duplicate_vt100_fn_key) +TEST_DECLARE(tty_duplicate_alt_modifier_key) +TEST_DECLARE(tty_composing_character) +TEST_DECLARE(tty_cursor_up) +TEST_DECLARE(tty_cursor_down) +TEST_DECLARE(tty_cursor_forward) +TEST_DECLARE(tty_cursor_back) +TEST_DECLARE(tty_cursor_next_line) +TEST_DECLARE(tty_cursor_previous_line) +TEST_DECLARE(tty_cursor_horizontal_move_absolute) +TEST_DECLARE(tty_cursor_move_absolute) +TEST_DECLARE(tty_hide_show_cursor) +TEST_DECLARE(tty_set_cursor_shape) +TEST_DECLARE(tty_erase) +TEST_DECLARE(tty_erase_line) +TEST_DECLARE(tty_set_style) +TEST_DECLARE(tty_save_restore_cursor_position) +TEST_DECLARE(tty_full_reset) +TEST_DECLARE(tty_escape_sequence_processing) #endif -TEST_DECLARE (tty_file) -TEST_DECLARE (tty_pty) -TEST_DECLARE (stdio_over_pipes) -TEST_DECLARE (stdio_emulate_iocp) -TEST_DECLARE (ip6_pton) -TEST_DECLARE (ip6_sin6_len) -TEST_DECLARE (connect_unspecified) -TEST_DECLARE (ipc_heavy_traffic_deadlock_bug) -TEST_DECLARE (ipc_listen_before_write) -TEST_DECLARE (ipc_listen_after_write) +TEST_DECLARE(tty_file) +TEST_DECLARE(tty_pty) +TEST_DECLARE(stdio_over_pipes) +TEST_DECLARE(stdio_emulate_iocp) +TEST_DECLARE(ip6_pton) +TEST_DECLARE(ip6_sin6_len) +TEST_DECLARE(connect_unspecified) +TEST_DECLARE(ipc_heavy_traffic_deadlock_bug) +TEST_DECLARE(ipc_listen_before_write) +TEST_DECLARE(ipc_listen_after_write) #ifndef _WIN32 -TEST_DECLARE (ipc_send_recv_pipe) -TEST_DECLARE (ipc_send_recv_pipe_inprocess) +TEST_DECLARE(ipc_send_recv_pipe) +TEST_DECLARE(ipc_send_recv_pipe_inprocess) #endif -TEST_DECLARE (ipc_send_recv_tcp) -TEST_DECLARE (ipc_send_recv_tcp_inprocess) -TEST_DECLARE (ipc_tcp_connection) -TEST_DECLARE (ipc_send_zero) +TEST_DECLARE(ipc_send_recv_tcp) +TEST_DECLARE(ipc_send_recv_tcp_inprocess) +TEST_DECLARE(ipc_tcp_connection) +TEST_DECLARE(ipc_send_zero) #ifndef _WIN32 -TEST_DECLARE (ipc_closed_handle) +TEST_DECLARE(ipc_closed_handle) #endif -TEST_DECLARE (tcp_alloc_cb_fail) -TEST_DECLARE (tcp_ping_pong) -TEST_DECLARE (tcp_ping_pong_vec) -TEST_DECLARE (tcp6_ping_pong) -TEST_DECLARE (tcp6_ping_pong_vec) -TEST_DECLARE (pipe_ping_pong) -TEST_DECLARE (pipe_ping_pong_vec) -TEST_DECLARE (delayed_accept) -TEST_DECLARE (multiple_listen) +TEST_DECLARE(tcp_alloc_cb_fail) +TEST_DECLARE(tcp_ping_pong) +TEST_DECLARE(tcp_ping_pong_vec) +TEST_DECLARE(tcp6_ping_pong) +TEST_DECLARE(tcp6_ping_pong_vec) +TEST_DECLARE(pipe_ping_pong) +TEST_DECLARE(pipe_ping_pong_vec) +TEST_DECLARE(delayed_accept) +TEST_DECLARE(multiple_listen) #ifndef _WIN32 -TEST_DECLARE (tcp_write_after_connect) +TEST_DECLARE(tcp_write_after_connect) #endif -TEST_DECLARE (tcp_writealot) -TEST_DECLARE (tcp_write_fail) -TEST_DECLARE (tcp_try_write) -TEST_DECLARE (tcp_try_write_error) -TEST_DECLARE (tcp_write_queue_order) -TEST_DECLARE (tcp_open) -TEST_DECLARE (tcp_open_twice) -TEST_DECLARE (tcp_open_bound) -TEST_DECLARE (tcp_open_connected) -TEST_DECLARE (tcp_connect_error_after_write) -TEST_DECLARE (tcp_shutdown_after_write) -TEST_DECLARE (tcp_bind_error_addrinuse_connect) -TEST_DECLARE (tcp_bind_error_addrinuse_listen) -TEST_DECLARE (tcp_bind_error_addrnotavail_1) -TEST_DECLARE (tcp_bind_error_addrnotavail_2) -TEST_DECLARE (tcp_bind_error_fault) -TEST_DECLARE (tcp_bind_error_inval) -TEST_DECLARE (tcp_bind_localhost_ok) -TEST_DECLARE (tcp_bind_invalid_flags) -TEST_DECLARE (tcp_bind_writable_flags) -TEST_DECLARE (tcp_listen_without_bind) -TEST_DECLARE (tcp_connect_error_fault) -TEST_DECLARE (tcp_connect_timeout) -TEST_DECLARE (tcp_local_connect_timeout) -TEST_DECLARE (tcp6_local_connect_timeout) -TEST_DECLARE (tcp_close_while_connecting) -TEST_DECLARE (tcp_close) -TEST_DECLARE (tcp_close_reset_accepted) -TEST_DECLARE (tcp_close_reset_accepted_after_shutdown) -TEST_DECLARE (tcp_close_reset_client) -TEST_DECLARE (tcp_close_reset_client_after_shutdown) -TEST_DECLARE (tcp_create_early) -TEST_DECLARE (tcp_create_early_bad_bind) -TEST_DECLARE (tcp_create_early_bad_domain) -TEST_DECLARE (tcp_create_early_accept) +TEST_DECLARE(tcp_writealot) +TEST_DECLARE(tcp_write_fail) +TEST_DECLARE(tcp_try_write) +TEST_DECLARE(tcp_try_write_error) +TEST_DECLARE(tcp_write_queue_order) +TEST_DECLARE(tcp_open) +TEST_DECLARE(tcp_open_twice) +TEST_DECLARE(tcp_open_bound) +TEST_DECLARE(tcp_open_connected) +TEST_DECLARE(tcp_connect_error_after_write) +TEST_DECLARE(tcp_shutdown_after_write) +TEST_DECLARE(tcp_bind_error_addrinuse_connect) +TEST_DECLARE(tcp_bind_error_addrinuse_listen) +TEST_DECLARE(tcp_bind_error_addrnotavail_1) +TEST_DECLARE(tcp_bind_error_addrnotavail_2) +TEST_DECLARE(tcp_bind_error_fault) +TEST_DECLARE(tcp_bind_error_inval) +TEST_DECLARE(tcp_bind_localhost_ok) +TEST_DECLARE(tcp_bind_invalid_flags) +TEST_DECLARE(tcp_bind_writable_flags) +TEST_DECLARE(tcp_listen_without_bind) +TEST_DECLARE(tcp_connect_error_fault) +TEST_DECLARE(tcp_connect_timeout) +TEST_DECLARE(tcp_local_connect_timeout) +TEST_DECLARE(tcp6_local_connect_timeout) +TEST_DECLARE(tcp_close_while_connecting) +TEST_DECLARE(tcp_close) +TEST_DECLARE(tcp_close_reset_accepted) +TEST_DECLARE(tcp_close_reset_accepted_after_shutdown) +TEST_DECLARE(tcp_close_reset_client) +TEST_DECLARE(tcp_close_reset_client_after_shutdown) +TEST_DECLARE(tcp_create_early) +TEST_DECLARE(tcp_create_early_bad_bind) +TEST_DECLARE(tcp_create_early_bad_domain) +TEST_DECLARE(tcp_create_early_accept) #ifndef _WIN32 -TEST_DECLARE (tcp_close_accept) -TEST_DECLARE (tcp_oob) +TEST_DECLARE(tcp_close_accept) +TEST_DECLARE(tcp_oob) #endif -TEST_DECLARE (tcp_flags) -TEST_DECLARE (tcp_write_to_half_open_connection) -TEST_DECLARE (tcp_unexpected_read) -TEST_DECLARE (tcp_read_stop) -TEST_DECLARE (tcp_read_stop_start) -TEST_DECLARE (tcp_bind6_error_addrinuse) -TEST_DECLARE (tcp_bind6_error_addrnotavail) -TEST_DECLARE (tcp_bind6_error_fault) -TEST_DECLARE (tcp_bind6_error_inval) -TEST_DECLARE (tcp_bind6_localhost_ok) -TEST_DECLARE (tcp_write_ready) -TEST_DECLARE (udp_alloc_cb_fail) -TEST_DECLARE (udp_bind) -TEST_DECLARE (udp_bind_reuseaddr) -TEST_DECLARE (udp_connect) -TEST_DECLARE (udp_connect6) -TEST_DECLARE (udp_create_early) -TEST_DECLARE (udp_create_early_bad_bind) -TEST_DECLARE (udp_create_early_bad_domain) -TEST_DECLARE (udp_send_and_recv) -TEST_DECLARE (udp_send_hang_loop) -TEST_DECLARE (udp_send_immediate) -TEST_DECLARE (udp_send_unreachable) -TEST_DECLARE (udp_mmsg) -TEST_DECLARE (udp_multicast_join) -TEST_DECLARE (udp_multicast_join6) -TEST_DECLARE (udp_multicast_ttl) -TEST_DECLARE (udp_multicast_interface) -TEST_DECLARE (udp_multicast_interface6) -TEST_DECLARE (udp_dgram_too_big) -TEST_DECLARE (udp_dual_stack) -TEST_DECLARE (udp_ipv6_only) -TEST_DECLARE (udp_options) -TEST_DECLARE (udp_options6) -TEST_DECLARE (udp_no_autobind) -TEST_DECLARE (udp_open) -TEST_DECLARE (udp_open_twice) -TEST_DECLARE (udp_open_bound) -TEST_DECLARE (udp_open_connect) +TEST_DECLARE(tcp_flags) +TEST_DECLARE(tcp_write_to_half_open_connection) +TEST_DECLARE(tcp_unexpected_read) +TEST_DECLARE(tcp_read_stop) +TEST_DECLARE(tcp_read_stop_start) +TEST_DECLARE(tcp_bind6_error_addrinuse) +TEST_DECLARE(tcp_bind6_error_addrnotavail) +TEST_DECLARE(tcp_bind6_error_fault) +TEST_DECLARE(tcp_bind6_error_inval) +TEST_DECLARE(tcp_bind6_localhost_ok) +TEST_DECLARE(tcp_write_ready) +TEST_DECLARE(udp_alloc_cb_fail) +TEST_DECLARE(udp_bind) +TEST_DECLARE(udp_bind_reuseaddr) +TEST_DECLARE(udp_connect) +TEST_DECLARE(udp_connect6) +TEST_DECLARE(udp_create_early) +TEST_DECLARE(udp_create_early_bad_bind) +TEST_DECLARE(udp_create_early_bad_domain) +TEST_DECLARE(udp_send_and_recv) +TEST_DECLARE(udp_send_hang_loop) +TEST_DECLARE(udp_send_immediate) +TEST_DECLARE(udp_send_unreachable) +TEST_DECLARE(udp_mmsg) +TEST_DECLARE(udp_multicast_join) +TEST_DECLARE(udp_multicast_join6) +TEST_DECLARE(udp_multicast_ttl) +TEST_DECLARE(udp_multicast_interface) +TEST_DECLARE(udp_multicast_interface6) +TEST_DECLARE(udp_dgram_too_big) +TEST_DECLARE(udp_dual_stack) +TEST_DECLARE(udp_ipv6_only) +TEST_DECLARE(udp_options) +TEST_DECLARE(udp_options6) +TEST_DECLARE(udp_no_autobind) +TEST_DECLARE(udp_open) +TEST_DECLARE(udp_open_twice) +TEST_DECLARE(udp_open_bound) +TEST_DECLARE(udp_open_connect) #ifndef _WIN32 -TEST_DECLARE (udp_send_unix) +TEST_DECLARE(udp_send_unix) #endif -TEST_DECLARE (udp_sendmmsg_error) -TEST_DECLARE (udp_try_send) -TEST_DECLARE (pipe_bind_error_addrinuse) -TEST_DECLARE (pipe_bind_error_addrnotavail) -TEST_DECLARE (pipe_bind_error_inval) -TEST_DECLARE (pipe_connect_multiple) -TEST_DECLARE (pipe_listen_without_bind) -TEST_DECLARE (pipe_connect_bad_name) -TEST_DECLARE (pipe_connect_to_file) -TEST_DECLARE (pipe_connect_on_prepare) -TEST_DECLARE (pipe_getsockname) -TEST_DECLARE (pipe_getsockname_abstract) -TEST_DECLARE (pipe_getsockname_blocking) -TEST_DECLARE (pipe_pending_instances) -TEST_DECLARE (pipe_sendmsg) -TEST_DECLARE (pipe_server_close) -TEST_DECLARE (connection_fail) -TEST_DECLARE (connection_fail_doesnt_auto_close) -TEST_DECLARE (shutdown_close_tcp) -TEST_DECLARE (shutdown_close_pipe) -TEST_DECLARE (shutdown_eof) -TEST_DECLARE (shutdown_simultaneous) -TEST_DECLARE (shutdown_twice) -TEST_DECLARE (callback_stack) -TEST_DECLARE (env_vars) -TEST_DECLARE (error_message) -TEST_DECLARE (sys_error) -TEST_DECLARE (timer) -TEST_DECLARE (timer_init) -TEST_DECLARE (timer_again) -TEST_DECLARE (timer_start_twice) -TEST_DECLARE (timer_order) -TEST_DECLARE (timer_huge_timeout) -TEST_DECLARE (timer_huge_repeat) -TEST_DECLARE (timer_run_once) -TEST_DECLARE (timer_from_check) -TEST_DECLARE (timer_is_closing) -TEST_DECLARE (timer_null_callback) -TEST_DECLARE (timer_early_check) -TEST_DECLARE (idle_starvation) -TEST_DECLARE (loop_handles) -TEST_DECLARE (get_loadavg) -TEST_DECLARE (walk_handles) -TEST_DECLARE (watcher_cross_stop) -TEST_DECLARE (ref) -TEST_DECLARE (idle_ref) -TEST_DECLARE (async_ref) -TEST_DECLARE (prepare_ref) -TEST_DECLARE (check_ref) -TEST_DECLARE (unref_in_prepare_cb) -TEST_DECLARE (timer_ref) -TEST_DECLARE (timer_ref2) -TEST_DECLARE (fs_event_ref) -TEST_DECLARE (fs_poll_ref) -TEST_DECLARE (tcp_ref) -TEST_DECLARE (tcp_ref2) -TEST_DECLARE (tcp_ref2b) -TEST_DECLARE (tcp_ref3) -TEST_DECLARE (tcp_ref4) -TEST_DECLARE (udp_ref) -TEST_DECLARE (udp_ref2) -TEST_DECLARE (udp_ref3) -TEST_DECLARE (pipe_ref) -TEST_DECLARE (pipe_ref2) -TEST_DECLARE (pipe_ref3) -TEST_DECLARE (pipe_ref4) +TEST_DECLARE(udp_sendmmsg_error) +TEST_DECLARE(udp_try_send) +TEST_DECLARE(pipe_bind_error_addrinuse) +TEST_DECLARE(pipe_bind_error_addrnotavail) +TEST_DECLARE(pipe_bind_error_inval) +TEST_DECLARE(pipe_connect_multiple) +TEST_DECLARE(pipe_listen_without_bind) +TEST_DECLARE(pipe_connect_bad_name) +TEST_DECLARE(pipe_connect_to_file) +TEST_DECLARE(pipe_connect_on_prepare) +TEST_DECLARE(pipe_getsockname) +TEST_DECLARE(pipe_getsockname_abstract) +TEST_DECLARE(pipe_getsockname_blocking) +TEST_DECLARE(pipe_pending_instances) +TEST_DECLARE(pipe_sendmsg) +TEST_DECLARE(pipe_server_close) +TEST_DECLARE(connection_fail) +TEST_DECLARE(connection_fail_doesnt_auto_close) +TEST_DECLARE(shutdown_close_tcp) +TEST_DECLARE(shutdown_close_pipe) +TEST_DECLARE(shutdown_eof) +TEST_DECLARE(shutdown_simultaneous) +TEST_DECLARE(shutdown_twice) +TEST_DECLARE(callback_stack) +TEST_DECLARE(env_vars) +TEST_DECLARE(error_message) +TEST_DECLARE(sys_error) +TEST_DECLARE(timer) +TEST_DECLARE(timer_init) +TEST_DECLARE(timer_again) +TEST_DECLARE(timer_start_twice) +TEST_DECLARE(timer_order) +TEST_DECLARE(timer_huge_timeout) +TEST_DECLARE(timer_huge_repeat) +TEST_DECLARE(timer_run_once) +TEST_DECLARE(timer_from_check) +TEST_DECLARE(timer_is_closing) +TEST_DECLARE(timer_null_callback) +TEST_DECLARE(timer_early_check) +TEST_DECLARE(idle_starvation) +TEST_DECLARE(loop_handles) +TEST_DECLARE(get_loadavg) +TEST_DECLARE(walk_handles) +TEST_DECLARE(watcher_cross_stop) +TEST_DECLARE(ref) +TEST_DECLARE(idle_ref) +TEST_DECLARE(async_ref) +TEST_DECLARE(prepare_ref) +TEST_DECLARE(check_ref) +TEST_DECLARE(unref_in_prepare_cb) +TEST_DECLARE(timer_ref) +TEST_DECLARE(timer_ref2) +TEST_DECLARE(fs_event_ref) +TEST_DECLARE(fs_poll_ref) +TEST_DECLARE(tcp_ref) +TEST_DECLARE(tcp_ref2) +TEST_DECLARE(tcp_ref2b) +TEST_DECLARE(tcp_ref3) +TEST_DECLARE(tcp_ref4) +TEST_DECLARE(udp_ref) +TEST_DECLARE(udp_ref2) +TEST_DECLARE(udp_ref3) +TEST_DECLARE(pipe_ref) +TEST_DECLARE(pipe_ref2) +TEST_DECLARE(pipe_ref3) +TEST_DECLARE(pipe_ref4) #ifndef _WIN32 -TEST_DECLARE (pipe_close_stdout_read_stdin) +TEST_DECLARE(pipe_close_stdout_read_stdin) #endif -TEST_DECLARE (pipe_set_non_blocking) -TEST_DECLARE (pipe_set_chmod) -TEST_DECLARE (process_ref) -TEST_DECLARE (process_priority) -TEST_DECLARE (has_ref) -TEST_DECLARE (active) -TEST_DECLARE (embed) -TEST_DECLARE (async) -TEST_DECLARE (async_null_cb) -TEST_DECLARE (eintr_handling) -TEST_DECLARE (get_currentexe) -TEST_DECLARE (process_title) -TEST_DECLARE (process_title_big_argv) -TEST_DECLARE (process_title_threadsafe) -TEST_DECLARE (cwd_and_chdir) -TEST_DECLARE (get_memory) -TEST_DECLARE (get_passwd) -TEST_DECLARE (handle_fileno) -TEST_DECLARE (homedir) -TEST_DECLARE (tmpdir) -TEST_DECLARE (hrtime) -TEST_DECLARE (getaddrinfo_fail) -TEST_DECLARE (getaddrinfo_fail_sync) -TEST_DECLARE (getaddrinfo_basic) -TEST_DECLARE (getaddrinfo_basic_sync) -TEST_DECLARE (getaddrinfo_concurrent) -TEST_DECLARE (gethostname) -TEST_DECLARE (getnameinfo_basic_ip4) -TEST_DECLARE (getnameinfo_basic_ip4_sync) -TEST_DECLARE (getnameinfo_basic_ip6) -TEST_DECLARE (getsockname_tcp) -TEST_DECLARE (getsockname_udp) -TEST_DECLARE (gettimeofday) -TEST_DECLARE (test_macros) -TEST_DECLARE (fail_always) -TEST_DECLARE (pass_always) -TEST_DECLARE (socket_buffer_size) -TEST_DECLARE (spawn_fails) +TEST_DECLARE(pipe_set_non_blocking) +TEST_DECLARE(pipe_set_chmod) +TEST_DECLARE(process_ref) +TEST_DECLARE(process_priority) +TEST_DECLARE(has_ref) +TEST_DECLARE(active) +TEST_DECLARE(embed) +TEST_DECLARE(async) +TEST_DECLARE(async_null_cb) +TEST_DECLARE(eintr_handling) +TEST_DECLARE(get_currentexe) +TEST_DECLARE(process_title) +TEST_DECLARE(process_title_big_argv) +TEST_DECLARE(process_title_threadsafe) +TEST_DECLARE(cwd_and_chdir) +TEST_DECLARE(get_memory) +TEST_DECLARE(get_passwd) +TEST_DECLARE(handle_fileno) +TEST_DECLARE(homedir) +TEST_DECLARE(tmpdir) +TEST_DECLARE(hrtime) +TEST_DECLARE(getaddrinfo_fail) +TEST_DECLARE(getaddrinfo_fail_sync) +TEST_DECLARE(getaddrinfo_basic) +TEST_DECLARE(getaddrinfo_basic_sync) +TEST_DECLARE(getaddrinfo_concurrent) +TEST_DECLARE(gethostname) +TEST_DECLARE(getnameinfo_basic_ip4) +TEST_DECLARE(getnameinfo_basic_ip4_sync) +TEST_DECLARE(getnameinfo_basic_ip6) +TEST_DECLARE(getsockname_tcp) +TEST_DECLARE(getsockname_udp) +TEST_DECLARE(gettimeofday) +TEST_DECLARE(test_macros) +TEST_DECLARE(fail_always) +TEST_DECLARE(pass_always) +TEST_DECLARE(socket_buffer_size) +TEST_DECLARE(spawn_fails) #ifndef _WIN32 -TEST_DECLARE (spawn_fails_check_for_waitpid_cleanup) +TEST_DECLARE(spawn_fails_check_for_waitpid_cleanup) #endif -TEST_DECLARE (spawn_empty_env) -TEST_DECLARE (spawn_exit_code) -TEST_DECLARE (spawn_stdout) -TEST_DECLARE (spawn_stdin) -TEST_DECLARE (spawn_stdio_greater_than_3) -TEST_DECLARE (spawn_ignored_stdio) -TEST_DECLARE (spawn_and_kill) -TEST_DECLARE (spawn_detached) -TEST_DECLARE (spawn_and_kill_with_std) -TEST_DECLARE (spawn_and_ping) -TEST_DECLARE (spawn_preserve_env) -TEST_DECLARE (spawn_setuid_fails) -TEST_DECLARE (spawn_setgid_fails) -TEST_DECLARE (spawn_stdout_to_file) -TEST_DECLARE (spawn_stdout_and_stderr_to_file) -TEST_DECLARE (spawn_stdout_and_stderr_to_file2) -TEST_DECLARE (spawn_stdout_and_stderr_to_file_swap) -TEST_DECLARE (spawn_auto_unref) -TEST_DECLARE (spawn_closed_process_io) -TEST_DECLARE (spawn_reads_child_path) -TEST_DECLARE (spawn_inherit_streams) -TEST_DECLARE (spawn_quoted_path) -TEST_DECLARE (spawn_tcp_server) -TEST_DECLARE (fs_poll) -TEST_DECLARE (fs_poll_getpath) -TEST_DECLARE (fs_poll_close_request) -TEST_DECLARE (fs_poll_close_request_multi_start_stop) -TEST_DECLARE (fs_poll_close_request_multi_stop_start) -TEST_DECLARE (fs_poll_close_request_stop_when_active) -TEST_DECLARE (kill) -TEST_DECLARE (kill_invalid_signum) -TEST_DECLARE (fs_file_noent) -TEST_DECLARE (fs_file_nametoolong) -TEST_DECLARE (fs_file_loop) -TEST_DECLARE (fs_file_async) -TEST_DECLARE (fs_file_sync) -TEST_DECLARE (fs_file_write_null_buffer) -TEST_DECLARE (fs_async_dir) -TEST_DECLARE (fs_async_sendfile) -TEST_DECLARE (fs_async_sendfile_nodata) -TEST_DECLARE (fs_mkdtemp) -TEST_DECLARE (fs_mkstemp) -TEST_DECLARE (fs_fstat) -TEST_DECLARE (fs_access) -TEST_DECLARE (fs_chmod) -TEST_DECLARE (fs_copyfile) -TEST_DECLARE (fs_unlink_readonly) +TEST_DECLARE(spawn_empty_env) +TEST_DECLARE(spawn_exit_code) +TEST_DECLARE(spawn_stdout) +TEST_DECLARE(spawn_stdin) +TEST_DECLARE(spawn_stdio_greater_than_3) +TEST_DECLARE(spawn_ignored_stdio) +TEST_DECLARE(spawn_and_kill) +TEST_DECLARE(spawn_detached) +TEST_DECLARE(spawn_and_kill_with_std) +TEST_DECLARE(spawn_and_ping) +TEST_DECLARE(spawn_preserve_env) +TEST_DECLARE(spawn_setuid_fails) +TEST_DECLARE(spawn_setgid_fails) +TEST_DECLARE(spawn_stdout_to_file) +TEST_DECLARE(spawn_stdout_and_stderr_to_file) +TEST_DECLARE(spawn_stdout_and_stderr_to_file2) +TEST_DECLARE(spawn_stdout_and_stderr_to_file_swap) +TEST_DECLARE(spawn_auto_unref) +TEST_DECLARE(spawn_closed_process_io) +TEST_DECLARE(spawn_reads_child_path) +TEST_DECLARE(spawn_inherit_streams) +TEST_DECLARE(spawn_quoted_path) +TEST_DECLARE(spawn_tcp_server) +TEST_DECLARE(fs_poll) +TEST_DECLARE(fs_poll_getpath) +TEST_DECLARE(fs_poll_close_request) +TEST_DECLARE(fs_poll_close_request_multi_start_stop) +TEST_DECLARE(fs_poll_close_request_multi_stop_start) +TEST_DECLARE(fs_poll_close_request_stop_when_active) +TEST_DECLARE(kill) +TEST_DECLARE(kill_invalid_signum) +TEST_DECLARE(fs_file_noent) +TEST_DECLARE(fs_file_nametoolong) +TEST_DECLARE(fs_file_loop) +TEST_DECLARE(fs_file_async) +TEST_DECLARE(fs_file_sync) +TEST_DECLARE(fs_file_write_null_buffer) +TEST_DECLARE(fs_async_dir) +TEST_DECLARE(fs_async_sendfile) +TEST_DECLARE(fs_async_sendfile_nodata) +TEST_DECLARE(fs_mkdtemp) +TEST_DECLARE(fs_mkstemp) +TEST_DECLARE(fs_fstat) +TEST_DECLARE(fs_access) +TEST_DECLARE(fs_chmod) +TEST_DECLARE(fs_copyfile) +TEST_DECLARE(fs_unlink_readonly) #ifdef _WIN32 -TEST_DECLARE (fs_unlink_archive_readonly) +TEST_DECLARE(fs_unlink_archive_readonly) #endif -TEST_DECLARE (fs_chown) -TEST_DECLARE (fs_link) -TEST_DECLARE (fs_readlink) -TEST_DECLARE (fs_realpath) -TEST_DECLARE (fs_symlink) -TEST_DECLARE (fs_symlink_dir) +TEST_DECLARE(fs_chown) +TEST_DECLARE(fs_link) +TEST_DECLARE(fs_readlink) +TEST_DECLARE(fs_realpath) +TEST_DECLARE(fs_symlink) +TEST_DECLARE(fs_symlink_dir) #ifdef _WIN32 -TEST_DECLARE (fs_symlink_junction) -TEST_DECLARE (fs_non_symlink_reparse_point) -TEST_DECLARE (fs_lstat_windows_store_apps) -TEST_DECLARE (fs_open_flags) +TEST_DECLARE(fs_symlink_junction) +TEST_DECLARE(fs_non_symlink_reparse_point) +TEST_DECLARE(fs_lstat_windows_store_apps) +TEST_DECLARE(fs_open_flags) #endif #if defined(_WIN32) && !defined(USING_UV_SHARED) -TEST_DECLARE (fs_fd_hash) +TEST_DECLARE(fs_fd_hash) #endif -TEST_DECLARE (fs_utime) -TEST_DECLARE (fs_utime_round) -TEST_DECLARE (fs_futime) -TEST_DECLARE (fs_lutime) -TEST_DECLARE (fs_file_open_append) -TEST_DECLARE (fs_statfs) -TEST_DECLARE (fs_stat_missing_path) -TEST_DECLARE (fs_read_bufs) -TEST_DECLARE (fs_read_file_eof) -TEST_DECLARE (fs_event_watch_dir) -TEST_DECLARE (fs_event_watch_dir_recursive) +TEST_DECLARE(fs_utime) +TEST_DECLARE(fs_utime_round) +TEST_DECLARE(fs_futime) +TEST_DECLARE(fs_lutime) +TEST_DECLARE(fs_file_open_append) +TEST_DECLARE(fs_statfs) +TEST_DECLARE(fs_stat_missing_path) +TEST_DECLARE(fs_read_bufs) +TEST_DECLARE(fs_read_file_eof) +TEST_DECLARE(fs_event_watch_dir) +TEST_DECLARE(fs_event_watch_dir_recursive) #ifdef _WIN32 -TEST_DECLARE (fs_event_watch_dir_short_path) +TEST_DECLARE(fs_event_watch_dir_short_path) #endif -TEST_DECLARE (fs_event_watch_file) -TEST_DECLARE (fs_event_watch_file_exact_path) -TEST_DECLARE (fs_event_watch_file_twice) -TEST_DECLARE (fs_event_watch_file_current_dir) +TEST_DECLARE(fs_event_watch_file) +TEST_DECLARE(fs_event_watch_file_exact_path) +TEST_DECLARE(fs_event_watch_file_twice) +TEST_DECLARE(fs_event_watch_file_current_dir) #ifdef _WIN32 -TEST_DECLARE (fs_event_watch_file_root_dir) +TEST_DECLARE(fs_event_watch_file_root_dir) #endif -TEST_DECLARE (fs_event_watch_invalid_path) -TEST_DECLARE (fs_event_no_callback_after_close) -TEST_DECLARE (fs_event_no_callback_on_close) -TEST_DECLARE (fs_event_immediate_close) -TEST_DECLARE (fs_event_close_with_pending_event) -TEST_DECLARE (fs_event_close_in_callback) -TEST_DECLARE (fs_event_start_and_close) -TEST_DECLARE (fs_event_error_reporting) -TEST_DECLARE (fs_event_getpath) -TEST_DECLARE (fs_event_stop_in_cb) -TEST_DECLARE (fs_scandir_empty_dir) -TEST_DECLARE (fs_scandir_non_existent_dir) -TEST_DECLARE (fs_scandir_file) -TEST_DECLARE (fs_open_dir) -TEST_DECLARE (fs_readdir_empty_dir) -TEST_DECLARE (fs_readdir_file) -TEST_DECLARE (fs_readdir_non_empty_dir) -TEST_DECLARE (fs_readdir_non_existing_dir) -TEST_DECLARE (fs_rename_to_existing_file) -TEST_DECLARE (fs_write_multiple_bufs) -TEST_DECLARE (fs_read_write_null_arguments) -TEST_DECLARE (get_osfhandle_valid_handle) -TEST_DECLARE (open_osfhandle_valid_handle) -TEST_DECLARE (fs_write_alotof_bufs) -TEST_DECLARE (fs_write_alotof_bufs_with_offset) -TEST_DECLARE (fs_partial_read) -TEST_DECLARE (fs_partial_write) -TEST_DECLARE (fs_file_pos_after_op_with_offset) -TEST_DECLARE (fs_null_req) -TEST_DECLARE (fs_read_dir) +TEST_DECLARE(fs_event_watch_invalid_path) +TEST_DECLARE(fs_event_no_callback_after_close) +TEST_DECLARE(fs_event_no_callback_on_close) +TEST_DECLARE(fs_event_immediate_close) +TEST_DECLARE(fs_event_close_with_pending_event) +TEST_DECLARE(fs_event_close_in_callback) +TEST_DECLARE(fs_event_start_and_close) +TEST_DECLARE(fs_event_error_reporting) +TEST_DECLARE(fs_event_getpath) +TEST_DECLARE(fs_event_stop_in_cb) +TEST_DECLARE(fs_scandir_empty_dir) +TEST_DECLARE(fs_scandir_non_existent_dir) +TEST_DECLARE(fs_scandir_file) +TEST_DECLARE(fs_open_dir) +TEST_DECLARE(fs_readdir_empty_dir) +TEST_DECLARE(fs_readdir_file) +TEST_DECLARE(fs_readdir_non_empty_dir) +TEST_DECLARE(fs_readdir_non_existing_dir) +TEST_DECLARE(fs_rename_to_existing_file) +TEST_DECLARE(fs_write_multiple_bufs) +TEST_DECLARE(fs_read_write_null_arguments) +TEST_DECLARE(get_osfhandle_valid_handle) +TEST_DECLARE(open_osfhandle_valid_handle) +TEST_DECLARE(fs_write_alotof_bufs) +TEST_DECLARE(fs_write_alotof_bufs_with_offset) +TEST_DECLARE(fs_partial_read) +TEST_DECLARE(fs_partial_write) +TEST_DECLARE(fs_file_pos_after_op_with_offset) +TEST_DECLARE(fs_null_req) +TEST_DECLARE(fs_read_dir) #ifdef _WIN32 -TEST_DECLARE (fs_file_pos_write) -TEST_DECLARE (fs_file_pos_append) -TEST_DECLARE (fs_exclusive_sharing_mode) -TEST_DECLARE (fs_file_flag_no_buffering) -TEST_DECLARE (fs_open_readonly_acl) -TEST_DECLARE (fs_fchmod_archive_readonly) -TEST_DECLARE (fs_invalid_mkdir_name) +TEST_DECLARE(fs_file_pos_write) +TEST_DECLARE(fs_file_pos_append) +TEST_DECLARE(fs_exclusive_sharing_mode) +TEST_DECLARE(fs_file_flag_no_buffering) +TEST_DECLARE(fs_open_readonly_acl) +TEST_DECLARE(fs_fchmod_archive_readonly) +TEST_DECLARE(fs_invalid_mkdir_name) #endif -TEST_DECLARE (fs_get_system_error) -TEST_DECLARE (strscpy) -TEST_DECLARE (threadpool_queue_work_simple) -TEST_DECLARE (threadpool_queue_work_einval) -TEST_DECLARE (threadpool_multiple_event_loops) -TEST_DECLARE (threadpool_cancel_getaddrinfo) -TEST_DECLARE (threadpool_cancel_getnameinfo) -TEST_DECLARE (threadpool_cancel_random) -TEST_DECLARE (threadpool_cancel_work) -TEST_DECLARE (threadpool_cancel_fs) -TEST_DECLARE (threadpool_cancel_single) -TEST_DECLARE (thread_local_storage) -TEST_DECLARE (thread_stack_size) -TEST_DECLARE (thread_stack_size_explicit) -TEST_DECLARE (thread_mutex) -TEST_DECLARE (thread_mutex_recursive) -TEST_DECLARE (thread_rwlock) -TEST_DECLARE (thread_rwlock_trylock) -TEST_DECLARE (thread_create) -TEST_DECLARE (thread_equal) -TEST_DECLARE (dlerror) -#if (defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))) && \ +TEST_DECLARE(fs_get_system_error) +TEST_DECLARE(strscpy) +TEST_DECLARE(threadpool_queue_work_simple) +TEST_DECLARE(threadpool_queue_work_einval) +TEST_DECLARE(threadpool_multiple_event_loops) +TEST_DECLARE(threadpool_cancel_getaddrinfo) +TEST_DECLARE(threadpool_cancel_getnameinfo) +TEST_DECLARE(threadpool_cancel_random) +TEST_DECLARE(threadpool_cancel_work) +TEST_DECLARE(threadpool_cancel_fs) +TEST_DECLARE(threadpool_cancel_single) +TEST_DECLARE(thread_local_storage) +TEST_DECLARE(thread_stack_size) +TEST_DECLARE(thread_stack_size_explicit) +TEST_DECLARE(thread_mutex) +TEST_DECLARE(thread_mutex_recursive) +TEST_DECLARE(thread_rwlock) +TEST_DECLARE(thread_rwlock_trylock) +TEST_DECLARE(thread_create) +TEST_DECLARE(thread_equal) +TEST_DECLARE(dlerror) +#if (defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))) && \ !defined(__sun) -TEST_DECLARE (poll_oob) +TEST_DECLARE(poll_oob) #endif -TEST_DECLARE (poll_duplex) -TEST_DECLARE (poll_unidirectional) -TEST_DECLARE (poll_close) -TEST_DECLARE (poll_bad_fdtype) +TEST_DECLARE(poll_duplex) +TEST_DECLARE(poll_unidirectional) +TEST_DECLARE(poll_close) +TEST_DECLARE(poll_bad_fdtype) #ifdef __linux__ -TEST_DECLARE (poll_nested_epoll) +TEST_DECLARE(poll_nested_epoll) #endif #ifdef UV_HAVE_KQUEUE -TEST_DECLARE (poll_nested_kqueue) +TEST_DECLARE(poll_nested_kqueue) #endif -TEST_DECLARE (poll_multiple_handles) +TEST_DECLARE(poll_multiple_handles) -TEST_DECLARE (ip4_addr) -TEST_DECLARE (ip6_addr_link_local) -TEST_DECLARE (ip_name) +TEST_DECLARE(ip4_addr) +TEST_DECLARE(ip6_addr_link_local) +TEST_DECLARE(ip_name) -TEST_DECLARE (poll_close_doesnt_corrupt_stack) -TEST_DECLARE (poll_closesocket) -TEST_DECLARE (close_fd) -TEST_DECLARE (closed_fd_events) -TEST_DECLARE (spawn_fs_open) +TEST_DECLARE(poll_close_doesnt_corrupt_stack) +TEST_DECLARE(poll_closesocket) +TEST_DECLARE(close_fd) +TEST_DECLARE(closed_fd_events) +TEST_DECLARE(spawn_fs_open) #ifdef _WIN32 -TEST_DECLARE (spawn_detect_pipe_name_collisions_on_windows) +TEST_DECLARE(spawn_detect_pipe_name_collisions_on_windows) #if !defined(USING_UV_SHARED) -TEST_DECLARE (argument_escaping) -TEST_DECLARE (environment_creation) +TEST_DECLARE(argument_escaping) +TEST_DECLARE(environment_creation) #endif -TEST_DECLARE (listen_with_simultaneous_accepts) -TEST_DECLARE (listen_no_simultaneous_accepts) -TEST_DECLARE (fs_stat_root) -TEST_DECLARE (spawn_with_an_odd_path) -TEST_DECLARE (ipc_listen_after_bind_twice) -TEST_DECLARE (win32_signum_number) +TEST_DECLARE(listen_with_simultaneous_accepts) +TEST_DECLARE(listen_no_simultaneous_accepts) +TEST_DECLARE(fs_stat_root) +TEST_DECLARE(spawn_with_an_odd_path) +TEST_DECLARE(ipc_listen_after_bind_twice) +TEST_DECLARE(win32_signum_number) #else -TEST_DECLARE (emfile) -TEST_DECLARE (spawn_setuid_setgid) -TEST_DECLARE (we_get_signal) -TEST_DECLARE (we_get_signals) -TEST_DECLARE (we_get_signal_one_shot) -TEST_DECLARE (we_get_signals_mixed) -TEST_DECLARE (signal_multiple_loops) -TEST_DECLARE (signal_pending_on_close) -TEST_DECLARE (signal_close_loop_alive) +TEST_DECLARE(emfile) +TEST_DECLARE(spawn_setuid_setgid) +TEST_DECLARE(we_get_signal) +TEST_DECLARE(we_get_signals) +TEST_DECLARE(we_get_signal_one_shot) +TEST_DECLARE(we_get_signals_mixed) +TEST_DECLARE(signal_multiple_loops) +TEST_DECLARE(signal_pending_on_close) +TEST_DECLARE(signal_close_loop_alive) #endif #ifdef __APPLE__ -TEST_DECLARE (osx_select) -TEST_DECLARE (osx_select_many_fds) +TEST_DECLARE(osx_select) +TEST_DECLARE(osx_select_many_fds) #endif -HELPER_DECLARE (tcp4_echo_server) -HELPER_DECLARE (tcp6_echo_server) -HELPER_DECLARE (udp4_echo_server) -HELPER_DECLARE (pipe_echo_server) +HELPER_DECLARE(tcp4_echo_server) +HELPER_DECLARE(tcp6_echo_server) +HELPER_DECLARE(udp4_echo_server) +HELPER_DECLARE(pipe_echo_server) -TEST_DECLARE (queue_foreach_delete) +TEST_DECLARE(queue_foreach_delete) -TEST_DECLARE (random_async) -TEST_DECLARE (random_sync) +TEST_DECLARE(random_async) +TEST_DECLARE(random_sync) -TEST_DECLARE (handle_type_name) -TEST_DECLARE (req_type_name) -TEST_DECLARE (getters_setters) +TEST_DECLARE(handle_type_name) +TEST_DECLARE(req_type_name) +TEST_DECLARE(getters_setters) -TEST_DECLARE (not_writable_after_shutdown) -TEST_DECLARE (not_readable_nor_writable_on_read_error) -TEST_DECLARE (readable_on_eof) +TEST_DECLARE(not_writable_after_shutdown) +TEST_DECLARE(not_readable_nor_writable_on_read_error) +TEST_DECLARE(readable_on_eof) #ifndef _WIN32 -TEST_DECLARE (fork_timer) -TEST_DECLARE (fork_socketpair) -TEST_DECLARE (fork_socketpair_started) -TEST_DECLARE (fork_signal_to_child) -TEST_DECLARE (fork_signal_to_child_closed) -#ifndef __APPLE__ /* This is forbidden in a fork child: The process has forked - and you cannot use this CoreFoundation functionality +TEST_DECLARE(fork_timer) +TEST_DECLARE(fork_socketpair) +TEST_DECLARE(fork_socketpair_started) +TEST_DECLARE(fork_signal_to_child) +TEST_DECLARE(fork_signal_to_child_closed) +#ifndef __APPLE__ /* This is forbidden in a fork child: The process has forked \ + and you cannot use this CoreFoundation functionality \ safely. You MUST exec(). */ -TEST_DECLARE (fork_fs_events_child) -TEST_DECLARE (fork_fs_events_child_dir) -TEST_DECLARE (fork_fs_events_file_parent_child) +TEST_DECLARE(fork_fs_events_child) +TEST_DECLARE(fork_fs_events_child_dir) +TEST_DECLARE(fork_fs_events_file_parent_child) #endif #ifndef __MVS__ -TEST_DECLARE (fork_threadpool_queue_work_simple) +TEST_DECLARE(fork_threadpool_queue_work_simple) #endif #endif -TEST_DECLARE (idna_toascii) -TEST_DECLARE (utf8_decode1) -TEST_DECLARE (utf8_decode1_overrun) -TEST_DECLARE (uname) +TEST_DECLARE(idna_toascii) +TEST_DECLARE(utf8_decode1) +TEST_DECLARE(utf8_decode1_overrun) +TEST_DECLARE(uname) -TEST_DECLARE (metrics_idle_time) -TEST_DECLARE (metrics_idle_time_thread) -TEST_DECLARE (metrics_idle_time_zero) +TEST_DECLARE(metrics_idle_time) +TEST_DECLARE(metrics_idle_time_thread) +TEST_DECLARE(metrics_idle_time_zero) TASK_LIST_START - TEST_ENTRY_CUSTOM (platform_output, 0, 1, 5000) +TEST_ENTRY_CUSTOM(platform_output, 0, 1, 5000) #if 0 TEST_ENTRY (callback_order) #endif - TEST_ENTRY (test_macros) - TEST_ENTRY (close_order) - TEST_ENTRY (run_once) - TEST_ENTRY (run_nowait) - TEST_ENTRY (loop_alive) - TEST_ENTRY (loop_close) - TEST_ENTRY (loop_instant_close) - TEST_ENTRY (loop_stop) - TEST_ENTRY (loop_update_time) - TEST_ENTRY (loop_backend_timeout) - TEST_ENTRY (loop_configure) - TEST_ENTRY (default_loop_close) - TEST_ENTRY (barrier_1) - TEST_ENTRY (barrier_2) - TEST_ENTRY (barrier_3) - TEST_ENTRY (barrier_serial_thread) - TEST_ENTRY (barrier_serial_thread_single) - TEST_ENTRY (condvar_1) - TEST_ENTRY (condvar_2) - TEST_ENTRY (condvar_3) - TEST_ENTRY (condvar_4) - TEST_ENTRY (condvar_5) - TEST_ENTRY (semaphore_1) - TEST_ENTRY (semaphore_2) - TEST_ENTRY (semaphore_3) - - TEST_ENTRY (pipe_connect_bad_name) - TEST_ENTRY (pipe_connect_to_file) - TEST_ENTRY (pipe_connect_on_prepare) - - TEST_ENTRY (pipe_server_close) +TEST_ENTRY(test_macros) +TEST_ENTRY(close_order) +TEST_ENTRY(run_once) +TEST_ENTRY(run_nowait) +TEST_ENTRY(loop_alive) +TEST_ENTRY(loop_close) +TEST_ENTRY(loop_instant_close) +TEST_ENTRY(loop_stop) +TEST_ENTRY(loop_update_time) +TEST_ENTRY(loop_backend_timeout) +TEST_ENTRY(loop_configure) +TEST_ENTRY(default_loop_close) +TEST_ENTRY(barrier_1) +TEST_ENTRY(barrier_2) +TEST_ENTRY(barrier_3) +TEST_ENTRY(barrier_serial_thread) +TEST_ENTRY(barrier_serial_thread_single) +TEST_ENTRY(condvar_1) +TEST_ENTRY(condvar_2) +TEST_ENTRY(condvar_3) +TEST_ENTRY(condvar_4) +TEST_ENTRY(condvar_5) +TEST_ENTRY(semaphore_1) +TEST_ENTRY(semaphore_2) +TEST_ENTRY(semaphore_3) + +TEST_ENTRY(pipe_connect_bad_name) +TEST_ENTRY(pipe_connect_to_file) +TEST_ENTRY(pipe_connect_on_prepare) + +TEST_ENTRY(pipe_server_close) #ifndef _WIN32 - TEST_ENTRY (pipe_close_stdout_read_stdin) +TEST_ENTRY(pipe_close_stdout_read_stdin) #endif - /* Seems to be either about 0.5s or 5s, depending on the OS. */ - TEST_ENTRY_CUSTOM (pipe_set_non_blocking, 0, 0, 20000) - TEST_ENTRY (pipe_set_chmod) - TEST_ENTRY (tty) +/* Seems to be either about 0.5s or 5s, depending on the OS. */ +TEST_ENTRY_CUSTOM(pipe_set_non_blocking, 0, 0, 20000) +TEST_ENTRY(pipe_set_chmod) +TEST_ENTRY(tty) #ifdef _WIN32 - TEST_ENTRY (tty_raw) - TEST_ENTRY (tty_empty_write) - TEST_ENTRY (tty_large_write) - TEST_ENTRY (tty_raw_cancel) - TEST_ENTRY (tty_duplicate_vt100_fn_key) - TEST_ENTRY (tty_duplicate_alt_modifier_key) - TEST_ENTRY (tty_composing_character) - TEST_ENTRY (tty_cursor_up) - TEST_ENTRY (tty_cursor_down) - TEST_ENTRY (tty_cursor_forward) - TEST_ENTRY (tty_cursor_back) - TEST_ENTRY (tty_cursor_next_line) - TEST_ENTRY (tty_cursor_previous_line) - TEST_ENTRY (tty_cursor_horizontal_move_absolute) - TEST_ENTRY (tty_cursor_move_absolute) - TEST_ENTRY (tty_hide_show_cursor) - TEST_ENTRY (tty_set_cursor_shape) - TEST_ENTRY (tty_erase) - TEST_ENTRY (tty_erase_line) - TEST_ENTRY (tty_set_style) - TEST_ENTRY (tty_save_restore_cursor_position) - TEST_ENTRY (tty_full_reset) - TEST_ENTRY (tty_escape_sequence_processing) +TEST_ENTRY(tty_raw) +TEST_ENTRY(tty_empty_write) +TEST_ENTRY(tty_large_write) +TEST_ENTRY(tty_raw_cancel) +TEST_ENTRY(tty_duplicate_vt100_fn_key) +TEST_ENTRY(tty_duplicate_alt_modifier_key) +TEST_ENTRY(tty_composing_character) +TEST_ENTRY(tty_cursor_up) +TEST_ENTRY(tty_cursor_down) +TEST_ENTRY(tty_cursor_forward) +TEST_ENTRY(tty_cursor_back) +TEST_ENTRY(tty_cursor_next_line) +TEST_ENTRY(tty_cursor_previous_line) +TEST_ENTRY(tty_cursor_horizontal_move_absolute) +TEST_ENTRY(tty_cursor_move_absolute) +TEST_ENTRY(tty_hide_show_cursor) +TEST_ENTRY(tty_set_cursor_shape) +TEST_ENTRY(tty_erase) +TEST_ENTRY(tty_erase_line) +TEST_ENTRY(tty_set_style) +TEST_ENTRY(tty_save_restore_cursor_position) +TEST_ENTRY(tty_full_reset) +TEST_ENTRY(tty_escape_sequence_processing) #endif - TEST_ENTRY (tty_file) - TEST_ENTRY (tty_pty) - TEST_ENTRY (stdio_over_pipes) - TEST_ENTRY (stdio_emulate_iocp) - TEST_ENTRY (ip6_pton) - TEST_ENTRY (ip6_sin6_len) - TEST_ENTRY (connect_unspecified) - TEST_ENTRY (ipc_heavy_traffic_deadlock_bug) - TEST_ENTRY (ipc_listen_before_write) - TEST_ENTRY (ipc_listen_after_write) +TEST_ENTRY(tty_file) +TEST_ENTRY(tty_pty) +TEST_ENTRY(stdio_over_pipes) +TEST_ENTRY(stdio_emulate_iocp) +TEST_ENTRY(ip6_pton) +TEST_ENTRY(ip6_sin6_len) +TEST_ENTRY(connect_unspecified) +TEST_ENTRY(ipc_heavy_traffic_deadlock_bug) +TEST_ENTRY(ipc_listen_before_write) +TEST_ENTRY(ipc_listen_after_write) #ifndef _WIN32 - TEST_ENTRY (ipc_send_recv_pipe) - TEST_ENTRY (ipc_send_recv_pipe_inprocess) +TEST_ENTRY(ipc_send_recv_pipe) +TEST_ENTRY(ipc_send_recv_pipe_inprocess) #endif - TEST_ENTRY (ipc_send_recv_tcp) - TEST_ENTRY (ipc_send_recv_tcp_inprocess) - TEST_ENTRY (ipc_tcp_connection) - TEST_ENTRY (ipc_send_zero) +TEST_ENTRY(ipc_send_recv_tcp) +TEST_ENTRY(ipc_send_recv_tcp_inprocess) +TEST_ENTRY(ipc_tcp_connection) +TEST_ENTRY(ipc_send_zero) #ifndef _WIN32 - TEST_ENTRY (ipc_closed_handle) +TEST_ENTRY(ipc_closed_handle) #endif - TEST_ENTRY (tcp_alloc_cb_fail) +TEST_ENTRY(tcp_alloc_cb_fail) - TEST_ENTRY (tcp_ping_pong) - TEST_HELPER (tcp_ping_pong, tcp4_echo_server) +TEST_ENTRY(tcp_ping_pong) +TEST_HELPER(tcp_ping_pong, tcp4_echo_server) - TEST_ENTRY (tcp_ping_pong_vec) - TEST_HELPER (tcp_ping_pong_vec, tcp4_echo_server) +TEST_ENTRY(tcp_ping_pong_vec) +TEST_HELPER(tcp_ping_pong_vec, tcp4_echo_server) - TEST_ENTRY (tcp6_ping_pong) - TEST_HELPER (tcp6_ping_pong, tcp6_echo_server) +TEST_ENTRY(tcp6_ping_pong) +TEST_HELPER(tcp6_ping_pong, tcp6_echo_server) - TEST_ENTRY (tcp6_ping_pong_vec) - TEST_HELPER (tcp6_ping_pong_vec, tcp6_echo_server) +TEST_ENTRY(tcp6_ping_pong_vec) +TEST_HELPER(tcp6_ping_pong_vec, tcp6_echo_server) - TEST_ENTRY (pipe_ping_pong) - TEST_HELPER (pipe_ping_pong, pipe_echo_server) +TEST_ENTRY(pipe_ping_pong) +TEST_HELPER(pipe_ping_pong, pipe_echo_server) - TEST_ENTRY (pipe_ping_pong_vec) - TEST_HELPER (pipe_ping_pong_vec, pipe_echo_server) +TEST_ENTRY(pipe_ping_pong_vec) +TEST_HELPER(pipe_ping_pong_vec, pipe_echo_server) - TEST_ENTRY (delayed_accept) - TEST_ENTRY (multiple_listen) +TEST_ENTRY(delayed_accept) +TEST_ENTRY(multiple_listen) #ifndef _WIN32 - TEST_ENTRY (tcp_write_after_connect) +TEST_ENTRY(tcp_write_after_connect) #endif #ifdef __MVS__ - TEST_ENTRY_CUSTOM (tcp_writealot, 0, 0, 20000) +TEST_ENTRY_CUSTOM(tcp_writealot, 0, 0, 20000) #else - TEST_ENTRY (tcp_writealot) +TEST_ENTRY(tcp_writealot) #endif - TEST_HELPER (tcp_writealot, tcp4_echo_server) - - TEST_ENTRY (tcp_write_fail) - TEST_HELPER (tcp_write_fail, tcp4_echo_server) - - TEST_ENTRY (tcp_try_write) - TEST_ENTRY (tcp_try_write_error) - - TEST_ENTRY (tcp_write_queue_order) - - TEST_ENTRY (tcp_open) - TEST_HELPER (tcp_open, tcp4_echo_server) - TEST_ENTRY (tcp_open_twice) - TEST_ENTRY (tcp_open_bound) - TEST_ENTRY (tcp_open_connected) - TEST_HELPER (tcp_open_connected, tcp4_echo_server) - TEST_ENTRY (tcp_write_ready) - TEST_HELPER (tcp_write_ready, tcp4_echo_server) - - TEST_ENTRY (tcp_shutdown_after_write) - TEST_HELPER (tcp_shutdown_after_write, tcp4_echo_server) - - TEST_ENTRY (tcp_connect_error_after_write) - TEST_ENTRY (tcp_bind_error_addrinuse_connect) - /* tcp4_echo_server steals the port. It needs to be a separate process - * because libuv sets setsockopt(SO_REUSEADDR) that lets you steal an - * existing bind if it originates from the same process. - */ - TEST_HELPER (tcp_bind_error_addrinuse_connect, tcp4_echo_server) - TEST_ENTRY (tcp_bind_error_addrinuse_listen) - TEST_ENTRY (tcp_bind_error_addrnotavail_1) - TEST_ENTRY (tcp_bind_error_addrnotavail_2) - TEST_ENTRY (tcp_bind_error_fault) - TEST_ENTRY (tcp_bind_error_inval) - TEST_ENTRY (tcp_bind_localhost_ok) - TEST_ENTRY (tcp_bind_invalid_flags) - TEST_ENTRY (tcp_bind_writable_flags) - TEST_ENTRY (tcp_listen_without_bind) - TEST_ENTRY (tcp_connect_error_fault) - TEST_ENTRY (tcp_connect_timeout) - TEST_ENTRY (tcp_local_connect_timeout) - TEST_ENTRY (tcp6_local_connect_timeout) - TEST_ENTRY (tcp_close_while_connecting) - TEST_ENTRY (tcp_close) - TEST_ENTRY (tcp_close_reset_accepted) - TEST_ENTRY (tcp_close_reset_accepted_after_shutdown) - TEST_ENTRY (tcp_close_reset_client) - TEST_ENTRY (tcp_close_reset_client_after_shutdown) - TEST_ENTRY (tcp_create_early) - TEST_ENTRY (tcp_create_early_bad_bind) - TEST_ENTRY (tcp_create_early_bad_domain) - TEST_ENTRY (tcp_create_early_accept) +TEST_HELPER(tcp_writealot, tcp4_echo_server) + +TEST_ENTRY(tcp_write_fail) +TEST_HELPER(tcp_write_fail, tcp4_echo_server) + +TEST_ENTRY(tcp_try_write) +TEST_ENTRY(tcp_try_write_error) + +TEST_ENTRY(tcp_write_queue_order) + +TEST_ENTRY(tcp_open) +TEST_HELPER(tcp_open, tcp4_echo_server) +TEST_ENTRY(tcp_open_twice) +TEST_ENTRY(tcp_open_bound) +TEST_ENTRY(tcp_open_connected) +TEST_HELPER(tcp_open_connected, tcp4_echo_server) +TEST_ENTRY(tcp_write_ready) +TEST_HELPER(tcp_write_ready, tcp4_echo_server) + +TEST_ENTRY(tcp_shutdown_after_write) +TEST_HELPER(tcp_shutdown_after_write, tcp4_echo_server) + +TEST_ENTRY(tcp_connect_error_after_write) +TEST_ENTRY(tcp_bind_error_addrinuse_connect) +/* tcp4_echo_server steals the port. It needs to be a separate process + * because libuv sets setsockopt(SO_REUSEADDR) that lets you steal an + * existing bind if it originates from the same process. + */ +TEST_HELPER(tcp_bind_error_addrinuse_connect, tcp4_echo_server) +TEST_ENTRY(tcp_bind_error_addrinuse_listen) +TEST_ENTRY(tcp_bind_error_addrnotavail_1) +TEST_ENTRY(tcp_bind_error_addrnotavail_2) +TEST_ENTRY(tcp_bind_error_fault) +TEST_ENTRY(tcp_bind_error_inval) +TEST_ENTRY(tcp_bind_localhost_ok) +TEST_ENTRY(tcp_bind_invalid_flags) +TEST_ENTRY(tcp_bind_writable_flags) +TEST_ENTRY(tcp_listen_without_bind) +TEST_ENTRY(tcp_connect_error_fault) +TEST_ENTRY(tcp_connect_timeout) +TEST_ENTRY(tcp_local_connect_timeout) +TEST_ENTRY(tcp6_local_connect_timeout) +TEST_ENTRY(tcp_close_while_connecting) +TEST_ENTRY(tcp_close) +TEST_ENTRY(tcp_close_reset_accepted) +TEST_ENTRY(tcp_close_reset_accepted_after_shutdown) +TEST_ENTRY(tcp_close_reset_client) +TEST_ENTRY(tcp_close_reset_client_after_shutdown) +TEST_ENTRY(tcp_create_early) +TEST_ENTRY(tcp_create_early_bad_bind) +TEST_ENTRY(tcp_create_early_bad_domain) +TEST_ENTRY(tcp_create_early_accept) #ifndef _WIN32 - TEST_ENTRY (tcp_close_accept) - TEST_ENTRY (tcp_oob) +TEST_ENTRY(tcp_close_accept) +TEST_ENTRY(tcp_oob) #endif - TEST_ENTRY (tcp_flags) - TEST_ENTRY (tcp_write_to_half_open_connection) - TEST_ENTRY (tcp_unexpected_read) - - TEST_ENTRY (tcp_read_stop) - TEST_HELPER (tcp_read_stop, tcp4_echo_server) - - TEST_ENTRY (tcp_read_stop_start) - - TEST_ENTRY (tcp_bind6_error_addrinuse) - TEST_ENTRY (tcp_bind6_error_addrnotavail) - TEST_ENTRY (tcp_bind6_error_fault) - TEST_ENTRY (tcp_bind6_error_inval) - TEST_ENTRY (tcp_bind6_localhost_ok) - - TEST_ENTRY (udp_alloc_cb_fail) - TEST_ENTRY (udp_bind) - TEST_ENTRY (udp_bind_reuseaddr) - TEST_ENTRY (udp_connect) - TEST_ENTRY (udp_connect6) - TEST_ENTRY (udp_create_early) - TEST_ENTRY (udp_create_early_bad_bind) - TEST_ENTRY (udp_create_early_bad_domain) - TEST_ENTRY (udp_send_and_recv) - TEST_ENTRY (udp_send_hang_loop) - TEST_ENTRY (udp_send_immediate) - TEST_ENTRY (udp_send_unreachable) - TEST_ENTRY (udp_dgram_too_big) - TEST_ENTRY (udp_dual_stack) - TEST_ENTRY (udp_ipv6_only) - TEST_ENTRY (udp_options) - TEST_ENTRY (udp_options6) - TEST_ENTRY (udp_no_autobind) - TEST_ENTRY (udp_mmsg) - TEST_ENTRY (udp_multicast_interface) - TEST_ENTRY (udp_multicast_interface6) - TEST_ENTRY (udp_multicast_join) - TEST_ENTRY (udp_multicast_join6) - TEST_ENTRY (udp_multicast_ttl) - TEST_ENTRY (udp_sendmmsg_error) - TEST_ENTRY (udp_try_send) - - TEST_ENTRY (udp_open) - TEST_ENTRY (udp_open_twice) - TEST_ENTRY (udp_open_bound) - TEST_ENTRY (udp_open_connect) +TEST_ENTRY(tcp_flags) +TEST_ENTRY(tcp_write_to_half_open_connection) +TEST_ENTRY(tcp_unexpected_read) + +TEST_ENTRY(tcp_read_stop) +TEST_HELPER(tcp_read_stop, tcp4_echo_server) + +TEST_ENTRY(tcp_read_stop_start) + +TEST_ENTRY(tcp_bind6_error_addrinuse) +TEST_ENTRY(tcp_bind6_error_addrnotavail) +TEST_ENTRY(tcp_bind6_error_fault) +TEST_ENTRY(tcp_bind6_error_inval) +TEST_ENTRY(tcp_bind6_localhost_ok) + +TEST_ENTRY(udp_alloc_cb_fail) +TEST_ENTRY(udp_bind) +TEST_ENTRY(udp_bind_reuseaddr) +TEST_ENTRY(udp_connect) +TEST_ENTRY(udp_connect6) +TEST_ENTRY(udp_create_early) +TEST_ENTRY(udp_create_early_bad_bind) +TEST_ENTRY(udp_create_early_bad_domain) +TEST_ENTRY(udp_send_and_recv) +TEST_ENTRY(udp_send_hang_loop) +TEST_ENTRY(udp_send_immediate) +TEST_ENTRY(udp_send_unreachable) +TEST_ENTRY(udp_dgram_too_big) +TEST_ENTRY(udp_dual_stack) +TEST_ENTRY(udp_ipv6_only) +TEST_ENTRY(udp_options) +TEST_ENTRY(udp_options6) +TEST_ENTRY(udp_no_autobind) +TEST_ENTRY(udp_mmsg) +TEST_ENTRY(udp_multicast_interface) +TEST_ENTRY(udp_multicast_interface6) +TEST_ENTRY(udp_multicast_join) +TEST_ENTRY(udp_multicast_join6) +TEST_ENTRY(udp_multicast_ttl) +TEST_ENTRY(udp_sendmmsg_error) +TEST_ENTRY(udp_try_send) + +TEST_ENTRY(udp_open) +TEST_ENTRY(udp_open_twice) +TEST_ENTRY(udp_open_bound) +TEST_ENTRY(udp_open_connect) #ifndef _WIN32 - TEST_ENTRY (udp_send_unix) +TEST_ENTRY(udp_send_unix) #endif - TEST_ENTRY (pipe_bind_error_addrinuse) - TEST_ENTRY (pipe_bind_error_addrnotavail) - TEST_ENTRY (pipe_bind_error_inval) - TEST_ENTRY (pipe_connect_multiple) - TEST_ENTRY (pipe_listen_without_bind) - TEST_ENTRY (pipe_getsockname) - TEST_ENTRY (pipe_getsockname_abstract) - TEST_ENTRY (pipe_getsockname_blocking) - TEST_ENTRY (pipe_pending_instances) - TEST_ENTRY (pipe_sendmsg) - - TEST_ENTRY (connection_fail) - TEST_ENTRY (connection_fail_doesnt_auto_close) - - TEST_ENTRY (shutdown_close_tcp) - TEST_HELPER (shutdown_close_tcp, tcp4_echo_server) - TEST_ENTRY (shutdown_close_pipe) - TEST_HELPER (shutdown_close_pipe, pipe_echo_server) - - TEST_ENTRY (shutdown_eof) - TEST_HELPER (shutdown_eof, tcp4_echo_server) - - TEST_ENTRY (shutdown_simultaneous) - TEST_HELPER (shutdown_simultaneous, tcp4_echo_server) - - TEST_ENTRY (shutdown_twice) - TEST_HELPER (shutdown_twice, tcp4_echo_server) - - TEST_ENTRY (callback_stack) - TEST_HELPER (callback_stack, tcp4_echo_server) - - TEST_ENTRY (env_vars) +TEST_ENTRY(pipe_bind_error_addrinuse) +TEST_ENTRY(pipe_bind_error_addrnotavail) +TEST_ENTRY(pipe_bind_error_inval) +TEST_ENTRY(pipe_connect_multiple) +TEST_ENTRY(pipe_listen_without_bind) +TEST_ENTRY(pipe_getsockname) +TEST_ENTRY(pipe_getsockname_abstract) +TEST_ENTRY(pipe_getsockname_blocking) +TEST_ENTRY(pipe_pending_instances) +TEST_ENTRY(pipe_sendmsg) + +TEST_ENTRY(connection_fail) +TEST_ENTRY(connection_fail_doesnt_auto_close) + +TEST_ENTRY(shutdown_close_tcp) +TEST_HELPER(shutdown_close_tcp, tcp4_echo_server) +TEST_ENTRY(shutdown_close_pipe) +TEST_HELPER(shutdown_close_pipe, pipe_echo_server) + +TEST_ENTRY(shutdown_eof) +TEST_HELPER(shutdown_eof, tcp4_echo_server) + +TEST_ENTRY(shutdown_simultaneous) +TEST_HELPER(shutdown_simultaneous, tcp4_echo_server) + +TEST_ENTRY(shutdown_twice) +TEST_HELPER(shutdown_twice, tcp4_echo_server) + +TEST_ENTRY(callback_stack) +TEST_HELPER(callback_stack, tcp4_echo_server) + +TEST_ENTRY(env_vars) - TEST_ENTRY (error_message) - TEST_ENTRY (sys_error) +TEST_ENTRY(error_message) +TEST_ENTRY(sys_error) - TEST_ENTRY (timer) - TEST_ENTRY (timer_init) - TEST_ENTRY (timer_again) - TEST_ENTRY (timer_start_twice) - TEST_ENTRY (timer_order) - TEST_ENTRY (timer_huge_timeout) - TEST_ENTRY (timer_huge_repeat) - TEST_ENTRY (timer_run_once) - TEST_ENTRY (timer_from_check) - TEST_ENTRY (timer_is_closing) - TEST_ENTRY (timer_null_callback) - TEST_ENTRY (timer_early_check) - - TEST_ENTRY (idle_starvation) - - TEST_ENTRY (ref) - TEST_ENTRY (idle_ref) - TEST_ENTRY (fs_poll_ref) - TEST_ENTRY (async_ref) - TEST_ENTRY (prepare_ref) - TEST_ENTRY (check_ref) - TEST_ENTRY (unref_in_prepare_cb) - TEST_ENTRY (timer_ref) - TEST_ENTRY (timer_ref2) - TEST_ENTRY (fs_event_ref) - TEST_ENTRY (tcp_ref) - TEST_ENTRY (tcp_ref2) - TEST_ENTRY (tcp_ref2b) - TEST_ENTRY (tcp_ref3) - TEST_HELPER (tcp_ref3, tcp4_echo_server) - TEST_ENTRY (tcp_ref4) - TEST_HELPER (tcp_ref4, tcp4_echo_server) - TEST_ENTRY (udp_ref) - TEST_ENTRY (udp_ref2) - TEST_ENTRY (udp_ref3) - TEST_HELPER (udp_ref3, udp4_echo_server) - TEST_ENTRY (pipe_ref) - TEST_ENTRY (pipe_ref2) - TEST_ENTRY (pipe_ref3) - TEST_HELPER (pipe_ref3, pipe_echo_server) - TEST_ENTRY (pipe_ref4) - TEST_HELPER (pipe_ref4, pipe_echo_server) - TEST_ENTRY (process_ref) - TEST_ENTRY (process_priority) - TEST_ENTRY (has_ref) - - TEST_ENTRY (loop_handles) - TEST_ENTRY (walk_handles) - - TEST_ENTRY (watcher_cross_stop) - - TEST_ENTRY (active) - - TEST_ENTRY (embed) - - TEST_ENTRY (async) - TEST_ENTRY (async_null_cb) - TEST_ENTRY (eintr_handling) - - TEST_ENTRY (get_currentexe) - - TEST_ENTRY (process_title) - TEST_ENTRY (process_title_big_argv) - TEST_ENTRY (process_title_threadsafe) - - TEST_ENTRY (cwd_and_chdir) - - TEST_ENTRY (get_memory) - - TEST_ENTRY (get_passwd) +TEST_ENTRY(timer) +TEST_ENTRY(timer_init) +TEST_ENTRY(timer_again) +TEST_ENTRY(timer_start_twice) +TEST_ENTRY(timer_order) +TEST_ENTRY(timer_huge_timeout) +TEST_ENTRY(timer_huge_repeat) +TEST_ENTRY(timer_run_once) +TEST_ENTRY(timer_from_check) +TEST_ENTRY(timer_is_closing) +TEST_ENTRY(timer_null_callback) +TEST_ENTRY(timer_early_check) + +TEST_ENTRY(idle_starvation) + +TEST_ENTRY(ref) +TEST_ENTRY(idle_ref) +TEST_ENTRY(fs_poll_ref) +TEST_ENTRY(async_ref) +TEST_ENTRY(prepare_ref) +TEST_ENTRY(check_ref) +TEST_ENTRY(unref_in_prepare_cb) +TEST_ENTRY(timer_ref) +TEST_ENTRY(timer_ref2) +TEST_ENTRY(fs_event_ref) +TEST_ENTRY(tcp_ref) +TEST_ENTRY(tcp_ref2) +TEST_ENTRY(tcp_ref2b) +TEST_ENTRY(tcp_ref3) +TEST_HELPER(tcp_ref3, tcp4_echo_server) +TEST_ENTRY(tcp_ref4) +TEST_HELPER(tcp_ref4, tcp4_echo_server) +TEST_ENTRY(udp_ref) +TEST_ENTRY(udp_ref2) +TEST_ENTRY(udp_ref3) +TEST_HELPER(udp_ref3, udp4_echo_server) +TEST_ENTRY(pipe_ref) +TEST_ENTRY(pipe_ref2) +TEST_ENTRY(pipe_ref3) +TEST_HELPER(pipe_ref3, pipe_echo_server) +TEST_ENTRY(pipe_ref4) +TEST_HELPER(pipe_ref4, pipe_echo_server) +TEST_ENTRY(process_ref) +TEST_ENTRY(process_priority) +TEST_ENTRY(has_ref) + +TEST_ENTRY(loop_handles) +TEST_ENTRY(walk_handles) + +TEST_ENTRY(watcher_cross_stop) + +TEST_ENTRY(active) + +TEST_ENTRY(embed) + +TEST_ENTRY(async) +TEST_ENTRY(async_null_cb) +TEST_ENTRY(eintr_handling) + +TEST_ENTRY(get_currentexe) + +TEST_ENTRY(process_title) +TEST_ENTRY(process_title_big_argv) +TEST_ENTRY(process_title_threadsafe) + +TEST_ENTRY(cwd_and_chdir) + +TEST_ENTRY(get_memory) + +TEST_ENTRY(get_passwd) - TEST_ENTRY (get_loadavg) +TEST_ENTRY(get_loadavg) - TEST_ENTRY (handle_fileno) +TEST_ENTRY(handle_fileno) - TEST_ENTRY (homedir) +TEST_ENTRY(homedir) - TEST_ENTRY (tmpdir) +TEST_ENTRY(tmpdir) - TEST_ENTRY_CUSTOM (hrtime, 0, 0, 20000) +TEST_ENTRY_CUSTOM(hrtime, 0, 0, 20000) - TEST_ENTRY_CUSTOM (getaddrinfo_fail, 0, 0, 10000) - TEST_ENTRY_CUSTOM (getaddrinfo_fail_sync, 0, 0, 10000) +TEST_ENTRY_CUSTOM(getaddrinfo_fail, 0, 0, 10000) +TEST_ENTRY_CUSTOM(getaddrinfo_fail_sync, 0, 0, 10000) - TEST_ENTRY (getaddrinfo_basic) - TEST_ENTRY (getaddrinfo_basic_sync) - TEST_ENTRY (getaddrinfo_concurrent) +TEST_ENTRY(getaddrinfo_basic) +TEST_ENTRY(getaddrinfo_basic_sync) +TEST_ENTRY(getaddrinfo_concurrent) - TEST_ENTRY (gethostname) +TEST_ENTRY(gethostname) - TEST_ENTRY (getnameinfo_basic_ip4) - TEST_ENTRY (getnameinfo_basic_ip4_sync) - TEST_ENTRY (getnameinfo_basic_ip6) +TEST_ENTRY(getnameinfo_basic_ip4) +TEST_ENTRY(getnameinfo_basic_ip4_sync) +TEST_ENTRY(getnameinfo_basic_ip6) - TEST_ENTRY (getsockname_tcp) - TEST_ENTRY (getsockname_udp) - - TEST_ENTRY (gettimeofday) - - TEST_ENTRY (poll_duplex) - TEST_ENTRY (poll_unidirectional) - TEST_ENTRY (poll_close) - TEST_ENTRY (poll_bad_fdtype) -#if (defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))) && \ +TEST_ENTRY(getsockname_tcp) +TEST_ENTRY(getsockname_udp) + +TEST_ENTRY(gettimeofday) + +TEST_ENTRY(poll_duplex) +TEST_ENTRY(poll_unidirectional) +TEST_ENTRY(poll_close) +TEST_ENTRY(poll_bad_fdtype) +#if (defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))) && \ !defined(__sun) - TEST_ENTRY (poll_oob) +TEST_ENTRY(poll_oob) #endif #ifdef __linux__ - TEST_ENTRY (poll_nested_epoll) +TEST_ENTRY(poll_nested_epoll) #endif #ifdef UV_HAVE_KQUEUE - TEST_ENTRY (poll_nested_kqueue) +TEST_ENTRY(poll_nested_kqueue) #endif - TEST_ENTRY (poll_multiple_handles) +TEST_ENTRY(poll_multiple_handles) - TEST_ENTRY (socket_buffer_size) +TEST_ENTRY(socket_buffer_size) - TEST_ENTRY (spawn_fails) +TEST_ENTRY(spawn_fails) #ifndef _WIN32 - TEST_ENTRY (spawn_fails_check_for_waitpid_cleanup) +TEST_ENTRY(spawn_fails_check_for_waitpid_cleanup) #endif - TEST_ENTRY (spawn_empty_env) - TEST_ENTRY (spawn_exit_code) - TEST_ENTRY (spawn_stdout) - TEST_ENTRY (spawn_stdin) - TEST_ENTRY (spawn_stdio_greater_than_3) - TEST_ENTRY (spawn_ignored_stdio) - TEST_ENTRY (spawn_and_kill) - TEST_ENTRY (spawn_detached) - TEST_ENTRY (spawn_and_kill_with_std) - TEST_ENTRY (spawn_and_ping) - TEST_ENTRY (spawn_preserve_env) - TEST_ENTRY (spawn_setuid_fails) - TEST_ENTRY (spawn_setgid_fails) - TEST_ENTRY (spawn_stdout_to_file) - TEST_ENTRY (spawn_stdout_and_stderr_to_file) - TEST_ENTRY (spawn_stdout_and_stderr_to_file2) - TEST_ENTRY (spawn_stdout_and_stderr_to_file_swap) - TEST_ENTRY (spawn_auto_unref) - TEST_ENTRY (spawn_closed_process_io) - TEST_ENTRY (spawn_reads_child_path) - TEST_ENTRY (spawn_inherit_streams) - TEST_ENTRY (spawn_quoted_path) - TEST_ENTRY (spawn_tcp_server) - TEST_ENTRY (fs_poll) - TEST_ENTRY (fs_poll_getpath) - TEST_ENTRY (fs_poll_close_request) - TEST_ENTRY (fs_poll_close_request_multi_start_stop) - TEST_ENTRY (fs_poll_close_request_multi_stop_start) - TEST_ENTRY (fs_poll_close_request_stop_when_active) - TEST_ENTRY (kill) - TEST_ENTRY (kill_invalid_signum) - - TEST_ENTRY (poll_close_doesnt_corrupt_stack) - TEST_ENTRY (poll_closesocket) - TEST_ENTRY (close_fd) - TEST_ENTRY (closed_fd_events) - TEST_ENTRY (spawn_fs_open) +TEST_ENTRY(spawn_empty_env) +TEST_ENTRY(spawn_exit_code) +TEST_ENTRY(spawn_stdout) +TEST_ENTRY(spawn_stdin) +TEST_ENTRY(spawn_stdio_greater_than_3) +TEST_ENTRY(spawn_ignored_stdio) +TEST_ENTRY(spawn_and_kill) +TEST_ENTRY(spawn_detached) +TEST_ENTRY(spawn_and_kill_with_std) +TEST_ENTRY(spawn_and_ping) +TEST_ENTRY(spawn_preserve_env) +TEST_ENTRY(spawn_setuid_fails) +TEST_ENTRY(spawn_setgid_fails) +TEST_ENTRY(spawn_stdout_to_file) +TEST_ENTRY(spawn_stdout_and_stderr_to_file) +TEST_ENTRY(spawn_stdout_and_stderr_to_file2) +TEST_ENTRY(spawn_stdout_and_stderr_to_file_swap) +TEST_ENTRY(spawn_auto_unref) +TEST_ENTRY(spawn_closed_process_io) +TEST_ENTRY(spawn_reads_child_path) +TEST_ENTRY(spawn_inherit_streams) +TEST_ENTRY(spawn_quoted_path) +TEST_ENTRY(spawn_tcp_server) +TEST_ENTRY(fs_poll) +TEST_ENTRY(fs_poll_getpath) +TEST_ENTRY(fs_poll_close_request) +TEST_ENTRY(fs_poll_close_request_multi_start_stop) +TEST_ENTRY(fs_poll_close_request_multi_stop_start) +TEST_ENTRY(fs_poll_close_request_stop_when_active) +TEST_ENTRY(kill) +TEST_ENTRY(kill_invalid_signum) + +TEST_ENTRY(poll_close_doesnt_corrupt_stack) +TEST_ENTRY(poll_closesocket) +TEST_ENTRY(close_fd) +TEST_ENTRY(closed_fd_events) +TEST_ENTRY(spawn_fs_open) #ifdef _WIN32 - TEST_ENTRY (spawn_detect_pipe_name_collisions_on_windows) +TEST_ENTRY(spawn_detect_pipe_name_collisions_on_windows) #if !defined(USING_UV_SHARED) - TEST_ENTRY (argument_escaping) - TEST_ENTRY (environment_creation) -# endif - TEST_ENTRY (listen_with_simultaneous_accepts) - TEST_ENTRY (listen_no_simultaneous_accepts) - TEST_ENTRY (fs_stat_root) - TEST_ENTRY (spawn_with_an_odd_path) - TEST_ENTRY (ipc_listen_after_bind_twice) - TEST_ENTRY (win32_signum_number) +TEST_ENTRY(argument_escaping) +TEST_ENTRY(environment_creation) +#endif +TEST_ENTRY(listen_with_simultaneous_accepts) +TEST_ENTRY(listen_no_simultaneous_accepts) +TEST_ENTRY(fs_stat_root) +TEST_ENTRY(spawn_with_an_odd_path) +TEST_ENTRY(ipc_listen_after_bind_twice) +TEST_ENTRY(win32_signum_number) #else - TEST_ENTRY (emfile) - TEST_ENTRY (spawn_setuid_setgid) - TEST_ENTRY (we_get_signal) - TEST_ENTRY (we_get_signals) - TEST_ENTRY (we_get_signal_one_shot) - TEST_ENTRY (we_get_signals_mixed) - TEST_ENTRY (signal_multiple_loops) - TEST_ENTRY (signal_pending_on_close) - TEST_ENTRY (signal_close_loop_alive) +TEST_ENTRY(emfile) +TEST_ENTRY(spawn_setuid_setgid) +TEST_ENTRY(we_get_signal) +TEST_ENTRY(we_get_signals) +TEST_ENTRY(we_get_signal_one_shot) +TEST_ENTRY(we_get_signals_mixed) +TEST_ENTRY(signal_multiple_loops) +TEST_ENTRY(signal_pending_on_close) +TEST_ENTRY(signal_close_loop_alive) #endif #ifdef __APPLE__ - TEST_ENTRY (osx_select) - TEST_ENTRY (osx_select_many_fds) +TEST_ENTRY(osx_select) +TEST_ENTRY(osx_select_many_fds) #endif - TEST_ENTRY (fs_file_noent) - TEST_ENTRY (fs_file_nametoolong) - TEST_ENTRY (fs_file_loop) - TEST_ENTRY (fs_file_async) - TEST_ENTRY (fs_file_sync) - TEST_ENTRY (fs_file_write_null_buffer) - TEST_ENTRY (fs_async_dir) - TEST_ENTRY (fs_async_sendfile) - TEST_ENTRY (fs_async_sendfile_nodata) - TEST_ENTRY (fs_mkdtemp) - TEST_ENTRY (fs_mkstemp) - TEST_ENTRY (fs_fstat) - TEST_ENTRY (fs_access) - TEST_ENTRY (fs_chmod) - TEST_ENTRY (fs_copyfile) - TEST_ENTRY (fs_unlink_readonly) +TEST_ENTRY(fs_file_noent) +TEST_ENTRY(fs_file_nametoolong) +TEST_ENTRY(fs_file_loop) +TEST_ENTRY(fs_file_async) +TEST_ENTRY(fs_file_sync) +TEST_ENTRY(fs_file_write_null_buffer) +TEST_ENTRY(fs_async_dir) +TEST_ENTRY(fs_async_sendfile) +TEST_ENTRY(fs_async_sendfile_nodata) +TEST_ENTRY(fs_mkdtemp) +TEST_ENTRY(fs_mkstemp) +TEST_ENTRY(fs_fstat) +TEST_ENTRY(fs_access) +TEST_ENTRY(fs_chmod) +TEST_ENTRY(fs_copyfile) +TEST_ENTRY(fs_unlink_readonly) #ifdef _WIN32 - TEST_ENTRY (fs_unlink_archive_readonly) +TEST_ENTRY(fs_unlink_archive_readonly) #endif - TEST_ENTRY (fs_chown) - TEST_ENTRY (fs_utime) - TEST_ENTRY (fs_utime_round) - TEST_ENTRY (fs_futime) - TEST_ENTRY (fs_lutime) - TEST_ENTRY (fs_readlink) - TEST_ENTRY (fs_realpath) - TEST_ENTRY (fs_symlink) - TEST_ENTRY (fs_symlink_dir) +TEST_ENTRY(fs_chown) +TEST_ENTRY(fs_utime) +TEST_ENTRY(fs_utime_round) +TEST_ENTRY(fs_futime) +TEST_ENTRY(fs_lutime) +TEST_ENTRY(fs_readlink) +TEST_ENTRY(fs_realpath) +TEST_ENTRY(fs_symlink) +TEST_ENTRY(fs_symlink_dir) #ifdef _WIN32 - TEST_ENTRY (fs_symlink_junction) - TEST_ENTRY (fs_non_symlink_reparse_point) - TEST_ENTRY (fs_lstat_windows_store_apps) - TEST_ENTRY (fs_open_flags) +TEST_ENTRY(fs_symlink_junction) +TEST_ENTRY(fs_non_symlink_reparse_point) +TEST_ENTRY(fs_lstat_windows_store_apps) +TEST_ENTRY(fs_open_flags) #endif #if defined(_WIN32) && !defined(USING_UV_SHARED) - TEST_ENTRY (fs_fd_hash) +TEST_ENTRY(fs_fd_hash) #endif - TEST_ENTRY (fs_statfs) - TEST_ENTRY (fs_stat_missing_path) - TEST_ENTRY (fs_read_bufs) - TEST_ENTRY (fs_read_file_eof) - TEST_ENTRY (fs_file_open_append) - TEST_ENTRY (fs_event_watch_dir) - TEST_ENTRY (fs_event_watch_dir_recursive) +TEST_ENTRY(fs_statfs) +TEST_ENTRY(fs_stat_missing_path) +TEST_ENTRY(fs_read_bufs) +TEST_ENTRY(fs_read_file_eof) +TEST_ENTRY(fs_file_open_append) +TEST_ENTRY(fs_event_watch_dir) +TEST_ENTRY(fs_event_watch_dir_recursive) #ifdef _WIN32 - TEST_ENTRY (fs_event_watch_dir_short_path) +TEST_ENTRY(fs_event_watch_dir_short_path) #endif - TEST_ENTRY (fs_event_watch_file) - TEST_ENTRY (fs_event_watch_file_exact_path) - TEST_ENTRY (fs_event_watch_file_twice) - TEST_ENTRY (fs_event_watch_file_current_dir) +TEST_ENTRY(fs_event_watch_file) +TEST_ENTRY(fs_event_watch_file_exact_path) +TEST_ENTRY(fs_event_watch_file_twice) +TEST_ENTRY(fs_event_watch_file_current_dir) #ifdef _WIN32 - TEST_ENTRY (fs_event_watch_file_root_dir) +TEST_ENTRY(fs_event_watch_file_root_dir) #endif - TEST_ENTRY (fs_event_watch_invalid_path) - TEST_ENTRY (fs_event_no_callback_after_close) - TEST_ENTRY (fs_event_no_callback_on_close) - TEST_ENTRY (fs_event_immediate_close) - TEST_ENTRY (fs_event_close_with_pending_event) - TEST_ENTRY (fs_event_close_in_callback) - TEST_ENTRY (fs_event_start_and_close) - TEST_ENTRY_CUSTOM (fs_event_error_reporting, 0, 0, 60000) - TEST_ENTRY (fs_event_getpath) - TEST_ENTRY (fs_event_stop_in_cb) - TEST_ENTRY (fs_scandir_empty_dir) - TEST_ENTRY (fs_scandir_non_existent_dir) - TEST_ENTRY (fs_scandir_file) - TEST_ENTRY (fs_open_dir) - TEST_ENTRY (fs_readdir_empty_dir) - TEST_ENTRY (fs_readdir_file) - TEST_ENTRY (fs_readdir_non_empty_dir) - TEST_ENTRY (fs_readdir_non_existing_dir) - TEST_ENTRY (fs_rename_to_existing_file) - TEST_ENTRY (fs_write_multiple_bufs) - TEST_ENTRY (fs_write_alotof_bufs) - TEST_ENTRY (fs_write_alotof_bufs_with_offset) - TEST_ENTRY (fs_partial_read) - TEST_ENTRY (fs_partial_write) - TEST_ENTRY (fs_read_write_null_arguments) - TEST_ENTRY (fs_file_pos_after_op_with_offset) - TEST_ENTRY (fs_null_req) - TEST_ENTRY (fs_read_dir) +TEST_ENTRY(fs_event_watch_invalid_path) +TEST_ENTRY(fs_event_no_callback_after_close) +TEST_ENTRY(fs_event_no_callback_on_close) +TEST_ENTRY(fs_event_immediate_close) +TEST_ENTRY(fs_event_close_with_pending_event) +TEST_ENTRY(fs_event_close_in_callback) +TEST_ENTRY(fs_event_start_and_close) +TEST_ENTRY_CUSTOM(fs_event_error_reporting, 0, 0, 60000) +TEST_ENTRY(fs_event_getpath) +TEST_ENTRY(fs_event_stop_in_cb) +TEST_ENTRY(fs_scandir_empty_dir) +TEST_ENTRY(fs_scandir_non_existent_dir) +TEST_ENTRY(fs_scandir_file) +TEST_ENTRY(fs_open_dir) +TEST_ENTRY(fs_readdir_empty_dir) +TEST_ENTRY(fs_readdir_file) +TEST_ENTRY(fs_readdir_non_empty_dir) +TEST_ENTRY(fs_readdir_non_existing_dir) +TEST_ENTRY(fs_rename_to_existing_file) +TEST_ENTRY(fs_write_multiple_bufs) +TEST_ENTRY(fs_write_alotof_bufs) +TEST_ENTRY(fs_write_alotof_bufs_with_offset) +TEST_ENTRY(fs_partial_read) +TEST_ENTRY(fs_partial_write) +TEST_ENTRY(fs_read_write_null_arguments) +TEST_ENTRY(fs_file_pos_after_op_with_offset) +TEST_ENTRY(fs_null_req) +TEST_ENTRY(fs_read_dir) #ifdef _WIN32 - TEST_ENTRY (fs_file_pos_write) - TEST_ENTRY (fs_file_pos_append) - TEST_ENTRY (fs_exclusive_sharing_mode) - TEST_ENTRY (fs_file_flag_no_buffering) - TEST_ENTRY (fs_open_readonly_acl) - TEST_ENTRY (fs_fchmod_archive_readonly) - TEST_ENTRY (fs_invalid_mkdir_name) +TEST_ENTRY(fs_file_pos_write) +TEST_ENTRY(fs_file_pos_append) +TEST_ENTRY(fs_exclusive_sharing_mode) +TEST_ENTRY(fs_file_flag_no_buffering) +TEST_ENTRY(fs_open_readonly_acl) +TEST_ENTRY(fs_fchmod_archive_readonly) +TEST_ENTRY(fs_invalid_mkdir_name) #endif - TEST_ENTRY (fs_get_system_error) - TEST_ENTRY (get_osfhandle_valid_handle) - TEST_ENTRY (open_osfhandle_valid_handle) - TEST_ENTRY (strscpy) - TEST_ENTRY (threadpool_queue_work_simple) - TEST_ENTRY (threadpool_queue_work_einval) - TEST_ENTRY_CUSTOM (threadpool_multiple_event_loops, 0, 0, 60000) - TEST_ENTRY (threadpool_cancel_getaddrinfo) - TEST_ENTRY (threadpool_cancel_getnameinfo) - TEST_ENTRY (threadpool_cancel_random) - TEST_ENTRY (threadpool_cancel_work) - TEST_ENTRY (threadpool_cancel_fs) - TEST_ENTRY (threadpool_cancel_single) - TEST_ENTRY (thread_local_storage) - TEST_ENTRY (thread_stack_size) - TEST_ENTRY (thread_stack_size_explicit) - TEST_ENTRY (thread_mutex) - TEST_ENTRY (thread_mutex_recursive) - TEST_ENTRY (thread_rwlock) - TEST_ENTRY (thread_rwlock_trylock) - TEST_ENTRY (thread_create) - TEST_ENTRY (thread_equal) - TEST_ENTRY (dlerror) - TEST_ENTRY (ip4_addr) - TEST_ENTRY (ip6_addr_link_local) - TEST_ENTRY (ip_name) - - TEST_ENTRY (queue_foreach_delete) - - TEST_ENTRY (random_async) - TEST_ENTRY (random_sync) - - TEST_ENTRY (handle_type_name) - TEST_ENTRY (req_type_name) - TEST_ENTRY (getters_setters) +TEST_ENTRY(fs_get_system_error) +TEST_ENTRY(get_osfhandle_valid_handle) +TEST_ENTRY(open_osfhandle_valid_handle) +TEST_ENTRY(strscpy) +TEST_ENTRY(threadpool_queue_work_simple) +TEST_ENTRY(threadpool_queue_work_einval) +TEST_ENTRY_CUSTOM(threadpool_multiple_event_loops, 0, 0, 60000) +TEST_ENTRY(threadpool_cancel_getaddrinfo) +TEST_ENTRY(threadpool_cancel_getnameinfo) +TEST_ENTRY(threadpool_cancel_random) +TEST_ENTRY(threadpool_cancel_work) +TEST_ENTRY(threadpool_cancel_fs) +TEST_ENTRY(threadpool_cancel_single) +TEST_ENTRY(thread_local_storage) +TEST_ENTRY(thread_stack_size) +TEST_ENTRY(thread_stack_size_explicit) +TEST_ENTRY(thread_mutex) +TEST_ENTRY(thread_mutex_recursive) +TEST_ENTRY(thread_rwlock) +TEST_ENTRY(thread_rwlock_trylock) +TEST_ENTRY(thread_create) +TEST_ENTRY(thread_equal) +TEST_ENTRY(dlerror) +TEST_ENTRY(ip4_addr) +TEST_ENTRY(ip6_addr_link_local) +TEST_ENTRY(ip_name) + +TEST_ENTRY(queue_foreach_delete) + +TEST_ENTRY(random_async) +TEST_ENTRY(random_sync) + +TEST_ENTRY(handle_type_name) +TEST_ENTRY(req_type_name) +TEST_ENTRY(getters_setters) #ifndef _WIN32 - TEST_ENTRY (fork_timer) - TEST_ENTRY (fork_socketpair) - TEST_ENTRY (fork_socketpair_started) - TEST_ENTRY (fork_signal_to_child) - TEST_ENTRY (fork_signal_to_child_closed) +TEST_ENTRY(fork_timer) +TEST_ENTRY(fork_socketpair) +TEST_ENTRY(fork_socketpair_started) +TEST_ENTRY(fork_signal_to_child) +TEST_ENTRY(fork_signal_to_child_closed) #ifndef __APPLE__ - TEST_ENTRY (fork_fs_events_child) - TEST_ENTRY (fork_fs_events_child_dir) - TEST_ENTRY (fork_fs_events_file_parent_child) +TEST_ENTRY(fork_fs_events_child) +TEST_ENTRY(fork_fs_events_child_dir) +TEST_ENTRY(fork_fs_events_file_parent_child) #endif #ifndef __MVS__ - TEST_ENTRY (fork_threadpool_queue_work_simple) +TEST_ENTRY(fork_threadpool_queue_work_simple) #endif #endif - TEST_ENTRY (utf8_decode1) - TEST_ENTRY (utf8_decode1_overrun) - TEST_ENTRY (uname) +TEST_ENTRY(utf8_decode1) +TEST_ENTRY(utf8_decode1_overrun) +TEST_ENTRY(uname) /* Doesn't work on z/OS because that platform uses EBCDIC, not ASCII. */ #ifndef __MVS__ - TEST_ENTRY (idna_toascii) +TEST_ENTRY(idna_toascii) #endif - TEST_ENTRY (not_writable_after_shutdown) - TEST_HELPER (not_writable_after_shutdown, tcp4_echo_server) - TEST_ENTRY (not_readable_nor_writable_on_read_error) - TEST_HELPER (not_readable_nor_writable_on_read_error, tcp4_echo_server) - TEST_ENTRY (readable_on_eof) - TEST_HELPER (readable_on_eof, tcp4_echo_server) +TEST_ENTRY(not_writable_after_shutdown) +TEST_HELPER(not_writable_after_shutdown, tcp4_echo_server) +TEST_ENTRY(not_readable_nor_writable_on_read_error) +TEST_HELPER(not_readable_nor_writable_on_read_error, tcp4_echo_server) +TEST_ENTRY(readable_on_eof) +TEST_HELPER(readable_on_eof, tcp4_echo_server) - TEST_ENTRY (metrics_idle_time) - TEST_ENTRY (metrics_idle_time_thread) - TEST_ENTRY (metrics_idle_time_zero) +TEST_ENTRY(metrics_idle_time) +TEST_ENTRY(metrics_idle_time_thread) +TEST_ENTRY(metrics_idle_time_zero) #if 0 /* These are for testing the test runner. */ diff --git a/src/md5.h b/src/md5.h index f1a685764..5dcda5637 100644 --- a/src/md5.h +++ b/src/md5.h @@ -32,10 +32,10 @@ typedef unsigned int MD5_u32plus; typedef struct { - MD5_u32plus lo, hi; - MD5_u32plus a, b, c, d; - unsigned char buffer[64]; - MD5_u32plus block[16]; + MD5_u32plus lo, hi; + MD5_u32plus a, b, c, d; + unsigned char buffer[64]; + MD5_u32plus block[16]; } MD5_CTX; extern void MD5_Init(MD5_CTX *ctx); diff --git a/src/mime.cpp b/src/mime.cpp index 48a48269a..d769129a9 100644 --- a/src/mime.cpp +++ b/src/mime.cpp @@ -5,1561 +5,1569 @@ #include const std::map mime_map = { - {"%", "application/x-trash"}, - {"~", "application/x-trash"}, - {"123", "application/vnd.lotus-1-2-3"}, - {"1905.1", "application/vnd.ieee.1905"}, - {"1clr", "application/clr"}, - {"1km", "application/vnd.1000minds.decision-model+xml"}, - {"210", "application/p21"}, - {"3dm", "text/vnd.in3d.3dml"}, - {"3dml", "text/vnd.in3d.3dml"}, - {"3mf", "application/vnd.ms-3mfdocument"}, - {"3tz", "application/vnd.maxar.archive.3tz+zip"}, - {"726", "audio/32kadpcm"}, - {"7z", "application/x-7z-compressed"}, - {"a", "text/vnd.a"}, - {"a2l", "application/A2L"}, - {"aa3", "audio/ATRAC3"}, - {"aac", "audio/aac"}, - {"aal", "audio/ATRAC-ADVANCED-LOSSLESS"}, - {"abc", "text/vnd.abc"}, - {"abw", "application/x-abiword"}, - {"ac", "application/pkix-attr-cert"}, - {"ac2", "application/vnd.banana-accounting"}, - {"ac3", "audio/ac3"}, - {"acc", "application/vnd.americandynamics.acc"}, - {"acn", "audio/asc"}, - {"acu", "application/vnd.acucobol"}, - {"acutc", "application/vnd.acucorp"}, - {"adts", "audio/aac"}, - {"aep", "application/vnd.audiograph"}, - {"afp", "application/vnd.afpc.modca"}, - {"age", "application/vnd.age"}, - {"ahead", "application/vnd.ahead.space"}, - {"ai", "application/postscript"}, - {"aif", "audio/x-aiff"}, - {"aifc", "audio/x-aiff"}, - {"aiff", "audio/x-aiff"}, - {"aion", "application/vnd.veritone.aion+json"}, - {"ait", "application/vnd.dvb.ait"}, - {"alc", "chemical/x-alchemy"}, - {"ami", "application/vnd.amiga.ami"}, - {"aml", "application/AML"}, - {"amlx", "application/automationml-amlx+zip"}, - {"amr", "audio/AMR"}, - {"AMR", "audio/AMR"}, - {"anx", "application/annodex"}, - {"apex", "application/vnd.apexlang"}, - {"apexlang", "application/vnd.apexlang"}, - {"apk", "application/vnd.android.package-archive"}, - {"apkg", "application/vnd.anki"}, - {"apng", "image/apng"}, - {"appcache", "text/cache-manifest"}, - {"apr", "application/vnd.lotus-approach"}, - {"apxml", "application/auth-policy+xml"}, - {"arrow", "application/vnd.apache.arrow.file"}, - {"arrows", "application/vnd.apache.arrow.stream"}, - {"art", "image/x-jg"}, - {"artisan", "application/vnd.artisan+json"}, - {"asc", "application/pgp-keys"}, - {"ascii", "text/vnd.ascii-art"}, - {"asf", "application/vnd.ms-asf"}, - {"asice", "application/vnd.etsi.asic-e+zip"}, - {"asics", "application/vnd.etsi.asic-s+zip"}, - {"asn", "chemical/x-ncbi-asn1"}, - {"aso", "application/vnd.accpac.simply.aso"}, - {"ass", "audio/aac"}, - {"at3", "audio/ATRAC3"}, - {"atc", "application/vnd.acucorp"}, - {"atf", "application/ATF"}, - {"atfx", "application/ATFX"}, - {"atom", "application/atom+xml"}, - {"atomcat", "application/atomcat+xml"}, - {"atomdeleted", "application/atomdeleted+xml"}, - {"atomsrv", "application/atomserv+xml"}, - {"atomsvc", "application/atomsvc+xml"}, - {"atx", "audio/ATRAC-X"}, - {"atxml", "application/ATXML"}, - {"au", "audio/basic"}, - {"auc", "application/tamp-apex-update-confirm"}, - {"avci", "image/avci"}, - {"avcs", "image/avcs"}, - {"avi", "video/x-msvideo"}, - {"avif", "image/avif"}, - {"awb", "audio/AMR-WB"}, - {"AWB", "audio/AMR-WB"}, - {"axa", "audio/annodex"}, - {"axv", "video/annodex"}, - {"azf", "application/vnd.airzip.filesecure.azf"}, - {"azs", "application/vnd.airzip.filesecure.azs"}, - {"azv", "image/vnd.airzip.accelerator.azv"}, - {"azw3", "application/vnd.amazon.mobi8-ebook"}, - {"b", "chemical/x-molconn-Z"}, - {"b16", "image/vnd.pco.b16"}, - {"bak", "application/x-trash"}, - {"bar", "application/vnd.qualcomm.brew-app-res"}, - {"bary", "model/vnd.bary"}, - {"bat", "application/x-msdos-program"}, - {"bcpio", "application/x-bcpio"}, - {"bdm", "application/vnd.syncml.dm+wbxml"}, - {"bed", "application/vnd.realvnc.bed"}, - {"bh2", "application/vnd.fujitsu.oasysprs"}, - {"bib", "text/x-bibtex"}, - {"bik", "video/vnd.radgamettools.bink"}, - {"bin", "application/octet-stream"}, - {"bk2", "video/vnd.radgamettools.bink"}, - {"bkm", "application/vnd.nervana"}, - {"bmed", "multipart/vnd.bint.med-plus"}, - {"bmi", "application/vnd.bmi"}, - {"bmml", "application/vnd.balsamiq.bmml+xml"}, - {"bmp", "image/bmp"}, - {"bmpr", "application/vnd.balsamiq.bmpr"}, - {"boo", "text/x-boo"}, - {"book", "application/x-maker"}, - {"box", "application/vnd.previewsystems.box"}, - {"bpd", "application/vnd.hbci"}, - {"brf", "text/plain"}, - {"bsd", "chemical/x-crossfire"}, - {"bsp", "model/vnd.valve.source.compiled-map"}, - {"btf", "image/prs.btif"}, - {"btif", "image/prs.btif"}, - {"c", "text/x-csrc"}, - {"c++", "text/x-c++src"}, - {"c11amc", "application/vnd.cluetrust.cartomobile-config"}, - {"c11amz", "application/vnd.cluetrust.cartomobile-config-pkg"}, - {"c3d", "chemical/x-chem3d"}, - {"c3ex", "application/cccex"}, - {"c4d", "application/vnd.clonk.c4group"}, - {"c4f", "application/vnd.clonk.c4group"}, - {"c4g", "application/vnd.clonk.c4group"}, - {"c4p", "application/vnd.clonk.c4group"}, - {"c4u", "application/vnd.clonk.c4group"}, - {"c9r", "application/vnd.cryptomator.encrypted"}, - {"c9s", "application/vnd.cryptomator.encrypted"}, - {"cab", "application/vnd.ms-cab-compressed"}, - {"cac", "chemical/x-cache"}, - {"cache", "chemical/x-cache"}, - {"cap", "application/vnd.tcpdump.pcap"}, - {"car", "application/vnd.ipld.car"}, - {"carjson", "application/vnd.eu.kasparian.car+json"}, - {"cascii", "chemical/x-cactvs-binary"}, - {"cat", "application/vnd.ms-pki.seccat"}, - {"cbin", "chemical/x-cactvs-binary"}, - {"cbor", "application/cbor"}, - {"cbr", "application/vnd.comicbook-rar"}, - {"cbz", "application/vnd.comicbook+zip"}, - {"cc", "text/x-c++src"}, - {"ccc", "text/vnd.net2phone.commcenter.command"}, - {"ccmp", "application/ccmp+xml"}, - {"ccxml", "application/ccxml+xml"}, - {"cda", "application/x-cdf"}, - {"cdbcmsg", "application/vnd.contact.cmsg"}, - {"cdf", "application/x-cdf"}, - {"cdfx", "application/CDFX+XML"}, - {"cdkey", "application/vnd.mediastation.cdkey"}, - {"cdmia", "application/cdmi-capability"}, - {"cdmic", "application/cdmi-container"}, - {"cdmid", "application/cdmi-domain"}, - {"cdmio", "application/cdmi-object"}, - {"cdmiq", "application/cdmi-queue"}, - {"cdr", "image/x-coreldraw"}, - {"cdt", "image/x-coreldrawtemplate"}, - {"cdx", "chemical/x-cdx"}, - {"cdxml", "application/vnd.chemdraw+xml"}, - {"cdy", "application/vnd.cinderella"}, - {"cea", "application/CEA"}, - {"cef", "chemical/x-cxf"}, - {"cellml", "application/cellml+xml"}, - {"cer", "application/pkix-cert"}, - {"cgm", "image/cgm"}, - {"chm", "application/vnd.ms-htmlhelp"}, - {"chrt", "application/vnd.kde.kchart"}, - {"cif", "application/vnd.multiad.creator.cif"}, - {"cii", "application/vnd.anser-web-certificate-issue-initiation"}, - {"cil", "application/vnd.ms-artgalry"}, - {"cl", "application/simple-filter+xml"}, - {"cla", "application/vnd.claymore"}, - {"class", "application/java-vm"}, - {"cld", "model/vnd.cld"}, - {"clkk", "application/vnd.crick.clicker.keyboard"}, - {"clkp", "application/vnd.crick.clicker.palette"}, - {"clkt", "application/vnd.crick.clicker.template"}, - {"clkw", "application/vnd.crick.clicker.wordbank"}, - {"clkx", "application/vnd.crick.clicker"}, - {"cls", "text/x-tex"}, - {"clue", "application/clue_info+xml"}, - {"cmc", "application/vnd.cosmocaller"}, - {"cmdf", "chemical/x-cmdf"}, - {"cml", "application/cellml+xml"}, - {"cmp", "application/vnd.yellowriver-custom-menu"}, - {"cmsc", "application/cms"}, - {"cnd", "text/jcr-cnd"}, - {"cod", "application/vnd.rim.cod"}, - {"coffee", "application/vnd.coffeescript"}, - {"com", "application/x-msdos-program"}, - {"copyright", "text/vnd.debian.copyright"}, - {"coswid", "application/swid+cbor"}, - {"cpa", "chemical/x-compass"}, - {"cpio", "application/x-cpio"}, - {"cpkg", "application/vnd.xmpie.cpkg"}, - {"cpl", "application/cpl+xml"}, - {"cpp", "text/x-c++src"}, - {"cpt", "application/mac-compactpro"}, - {"CQL", "text/cql"}, - {"cr2", "image/x-canon-cr2"}, - {"crl", "application/pkix-crl"}, - {"crt", "application/x-x509-ca-cert"}, - {"crtr", "application/vnd.multiad.creator"}, - {"crw", "image/x-canon-crw"}, - {"cryptomator", "application/vnd.cryptomator.vault"}, - {"cryptonote", "application/vnd.rig.cryptonote"}, - {"csd", "audio/csound"}, - {"csf", "chemical/x-cache-csf"}, - {"csh", "application/x-csh"}, - {"csl", "application/vnd.citationstyles.style+xml"}, - {"csm", "chemical/x-csml"}, - {"csml", "chemical/x-csml"}, - {"csp", "application/vnd.commonspace"}, - {"csrattrs", "application/csrattrs"}, - {"css", "text/css"}, - {"cst", "application/vnd.commonspace"}, - {"csv", "text/csv"}, - {"csvs", "text/csv-schema"}, - {"ctab", "chemical/x-cactvs-binary"}, - {"ctx", "chemical/x-ctx"}, - {"cu", "application/cu-seeme"}, - {"cub", "chemical/x-gaussian-cube"}, - {"cuc", "application/tamp-community-update-confirm"}, - {"curl", "text/vnd.curl"}, - {"cw", "application/prs.cww"}, - {"cwl", "application/cwl"}, - {"cwl.json", "application/cwl+json"}, - {"cww", "application/prs.cww"}, - {"cxf", "chemical/x-cxf"}, - {"cxx", "text/x-c++src"}, - {"d", "text/x-dsrc"}, - {"dae", "model/vnd.collada+xml"}, - {"daf", "application/vnd.Mobius.DAF"}, - {"dart", "application/vnd.dart"}, - {"dataless", "application/vnd.fdsn.seed"}, - {"davmount", "application/davmount+xml"}, - {"dbf", "application/vnd.dbf"}, - {"dcd", "application/DCD"}, - {"dcm", "application/dicom"}, - {"dcr", "application/x-director"}, - {"dd2", "application/vnd.oma.dd2+xml"}, - {"ddd", "application/vnd.fujixerox.ddd"}, - {"ddeb", "application/vnd.debian.binary-package"}, - {"ddf", "application/vnd.syncml.dmddf+xml"}, - {"deb", "application/vnd.debian.binary-package"}, - {"deploy", "application/octet-stream"}, - {"dfac", "application/vnd.dreamfactory"}, - {"dif", "video/dv"}, - {"diff", "text/x-diff"}, - {"dii", "application/DII"}, - {"dim", "application/vnd.fastcopy-disk-image"}, - {"dir", "application/x-director"}, - {"dis", "application/vnd.Mobius.DIS"}, - {"dist", "application/vnd.apple.installer+xml"}, - {"distz", "application/vnd.apple.installer+xml"}, - {"dit", "application/DIT"}, - {"dive", "application/vnd.patentdive"}, - {"djv", "image/vnd.djvu"}, - {"djvu", "image/vnd.djvu"}, - {"dl", "application/vnd.datalog"}, - {"dll", "application/x-msdos-program"}, - {"dls", "audio/dls"}, - {"dmg", "application/x-apple-diskimage"}, - {"dmp", "application/vnd.tcpdump.pcap"}, - {"dms", "text/vnd.DMClientScript"}, - {"dna", "application/vnd.dna"}, - {"doc", "application/msword"}, - {"docjson", "application/vnd.document+json"}, - {"docm", "application/vnd.ms-word.document.macroEnabled.12"}, - {"docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"}, - {"dor", "model/vnd.gdl"}, - {"dot", "text/vnd.graphviz"}, - {"dotm", "application/vnd.ms-word.template.macroEnabled.12"}, - {"dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template"}, - {"dp", "application/vnd.osgi.dp"}, - {"dpg", "application/vnd.dpgraph"}, - {"dpgraph", "application/vnd.dpgraph"}, - {"dpkg", "application/vnd.xmpie.dpkg"}, - {"dpx", "image/dpx"}, - {"drle", "image/dicom-rle"}, - {"dsc", "text/prs.lines.tag"}, - {"dsm", "application/vnd.desmume.movie"}, - {"dssc", "application/dssc+der"}, - {"dtd", "application/xml-dtd"}, - {"dts", "audio/vnd.dts"}, - {"dtshd", "audio/vnd.dts.hd"}, - {"dv", "video/dv"}, - {"dvb", "video/vnd.dvb.file"}, - {"dvc", "application/dvcs"}, - {"dvi", "application/x-dvi"}, - {"dwd", "application/atsc-dwd+xml"}, - {"dwf", "model/vnd.dwf"}, - {"dwg", "image/vnd.dwg"}, - {"dx", "chemical/x-jcamp-dx"}, - {"dxf", "image/vnd.dxf"}, - {"dxp", "application/vnd.spotfire.dxp"}, - {"dxr", "application/x-director"}, - {"dzr", "application/vnd.dzr"}, - {"ebuild", "application/vnd.gentoo.ebuild"}, - {"ecelp4800", "audio/vnd.nuera.ecelp4800"}, - {"ecelp7470", "audio/vnd.nuera.ecelp7470"}, - {"ecelp9600", "audio/vnd.nuera.ecelp9600"}, - {"ecig", "application/vnd.evolv.ecig.settings"}, - {"ecigprofile", "application/vnd.evolv.ecig.profile"}, - {"ecigtheme", "application/vnd.evolv.ecig.theme"}, - {"eclass", "application/vnd.gentoo.eclass"}, - {"edm", "application/vnd.novadigm.EDM"}, - {"edx", "application/vnd.novadigm.EDX"}, - {"efi", "application/efi"}, - {"efif", "application/vnd.picsel"}, - {"ei6", "application/vnd.pg.osasli"}, - {"ELN", "application/vnd.eln+zip"}, - {"emb", "chemical/x-embl-dl-nucleotide"}, - {"embl", "chemical/x-embl-dl-nucleotide"}, - {"emf", "image/emf"}, - {"eml", "message/rfc822"}, - {"emm", "application/vnd.ibm.electronic-media"}, - {"emma", "application/emma+xml"}, - {"emotionml", "application/emotionml+xml"}, - {"ent", "application/xml-external-parsed-entity"}, - {"entity", "application/vnd.nervana"}, - {"enw", "audio/EVRCNW"}, - {"eol", "audio/vnd.digital-winds"}, - {"eot", "application/vnd.ms-fontobject"}, - {"ep", "application/vnd.bluetooth.ep.oob"}, - {"eps", "application/postscript"}, - {"eps2", "application/postscript"}, - {"eps3", "application/postscript"}, - {"epsf", "application/postscript"}, - {"epsi", "application/postscript"}, - {"epub", "application/epub+zip"}, - {"erf", "image/x-epson-erf"}, - {"es", "text/javascript"}, - {"es3", "application/vnd.eszigno3+xml"}, - {"esa", "application/vnd.osgi.subsystem"}, - {"esf", "application/vnd.epson.esf"}, - {"espass", "application/vnd.espass-espass+zip"}, - {"et3", "application/vnd.eszigno3+xml"}, - {"etx", "text/x-setext"}, - {"evb", "audio/EVRCB"}, - {"evc", "audio/EVRC"}, - {"evw", "audio/EVRCWB"}, - {"exe", "application/x-msdos-program"}, - {"exi", "application/exi"}, - {"exp", "application/express"}, - {"exr", "image/aces"}, - {"ext", "application/vnd.novadigm.EXT"}, - {"ez", "application/andrew-inset"}, - {"ez2", "application/vnd.ezpix-album"}, - {"ez3", "application/vnd.ezpix-package"}, - {"fb", "application/x-maker"}, - {"fbdoc", "application/x-maker"}, - {"fbs", "image/vnd.fastbidsheet"}, - {"fcdt", "application/vnd.adobe.formscentral.fcdt"}, - {"fch", "chemical/x-gaussian-checkpoint"}, - {"fchk", "chemical/x-gaussian-checkpoint"}, - {"fcs", "application/vnd.isac.fcs"}, - {"fdf", "application/fdf"}, - {"fdt", "application/fdt+xml"}, - {"fe_launch", "application/vnd.denovo.fcselayout-link"}, - {"fg5", "application/vnd.fujitsu.oasysgp"}, - {"fig", "application/x-xfig"}, - {"finf", "application/fastinfoset"}, - {"fit", "image/fits"}, - {"fits", "image/fits"}, - {"fla", "application/vnd.dtg.local.flash"}, - {"flac", "audio/flac"}, - {"flb", "application/vnd.ficlab.flb+zip"}, - {"fli", "video/fli"}, - {"flo", "application/vnd.micrografx.flo"}, - {"flt", "text/vnd.ficlab.flt"}, - {"flv", "video/x-flv"}, - {"flw", "application/vnd.kde.kivio"}, - {"flx", "text/vnd.fmi.flexstor"}, - {"fly", "text/vnd.fly"}, - {"fm", "application/vnd.framemaker"}, - {"fo", "application/vnd.software602.filler.form+xml"}, - {"fpx", "image/vnd.fpx"}, - {"frame", "application/x-maker"}, - {"frm", "application/vnd.ufdl"}, - {"fsc", "application/vnd.fsc.weblaunch"}, - {"fst", "image/vnd.fst"}, - {"ftc", "application/vnd.fluxtime.clip"}, - {"fti", "application/vnd.anser-web-funds-transfer-initiation"}, - {"fts", "image/fits"}, - {"fvt", "video/vnd.fvt"}, - {"fxp", "application/vnd.adobe.fxp"}, - {"fxpl", "application/vnd.adobe.fxp"}, - {"fzs", "application/vnd.fuzzysheet"}, - {"g2w", "application/vnd.geoplan"}, - {"g3w", "application/vnd.geospace"}, - {"gac", "application/vnd.groove-account"}, - {"gal", "chemical/x-gaussian-log"}, - {"gam", "chemical/x-gamess-input"}, - {"gamin", "chemical/x-gamess-input"}, - {"gan", "application/x-ganttproject"}, - {"gau", "chemical/x-gaussian-input"}, - {"gbr", "application/rpki-ghostbusters"}, - {"gcd", "text/x-pcs-gcd"}, - {"gcf", "application/x-graphing-calculator"}, - {"gcg", "chemical/x-gcg8-sequence"}, - {"gdl", "model/vnd.gdl"}, - {"gdz", "application/vnd.familysearch.gedcom+zip"}, - {"ged", "text/vnd.familysearch.gedcom"}, - {"gen", "chemical/x-genbank"}, - {"genozip", "application/vnd.genozip"}, - {"geo", "application/vnd.dynageo"}, - {"geojson", "application/geo+json"}, - {"gex", "application/vnd.geometry-explorer"}, - {"gf", "application/x-tex-gf"}, - {"gff3", "text/gff3"}, - {"ggb", "application/vnd.geogebra.file"}, - {"ggs", "application/vnd.geogebra.slides"}, - {"ggt", "application/vnd.geogebra.tool"}, - {"ghf", "application/vnd.groove-help"}, - {"gif", "image/gif"}, - {"gim", "application/vnd.groove-identity-message"}, - {"gjc", "chemical/x-gaussian-input"}, - {"gjf", "chemical/x-gaussian-input"}, - {"gl", "video/gl"}, - {"glb", "model/gltf-binary"}, - {"glbin", "application/gltf-buffer"}, - {"glbuf", "application/gltf-buffer"}, - {"gltf", "model/gltf+json"}, - {"gml", "application/gml+xml"}, - {"gnumeric", "application/x-gnumeric"}, - {"gph", "application/vnd.FloGraphIt"}, - {"gpkg", "application/geopackage+sqlite3"}, - {"gpkg.tar", "application/vnd.gentoo.gpkg"}, - {"gpt", "chemical/x-mopac-graph"}, - {"gqf", "application/vnd.grafeq"}, - {"gqs", "application/vnd.grafeq"}, - {"gram", "application/srgs"}, - {"grd", "application/vnd.gentics.grd+json"}, - {"gre", "application/vnd.geometry-explorer"}, - {"grv", "application/vnd.groove-injector"}, - {"grxml", "application/srgs+xml"}, - {"gsf", "application/x-font"}, - {"gsheet", "application/urc-grpsheet+xml"}, - {"gsm", "audio/x-gsm"}, - {"gtar", "application/x-gtar"}, - {"gtm", "application/vnd.groove-tool-message"}, - {"gtw", "model/vnd.gtw"}, - {"gv", "text/vnd.graphviz"}, - {"gxt", "application/vnd.geonext"}, - {"gz", "application/gzip"}, - {"h", "text/x-chdr"}, - {"h++", "text/x-c++hdr"}, - {"hal", "application/vnd.hal+xml"}, - {"hans", "text/vnd.hans"}, - {"hbc", "application/vnd.hbci"}, - {"hbci", "application/vnd.hbci"}, - {"hdf", "application/x-hdf"}, - {"hdr", "image/vnd.radiance"}, - {"hdt", "application/vnd.hdt"}, - {"heic", "image/heic"}, - {"heics", "image/heic-sequence"}, - {"heif", "image/heif"}, - {"heifs", "image/heif-sequence"}, - {"hej2", "image/hej2k"}, - {"held", "application/atsc-held+xml"}, - {"hgl", "text/vnd.hgl"}, - {"hh", "text/x-c++hdr"}, - {"hif", "image/avif"}, - {"hin", "chemical/x-hin"}, - {"hpgl", "application/vnd.hp-HPGL"}, - {"hpi", "application/vnd.hp-hpid"}, - {"hpid", "application/vnd.hp-hpid"}, - {"hpp", "text/x-c++hdr"}, - {"hps", "application/vnd.hp-hps"}, - {"hpub", "application/prs.hpub+zip"}, - {"hqx", "application/mac-binhex40"}, - {"hs", "text/x-haskell"}, - {"hsj2", "image/hsj2"}, - {"hsl", "application/vnd.hsl"}, - {"hta", "application/hta"}, - {"htc", "text/x-component"}, - {"htke", "application/vnd.kenameaapp"}, - {"htm", "text/html"}, - {"html", "text/html"}, - {"hvd", "application/vnd.yamaha.hv-dic"}, - {"hvp", "application/vnd.yamaha.hv-voice"}, - {"hvs", "application/vnd.yamaha.hv-script"}, - {"hwp", "application/x-hwp"}, - {"hxx", "text/x-c++hdr"}, - {"i2g", "application/vnd.intergeo"}, - {"ic0", "application/vnd.commerce-battelle"}, - {"ic1", "application/vnd.commerce-battelle"}, - {"ic2", "application/vnd.commerce-battelle"}, - {"ic3", "application/vnd.commerce-battelle"}, - {"ic4", "application/vnd.commerce-battelle"}, - {"ic5", "application/vnd.commerce-battelle"}, - {"ic6", "application/vnd.commerce-battelle"}, - {"ic7", "application/vnd.commerce-battelle"}, - {"ic8", "application/vnd.commerce-battelle"}, - {"ica", "application/x-ica"}, - {"icc", "application/vnd.iccprofile"}, - {"icd", "application/vnd.commerce-battelle"}, - {"icf", "application/vnd.commerce-battelle"}, - {"icm", "application/vnd.iccprofile"}, - {"ico", "image/vnd.microsoft.icon"}, - {"ics", "text/calendar"}, - {"ief", "image/ief"}, - {"ifb", "text/calendar"}, - {"ifc", "application/p21"}, - {"ifm", "application/vnd.shana.informed.formdata"}, - {"iges", "model/iges"}, - {"igl", "application/vnd.igloader"}, - {"igm", "application/vnd.insors.igm"}, - {"ign", "application/vnd.coreos.ignition+json"}, - {"ignition", "application/vnd.coreos.ignition+json"}, - {"igs", "model/iges"}, - {"igx", "application/vnd.micrografx.igx"}, - {"iif", "application/vnd.shana.informed.interchange"}, - {"iii", "application/x-iphone"}, - {"imf", "application/vnd.imagemeter.folder+zip"}, - {"imgcal", "application/vnd.3lightssoftware.imagescal"}, - {"imi", "application/vnd.imagemeter.image+zip"}, - {"imp", "application/vnd.accpac.simply.imp"}, - {"ims", "application/vnd.ms-ims"}, - {"imscc", "application/vnd.ims.imsccv1p1"}, - {"info", "application/x-info"}, - {"ink", "application/inkml+xml"}, - {"inkml", "application/inkml+xml"}, - {"inp", "chemical/x-gamess-input"}, - {"ins", "application/x-internet-signup"}, - {"iota", "application/vnd.astraea-software.iota"}, - {"ipfix", "application/ipfix"}, - {"ipk", "application/vnd.shana.informed.package"}, - {"ipns-record", "application/vnd.ipfs.ipns-record"}, - {"irm", "application/vnd.ibm.rights-management"}, - {"irp", "application/vnd.irepository.package+xml"}, - {"ism", "model/vnd.gdl"}, - {"iso", "application/x-iso9660-image"}, - {"isp", "application/x-internet-signup"}, - {"ist", "chemical/x-isostar"}, - {"istc", "application/vnd.veryant.thin"}, - {"istr", "chemical/x-isostar"}, - {"isws", "application/vnd.veryant.thin"}, - {"itp", "application/vnd.shana.informed.formtemplate"}, - {"its", "application/its+xml"}, - {"ivp", "application/vnd.immervision-ivp"}, - {"ivu", "application/vnd.immervision-ivu"}, - {"j2c", "image/j2c"}, - {"J2C", "image/j2c"}, - {"j2k", "image/j2c"}, - {"J2K", "image/j2c"}, - {"jad", "text/vnd.sun.j2me.app-descriptor"}, - {"jam", "application/vnd.jam"}, - {"jar", "application/java-archive"}, - {"java", "text/x-java"}, - {"jdx", "chemical/x-jcamp-dx"}, - {"jpeg", "image/jpeg"}, - {"jhc", "image/jphc"}, - {"jisp", "application/vnd.jisp"}, - {"jls", "image/jls"}, - {"jlt", "application/vnd.hp-jlyt"}, - {"jmz", "application/x-jmol"}, - {"jng", "image/x-jng"}, - {"jnlp", "application/x-java-jnlp-file"}, - {"joda", "application/vnd.joost.joda-archive"}, - {"jp2", "image/jp2"}, - {"jpg", "image/jpeg"}, - {"jpe", "image/jpeg"}, - {"jpf", "image/jpx"}, - {"jfif", "image/jpeg"}, - {"jpg2", "image/jp2"}, - {"jpgm", "image/jpm"}, - {"jph", "image/jph"}, - {"jphc", "image/jphc"}, - {"jpm", "image/jpm"}, - {"jpx", "image/jpx"}, - {"jrd", "application/jrd+json"}, - {"js", "text/javascript"}, - {"json", "application/json"}, - {"json-patch", "application/json-patch+json"}, - {"jsonld", "application/ld+json"}, - {"jsontd", "application/td+json"}, - {"jsontm", "application/tm+json"}, - {"jt", "model/JT"}, - {"jtd", "text/vnd.esmertec.theme-descriptor"}, - {"jxl", "image/jxl"}, - {"jxr", "image/jxr"}, - {"jxra", "image/jxrA"}, - {"jxrs", "image/jxrS"}, - {"jxs", "image/jxs"}, - {"jxsc", "image/jxsc"}, - {"jxsi", "image/jxsi"}, - {"jxss", "image/jxss"}, - {"karbon", "application/vnd.kde.karbon"}, - {"kcm", "application/vnd.nervana"}, - {"key", "application/pgp-keys"}, - {"keynote", "application/vnd.apple.keynote"}, - {"kfo", "application/vnd.kde.kformula"}, - {"kia", "application/vnd.kidspiration"}, - {"kil", "application/x-killustrator"}, - {"kin", "chemical/x-kinemage"}, - {"kml", "application/vnd.google-earth.kml+xml"}, - {"kmz", "application/vnd.google-earth.kmz"}, - {"kne", "application/vnd.Kinar"}, - {"knp", "application/vnd.Kinar"}, - {"kom", "application/vnd.hbci"}, - {"kon", "application/vnd.kde.kontour"}, - {"koz", "audio/vnd.audiokoz"}, - {"kpr", "application/vnd.kde.kpresenter"}, - {"kpt", "application/vnd.kde.kpresenter"}, - {"ksp", "application/vnd.kde.kspread"}, - {"ktr", "application/vnd.kahootz"}, - {"ktx", "image/ktx"}, - {"ktx2", "image/ktx2"}, - {"ktz", "application/vnd.kahootz"}, - {"kwd", "application/vnd.kde.kword"}, - {"kwt", "application/vnd.kde.kword"}, - {"l16", "audio/L16"}, - {"las", "application/vnd.las"}, - {"lasjson", "application/vnd.las.las+json"}, - {"lasxml", "application/vnd.las.las+xml"}, - {"latex", "application/x-latex"}, - {"lbc", "audio/iLBC"}, - {"lbd", "application/vnd.llamagraphics.life-balance.desktop"}, - {"lbe", "application/vnd.llamagraphics.life-balance.exchange+xml"}, - {"lca", "application/vnd.logipipe.circuit+zip"}, - {"lcs", "application/vnd.logipipe.circuit+zip"}, - {"le", "application/vnd.bluetooth.le.oob"}, - {"les", "application/vnd.hhe.lesson-player"}, - {"lgr", "application/lgr+xml"}, - {"lha", "application/x-lha"}, - {"lhs", "text/x-literate-haskell"}, - {"lhzd", "application/vnd.belightsoft.lhzd+zip"}, - {"lhzl", "application/vnd.belightsoft.lhzl+zip"}, - {"lin", "application/bbolin"}, - {"line", "application/vnd.nebumind.line"}, - {"link66", "application/vnd.route66.link66+xml"}, - {"list3820", "application/vnd.afpc.modca"}, - {"listafp", "application/vnd.afpc.modca"}, - {"lmp", "model/vnd.gdl"}, - {"loas", "audio/usac"}, - {"loom", "application/vnd.loom"}, - {"lostsyncxml", "application/lostsync+xml"}, - {"lostxml", "application/lost+xml"}, - {"lpf", "application/lpf+zip"}, - {"lrm", "application/vnd.ms-lrm"}, - {"lsf", "video/x-la-asf"}, - {"lsx", "video/x-la-asf"}, - {"ltx", "text/x-tex"}, - {"lvp", "audio/vnd.lucent.voice"}, - {"lwp", "application/vnd.lotus-wordpro"}, - {"lxf", "application/LXF"}, - {"ly", "text/x-lilypond"}, - {"lyx", "application/x-lyx"}, - {"lzh", "application/x-lzh"}, - {"lzx", "application/x-lzx"}, - {"m", "application/vnd.wolfram.mathematica.package"}, - {"m1v", "video/mpeg"}, - {"m21", "application/mp21"}, - {"m2v", "video/mpeg"}, - {"m3g", "application/m3g"}, - {"m3u", "audio/mpegurl"}, - {"m3u8", "application/vnd.apple.mpegurl"}, - {"m4a", "audio/mp4"}, - {"m4s", "video/iso.segment"}, - {"m4u", "video/vnd.mpegurl"}, - {"m4v", "video/mp4"}, - {"ma", "application/mathematica"}, - {"mads", "application/mads+xml"}, - {"maei", "application/mmt-aei+xml"}, - {"mag", "application/vnd.ecowin.chart"}, - {"mail", "message/rfc822"}, - {"maker", "application/x-maker"}, - {"man", "application/x-troff-man"}, - {"manifest", "text/cache-manifest"}, - {"markdown", "text/markdown"}, - {"mb", "application/mathematica"}, - {"mbk", "application/vnd.Mobius.MBK"}, - {"mbox", "application/mbox"}, - {"mbsdf", "application/vnd.mdl-mbsdf"}, - {"mc1", "application/vnd.medcalcdata"}, - {"mc2", "text/vnd.senx.warpscript"}, - {"mcd", "application/vnd.mcd"}, - {"mcif", "chemical/x-mmcif"}, - {"mcm", "chemical/x-macmolecule"}, - {"md", "text/markdown"}, - {"mdb", "application/msaccess"}, - {"mdc", "application/vnd.marlin.drm.mdcf"}, - {"mdi", "image/vnd.ms-modi"}, - {"mdl", "application/vnd.mdl"}, - {"me", "application/x-troff-me"}, - {"mesh", "model/mesh"}, - {"meta4", "application/metalink4+xml"}, - {"mets", "application/mets+xml"}, - {"mf4", "application/MF4"}, - {"mfm", "application/vnd.mfmp"}, - {"mft", "application/rpki-manifest"}, - {"mgp", "application/vnd.osgeo.mapguide.package"}, - {"mgz", "application/vnd.proteus.magazine"}, - {"mhas", "audio/mhas"}, - {"mid", "audio/sp-midi"}, - {"mif", "application/vnd.mif"}, - {"miz", "text/mizar"}, - {"mj2", "video/mj2"}, - {"mjp2", "video/mj2"}, - {"mjs", "text/javascript"}, - {"mkv", "video/x-matroska"}, - {"ml2", "application/vnd.sybyl.mol2"}, - {"mlp", "audio/vnd.dolby.mlp"}, - {"mm", "application/x-freemind"}, - {"mmd", "application/vnd.chipnuts.karaoke-mmd"}, - {"mmdb", "application/vnd.maxmind.maxmind-db"}, - {"mmf", "application/vnd.smaf"}, - {"mml", "application/mathml+xml"}, - {"mmod", "chemical/x-macromodel-input"}, - {"mmr", "image/vnd.fujixerox.edmics-mmr"}, - {"mng", "video/x-mng"}, - {"moc", "text/x-moc"}, - {"mod", "application/xml-dtd"}, - {"model-inter", "application/vnd.vd-study"}, - {"modl", "application/vnd.modl"}, - {"mods", "application/mods+xml"}, - {"mol", "chemical/x-mdl-molfile"}, - {"mol2", "application/vnd.sybyl.mol2"}, - {"moml", "model/vnd.moml+xml"}, - {"moo", "chemical/x-mopac-out"}, - {"mop", "chemical/x-mopac-input"}, - {"mopcrt", "chemical/x-mopac-input"}, - {"mov", "video/quicktime"}, - {"movie", "video/x-sgi-movie"}, - {"mp1", "audio/mpeg"}, - {"mp2", "audio/mpeg"}, - {"mp21", "application/mp21"}, - {"mp3", "audio/mpeg"}, - {"mp4", "video/mp4"}, - {"mpc", "application/vnd.mophun.certificate"}, - {"mpd", "application/dash+xml"}, - {"mpdd", "application/dashdelta"}, - {"mpe", "video/mpeg"}, - {"mpeg", "video/mpeg"}, - {"mpega", "audio/mpeg"}, - {"mpf", "text/vnd.ms-mediapackage"}, - {"mpg", "video/mpeg"}, - {"mpg4", "video/mp4"}, - {"mpga", "audio/mpeg"}, - {"mph", "application/x-comsol"}, - {"mpkg", "application/vnd.apple.installer+xml"}, - {"mpm", "application/vnd.blueice.multipass"}, - {"mpn", "application/vnd.mophun.application"}, - {"mpp", "application/vnd.ms-project"}, - {"mpt", "application/vnd.ms-project"}, - {"mpv", "video/x-matroska"}, - {"mpw", "application/vnd.exstream-empower+zip"}, - {"mpy", "application/vnd.ibm.MiniPay"}, - {"mqy", "application/vnd.Mobius.MQY"}, - {"mrc", "application/marc"}, - {"mrcx", "application/marcxml+xml"}, - {"ms", "application/x-troff-ms"}, - {"msa", "application/vnd.msa-disk-image"}, - {"msd", "application/vnd.fdsn.mseed"}, - {"mseed", "application/vnd.fdsn.mseed"}, - {"mseq", "application/vnd.mseq"}, - {"msf", "application/vnd.epson.msf"}, - {"msh", "model/mesh"}, - {"msi", "application/x-msi"}, - {"msl", "application/vnd.Mobius.MSL"}, - {"msm", "model/vnd.gdl"}, - {"msp", "application/octet-stream"}, - {"msty", "application/vnd.muvee.style"}, - {"msu", "application/octet-stream"}, - {"mtl", "model/mtl"}, - {"mts", "model/vnd.mts"}, - {"multitrack", "audio/vnd.presonus.multitrack"}, - {"mus", "application/vnd.musician"}, - {"musd", "application/mmt-usd+xml"}, - {"mvb", "chemical/x-mopac-vib"}, - {"mvt", "application/vnd.mapbox-vector-tile"}, - {"mwc", "application/vnd.dpgraph"}, - {"mwf", "application/vnd.MFER"}, - {"mxf", "application/mxf"}, - {"mxi", "application/vnd.vd-study"}, - {"mxl", "application/vnd.recordare.musicxml"}, - {"mxmf", "audio/mobile-xmf"}, - {"mxml", "application/xv+xml"}, - {"mxs", "application/vnd.triscape.mxs"}, - {"mxu", "video/vnd.mpegurl"}, - {"n3", "text/n3"}, - {"nb", "application/vnd.wolfram.mathematica"}, - {"nbp", "application/vnd.wolfram.player"}, - {"nc", "application/x-netcdf"}, - {"ndc", "application/vnd.osa.netdeploy"}, - {"ndl", "application/vnd.lotus-notes"}, - {"nds", "application/vnd.nintendo.nitro.rom"}, - {"nebul", "application/vnd.nebumind.line"}, - {"nef", "image/x-nikon-nef"}, - {"ngdat", "application/vnd.nokia.n-gage.data"}, - {"nim", "video/vnd.nokia.interleaved-multimedia"}, - {"nimn", "application/vnd.nimn"}, - {"nitf", "application/vnd.nitf"}, - {"nlu", "application/vnd.neurolanguage.nlu"}, - {"nml", "application/vnd.enliven"}, - {"nnd", "application/vnd.noblenet-directory"}, - {"nns", "application/vnd.noblenet-sealer"}, - {"nnw", "application/vnd.noblenet-web"}, - {"notebook", "application/vnd.smart.notebook"}, - {"nq", "application/n-quads"}, - {"ns2", "application/vnd.lotus-notes"}, - {"ns3", "application/vnd.lotus-notes"}, - {"ns4", "application/vnd.lotus-notes"}, - {"nsf", "application/vnd.lotus-notes"}, - {"nsg", "application/vnd.lotus-notes"}, - {"nsh", "application/vnd.lotus-notes"}, - {"nt", "application/n-triples"}, - {"ntf", "application/vnd.lotus-notes"}, - {"numbers", "application/vnd.apple.numbers"}, - {"nwc", "application/x-nwc"}, - {"o", "application/x-object"}, - {"oa2", "application/vnd.fujitsu.oasys2"}, - {"oa3", "application/vnd.fujitsu.oasys3"}, - {"oas", "application/vnd.fujitsu.oasys"}, - {"ob", "application/vnd.1ob"}, - {"obg", "application/vnd.openblox.game-binary"}, - {"obgx", "application/vnd.openblox.game+xml"}, - {"obj", "model/obj"}, - {"oda", "application/ODA"}, - {"odb", "application/vnd.oasis.opendocument.base"}, - {"odc", "application/vnd.oasis.opendocument.chart"}, - {"odd", "application/tei+xml"}, - {"odf", "application/vnd.oasis.opendocument.formula"}, - {"odg", "application/vnd.oasis.opendocument.graphics"}, - {"odi", "application/vnd.oasis.opendocument.image"}, - {"odm", "application/vnd.oasis.opendocument.text-master"}, - {"odp", "application/vnd.oasis.opendocument.presentation"}, - {"ods", "application/vnd.oasis.opendocument.spreadsheet"}, - {"odt", "application/vnd.oasis.opendocument.text"}, - {"odx", "application/ODX"}, - {"oeb", "application/vnd.openeye.oeb"}, - {"oga", "audio/ogg"}, - {"ogex", "model/vnd.opengex"}, - {"ogg", "audio/ogg"}, - {"ogv", "video/ogg"}, - {"ogx", "application/ogg"}, - {"old", "application/x-trash"}, - {"omg", "audio/ATRAC3"}, - {"one", "application/onenote"}, - {"onepkg", "application/onenote"}, - {"onetmp", "application/onenote"}, - {"onetoc2", "application/onenote"}, - {"opf", "application/oebps-package+xml"}, - {"oprc", "application/vnd.palm"}, - {"opus", "audio/ogg"}, - {"or2", "application/vnd.lotus-organizer"}, - {"or3", "application/vnd.lotus-organizer"}, - {"orc", "audio/csound"}, - {"orf", "image/x-olympus-orf"}, - {"org", "application/vnd.lotus-organizer"}, - {"orq", "application/ocsp-request"}, - {"ors", "application/ocsp-response"}, - {"osf", "application/vnd.yamaha.openscoreformat"}, - {"osm", "application/vnd.openstreetmap.data+xml"}, - {"ota", "application/vnd.android.ota"}, - {"otc", "application/vnd.oasis.opendocument.chart-template"}, - {"otf", "font/otf"}, - {"otg", "application/vnd.oasis.opendocument.graphics-template"}, - {"oth", "application/vnd.oasis.opendocument.text-web"}, - {"oti", "application/vnd.oasis.opendocument.image-template"}, - {"otm", "application/vnd.oasis.opendocument.text-master-template"}, - {"otp", "application/vnd.oasis.opendocument.presentation-template"}, - {"ots", "application/vnd.oasis.opendocument.spreadsheet-template"}, - {"ott", "application/vnd.oasis.opendocument.text-template"}, - {"ovl", "application/vnd.afpc.modca-overlay"}, - {"oxlicg", "application/vnd.oxli.countgraph"}, - {"oxps", "application/oxps"}, - {"oxt", "application/vnd.openofficeorg.extension"}, - {"oza", "application/x-oz-application"}, - {"p", "text/x-pascal"}, - {"p10", "application/pkcs10"}, - {"p12", "application/pkcs12"}, - {"p21", "application/p21"}, - {"p2p", "application/vnd.wfa.p2p"}, - {"p7c", "application/pkcs7-mime"}, - {"p7m", "application/pkcs7-mime"}, - {"p7r", "application/x-pkcs7-certreqresp"}, - {"p7s", "application/pkcs7-signature"}, - {"p7z", "application/pkcs7-mime"}, - {"p8", "application/pkcs8"}, - {"p8e", "application/pkcs8-encrypted"}, - {"pac", "application/x-ns-proxy-autoconfig"}, - {"package", "application/vnd.autopackage"}, - {"pages", "application/vnd.apple.pages"}, - {"pas", "text/x-pascal"}, - {"pat", "image/x-coreldrawpattern"}, - {"patch", "text/x-diff"}, - {"paw", "application/vnd.pawaafile"}, - {"pbd", "application/vnd.powerbuilder6"}, - {"pbm", "image/x-portable-bitmap"}, - {"pcap", "application/vnd.tcpdump.pcap"}, - {"pcf", "application/x-font-pcf"}, - {"pcf.Z", "application/x-font-pcf"}, - {"pcl", "application/vnd.hp-PCL"}, - {"pcx", "image/vnd.zbrush.pcx"}, - {"pdb", "application/vnd.palm"}, - {"pdf", "application/pdf"}, - {"pdx", "application/PDX"}, - {"pem", "application/pem-certificate-chain"}, - {"pfa", "application/x-font"}, - {"pfb", "application/x-font"}, - {"pfr", "application/font-tdpfr"}, - {"pfx", "application/pkcs12"}, - {"pgb", "image/vnd.globalgraphics.pgb"}, - {"PGB", "image/vnd.globalgraphics.pgb"}, - {"pgm", "image/x-portable-graymap"}, - {"pgn", "application/vnd.chess-pgn"}, - {"pgp", "application/pgp-encrypted"}, - {"pil", "application/vnd.piaccess.application-licence"}, - {"pk", "application/x-tex-pk"}, - {"pkd", "application/vnd.hbci"}, - {"pkg", "application/vnd.apple.installer+xml"}, - {"pki", "application/pkixcmp"}, - {"pkipath", "application/pkix-pkipath"}, - {"pl", "text/x-perl"}, - {"plb", "application/vnd.3gpp.pic-bw-large"}, - {"plc", "application/vnd.Mobius.PLC"}, - {"plf", "application/vnd.pocketlearn"}, - {"plj", "audio/vnd.everad.plj"}, - {"plp", "application/vnd.panoply"}, - {"pls", "audio/x-scpls"}, - {"pm", "text/x-perl"}, - {"pml", "application/vnd.ctc-posml"}, - {"png", "image/png"}, - {"pnm", "image/x-portable-anymap"}, - {"portpkg", "application/vnd.macports.portpkg"}, - {"pot", "text/plain"}, - {"potm", "application/vnd.ms-powerpoint.template.macroEnabled.12"}, - {"potx", "application/vnd.openxmlformats-officedocument.presentationml.template"}, - {"ppam", "application/vnd.ms-powerpoint.addin.macroEnabled.12"}, - {"ppd", "application/vnd.cups-ppd"}, - {"ppkg", "application/vnd.xmpie.ppkg"}, - {"ppm", "image/x-portable-pixmap"}, - {"pps", "application/vnd.ms-powerpoint"}, - {"ppsm", "application/vnd.ms-powerpoint.slideshow.macroEnabled.12"}, - {"ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow"}, - {"ppt", "application/vnd.ms-powerpoint"}, - {"pptm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12"}, - {"ppttc", "application/vnd.think-cell.ppttc+json"}, - {"pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"}, - {"pqa", "application/vnd.palm"}, - {"prc", "model/prc"}, - {"pre", "application/vnd.lotus-freelance"}, - {"preminet", "application/vnd.preminet"}, - {"prf", "application/pics-rules"}, - {"provn", "text/provenance-notation"}, - {"provx", "application/provenance+xml"}, - {"prt", "chemical/x-ncbi-asn1-ascii"}, - {"prz", "application/vnd.lotus-freelance"}, - {"ps", "application/postscript"}, - {"psb", "application/vnd.3gpp.pic-bw-small"}, - {"psd", "image/vnd.adobe.photoshop"}, - {"pseg3820", "application/vnd.afpc.modca"}, - {"psfs", "application/vnd.psfs"}, - {"psg", "application/vnd.afpc.modca-pagesegment"}, - {"psid", "audio/prs.sid"}, - {"pskcxml", "application/pskc+xml"}, - {"pt", "application/vnd.snesdev-page-table"}, - {"pti", "image/prs.pti"}, - {"ptid", "application/vnd.pvi.ptid1"}, - {"ptrom", "application/vnd.snesdev-page-table"}, - {"pub", "application/vnd.exstream-package"}, - {"pvb", "application/vnd.3gpp.pic-bw-var"}, - {"pwn", "application/vnd.3M.Post-it-Notes"}, - {"py", "text/x-python"}, - {"pya", "audio/vnd.ms-playready.media.pya"}, - {"pyc", "application/x-python-code"}, - {"pyo", "application/x-python-code"}, - {"pyox", "model/vnd.pytha.pyox"}, - {"pyv", "video/vnd.ms-playready.media.pyv"}, - {"qam", "application/vnd.epson.quickanime"}, - {"qbo", "application/vnd.intu.qbo"}, - {"qca", "application/vnd.ericsson.quickcall"}, - {"qcall", "application/vnd.ericsson.quickcall"}, - {"qcp", "audio/EVRC-QCP"}, - {"QCP", "audio/EVRC-QCP"}, - {"qfx", "application/vnd.intu.qfx"}, - {"qgs", "application/x-qgis"}, - {"qps", "application/vnd.publishare-delta-tree"}, - {"qt", "video/quicktime"}, - {"qtl", "application/x-quicktimeplayer"}, - {"quiz", "application/vnd.quobject-quoxdocument"}, - {"quox", "application/vnd.quobject-quoxdocument"}, - {"qvd", "application/vnd.theqvd"}, - {"qwd", "application/vnd.Quark.QuarkXPress"}, - {"qwt", "application/vnd.Quark.QuarkXPress"}, - {"qxb", "application/vnd.Quark.QuarkXPress"}, - {"qxd", "application/vnd.Quark.QuarkXPress"}, - {"qxl", "application/vnd.Quark.QuarkXPress"}, - {"qxt", "application/vnd.Quark.QuarkXPress"}, - {"ra", "audio/x-pn-realaudio"}, - {"ram", "audio/x-pn-realaudio"}, - {"rapd", "application/route-apd+xml"}, - {"rar", "application/vnd.rar"}, - {"ras", "image/x-cmu-raster"}, - {"rb", "application/x-ruby"}, - {"rcprofile", "application/vnd.ipunplugged.rcprofile"}, - {"rct", "application/prs.nprend"}, - {"rd", "chemical/x-mdl-rdfile"}, - {"rdf", "application/rdf+xml"}, - {"rdf-crypt", "application/prs.rdf-xml-crypt"}, - {"rdp", "application/x-rdp"}, - {"rdz", "application/vnd.data-vision.rdz"}, - {"relo", "application/p2p-overlay+xml"}, - {"reload", "application/vnd.resilient.logic"}, - {"rep", "application/vnd.businessobjects"}, - {"request", "application/vnd.nervana"}, - {"rfcxml", "application/rfc+xml"}, - {"rgb", "image/x-rgb"}, - {"rgbe", "image/vnd.radiance"}, - {"rif", "application/reginfo+xml"}, - {"rip", "audio/vnd.rip"}, - {"rl", "application/resource-lists+xml"}, - {"rlc", "image/vnd.fujixerox.edmics-rlc"}, - {"rld", "application/resource-lists-diff+xml"}, - {"rlm", "application/vnd.resilient.logic"}, - {"rm", "audio/x-pn-realaudio"}, - {"rms", "application/vnd.jcp.javame.midlet-rms"}, - {"rnc", "application/relax-ng-compact-syntax"}, - {"rnd", "application/prs.nprend"}, - {"roa", "application/rpki-roa"}, - {"roff", "text/troff"}, - {"ros", "chemical/x-rosdal"}, - {"rp9", "application/vnd.cloanto.rp9"}, - {"rpm", "application/x-redhat-package-manager"}, - {"rpss", "application/vnd.nokia.radio-presets"}, - {"rpst", "application/vnd.nokia.radio-preset"}, - {"rq", "application/sparql-query"}, - {"rs", "application/rls-services+xml"}, - {"rsat", "application/atsc-rsat+xml"}, - {"rsheet", "application/urc-ressheet+xml"}, - {"rsm", "model/vnd.gdl"}, - {"rss", "application/x-rss+xml"}, - {"rst", "text/prs.fallenstein.rst"}, - {"rtf", "application/rtf"}, - {"rusd", "application/route-usd+xml"}, - {"rxn", "chemical/x-mdl-rxnfile"}, - {"rxt", "application/vnd.medicalholodeck.recordxr"}, - {"s11", "video/vnd.sealed.mpeg1"}, - {"s14", "video/vnd.sealed.mpeg4"}, - {"s1a", "application/vnd.sealedmedia.softseal.pdf"}, - {"s1e", "application/vnd.sealed.xls"}, - {"s1g", "image/vnd.sealedmedia.softseal.gif"}, - {"s1h", "application/vnd.sealedmedia.softseal.html"}, - {"s1j", "image/vnd.sealedmedia.softseal.jpg"}, - {"s1m", "audio/vnd.sealedmedia.softseal.mpeg"}, - {"s1n", "image/vnd.sealed.png"}, - {"s1p", "application/vnd.sealed.ppt"}, - {"s1q", "video/vnd.sealedmedia.softseal.mov"}, - {"s1w", "application/vnd.sealed.doc"}, - {"s3df", "application/vnd.sealed.3df"}, - {"sac", "application/tamp-sequence-adjust-confirm"}, - {"saf", "application/vnd.yamaha.smaf-audio"}, - {"sam", "application/vnd.lotus-wordpro"}, - {"SAR", "application/vnd.sar"}, - {"sarif", "application/sarif+json"}, - {"sarif-external-properties", "application/sarif-external-properties+json"}, - {"sarif-external-properties.json", "application/sarif-external-properties+json"}, - {"sarif.json", "application/sarif+json"}, - {"sc", "application/vnd.ibm.secure-container"}, - {"scala", "text/x-scala"}, - {"scd", "application/vnd.scribus"}, - {"sce", "application/vnd.etsi.asic-e+zip"}, - {"sci", "application/x-scilab"}, - {"scim", "application/scim+json"}, - {"scl", "application/vnd.sycle+xml"}, - {"scld", "application/vnd.doremir.scorecloud-binary-document"}, - {"scm", "application/vnd.lotus-screencam"}, - {"sco", "audio/csound"}, - {"scq", "application/scvp-cv-request"}, - {"scr", "application/x-silverlight"}, - {"scs", "application/scvp-cv-response"}, - {"scsf", "application/vnd.sealed.csf"}, - {"sd", "chemical/x-mdl-sdfile"}, - {"sd2", "audio/x-sd2"}, - {"sda", "application/vnd.stardivision.draw"}, - {"sdc", "application/vnd.stardivision.calc"}, - {"sdd", "application/vnd.stardivision.impress"}, - {"sdf", "application/vnd.Kinar"}, - {"sdkd", "application/vnd.solent.sdkm+xml"}, - {"sdkm", "application/vnd.solent.sdkm+xml"}, - {"sdo", "application/vnd.sealed.doc"}, - {"sdoc", "application/vnd.sealed.doc"}, - {"sdp", "application/sdp"}, - {"sds", "application/vnd.stardivision.chart"}, - {"sdw", "application/vnd.stardivision.writer"}, - {"see", "application/vnd.seemail"}, - {"seed", "application/vnd.fdsn.seed"}, - {"sem", "application/vnd.sealed.eml"}, - {"sema", "application/vnd.sema"}, - {"semd", "application/vnd.semd"}, - {"semf", "application/vnd.semf"}, - {"seml", "application/vnd.sealed.eml"}, - {"senml", "application/senml+json"}, - {"senml-etchc", "application/senml-etch+cbor"}, - {"senml-etchj", "application/senml-etch+json"}, - {"senmlc", "application/senml+cbor"}, - {"senmle", "application/senml-exi"}, - {"senmlx", "application/senml+xml"}, - {"sensml", "application/sensml+json"}, - {"sensmlc", "application/sensml+cbor"}, - {"sensmle", "application/sensml-exi"}, - {"sensmlx", "application/sensml+xml"}, - {"ser", "application/java-serialized-object"}, - {"sfc", "application/vnd.nintendo.snes.rom"}, - {"sfd", "application/vnd.font-fontforge-sfd"}, - {"sfd-hdstx", "application/vnd.hydrostatix.sof-data"}, - {"sfs", "application/vnd.spotfire.sfs"}, - {"sfv", "text/x-sfv"}, - {"sgf", "application/x-go-sgf"}, - {"sgi", "image/vnd.sealedmedia.softseal.gif"}, - {"sgif", "image/vnd.sealedmedia.softseal.gif"}, - {"sgl", "application/vnd.stardivision.writer-global"}, - {"sgm", "text/SGML"}, - {"sgml", "text/SGML"}, - {"sh", "application/x-sh"}, - {"shaclc", "text/shaclc"}, - {"shar", "application/x-shar"}, - {"shc", "text/shaclc"}, - {"shex", "text/shex"}, - {"shf", "application/shf+xml"}, - {"shp", "application/vnd.shp"}, - {"shtml", "text/html"}, - {"shx", "application/vnd.shx"}, - {"si", "text/vnd.wap.si"}, - {"sic", "application/vnd.wap.sic"}, - {"sid", "audio/prs.sid"}, - {"sieve", "application/sieve"}, - {"sig", "application/pgp-signature"}, - {"sik", "application/x-trash"}, - {"silo", "model/mesh"}, - {"sipa", "application/vnd.smintio.portals.archive"}, - {"sis", "application/vnd.symbian.install"}, - {"sit", "application/x-stuffit"}, - {"sitx", "application/x-stuffit"}, - {"siv", "application/sieve"}, - {"sjp", "image/vnd.sealedmedia.softseal.jpg"}, - {"sjpg", "image/vnd.sealedmedia.softseal.jpg"}, - {"skd", "application/vnd.koan"}, - {"skm", "application/vnd.koan"}, - {"skp", "application/vnd.koan"}, - {"skt", "application/vnd.koan"}, - {"sl", "text/vnd.wap.sl"}, - {"sla", "application/vnd.scribus"}, - {"slaz", "application/vnd.scribus"}, - {"slc", "application/vnd.wap.slc"}, - {"sldm", "application/vnd.ms-powerpoint.slide.macroEnabled.12"}, - {"sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide"}, - {"sls", "application/route-s-tsid+xml"}, - {"slt", "application/vnd.epson.salt"}, - {"sm", "application/vnd.stepmania.stepchart"}, - {"smc", "application/vnd.nintendo.snes.rom"}, - {"smf", "application/vnd.stardivision.math"}, - {"smh", "application/vnd.sealed.mht"}, - {"smht", "application/vnd.sealed.mht"}, - {"smi", "application/smil+xml"}, - {"smil", "application/smil+xml"}, - {"smk", "video/vnd.radgamettools.smacker"}, - {"sml", "application/smil+xml"}, - {"smo", "video/vnd.sealedmedia.softseal.mov"}, - {"smov", "video/vnd.sealedmedia.softseal.mov"}, - {"smp", "audio/vnd.sealedmedia.softseal.mpeg"}, - {"smp3", "audio/vnd.sealedmedia.softseal.mpeg"}, - {"smpg", "video/vnd.sealed.mpeg1"}, - {"sms", "application/vnd.3gpp2.sms"}, - {"smv", "audio/SMV"}, - {"smzip", "application/vnd.stepmania.package"}, - {"snd", "audio/basic"}, - {"soa", "text/dns"}, - {"soc", "application/sgml-open-catalog"}, - {"sofa", "audio/sofa"}, - {"sos", "text/vnd.sosi"}, - {"spc", "chemical/x-galactic-spc"}, - {"spd", "application/vnd.sealedmedia.softseal.pdf"}, - {"spdf", "application/vnd.sealedmedia.softseal.pdf"}, - {"spdx", "text/spdx"}, - {"spdx.json", "application/spdx+json"}, - {"spf", "application/vnd.yamaha.smaf-phrase"}, - {"spl", "application/futuresplash"}, - {"spn", "image/vnd.sealed.png"}, - {"spng", "image/vnd.sealed.png"}, - {"spo", "text/vnd.in3d.spot"}, - {"spot", "text/vnd.in3d.spot"}, - {"spp", "application/scvp-vp-response"}, - {"sppt", "application/vnd.sealed.ppt"}, - {"spq", "application/scvp-vp-request"}, - {"spx", "audio/ogg"}, - {"sql", "application/sql"}, - {"sqlite", "application/vnd.sqlite3"}, - {"sqlite3", "application/vnd.sqlite3"}, - {"sr", "application/vnd.sigrok.session"}, - {"src", "application/x-wais-source"}, - {"srt", "text/plain"}, - {"sru", "application/sru+xml"}, - {"srx", "application/sparql-results+xml"}, - {"sse", "application/vnd.kodak-descriptor"}, - {"ssf", "application/vnd.epson.ssf"}, - {"ssml", "application/ssml+xml"}, - {"ssv", "application/vnd.shade-save-file"}, - {"ssvc", "application/vnd.crypto-shade-file"}, - {"ssw", "video/vnd.sealed.swf"}, - {"sswf", "video/vnd.sealed.swf"}, - {"st", "application/vnd.sailingtracker.track"}, - {"stc", "application/vnd.sun.xml.calc.template"}, - {"std", "application/vnd.sun.xml.draw.template"}, - {"step", "model/step"}, - {"stf", "application/vnd.wt.stf"}, - {"sti", "application/vnd.sun.xml.impress.template"}, - {"stif", "application/vnd.sealed.tiff"}, - {"stix", "application/stix+json"}, - {"stk", "application/hyperstudio"}, - {"stl", "model/stl"}, - {"stml", "application/vnd.sealedmedia.softseal.html"}, - {"stp", "model/step"}, - {"stpnc", "application/p21"}, - {"stpx", "model/step+xml"}, - {"stpxz", "model/step-xml+zip"}, - {"stpz", "model/step+zip"}, - {"str", "application/vnd.pg.format"}, - {"study-inter", "application/vnd.vd-study"}, - {"stw", "application/vnd.sun.xml.writer.template"}, - {"sty", "text/x-tex"}, - {"sus", "application/vnd.sus-calendar"}, - {"susp", "application/vnd.sus-calendar"}, - {"sv4cpio", "application/x-sv4cpio"}, - {"sv4crc", "application/x-sv4crc"}, - {"svc", "application/vnd.dvb.service"}, - {"svg", "image/svg+xml"}, - {"svgz", "image/svg+xml"}, - {"sw", "chemical/x-swissprot"}, - {"swf", "application/vnd.adobe.flash.movie"}, - {"swi", "application/vnd.aristanetworks.swi"}, - {"swidtag", "application/swid+xml"}, - {"sxc", "application/vnd.sun.xml.calc"}, - {"sxd", "application/vnd.sun.xml.draw"}, - {"sxg", "application/vnd.sun.xml.writer.global"}, - {"sxi", "application/vnd.sun.xml.impress"}, - {"sxl", "application/vnd.sealed.xls"}, - {"sxls", "application/vnd.sealed.xls"}, - {"sxm", "application/vnd.sun.xml.math"}, - {"sxw", "application/vnd.sun.xml.writer"}, - {"sy2", "application/vnd.sybyl.mol2"}, - {"syft.json", "application/vnd.syft+json"}, - {"t", "text/troff"}, - {"tag", "text/prs.lines.tag"}, - {"taglet", "application/vnd.mynfc"}, - {"tam", "application/vnd.onepager"}, - {"tamp", "application/vnd.onepagertamp"}, - {"tamx", "application/vnd.onepagertamx"}, - {"tao", "application/vnd.tao.intent-module-archive"}, - {"tap", "image/vnd.tencent.tap"}, - {"tar", "application/x-tar"}, - {"tat", "application/vnd.onepagertat"}, - {"tatp", "application/vnd.onepagertatp"}, - {"tatx", "application/vnd.onepagertatx"}, - {"tau", "application/tamp-apex-update"}, - {"taz", "application/x-gtar-compressed"}, - {"tcap", "application/vnd.3gpp2.tcap"}, - {"tcl", "application/x-tcl"}, - {"tcu", "application/tamp-community-update"}, - {"td", "application/urc-targetdesc+xml"}, - {"teacher", "application/vnd.smart.teacher"}, - {"tei", "application/tei+xml"}, - {"teiCorpus", "application/tei+xml"}, - {"ter", "application/tamp-error"}, - {"tex", "text/x-tex"}, - {"texi", "application/x-texinfo"}, - {"texinfo", "application/x-texinfo"}, - {"text", "text/plain"}, - {"tfi", "application/thraud+xml"}, - {"tfx", "image/tiff-fx"}, - {"tgf", "chemical/x-mdl-tgf"}, - {"tgz", "application/x-gtar-compressed"}, - {"thmx", "application/vnd.ms-officetheme"}, - {"tif", "image/tiff"}, - {"tiff", "image/tiff"}, - {"tk", "text/x-tcl"}, - {"tlclient", "application/vnd.cendio.thinlinc.clientconf"}, - {"tm", "text/texmacs"}, - {"tm.json", "application/tm+json"}, - {"tm.jsonld", "application/tm+json"}, - {"tmo", "application/vnd.tmobile-livetv"}, - {"tnef", "application/vnd.ms-tnef"}, - {"tnf", "application/vnd.ms-tnef"}, - {"torrent", "application/x-bittorrent"}, - {"tpl", "application/vnd.groove-tool-template"}, - {"tpt", "application/vnd.trid.tpt"}, - {"tr", "text/troff"}, - {"tra", "application/vnd.trueapp"}, - {"tree", "application/vnd.rainstor.data"}, - {"trig", "application/trig"}, - {"ts", "text/vnd.trolltech.linguist"}, - {"tsa", "application/tamp-sequence-adjust"}, - {"tsd", "application/timestamped-data"}, - {"tsp", "application/dsptype"}, - {"tsq", "application/timestamp-query"}, - {"tsr", "application/timestamp-reply"}, - {"tst", "application/vnd.etsi.timestamp-token"}, - {"tsv", "text/tab-separated-values"}, - {"ttc", "font/collection"}, - {"ttf", "font/ttf"}, - {"ttl", "text/turtle"}, - {"ttml", "application/ttml+xml"}, - {"tuc", "application/tamp-update-confirm"}, - {"tur", "application/tamp-update"}, - {"twd", "application/vnd.SimTech-MindMapper"}, - {"twds", "application/vnd.SimTech-MindMapper"}, - {"txd", "application/vnd.genomatix.tuxedo"}, - {"txf", "application/vnd.Mobius.TXF"}, - {"txt", "text/plain"}, - {"u3d", "model/u3d"}, - {"u8dsn", "message/global-delivery-status"}, - {"u8hdr", "message/global-headers"}, - {"u8mdn", "message/global-disposition-notification"}, - {"u8msg", "message/global"}, - {"udeb", "application/vnd.debian.binary-package"}, - {"ufd", "application/vnd.ufdl"}, - {"ufdl", "application/vnd.ufdl"}, - {"uis", "application/urc-uisocketdesc+xml"}, - {"umj", "application/vnd.umajin"}, - {"unityweb", "application/vnd.unity"}, - {"uo", "application/vnd.uoml+xml"}, - {"uoml", "application/vnd.uoml+xml"}, - {"upa", "application/vnd.hbci"}, - {"uri", "text/uri-list"}, - {"urim", "application/vnd.uri-map"}, - {"urimap", "application/vnd.uri-map"}, - {"uris", "text/uri-list"}, - {"usda", "model/vnd.usda"}, - {"usdz", "model/vnd.usdz+zip"}, - {"ustar", "application/x-ustar"}, - {"utz", "application/vnd.uiq.theme"}, - {"uva", "audio/vnd.dece.audio"}, - {"uvd", "application/vnd.dece.data"}, - {"uvf", "application/vnd.dece.data"}, - {"uvg", "image/vnd.dece.graphic"}, - {"uvh", "video/vnd.dece.hd"}, - {"uvi", "image/vnd.dece.graphic"}, - {"uvm", "video/vnd.dece.mobile"}, - {"uvp", "video/vnd.dece.pd"}, - {"uvs", "video/vnd.dece.sd"}, - {"uvt", "application/vnd.dece.ttml+xml"}, - {"uvu", "video/vnd.dece.mp4"}, - {"uvv", "video/vnd.dece.video"}, - {"uvva", "audio/vnd.dece.audio"}, - {"uvvd", "application/vnd.dece.data"}, - {"uvvf", "application/vnd.dece.data"}, - {"uvvg", "image/vnd.dece.graphic"}, - {"uvvh", "video/vnd.dece.hd"}, - {"uvvi", "image/vnd.dece.graphic"}, - {"uvvm", "video/vnd.dece.mobile"}, - {"uvvp", "video/vnd.dece.pd"}, - {"uvvs", "video/vnd.dece.sd"}, - {"uvvt", "application/vnd.dece.ttml+xml"}, - {"uvvu", "video/vnd.dece.mp4"}, - {"uvvv", "video/vnd.dece.video"}, - {"uvvx", "application/vnd.dece.unspecified"}, - {"uvvz", "application/vnd.dece.zip"}, - {"uvx", "application/vnd.dece.unspecified"}, - {"uvz", "application/vnd.dece.zip"}, - {"val", "chemical/x-ncbi-asn1-binary"}, - {"vbk", "audio/vnd.nortel.vbk"}, - {"vbox", "application/vnd.previewsystems.box"}, - {"vcard", "text/vcard"}, - {"vcd", "application/x-cdlink"}, - {"vcf", "text/vcard"}, - {"vcg", "application/vnd.groove-vcard"}, - {"vcj", "application/voucher-cms+json"}, - {"vcs", "text/x-vcalendar"}, - {"vcx", "application/vnd.vcx"}, - {"vds", "model/vnd.sap.vds"}, - {"VES", "application/vnd.ves.encrypted"}, - {"vew", "application/vnd.lotus-approach"}, - {"VFK", "text/vnd.exchangeable"}, - {"vfr", "application/vnd.tml"}, - {"viaframe", "application/vnd.tml"}, - {"vis", "application/vnd.visionary"}, - {"viv", "video/vnd.vivo"}, - {"vmd", "chemical/x-vmd"}, - {"vms", "chemical/x-vamas-iso14976"}, - {"vmt", "application/vnd.valve.source.material"}, - {"vpm", "multipart/voice-message"}, - {"vrm", "model/vrml"}, - {"vrml", "model/vrml"}, - {"vsc", "application/vnd.vidsoft.vidconference"}, - {"vsd", "application/vnd.visio"}, - {"vsf", "application/vnd.vsf"}, - {"vss", "application/vnd.visio"}, - {"vst", "application/vnd.visio"}, - {"vsw", "application/vnd.visio"}, - {"vtf", "image/vnd.valve.source.texture"}, - {"vtnstd", "application/vnd.veritone.aion+json"}, - {"vtt", "text/vtt"}, - {"vtu", "model/vnd.vtu"}, - {"vwx", "application/vnd.vectorworks"}, - {"vxml", "application/voicexml+xml"}, - {"wad", "application/x-doom"}, - {"wadl", "application/vnd.sun.wadl+xml"}, - {"wafl", "application/vnd.wasmflow.wafl"}, - {"wasm", "application/wasm"}, - {"wav", "audio/x-wav"}, - {"wax", "audio/x-ms-wax"}, - {"wbmp", "image/vnd.wap.wbmp"}, - {"wbs", "application/vnd.criticaltools.wbs+xml"}, - {"wbxml", "application/vnd.wap.wbxml"}, - {"wcm", "application/vnd.ms-works"}, - {"wdb", "application/vnd.ms-works"}, - {"webm", "video/webm"}, - {"webmanifest", "application/manifest+json"}, - {"webp", "image/webp"}, - {"wg", "application/vnd.pmi.widget"}, - {"wgsl", "text/wgsl"}, - {"wgt", "application/widget"}, - {"wif", "application/watcherinfo+xml"}, - {"win", "model/vnd.gdl"}, - {"wk", "application/x-123"}, - {"wk1", "application/vnd.lotus-1-2-3"}, - {"wk3", "application/vnd.lotus-1-2-3"}, - {"wk4", "application/vnd.lotus-1-2-3"}, - {"wks", "application/vnd.ms-works"}, - {"wlnk", "application/link-format"}, - {"wm", "video/x-ms-wm"}, - {"wma", "audio/x-ms-wma"}, - {"wmc", "application/vnd.wmc"}, - {"wmd", "application/x-ms-wmd"}, - {"wmf", "image/wmf"}, - {"wml", "text/vnd.wap.wml"}, - {"wmlc", "application/vnd.wap.wmlc"}, - {"wmls", "text/vnd.wap.wmlscript"}, - {"wmlsc", "application/vnd.wap.wmlscriptc"}, - {"wmv", "video/x-ms-wmv"}, - {"wmx", "video/x-ms-wmx"}, - {"wmz", "application/x-ms-wmz"}, - {"woff", "font/woff"}, - {"woff2", "font/woff2"}, - {"wpd", "application/vnd.wordperfect"}, - {"wpl", "application/vnd.ms-wpl"}, - {"wps", "application/vnd.ms-works"}, - {"wqd", "application/vnd.wqd"}, - {"wrl", "model/vrml"}, - {"wsc", "application/vnd.wfa.wsc"}, - {"wsdl", "application/wsdl+xml"}, - {"wspolicy", "application/wspolicy+xml"}, - {"wtb", "application/vnd.webturbo"}, - {"wv", "application/vnd.wv.csp+wbxml"}, - {"wvx", "video/x-ms-wvx"}, - {"wz", "application/x-wingz"}, - {"x_b", "model/vnd.parasolid.transmit.binary"}, - {"x_t", "model/vnd.parasolid.transmit.text"}, - {"x3d", "model/x3d+xml"}, - {"x3db", "model/x3d+fastinfoset"}, - {"x3dv", "model/x3d-vrml"}, - {"x3dvz", "model/x3d-vrml"}, - {"x3dz", "model/x3d+xml"}, - {"xar", "application/vnd.xara"}, - {"xav", "application/xcap-att+xml"}, - {"xbd", "application/vnd.fujixerox.docuworks.binder"}, - {"xbm", "image/x-xbitmap"}, - {"xca", "application/xcap-caps+xml"}, - {"xcf", "image/x-xcf"}, - {"xcos", "application/x-scilab-xcos"}, - {"xcs", "application/calendar+xml"}, - {"xct", "application/vnd.fujixerox.docuworks.container"}, - {"xdd", "application/bacnet-xdd+zip"}, - {"xdf", "application/xcap-diff+xml"}, - {"xdm", "application/vnd.syncml.dm+xml"}, - {"xdp", "application/vnd.adobe.xdp+xml"}, - {"xdssc", "application/dssc+xml"}, - {"xdw", "application/vnd.fujixerox.docuworks"}, - {"xel", "application/xcap-el+xml"}, - {"xer", "application/xcap-error+xml"}, - {"xfd", "application/vnd.xfdl"}, - {"xfdf", "application/xfdf"}, - {"xfdl", "application/vnd.xfdl"}, - {"xhe", "audio/usac"}, - {"xht", "application/xhtml+xml"}, - {"xhtm", "application/xhtml+xml"}, - {"xhtml", "application/xhtml+xml"}, - {"xhvml", "application/xv+xml"}, - {"xif", "image/vnd.xiff"}, - {"xla", "application/vnd.ms-excel"}, - {"xlam", "application/vnd.ms-excel.addin.macroEnabled.12"}, - {"xlc", "application/vnd.ms-excel"}, - {"xlf", "application/xliff+xml"}, - {"xlim", "application/vnd.xmpie.xlim"}, - {"xlm", "application/vnd.ms-excel"}, - {"xls", "application/vnd.ms-excel"}, - {"xlsb", "application/vnd.ms-excel.sheet.binary.macroEnabled.12"}, - {"xlsm", "application/vnd.ms-excel.sheet.macroEnabled.12"}, - {"xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}, - {"xlt", "application/vnd.ms-excel"}, - {"xltm", "application/vnd.ms-excel.template.macroEnabled.12"}, - {"xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template"}, - {"xlw", "application/vnd.ms-excel"}, - {"xml", "application/xml"}, - {"xmls", "application/dskpp+xml"}, - {"xmt_bin", "model/vnd.parasolid.transmit.binary"}, - {"xmt_txt", "model/vnd.parasolid.transmit.text"}, - {"xns", "application/xcap-ns+xml"}, - {"xo", "application/vnd.olpc-sugar"}, - {"xodp", "application/vnd.collabio.xodocuments.presentation"}, - {"xods", "application/vnd.collabio.xodocuments.spreadsheet"}, - {"xodt", "application/vnd.collabio.xodocuments.document"}, - {"xop", "application/xop+xml"}, - {"xotp", "application/vnd.collabio.xodocuments.presentation-template"}, - {"xots", "application/vnd.collabio.xodocuments.spreadsheet-template"}, - {"xott", "application/vnd.collabio.xodocuments.document-template"}, - {"xpak", "application/vnd.gentoo.xpak"}, - {"xpi", "application/x-xpinstall"}, - {"xpm", "image/x-xpixmap"}, - {"xpr", "application/vnd.is-xpr"}, - {"xps", "application/vnd.ms-xpsdocument"}, - {"xpw", "application/vnd.intercon.formnet"}, - {"xpx", "application/vnd.intercon.formnet"}, - {"xsf", "application/prs.xsf+xml"}, - {"xsl", "application/xslt+xml"}, - {"xslt", "application/xslt+xml"}, - {"xsm", "application/vnd.syncml+xml"}, - {"xspf", "application/xspf+xml"}, - {"xtel", "chemical/x-xtel"}, - {"xul", "application/vnd.mozilla.xul+xml"}, - {"xvm", "application/xv+xml"}, - {"xvml", "application/xv+xml"}, - {"xwd", "image/x-xwindowdump"}, - {"xyz", "chemical/x-xyz"}, - {"xyze", "image/vnd.radiance"}, - {"xz", "application/x-xz"}, - {"yaml", "application/yaml"}, - {"yang", "application/yang"}, - {"yin", "application/yin+xml"}, - {"yme", "application/vnd.yaoweme"}, - {"yml", "application/yaml"}, - {"yt", "video/vnd.youtube.yt"}, - {"zaz", "application/vnd.zzazz.deck+xml"}, - {"zfc", "application/vnd.filmit.zfc"}, - {"zfo", "application/vnd.software602.filler.form-xml-zip"}, - {"zip", "application/zip"}, - {"zir", "application/vnd.zul"}, - {"zirz", "application/vnd.zul"}, - {"zmm", "application/vnd.HandHeld-Entertainment+xml"}, - {"zmt", "chemical/x-mopac-input"}, - {"zone", "text/dns"}, - {"zst", "application/zstd"} -}; + {"%", "application/x-trash"}, + {"~", "application/x-trash"}, + {"123", "application/vnd.lotus-1-2-3"}, + {"1905.1", "application/vnd.ieee.1905"}, + {"1clr", "application/clr"}, + {"1km", "application/vnd.1000minds.decision-model+xml"}, + {"210", "application/p21"}, + {"3dm", "text/vnd.in3d.3dml"}, + {"3dml", "text/vnd.in3d.3dml"}, + {"3mf", "application/vnd.ms-3mfdocument"}, + {"3tz", "application/vnd.maxar.archive.3tz+zip"}, + {"726", "audio/32kadpcm"}, + {"7z", "application/x-7z-compressed"}, + {"a", "text/vnd.a"}, + {"a2l", "application/A2L"}, + {"aa3", "audio/ATRAC3"}, + {"aac", "audio/aac"}, + {"aal", "audio/ATRAC-ADVANCED-LOSSLESS"}, + {"abc", "text/vnd.abc"}, + {"abw", "application/x-abiword"}, + {"ac", "application/pkix-attr-cert"}, + {"ac2", "application/vnd.banana-accounting"}, + {"ac3", "audio/ac3"}, + {"acc", "application/vnd.americandynamics.acc"}, + {"acn", "audio/asc"}, + {"acu", "application/vnd.acucobol"}, + {"acutc", "application/vnd.acucorp"}, + {"adts", "audio/aac"}, + {"aep", "application/vnd.audiograph"}, + {"afp", "application/vnd.afpc.modca"}, + {"age", "application/vnd.age"}, + {"ahead", "application/vnd.ahead.space"}, + {"ai", "application/postscript"}, + {"aif", "audio/x-aiff"}, + {"aifc", "audio/x-aiff"}, + {"aiff", "audio/x-aiff"}, + {"aion", "application/vnd.veritone.aion+json"}, + {"ait", "application/vnd.dvb.ait"}, + {"alc", "chemical/x-alchemy"}, + {"ami", "application/vnd.amiga.ami"}, + {"aml", "application/AML"}, + {"amlx", "application/automationml-amlx+zip"}, + {"amr", "audio/AMR"}, + {"AMR", "audio/AMR"}, + {"anx", "application/annodex"}, + {"apex", "application/vnd.apexlang"}, + {"apexlang", "application/vnd.apexlang"}, + {"apk", "application/vnd.android.package-archive"}, + {"apkg", "application/vnd.anki"}, + {"apng", "image/apng"}, + {"appcache", "text/cache-manifest"}, + {"apr", "application/vnd.lotus-approach"}, + {"apxml", "application/auth-policy+xml"}, + {"arrow", "application/vnd.apache.arrow.file"}, + {"arrows", "application/vnd.apache.arrow.stream"}, + {"art", "image/x-jg"}, + {"artisan", "application/vnd.artisan+json"}, + {"asc", "application/pgp-keys"}, + {"ascii", "text/vnd.ascii-art"}, + {"asf", "application/vnd.ms-asf"}, + {"asice", "application/vnd.etsi.asic-e+zip"}, + {"asics", "application/vnd.etsi.asic-s+zip"}, + {"asn", "chemical/x-ncbi-asn1"}, + {"aso", "application/vnd.accpac.simply.aso"}, + {"ass", "audio/aac"}, + {"at3", "audio/ATRAC3"}, + {"atc", "application/vnd.acucorp"}, + {"atf", "application/ATF"}, + {"atfx", "application/ATFX"}, + {"atom", "application/atom+xml"}, + {"atomcat", "application/atomcat+xml"}, + {"atomdeleted", "application/atomdeleted+xml"}, + {"atomsrv", "application/atomserv+xml"}, + {"atomsvc", "application/atomsvc+xml"}, + {"atx", "audio/ATRAC-X"}, + {"atxml", "application/ATXML"}, + {"au", "audio/basic"}, + {"auc", "application/tamp-apex-update-confirm"}, + {"avci", "image/avci"}, + {"avcs", "image/avcs"}, + {"avi", "video/x-msvideo"}, + {"avif", "image/avif"}, + {"awb", "audio/AMR-WB"}, + {"AWB", "audio/AMR-WB"}, + {"axa", "audio/annodex"}, + {"axv", "video/annodex"}, + {"azf", "application/vnd.airzip.filesecure.azf"}, + {"azs", "application/vnd.airzip.filesecure.azs"}, + {"azv", "image/vnd.airzip.accelerator.azv"}, + {"azw3", "application/vnd.amazon.mobi8-ebook"}, + {"b", "chemical/x-molconn-Z"}, + {"b16", "image/vnd.pco.b16"}, + {"bak", "application/x-trash"}, + {"bar", "application/vnd.qualcomm.brew-app-res"}, + {"bary", "model/vnd.bary"}, + {"bat", "application/x-msdos-program"}, + {"bcpio", "application/x-bcpio"}, + {"bdm", "application/vnd.syncml.dm+wbxml"}, + {"bed", "application/vnd.realvnc.bed"}, + {"bh2", "application/vnd.fujitsu.oasysprs"}, + {"bib", "text/x-bibtex"}, + {"bik", "video/vnd.radgamettools.bink"}, + {"bin", "application/octet-stream"}, + {"bk2", "video/vnd.radgamettools.bink"}, + {"bkm", "application/vnd.nervana"}, + {"bmed", "multipart/vnd.bint.med-plus"}, + {"bmi", "application/vnd.bmi"}, + {"bmml", "application/vnd.balsamiq.bmml+xml"}, + {"bmp", "image/bmp"}, + {"bmpr", "application/vnd.balsamiq.bmpr"}, + {"boo", "text/x-boo"}, + {"book", "application/x-maker"}, + {"box", "application/vnd.previewsystems.box"}, + {"bpd", "application/vnd.hbci"}, + {"brf", "text/plain"}, + {"bsd", "chemical/x-crossfire"}, + {"bsp", "model/vnd.valve.source.compiled-map"}, + {"btf", "image/prs.btif"}, + {"btif", "image/prs.btif"}, + {"c", "text/x-csrc"}, + {"c++", "text/x-c++src"}, + {"c11amc", "application/vnd.cluetrust.cartomobile-config"}, + {"c11amz", "application/vnd.cluetrust.cartomobile-config-pkg"}, + {"c3d", "chemical/x-chem3d"}, + {"c3ex", "application/cccex"}, + {"c4d", "application/vnd.clonk.c4group"}, + {"c4f", "application/vnd.clonk.c4group"}, + {"c4g", "application/vnd.clonk.c4group"}, + {"c4p", "application/vnd.clonk.c4group"}, + {"c4u", "application/vnd.clonk.c4group"}, + {"c9r", "application/vnd.cryptomator.encrypted"}, + {"c9s", "application/vnd.cryptomator.encrypted"}, + {"cab", "application/vnd.ms-cab-compressed"}, + {"cac", "chemical/x-cache"}, + {"cache", "chemical/x-cache"}, + {"cap", "application/vnd.tcpdump.pcap"}, + {"car", "application/vnd.ipld.car"}, + {"carjson", "application/vnd.eu.kasparian.car+json"}, + {"cascii", "chemical/x-cactvs-binary"}, + {"cat", "application/vnd.ms-pki.seccat"}, + {"cbin", "chemical/x-cactvs-binary"}, + {"cbor", "application/cbor"}, + {"cbr", "application/vnd.comicbook-rar"}, + {"cbz", "application/vnd.comicbook+zip"}, + {"cc", "text/x-c++src"}, + {"ccc", "text/vnd.net2phone.commcenter.command"}, + {"ccmp", "application/ccmp+xml"}, + {"ccxml", "application/ccxml+xml"}, + {"cda", "application/x-cdf"}, + {"cdbcmsg", "application/vnd.contact.cmsg"}, + {"cdf", "application/x-cdf"}, + {"cdfx", "application/CDFX+XML"}, + {"cdkey", "application/vnd.mediastation.cdkey"}, + {"cdmia", "application/cdmi-capability"}, + {"cdmic", "application/cdmi-container"}, + {"cdmid", "application/cdmi-domain"}, + {"cdmio", "application/cdmi-object"}, + {"cdmiq", "application/cdmi-queue"}, + {"cdr", "image/x-coreldraw"}, + {"cdt", "image/x-coreldrawtemplate"}, + {"cdx", "chemical/x-cdx"}, + {"cdxml", "application/vnd.chemdraw+xml"}, + {"cdy", "application/vnd.cinderella"}, + {"cea", "application/CEA"}, + {"cef", "chemical/x-cxf"}, + {"cellml", "application/cellml+xml"}, + {"cer", "application/pkix-cert"}, + {"cgm", "image/cgm"}, + {"chm", "application/vnd.ms-htmlhelp"}, + {"chrt", "application/vnd.kde.kchart"}, + {"cif", "application/vnd.multiad.creator.cif"}, + {"cii", "application/vnd.anser-web-certificate-issue-initiation"}, + {"cil", "application/vnd.ms-artgalry"}, + {"cl", "application/simple-filter+xml"}, + {"cla", "application/vnd.claymore"}, + {"class", "application/java-vm"}, + {"cld", "model/vnd.cld"}, + {"clkk", "application/vnd.crick.clicker.keyboard"}, + {"clkp", "application/vnd.crick.clicker.palette"}, + {"clkt", "application/vnd.crick.clicker.template"}, + {"clkw", "application/vnd.crick.clicker.wordbank"}, + {"clkx", "application/vnd.crick.clicker"}, + {"cls", "text/x-tex"}, + {"clue", "application/clue_info+xml"}, + {"cmc", "application/vnd.cosmocaller"}, + {"cmdf", "chemical/x-cmdf"}, + {"cml", "application/cellml+xml"}, + {"cmp", "application/vnd.yellowriver-custom-menu"}, + {"cmsc", "application/cms"}, + {"cnd", "text/jcr-cnd"}, + {"cod", "application/vnd.rim.cod"}, + {"coffee", "application/vnd.coffeescript"}, + {"com", "application/x-msdos-program"}, + {"copyright", "text/vnd.debian.copyright"}, + {"coswid", "application/swid+cbor"}, + {"cpa", "chemical/x-compass"}, + {"cpio", "application/x-cpio"}, + {"cpkg", "application/vnd.xmpie.cpkg"}, + {"cpl", "application/cpl+xml"}, + {"cpp", "text/x-c++src"}, + {"cpt", "application/mac-compactpro"}, + {"CQL", "text/cql"}, + {"cr2", "image/x-canon-cr2"}, + {"crl", "application/pkix-crl"}, + {"crt", "application/x-x509-ca-cert"}, + {"crtr", "application/vnd.multiad.creator"}, + {"crw", "image/x-canon-crw"}, + {"cryptomator", "application/vnd.cryptomator.vault"}, + {"cryptonote", "application/vnd.rig.cryptonote"}, + {"csd", "audio/csound"}, + {"csf", "chemical/x-cache-csf"}, + {"csh", "application/x-csh"}, + {"csl", "application/vnd.citationstyles.style+xml"}, + {"csm", "chemical/x-csml"}, + {"csml", "chemical/x-csml"}, + {"csp", "application/vnd.commonspace"}, + {"csrattrs", "application/csrattrs"}, + {"css", "text/css"}, + {"cst", "application/vnd.commonspace"}, + {"csv", "text/csv"}, + {"csvs", "text/csv-schema"}, + {"ctab", "chemical/x-cactvs-binary"}, + {"ctx", "chemical/x-ctx"}, + {"cu", "application/cu-seeme"}, + {"cub", "chemical/x-gaussian-cube"}, + {"cuc", "application/tamp-community-update-confirm"}, + {"curl", "text/vnd.curl"}, + {"cw", "application/prs.cww"}, + {"cwl", "application/cwl"}, + {"cwl.json", "application/cwl+json"}, + {"cww", "application/prs.cww"}, + {"cxf", "chemical/x-cxf"}, + {"cxx", "text/x-c++src"}, + {"d", "text/x-dsrc"}, + {"dae", "model/vnd.collada+xml"}, + {"daf", "application/vnd.Mobius.DAF"}, + {"dart", "application/vnd.dart"}, + {"dataless", "application/vnd.fdsn.seed"}, + {"davmount", "application/davmount+xml"}, + {"dbf", "application/vnd.dbf"}, + {"dcd", "application/DCD"}, + {"dcm", "application/dicom"}, + {"dcr", "application/x-director"}, + {"dd2", "application/vnd.oma.dd2+xml"}, + {"ddd", "application/vnd.fujixerox.ddd"}, + {"ddeb", "application/vnd.debian.binary-package"}, + {"ddf", "application/vnd.syncml.dmddf+xml"}, + {"deb", "application/vnd.debian.binary-package"}, + {"deploy", "application/octet-stream"}, + {"dfac", "application/vnd.dreamfactory"}, + {"dif", "video/dv"}, + {"diff", "text/x-diff"}, + {"dii", "application/DII"}, + {"dim", "application/vnd.fastcopy-disk-image"}, + {"dir", "application/x-director"}, + {"dis", "application/vnd.Mobius.DIS"}, + {"dist", "application/vnd.apple.installer+xml"}, + {"distz", "application/vnd.apple.installer+xml"}, + {"dit", "application/DIT"}, + {"dive", "application/vnd.patentdive"}, + {"djv", "image/vnd.djvu"}, + {"djvu", "image/vnd.djvu"}, + {"dl", "application/vnd.datalog"}, + {"dll", "application/x-msdos-program"}, + {"dls", "audio/dls"}, + {"dmg", "application/x-apple-diskimage"}, + {"dmp", "application/vnd.tcpdump.pcap"}, + {"dms", "text/vnd.DMClientScript"}, + {"dna", "application/vnd.dna"}, + {"doc", "application/msword"}, + {"docjson", "application/vnd.document+json"}, + {"docm", "application/vnd.ms-word.document.macroEnabled.12"}, + {"docx", + "application/vnd.openxmlformats-officedocument.wordprocessingml.document"}, + {"dor", "model/vnd.gdl"}, + {"dot", "text/vnd.graphviz"}, + {"dotm", "application/vnd.ms-word.template.macroEnabled.12"}, + {"dotx", + "application/vnd.openxmlformats-officedocument.wordprocessingml.template"}, + {"dp", "application/vnd.osgi.dp"}, + {"dpg", "application/vnd.dpgraph"}, + {"dpgraph", "application/vnd.dpgraph"}, + {"dpkg", "application/vnd.xmpie.dpkg"}, + {"dpx", "image/dpx"}, + {"drle", "image/dicom-rle"}, + {"dsc", "text/prs.lines.tag"}, + {"dsm", "application/vnd.desmume.movie"}, + {"dssc", "application/dssc+der"}, + {"dtd", "application/xml-dtd"}, + {"dts", "audio/vnd.dts"}, + {"dtshd", "audio/vnd.dts.hd"}, + {"dv", "video/dv"}, + {"dvb", "video/vnd.dvb.file"}, + {"dvc", "application/dvcs"}, + {"dvi", "application/x-dvi"}, + {"dwd", "application/atsc-dwd+xml"}, + {"dwf", "model/vnd.dwf"}, + {"dwg", "image/vnd.dwg"}, + {"dx", "chemical/x-jcamp-dx"}, + {"dxf", "image/vnd.dxf"}, + {"dxp", "application/vnd.spotfire.dxp"}, + {"dxr", "application/x-director"}, + {"dzr", "application/vnd.dzr"}, + {"ebuild", "application/vnd.gentoo.ebuild"}, + {"ecelp4800", "audio/vnd.nuera.ecelp4800"}, + {"ecelp7470", "audio/vnd.nuera.ecelp7470"}, + {"ecelp9600", "audio/vnd.nuera.ecelp9600"}, + {"ecig", "application/vnd.evolv.ecig.settings"}, + {"ecigprofile", "application/vnd.evolv.ecig.profile"}, + {"ecigtheme", "application/vnd.evolv.ecig.theme"}, + {"eclass", "application/vnd.gentoo.eclass"}, + {"edm", "application/vnd.novadigm.EDM"}, + {"edx", "application/vnd.novadigm.EDX"}, + {"efi", "application/efi"}, + {"efif", "application/vnd.picsel"}, + {"ei6", "application/vnd.pg.osasli"}, + {"ELN", "application/vnd.eln+zip"}, + {"emb", "chemical/x-embl-dl-nucleotide"}, + {"embl", "chemical/x-embl-dl-nucleotide"}, + {"emf", "image/emf"}, + {"eml", "message/rfc822"}, + {"emm", "application/vnd.ibm.electronic-media"}, + {"emma", "application/emma+xml"}, + {"emotionml", "application/emotionml+xml"}, + {"ent", "application/xml-external-parsed-entity"}, + {"entity", "application/vnd.nervana"}, + {"enw", "audio/EVRCNW"}, + {"eol", "audio/vnd.digital-winds"}, + {"eot", "application/vnd.ms-fontobject"}, + {"ep", "application/vnd.bluetooth.ep.oob"}, + {"eps", "application/postscript"}, + {"eps2", "application/postscript"}, + {"eps3", "application/postscript"}, + {"epsf", "application/postscript"}, + {"epsi", "application/postscript"}, + {"epub", "application/epub+zip"}, + {"erf", "image/x-epson-erf"}, + {"es", "text/javascript"}, + {"es3", "application/vnd.eszigno3+xml"}, + {"esa", "application/vnd.osgi.subsystem"}, + {"esf", "application/vnd.epson.esf"}, + {"espass", "application/vnd.espass-espass+zip"}, + {"et3", "application/vnd.eszigno3+xml"}, + {"etx", "text/x-setext"}, + {"evb", "audio/EVRCB"}, + {"evc", "audio/EVRC"}, + {"evw", "audio/EVRCWB"}, + {"exe", "application/x-msdos-program"}, + {"exi", "application/exi"}, + {"exp", "application/express"}, + {"exr", "image/aces"}, + {"ext", "application/vnd.novadigm.EXT"}, + {"ez", "application/andrew-inset"}, + {"ez2", "application/vnd.ezpix-album"}, + {"ez3", "application/vnd.ezpix-package"}, + {"fb", "application/x-maker"}, + {"fbdoc", "application/x-maker"}, + {"fbs", "image/vnd.fastbidsheet"}, + {"fcdt", "application/vnd.adobe.formscentral.fcdt"}, + {"fch", "chemical/x-gaussian-checkpoint"}, + {"fchk", "chemical/x-gaussian-checkpoint"}, + {"fcs", "application/vnd.isac.fcs"}, + {"fdf", "application/fdf"}, + {"fdt", "application/fdt+xml"}, + {"fe_launch", "application/vnd.denovo.fcselayout-link"}, + {"fg5", "application/vnd.fujitsu.oasysgp"}, + {"fig", "application/x-xfig"}, + {"finf", "application/fastinfoset"}, + {"fit", "image/fits"}, + {"fits", "image/fits"}, + {"fla", "application/vnd.dtg.local.flash"}, + {"flac", "audio/flac"}, + {"flb", "application/vnd.ficlab.flb+zip"}, + {"fli", "video/fli"}, + {"flo", "application/vnd.micrografx.flo"}, + {"flt", "text/vnd.ficlab.flt"}, + {"flv", "video/x-flv"}, + {"flw", "application/vnd.kde.kivio"}, + {"flx", "text/vnd.fmi.flexstor"}, + {"fly", "text/vnd.fly"}, + {"fm", "application/vnd.framemaker"}, + {"fo", "application/vnd.software602.filler.form+xml"}, + {"fpx", "image/vnd.fpx"}, + {"frame", "application/x-maker"}, + {"frm", "application/vnd.ufdl"}, + {"fsc", "application/vnd.fsc.weblaunch"}, + {"fst", "image/vnd.fst"}, + {"ftc", "application/vnd.fluxtime.clip"}, + {"fti", "application/vnd.anser-web-funds-transfer-initiation"}, + {"fts", "image/fits"}, + {"fvt", "video/vnd.fvt"}, + {"fxp", "application/vnd.adobe.fxp"}, + {"fxpl", "application/vnd.adobe.fxp"}, + {"fzs", "application/vnd.fuzzysheet"}, + {"g2w", "application/vnd.geoplan"}, + {"g3w", "application/vnd.geospace"}, + {"gac", "application/vnd.groove-account"}, + {"gal", "chemical/x-gaussian-log"}, + {"gam", "chemical/x-gamess-input"}, + {"gamin", "chemical/x-gamess-input"}, + {"gan", "application/x-ganttproject"}, + {"gau", "chemical/x-gaussian-input"}, + {"gbr", "application/rpki-ghostbusters"}, + {"gcd", "text/x-pcs-gcd"}, + {"gcf", "application/x-graphing-calculator"}, + {"gcg", "chemical/x-gcg8-sequence"}, + {"gdl", "model/vnd.gdl"}, + {"gdz", "application/vnd.familysearch.gedcom+zip"}, + {"ged", "text/vnd.familysearch.gedcom"}, + {"gen", "chemical/x-genbank"}, + {"genozip", "application/vnd.genozip"}, + {"geo", "application/vnd.dynageo"}, + {"geojson", "application/geo+json"}, + {"gex", "application/vnd.geometry-explorer"}, + {"gf", "application/x-tex-gf"}, + {"gff3", "text/gff3"}, + {"ggb", "application/vnd.geogebra.file"}, + {"ggs", "application/vnd.geogebra.slides"}, + {"ggt", "application/vnd.geogebra.tool"}, + {"ghf", "application/vnd.groove-help"}, + {"gif", "image/gif"}, + {"gim", "application/vnd.groove-identity-message"}, + {"gjc", "chemical/x-gaussian-input"}, + {"gjf", "chemical/x-gaussian-input"}, + {"gl", "video/gl"}, + {"glb", "model/gltf-binary"}, + {"glbin", "application/gltf-buffer"}, + {"glbuf", "application/gltf-buffer"}, + {"gltf", "model/gltf+json"}, + {"gml", "application/gml+xml"}, + {"gnumeric", "application/x-gnumeric"}, + {"gph", "application/vnd.FloGraphIt"}, + {"gpkg", "application/geopackage+sqlite3"}, + {"gpkg.tar", "application/vnd.gentoo.gpkg"}, + {"gpt", "chemical/x-mopac-graph"}, + {"gqf", "application/vnd.grafeq"}, + {"gqs", "application/vnd.grafeq"}, + {"gram", "application/srgs"}, + {"grd", "application/vnd.gentics.grd+json"}, + {"gre", "application/vnd.geometry-explorer"}, + {"grv", "application/vnd.groove-injector"}, + {"grxml", "application/srgs+xml"}, + {"gsf", "application/x-font"}, + {"gsheet", "application/urc-grpsheet+xml"}, + {"gsm", "audio/x-gsm"}, + {"gtar", "application/x-gtar"}, + {"gtm", "application/vnd.groove-tool-message"}, + {"gtw", "model/vnd.gtw"}, + {"gv", "text/vnd.graphviz"}, + {"gxt", "application/vnd.geonext"}, + {"gz", "application/gzip"}, + {"h", "text/x-chdr"}, + {"h++", "text/x-c++hdr"}, + {"hal", "application/vnd.hal+xml"}, + {"hans", "text/vnd.hans"}, + {"hbc", "application/vnd.hbci"}, + {"hbci", "application/vnd.hbci"}, + {"hdf", "application/x-hdf"}, + {"hdr", "image/vnd.radiance"}, + {"hdt", "application/vnd.hdt"}, + {"heic", "image/heic"}, + {"heics", "image/heic-sequence"}, + {"heif", "image/heif"}, + {"heifs", "image/heif-sequence"}, + {"hej2", "image/hej2k"}, + {"held", "application/atsc-held+xml"}, + {"hgl", "text/vnd.hgl"}, + {"hh", "text/x-c++hdr"}, + {"hif", "image/avif"}, + {"hin", "chemical/x-hin"}, + {"hpgl", "application/vnd.hp-HPGL"}, + {"hpi", "application/vnd.hp-hpid"}, + {"hpid", "application/vnd.hp-hpid"}, + {"hpp", "text/x-c++hdr"}, + {"hps", "application/vnd.hp-hps"}, + {"hpub", "application/prs.hpub+zip"}, + {"hqx", "application/mac-binhex40"}, + {"hs", "text/x-haskell"}, + {"hsj2", "image/hsj2"}, + {"hsl", "application/vnd.hsl"}, + {"hta", "application/hta"}, + {"htc", "text/x-component"}, + {"htke", "application/vnd.kenameaapp"}, + {"htm", "text/html"}, + {"html", "text/html"}, + {"hvd", "application/vnd.yamaha.hv-dic"}, + {"hvp", "application/vnd.yamaha.hv-voice"}, + {"hvs", "application/vnd.yamaha.hv-script"}, + {"hwp", "application/x-hwp"}, + {"hxx", "text/x-c++hdr"}, + {"i2g", "application/vnd.intergeo"}, + {"ic0", "application/vnd.commerce-battelle"}, + {"ic1", "application/vnd.commerce-battelle"}, + {"ic2", "application/vnd.commerce-battelle"}, + {"ic3", "application/vnd.commerce-battelle"}, + {"ic4", "application/vnd.commerce-battelle"}, + {"ic5", "application/vnd.commerce-battelle"}, + {"ic6", "application/vnd.commerce-battelle"}, + {"ic7", "application/vnd.commerce-battelle"}, + {"ic8", "application/vnd.commerce-battelle"}, + {"ica", "application/x-ica"}, + {"icc", "application/vnd.iccprofile"}, + {"icd", "application/vnd.commerce-battelle"}, + {"icf", "application/vnd.commerce-battelle"}, + {"icm", "application/vnd.iccprofile"}, + {"ico", "image/vnd.microsoft.icon"}, + {"ics", "text/calendar"}, + {"ief", "image/ief"}, + {"ifb", "text/calendar"}, + {"ifc", "application/p21"}, + {"ifm", "application/vnd.shana.informed.formdata"}, + {"iges", "model/iges"}, + {"igl", "application/vnd.igloader"}, + {"igm", "application/vnd.insors.igm"}, + {"ign", "application/vnd.coreos.ignition+json"}, + {"ignition", "application/vnd.coreos.ignition+json"}, + {"igs", "model/iges"}, + {"igx", "application/vnd.micrografx.igx"}, + {"iif", "application/vnd.shana.informed.interchange"}, + {"iii", "application/x-iphone"}, + {"imf", "application/vnd.imagemeter.folder+zip"}, + {"imgcal", "application/vnd.3lightssoftware.imagescal"}, + {"imi", "application/vnd.imagemeter.image+zip"}, + {"imp", "application/vnd.accpac.simply.imp"}, + {"ims", "application/vnd.ms-ims"}, + {"imscc", "application/vnd.ims.imsccv1p1"}, + {"info", "application/x-info"}, + {"ink", "application/inkml+xml"}, + {"inkml", "application/inkml+xml"}, + {"inp", "chemical/x-gamess-input"}, + {"ins", "application/x-internet-signup"}, + {"iota", "application/vnd.astraea-software.iota"}, + {"ipfix", "application/ipfix"}, + {"ipk", "application/vnd.shana.informed.package"}, + {"ipns-record", "application/vnd.ipfs.ipns-record"}, + {"irm", "application/vnd.ibm.rights-management"}, + {"irp", "application/vnd.irepository.package+xml"}, + {"ism", "model/vnd.gdl"}, + {"iso", "application/x-iso9660-image"}, + {"isp", "application/x-internet-signup"}, + {"ist", "chemical/x-isostar"}, + {"istc", "application/vnd.veryant.thin"}, + {"istr", "chemical/x-isostar"}, + {"isws", "application/vnd.veryant.thin"}, + {"itp", "application/vnd.shana.informed.formtemplate"}, + {"its", "application/its+xml"}, + {"ivp", "application/vnd.immervision-ivp"}, + {"ivu", "application/vnd.immervision-ivu"}, + {"j2c", "image/j2c"}, + {"J2C", "image/j2c"}, + {"j2k", "image/j2c"}, + {"J2K", "image/j2c"}, + {"jad", "text/vnd.sun.j2me.app-descriptor"}, + {"jam", "application/vnd.jam"}, + {"jar", "application/java-archive"}, + {"java", "text/x-java"}, + {"jdx", "chemical/x-jcamp-dx"}, + {"jpeg", "image/jpeg"}, + {"jhc", "image/jphc"}, + {"jisp", "application/vnd.jisp"}, + {"jls", "image/jls"}, + {"jlt", "application/vnd.hp-jlyt"}, + {"jmz", "application/x-jmol"}, + {"jng", "image/x-jng"}, + {"jnlp", "application/x-java-jnlp-file"}, + {"joda", "application/vnd.joost.joda-archive"}, + {"jp2", "image/jp2"}, + {"jpg", "image/jpeg"}, + {"jpe", "image/jpeg"}, + {"jpf", "image/jpx"}, + {"jfif", "image/jpeg"}, + {"jpg2", "image/jp2"}, + {"jpgm", "image/jpm"}, + {"jph", "image/jph"}, + {"jphc", "image/jphc"}, + {"jpm", "image/jpm"}, + {"jpx", "image/jpx"}, + {"jrd", "application/jrd+json"}, + {"js", "text/javascript"}, + {"json", "application/json"}, + {"json-patch", "application/json-patch+json"}, + {"jsonld", "application/ld+json"}, + {"jsontd", "application/td+json"}, + {"jsontm", "application/tm+json"}, + {"jt", "model/JT"}, + {"jtd", "text/vnd.esmertec.theme-descriptor"}, + {"jxl", "image/jxl"}, + {"jxr", "image/jxr"}, + {"jxra", "image/jxrA"}, + {"jxrs", "image/jxrS"}, + {"jxs", "image/jxs"}, + {"jxsc", "image/jxsc"}, + {"jxsi", "image/jxsi"}, + {"jxss", "image/jxss"}, + {"karbon", "application/vnd.kde.karbon"}, + {"kcm", "application/vnd.nervana"}, + {"key", "application/pgp-keys"}, + {"keynote", "application/vnd.apple.keynote"}, + {"kfo", "application/vnd.kde.kformula"}, + {"kia", "application/vnd.kidspiration"}, + {"kil", "application/x-killustrator"}, + {"kin", "chemical/x-kinemage"}, + {"kml", "application/vnd.google-earth.kml+xml"}, + {"kmz", "application/vnd.google-earth.kmz"}, + {"kne", "application/vnd.Kinar"}, + {"knp", "application/vnd.Kinar"}, + {"kom", "application/vnd.hbci"}, + {"kon", "application/vnd.kde.kontour"}, + {"koz", "audio/vnd.audiokoz"}, + {"kpr", "application/vnd.kde.kpresenter"}, + {"kpt", "application/vnd.kde.kpresenter"}, + {"ksp", "application/vnd.kde.kspread"}, + {"ktr", "application/vnd.kahootz"}, + {"ktx", "image/ktx"}, + {"ktx2", "image/ktx2"}, + {"ktz", "application/vnd.kahootz"}, + {"kwd", "application/vnd.kde.kword"}, + {"kwt", "application/vnd.kde.kword"}, + {"l16", "audio/L16"}, + {"las", "application/vnd.las"}, + {"lasjson", "application/vnd.las.las+json"}, + {"lasxml", "application/vnd.las.las+xml"}, + {"latex", "application/x-latex"}, + {"lbc", "audio/iLBC"}, + {"lbd", "application/vnd.llamagraphics.life-balance.desktop"}, + {"lbe", "application/vnd.llamagraphics.life-balance.exchange+xml"}, + {"lca", "application/vnd.logipipe.circuit+zip"}, + {"lcs", "application/vnd.logipipe.circuit+zip"}, + {"le", "application/vnd.bluetooth.le.oob"}, + {"les", "application/vnd.hhe.lesson-player"}, + {"lgr", "application/lgr+xml"}, + {"lha", "application/x-lha"}, + {"lhs", "text/x-literate-haskell"}, + {"lhzd", "application/vnd.belightsoft.lhzd+zip"}, + {"lhzl", "application/vnd.belightsoft.lhzl+zip"}, + {"lin", "application/bbolin"}, + {"line", "application/vnd.nebumind.line"}, + {"link66", "application/vnd.route66.link66+xml"}, + {"list3820", "application/vnd.afpc.modca"}, + {"listafp", "application/vnd.afpc.modca"}, + {"lmp", "model/vnd.gdl"}, + {"loas", "audio/usac"}, + {"loom", "application/vnd.loom"}, + {"lostsyncxml", "application/lostsync+xml"}, + {"lostxml", "application/lost+xml"}, + {"lpf", "application/lpf+zip"}, + {"lrm", "application/vnd.ms-lrm"}, + {"lsf", "video/x-la-asf"}, + {"lsx", "video/x-la-asf"}, + {"ltx", "text/x-tex"}, + {"lvp", "audio/vnd.lucent.voice"}, + {"lwp", "application/vnd.lotus-wordpro"}, + {"lxf", "application/LXF"}, + {"ly", "text/x-lilypond"}, + {"lyx", "application/x-lyx"}, + {"lzh", "application/x-lzh"}, + {"lzx", "application/x-lzx"}, + {"m", "application/vnd.wolfram.mathematica.package"}, + {"m1v", "video/mpeg"}, + {"m21", "application/mp21"}, + {"m2v", "video/mpeg"}, + {"m3g", "application/m3g"}, + {"m3u", "audio/mpegurl"}, + {"m3u8", "application/vnd.apple.mpegurl"}, + {"m4a", "audio/mp4"}, + {"m4s", "video/iso.segment"}, + {"m4u", "video/vnd.mpegurl"}, + {"m4v", "video/mp4"}, + {"ma", "application/mathematica"}, + {"mads", "application/mads+xml"}, + {"maei", "application/mmt-aei+xml"}, + {"mag", "application/vnd.ecowin.chart"}, + {"mail", "message/rfc822"}, + {"maker", "application/x-maker"}, + {"man", "application/x-troff-man"}, + {"manifest", "text/cache-manifest"}, + {"markdown", "text/markdown"}, + {"mb", "application/mathematica"}, + {"mbk", "application/vnd.Mobius.MBK"}, + {"mbox", "application/mbox"}, + {"mbsdf", "application/vnd.mdl-mbsdf"}, + {"mc1", "application/vnd.medcalcdata"}, + {"mc2", "text/vnd.senx.warpscript"}, + {"mcd", "application/vnd.mcd"}, + {"mcif", "chemical/x-mmcif"}, + {"mcm", "chemical/x-macmolecule"}, + {"md", "text/markdown"}, + {"mdb", "application/msaccess"}, + {"mdc", "application/vnd.marlin.drm.mdcf"}, + {"mdi", "image/vnd.ms-modi"}, + {"mdl", "application/vnd.mdl"}, + {"me", "application/x-troff-me"}, + {"mesh", "model/mesh"}, + {"meta4", "application/metalink4+xml"}, + {"mets", "application/mets+xml"}, + {"mf4", "application/MF4"}, + {"mfm", "application/vnd.mfmp"}, + {"mft", "application/rpki-manifest"}, + {"mgp", "application/vnd.osgeo.mapguide.package"}, + {"mgz", "application/vnd.proteus.magazine"}, + {"mhas", "audio/mhas"}, + {"mid", "audio/sp-midi"}, + {"mif", "application/vnd.mif"}, + {"miz", "text/mizar"}, + {"mj2", "video/mj2"}, + {"mjp2", "video/mj2"}, + {"mjs", "text/javascript"}, + {"mkv", "video/x-matroska"}, + {"ml2", "application/vnd.sybyl.mol2"}, + {"mlp", "audio/vnd.dolby.mlp"}, + {"mm", "application/x-freemind"}, + {"mmd", "application/vnd.chipnuts.karaoke-mmd"}, + {"mmdb", "application/vnd.maxmind.maxmind-db"}, + {"mmf", "application/vnd.smaf"}, + {"mml", "application/mathml+xml"}, + {"mmod", "chemical/x-macromodel-input"}, + {"mmr", "image/vnd.fujixerox.edmics-mmr"}, + {"mng", "video/x-mng"}, + {"moc", "text/x-moc"}, + {"mod", "application/xml-dtd"}, + {"model-inter", "application/vnd.vd-study"}, + {"modl", "application/vnd.modl"}, + {"mods", "application/mods+xml"}, + {"mol", "chemical/x-mdl-molfile"}, + {"mol2", "application/vnd.sybyl.mol2"}, + {"moml", "model/vnd.moml+xml"}, + {"moo", "chemical/x-mopac-out"}, + {"mop", "chemical/x-mopac-input"}, + {"mopcrt", "chemical/x-mopac-input"}, + {"mov", "video/quicktime"}, + {"movie", "video/x-sgi-movie"}, + {"mp1", "audio/mpeg"}, + {"mp2", "audio/mpeg"}, + {"mp21", "application/mp21"}, + {"mp3", "audio/mpeg"}, + {"mp4", "video/mp4"}, + {"mpc", "application/vnd.mophun.certificate"}, + {"mpd", "application/dash+xml"}, + {"mpdd", "application/dashdelta"}, + {"mpe", "video/mpeg"}, + {"mpeg", "video/mpeg"}, + {"mpega", "audio/mpeg"}, + {"mpf", "text/vnd.ms-mediapackage"}, + {"mpg", "video/mpeg"}, + {"mpg4", "video/mp4"}, + {"mpga", "audio/mpeg"}, + {"mph", "application/x-comsol"}, + {"mpkg", "application/vnd.apple.installer+xml"}, + {"mpm", "application/vnd.blueice.multipass"}, + {"mpn", "application/vnd.mophun.application"}, + {"mpp", "application/vnd.ms-project"}, + {"mpt", "application/vnd.ms-project"}, + {"mpv", "video/x-matroska"}, + {"mpw", "application/vnd.exstream-empower+zip"}, + {"mpy", "application/vnd.ibm.MiniPay"}, + {"mqy", "application/vnd.Mobius.MQY"}, + {"mrc", "application/marc"}, + {"mrcx", "application/marcxml+xml"}, + {"ms", "application/x-troff-ms"}, + {"msa", "application/vnd.msa-disk-image"}, + {"msd", "application/vnd.fdsn.mseed"}, + {"mseed", "application/vnd.fdsn.mseed"}, + {"mseq", "application/vnd.mseq"}, + {"msf", "application/vnd.epson.msf"}, + {"msh", "model/mesh"}, + {"msi", "application/x-msi"}, + {"msl", "application/vnd.Mobius.MSL"}, + {"msm", "model/vnd.gdl"}, + {"msp", "application/octet-stream"}, + {"msty", "application/vnd.muvee.style"}, + {"msu", "application/octet-stream"}, + {"mtl", "model/mtl"}, + {"mts", "model/vnd.mts"}, + {"multitrack", "audio/vnd.presonus.multitrack"}, + {"mus", "application/vnd.musician"}, + {"musd", "application/mmt-usd+xml"}, + {"mvb", "chemical/x-mopac-vib"}, + {"mvt", "application/vnd.mapbox-vector-tile"}, + {"mwc", "application/vnd.dpgraph"}, + {"mwf", "application/vnd.MFER"}, + {"mxf", "application/mxf"}, + {"mxi", "application/vnd.vd-study"}, + {"mxl", "application/vnd.recordare.musicxml"}, + {"mxmf", "audio/mobile-xmf"}, + {"mxml", "application/xv+xml"}, + {"mxs", "application/vnd.triscape.mxs"}, + {"mxu", "video/vnd.mpegurl"}, + {"n3", "text/n3"}, + {"nb", "application/vnd.wolfram.mathematica"}, + {"nbp", "application/vnd.wolfram.player"}, + {"nc", "application/x-netcdf"}, + {"ndc", "application/vnd.osa.netdeploy"}, + {"ndl", "application/vnd.lotus-notes"}, + {"nds", "application/vnd.nintendo.nitro.rom"}, + {"nebul", "application/vnd.nebumind.line"}, + {"nef", "image/x-nikon-nef"}, + {"ngdat", "application/vnd.nokia.n-gage.data"}, + {"nim", "video/vnd.nokia.interleaved-multimedia"}, + {"nimn", "application/vnd.nimn"}, + {"nitf", "application/vnd.nitf"}, + {"nlu", "application/vnd.neurolanguage.nlu"}, + {"nml", "application/vnd.enliven"}, + {"nnd", "application/vnd.noblenet-directory"}, + {"nns", "application/vnd.noblenet-sealer"}, + {"nnw", "application/vnd.noblenet-web"}, + {"notebook", "application/vnd.smart.notebook"}, + {"nq", "application/n-quads"}, + {"ns2", "application/vnd.lotus-notes"}, + {"ns3", "application/vnd.lotus-notes"}, + {"ns4", "application/vnd.lotus-notes"}, + {"nsf", "application/vnd.lotus-notes"}, + {"nsg", "application/vnd.lotus-notes"}, + {"nsh", "application/vnd.lotus-notes"}, + {"nt", "application/n-triples"}, + {"ntf", "application/vnd.lotus-notes"}, + {"numbers", "application/vnd.apple.numbers"}, + {"nwc", "application/x-nwc"}, + {"o", "application/x-object"}, + {"oa2", "application/vnd.fujitsu.oasys2"}, + {"oa3", "application/vnd.fujitsu.oasys3"}, + {"oas", "application/vnd.fujitsu.oasys"}, + {"ob", "application/vnd.1ob"}, + {"obg", "application/vnd.openblox.game-binary"}, + {"obgx", "application/vnd.openblox.game+xml"}, + {"obj", "model/obj"}, + {"oda", "application/ODA"}, + {"odb", "application/vnd.oasis.opendocument.base"}, + {"odc", "application/vnd.oasis.opendocument.chart"}, + {"odd", "application/tei+xml"}, + {"odf", "application/vnd.oasis.opendocument.formula"}, + {"odg", "application/vnd.oasis.opendocument.graphics"}, + {"odi", "application/vnd.oasis.opendocument.image"}, + {"odm", "application/vnd.oasis.opendocument.text-master"}, + {"odp", "application/vnd.oasis.opendocument.presentation"}, + {"ods", "application/vnd.oasis.opendocument.spreadsheet"}, + {"odt", "application/vnd.oasis.opendocument.text"}, + {"odx", "application/ODX"}, + {"oeb", "application/vnd.openeye.oeb"}, + {"oga", "audio/ogg"}, + {"ogex", "model/vnd.opengex"}, + {"ogg", "audio/ogg"}, + {"ogv", "video/ogg"}, + {"ogx", "application/ogg"}, + {"old", "application/x-trash"}, + {"omg", "audio/ATRAC3"}, + {"one", "application/onenote"}, + {"onepkg", "application/onenote"}, + {"onetmp", "application/onenote"}, + {"onetoc2", "application/onenote"}, + {"opf", "application/oebps-package+xml"}, + {"oprc", "application/vnd.palm"}, + {"opus", "audio/ogg"}, + {"or2", "application/vnd.lotus-organizer"}, + {"or3", "application/vnd.lotus-organizer"}, + {"orc", "audio/csound"}, + {"orf", "image/x-olympus-orf"}, + {"org", "application/vnd.lotus-organizer"}, + {"orq", "application/ocsp-request"}, + {"ors", "application/ocsp-response"}, + {"osf", "application/vnd.yamaha.openscoreformat"}, + {"osm", "application/vnd.openstreetmap.data+xml"}, + {"ota", "application/vnd.android.ota"}, + {"otc", "application/vnd.oasis.opendocument.chart-template"}, + {"otf", "font/otf"}, + {"otg", "application/vnd.oasis.opendocument.graphics-template"}, + {"oth", "application/vnd.oasis.opendocument.text-web"}, + {"oti", "application/vnd.oasis.opendocument.image-template"}, + {"otm", "application/vnd.oasis.opendocument.text-master-template"}, + {"otp", "application/vnd.oasis.opendocument.presentation-template"}, + {"ots", "application/vnd.oasis.opendocument.spreadsheet-template"}, + {"ott", "application/vnd.oasis.opendocument.text-template"}, + {"ovl", "application/vnd.afpc.modca-overlay"}, + {"oxlicg", "application/vnd.oxli.countgraph"}, + {"oxps", "application/oxps"}, + {"oxt", "application/vnd.openofficeorg.extension"}, + {"oza", "application/x-oz-application"}, + {"p", "text/x-pascal"}, + {"p10", "application/pkcs10"}, + {"p12", "application/pkcs12"}, + {"p21", "application/p21"}, + {"p2p", "application/vnd.wfa.p2p"}, + {"p7c", "application/pkcs7-mime"}, + {"p7m", "application/pkcs7-mime"}, + {"p7r", "application/x-pkcs7-certreqresp"}, + {"p7s", "application/pkcs7-signature"}, + {"p7z", "application/pkcs7-mime"}, + {"p8", "application/pkcs8"}, + {"p8e", "application/pkcs8-encrypted"}, + {"pac", "application/x-ns-proxy-autoconfig"}, + {"package", "application/vnd.autopackage"}, + {"pages", "application/vnd.apple.pages"}, + {"pas", "text/x-pascal"}, + {"pat", "image/x-coreldrawpattern"}, + {"patch", "text/x-diff"}, + {"paw", "application/vnd.pawaafile"}, + {"pbd", "application/vnd.powerbuilder6"}, + {"pbm", "image/x-portable-bitmap"}, + {"pcap", "application/vnd.tcpdump.pcap"}, + {"pcf", "application/x-font-pcf"}, + {"pcf.Z", "application/x-font-pcf"}, + {"pcl", "application/vnd.hp-PCL"}, + {"pcx", "image/vnd.zbrush.pcx"}, + {"pdb", "application/vnd.palm"}, + {"pdf", "application/pdf"}, + {"pdx", "application/PDX"}, + {"pem", "application/pem-certificate-chain"}, + {"pfa", "application/x-font"}, + {"pfb", "application/x-font"}, + {"pfr", "application/font-tdpfr"}, + {"pfx", "application/pkcs12"}, + {"pgb", "image/vnd.globalgraphics.pgb"}, + {"PGB", "image/vnd.globalgraphics.pgb"}, + {"pgm", "image/x-portable-graymap"}, + {"pgn", "application/vnd.chess-pgn"}, + {"pgp", "application/pgp-encrypted"}, + {"pil", "application/vnd.piaccess.application-licence"}, + {"pk", "application/x-tex-pk"}, + {"pkd", "application/vnd.hbci"}, + {"pkg", "application/vnd.apple.installer+xml"}, + {"pki", "application/pkixcmp"}, + {"pkipath", "application/pkix-pkipath"}, + {"pl", "text/x-perl"}, + {"plb", "application/vnd.3gpp.pic-bw-large"}, + {"plc", "application/vnd.Mobius.PLC"}, + {"plf", "application/vnd.pocketlearn"}, + {"plj", "audio/vnd.everad.plj"}, + {"plp", "application/vnd.panoply"}, + {"pls", "audio/x-scpls"}, + {"pm", "text/x-perl"}, + {"pml", "application/vnd.ctc-posml"}, + {"png", "image/png"}, + {"pnm", "image/x-portable-anymap"}, + {"portpkg", "application/vnd.macports.portpkg"}, + {"pot", "text/plain"}, + {"potm", "application/vnd.ms-powerpoint.template.macroEnabled.12"}, + {"potx", + "application/vnd.openxmlformats-officedocument.presentationml.template"}, + {"ppam", "application/vnd.ms-powerpoint.addin.macroEnabled.12"}, + {"ppd", "application/vnd.cups-ppd"}, + {"ppkg", "application/vnd.xmpie.ppkg"}, + {"ppm", "image/x-portable-pixmap"}, + {"pps", "application/vnd.ms-powerpoint"}, + {"ppsm", "application/vnd.ms-powerpoint.slideshow.macroEnabled.12"}, + {"ppsx", + "application/vnd.openxmlformats-officedocument.presentationml.slideshow"}, + {"ppt", "application/vnd.ms-powerpoint"}, + {"pptm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12"}, + {"ppttc", "application/vnd.think-cell.ppttc+json"}, + {"pptx", "application/" + "vnd.openxmlformats-officedocument.presentationml.presentation"}, + {"pqa", "application/vnd.palm"}, + {"prc", "model/prc"}, + {"pre", "application/vnd.lotus-freelance"}, + {"preminet", "application/vnd.preminet"}, + {"prf", "application/pics-rules"}, + {"provn", "text/provenance-notation"}, + {"provx", "application/provenance+xml"}, + {"prt", "chemical/x-ncbi-asn1-ascii"}, + {"prz", "application/vnd.lotus-freelance"}, + {"ps", "application/postscript"}, + {"psb", "application/vnd.3gpp.pic-bw-small"}, + {"psd", "image/vnd.adobe.photoshop"}, + {"pseg3820", "application/vnd.afpc.modca"}, + {"psfs", "application/vnd.psfs"}, + {"psg", "application/vnd.afpc.modca-pagesegment"}, + {"psid", "audio/prs.sid"}, + {"pskcxml", "application/pskc+xml"}, + {"pt", "application/vnd.snesdev-page-table"}, + {"pti", "image/prs.pti"}, + {"ptid", "application/vnd.pvi.ptid1"}, + {"ptrom", "application/vnd.snesdev-page-table"}, + {"pub", "application/vnd.exstream-package"}, + {"pvb", "application/vnd.3gpp.pic-bw-var"}, + {"pwn", "application/vnd.3M.Post-it-Notes"}, + {"py", "text/x-python"}, + {"pya", "audio/vnd.ms-playready.media.pya"}, + {"pyc", "application/x-python-code"}, + {"pyo", "application/x-python-code"}, + {"pyox", "model/vnd.pytha.pyox"}, + {"pyv", "video/vnd.ms-playready.media.pyv"}, + {"qam", "application/vnd.epson.quickanime"}, + {"qbo", "application/vnd.intu.qbo"}, + {"qca", "application/vnd.ericsson.quickcall"}, + {"qcall", "application/vnd.ericsson.quickcall"}, + {"qcp", "audio/EVRC-QCP"}, + {"QCP", "audio/EVRC-QCP"}, + {"qfx", "application/vnd.intu.qfx"}, + {"qgs", "application/x-qgis"}, + {"qps", "application/vnd.publishare-delta-tree"}, + {"qt", "video/quicktime"}, + {"qtl", "application/x-quicktimeplayer"}, + {"quiz", "application/vnd.quobject-quoxdocument"}, + {"quox", "application/vnd.quobject-quoxdocument"}, + {"qvd", "application/vnd.theqvd"}, + {"qwd", "application/vnd.Quark.QuarkXPress"}, + {"qwt", "application/vnd.Quark.QuarkXPress"}, + {"qxb", "application/vnd.Quark.QuarkXPress"}, + {"qxd", "application/vnd.Quark.QuarkXPress"}, + {"qxl", "application/vnd.Quark.QuarkXPress"}, + {"qxt", "application/vnd.Quark.QuarkXPress"}, + {"ra", "audio/x-pn-realaudio"}, + {"ram", "audio/x-pn-realaudio"}, + {"rapd", "application/route-apd+xml"}, + {"rar", "application/vnd.rar"}, + {"ras", "image/x-cmu-raster"}, + {"rb", "application/x-ruby"}, + {"rcprofile", "application/vnd.ipunplugged.rcprofile"}, + {"rct", "application/prs.nprend"}, + {"rd", "chemical/x-mdl-rdfile"}, + {"rdf", "application/rdf+xml"}, + {"rdf-crypt", "application/prs.rdf-xml-crypt"}, + {"rdp", "application/x-rdp"}, + {"rdz", "application/vnd.data-vision.rdz"}, + {"relo", "application/p2p-overlay+xml"}, + {"reload", "application/vnd.resilient.logic"}, + {"rep", "application/vnd.businessobjects"}, + {"request", "application/vnd.nervana"}, + {"rfcxml", "application/rfc+xml"}, + {"rgb", "image/x-rgb"}, + {"rgbe", "image/vnd.radiance"}, + {"rif", "application/reginfo+xml"}, + {"rip", "audio/vnd.rip"}, + {"rl", "application/resource-lists+xml"}, + {"rlc", "image/vnd.fujixerox.edmics-rlc"}, + {"rld", "application/resource-lists-diff+xml"}, + {"rlm", "application/vnd.resilient.logic"}, + {"rm", "audio/x-pn-realaudio"}, + {"rms", "application/vnd.jcp.javame.midlet-rms"}, + {"rnc", "application/relax-ng-compact-syntax"}, + {"rnd", "application/prs.nprend"}, + {"roa", "application/rpki-roa"}, + {"roff", "text/troff"}, + {"ros", "chemical/x-rosdal"}, + {"rp9", "application/vnd.cloanto.rp9"}, + {"rpm", "application/x-redhat-package-manager"}, + {"rpss", "application/vnd.nokia.radio-presets"}, + {"rpst", "application/vnd.nokia.radio-preset"}, + {"rq", "application/sparql-query"}, + {"rs", "application/rls-services+xml"}, + {"rsat", "application/atsc-rsat+xml"}, + {"rsheet", "application/urc-ressheet+xml"}, + {"rsm", "model/vnd.gdl"}, + {"rss", "application/x-rss+xml"}, + {"rst", "text/prs.fallenstein.rst"}, + {"rtf", "application/rtf"}, + {"rusd", "application/route-usd+xml"}, + {"rxn", "chemical/x-mdl-rxnfile"}, + {"rxt", "application/vnd.medicalholodeck.recordxr"}, + {"s11", "video/vnd.sealed.mpeg1"}, + {"s14", "video/vnd.sealed.mpeg4"}, + {"s1a", "application/vnd.sealedmedia.softseal.pdf"}, + {"s1e", "application/vnd.sealed.xls"}, + {"s1g", "image/vnd.sealedmedia.softseal.gif"}, + {"s1h", "application/vnd.sealedmedia.softseal.html"}, + {"s1j", "image/vnd.sealedmedia.softseal.jpg"}, + {"s1m", "audio/vnd.sealedmedia.softseal.mpeg"}, + {"s1n", "image/vnd.sealed.png"}, + {"s1p", "application/vnd.sealed.ppt"}, + {"s1q", "video/vnd.sealedmedia.softseal.mov"}, + {"s1w", "application/vnd.sealed.doc"}, + {"s3df", "application/vnd.sealed.3df"}, + {"sac", "application/tamp-sequence-adjust-confirm"}, + {"saf", "application/vnd.yamaha.smaf-audio"}, + {"sam", "application/vnd.lotus-wordpro"}, + {"SAR", "application/vnd.sar"}, + {"sarif", "application/sarif+json"}, + {"sarif-external-properties", "application/sarif-external-properties+json"}, + {"sarif-external-properties.json", + "application/sarif-external-properties+json"}, + {"sarif.json", "application/sarif+json"}, + {"sc", "application/vnd.ibm.secure-container"}, + {"scala", "text/x-scala"}, + {"scd", "application/vnd.scribus"}, + {"sce", "application/vnd.etsi.asic-e+zip"}, + {"sci", "application/x-scilab"}, + {"scim", "application/scim+json"}, + {"scl", "application/vnd.sycle+xml"}, + {"scld", "application/vnd.doremir.scorecloud-binary-document"}, + {"scm", "application/vnd.lotus-screencam"}, + {"sco", "audio/csound"}, + {"scq", "application/scvp-cv-request"}, + {"scr", "application/x-silverlight"}, + {"scs", "application/scvp-cv-response"}, + {"scsf", "application/vnd.sealed.csf"}, + {"sd", "chemical/x-mdl-sdfile"}, + {"sd2", "audio/x-sd2"}, + {"sda", "application/vnd.stardivision.draw"}, + {"sdc", "application/vnd.stardivision.calc"}, + {"sdd", "application/vnd.stardivision.impress"}, + {"sdf", "application/vnd.Kinar"}, + {"sdkd", "application/vnd.solent.sdkm+xml"}, + {"sdkm", "application/vnd.solent.sdkm+xml"}, + {"sdo", "application/vnd.sealed.doc"}, + {"sdoc", "application/vnd.sealed.doc"}, + {"sdp", "application/sdp"}, + {"sds", "application/vnd.stardivision.chart"}, + {"sdw", "application/vnd.stardivision.writer"}, + {"see", "application/vnd.seemail"}, + {"seed", "application/vnd.fdsn.seed"}, + {"sem", "application/vnd.sealed.eml"}, + {"sema", "application/vnd.sema"}, + {"semd", "application/vnd.semd"}, + {"semf", "application/vnd.semf"}, + {"seml", "application/vnd.sealed.eml"}, + {"senml", "application/senml+json"}, + {"senml-etchc", "application/senml-etch+cbor"}, + {"senml-etchj", "application/senml-etch+json"}, + {"senmlc", "application/senml+cbor"}, + {"senmle", "application/senml-exi"}, + {"senmlx", "application/senml+xml"}, + {"sensml", "application/sensml+json"}, + {"sensmlc", "application/sensml+cbor"}, + {"sensmle", "application/sensml-exi"}, + {"sensmlx", "application/sensml+xml"}, + {"ser", "application/java-serialized-object"}, + {"sfc", "application/vnd.nintendo.snes.rom"}, + {"sfd", "application/vnd.font-fontforge-sfd"}, + {"sfd-hdstx", "application/vnd.hydrostatix.sof-data"}, + {"sfs", "application/vnd.spotfire.sfs"}, + {"sfv", "text/x-sfv"}, + {"sgf", "application/x-go-sgf"}, + {"sgi", "image/vnd.sealedmedia.softseal.gif"}, + {"sgif", "image/vnd.sealedmedia.softseal.gif"}, + {"sgl", "application/vnd.stardivision.writer-global"}, + {"sgm", "text/SGML"}, + {"sgml", "text/SGML"}, + {"sh", "application/x-sh"}, + {"shaclc", "text/shaclc"}, + {"shar", "application/x-shar"}, + {"shc", "text/shaclc"}, + {"shex", "text/shex"}, + {"shf", "application/shf+xml"}, + {"shp", "application/vnd.shp"}, + {"shtml", "text/html"}, + {"shx", "application/vnd.shx"}, + {"si", "text/vnd.wap.si"}, + {"sic", "application/vnd.wap.sic"}, + {"sid", "audio/prs.sid"}, + {"sieve", "application/sieve"}, + {"sig", "application/pgp-signature"}, + {"sik", "application/x-trash"}, + {"silo", "model/mesh"}, + {"sipa", "application/vnd.smintio.portals.archive"}, + {"sis", "application/vnd.symbian.install"}, + {"sit", "application/x-stuffit"}, + {"sitx", "application/x-stuffit"}, + {"siv", "application/sieve"}, + {"sjp", "image/vnd.sealedmedia.softseal.jpg"}, + {"sjpg", "image/vnd.sealedmedia.softseal.jpg"}, + {"skd", "application/vnd.koan"}, + {"skm", "application/vnd.koan"}, + {"skp", "application/vnd.koan"}, + {"skt", "application/vnd.koan"}, + {"sl", "text/vnd.wap.sl"}, + {"sla", "application/vnd.scribus"}, + {"slaz", "application/vnd.scribus"}, + {"slc", "application/vnd.wap.slc"}, + {"sldm", "application/vnd.ms-powerpoint.slide.macroEnabled.12"}, + {"sldx", + "application/vnd.openxmlformats-officedocument.presentationml.slide"}, + {"sls", "application/route-s-tsid+xml"}, + {"slt", "application/vnd.epson.salt"}, + {"sm", "application/vnd.stepmania.stepchart"}, + {"smc", "application/vnd.nintendo.snes.rom"}, + {"smf", "application/vnd.stardivision.math"}, + {"smh", "application/vnd.sealed.mht"}, + {"smht", "application/vnd.sealed.mht"}, + {"smi", "application/smil+xml"}, + {"smil", "application/smil+xml"}, + {"smk", "video/vnd.radgamettools.smacker"}, + {"sml", "application/smil+xml"}, + {"smo", "video/vnd.sealedmedia.softseal.mov"}, + {"smov", "video/vnd.sealedmedia.softseal.mov"}, + {"smp", "audio/vnd.sealedmedia.softseal.mpeg"}, + {"smp3", "audio/vnd.sealedmedia.softseal.mpeg"}, + {"smpg", "video/vnd.sealed.mpeg1"}, + {"sms", "application/vnd.3gpp2.sms"}, + {"smv", "audio/SMV"}, + {"smzip", "application/vnd.stepmania.package"}, + {"snd", "audio/basic"}, + {"soa", "text/dns"}, + {"soc", "application/sgml-open-catalog"}, + {"sofa", "audio/sofa"}, + {"sos", "text/vnd.sosi"}, + {"spc", "chemical/x-galactic-spc"}, + {"spd", "application/vnd.sealedmedia.softseal.pdf"}, + {"spdf", "application/vnd.sealedmedia.softseal.pdf"}, + {"spdx", "text/spdx"}, + {"spdx.json", "application/spdx+json"}, + {"spf", "application/vnd.yamaha.smaf-phrase"}, + {"spl", "application/futuresplash"}, + {"spn", "image/vnd.sealed.png"}, + {"spng", "image/vnd.sealed.png"}, + {"spo", "text/vnd.in3d.spot"}, + {"spot", "text/vnd.in3d.spot"}, + {"spp", "application/scvp-vp-response"}, + {"sppt", "application/vnd.sealed.ppt"}, + {"spq", "application/scvp-vp-request"}, + {"spx", "audio/ogg"}, + {"sql", "application/sql"}, + {"sqlite", "application/vnd.sqlite3"}, + {"sqlite3", "application/vnd.sqlite3"}, + {"sr", "application/vnd.sigrok.session"}, + {"src", "application/x-wais-source"}, + {"srt", "text/plain"}, + {"sru", "application/sru+xml"}, + {"srx", "application/sparql-results+xml"}, + {"sse", "application/vnd.kodak-descriptor"}, + {"ssf", "application/vnd.epson.ssf"}, + {"ssml", "application/ssml+xml"}, + {"ssv", "application/vnd.shade-save-file"}, + {"ssvc", "application/vnd.crypto-shade-file"}, + {"ssw", "video/vnd.sealed.swf"}, + {"sswf", "video/vnd.sealed.swf"}, + {"st", "application/vnd.sailingtracker.track"}, + {"stc", "application/vnd.sun.xml.calc.template"}, + {"std", "application/vnd.sun.xml.draw.template"}, + {"step", "model/step"}, + {"stf", "application/vnd.wt.stf"}, + {"sti", "application/vnd.sun.xml.impress.template"}, + {"stif", "application/vnd.sealed.tiff"}, + {"stix", "application/stix+json"}, + {"stk", "application/hyperstudio"}, + {"stl", "model/stl"}, + {"stml", "application/vnd.sealedmedia.softseal.html"}, + {"stp", "model/step"}, + {"stpnc", "application/p21"}, + {"stpx", "model/step+xml"}, + {"stpxz", "model/step-xml+zip"}, + {"stpz", "model/step+zip"}, + {"str", "application/vnd.pg.format"}, + {"study-inter", "application/vnd.vd-study"}, + {"stw", "application/vnd.sun.xml.writer.template"}, + {"sty", "text/x-tex"}, + {"sus", "application/vnd.sus-calendar"}, + {"susp", "application/vnd.sus-calendar"}, + {"sv4cpio", "application/x-sv4cpio"}, + {"sv4crc", "application/x-sv4crc"}, + {"svc", "application/vnd.dvb.service"}, + {"svg", "image/svg+xml"}, + {"svgz", "image/svg+xml"}, + {"sw", "chemical/x-swissprot"}, + {"swf", "application/vnd.adobe.flash.movie"}, + {"swi", "application/vnd.aristanetworks.swi"}, + {"swidtag", "application/swid+xml"}, + {"sxc", "application/vnd.sun.xml.calc"}, + {"sxd", "application/vnd.sun.xml.draw"}, + {"sxg", "application/vnd.sun.xml.writer.global"}, + {"sxi", "application/vnd.sun.xml.impress"}, + {"sxl", "application/vnd.sealed.xls"}, + {"sxls", "application/vnd.sealed.xls"}, + {"sxm", "application/vnd.sun.xml.math"}, + {"sxw", "application/vnd.sun.xml.writer"}, + {"sy2", "application/vnd.sybyl.mol2"}, + {"syft.json", "application/vnd.syft+json"}, + {"t", "text/troff"}, + {"tag", "text/prs.lines.tag"}, + {"taglet", "application/vnd.mynfc"}, + {"tam", "application/vnd.onepager"}, + {"tamp", "application/vnd.onepagertamp"}, + {"tamx", "application/vnd.onepagertamx"}, + {"tao", "application/vnd.tao.intent-module-archive"}, + {"tap", "image/vnd.tencent.tap"}, + {"tar", "application/x-tar"}, + {"tat", "application/vnd.onepagertat"}, + {"tatp", "application/vnd.onepagertatp"}, + {"tatx", "application/vnd.onepagertatx"}, + {"tau", "application/tamp-apex-update"}, + {"taz", "application/x-gtar-compressed"}, + {"tcap", "application/vnd.3gpp2.tcap"}, + {"tcl", "application/x-tcl"}, + {"tcu", "application/tamp-community-update"}, + {"td", "application/urc-targetdesc+xml"}, + {"teacher", "application/vnd.smart.teacher"}, + {"tei", "application/tei+xml"}, + {"teiCorpus", "application/tei+xml"}, + {"ter", "application/tamp-error"}, + {"tex", "text/x-tex"}, + {"texi", "application/x-texinfo"}, + {"texinfo", "application/x-texinfo"}, + {"text", "text/plain"}, + {"tfi", "application/thraud+xml"}, + {"tfx", "image/tiff-fx"}, + {"tgf", "chemical/x-mdl-tgf"}, + {"tgz", "application/x-gtar-compressed"}, + {"thmx", "application/vnd.ms-officetheme"}, + {"tif", "image/tiff"}, + {"tiff", "image/tiff"}, + {"tk", "text/x-tcl"}, + {"tlclient", "application/vnd.cendio.thinlinc.clientconf"}, + {"tm", "text/texmacs"}, + {"tm.json", "application/tm+json"}, + {"tm.jsonld", "application/tm+json"}, + {"tmo", "application/vnd.tmobile-livetv"}, + {"tnef", "application/vnd.ms-tnef"}, + {"tnf", "application/vnd.ms-tnef"}, + {"torrent", "application/x-bittorrent"}, + {"tpl", "application/vnd.groove-tool-template"}, + {"tpt", "application/vnd.trid.tpt"}, + {"tr", "text/troff"}, + {"tra", "application/vnd.trueapp"}, + {"tree", "application/vnd.rainstor.data"}, + {"trig", "application/trig"}, + {"ts", "text/vnd.trolltech.linguist"}, + {"tsa", "application/tamp-sequence-adjust"}, + {"tsd", "application/timestamped-data"}, + {"tsp", "application/dsptype"}, + {"tsq", "application/timestamp-query"}, + {"tsr", "application/timestamp-reply"}, + {"tst", "application/vnd.etsi.timestamp-token"}, + {"tsv", "text/tab-separated-values"}, + {"ttc", "font/collection"}, + {"ttf", "font/ttf"}, + {"ttl", "text/turtle"}, + {"ttml", "application/ttml+xml"}, + {"tuc", "application/tamp-update-confirm"}, + {"tur", "application/tamp-update"}, + {"twd", "application/vnd.SimTech-MindMapper"}, + {"twds", "application/vnd.SimTech-MindMapper"}, + {"txd", "application/vnd.genomatix.tuxedo"}, + {"txf", "application/vnd.Mobius.TXF"}, + {"txt", "text/plain"}, + {"u3d", "model/u3d"}, + {"u8dsn", "message/global-delivery-status"}, + {"u8hdr", "message/global-headers"}, + {"u8mdn", "message/global-disposition-notification"}, + {"u8msg", "message/global"}, + {"udeb", "application/vnd.debian.binary-package"}, + {"ufd", "application/vnd.ufdl"}, + {"ufdl", "application/vnd.ufdl"}, + {"uis", "application/urc-uisocketdesc+xml"}, + {"umj", "application/vnd.umajin"}, + {"unityweb", "application/vnd.unity"}, + {"uo", "application/vnd.uoml+xml"}, + {"uoml", "application/vnd.uoml+xml"}, + {"upa", "application/vnd.hbci"}, + {"uri", "text/uri-list"}, + {"urim", "application/vnd.uri-map"}, + {"urimap", "application/vnd.uri-map"}, + {"uris", "text/uri-list"}, + {"usda", "model/vnd.usda"}, + {"usdz", "model/vnd.usdz+zip"}, + {"ustar", "application/x-ustar"}, + {"utz", "application/vnd.uiq.theme"}, + {"uva", "audio/vnd.dece.audio"}, + {"uvd", "application/vnd.dece.data"}, + {"uvf", "application/vnd.dece.data"}, + {"uvg", "image/vnd.dece.graphic"}, + {"uvh", "video/vnd.dece.hd"}, + {"uvi", "image/vnd.dece.graphic"}, + {"uvm", "video/vnd.dece.mobile"}, + {"uvp", "video/vnd.dece.pd"}, + {"uvs", "video/vnd.dece.sd"}, + {"uvt", "application/vnd.dece.ttml+xml"}, + {"uvu", "video/vnd.dece.mp4"}, + {"uvv", "video/vnd.dece.video"}, + {"uvva", "audio/vnd.dece.audio"}, + {"uvvd", "application/vnd.dece.data"}, + {"uvvf", "application/vnd.dece.data"}, + {"uvvg", "image/vnd.dece.graphic"}, + {"uvvh", "video/vnd.dece.hd"}, + {"uvvi", "image/vnd.dece.graphic"}, + {"uvvm", "video/vnd.dece.mobile"}, + {"uvvp", "video/vnd.dece.pd"}, + {"uvvs", "video/vnd.dece.sd"}, + {"uvvt", "application/vnd.dece.ttml+xml"}, + {"uvvu", "video/vnd.dece.mp4"}, + {"uvvv", "video/vnd.dece.video"}, + {"uvvx", "application/vnd.dece.unspecified"}, + {"uvvz", "application/vnd.dece.zip"}, + {"uvx", "application/vnd.dece.unspecified"}, + {"uvz", "application/vnd.dece.zip"}, + {"val", "chemical/x-ncbi-asn1-binary"}, + {"vbk", "audio/vnd.nortel.vbk"}, + {"vbox", "application/vnd.previewsystems.box"}, + {"vcard", "text/vcard"}, + {"vcd", "application/x-cdlink"}, + {"vcf", "text/vcard"}, + {"vcg", "application/vnd.groove-vcard"}, + {"vcj", "application/voucher-cms+json"}, + {"vcs", "text/x-vcalendar"}, + {"vcx", "application/vnd.vcx"}, + {"vds", "model/vnd.sap.vds"}, + {"VES", "application/vnd.ves.encrypted"}, + {"vew", "application/vnd.lotus-approach"}, + {"VFK", "text/vnd.exchangeable"}, + {"vfr", "application/vnd.tml"}, + {"viaframe", "application/vnd.tml"}, + {"vis", "application/vnd.visionary"}, + {"viv", "video/vnd.vivo"}, + {"vmd", "chemical/x-vmd"}, + {"vms", "chemical/x-vamas-iso14976"}, + {"vmt", "application/vnd.valve.source.material"}, + {"vpm", "multipart/voice-message"}, + {"vrm", "model/vrml"}, + {"vrml", "model/vrml"}, + {"vsc", "application/vnd.vidsoft.vidconference"}, + {"vsd", "application/vnd.visio"}, + {"vsf", "application/vnd.vsf"}, + {"vss", "application/vnd.visio"}, + {"vst", "application/vnd.visio"}, + {"vsw", "application/vnd.visio"}, + {"vtf", "image/vnd.valve.source.texture"}, + {"vtnstd", "application/vnd.veritone.aion+json"}, + {"vtt", "text/vtt"}, + {"vtu", "model/vnd.vtu"}, + {"vwx", "application/vnd.vectorworks"}, + {"vxml", "application/voicexml+xml"}, + {"wad", "application/x-doom"}, + {"wadl", "application/vnd.sun.wadl+xml"}, + {"wafl", "application/vnd.wasmflow.wafl"}, + {"wasm", "application/wasm"}, + {"wav", "audio/x-wav"}, + {"wax", "audio/x-ms-wax"}, + {"wbmp", "image/vnd.wap.wbmp"}, + {"wbs", "application/vnd.criticaltools.wbs+xml"}, + {"wbxml", "application/vnd.wap.wbxml"}, + {"wcm", "application/vnd.ms-works"}, + {"wdb", "application/vnd.ms-works"}, + {"webm", "video/webm"}, + {"webmanifest", "application/manifest+json"}, + {"webp", "image/webp"}, + {"wg", "application/vnd.pmi.widget"}, + {"wgsl", "text/wgsl"}, + {"wgt", "application/widget"}, + {"wif", "application/watcherinfo+xml"}, + {"win", "model/vnd.gdl"}, + {"wk", "application/x-123"}, + {"wk1", "application/vnd.lotus-1-2-3"}, + {"wk3", "application/vnd.lotus-1-2-3"}, + {"wk4", "application/vnd.lotus-1-2-3"}, + {"wks", "application/vnd.ms-works"}, + {"wlnk", "application/link-format"}, + {"wm", "video/x-ms-wm"}, + {"wma", "audio/x-ms-wma"}, + {"wmc", "application/vnd.wmc"}, + {"wmd", "application/x-ms-wmd"}, + {"wmf", "image/wmf"}, + {"wml", "text/vnd.wap.wml"}, + {"wmlc", "application/vnd.wap.wmlc"}, + {"wmls", "text/vnd.wap.wmlscript"}, + {"wmlsc", "application/vnd.wap.wmlscriptc"}, + {"wmv", "video/x-ms-wmv"}, + {"wmx", "video/x-ms-wmx"}, + {"wmz", "application/x-ms-wmz"}, + {"woff", "font/woff"}, + {"woff2", "font/woff2"}, + {"wpd", "application/vnd.wordperfect"}, + {"wpl", "application/vnd.ms-wpl"}, + {"wps", "application/vnd.ms-works"}, + {"wqd", "application/vnd.wqd"}, + {"wrl", "model/vrml"}, + {"wsc", "application/vnd.wfa.wsc"}, + {"wsdl", "application/wsdl+xml"}, + {"wspolicy", "application/wspolicy+xml"}, + {"wtb", "application/vnd.webturbo"}, + {"wv", "application/vnd.wv.csp+wbxml"}, + {"wvx", "video/x-ms-wvx"}, + {"wz", "application/x-wingz"}, + {"x_b", "model/vnd.parasolid.transmit.binary"}, + {"x_t", "model/vnd.parasolid.transmit.text"}, + {"x3d", "model/x3d+xml"}, + {"x3db", "model/x3d+fastinfoset"}, + {"x3dv", "model/x3d-vrml"}, + {"x3dvz", "model/x3d-vrml"}, + {"x3dz", "model/x3d+xml"}, + {"xar", "application/vnd.xara"}, + {"xav", "application/xcap-att+xml"}, + {"xbd", "application/vnd.fujixerox.docuworks.binder"}, + {"xbm", "image/x-xbitmap"}, + {"xca", "application/xcap-caps+xml"}, + {"xcf", "image/x-xcf"}, + {"xcos", "application/x-scilab-xcos"}, + {"xcs", "application/calendar+xml"}, + {"xct", "application/vnd.fujixerox.docuworks.container"}, + {"xdd", "application/bacnet-xdd+zip"}, + {"xdf", "application/xcap-diff+xml"}, + {"xdm", "application/vnd.syncml.dm+xml"}, + {"xdp", "application/vnd.adobe.xdp+xml"}, + {"xdssc", "application/dssc+xml"}, + {"xdw", "application/vnd.fujixerox.docuworks"}, + {"xel", "application/xcap-el+xml"}, + {"xer", "application/xcap-error+xml"}, + {"xfd", "application/vnd.xfdl"}, + {"xfdf", "application/xfdf"}, + {"xfdl", "application/vnd.xfdl"}, + {"xhe", "audio/usac"}, + {"xht", "application/xhtml+xml"}, + {"xhtm", "application/xhtml+xml"}, + {"xhtml", "application/xhtml+xml"}, + {"xhvml", "application/xv+xml"}, + {"xif", "image/vnd.xiff"}, + {"xla", "application/vnd.ms-excel"}, + {"xlam", "application/vnd.ms-excel.addin.macroEnabled.12"}, + {"xlc", "application/vnd.ms-excel"}, + {"xlf", "application/xliff+xml"}, + {"xlim", "application/vnd.xmpie.xlim"}, + {"xlm", "application/vnd.ms-excel"}, + {"xls", "application/vnd.ms-excel"}, + {"xlsb", "application/vnd.ms-excel.sheet.binary.macroEnabled.12"}, + {"xlsm", "application/vnd.ms-excel.sheet.macroEnabled.12"}, + {"xlsx", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}, + {"xlt", "application/vnd.ms-excel"}, + {"xltm", "application/vnd.ms-excel.template.macroEnabled.12"}, + {"xltx", + "application/vnd.openxmlformats-officedocument.spreadsheetml.template"}, + {"xlw", "application/vnd.ms-excel"}, + {"xml", "application/xml"}, + {"xmls", "application/dskpp+xml"}, + {"xmt_bin", "model/vnd.parasolid.transmit.binary"}, + {"xmt_txt", "model/vnd.parasolid.transmit.text"}, + {"xns", "application/xcap-ns+xml"}, + {"xo", "application/vnd.olpc-sugar"}, + {"xodp", "application/vnd.collabio.xodocuments.presentation"}, + {"xods", "application/vnd.collabio.xodocuments.spreadsheet"}, + {"xodt", "application/vnd.collabio.xodocuments.document"}, + {"xop", "application/xop+xml"}, + {"xotp", "application/vnd.collabio.xodocuments.presentation-template"}, + {"xots", "application/vnd.collabio.xodocuments.spreadsheet-template"}, + {"xott", "application/vnd.collabio.xodocuments.document-template"}, + {"xpak", "application/vnd.gentoo.xpak"}, + {"xpi", "application/x-xpinstall"}, + {"xpm", "image/x-xpixmap"}, + {"xpr", "application/vnd.is-xpr"}, + {"xps", "application/vnd.ms-xpsdocument"}, + {"xpw", "application/vnd.intercon.formnet"}, + {"xpx", "application/vnd.intercon.formnet"}, + {"xsf", "application/prs.xsf+xml"}, + {"xsl", "application/xslt+xml"}, + {"xslt", "application/xslt+xml"}, + {"xsm", "application/vnd.syncml+xml"}, + {"xspf", "application/xspf+xml"}, + {"xtel", "chemical/x-xtel"}, + {"xul", "application/vnd.mozilla.xul+xml"}, + {"xvm", "application/xv+xml"}, + {"xvml", "application/xv+xml"}, + {"xwd", "image/x-xwindowdump"}, + {"xyz", "chemical/x-xyz"}, + {"xyze", "image/vnd.radiance"}, + {"xz", "application/x-xz"}, + {"yaml", "application/yaml"}, + {"yang", "application/yang"}, + {"yin", "application/yin+xml"}, + {"yme", "application/vnd.yaoweme"}, + {"yml", "application/yaml"}, + {"yt", "video/vnd.youtube.yt"}, + {"zaz", "application/vnd.zzazz.deck+xml"}, + {"zfc", "application/vnd.filmit.zfc"}, + {"zfo", "application/vnd.software602.filler.form-xml-zip"}, + {"zip", "application/zip"}, + {"zir", "application/vnd.zul"}, + {"zirz", "application/vnd.zul"}, + {"zmm", "application/vnd.HandHeld-Entertainment+xml"}, + {"zmt", "chemical/x-mopac-input"}, + {"zone", "text/dns"}, + {"zst", "application/zstd"}}; -std::string find_mime_type(const std::string& ext) { +std::string find_mime_type(const std::string &ext) { std::map::const_iterator it = mime_map.find(ext); if (it == mime_map.end()) { return ""; } - + return it->second; } diff --git a/src/mime.h b/src/mime.h index d8f095192..d23ee1ca1 100644 --- a/src/mime.h +++ b/src/mime.h @@ -1,4 +1,4 @@ #include // Given a file extension, get the corresponding mime type -std::string find_mime_type(const std::string& ext); +std::string find_mime_type(const std::string &ext); diff --git a/src/optional.h b/src/optional.h index d01b089c0..b1f4b2493 100644 --- a/src/optional.h +++ b/src/optional.h @@ -7,402 +7,402 @@ // The idea and interface is based on Boost.Optional library // authored by Fernando Luis Cacciola Carballal -# ifndef ___OPTIONAL_HPP___ -# define ___OPTIONAL_HPP___ - -# include -# include -# include -# include -# include -# include -# include - -# define TR2_OPTIONAL_REQUIRES(...) typename enable_if<__VA_ARGS__::value, bool>::type = false - -# if defined __GNUC__ // NOTE: GNUC is also defined for Clang -# if (__GNUC__ == 4) && (__GNUC_MINOR__ >= 8) -# define TR2_OPTIONAL_GCC_4_8_AND_HIGHER___ -# elif (__GNUC__ > 4) -# define TR2_OPTIONAL_GCC_4_8_AND_HIGHER___ -# endif - -# if (__GNUC__ == 4) && (__GNUC_MINOR__ >= 7) -# define TR2_OPTIONAL_GCC_4_7_AND_HIGHER___ -# elif (__GNUC__ > 4) -# define TR2_OPTIONAL_GCC_4_7_AND_HIGHER___ -# endif - -# if (__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && (__GNUC_PATCHLEVEL__ >= 1) -# define TR2_OPTIONAL_GCC_4_8_1_AND_HIGHER___ -# elif (__GNUC__ == 4) && (__GNUC_MINOR__ >= 9) -# define TR2_OPTIONAL_GCC_4_8_1_AND_HIGHER___ -# elif (__GNUC__ > 4) -# define TR2_OPTIONAL_GCC_4_8_1_AND_HIGHER___ -# endif -# endif - -# if defined __clang_major__ -# if (__clang_major__ == 3 && __clang_minor__ >= 5) -# define TR2_OPTIONAL_CLANG_3_5_AND_HIGHTER_ -# elif (__clang_major__ > 3) -# define TR2_OPTIONAL_CLANG_3_5_AND_HIGHTER_ -# endif -# if defined TR2_OPTIONAL_CLANG_3_5_AND_HIGHTER_ -# define TR2_OPTIONAL_CLANG_3_4_2_AND_HIGHER_ -# elif (__clang_major__ == 3 && __clang_minor__ == 4 && __clang_patchlevel__ >= 2) -# define TR2_OPTIONAL_CLANG_3_4_2_AND_HIGHER_ -# endif -# endif - -# if defined _MSC_VER -# if (_MSC_VER >= 1900) -# define TR2_OPTIONAL_MSVC_2015_AND_HIGHER___ -# endif -# endif - -# if defined __clang__ -# if (__clang_major__ > 2) || (__clang_major__ == 2) && (__clang_minor__ >= 9) -# define OPTIONAL_HAS_THIS_RVALUE_REFS 1 -# else -# define OPTIONAL_HAS_THIS_RVALUE_REFS 0 -# endif -# elif defined TR2_OPTIONAL_GCC_4_8_1_AND_HIGHER___ -# define OPTIONAL_HAS_THIS_RVALUE_REFS 1 -# elif defined TR2_OPTIONAL_MSVC_2015_AND_HIGHER___ -# define OPTIONAL_HAS_THIS_RVALUE_REFS 1 -# else -# define OPTIONAL_HAS_THIS_RVALUE_REFS 0 -# endif - - -# if defined TR2_OPTIONAL_GCC_4_8_1_AND_HIGHER___ -# define OPTIONAL_HAS_CONSTEXPR_INIT_LIST 1 -# define OPTIONAL_CONSTEXPR_INIT_LIST constexpr -# else -# define OPTIONAL_HAS_CONSTEXPR_INIT_LIST 0 -# define OPTIONAL_CONSTEXPR_INIT_LIST -# endif - -# if defined TR2_OPTIONAL_CLANG_3_5_AND_HIGHTER_ && (defined __cplusplus) && (__cplusplus != 201103L) -# define OPTIONAL_HAS_MOVE_ACCESSORS 1 -# else -# define OPTIONAL_HAS_MOVE_ACCESSORS 0 -# endif - -// In C++11 constexpr implies const, so we need to make non-const members also non-constexpr -# if (defined __cplusplus) && (__cplusplus == 201103L) -# define OPTIONAL_MUTABLE_CONSTEXPR -# else -# define OPTIONAL_MUTABLE_CONSTEXPR constexpr -# endif - -namespace std{ - -namespace experimental{ +#ifndef ___OPTIONAL_HPP___ +#define ___OPTIONAL_HPP___ + +#include +#include +#include +#include +#include +#include +#include + +#define TR2_OPTIONAL_REQUIRES(...) \ + typename enable_if<__VA_ARGS__::value, bool>::type = false + +#if defined __GNUC__ // NOTE: GNUC is also defined for Clang +#if (__GNUC__ == 4) && (__GNUC_MINOR__ >= 8) +#define TR2_OPTIONAL_GCC_4_8_AND_HIGHER___ +#elif (__GNUC__ > 4) +#define TR2_OPTIONAL_GCC_4_8_AND_HIGHER___ +#endif + +#if (__GNUC__ == 4) && (__GNUC_MINOR__ >= 7) +#define TR2_OPTIONAL_GCC_4_7_AND_HIGHER___ +#elif (__GNUC__ > 4) +#define TR2_OPTIONAL_GCC_4_7_AND_HIGHER___ +#endif + +#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && (__GNUC_PATCHLEVEL__ >= 1) +#define TR2_OPTIONAL_GCC_4_8_1_AND_HIGHER___ +#elif (__GNUC__ == 4) && (__GNUC_MINOR__ >= 9) +#define TR2_OPTIONAL_GCC_4_8_1_AND_HIGHER___ +#elif (__GNUC__ > 4) +#define TR2_OPTIONAL_GCC_4_8_1_AND_HIGHER___ +#endif +#endif + +#if defined __clang_major__ +#if (__clang_major__ == 3 && __clang_minor__ >= 5) +#define TR2_OPTIONAL_CLANG_3_5_AND_HIGHTER_ +#elif (__clang_major__ > 3) +#define TR2_OPTIONAL_CLANG_3_5_AND_HIGHTER_ +#endif +#if defined TR2_OPTIONAL_CLANG_3_5_AND_HIGHTER_ +#define TR2_OPTIONAL_CLANG_3_4_2_AND_HIGHER_ +#elif (__clang_major__ == 3 && __clang_minor__ == 4 && \ + __clang_patchlevel__ >= 2) +#define TR2_OPTIONAL_CLANG_3_4_2_AND_HIGHER_ +#endif +#endif + +#if defined _MSC_VER +#if (_MSC_VER >= 1900) +#define TR2_OPTIONAL_MSVC_2015_AND_HIGHER___ +#endif +#endif + +#if defined __clang__ +#if (__clang_major__ > 2) || (__clang_major__ == 2) && (__clang_minor__ >= 9) +#define OPTIONAL_HAS_THIS_RVALUE_REFS 1 +#else +#define OPTIONAL_HAS_THIS_RVALUE_REFS 0 +#endif +#elif defined TR2_OPTIONAL_GCC_4_8_1_AND_HIGHER___ +#define OPTIONAL_HAS_THIS_RVALUE_REFS 1 +#elif defined TR2_OPTIONAL_MSVC_2015_AND_HIGHER___ +#define OPTIONAL_HAS_THIS_RVALUE_REFS 1 +#else +#define OPTIONAL_HAS_THIS_RVALUE_REFS 0 +#endif + +#if defined TR2_OPTIONAL_GCC_4_8_1_AND_HIGHER___ +#define OPTIONAL_HAS_CONSTEXPR_INIT_LIST 1 +#define OPTIONAL_CONSTEXPR_INIT_LIST constexpr +#else +#define OPTIONAL_HAS_CONSTEXPR_INIT_LIST 0 +#define OPTIONAL_CONSTEXPR_INIT_LIST +#endif + +#if defined TR2_OPTIONAL_CLANG_3_5_AND_HIGHTER_ && (defined __cplusplus) && \ + (__cplusplus != 201103L) +#define OPTIONAL_HAS_MOVE_ACCESSORS 1 +#else +#define OPTIONAL_HAS_MOVE_ACCESSORS 0 +#endif + +// In C++11 constexpr implies const, so we need to make non-const members also +// non-constexpr +#if (defined __cplusplus) && (__cplusplus == 201103L) +#define OPTIONAL_MUTABLE_CONSTEXPR +#else +#define OPTIONAL_MUTABLE_CONSTEXPR constexpr +#endif + +namespace std { + +namespace experimental { // BEGIN workaround for missing is_trivially_destructible -# if defined TR2_OPTIONAL_GCC_4_8_AND_HIGHER___ - // leave it: it is already there -# elif defined TR2_OPTIONAL_CLANG_3_4_2_AND_HIGHER_ - // leave it: it is already there -# elif defined TR2_OPTIONAL_MSVC_2015_AND_HIGHER___ - // leave it: it is already there -# elif defined TR2_OPTIONAL_DISABLE_EMULATION_OF_TYPE_TRAITS - // leave it: the user doesn't want it -# else - template - using is_trivially_destructible = std::has_trivial_destructor; -# endif +#if defined TR2_OPTIONAL_GCC_4_8_AND_HIGHER___ +// leave it: it is already there +#elif defined TR2_OPTIONAL_CLANG_3_4_2_AND_HIGHER_ +// leave it: it is already there +#elif defined TR2_OPTIONAL_MSVC_2015_AND_HIGHER___ +// leave it: it is already there +#elif defined TR2_OPTIONAL_DISABLE_EMULATION_OF_TYPE_TRAITS +// leave it: the user doesn't want it +#else +template +using is_trivially_destructible = std::has_trivial_destructor; +#endif // END workaround for missing is_trivially_destructible -# if (defined TR2_OPTIONAL_GCC_4_7_AND_HIGHER___) - // leave it; our metafunctions are already defined. -# elif defined TR2_OPTIONAL_CLANG_3_4_2_AND_HIGHER_ - // leave it; our metafunctions are already defined. -# elif defined TR2_OPTIONAL_MSVC_2015_AND_HIGHER___ - // leave it: it is already there -# elif defined TR2_OPTIONAL_DISABLE_EMULATION_OF_TYPE_TRAITS - // leave it: the user doesn't want it -# else - +#if (defined TR2_OPTIONAL_GCC_4_7_AND_HIGHER___) +// leave it; our metafunctions are already defined. +#elif defined TR2_OPTIONAL_CLANG_3_4_2_AND_HIGHER_ +// leave it; our metafunctions are already defined. +#elif defined TR2_OPTIONAL_MSVC_2015_AND_HIGHER___ +// leave it: it is already there +#elif defined TR2_OPTIONAL_DISABLE_EMULATION_OF_TYPE_TRAITS +// leave it: the user doesn't want it +#else // workaround for missing traits in GCC and CLANG -template -struct is_nothrow_move_constructible -{ - constexpr static bool value = std::is_nothrow_constructible::value; +template struct is_nothrow_move_constructible { + constexpr static bool value = std::is_nothrow_constructible::value; }; +template struct is_assignable { + template constexpr static bool has_assign(...) { + return false; + } -template -struct is_assignable -{ - template - constexpr static bool has_assign(...) { return false; } - - template () = std::declval(), true)) > + template () = std::declval(), true))> // the comma operator is necessary for the cases where operator= returns void - constexpr static bool has_assign(bool) { return true; } + constexpr static bool has_assign(bool) { + return true; + } constexpr static bool value = has_assign(true); }; - -template -struct is_nothrow_move_assignable -{ - template - struct has_nothrow_move_assign { +template struct is_nothrow_move_assignable { + template struct has_nothrow_move_assign { constexpr static bool value = false; }; - template - struct has_nothrow_move_assign { - constexpr static bool value = noexcept( std::declval() = std::declval() ); + template struct has_nothrow_move_assign { + constexpr static bool value = + noexcept(std::declval() = std::declval()); }; - constexpr static bool value = has_nothrow_move_assign::value>::value; + constexpr static bool value = + has_nothrow_move_assign::value>::value; }; // end workaround - -# endif - - +#endif // 20.5.4, optional for object types template class optional; // 20.5.5, optional for lvalue reference types -template class optional; - +template class optional; // workaround: std utility functions aren't constexpr yet -template inline constexpr T&& constexpr_forward(typename std::remove_reference::type& t) noexcept -{ - return static_cast(t); +template +inline constexpr T && +constexpr_forward(typename std::remove_reference::type &t) noexcept { + return static_cast(t); } -template inline constexpr T&& constexpr_forward(typename std::remove_reference::type&& t) noexcept -{ - static_assert(!std::is_lvalue_reference::value, "!!"); - return static_cast(t); +template +inline constexpr T && +constexpr_forward(typename std::remove_reference::type &&t) noexcept { + static_assert(!std::is_lvalue_reference::value, "!!"); + return static_cast(t); } -template inline constexpr typename std::remove_reference::type&& constexpr_move(T&& t) noexcept -{ - return static_cast::type&&>(t); +template +inline constexpr typename std::remove_reference::type && +constexpr_move(T &&t) noexcept { + return static_cast::type &&>(t); } - #if defined NDEBUG -# define TR2_OPTIONAL_ASSERTED_EXPRESSION(CHECK, EXPR) (EXPR) +#define TR2_OPTIONAL_ASSERTED_EXPRESSION(CHECK, EXPR) (EXPR) #else -# define TR2_OPTIONAL_ASSERTED_EXPRESSION(CHECK, EXPR) ((CHECK) ? (EXPR) : ([]{assert(!#CHECK);}(), (EXPR))) +#define TR2_OPTIONAL_ASSERTED_EXPRESSION(CHECK, EXPR) \ + ((CHECK) ? (EXPR) : ([] { assert(!#CHECK); }(), (EXPR))) #endif - -namespace detail_ -{ +namespace detail_ { // static_addressof: a constexpr version of addressof -template -struct has_overloaded_addressof -{ - template - constexpr static bool has_overload(...) { return false; } - - template ().operator&()) > - constexpr static bool has_overload(bool) { return true; } +template struct has_overloaded_addressof { + template constexpr static bool has_overload(...) { return false; } + + template ().operator&())> + constexpr static bool has_overload(bool) { + return true; + } constexpr static bool value = has_overload(true); }; template )> -constexpr T* static_addressof(T& ref) -{ +constexpr T *static_addressof(T &ref) { return &ref; } template )> -T* static_addressof(T& ref) -{ +T *static_addressof(T &ref) { return std::addressof(ref); } +// the call to convert(b) has return type A and converts b to type A iff b +// decltype(b) is implicitly convertible to A +template constexpr U convert(U v) { return v; } -// the call to convert(b) has return type A and converts b to type A iff b decltype(b) is implicitly convertible to A -template -constexpr U convert(U v) { return v; } - +namespace swap_ns { +using std::swap; -namespace swap_ns -{ - using std::swap; - - template - void adl_swap(T& t, T& u) noexcept(noexcept(swap(t, u))) - { - swap(t, u); - } +template void adl_swap(T &t, T &u) noexcept(noexcept(swap(t, u))) { + swap(t, u); +} } // namespace swap_ns -} // namespace detail - - -constexpr struct trivial_init_t{} trivial_init{}; +} // namespace detail_ +constexpr struct trivial_init_t { +} trivial_init{}; // 20.5.6, In-place construction -constexpr struct in_place_t{} in_place{}; - +constexpr struct in_place_t { +} in_place{}; // 20.5.7, Disengaged state indicator -struct nullopt_t -{ - struct init{}; - constexpr explicit nullopt_t(init){} +struct nullopt_t { + struct init {}; + constexpr explicit nullopt_t(init) {} }; constexpr nullopt_t nullopt{nullopt_t::init()}; - // 20.5.8, class bad_optional_access class bad_optional_access : public logic_error { public: - explicit bad_optional_access(const string& what_arg) : logic_error{what_arg} {} - explicit bad_optional_access(const char* what_arg) : logic_error{what_arg} {} + explicit bad_optional_access(const string &what_arg) + : logic_error{what_arg} {} + explicit bad_optional_access(const char *what_arg) : logic_error{what_arg} {} }; - -template -union storage_t -{ +template union storage_t { unsigned char dummy_; T value_; - constexpr storage_t( trivial_init_t ) noexcept : dummy_() {}; + constexpr storage_t(trivial_init_t) noexcept : dummy_() {}; template - constexpr storage_t( Args&&... args ) : value_(constexpr_forward(args)...) {} + constexpr storage_t(Args &&...args) + : value_(constexpr_forward(args)...) {} - ~storage_t(){} + ~storage_t() {} }; +template union constexpr_storage_t { + unsigned char dummy_; + T value_; -template -union constexpr_storage_t -{ - unsigned char dummy_; - T value_; - - constexpr constexpr_storage_t( trivial_init_t ) noexcept : dummy_() {}; + constexpr constexpr_storage_t(trivial_init_t) noexcept : dummy_() {}; - template - constexpr constexpr_storage_t( Args&&... args ) : value_(constexpr_forward(args)...) {} + template + constexpr constexpr_storage_t(Args &&...args) + : value_(constexpr_forward(args)...) {} - ~constexpr_storage_t() = default; + ~constexpr_storage_t() = default; }; +template struct optional_base { + bool init_; + storage_t storage_; -template -struct optional_base -{ - bool init_; - storage_t storage_; - - constexpr optional_base() noexcept : init_(false), storage_(trivial_init) {}; + constexpr optional_base() noexcept : init_(false), storage_(trivial_init) {}; - explicit constexpr optional_base(const T& v) : init_(true), storage_(v) {} + explicit constexpr optional_base(const T &v) : init_(true), storage_(v) {} - explicit constexpr optional_base(T&& v) : init_(true), storage_(constexpr_move(v)) {} + explicit constexpr optional_base(T &&v) + : init_(true), storage_(constexpr_move(v)) {} - template explicit optional_base(in_place_t, Args&&... args) - : init_(true), storage_(constexpr_forward(args)...) {} + template + explicit optional_base(in_place_t, Args &&...args) + : init_(true), storage_(constexpr_forward(args)...) {} - template >)> - explicit optional_base(in_place_t, std::initializer_list il, Args&&... args) - : init_(true), storage_(il, std::forward(args)...) {} + template < + class U, class... Args, + TR2_OPTIONAL_REQUIRES(is_constructible>)> + explicit optional_base(in_place_t, std::initializer_list il, + Args &&...args) + : init_(true), storage_(il, std::forward(args)...) {} - ~optional_base() { if (init_) storage_.value_.T::~T(); } + ~optional_base() { + if (init_) + storage_.value_.T::~T(); + } }; +template struct constexpr_optional_base { + bool init_; + constexpr_storage_t storage_; -template -struct constexpr_optional_base -{ - bool init_; - constexpr_storage_t storage_; + constexpr constexpr_optional_base() noexcept + : init_(false), storage_(trivial_init) {}; - constexpr constexpr_optional_base() noexcept : init_(false), storage_(trivial_init) {}; + explicit constexpr constexpr_optional_base(const T &v) + : init_(true), storage_(v) {} - explicit constexpr constexpr_optional_base(const T& v) : init_(true), storage_(v) {} + explicit constexpr constexpr_optional_base(T &&v) + : init_(true), storage_(constexpr_move(v)) {} - explicit constexpr constexpr_optional_base(T&& v) : init_(true), storage_(constexpr_move(v)) {} - - template explicit constexpr constexpr_optional_base(in_place_t, Args&&... args) + template + explicit constexpr constexpr_optional_base(in_place_t, Args &&...args) : init_(true), storage_(constexpr_forward(args)...) {} - template >)> - OPTIONAL_CONSTEXPR_INIT_LIST explicit constexpr_optional_base(in_place_t, std::initializer_list il, Args&&... args) + template < + class U, class... Args, + TR2_OPTIONAL_REQUIRES(is_constructible>)> + OPTIONAL_CONSTEXPR_INIT_LIST explicit constexpr_optional_base( + in_place_t, std::initializer_list il, Args &&...args) : init_(true), storage_(il, std::forward(args)...) {} - ~constexpr_optional_base() = default; + ~constexpr_optional_base() = default; }; template using OptionalBase = typename std::conditional< - is_trivially_destructible::value, // if possible - constexpr_optional_base::type>, // use base with trivial destructor - optional_base::type> ->::type; - + is_trivially_destructible::value, // if possible + constexpr_optional_base::type>, // use base with trivial destructor + optional_base::type>>::type; - -template -class optional : private OptionalBase -{ - static_assert( !std::is_same::type, nullopt_t>::value, "bad T" ); - static_assert( !std::is_same::type, in_place_t>::value, "bad T" ); - +template class optional : private OptionalBase { + static_assert(!std::is_same::type, nullopt_t>::value, + "bad T"); + static_assert(!std::is_same::type, in_place_t>::value, + "bad T"); constexpr bool initialized() const noexcept { return OptionalBase::init_; } - typename std::remove_const::type* dataptr() { return std::addressof(OptionalBase::storage_.value_); } - constexpr const T* dataptr() const { return detail_::static_addressof(OptionalBase::storage_.value_); } - -# if OPTIONAL_HAS_THIS_RVALUE_REFS == 1 - constexpr const T& contained_val() const& { return OptionalBase::storage_.value_; } -# if OPTIONAL_HAS_MOVE_ACCESSORS == 1 - OPTIONAL_MUTABLE_CONSTEXPR T&& contained_val() && { return std::move(OptionalBase::storage_.value_); } - OPTIONAL_MUTABLE_CONSTEXPR T& contained_val() & { return OptionalBase::storage_.value_; } -# else - T& contained_val() & { return OptionalBase::storage_.value_; } - T&& contained_val() && { return std::move(OptionalBase::storage_.value_); } -# endif -# else - constexpr const T& contained_val() const { return OptionalBase::storage_.value_; } - T& contained_val() { return OptionalBase::storage_.value_; } -# endif + typename std::remove_const::type *dataptr() { + return std::addressof(OptionalBase::storage_.value_); + } + constexpr const T *dataptr() const { + return detail_::static_addressof(OptionalBase::storage_.value_); + } + +#if OPTIONAL_HAS_THIS_RVALUE_REFS == 1 + constexpr const T &contained_val() const & { + return OptionalBase::storage_.value_; + } +#if OPTIONAL_HAS_MOVE_ACCESSORS == 1 + OPTIONAL_MUTABLE_CONSTEXPR T &&contained_val() && { + return std::move(OptionalBase::storage_.value_); + } + OPTIONAL_MUTABLE_CONSTEXPR T &contained_val() & { + return OptionalBase::storage_.value_; + } +#else + T &contained_val() & { return OptionalBase::storage_.value_; } + T &&contained_val() && { return std::move(OptionalBase::storage_.value_); } +#endif +#else + constexpr const T &contained_val() const { + return OptionalBase::storage_.value_; + } + T &contained_val() { return OptionalBase::storage_.value_; } +#endif void clear() noexcept { - if (initialized()) dataptr()->T::~T(); + if (initialized()) + dataptr()->T::~T(); OptionalBase::init_ = false; } - + template - void initialize(Args&&... args) noexcept(noexcept(T(std::forward(args)...))) - { + void initialize(Args &&...args) noexcept( + noexcept(T(std::forward(args)...))) { assert(!OptionalBase::init_); - ::new (static_cast(dataptr())) T(std::forward(args)...); + ::new (static_cast(dataptr())) T(std::forward(args)...); OptionalBase::init_ = true; } template - void initialize(std::initializer_list il, Args&&... args) noexcept(noexcept(T(il, std::forward(args)...))) - { + void initialize(std::initializer_list il, Args &&...args) noexcept( + noexcept(T(il, std::forward(args)...))) { assert(!OptionalBase::init_); - ::new (static_cast(dataptr())) T(il, std::forward(args)...); + ::new (static_cast(dataptr())) T(il, std::forward(args)...); OptionalBase::init_ = true; } @@ -410,657 +410,618 @@ class optional : private OptionalBase typedef T value_type; // 20.5.5.1, constructors - constexpr optional() noexcept : OptionalBase() {}; + constexpr optional() noexcept : OptionalBase() {}; constexpr optional(nullopt_t) noexcept : OptionalBase() {}; - optional(const optional& rhs) - : OptionalBase() - { + optional(const optional &rhs) : OptionalBase() { if (rhs.initialized()) { - ::new (static_cast(dataptr())) T(*rhs); - OptionalBase::init_ = true; + ::new (static_cast(dataptr())) T(*rhs); + OptionalBase::init_ = true; } } - optional(optional&& rhs) noexcept(is_nothrow_move_constructible::value) - : OptionalBase() - { + optional(optional &&rhs) noexcept(is_nothrow_move_constructible::value) + : OptionalBase() { if (rhs.initialized()) { - ::new (static_cast(dataptr())) T(std::move(*rhs)); - OptionalBase::init_ = true; + ::new (static_cast(dataptr())) T(std::move(*rhs)); + OptionalBase::init_ = true; } } - constexpr optional(const T& v) : OptionalBase(v) {} + constexpr optional(const T &v) : OptionalBase(v) {} - constexpr optional(T&& v) : OptionalBase(constexpr_move(v)) {} + constexpr optional(T &&v) : OptionalBase(constexpr_move(v)) {} template - explicit constexpr optional(in_place_t, Args&&... args) - : OptionalBase(in_place_t{}, constexpr_forward(args)...) {} + explicit constexpr optional(in_place_t, Args &&...args) + : OptionalBase(in_place_t{}, constexpr_forward(args)...) {} - template >)> - OPTIONAL_CONSTEXPR_INIT_LIST explicit optional(in_place_t, std::initializer_list il, Args&&... args) - : OptionalBase(in_place_t{}, il, constexpr_forward(args)...) {} + template < + class U, class... Args, + TR2_OPTIONAL_REQUIRES(is_constructible>)> + OPTIONAL_CONSTEXPR_INIT_LIST explicit optional(in_place_t, + std::initializer_list il, + Args &&...args) + : OptionalBase(in_place_t{}, il, constexpr_forward(args)...) {} // 20.5.4.2, Destructor ~optional() = default; // 20.5.4.3, assignment - optional& operator=(nullopt_t) noexcept - { + optional &operator=(nullopt_t) noexcept { clear(); return *this; } - - optional& operator=(const optional& rhs) - { - if (initialized() == true && rhs.initialized() == false) clear(); - else if (initialized() == false && rhs.initialized() == true) initialize(*rhs); - else if (initialized() == true && rhs.initialized() == true) contained_val() = *rhs; + + optional &operator=(const optional &rhs) { + if (initialized() == true && rhs.initialized() == false) + clear(); + else if (initialized() == false && rhs.initialized() == true) + initialize(*rhs); + else if (initialized() == true && rhs.initialized() == true) + contained_val() = *rhs; return *this; } - - optional& operator=(optional&& rhs) - noexcept(is_nothrow_move_assignable::value && is_nothrow_move_constructible::value) - { - if (initialized() == true && rhs.initialized() == false) clear(); - else if (initialized() == false && rhs.initialized() == true) initialize(std::move(*rhs)); - else if (initialized() == true && rhs.initialized() == true) contained_val() = std::move(*rhs); + + optional & + operator=(optional &&rhs) noexcept(is_nothrow_move_assignable::value && + is_nothrow_move_constructible::value) { + if (initialized() == true && rhs.initialized() == false) + clear(); + else if (initialized() == false && rhs.initialized() == true) + initialize(std::move(*rhs)); + else if (initialized() == true && rhs.initialized() == true) + contained_val() = std::move(*rhs); return *this; } template - auto operator=(U&& v) - -> typename enable_if - < - is_same::type, T>::value, - optional& - >::type - { - if (initialized()) { contained_val() = std::forward(v); } - else { initialize(std::forward(v)); } + auto operator=(U &&v) -> + typename enable_if::type, T>::value, + optional &>::type { + if (initialized()) { + contained_val() = std::forward(v); + } else { + initialize(std::forward(v)); + } return *this; } - - - template - void emplace(Args&&... args) - { + + template void emplace(Args &&...args) { clear(); initialize(std::forward(args)...); } - + template - void emplace(initializer_list il, Args&&... args) - { + void emplace(initializer_list il, Args &&...args) { clear(); initialize(il, std::forward(args)...); } - + // 20.5.4.4, Swap - void swap(optional& rhs) noexcept(is_nothrow_move_constructible::value - && noexcept(detail_::swap_ns::adl_swap(declval(), declval()))) - { - if (initialized() == true && rhs.initialized() == false) { rhs.initialize(std::move(**this)); clear(); } - else if (initialized() == false && rhs.initialized() == true) { initialize(std::move(*rhs)); rhs.clear(); } - else if (initialized() == true && rhs.initialized() == true) { using std::swap; swap(**this, *rhs); } + void swap(optional &rhs) noexcept( + is_nothrow_move_constructible::value && + noexcept(detail_::swap_ns::adl_swap(declval(), declval()))) { + if (initialized() == true && rhs.initialized() == false) { + rhs.initialize(std::move(**this)); + clear(); + } else if (initialized() == false && rhs.initialized() == true) { + initialize(std::move(*rhs)); + rhs.clear(); + } else if (initialized() == true && rhs.initialized() == true) { + using std::swap; + swap(**this, *rhs); + } } // 20.5.4.5, Observers - + explicit constexpr operator bool() const noexcept { return initialized(); } constexpr bool has_value() const noexcept { return initialized(); } - - constexpr T const* operator ->() const { + + constexpr T const *operator->() const { return TR2_OPTIONAL_ASSERTED_EXPRESSION(initialized(), dataptr()); } - -# if OPTIONAL_HAS_MOVE_ACCESSORS == 1 - OPTIONAL_MUTABLE_CONSTEXPR T* operator ->() { - assert (initialized()); +#if OPTIONAL_HAS_MOVE_ACCESSORS == 1 + + OPTIONAL_MUTABLE_CONSTEXPR T *operator->() { + assert(initialized()); return dataptr(); } - - constexpr T const& operator *() const& { + + constexpr T const &operator*() const & { return TR2_OPTIONAL_ASSERTED_EXPRESSION(initialized(), contained_val()); } - - OPTIONAL_MUTABLE_CONSTEXPR T& operator *() & { - assert (initialized()); + + OPTIONAL_MUTABLE_CONSTEXPR T &operator*() & { + assert(initialized()); return contained_val(); } - - OPTIONAL_MUTABLE_CONSTEXPR T&& operator *() && { - assert (initialized()); + + OPTIONAL_MUTABLE_CONSTEXPR T &&operator*() && { + assert(initialized()); return constexpr_move(contained_val()); } - constexpr T const& value() const& { - return initialized() ? contained_val() : (throw bad_optional_access("bad optional access"), contained_val()); + constexpr T const &value() const & { + return initialized() ? contained_val() + : (throw bad_optional_access("bad optional access"), + contained_val()); } - - OPTIONAL_MUTABLE_CONSTEXPR T& value() & { - return initialized() ? contained_val() : (throw bad_optional_access("bad optional access"), contained_val()); + + OPTIONAL_MUTABLE_CONSTEXPR T &value() & { + return initialized() ? contained_val() + : (throw bad_optional_access("bad optional access"), + contained_val()); } - - OPTIONAL_MUTABLE_CONSTEXPR T&& value() && { - if (!initialized()) throw bad_optional_access("bad optional access"); - return std::move(contained_val()); + + OPTIONAL_MUTABLE_CONSTEXPR T &&value() && { + if (!initialized()) + throw bad_optional_access("bad optional access"); + return std::move(contained_val()); } - -# else - T* operator ->() { - assert (initialized()); +#else + + T *operator->() { + assert(initialized()); return dataptr(); } - - constexpr T const& operator *() const { + + constexpr T const &operator*() const { return TR2_OPTIONAL_ASSERTED_EXPRESSION(initialized(), contained_val()); } - - T& operator *() { - assert (initialized()); + + T &operator*() { + assert(initialized()); return contained_val(); } - - constexpr T const& value() const { - return initialized() ? contained_val() : (throw bad_optional_access("bad optional access"), contained_val()); + + constexpr T const &value() const { + return initialized() ? contained_val() + : (throw bad_optional_access("bad optional access"), + contained_val()); } - - T& value() { - return initialized() ? contained_val() : (throw bad_optional_access("bad optional access"), contained_val()); + + T &value() { + return initialized() ? contained_val() + : (throw bad_optional_access("bad optional access"), + contained_val()); } - -# endif - -# if OPTIONAL_HAS_THIS_RVALUE_REFS == 1 - - template - constexpr T value_or(V&& v) const& - { + +#endif + +#if OPTIONAL_HAS_THIS_RVALUE_REFS == 1 + + template constexpr T value_or(V &&v) const & { return *this ? **this : detail_::convert(constexpr_forward(v)); } - -# if OPTIONAL_HAS_MOVE_ACCESSORS == 1 - template - OPTIONAL_MUTABLE_CONSTEXPR T value_or(V&& v) && - { - return *this ? constexpr_move(const_cast&>(*this).contained_val()) : detail_::convert(constexpr_forward(v)); +#if OPTIONAL_HAS_MOVE_ACCESSORS == 1 + + template OPTIONAL_MUTABLE_CONSTEXPR T value_or(V &&v) && { + return *this ? constexpr_move( + const_cast &>(*this).contained_val()) + : detail_::convert(constexpr_forward(v)); } -# else - - template - T value_or(V&& v) && - { - return *this ? constexpr_move(const_cast&>(*this).contained_val()) : detail_::convert(constexpr_forward(v)); +#else + + template T value_or(V &&v) && { + return *this ? constexpr_move( + const_cast &>(*this).contained_val()) + : detail_::convert(constexpr_forward(v)); } - -# endif - -# else - - template - constexpr T value_or(V&& v) const - { + +#endif + +#else + + template constexpr T value_or(V &&v) const { return *this ? **this : detail_::convert(constexpr_forward(v)); } -# endif +#endif // 20.6.3.6, modifiers void reset() noexcept { clear(); } }; +template class optional { + static_assert(!std::is_same::value, "bad T"); + static_assert(!std::is_same::value, "bad T"); + T *ref; -template -class optional -{ - static_assert( !std::is_same::value, "bad T" ); - static_assert( !std::is_same::value, "bad T" ); - T* ref; - public: - // 20.5.5.1, construction/destruction constexpr optional() noexcept : ref(nullptr) {} - + constexpr optional(nullopt_t) noexcept : ref(nullptr) {} - - constexpr optional(T& v) noexcept : ref(detail_::static_addressof(v)) {} - - optional(T&&) = delete; - - constexpr optional(const optional& rhs) noexcept : ref(rhs.ref) {} - - explicit constexpr optional(in_place_t, T& v) noexcept : ref(detail_::static_addressof(v)) {} - - explicit optional(in_place_t, T&&) = delete; - + + constexpr optional(T &v) noexcept : ref(detail_::static_addressof(v)) {} + + optional(T &&) = delete; + + constexpr optional(const optional &rhs) noexcept : ref(rhs.ref) {} + + explicit constexpr optional(in_place_t, T &v) noexcept + : ref(detail_::static_addressof(v)) {} + + explicit optional(in_place_t, T &&) = delete; + ~optional() = default; - + // 20.5.5.2, mutation - optional& operator=(nullopt_t) noexcept { + optional &operator=(nullopt_t) noexcept { ref = nullptr; return *this; } - + // optional& operator=(const optional& rhs) noexcept { - // ref = rhs.ref; - // return *this; + // ref = rhs.ref; + // return *this; // } - + // optional& operator=(optional&& rhs) noexcept { - // ref = rhs.ref; - // return *this; + // ref = rhs.ref; + // return *this; // } - + template - auto operator=(U&& rhs) noexcept - -> typename enable_if - < - is_same::type, optional>::value, - optional& - >::type - { + auto operator=(U &&rhs) noexcept -> + typename enable_if::type, optional>::value, + optional &>::type { ref = rhs.ref; return *this; } - + template - auto operator=(U&& rhs) noexcept - -> typename enable_if - < - !is_same::type, optional>::value, - optional& - >::type - = delete; - - void emplace(T& v) noexcept { - ref = detail_::static_addressof(v); - } - - void emplace(T&&) = delete; - - - void swap(optional& rhs) noexcept - { - std::swap(ref, rhs.ref); - } - + auto operator=(U &&rhs) noexcept -> typename enable_if< + !is_same::type, optional>::value, + optional &>::type = delete; + + void emplace(T &v) noexcept { ref = detail_::static_addressof(v); } + + void emplace(T &&) = delete; + + void swap(optional &rhs) noexcept { std::swap(ref, rhs.ref); } + // 20.5.5.3, observers - constexpr T* operator->() const { + constexpr T *operator->() const { return TR2_OPTIONAL_ASSERTED_EXPRESSION(ref, ref); } - - constexpr T& operator*() const { + + constexpr T &operator*() const { return TR2_OPTIONAL_ASSERTED_EXPRESSION(ref, *ref); } - - constexpr T& value() const { - return ref ? *ref : (throw bad_optional_access("bad optional access"), *ref); - } - - explicit constexpr operator bool() const noexcept { - return ref != nullptr; - } - - constexpr bool has_value() const noexcept { - return ref != nullptr; + + constexpr T &value() const { + return ref ? *ref + : (throw bad_optional_access("bad optional access"), *ref); } - - template - constexpr typename decay::type value_or(V&& v) const - { - return *this ? **this : detail_::convert::type>(constexpr_forward(v)); + + explicit constexpr operator bool() const noexcept { return ref != nullptr; } + + constexpr bool has_value() const noexcept { return ref != nullptr; } + + template constexpr typename decay::type value_or(V &&v) const { + return *this ? **this + : detail_::convert::type>( + constexpr_forward(v)); } // x.x.x.x, modifiers void reset() noexcept { ref = nullptr; } }; - -template -class optional -{ - static_assert( sizeof(T) == 0, "optional rvalue references disallowed" ); +template class optional { + static_assert(sizeof(T) == 0, "optional rvalue references disallowed"); }; - // 20.5.8, Relational operators -template constexpr bool operator==(const optional& x, const optional& y) -{ +template +constexpr bool operator==(const optional &x, const optional &y) { return bool(x) != bool(y) ? false : bool(x) == false ? true : *x == *y; } -template constexpr bool operator!=(const optional& x, const optional& y) -{ +template +constexpr bool operator!=(const optional &x, const optional &y) { return !(x == y); } -template constexpr bool operator<(const optional& x, const optional& y) -{ +template +constexpr bool operator<(const optional &x, const optional &y) { return (!y) ? false : (!x) ? true : *x < *y; } -template constexpr bool operator>(const optional& x, const optional& y) -{ +template +constexpr bool operator>(const optional &x, const optional &y) { return (y < x); } -template constexpr bool operator<=(const optional& x, const optional& y) -{ +template +constexpr bool operator<=(const optional &x, const optional &y) { return !(y < x); } -template constexpr bool operator>=(const optional& x, const optional& y) -{ +template +constexpr bool operator>=(const optional &x, const optional &y) { return !(x < y); } - // 20.5.9, Comparison with nullopt -template constexpr bool operator==(const optional& x, nullopt_t) noexcept -{ +template +constexpr bool operator==(const optional &x, nullopt_t) noexcept { return (!x); } -template constexpr bool operator==(nullopt_t, const optional& x) noexcept -{ +template +constexpr bool operator==(nullopt_t, const optional &x) noexcept { return (!x); } -template constexpr bool operator!=(const optional& x, nullopt_t) noexcept -{ +template +constexpr bool operator!=(const optional &x, nullopt_t) noexcept { return bool(x); } -template constexpr bool operator!=(nullopt_t, const optional& x) noexcept -{ +template +constexpr bool operator!=(nullopt_t, const optional &x) noexcept { return bool(x); } -template constexpr bool operator<(const optional&, nullopt_t) noexcept -{ +template +constexpr bool operator<(const optional &, nullopt_t) noexcept { return false; } -template constexpr bool operator<(nullopt_t, const optional& x) noexcept -{ +template +constexpr bool operator<(nullopt_t, const optional &x) noexcept { return bool(x); } -template constexpr bool operator<=(const optional& x, nullopt_t) noexcept -{ +template +constexpr bool operator<=(const optional &x, nullopt_t) noexcept { return (!x); } -template constexpr bool operator<=(nullopt_t, const optional&) noexcept -{ +template +constexpr bool operator<=(nullopt_t, const optional &) noexcept { return true; } -template constexpr bool operator>(const optional& x, nullopt_t) noexcept -{ +template +constexpr bool operator>(const optional &x, nullopt_t) noexcept { return bool(x); } -template constexpr bool operator>(nullopt_t, const optional&) noexcept -{ +template +constexpr bool operator>(nullopt_t, const optional &) noexcept { return false; } -template constexpr bool operator>=(const optional&, nullopt_t) noexcept -{ +template +constexpr bool operator>=(const optional &, nullopt_t) noexcept { return true; } -template constexpr bool operator>=(nullopt_t, const optional& x) noexcept -{ +template +constexpr bool operator>=(nullopt_t, const optional &x) noexcept { return (!x); } - - // 20.5.10, Comparison with T -template constexpr bool operator==(const optional& x, const T& v) -{ +template constexpr bool operator==(const optional &x, const T &v) { return bool(x) ? *x == v : false; } -template constexpr bool operator==(const T& v, const optional& x) -{ +template constexpr bool operator==(const T &v, const optional &x) { return bool(x) ? v == *x : false; } -template constexpr bool operator!=(const optional& x, const T& v) -{ +template constexpr bool operator!=(const optional &x, const T &v) { return bool(x) ? *x != v : true; } -template constexpr bool operator!=(const T& v, const optional& x) -{ +template constexpr bool operator!=(const T &v, const optional &x) { return bool(x) ? v != *x : true; } -template constexpr bool operator<(const optional& x, const T& v) -{ +template constexpr bool operator<(const optional &x, const T &v) { return bool(x) ? *x < v : true; } -template constexpr bool operator>(const T& v, const optional& x) -{ +template constexpr bool operator>(const T &v, const optional &x) { return bool(x) ? v > *x : true; } -template constexpr bool operator>(const optional& x, const T& v) -{ +template constexpr bool operator>(const optional &x, const T &v) { return bool(x) ? *x > v : false; } -template constexpr bool operator<(const T& v, const optional& x) -{ +template constexpr bool operator<(const T &v, const optional &x) { return bool(x) ? v < *x : false; } -template constexpr bool operator>=(const optional& x, const T& v) -{ +template constexpr bool operator>=(const optional &x, const T &v) { return bool(x) ? *x >= v : false; } -template constexpr bool operator<=(const T& v, const optional& x) -{ +template constexpr bool operator<=(const T &v, const optional &x) { return bool(x) ? v <= *x : false; } -template constexpr bool operator<=(const optional& x, const T& v) -{ +template constexpr bool operator<=(const optional &x, const T &v) { return bool(x) ? *x <= v : true; } -template constexpr bool operator>=(const T& v, const optional& x) -{ +template constexpr bool operator>=(const T &v, const optional &x) { return bool(x) ? v >= *x : true; } - // Comparison of optional with T -template constexpr bool operator==(const optional& x, const T& v) -{ +template +constexpr bool operator==(const optional &x, const T &v) { return bool(x) ? *x == v : false; } -template constexpr bool operator==(const T& v, const optional& x) -{ +template +constexpr bool operator==(const T &v, const optional &x) { return bool(x) ? v == *x : false; } -template constexpr bool operator!=(const optional& x, const T& v) -{ +template +constexpr bool operator!=(const optional &x, const T &v) { return bool(x) ? *x != v : true; } -template constexpr bool operator!=(const T& v, const optional& x) -{ +template +constexpr bool operator!=(const T &v, const optional &x) { return bool(x) ? v != *x : true; } -template constexpr bool operator<(const optional& x, const T& v) -{ +template +constexpr bool operator<(const optional &x, const T &v) { return bool(x) ? *x < v : true; } -template constexpr bool operator>(const T& v, const optional& x) -{ +template +constexpr bool operator>(const T &v, const optional &x) { return bool(x) ? v > *x : true; } -template constexpr bool operator>(const optional& x, const T& v) -{ +template +constexpr bool operator>(const optional &x, const T &v) { return bool(x) ? *x > v : false; } -template constexpr bool operator<(const T& v, const optional& x) -{ +template +constexpr bool operator<(const T &v, const optional &x) { return bool(x) ? v < *x : false; } -template constexpr bool operator>=(const optional& x, const T& v) -{ +template +constexpr bool operator>=(const optional &x, const T &v) { return bool(x) ? *x >= v : false; } -template constexpr bool operator<=(const T& v, const optional& x) -{ +template +constexpr bool operator<=(const T &v, const optional &x) { return bool(x) ? v <= *x : false; } -template constexpr bool operator<=(const optional& x, const T& v) -{ +template +constexpr bool operator<=(const optional &x, const T &v) { return bool(x) ? *x <= v : true; } -template constexpr bool operator>=(const T& v, const optional& x) -{ +template +constexpr bool operator>=(const T &v, const optional &x) { return bool(x) ? v >= *x : true; } // Comparison of optional with T -template constexpr bool operator==(const optional& x, const T& v) -{ +template +constexpr bool operator==(const optional &x, const T &v) { return bool(x) ? *x == v : false; } -template constexpr bool operator==(const T& v, const optional& x) -{ +template +constexpr bool operator==(const T &v, const optional &x) { return bool(x) ? v == *x : false; } -template constexpr bool operator!=(const optional& x, const T& v) -{ +template +constexpr bool operator!=(const optional &x, const T &v) { return bool(x) ? *x != v : true; } -template constexpr bool operator!=(const T& v, const optional& x) -{ +template +constexpr bool operator!=(const T &v, const optional &x) { return bool(x) ? v != *x : true; } -template constexpr bool operator<(const optional& x, const T& v) -{ +template +constexpr bool operator<(const optional &x, const T &v) { return bool(x) ? *x < v : true; } -template constexpr bool operator>(const T& v, const optional& x) -{ +template +constexpr bool operator>(const T &v, const optional &x) { return bool(x) ? v > *x : true; } -template constexpr bool operator>(const optional& x, const T& v) -{ +template +constexpr bool operator>(const optional &x, const T &v) { return bool(x) ? *x > v : false; } -template constexpr bool operator<(const T& v, const optional& x) -{ +template +constexpr bool operator<(const T &v, const optional &x) { return bool(x) ? v < *x : false; } -template constexpr bool operator>=(const optional& x, const T& v) -{ +template +constexpr bool operator>=(const optional &x, const T &v) { return bool(x) ? *x >= v : false; } -template constexpr bool operator<=(const T& v, const optional& x) -{ +template +constexpr bool operator<=(const T &v, const optional &x) { return bool(x) ? v <= *x : false; } -template constexpr bool operator<=(const optional& x, const T& v) -{ +template +constexpr bool operator<=(const optional &x, const T &v) { return bool(x) ? *x <= v : true; } -template constexpr bool operator>=(const T& v, const optional& x) -{ +template +constexpr bool operator>=(const T &v, const optional &x) { return bool(x) ? v >= *x : true; } - // 20.5.12, Specialized algorithms template -void swap(optional& x, optional& y) noexcept(noexcept(x.swap(y))) -{ +void swap(optional &x, optional &y) noexcept(noexcept(x.swap(y))) { x.swap(y); } - template -constexpr optional::type> make_optional(T&& v) -{ +constexpr optional::type> make_optional(T &&v) { return optional::type>(constexpr_forward(v)); } template -constexpr optional make_optional(reference_wrapper v) -{ - return optional(v.get()); +constexpr optional make_optional(reference_wrapper v) { + return optional(v.get()); } - } // namespace experimental } // namespace std -namespace std -{ - template - struct hash> - { - typedef typename hash::result_type result_type; - typedef std::experimental::optional argument_type; - - constexpr result_type operator()(argument_type const& arg) const { - return arg ? std::hash{}(*arg) : result_type{}; - } - }; - - template - struct hash> - { - typedef typename hash::result_type result_type; - typedef std::experimental::optional argument_type; - - constexpr result_type operator()(argument_type const& arg) const { - return arg ? std::hash{}(*arg) : result_type{}; - } - }; -} +namespace std { +template struct hash> { + typedef typename hash::result_type result_type; + typedef std::experimental::optional argument_type; + + constexpr result_type operator()(argument_type const &arg) const { + return arg ? std::hash{}(*arg) : result_type{}; + } +}; + +template struct hash> { + typedef typename hash::result_type result_type; + typedef std::experimental::optional argument_type; + + constexpr result_type operator()(argument_type const &arg) const { + return arg ? std::hash{}(*arg) : result_type{}; + } +}; +} // namespace std -# undef TR2_OPTIONAL_REQUIRES -# undef TR2_OPTIONAL_ASSERTED_EXPRESSION +#undef TR2_OPTIONAL_REQUIRES +#undef TR2_OPTIONAL_ASSERTED_EXPRESSION -# endif //___OPTIONAL_HPP___ +#endif //___OPTIONAL_HPP___ diff --git a/src/sha1/sha1.h b/src/sha1/sha1.h index 1cb536025..a662161b3 100644 --- a/src/sha1/sha1.h +++ b/src/sha1/sha1.h @@ -9,16 +9,16 @@ extern "C" { #endif typedef struct { - uint32_t state[5]; - uint32_t count[2]; - uint8_t buffer[64]; + uint32_t state[5]; + uint32_t count[2]; + uint8_t buffer[64]; } SHA1_CTX; #define SHA1_DIGEST_SIZE 20 -void reid_SHA1_Init(SHA1_CTX* context); -void reid_SHA1_Update(SHA1_CTX* context, const uint8_t* data, const size_t len); -void reid_SHA1_Final(SHA1_CTX* context, uint8_t digest[SHA1_DIGEST_SIZE]); +void reid_SHA1_Init(SHA1_CTX *context); +void reid_SHA1_Update(SHA1_CTX *context, const uint8_t *data, const size_t len); +void reid_SHA1_Final(SHA1_CTX *context, uint8_t digest[SHA1_DIGEST_SIZE]); #ifdef __cplusplus } diff --git a/src/socket.cpp b/src/socket.cpp index 492388f2c..3e52bc038 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -3,7 +3,7 @@ #include #include -void on_Socket_close(uv_handle_t* pHandle); +void on_Socket_close(uv_handle_t *pHandle); void Socket::addConnection(std::shared_ptr request) { connections.push_back(request); @@ -11,8 +11,8 @@ void Socket::addConnection(std::shared_ptr request) { void Socket::removeConnection(std::shared_ptr request) { connections.erase( - std::remove(connections.begin(), connections.end(), request), - connections.end()); + std::remove(connections.begin(), connections.end(), request), + connections.end()); } Socket::~Socket() { @@ -21,8 +21,8 @@ Socket::~Socket() { } // A deleter callback for the shared_ptr. -void delete_ppsocket(uv_handle_t* pHandle) { - std::shared_ptr* ppSocket = (std::shared_ptr*)pHandle->data; +void delete_ppsocket(uv_handle_t *pHandle) { + std::shared_ptr *ppSocket = (std::shared_ptr *)pHandle->data; delete ppSocket; } @@ -34,15 +34,15 @@ void delete_ppsocket(uv_handle_t* pHandle) { void Socket::close() { ASSERT_BACKGROUND_THREAD() debug_log("Socket::close", LOG_DEBUG); - for (std::vector >::reverse_iterator it = connections.rbegin(); - it != connections.rend(); - it++) { + for (std::vector>::reverse_iterator it = + connections.rbegin(); + it != connections.rend(); it++) { // std::cerr << "Request close on " << *it << std::endl; (*it)->close(); } - uv_handle_t* pHandle = toHandle(&handle.stream); + uv_handle_t *pHandle = toHandle(&handle.stream); // Delete the shared_ptr only after uv_close() does its work. This // will decrease the refcount and should trigger deletion of the Socket. diff --git a/src/socket.h b/src/socket.h index 472e917fc..abcd901c6 100644 --- a/src/socket.h +++ b/src/socket.h @@ -12,14 +12,12 @@ class Socket { public: VariantHandle handle; std::shared_ptr pWebApplication; - CallbackQueue* background_queue; - std::vector > connections; + CallbackQueue *background_queue; + std::vector> connections; Socket(std::shared_ptr pWebApplication, - CallbackQueue* background_queue) - : pWebApplication(pWebApplication), background_queue(background_queue) - { - } + CallbackQueue *background_queue) + : pWebApplication(pWebApplication), background_queue(background_queue) {} void addConnection(std::shared_ptr request); void removeConnection(std::shared_ptr request); @@ -28,5 +26,4 @@ class Socket { virtual ~Socket(); }; - #endif // SOCKET_HPP diff --git a/src/staticpath.cpp b/src/staticpath.cpp index decc6308c..a4a20872b 100644 --- a/src/staticpath.cpp +++ b/src/staticpath.cpp @@ -1,132 +1,135 @@ #include "staticpath.h" -#include "thread.h" -#include "utils.h" #include "constants.h" #include "optional.h" +#include "thread.h" +#include "utils.h" // ============================================================================ // StaticPathOptions // ============================================================================ -StaticPathOptions::StaticPathOptions(const Rcpp::List& options) : - indexhtml(std::experimental::nullopt), - fallthrough(std::experimental::nullopt), - html_charset(std::experimental::nullopt), - headers(std::experimental::nullopt), - validation(std::experimental::nullopt), - exclude(std::experimental::nullopt) -{ +StaticPathOptions::StaticPathOptions(const list &options) + : indexhtml(std::experimental::nullopt), + fallthrough(std::experimental::nullopt), + html_charset(std::experimental::nullopt), + headers(std::experimental::nullopt), + validation(std::experimental::nullopt), + exclude(std::experimental::nullopt) { ASSERT_MAIN_THREAD() - std::string obj_class = options.attr("class"); + std::string obj_class = std::string(strings(SEXP(options.attr("class")))[0]); if (obj_class != "staticPathOptions") { - throw Rcpp::exception("staticPath options object must have class 'staticPathOptions'."); + stop("staticPath options object must have class 'staticPathOptions'."); } - // This seems to be a necessary intermediary for passing objects to - // `optional_as()`. - Rcpp::RObject temp; + SEXP temp; temp = options.attr("normalized"); std::experimental::optional normalized = optional_as(temp); if (!normalized || !*normalized) { - throw Rcpp::exception("staticPathOptions object must be normalized."); + stop("staticPathOptions object must be normalized."); } - // There's probably a more concise way to do this assignment than by using temp. - temp = options["indexhtml"]; indexhtml = optional_as(temp); - temp = options["fallthrough"]; fallthrough = optional_as(temp); - temp = options["html_charset"]; html_charset = optional_as(temp); - temp = options["headers"]; headers = optional_as(temp); - temp = options["validation"]; validation = optional_as >(temp); - temp = options["exclude"]; exclude = optional_as(temp); + // There's probably a more concise way to do this assignment than by using + // temp. + temp = options["indexhtml"]; + indexhtml = optional_as(temp); + temp = options["fallthrough"]; + fallthrough = optional_as(temp); + temp = options["html_charset"]; + html_charset = optional_as(temp); + temp = options["headers"]; + headers = optional_as(temp); + temp = options["validation"]; + validation = optional_as>(temp); + temp = options["exclude"]; + exclude = optional_as(temp); } - -void StaticPathOptions::setOptions(const Rcpp::List& options) { +void StaticPathOptions::setOptions(const list &options) { ASSERT_MAIN_THREAD() - Rcpp::RObject temp; - if (options.containsElementNamed("indexhtml")) { + SEXP temp; + if (options.contains("indexhtml")) { temp = options["indexhtml"]; - if (!temp.isNULL()) { + if (!Rf_isNull(temp)) { indexhtml = optional_as(temp); } } - if (options.containsElementNamed("fallthrough")) { + if (options.contains("fallthrough")) { temp = options["fallthrough"]; - if (!temp.isNULL()) { + if (!Rf_isNull(temp)) { fallthrough = optional_as(temp); } } - if (options.containsElementNamed("html_charset")) { + if (options.contains("html_charset")) { temp = options["html_charset"]; - if (!temp.isNULL()) { + if (!Rf_isNull(temp)) { html_charset = optional_as(temp); } } - if (options.containsElementNamed("headers")) { + if (options.contains("headers")) { temp = options["headers"]; - if (!temp.isNULL()) { + if (!Rf_isNull(temp)) { headers = optional_as(temp); } } - if (options.containsElementNamed("validation")) { + if (options.contains("validation")) { temp = options["validation"]; - if (!temp.isNULL()) { - validation = optional_as >(temp); + if (!Rf_isNull(temp)) { + validation = optional_as>(temp); } } - if (options.containsElementNamed("exclude")) { + if (options.contains("exclude")) { temp = options["exclude"]; - if (!temp.isNULL()) { + if (!Rf_isNull(temp)) { exclude = optional_as(temp); } } } -Rcpp::List StaticPathOptions::asRObject() const { +list StaticPathOptions::asRObject() const { ASSERT_MAIN_THREAD() - using namespace Rcpp; - - List obj = List::create( - _["indexhtml"] = optional_wrap(indexhtml), - _["fallthrough"] = optional_wrap(fallthrough), - _["html_charset"] = optional_wrap(html_charset), - _["headers"] = optional_wrap(headers), - _["validation"] = optional_wrap(validation), - _["exclude"] = optional_wrap(exclude) - ); - + writable::list obj = {"indexhtml"_nm = optional_wrap(indexhtml), + "fallthrough"_nm = optional_wrap(fallthrough), + "html_charset"_nm = optional_wrap(html_charset), + "headers"_nm = optional_wrap(headers), + "validation"_nm = optional_wrap(validation), + "exclude"_nm = optional_wrap(exclude)}; obj.attr("class") = "staticPathOptions"; - return obj; } // Merge StaticPathOptions object `a` with `b`. Values in `a` take precedence. -StaticPathOptions StaticPathOptions::merge( - const StaticPathOptions& a, - const StaticPathOptions& b) -{ +StaticPathOptions StaticPathOptions::merge(const StaticPathOptions &a, + const StaticPathOptions &b) { StaticPathOptions new_sp = a; - if (new_sp.indexhtml == std::experimental::nullopt) new_sp.indexhtml = b.indexhtml; - if (new_sp.fallthrough == std::experimental::nullopt) new_sp.fallthrough = b.fallthrough; - if (new_sp.html_charset == std::experimental::nullopt) new_sp.html_charset = b.html_charset; - if (new_sp.headers == std::experimental::nullopt) new_sp.headers = b.headers; - if (new_sp.validation == std::experimental::nullopt) new_sp.validation = b.validation; - if (new_sp.exclude == std::experimental::nullopt) new_sp.exclude = b.exclude; + if (new_sp.indexhtml == std::experimental::nullopt) + new_sp.indexhtml = b.indexhtml; + if (new_sp.fallthrough == std::experimental::nullopt) + new_sp.fallthrough = b.fallthrough; + if (new_sp.html_charset == std::experimental::nullopt) + new_sp.html_charset = b.html_charset; + if (new_sp.headers == std::experimental::nullopt) + new_sp.headers = b.headers; + if (new_sp.validation == std::experimental::nullopt) + new_sp.validation = b.validation; + if (new_sp.exclude == std::experimental::nullopt) + new_sp.exclude = b.exclude; return new_sp; } // Check if a set of request headers satisfies the condition specified by // `validation`. -bool StaticPathOptions::validateRequestHeaders(const RequestHeaders& headers) const { +bool StaticPathOptions::validateRequestHeaders( + const RequestHeaders &headers) const { if (validation == std::experimental::nullopt) { - throw std::runtime_error("Cannot validate request headers because validation pattern is not set."); + throw std::runtime_error("Cannot validate request headers because " + "validation pattern is not set."); } // Should have the format {"==", "aaa", "bbb"}, or {} if there's no // validation pattern. - const std::vector& pattern = *validation; + const std::vector &pattern = *validation; if (pattern.size() == 0) { return true; @@ -144,16 +147,15 @@ bool StaticPathOptions::validateRequestHeaders(const RequestHeaders& headers) co return false; } - // ============================================================================ // StaticPath // ============================================================================ -StaticPath::StaticPath(const Rcpp::List& sp) { +StaticPath::StaticPath(const list &sp) { ASSERT_MAIN_THREAD() - path = Rcpp::as(sp["path"]); + path = as_cpp(sp["path"]); - Rcpp::List options_list = sp["options"]; + list options_list(sp["options"]); options = StaticPathOptions(options_list); if (path.length() == 0) { @@ -167,29 +169,20 @@ StaticPath::StaticPath(const Rcpp::List& sp) { } } -Rcpp::List StaticPath::asRObject() const { +list StaticPath::asRObject() const { ASSERT_MAIN_THREAD() - using namespace Rcpp; - - List obj = List::create( - _["path"] = path, - _["options"] = options.asRObject() - ); - + writable::list obj = {"path"_nm = path, "options"_nm = options.asRObject()}; obj.attr("class") = "staticPath"; - return obj; } - // ============================================================================ // StaticPathManager // ============================================================================ -StaticPathManager::StaticPathManager() { - uv_mutex_init(&mutex); -} +StaticPathManager::StaticPathManager() { uv_mutex_init(&mutex); } -StaticPathManager::StaticPathManager(const Rcpp::List& path_list, const Rcpp::List& options_list) { +StaticPathManager::StaticPathManager(const list &path_list, + const list &options_list) { ASSERT_MAIN_THREAD() uv_mutex_init(&mutex); @@ -199,29 +192,28 @@ StaticPathManager::StaticPathManager(const Rcpp::List& path_list, const Rcpp::Li return; } - Rcpp::CharacterVector names = path_list.names(); - if (names.isNULL()) { - throw Rcpp::exception("Error processing static paths: all static paths must be named."); + strings names = path_list.names(); + if (names.size() == 0) { + stop("Error processing static paths: all static paths must be named."); } - for (int i=0; i(names[i]); + for (R_xlen_t i = 0; i < path_list.size(); i++) { + std::string name = std::string(names[i]); if (name == "") { - throw Rcpp::exception("Error processing static paths."); + stop("Error processing static paths."); } - Rcpp::List sp(path_list[i]); + list sp(path_list[i]); StaticPath staticpath(sp); - this->path_map.insert( - std::pair(name, staticpath) - ); + this->path_map.insert(std::pair(name, staticpath)); } } - -// Returns a StaticPath object, which has its options merged with the overall ones. -std::experimental::optional StaticPathManager::get(const std::string& path) const { +// Returns a StaticPath object, which has its options merged with the overall +// ones. +std::experimental::optional +StaticPathManager::get(const std::string &path) const { guard guard(mutex); std::map::const_iterator it = path_map.find(path); if (it == path_map.end()) { @@ -235,16 +227,16 @@ std::experimental::optional StaticPathManager::get(const std::string return sp; } -std::experimental::optional StaticPathManager::get(const Rcpp::CharacterVector& path) const { +std::experimental::optional +StaticPathManager::get(const strings &path) const { ASSERT_MAIN_THREAD() if (path.size() != 1) { - throw Rcpp::exception("Can only get a single StaticPath object."); + stop("Can only get a single StaticPath object."); } - return get(Rcpp::as(path)); + return get(std::string(path[0])); } - -void StaticPathManager::set(const std::string& path, const StaticPath& sp) { +void StaticPathManager::set(const std::string &path, const StaticPath &sp) { guard guard(mutex); // If the key already exists, replace the value. std::map::iterator it = path_map.find(path); @@ -253,26 +245,23 @@ void StaticPathManager::set(const std::string& path, const StaticPath& sp) { } // Otherwise, insert the pair. - path_map.insert( - std::pair(path, sp) - ); + path_map.insert(std::pair(path, sp)); } -void StaticPathManager::set(const std::map& pmap) { +void StaticPathManager::set(const std::map &pmap) { std::map::const_iterator it; for (it = pmap.begin(); it != pmap.end(); it++) { set(it->first, it->second); } } -void StaticPathManager::set(const Rcpp::List& pmap) { +void StaticPathManager::set(const list &pmap) { ASSERT_MAIN_THREAD() - std::map pmap2 = toMap(pmap); + std::map pmap2 = toMap(pmap); set(pmap2); } - -void StaticPathManager::remove(const std::string& path) { +void StaticPathManager::remove(const std::string &path) { guard guard(mutex); std::map::iterator it = path_map.find(path); if (it != path_map.end()) { @@ -280,20 +269,20 @@ void StaticPathManager::remove(const std::string& path) { } } -void StaticPathManager::remove(const std::vector& paths) { +void StaticPathManager::remove(const std::vector &paths) { std::vector::const_iterator it; for (it = paths.begin(); it != paths.end(); it++) { remove(*it); } } -void StaticPathManager::remove(const Rcpp::CharacterVector& paths) { +void StaticPathManager::remove(const strings &paths) { ASSERT_MAIN_THREAD() - std::vector paths_vec = Rcpp::as >(paths); - remove(paths_vec); + for (R_xlen_t i = 0; i < paths.size(); i++) { + remove(std::string(paths[i])); + } } - // Given a URL path, this returns a pair where the first element is a matching // StaticPath object, and the second element is the portion of the url_path that // comes after the match for the static path. @@ -312,11 +301,11 @@ void StaticPathManager::remove(const Rcpp::CharacterVector& paths) { // there is a static path "/foo"), then the returned pair consists of the // matching StaticPath object and an empty string "". // -// If no matching static path is found, then it returns std::experimental::nullopt. +// If no matching static path is found, then it returns +// std::experimental::nullopt. // -std::experimental::optional > StaticPathManager::matchStaticPath( - const std::string& url_path) const -{ +std::experimental::optional> +StaticPathManager::matchStaticPath(const std::string &url_path) const { if (url_path.empty()) { return std::experimental::nullopt; @@ -337,7 +326,7 @@ std::experimental::optional > StaticPathManag path = path.substr(0, path.length() - 1); } - pre_slash = path; + pre_slash = path; post_slash = ""; size_t found_idx = path.length() + 1; @@ -380,25 +369,31 @@ std::experimental::optional > StaticPathManag } } -const StaticPathOptions& StaticPathManager::getOptions() const { +const StaticPathOptions &StaticPathManager::getOptions() const { return options; } -void StaticPathManager::setOptions(const Rcpp::List& opts) { +void StaticPathManager::setOptions(const list &opts) { options.setOptions(opts); } // Returns a list of R objects that reflect the StaticPaths, without merging // the overall options. -Rcpp::List StaticPathManager::pathsAsRObject() const { +list StaticPathManager::pathsAsRObject() const { ASSERT_MAIN_THREAD() guard guard(mutex); - Rcpp::List obj; + R_xlen_t n = static_cast(path_map.size()); + writable::list obj(n); + writable::strings nms(n); + + R_xlen_t i = 0; std::map::const_iterator it; - for (it = path_map.begin(); it != path_map.end(); it++) { - obj[it->first] = it->second.asRObject(); + for (it = path_map.begin(); it != path_map.end(); ++it, ++i) { + nms[i] = it->first; + obj[i] = it->second.asRObject(); } + obj.attr("names") = nms; return obj; } diff --git a/src/staticpath.h b/src/staticpath.h index 24a99f6d1..b611f7541 100644 --- a/src/staticpath.h +++ b/src/staticpath.h @@ -1,12 +1,15 @@ #ifndef STATICPATH_HPP #define STATICPATH_HPP -#include -#include -#include +#include "constants.h" #include "optional.h" #include "thread.h" -#include "constants.h" +#include +#include + +#include "cpp11.hpp" + +using namespace cpp11; class StaticPathOptions { public: @@ -14,39 +17,37 @@ class StaticPathOptions { std::experimental::optional fallthrough; std::experimental::optional html_charset; std::experimental::optional headers; - std::experimental::optional > validation; + std::experimental::optional> validation; std::experimental::optional exclude; - StaticPathOptions() : - indexhtml(std::experimental::nullopt), - fallthrough(std::experimental::nullopt), - html_charset(std::experimental::nullopt), - headers(std::experimental::nullopt), - validation(std::experimental::nullopt), - exclude(std::experimental::nullopt) - { }; - StaticPathOptions(const Rcpp::List& options); + StaticPathOptions() + : indexhtml(std::experimental::nullopt), + fallthrough(std::experimental::nullopt), + html_charset(std::experimental::nullopt), + headers(std::experimental::nullopt), + validation(std::experimental::nullopt), + exclude(std::experimental::nullopt) {}; + StaticPathOptions(const list &options); - void setOptions(const Rcpp::List& options); + void setOptions(const list &options); - Rcpp::List asRObject() const; + list asRObject() const; - static StaticPathOptions merge(const StaticPathOptions& a, const StaticPathOptions& b); + static StaticPathOptions merge(const StaticPathOptions &a, + const StaticPathOptions &b); - bool validateRequestHeaders(const RequestHeaders& headers) const; + bool validateRequestHeaders(const RequestHeaders &headers) const; }; - class StaticPath { public: std::string path; StaticPathOptions options; - StaticPath(const Rcpp::List& sp); + StaticPath(const list &sp); - Rcpp::List asRObject() const; + list asRObject() const; }; - class StaticPathManager { std::map path_map; // Mutex is used whenever path_map is accessed. @@ -56,27 +57,26 @@ class StaticPathManager { public: StaticPathManager(); - StaticPathManager(const Rcpp::List& path_list, const Rcpp::List& options_list); - - std::experimental::optional get(const std::string& path) const; - std::experimental::optional get(const Rcpp::CharacterVector& path) const; + StaticPathManager(const list &path_list, const list &options_list); - void set(const std::string& path, const StaticPath& sp); - void set(const std::map& pmap); - void set(const Rcpp::List& pmap); + std::experimental::optional get(const std::string &path) const; + std::experimental::optional get(const strings &path) const; - void remove(const std::string& path); - void remove(const std::vector& paths); - void remove(const Rcpp::CharacterVector& paths); + void set(const std::string &path, const StaticPath &sp); + void set(const std::map &pmap); + void set(const list &pmap); - std::experimental::optional > matchStaticPath( - const std::string& url_path) const; + void remove(const std::string &path); + void remove(const std::vector &paths); + void remove(const strings &paths); + std::experimental::optional> + matchStaticPath(const std::string &url_path) const; - const StaticPathOptions& getOptions() const; - void setOptions(const Rcpp::List& opts); + const StaticPathOptions &getOptions() const; + void setOptions(const list &opts); - Rcpp::List pathsAsRObject() const; + list pathsAsRObject() const; }; #endif diff --git a/src/thread.cpp b/src/thread.cpp index 69d5243e5..e63094fc3 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -3,13 +3,9 @@ static uv_thread_t __main_thread__; static uv_thread_t __background_thread__; -void register_main_thread() { - __main_thread__ = uv_thread_self(); -} +void register_main_thread() { __main_thread__ = uv_thread_self(); } -void register_background_thread() { - __background_thread__ = uv_thread_self(); -} +void register_background_thread() { __background_thread__ = uv_thread_self(); } bool is_main_thread() { uv_thread_t cur_thread = uv_thread_self(); diff --git a/src/thread.h b/src/thread.h index 80ea8b1c6..c05edc53b 100644 --- a/src/thread.h +++ b/src/thread.h @@ -11,14 +11,13 @@ void register_background_thread(); bool is_main_thread(); bool is_background_thread(); - #ifdef DEBUG_THREAD #include // This must be called from the main thread so that thread assertions can be // tested later. -#define ASSERT_MAIN_THREAD() assert(is_main_thread()); -#define ASSERT_BACKGROUND_THREAD() assert(is_background_thread()); +#define ASSERT_MAIN_THREAD() assert(is_main_thread()); +#define ASSERT_BACKGROUND_THREAD() assert(is_background_thread()); #else #define ASSERT_MAIN_THREAD() @@ -26,7 +25,6 @@ bool is_background_thread(); #endif // DEBUG_THREAD - class guard { public: guard(uv_mutex_t &mutex) { @@ -34,22 +32,16 @@ class guard { uv_mutex_lock(_mutex); } - ~guard() { - uv_mutex_unlock(_mutex); - } + ~guard() { uv_mutex_unlock(_mutex); } private: - uv_mutex_t* _mutex; + uv_mutex_t *_mutex; }; - // Container class for holding thread-safe values. -template -class ThreadSafe { +template class ThreadSafe { public: - ThreadSafe(const T value) : _value(value) { - uv_mutex_init(&_mutex); - }; + ThreadSafe(const T value) : _value(value) { uv_mutex_init(&_mutex); }; void set(const T value) { guard guard(_mutex); @@ -66,7 +58,6 @@ class ThreadSafe { uv_mutex_t _mutex; }; - // Wrapper class for mutex/condition variable pair. class CondWait { public: @@ -80,27 +71,18 @@ class CondWait { uv_cond_destroy(&cond); } - void lock() { - uv_mutex_lock(&mutex); - } + void lock() { uv_mutex_lock(&mutex); } - void unlock() { - uv_mutex_unlock(&mutex); - } + void unlock() { uv_mutex_unlock(&mutex); } - void signal() { - uv_cond_signal(&cond); - }; + void signal() { uv_cond_signal(&cond); }; - void wait() { - uv_cond_wait(&cond, &mutex); - } + void wait() { uv_cond_wait(&cond, &mutex); } uv_mutex_t mutex; uv_cond_t cond; }; - // uv_barrier_t causes crashes on Windows (with libuv 1.15.0), so we have our // own implementation here. class Barrier { @@ -119,7 +101,7 @@ class Barrier { if (n == 0) { condwait.signal(); } - while(n > 0) { + while (n > 0) { condwait.wait(); } } diff --git a/src/timegm.cpp b/src/timegm.cpp index ea4093e67..b58123717 100644 --- a/src/timegm.cpp +++ b/src/timegm.cpp @@ -1,34 +1,30 @@ #include "timegm.h" -#include #include +#include // From https://stackoverflow.com/a/58037981/412655 -int days_since_1970(int y, int m, int d) -{ - y -= m <= 2; - int era = y / 400; - int yoe = y - era * 400; // [0, 399] - int doy = (153 * (m + (m > 2 ? -3 : 9)) + 2) / 5 + d - 1; // [0, 365] - int doe = yoe * 365 + yoe / 4 - yoe / 100 + doy; // [0, 146096] - return era * 146097 + doe - 719468; +int days_since_1970(int y, int m, int d) { + y -= m <= 2; + int era = y / 400; + int yoe = y - era * 400; // [0, 399] + int doy = (153 * (m + (m > 2 ? -3 : 9)) + 2) / 5 + d - 1; // [0, 365] + int doe = yoe * 365 + yoe / 4 - yoe / 100 + doy; // [0, 146096] + return era * 146097 + doe - 719468; } -time_t timegm2(struct tm const* t) -{ - int year = t->tm_year + 1900; - int month = t->tm_mon; // 0-11 - if (month > 11) - { - year += month / 12; - month %= 12; - } - else if (month < 0) - { - int years_diff = (11 - month) / 12; - year -= years_diff; - month += 12 * years_diff; - } - int days_since_epoch = days_since_1970(year, month + 1, t->tm_mday); +time_t timegm2(struct tm const *t) { + int year = t->tm_year + 1900; + int month = t->tm_mon; // 0-11 + if (month > 11) { + year += month / 12; + month %= 12; + } else if (month < 0) { + int years_diff = (11 - month) / 12; + year -= years_diff; + month += 12 * years_diff; + } + int days_since_epoch = days_since_1970(year, month + 1, t->tm_mday); - return 60 * (60 * (24L * days_since_epoch + t->tm_hour) + t->tm_min) + t->tm_sec; + return 60 * (60 * (24L * days_since_epoch + t->tm_hour) + t->tm_min) + + t->tm_sec; } diff --git a/src/tqueue.h b/src/tqueue.h index 6aff34f5a..5f9b1bee1 100644 --- a/src/tqueue.h +++ b/src/tqueue.h @@ -3,11 +3,10 @@ // A thread-safe queue, using threading constructs from libuv. -#include #include "thread.h" +#include -template -class tqueue { +template class tqueue { private: std::queue q; @@ -15,45 +14,38 @@ class tqueue { public: tqueue(); - void push(const T&); - T& front(); + void push(const T &); + T &front(); void pop(); int size(); uv_mutex_t mutex; }; - -template -tqueue::tqueue() { +template tqueue::tqueue() { uv_mutex_init_recursive(&mutex); q = std::queue(); } -template -void tqueue::push(const T& item) { +template void tqueue::push(const T &item) { guard guard(mutex); q.push(item); } -template -T& tqueue::front() { +template T &tqueue::front() { guard guard(mutex); - T& item = q.front(); + T &item = q.front(); return item; } -template -void tqueue::pop() { +template void tqueue::pop() { guard guard(mutex); q.pop(); } -template -int tqueue::size() { +template int tqueue::size() { guard guard(mutex); return q.size(); } - #endif // TQUEUE_HPP diff --git a/src/utils.cpp b/src/utils.cpp index 69be8c90a..394a46313 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -1,18 +1,17 @@ #include "utils.h" +#include // Set the default log level LogLevel log_level_ = LOG_ERROR; -void debug_log(const std::string& msg, LogLevel level) { +void debug_log(const std::string &msg, LogLevel level) { if (log_level_ >= level) { err_printf("%s\n", msg.c_str()); }; } - // Sets the current log level and returns previous value. -// [[Rcpp::export]] -std::string log_level(const std::string& level) { +[[cpp11::register]] std::string log_level(const std::string &level) { LogLevel old_level = log_level_; if (level == "") { @@ -28,16 +27,22 @@ std::string log_level(const std::string& level) { } else if (level == "DEBUG") { log_level_ = LOG_DEBUG; } else { - Rcpp::stop("Unknown value for `level`"); + stop("Unknown value for `level`"); } - switch(old_level) { - case LOG_OFF: return "OFF"; - case LOG_ERROR: return "ERROR"; - case LOG_WARN: return "WARN"; - case LOG_INFO: return "INFO"; - case LOG_DEBUG: return "DEBUG"; - default: return ""; + switch (old_level) { + case LOG_OFF: + return "OFF"; + case LOG_ERROR: + return "ERROR"; + case LOG_WARN: + return "WARN"; + case LOG_INFO: + return "INFO"; + case LOG_DEBUG: + return "DEBUG"; + default: + return ""; } } @@ -47,7 +52,7 @@ std::string log_level(const std::string& level) { // @param pOut If true is returned, the integer value of the parsed value. If // false returned, pOut is untouched. // @return true if successful, false if parsing fails for any reason -bool str_read_int(std::istream* input, size_t digits, int* pOut) { +bool str_read_int(std::istream *input, size_t digits, int *pOut) { if (digits <= 0) { return false; } @@ -79,7 +84,8 @@ bool str_read_int(std::istream* input, size_t digits, int* pOut) { // element in `values` that matched the input. If false is returned, then res // will be untouched. // @return true if successful, false if reading failed or no match found -bool str_read_lookup(std::istream* input, size_t bytes, const std::vector& values, int* pRes) { +bool str_read_lookup(std::istream *input, size_t bytes, + const std::vector &values, int *pRes) { std::vector buf; buf.resize(bytes + 1); @@ -96,12 +102,14 @@ bool str_read_lookup(std::istream* input, size_t bytes, const std::vector months {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; -const std::vector days_of_week {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; +const std::vector months{"Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; +const std::vector days_of_week{"Sun", "Mon", "Tue", "Wed", + "Thu", "Fri", "Sat"}; // Given a date string of format "Wed, 21 Oct 2015 07:28:00 GMT", return a // time_t representing that time. If the date is malformed, then return 0. -time_t parse_http_date_string(const std::string& date) { +time_t parse_http_date_string(const std::string &date) { // This is because the static std::locale may not be thread-safe. If in the // future we need to call this from multiple threads, we can remove this and // make the std::locale non-static. @@ -126,28 +134,47 @@ time_t parse_http_date_string(const std::string& date) { // return 0; // } - if (!str_read_lookup(&date_ss, 3, days_of_week, &t.tm_wday)) return 0; - if (date_ss.get() != ',') return 0; - if (date_ss.get() != ' ') return 0; - if (!str_read_int(&date_ss, 2, &t.tm_mday)) return 0; - if (date_ss.get() != ' ') return 0; - if (!str_read_lookup(&date_ss, 3, months, &t.tm_mon)) return 0; - if (date_ss.get() != ' ') return 0; + if (!str_read_lookup(&date_ss, 3, days_of_week, &t.tm_wday)) + return 0; + if (date_ss.get() != ',') + return 0; + if (date_ss.get() != ' ') + return 0; + if (!str_read_int(&date_ss, 2, &t.tm_mday)) + return 0; + if (date_ss.get() != ' ') + return 0; + if (!str_read_lookup(&date_ss, 3, months, &t.tm_mon)) + return 0; + if (date_ss.get() != ' ') + return 0; int year = 0; - if (!str_read_int(&date_ss, 4, &year)) return 0; + if (!str_read_int(&date_ss, 4, &year)) + return 0; t.tm_year = year - 1900; - if (date_ss.get() != ' ') return 0; - if (!str_read_int(&date_ss, 2, &t.tm_hour)) return 0; - if (date_ss.get() != ':') return 0; - if (!str_read_int(&date_ss, 2, &t.tm_min)) return 0; - if (date_ss.get() != ':') return 0; - if (!str_read_int(&date_ss, 2, &t.tm_sec)) return 0; - if (date_ss.get() != ' ') return 0; - if (date_ss.get() != 'G') return 0; - if (date_ss.get() != 'M') return 0; - if (date_ss.get() != 'T') return 0; - if (date_ss.get() != EOF) return 0; - } catch(...) { + if (date_ss.get() != ' ') + return 0; + if (!str_read_int(&date_ss, 2, &t.tm_hour)) + return 0; + if (date_ss.get() != ':') + return 0; + if (!str_read_int(&date_ss, 2, &t.tm_min)) + return 0; + if (date_ss.get() != ':') + return 0; + if (!str_read_int(&date_ss, 2, &t.tm_sec)) + return 0; + if (date_ss.get() != ' ') + return 0; + if (date_ss.get() != 'G') + return 0; + if (date_ss.get() != 'M') + return 0; + if (date_ss.get() != 'T') + return 0; + if (date_ss.get() != EOF) + return 0; + } catch (...) { return 0; } diff --git a/src/utils.h b/src/utils.h index 94448ec14..fc324910c 100644 --- a/src/utils.h +++ b/src/utils.h @@ -1,42 +1,46 @@ #ifndef UTILS_H #define UTILS_H +#include "optional.h" +#include "thread.h" +#include "timegm.h" #include -#include -#include +#include +#include #include #include #include +#include #include -#include -#include "optional.h" -#include "thread.h" -#include "timegm.h" + +#include "cpp11.hpp" + +using namespace cpp11; // A callback for deleting objects on the main thread using later(). This is -// needed when the object is an Rcpp object or contains one, because deleting +// needed when the object is a cpp11 object or contains one, because deleting // such objects invoke R's memory management functions. -template -void deleter_main(void* obj) { +template void deleter_main(void *obj) { ASSERT_MAIN_THREAD() // later() passes a void* to the callback, so we have to cast it. - T* typed_obj = reinterpret_cast(obj); + T *typed_obj = reinterpret_cast(obj); try { delete typed_obj; - } catch (...) {} + } catch (...) { + } } // Does the same as deleter_main, but checks that it's running on the // background thread (when thread debugging is enabled). -template -void deleter_background(void* obj) { +template void deleter_background(void *obj) { ASSERT_BACKGROUND_THREAD() - T* typed_obj = reinterpret_cast(obj); + T *typed_obj = reinterpret_cast(obj); try { delete typed_obj; - } catch (...) {} + } catch (...) { + } } // It's not safe to call REprintf from the background thread but we need some @@ -58,55 +62,45 @@ inline void err_printf(const char *fmt, ...) { ssize_t res = write(STDERR_FILENO, buf, n); // This is here simply to avoid a warning about "ignoring return value" of the // write(), or "variable 'res' set but not used" on some compilers. - if (res) res += 0; + if (res) + res += 0; return; } - // ============================================================================ // Logging // ============================================================================ -enum LogLevel { - LOG_OFF, - LOG_ERROR, - LOG_WARN, - LOG_INFO, - LOG_DEBUG -}; +enum LogLevel { LOG_OFF, LOG_ERROR, LOG_WARN, LOG_INFO, LOG_DEBUG }; -void debug_log(const std::string& msg, LogLevel level); +void debug_log(const std::string &msg, LogLevel level); // ============================================================================ - // Indexing into an empty vector causes assertion failures on some platforms -template -T* safe_vec_addr(std::vector& vec) { +template T *safe_vec_addr(std::vector &vec) { return vec.size() ? &vec[0] : NULL; } // Indexing into an empty vector causes assertion failures on some platforms -inline const char* safe_str_addr(const std::string& str) { +inline const char *safe_str_addr(const std::string &str) { return str.size() ? &str[0] : NULL; } -inline std::string to_lower(const std::string& str) { +inline std::string to_lower(const std::string &str) { std::string lowered = str; std::transform(lowered.begin(), lowered.end(), lowered.begin(), tolower); return lowered; } -template -std::string toString(T x) { +template std::string toString(T x) { std::stringstream ss; ss << x; return ss.str(); } -// This is used for converting an Rcpp named vector (T2) to a std::map. -template -std::map toMap(T2 x) { +// This is used for converting a named R vector (T2) to a std::map. +template std::map toMap(T2 x) { ASSERT_MAIN_THREAD() std::map strmap; @@ -115,169 +109,207 @@ std::map toMap(T2 x) { return strmap; } - Rcpp::CharacterVector names = x.names(); - if (names.isNULL()) { - throw Rcpp::exception("Error converting R object to map: vector does not have names."); + strings names = x.names(); + if (Rf_isNull(SEXP(names))) { + stop("Error converting R object to map: vector does not have " + "names."); } - for (int i=0; i(names[i]); - T1 value = Rcpp::as (x[i]); + for (R_xlen_t i = 0; i < x.size(); i++) { + std::string name = std::string(names[i]); + T1 value = as_cpp(SEXP(x[i])); if (name == "") { - throw Rcpp::exception("Error converting R object to map: element has empty name."); + stop("Error converting R object to map: element has empty " + "name."); } - strmap.insert( - std::pair(name, value) - ); + strmap.insert(std::pair(name, value)); } return strmap; } -// A wrapper for Rcpp::as. If the R value is NULL, this returns nullopt; -// otherwise it returns the usual value that Rcpp::as returns, wrapped in -// std::experimental::optional. -template -std::experimental::optional optional_as(T2 value) { - if (value.isNULL()) { +// A wrapper for as_cpp. If the R value is NULL, this returns nullopt; +// otherwise it returns the usual value that as_cpp returns, wrapped in +// std::experimental::optional. +template std::experimental::optional optional_as(SEXP value) { + if (Rf_isNull(value)) { return std::experimental::nullopt; } - return std::experimental::optional( Rcpp::as(value) ); + return std::experimental::optional(as_cpp(value)); } -// A wrapper for Rcpp::wrap. If the C++ value is missing, this returns the -// R value NULL; otherwise it returns the usual value that Rcpp::wrap returns, after -// unwrapping from the std::experimental::optional. -template -Rcpp::RObject optional_wrap(std::experimental::optional value) { +// If the C++ value is missing, this returns R NULL; otherwise converts to SEXP. +template SEXP optional_wrap(std::experimental::optional value) { if (!value.has_value()) { return R_NilValue; } - return Rcpp::wrap(*value); + return as_sexp(*value); } - -// as() and wrap() for ResponseHeaders. Since the ResponseHeaders typedef is -// in constants.h and this file doesn't include constants.h, we'll define them +// as_cpp and as_sexp for ResponseHeaders. Since the ResponseHeaders typedef is +// in constants.h and this file doesn't include constants.h, we define them // using the actual vector type instead of the ResponseHeaders typedef. -// (constants.h doesn't include Rcpp.h so we can't define these functions -// there.) -namespace Rcpp { - template <> inline std::vector > as(SEXP x) { - ASSERT_MAIN_THREAD() - Rcpp::CharacterVector headers(x); - Rcpp::CharacterVector names = headers.names(); - - if (names.isNULL()) { - throw Rcpp::exception("All values must be named."); - } - - std::vector > result; - - for (int i=0; i(names[i]); - if (name == "") { - throw Rcpp::exception("All values must be named."); - } - - std::string value = Rcpp::as(headers[i]); - - result.push_back(std::make_pair(name, value)); - } +inline std::vector> +as_response_headers(SEXP x) { + ASSERT_MAIN_THREAD() + strings hdrs(x); + strings nms = hdrs.names(); - return result; + if (Rf_isNull(SEXP(nms))) { + stop("All values must be named."); } - template <> inline SEXP wrap(const std::vector > &x) { - ASSERT_MAIN_THREAD() - - std::vector values(x.size()); - std::vector names(x.size()); - - for (unsigned int i=0; i> result; + for (R_xlen_t i = 0; i < hdrs.size(); i++) { + std::string name = std::string(nms[i]); + if (name.empty()) { + stop("All values must be named."); } + result.push_back({name, std::string(hdrs[i])}); + } + return result; +} - Rcpp::CharacterVector result = Rcpp::wrap(values); - result.attr("names") = Rcpp::wrap(names); +inline SEXP response_headers_to_sexp( + const std::vector> &x) { + ASSERT_MAIN_THREAD() + R_xlen_t n = static_cast(x.size()); + writable::strings values(n); + writable::strings nms(n); + for (R_xlen_t i = 0; i < n; i++) { + nms[i] = x[i].first; + values[i] = x[i].second; + } + values.attr("names") = nms; + return values; +} - return result; +// optional_as / optional_wrap specializations for ResponseHeaders. +template <> +inline std::experimental::optional< + std::vector>> +optional_as>>(SEXP value) { + if (Rf_isNull(value)) { + return std::experimental::nullopt; } + return as_response_headers(value); } +template <> +inline SEXP optional_wrap(std::experimental::optional< + std::vector>> + value) { + if (!value.has_value()) { + return R_NilValue; + } + return response_headers_to_sexp(*value); +} // Return a date string in the format required for the HTTP Date header. For // example: "Wed, 21 Oct 2015 07:28:00 GMT" -inline std::string http_date_string(const time_t& t) { +inline std::string http_date_string(const time_t &t) { struct tm timeptr; - #ifdef _WIN32 +#ifdef _WIN32 gmtime_s(&timeptr, &t); - #else +#else gmtime_r(&t, &timeptr); - #endif +#endif std::string day_name; - switch(timeptr.tm_wday) { - case 0: day_name = "Sun"; break; - case 1: day_name = "Mon"; break; - case 2: day_name = "Tue"; break; - case 3: day_name = "Wed"; break; - case 4: day_name = "Thu"; break; - case 5: day_name = "Fri"; break; - case 6: day_name = "Sat"; break; - default: return ""; + switch (timeptr.tm_wday) { + case 0: + day_name = "Sun"; + break; + case 1: + day_name = "Mon"; + break; + case 2: + day_name = "Tue"; + break; + case 3: + day_name = "Wed"; + break; + case 4: + day_name = "Thu"; + break; + case 5: + day_name = "Fri"; + break; + case 6: + day_name = "Sat"; + break; + default: + return ""; } std::string month_name; - switch(timeptr.tm_mon) { - case 0: month_name = "Jan"; break; - case 1: month_name = "Feb"; break; - case 2: month_name = "Mar"; break; - case 3: month_name = "Apr"; break; - case 4: month_name = "May"; break; - case 5: month_name = "Jun"; break; - case 6: month_name = "Jul"; break; - case 7: month_name = "Aug"; break; - case 8: month_name = "Sep"; break; - case 9: month_name = "Oct"; break; - case 10: month_name = "Nov"; break; - case 11: month_name = "Dec"; break; - default: return ""; + switch (timeptr.tm_mon) { + case 0: + month_name = "Jan"; + break; + case 1: + month_name = "Feb"; + break; + case 2: + month_name = "Mar"; + break; + case 3: + month_name = "Apr"; + break; + case 4: + month_name = "May"; + break; + case 5: + month_name = "Jun"; + break; + case 6: + month_name = "Jul"; + break; + case 7: + month_name = "Aug"; + break; + case 8: + month_name = "Sep"; + break; + case 9: + month_name = "Oct"; + break; + case 10: + month_name = "Nov"; + break; + case 11: + month_name = "Dec"; + break; + default: + return ""; } const int maxlen = 50; char res[maxlen]; - snprintf(res, maxlen, "%s, %02d %s %04d %02d:%02d:%02d GMT", - day_name.c_str(), - timeptr.tm_mday, - month_name.c_str(), - timeptr.tm_year + 1900, - timeptr.tm_hour, - timeptr.tm_min, - timeptr.tm_sec - ); + snprintf(res, maxlen, "%s, %02d %s %04d %02d:%02d:%02d GMT", day_name.c_str(), + timeptr.tm_mday, month_name.c_str(), timeptr.tm_year + 1900, + timeptr.tm_hour, timeptr.tm_min, timeptr.tm_sec); return std::string(res); } // Given a date string of format "Wed, 21 Oct 2015 07:28:00 GMT", return a // time_t representing that time. If the date is malformed, then return 0. -time_t parse_http_date_string(const std::string& date); +time_t parse_http_date_string(const std::string &date); // Compares two strings in constant time. Returns true if they are the same; // false otherwise. -inline bool constant_time_compare(const std::string& a, const std::string& b) { +inline bool constant_time_compare(const std::string &a, const std::string &b) { if (a.length() != b.length()) return false; - volatile const char* ac = a.c_str(); - volatile const char* bc = b.c_str(); + volatile const char *ac = a.c_str(); + volatile const char *bc = b.c_str(); volatile char result = 0; int len = a.length(); - for (int i=0; i - -void freeAfterClose(uv_handle_t* handle) { - free(handle); -} +void freeAfterClose(uv_handle_t *handle) { free(handle); } class WriteOp { private: - ExtendedWrite* pParent; + ExtendedWrite *pParent; // Bytes to write before writing the buffer std::vector prefix; @@ -23,9 +20,10 @@ class WriteOp { public: uv_write_t handle; - WriteOp(ExtendedWrite* parent, std::string prefix, uv_buf_t data, std::string suffix) - : pParent(parent), prefix(prefix.begin(), prefix.end()), buffer(data), - suffix(suffix.begin(), suffix.end()) { + WriteOp(ExtendedWrite *parent, std::string prefix, uv_buf_t data, + std::string suffix) + : pParent(parent), prefix(prefix.begin(), prefix.end()), buffer(data), + suffix(suffix.begin(), suffix.end()) { memset(&handle, 0, sizeof(uv_write_t)); handle.data = this; } @@ -60,9 +58,7 @@ class WriteOp { } }; -uint64_t InMemoryDataSource::size() const { - return _buffer.size(); -} +uint64_t InMemoryDataSource::size() const { return _buffer.size(); } uv_buf_t InMemoryDataSource::getData(size_t bytesDesired) { ASSERT_BACKGROUND_THREAD() size_t bytes = _buffer.size() - _pos; @@ -70,29 +66,28 @@ uv_buf_t InMemoryDataSource::getData(size_t bytesDesired) { bytes = bytesDesired; uv_buf_t mem; - mem.base = bytes > 0 ? reinterpret_cast(&_buffer[_pos]) : 0; + mem.base = bytes > 0 ? reinterpret_cast(&_buffer[_pos]) : 0; mem.len = bytes; _pos += bytes; return mem; } -void InMemoryDataSource::freeData(uv_buf_t buffer) { -} +void InMemoryDataSource::freeData(uv_buf_t buffer) {} void InMemoryDataSource::close() { ASSERT_BACKGROUND_THREAD() _buffer.clear(); } -void InMemoryDataSource::add(const std::vector& moreData) { +void InMemoryDataSource::add(const std::vector &moreData) { ASSERT_BACKGROUND_THREAD() if (_buffer.capacity() < _buffer.size() + moreData.size()) _buffer.reserve(_buffer.size() + moreData.size()); _buffer.insert(_buffer.end(), moreData.begin(), moreData.end()); } -static void writecb(uv_write_t* handle, int status) { +static void writecb(uv_write_t *handle, int status) { ASSERT_BACKGROUND_THREAD() - WriteOp* pWriteOp = (WriteOp*)handle->data; + WriteOp *pWriteOp = (WriteOp *)handle->data; pWriteOp->end(); } @@ -117,7 +112,7 @@ void ExtendedWrite::next() { uv_buf_t buf; try { buf = _pDataSource->getData(65536); - } catch (std::exception& e) { + } catch (std::exception &e) { _errored = true; if (_activeWrites == 0) { _pDataSource->close(); @@ -167,7 +162,7 @@ void ExtendedWrite::next() { return; } - WriteOp* pWriteOp = new WriteOp(this, prefix, buf, suffix); + WriteOp *pWriteOp = new WriteOp(this, prefix, buf, suffix); _activeWrites++; auto op_bufs = pWriteOp->bufs(); uv_write(&pWriteOp->handle, _pHandle, &op_bufs[0], op_bufs.size(), &writecb); diff --git a/src/uvutil.h b/src/uvutil.h index ce3e97049..6128b95b1 100644 --- a/src/uvutil.h +++ b/src/uvutil.h @@ -2,28 +2,25 @@ #define UVUTIL_HPP #include "thread.h" -#include -#include #include +#include +#include #include +#include -#include +#include "cpp11.hpp" -inline uv_handle_t* toHandle(uv_timer_t* timer) { - return (uv_handle_t*)timer; -} -inline uv_handle_t* toHandle(uv_tcp_t* tcp) { - return (uv_handle_t*)tcp; -} -inline uv_handle_t* toHandle(uv_stream_t* stream) { - return (uv_handle_t*)stream; -} +using namespace cpp11; -inline uv_stream_t* toStream(uv_tcp_t* tcp) { - return (uv_stream_t*)tcp; +inline uv_handle_t *toHandle(uv_timer_t *timer) { return (uv_handle_t *)timer; } +inline uv_handle_t *toHandle(uv_tcp_t *tcp) { return (uv_handle_t *)tcp; } +inline uv_handle_t *toHandle(uv_stream_t *stream) { + return (uv_handle_t *)stream; } -void freeAfterClose(uv_handle_t* handle); +inline uv_stream_t *toStream(uv_tcp_t *tcp) { return (uv_stream_t *)tcp; } + +void freeAfterClose(uv_handle_t *handle); class WriteOp; @@ -42,27 +39,26 @@ class InMemoryDataSource : public DataSource { private: std::vector _buffer; size_t _pos; + public: - explicit InMemoryDataSource(const std::vector& buffer = std::vector()) - : _buffer(buffer), _pos(0) {} + explicit InMemoryDataSource( + const std::vector &buffer = std::vector()) + : _buffer(buffer), _pos(0) {} - explicit InMemoryDataSource(const Rcpp::RawVector& rawVector) - : _buffer(rawVector.size()), _pos(0) - { + explicit InMemoryDataSource(const raws &rawVector) + : _buffer(rawVector.size()), _pos(0) { ASSERT_MAIN_THREAD() std::copy(rawVector.begin(), rawVector.end(), _buffer.begin()); } - virtual ~InMemoryDataSource() { - close(); - } + virtual ~InMemoryDataSource() { close(); } uint64_t size() const; uv_buf_t getData(size_t bytesDesired); void freeData(uv_buf_t buffer); void close(); - void add(const std::vector& moreData); + void add(const std::vector &moreData); }; // Class for writing a DataSource to a uv_stream_t. Takes care @@ -73,13 +69,14 @@ class ExtendedWrite { int _activeWrites; bool _errored; bool _completed; - uv_stream_t* _pHandle; + uv_stream_t *_pHandle; std::shared_ptr _pDataSource; public: - ExtendedWrite(uv_stream_t* pHandle, std::shared_ptr pDataSource, bool chunked) - : _chunked(chunked), _activeWrites(0), _errored(false), _completed(false), _pHandle(pHandle), - _pDataSource(pDataSource) {} + ExtendedWrite(uv_stream_t *pHandle, std::shared_ptr pDataSource, + bool chunked) + : _chunked(chunked), _activeWrites(0), _errored(false), _completed(false), + _pHandle(pHandle), _pDataSource(pDataSource) {} virtual ~ExtendedWrite() {} virtual void onWriteComplete(int status) = 0; @@ -89,11 +86,9 @@ class ExtendedWrite { protected: void next(); - }; - -inline int ip_family(const std::string& ip) { +inline int ip_family(const std::string &ip) { // A buffer big enough for an IPv6 address unsigned char addr[16]; diff --git a/src/webapplication.cpp b/src/webapplication.cpp index 77d41d63d..adf928890 100644 --- a/src/webapplication.cpp +++ b/src/webapplication.cpp @@ -1,26 +1,24 @@ -#include -#include -#include "httpuv.h" -#include "filedatasource.h" #include "webapplication.h" -#include "httprequest.h" +#include "filedatasource.h" +#include "fs.h" #include "http.h" -#include "thread.h" -#include "utils.h" +#include "httprequest.h" +#include "httpuv.h" #include "mime.h" #include "staticpath.h" -#include "fs.h" +#include "thread.h" +#include "utils.h" #include +#include +#include // ============================================================================ // Utility functions // ============================================================================ -std::string normalizeHeaderName(const std::string& name) { +std::string normalizeHeaderName(const std::string &name) { std::string result = name; - for (std::string::iterator it = result.begin(); - it != result.end(); - it++) { + for (std::string::iterator it = result.begin(); it != result.end(); it++) { if (*it == '-') *it = '_'; else if (*it >= 'a' && *it <= 'z') @@ -29,7 +27,7 @@ std::string normalizeHeaderName(const std::string& name) { return result; } -const std::string& getStatusDescription(int code) { +const std::string &getStatusDescription(int code) { static std::map statusDescs; static std::string unknown("Dunno"); if (statusDescs.size() == 0) { @@ -83,38 +81,35 @@ const std::string& getStatusDescription(int code) { // A generic HTTP response to send when an error (uncaught in the R code) // happens during processing a request. -Rcpp::List errorResponse() { +list errorResponse() { ASSERT_MAIN_THREAD() - using namespace Rcpp; - return List::create( - _["status"] = 500L, - _["headers"] = List::create( - _["Content-Type"] = "text/plain; charset=UTF-8" - ), - _["body"] = "An exception occurred." - ); + return writable::list({"status"_nm = 500L, + "headers"_nm = writable::list( + {"Content-Type"_nm = "text/plain; charset=UTF-8"}), + "body"_nm = "An exception occurred."}); } // An analog to errorResponse, but this returns an shared_ptr -// instead of an Rcpp::List, doesn't involve any R objects, and can be run on +// instead of an list, doesn't involve any R objects, and can be run on // the background thread. -std::shared_ptr error_response(std::shared_ptr pRequest, int code) { +std::shared_ptr +error_response(std::shared_ptr pRequest, int code) { std::string description = getStatusDescription(code); std::string content = toString(code) + " " + description + "\n"; std::vector responseData(content.begin(), content.end()); // Freed in on_response_written - std::shared_ptr pDataSource = std::make_shared(responseData); + std::shared_ptr pDataSource = + std::make_shared(responseData); return std::shared_ptr( - new HttpResponse(pRequest, code, description, pDataSource), - auto_deleter_background - ); + new HttpResponse(pRequest, code, description, pDataSource), + auto_deleter_background); } // Given a URL path like "/foo?abc=123", removes the '?' and everything after. -std::pair splitQueryString(const std::string& url) { +std::pair splitQueryString(const std::string &url) { size_t qsIndex = url.find('?'); std::string path, queryString; if (qsIndex == std::string::npos) @@ -127,78 +122,64 @@ std::pair splitQueryString(const std::string& url) { return std::pair(path, queryString); } - -void requestToEnv(std::shared_ptr pRequest, Rcpp::Environment* pEnv) { +void requestToEnv(std::shared_ptr pRequest, environment *pEnv) { ASSERT_MAIN_THREAD() - using namespace Rcpp; + environment &env = *pEnv; - Environment& env = *pEnv; + std::pair url_query = + splitQueryString(pRequest->url()); + std::string &path = url_query.first; + std::string &queryString = url_query.second; - std::pair url_query = splitQueryString(pRequest->url()); - std::string& path = url_query.first; - std::string& queryString = url_query.second; + env["REQUEST_METHOD"] = pRequest->method(); + env["SCRIPT_NAME"] = std::string(""); + env["PATH_INFO"] = path; + env["QUERY_STRING"] = queryString; - // When making assignments into the Environment, the value must be wrapped - // in a Rcpp object -- letting Rcpp automatically do the wrapping can result - // in an object being GC'd too early. - // https://github.com/RcppCore/Rcpp/issues/780 - env["REQUEST_METHOD"] = CharacterVector(pRequest->method()); - env["SCRIPT_NAME"] = CharacterVector(std::string("")); - env["PATH_INFO"] = CharacterVector(path); - env["QUERY_STRING"] = CharacterVector(queryString); - - env["rook.version"] = CharacterVector("1.1-0"); - env["rook.url_scheme"] = CharacterVector("http"); + env["rook.version"] = std::string("1.1-0"); + env["rook.url_scheme"] = std::string("http"); Address addr = pRequest->serverAddress(); - env["SERVER_NAME"] = CharacterVector(addr.host); + env["SERVER_NAME"] = addr.host; std::ostringstream portstr; portstr << addr.port; - env["SERVER_PORT"] = CharacterVector(portstr.str()); + env["SERVER_PORT"] = portstr.str(); Address raddr = pRequest->clientAddress(); - env["REMOTE_ADDR"] = CharacterVector(raddr.host); + env["REMOTE_ADDR"] = raddr.host; std::ostringstream rportstr; rportstr << raddr.port; - env["REMOTE_PORT"] = CharacterVector(rportstr.str()); + env["REMOTE_PORT"] = rportstr.str(); - const RequestHeaders& headers = pRequest->headers(); - Rcpp::CharacterVector raw_headers(headers.size()); - Rcpp::CharacterVector raw_header_names(headers.size()); + const RequestHeaders &headers = pRequest->headers(); + writable::strings raw_headers(headers.size()); + writable::strings raw_header_names(headers.size()); - for (RequestHeaders::const_iterator it = headers.begin(); - it != headers.end(); - it++) { + for (RequestHeaders::const_iterator it = headers.begin(); it != headers.end(); + it++) { int idx = std::distance(headers.begin(), it); - env["HTTP_" + normalizeHeaderName(it->first)] = CharacterVector(it->second); + env["HTTP_" + normalizeHeaderName(it->first)] = it->second; raw_header_names[idx] = to_lower(it->first); raw_headers[idx] = it->second; } raw_headers.attr("names") = raw_header_names; env["HEADERS"] = raw_headers; - } - -std::shared_ptr listToResponse( - std::shared_ptr pRequest, - const Rcpp::List& response) -{ +std::shared_ptr +listToResponse(std::shared_ptr pRequest, const list &response) { ASSERT_MAIN_THREAD() - using namespace Rcpp; - if (response.isNULL() || response.size() == 0) { + if (Rf_isNull(response) || response.size() == 0) { return std::shared_ptr(); } - CharacterVector names = response.names(); + strings resp_names = response.names(); - int status = Rcpp::as(response["status"]); + int status = as_cpp(response["status"]); std::string statusDesc = getStatusDescription(status); - List responseHeaders = response["headers"]; - // Self-frees when response is written std::shared_ptr pDataSource; @@ -208,50 +189,49 @@ std::shared_ptr listToResponse( // // See https://tools.ietf.org/html/rfc7231#section-6.3.5 and // https://tools.ietf.org/html/rfc7232#section-4.1 - bool hasBody = response.containsElementNamed("body") && !Rf_isNull(response["body"]); + bool hasBody = response.contains("body") && !Rf_isNull(response["body"]); // The response can either contain: // - bodyFile: String value that names the file that should be streamed // - body: Character vector (which is charToRaw-ed) or raw vector, or NULL - if (std::find(names.begin(), names.end(), "bodyFile") != names.end()) { + if (std::find(resp_names.begin(), resp_names.end(), "bodyFile") != + resp_names.end()) { std::shared_ptr pFDS = std::make_shared(); - FileDataSourceResult ret = pFDS->initialize( - Rcpp::as(response["bodyFile"]), - Rcpp::as(response["bodyFileOwned"]) - ); + FileDataSourceResult ret = + pFDS->initialize(as_cpp(response["bodyFile"]), + as_cpp(response["bodyFileOwned"])); if (ret != FDS_OK) { REprintf("%s", pFDS->lastErrorMessage().c_str()); return error_response(pRequest, 500); } pDataSource = pFDS; - } - else if (hasBody && Rf_isString(response["body"])) { - RawVector responseBytes = Function("charToRaw")(response["body"]); - pDataSource = std::make_shared(responseBytes); - } - else if (hasBody) { - RawVector responseBytes = response["body"]; - pDataSource = std::make_shared(responseBytes); + } else if (hasBody && Rf_isString(response["body"])) { + raws responseBytes(package("base")["charToRaw"](response["body"])); + pDataSource = std::make_shared( + std::vector(responseBytes.begin(), responseBytes.end())); + } else if (hasBody) { + raws responseBytes(response["body"]); + pDataSource = std::make_shared( + std::vector(responseBytes.begin(), responseBytes.end())); } std::shared_ptr pResp( - new HttpResponse(pRequest, status, statusDesc, pDataSource), - auto_deleter_background - ); - CharacterVector headerNames = responseHeaders.names(); - for (R_len_t i = 0; i < responseHeaders.size(); i++) { - pResp->addHeader( - std::string((char*)headerNames[i], headerNames[i].size()), - Rcpp::as(responseHeaders[i])); + new HttpResponse(pRequest, status, statusDesc, pDataSource), + auto_deleter_background); + if (response.contains("headers") && !Rf_isNull(response["headers"])) { + list responseHeaders(response["headers"]); + strings headerNames = responseHeaders.names(); + for (R_len_t i = 0; i < responseHeaders.size(); i++) { + pResp->addHeader(std::string(headerNames[i]), + as_cpp(responseHeaders[i])); + } } return pResp; } void invokeResponseFun(std::function)> fun, - std::shared_ptr pRequest, - Rcpp::List response) -{ + std::shared_ptr pRequest, list response) { ASSERT_MAIN_THREAD() // new HttpResponse object. The callback will invoke // HttpResponse->writeResponse(). @@ -259,46 +239,40 @@ void invokeResponseFun(std::function)> fun, fun(pResponse); } - // ============================================================================ // Methods // ============================================================================ -RWebApplication::RWebApplication( - Rcpp::Function onHeaders, - Rcpp::Function onBodyData, - Rcpp::Function onRequest, - Rcpp::Function onWSOpen, - Rcpp::Function onWSMessage, - Rcpp::Function onWSClose, - Rcpp::List staticPaths, - Rcpp::List staticPathOptions) : - _onHeaders(onHeaders), _onBodyData(onBodyData), _onRequest(onRequest), - _onWSOpen(onWSOpen), _onWSMessage(onWSMessage), _onWSClose(onWSClose) -{ +RWebApplication::RWebApplication(sexp onHeaders, function onBodyData, + function onRequest, function onWSOpen, + function onWSMessage, function onWSClose, + list staticPaths, list staticPathOptions) + : _onHeaders(onHeaders), _onBodyData(onBodyData), _onRequest(onRequest), + _onWSOpen(onWSOpen), _onWSMessage(onWSMessage), _onWSClose(onWSClose) { ASSERT_MAIN_THREAD() _staticPathManager = StaticPathManager(staticPaths, staticPathOptions); } - -void RWebApplication::onHeaders(std::shared_ptr pRequest, - std::function)> callback) -{ +void RWebApplication::onHeaders( + std::shared_ptr pRequest, + std::function)> callback) { ASSERT_MAIN_THREAD() - if (_onHeaders.isNULL()) { - std::shared_ptr null_ptr; - callback(null_ptr); - } requestToEnv(pRequest, &pRequest->env()); // Call the R onHeaders function. If an exception occurs during processing, // catch it and then send a generic error response. - Rcpp::List response; + list response; try { - response = _onHeaders(pRequest->env()); - } catch (Rcpp::internal::InterruptedException &e) { + sexp result(function(_onHeaders)(pRequest->env())); + if (Rf_isNull(result)) { + std::shared_ptr null_ptr; + callback(null_ptr); + return; + } + response = list(result); + } catch (unwind_exception &e) { debug_log("Interrupt occurred in _onHeaders", LOG_INFO); response = errorResponse(); } catch (...) { @@ -313,10 +287,10 @@ void RWebApplication::onHeaders(std::shared_ptr pRequest, callback(pResponse); } -void RWebApplication::onBodyData(std::shared_ptr pRequest, - std::shared_ptr > data, - std::function)> errorCallback) -{ +void RWebApplication::onBodyData( + std::shared_ptr pRequest, + std::shared_ptr> data, + std::function)> errorCallback) { ASSERT_MAIN_THREAD() debug_log("RWebApplication::onBodyData", LOG_DEBUG); @@ -325,15 +299,15 @@ void RWebApplication::onBodyData(std::shared_ptr pRequest, if (pRequest->isResponseScheduled()) return; - Rcpp::RawVector rawVector(data->size()); + writable::raws rawVector(data->size()); std::copy(data->begin(), data->end(), rawVector.begin()); try { _onBodyData(pRequest->env(), rawVector); } catch (...) { debug_log("Exception occurred in _onBodyData", LOG_INFO); - // Send an error message to the client. It's very possible that getResponse() or more - // calls to onBodyData() will have been scheduled on the main thread - // before the errorCallback is called. + // Send an error message to the client. It's very possible that + // getResponse() or more calls to onBodyData() will have been scheduled on + // the main thread before the errorCallback is called. // // Note that some (most?) clients won't correctly handle a response that's // sent early, before the request is completed. @@ -342,27 +316,26 @@ void RWebApplication::onBodyData(std::shared_ptr pRequest, } } -void RWebApplication::getResponse(std::shared_ptr pRequest, - std::function)> callback) { +void RWebApplication::getResponse( + std::shared_ptr pRequest, + std::function)> callback) { ASSERT_MAIN_THREAD() debug_log("RWebApplication::getResponse", LOG_DEBUG); - using namespace Rcpp; // Pass callback to R: // invokeResponseFun(callback, pRequest, _1) - std::function* callback_wrapper = new std::function( - std::bind(invokeResponseFun, callback, pRequest, std::placeholders::_1) - ); + std::function *callback_wrapper = new std::function( + std::bind(invokeResponseFun, callback, pRequest, std::placeholders::_1)); - SEXP callback_xptr = PROTECT(R_MakeExternalPtr(callback_wrapper, R_NilValue, R_NilValue)); + SEXP callback_xptr = + PROTECT(R_MakeExternalPtr(callback_wrapper, R_NilValue, R_NilValue)); // We previously encountered an error processing the body. Don't call into // the R call/_onRequest() function. We need to signal the HttpRequest // object to let it know that we had an error. if (pRequest->isResponseScheduled()) { - invokeCppCallback(Rcpp::List(), callback_xptr); - } - else { + invokeCppCallback(SEXP(list()), callback_xptr); + } else { // Call the R call() function, and pass it the callback xptr so it can // asynchronously pass data back to C++. @@ -372,15 +345,15 @@ void RWebApplication::getResponse(std::shared_ptr pRequest, // On the R side, httpuv's call() function will catch errors that happen // in the user-defined call() function, but if an error happens outside of // that scope, or if another uncaught exception happens (like an interrupt - // if Ctrl-C is pressed), then it will bubble up to here, where we'll catch - // it and deal with it. + // if Ctrl-C is pressed), then it will bubble up to here, where we'll + // catch it and deal with it. - } catch (Rcpp::internal::InterruptedException &e) { + } catch (unwind_exception &e) { debug_log("Interrupt occurred in _onRequest", LOG_INFO); - invokeCppCallback(errorResponse(), callback_xptr); + invokeCppCallback(SEXP(errorResponse()), callback_xptr); } catch (...) { debug_log("Exception occurred in _onRequest", LOG_INFO); - invokeCppCallback(errorResponse(), callback_xptr); + invokeCppCallback(SEXP(errorResponse()), callback_xptr); } } @@ -397,35 +370,25 @@ void RWebApplication::onWSOpen(std::shared_ptr pRequest, requestToEnv(pRequest, &pRequest->env()); try { - _onWSOpen( - externalize_shared_ptr(pConn), - pRequest->env() - ); - } catch(...) { + _onWSOpen(externalize_shared_ptr(pConn), pRequest->env()); + } catch (...) { error_callback(); } } void RWebApplication::onWSMessage(std::shared_ptr pConn, bool binary, - std::shared_ptr > data, - std::function error_callback) -{ + std::shared_ptr> data, + std::function error_callback) { ASSERT_MAIN_THREAD() try { if (binary) - _onWSMessage( - externalize_shared_ptr(pConn), - binary, - std::vector(data->begin(), data->end()) - ); + _onWSMessage(externalize_shared_ptr(pConn), binary, + std::vector(data->begin(), data->end())); else - _onWSMessage( - externalize_shared_ptr(pConn), - binary, - std::string(data->begin(), data->end()) - ); - } catch(...) { + _onWSMessage(externalize_shared_ptr(pConn), binary, + std::string(data->begin(), data->end())); + } catch (...) { error_callback(); } } @@ -435,7 +398,6 @@ void RWebApplication::onWSClose(std::shared_ptr pConn) { _onWSClose(externalize_shared_ptr(pConn)); } - // ============================================================================ // Static file serving // ============================================================================ @@ -443,9 +405,8 @@ void RWebApplication::onWSClose(std::shared_ptr pConn) { // Unlike most of the methods for an RWebApplication, these ones are called on // the background thread. -std::shared_ptr RWebApplication::staticFileResponse( - std::shared_ptr pRequest -) { +std::shared_ptr +RWebApplication::staticFileResponse(std::shared_ptr pRequest) { ASSERT_BACKGROUND_THREAD() // If there's any Upgrade header, don't try to serve a static file. Just @@ -455,11 +416,12 @@ std::shared_ptr RWebApplication::staticFileResponse( } // Strip off query string - std::pair url_query = splitQueryString(pRequest->url()); + std::pair url_query = + splitQueryString(pRequest->url()); std::string url_path = doDecodeURI(url_query.first, true); std::experimental::optional> sp_pair = - _staticPathManager.matchStaticPath(url_path); + _staticPathManager.matchStaticPath(url_path); if (!sp_pair) { // This was not a static path. Fall through to the R code to handle this @@ -469,9 +431,9 @@ std::shared_ptr RWebApplication::staticFileResponse( // If we get here, we've matched a static path. - const StaticPath& sp = sp_pair->first; + const StaticPath &sp = sp_pair->first; // Note that the subpath may include leading dirs, as in "foo/bar/abc.txt". - const std::string& subpath = sp_pair->second; + const std::string &subpath = sp_pair->second; // This is an excluded path if (*sp.options.exclude) { @@ -490,8 +452,9 @@ std::shared_ptr RWebApplication::staticFileResponse( } // Make sure that there's no message body. - if ((pRequest->hasHeader("Content-Length") && pRequest->getHeader("Content-Length") != "0") - || pRequest->hasHeader("Transfer-Encoding")) { + if ((pRequest->hasHeader("Content-Length") && + pRequest->getHeader("Content-Length") != "0") || + pRequest->hasHeader("Transfer-Encoding")) { return error_response(pRequest, 400); } @@ -501,8 +464,8 @@ std::shared_ptr RWebApplication::staticFileResponse( // at the end of the URL, as in "/foo/..". Paths like "/foo../" or "/..foo/" // are OK. if (url_path.find("/../") != std::string::npos || - (url_path.length() >= 3 && url_path.substr(url_path.length()-3, 3) == "/..") - ) { + (url_path.length() >= 3 && + url_path.substr(url_path.length() - 3, 3) == "/..")) { if (*sp.options.fallthrough) { return std::shared_ptr(); } else { @@ -522,7 +485,8 @@ std::shared_ptr RWebApplication::staticFileResponse( } } - std::shared_ptr pDataSource = std::make_shared(); + std::shared_ptr pDataSource = + std::make_shared(); FileDataSourceResult ret = pDataSource->initialize(local_path, false); if (ret != FDS_OK) { @@ -540,7 +504,8 @@ std::shared_ptr RWebApplication::staticFileResponse( // Use local_path instead of subpath, because if the subpath is "/foo/" and // *(sp.options.indexhtml) is true, then the local_path will be // "/foo/index.html". We need to use the latter to determine mime type. - std::string content_type = find_mime_type(find_extension(basename(local_path))); + std::string content_type = + find_mime_type(find_extension(basename(local_path))); if (content_type == "") { content_type = "application/octet-stream"; } else if (content_type == "text/html") { @@ -555,7 +520,8 @@ std::shared_ptr RWebApplication::staticFileResponse( bool client_cache_is_valid = false; if (pRequest->hasHeader("If-Modified-Since")) { time_t file_mtime = pDataSource->getMtime(); - time_t if_mod_since = parse_http_date_string(pRequest->getHeader("If-Modified-Since")); + time_t if_mod_since = + parse_http_date_string(pRequest->getHeader("If-Modified-Since")); if (file_mtime != 0 && if_mod_since != 0 && file_mtime <= if_mod_since) { client_cache_is_valid = true; @@ -585,14 +551,14 @@ std::shared_ptr RWebApplication::staticFileResponse( } std::shared_ptr pResponse = std::shared_ptr( - new HttpResponse(pRequest, status_code, getStatusDescription(status_code), pDataSource2), - auto_deleter_background - ); + new HttpResponse(pRequest, status_code, getStatusDescription(status_code), + pDataSource2), + auto_deleter_background); - ResponseHeaders& respHeaders = pResponse->headers(); + ResponseHeaders &respHeaders = pResponse->headers(); // Add extra user-specified headers. - const ResponseHeaders& extraRespHeaders = *sp.options.headers; + const ResponseHeaders &extraRespHeaders = *sp.options.headers; if (extraRespHeaders.size() != 0) { ResponseHeaders::const_iterator it; for (it = extraRespHeaders.begin(); it != extraRespHeaders.end(); it++) { @@ -601,8 +567,8 @@ std::shared_ptr RWebApplication::staticFileResponse( // https://tools.ietf.org/html/rfc7232#section-4.1 // (Date is automatically added in the HttpResponse.) if (it->first == "Cache-Control" || it->first == "Content-Location" || - it->first == "ETag" || it->first == "Expires" || it->first == "Vary") - { + it->first == "ETag" || it->first == "Expires" || + it->first == "Vary") { respHeaders.push_back(*it); } @@ -618,14 +584,16 @@ std::shared_ptr RWebApplication::staticFileResponse( // it. If we didn't set it here, the response for the GET would // automatically set the Content-Length (by using the FileDataSource), but // the response for the HEAD would not. - respHeaders.push_back(std::make_pair("Content-Length", toString(pDataSource->size()))); + respHeaders.push_back( + std::make_pair("Content-Length", toString(pDataSource->size()))); respHeaders.push_back(std::make_pair("Content-Type", content_type)); - respHeaders.push_back(std::make_pair("Last-Modified", http_date_string(pDataSource->getMtime()))); + respHeaders.push_back(std::make_pair( + "Last-Modified", http_date_string(pDataSource->getMtime()))); } return pResponse; } -StaticPathManager& RWebApplication::getStaticPathManager() { +StaticPathManager &RWebApplication::getStaticPathManager() { return _staticPathManager; } diff --git a/src/webapplication.h b/src/webapplication.h index 51e4f262b..cdba1c2f7 100644 --- a/src/webapplication.h +++ b/src/webapplication.h @@ -1,12 +1,15 @@ #ifndef WEBAPPLICATION_HPP #define WEBAPPLICATION_HPP +#include "staticpath.h" +#include "thread.h" +#include "websockets.h" #include #include -#include -#include "websockets.h" -#include "thread.h" -#include "staticpath.h" + +#include "cpp11.hpp" + +using namespace cpp11; class HttpRequest; class HttpResponse; @@ -14,71 +17,66 @@ class HttpResponse; class WebApplication { public: virtual ~WebApplication() {} - virtual void onHeaders(std::shared_ptr pRequest, - std::function)> callback) = 0; - virtual void onBodyData(std::shared_ptr pRequest, - std::shared_ptr > data, - std::function)> errorCallback) = 0; - virtual void getResponse(std::shared_ptr request, - std::function)> callback) = 0; + virtual void + onHeaders(std::shared_ptr pRequest, + std::function)> callback) = 0; + virtual void onBodyData( + std::shared_ptr pRequest, + std::shared_ptr> data, + std::function)> errorCallback) = 0; + virtual void + getResponse(std::shared_ptr request, + std::function)> callback) = 0; virtual void onWSOpen(std::shared_ptr pRequest, std::function error_callback) = 0; - virtual void onWSMessage(std::shared_ptr, - bool binary, - std::shared_ptr > data, + virtual void onWSMessage(std::shared_ptr, bool binary, + std::shared_ptr> data, std::function error_callback) = 0; virtual void onWSClose(std::shared_ptr) = 0; - virtual std::shared_ptr staticFileResponse( - std::shared_ptr pRequest) = 0; - virtual StaticPathManager& getStaticPathManager() = 0; + virtual std::shared_ptr + staticFileResponse(std::shared_ptr pRequest) = 0; + virtual StaticPathManager &getStaticPathManager() = 0; }; - class RWebApplication : public WebApplication { private: - Rcpp::Function _onHeaders; - Rcpp::Function _onBodyData; - Rcpp::Function _onRequest; - Rcpp::Function _onWSOpen; - Rcpp::Function _onWSMessage; - Rcpp::Function _onWSClose; + sexp _onHeaders; + function _onBodyData; + function _onRequest; + function _onWSOpen; + function _onWSMessage; + function _onWSClose; StaticPathManager _staticPathManager; public: - RWebApplication(Rcpp::Function onHeaders, - Rcpp::Function onBodyData, - Rcpp::Function onRequest, - Rcpp::Function onWSOpen, - Rcpp::Function onWSMessage, - Rcpp::Function onWSClose, - Rcpp::List staticPaths, - Rcpp::List staticPathOptions); + RWebApplication(sexp onHeaders, function onBodyData, function onRequest, + function onWSOpen, function onWSMessage, function onWSClose, + list staticPaths, list staticPathOptions); - virtual ~RWebApplication() { - ASSERT_MAIN_THREAD() - } + virtual ~RWebApplication() { ASSERT_MAIN_THREAD() } - virtual void onHeaders(std::shared_ptr pRequest, - std::function)> callback); - virtual void onBodyData(std::shared_ptr pRequest, - std::shared_ptr > data, - std::function)> errorCallback); - virtual void getResponse(std::shared_ptr request, - std::function)> callback); + virtual void + onHeaders(std::shared_ptr pRequest, + std::function)> callback); + virtual void + onBodyData(std::shared_ptr pRequest, + std::shared_ptr> data, + std::function)> errorCallback); + virtual void + getResponse(std::shared_ptr request, + std::function)> callback); virtual void onWSOpen(std::shared_ptr pRequest, std::function error_callback); virtual void onWSMessage(std::shared_ptr conn, - bool binary, - std::shared_ptr > data, + bool binary, std::shared_ptr> data, std::function error_callback); virtual void onWSClose(std::shared_ptr conn); - virtual std::shared_ptr staticFileResponse( - std::shared_ptr pRequest); - virtual StaticPathManager& getStaticPathManager(); + virtual std::shared_ptr + staticFileResponse(std::shared_ptr pRequest); + virtual StaticPathManager &getStaticPathManager(); }; - #endif // WEBAPPLICATION_HPP diff --git a/src/websockets-base.cpp b/src/websockets-base.cpp index 29b92288a..9563b8b96 100644 --- a/src/websockets-base.cpp +++ b/src/websockets-base.cpp @@ -1,13 +1,13 @@ -#include #include "websockets-base.h" +#include bool isBigEndian() { uint32_t i = 1; - return *((uint8_t*)&i) == 0; + return *((uint8_t *)&i) == 0; } // Swaps the byte range [pStart, pEnd) -void swapByteOrder(unsigned char* pStart, unsigned char* pEnd) { +void swapByteOrder(unsigned char *pStart, unsigned char *pEnd) { // Easier for callers to use exclusive end but easier to implement // using inclusive end pEnd--; @@ -24,31 +24,29 @@ void swapByteOrder(unsigned char* pStart, unsigned char* pEnd) { } } -void WebSocketProto::createFrameHeader( - Opcode opcode, bool mask, size_t payloadSize, int32_t maskingKey, - char pData[MAX_HEADER_BYTES], size_t* pLen) const { +void WebSocketProto::createFrameHeader(Opcode opcode, bool mask, + size_t payloadSize, int32_t maskingKey, + char pData[MAX_HEADER_BYTES], + size_t *pLen) const { - unsigned char* pBuf = (unsigned char*)pData; - unsigned char* pMaskingKey = pBuf + 2; + unsigned char *pBuf = (unsigned char *)pData; + unsigned char *pMaskingKey = pBuf + 2; // Need to copy from a 64-bit chunk of memory, but size_t may be smaller. uint64_t payloadSize_64 = payloadSize; - pBuf[0] = - toFin(true) << 7 | // FIN; always true - encodeOpcode(opcode); + pBuf[0] = toFin(true) << 7 | // FIN; always true + encodeOpcode(opcode); pBuf[1] = mask ? 1 << 7 : 0; if (payloadSize_64 <= 125) { pBuf[1] |= payloadSize_64; pMaskingKey = pBuf + 2; - } - else if (payloadSize_64 <= 65535) {// 2^16-1 + } else if (payloadSize_64 <= 65535) { // 2^16-1 pBuf[1] |= 126; memcpy(pBuf + 2, &payloadSize_64, sizeof(uint16_t)); if (!isBigEndian()) swapByteOrder(pBuf + 2, pBuf + 4); pMaskingKey = pBuf + 4; - } - else { + } else { pBuf[1] |= 127; memcpy(pBuf + 2, &payloadSize_64, sizeof(uint64_t)); if (!isBigEndian()) diff --git a/src/websockets-base.h b/src/websockets-base.h index 8781f5f38..b993caf97 100644 --- a/src/websockets-base.h +++ b/src/websockets-base.h @@ -12,21 +12,20 @@ class WebSocketProto { virtual ~WebSocketProto() {} // Return true if the request uses this protocol version and is valid - virtual bool canHandle(const RequestHeaders& requestHeaders, - const char* pData, size_t len) const = 0; + virtual bool canHandle(const RequestHeaders &requestHeaders, + const char *pData, size_t len) const = 0; // Populate response headers with the appropriate values. This call // must not fail, but it will not be called unless canHandle returned // true previously, so any validation should be done in canHandle. - virtual void handshake(const std::string& url, - const RequestHeaders& requestHeaders, - char** ppData, size_t* pLen, - ResponseHeaders* responseHeaders, - std::vector* pResponse) const = 0; + virtual void handshake(const std::string &url, + const RequestHeaders &requestHeaders, char **ppData, + size_t *pLen, ResponseHeaders *responseHeaders, + std::vector *pResponse) const = 0; void createFrameHeader(Opcode opcode, bool mask, size_t payloadSize, - int32_t maskingKey, - char pData[MAX_HEADER_BYTES], size_t* pLen) const; + int32_t maskingKey, char pData[MAX_HEADER_BYTES], + size_t *pLen) const; virtual bool isFin(uint8_t firstBit) const = 0; virtual uint8_t toFin(bool isFin) const = 0; @@ -36,6 +35,6 @@ class WebSocketProto { bool isBigEndian(); // Swaps the byte range [pStart, pEnd) -void swapByteOrder(unsigned char* pStart, unsigned char* pEnd); +void swapByteOrder(unsigned char *pStart, unsigned char *pEnd); #endif // WEBSOCKETS_BASE_H diff --git a/src/websockets-hixie76.cpp b/src/websockets-hixie76.cpp index 5d0b9d832..0e3f19aa5 100644 --- a/src/websockets-hixie76.cpp +++ b/src/websockets-hixie76.cpp @@ -1,20 +1,19 @@ #include "websockets-hixie76.h" #include -void WSHixie76Parser::handshake(const std::string& url, - const RequestHeaders& requestHeaders, - char** ppData, size_t* pLen, - ResponseHeaders* responseHeaders, - std::vector* pResponse) const { +void WSHixie76Parser::handshake(const std::string &url, + const RequestHeaders &requestHeaders, + char **ppData, size_t *pLen, + ResponseHeaders *responseHeaders, + std::vector *pResponse) const { _hybi03.handshake(url, requestHeaders, ppData, pLen, responseHeaders, pResponse); } void WSHixie76Parser::createFrameHeaderFooter( - Opcode opcode, bool mask, size_t payloadSize, - int32_t maskingKey, - char pHeaderData[MAX_HEADER_BYTES], size_t* pHeaderLen, - char pFooterData[MAX_FOOTER_BYTES], size_t* pFooterLen) const { + Opcode opcode, bool mask, size_t payloadSize, int32_t maskingKey, + char pHeaderData[MAX_HEADER_BYTES], size_t *pHeaderLen, + char pFooterData[MAX_FOOTER_BYTES], size_t *pFooterLen) const { pHeaderData[0] = 0; *pHeaderLen = 1; @@ -23,10 +22,10 @@ void WSHixie76Parser::createFrameHeaderFooter( } #include -void WSHixie76Parser::read(const char* data, size_t len) { +void WSHixie76Parser::read(const char *data, size_t len) { if (len == 0) return; - for (const char* pos = data; pos < data + len; pos++) { + for (const char *pos = data; pos < data + len; pos++) { uint8_t b = *pos; if (_state == H76_START) { @@ -51,7 +50,7 @@ void WSHixie76Parser::read(const char* data, size_t len) { } else if (_state == H76_IN_TEXT_FRAME) { - const char* endMarker = pos; + const char *endMarker = pos; while (endMarker < (data + len) && *endMarker != (char)0xFF) { endMarker++; } diff --git a/src/websockets-hixie76.h b/src/websockets-hixie76.h index c8cbb0e98..b57a15031 100644 --- a/src/websockets-hixie76.h +++ b/src/websockets-hixie76.h @@ -1,8 +1,8 @@ #ifndef WEBSOCKETS_HIXIE76_H #define WEBSOCKETS_HIXIE76_H -#include "websockets.h" #include "websockets-hybi03.h" +#include "websockets.h" enum Hixie76State { // Starting state, also what we return to after finishing a frame @@ -23,31 +23,28 @@ enum Hixie76State { class WSHixie76Parser : public WSParser { private: - WSParserCallbacks* _pCallbacks; + WSParserCallbacks *_pCallbacks; WebSocketProto_HyBi03 _hybi03; int _state; size_t _bytesLeft; public: - WSHixie76Parser(WSParserCallbacks* pCallbacks) : - _pCallbacks(pCallbacks), _state(H76_START) { - } + WSHixie76Parser(WSParserCallbacks *pCallbacks) + : _pCallbacks(pCallbacks), _state(H76_START) {} ~WSHixie76Parser() {} - void handshake(const std::string& url, - const RequestHeaders& requestHeaders, - char** ppData, size_t* pLen, - ResponseHeaders* responseHeaders, - std::vector* pResponse) const; + void handshake(const std::string &url, const RequestHeaders &requestHeaders, + char **ppData, size_t *pLen, ResponseHeaders *responseHeaders, + std::vector *pResponse) const; - void createFrameHeaderFooter( - Opcode opcode, bool mask, size_t payloadSize, - int32_t maskingKey, - char pHeaderData[MAX_HEADER_BYTES], size_t* pHeaderLen, - char pFooterData[MAX_FOOTER_BYTES], size_t* pFooterLen - ) const; + void createFrameHeaderFooter(Opcode opcode, bool mask, size_t payloadSize, + int32_t maskingKey, + char pHeaderData[MAX_HEADER_BYTES], + size_t *pHeaderLen, + char pFooterData[MAX_FOOTER_BYTES], + size_t *pFooterLen) const; - void read(const char* data, size_t len); + void read(const char *data, size_t len); }; #endif // WEBSOCKETS_HIXIE76_H diff --git a/src/websockets-hybi03.cpp b/src/websockets-hybi03.cpp index c579e25ca..a09bd3e3f 100644 --- a/src/websockets-hybi03.cpp +++ b/src/websockets-hybi03.cpp @@ -9,15 +9,14 @@ extern "C" { #include "utils.h" -bool calculateKeyValue(const std::string& key, uint32_t* pResult = NULL) { +bool calculateKeyValue(const std::string &key, uint32_t *pResult = NULL) { std::string trimmed = trim(key); uint32_t value = 0; uint32_t spaces = 0; - for (std::string::const_iterator it = trimmed.begin(); - it != trimmed.end(); + for (std::string::const_iterator it = trimmed.begin(); it != trimmed.end(); it++) { if (*it == ' ') - spaces ++; + spaces++; else if (*it >= '0' && *it <= '9') { value *= 10; value += *it - '0'; @@ -30,8 +29,8 @@ bool calculateKeyValue(const std::string& key, uint32_t* pResult = NULL) { return true; } -bool WebSocketProto_HyBi03::canHandle(const RequestHeaders& requestHeaders, - const char* pData, size_t len) const { +bool WebSocketProto_HyBi03::canHandle(const RequestHeaders &requestHeaders, + const char *pData, size_t len) const { if (len != 8) return false; @@ -50,11 +49,11 @@ bool WebSocketProto_HyBi03::canHandle(const RequestHeaders& requestHeaders, strcasecmp(requestHeaders.at("upgrade").c_str(), "websocket") == 0; } -void WebSocketProto_HyBi03::handshake(const std::string& url, - const RequestHeaders& requestHeaders, - char** ppData, size_t* pLen, - ResponseHeaders* pResponseHeaders, - std::vector* pResponse) const { +void WebSocketProto_HyBi03::handshake(const std::string &url, + const RequestHeaders &requestHeaders, + char **ppData, size_t *pLen, + ResponseHeaders *pResponseHeaders, + std::vector *pResponse) const { assert(*pLen >= 8); @@ -63,8 +62,8 @@ void WebSocketProto_HyBi03::handshake(const std::string& url, calculateKeyValue(requestHeaders.at("sec-websocket-key2"), &key2); uint8_t handshake[16]; - *reinterpret_cast(handshake) = key1; - *reinterpret_cast(handshake + 4) = key2; + *reinterpret_cast(handshake) = key1; + *reinterpret_cast(handshake + 4) = key2; if (!isBigEndian()) { swapByteOrder(handshake, handshake + 4); swapByteOrder(handshake + 4, handshake + 8); @@ -94,38 +93,51 @@ void WebSocketProto_HyBi03::handshake(const std::string& url, pResponseHeaders->push_back(std::make_pair("Connection", "Upgrade")); pResponseHeaders->push_back(std::make_pair("Upgrade", "WebSocket")); pResponseHeaders->push_back(std::make_pair("Sec-WebSocket-Origin", origin)); - pResponseHeaders->push_back(std::make_pair("Sec-WebSocket-Location", location)); + pResponseHeaders->push_back( + std::make_pair("Sec-WebSocket-Location", location)); } bool WebSocketProto_HyBi03::isFin(uint8_t firstBit) const { return firstBit == 0; } -uint8_t WebSocketProto_HyBi03::toFin(bool isFin) const { - return isFin ? 0 : 1; -} +uint8_t WebSocketProto_HyBi03::toFin(bool isFin) const { return isFin ? 0 : 1; } Opcode WebSocketProto_HyBi03::decodeOpcode(uint8_t rawCode) const { switch (rawCode) { - case 0: return Continuation; - case 1: return Close; - case 2: return Ping; - case 3: return Pong; - case 4: return Text; - case 5: return Binary; - default: return Reserved; + case 0: + return Continuation; + case 1: + return Close; + case 2: + return Ping; + case 3: + return Pong; + case 4: + return Text; + case 5: + return Binary; + default: + return Reserved; } } uint8_t WebSocketProto_HyBi03::encodeOpcode(Opcode opcode) const { switch (opcode) { - case Continuation: return 0; - case Close: return 1; - case Ping: return 2; - case Pong: return 3; - case Text: return 4; - case Binary: return 5; + case Continuation: + return 0; + case Close: + return 1; + case Ping: + return 2; + case Pong: + return 3; + case Text: + return 4; + case Binary: + return 5; case Reserved: - default: return 6; // not expected + default: + return 6; // not expected } } diff --git a/src/websockets-hybi03.h b/src/websockets-hybi03.h index 3cc301aee..11d456f7d 100644 --- a/src/websockets-hybi03.h +++ b/src/websockets-hybi03.h @@ -9,18 +9,16 @@ class WebSocketProto_HyBi03 : public WebSocketProto { WebSocketProto_HyBi03() {} virtual ~WebSocketProto_HyBi03() {} - bool canHandle(const RequestHeaders& requestHeaders, - const char* pData, size_t len) const; + bool canHandle(const RequestHeaders &requestHeaders, const char *pData, + size_t len) const; - void handshake(const std::string& url, - const RequestHeaders& requestHeaders, - char** ppData, size_t* pLen, - ResponseHeaders* pResponseHeaders, - std::vector* pResponse) const; + void handshake(const std::string &url, const RequestHeaders &requestHeaders, + char **ppData, size_t *pLen, ResponseHeaders *pResponseHeaders, + std::vector *pResponse) const; void createFrameHeader(Opcode opcode, bool mask, size_t payloadSize, - int32_t maskingKey, - char pData[MAX_HEADER_BYTES], size_t* pLen) const; + int32_t maskingKey, char pData[MAX_HEADER_BYTES], + size_t *pLen) const; bool isFin(uint8_t firstBit) const; uint8_t toFin(bool isFin) const; diff --git a/src/websockets-ietf.cpp b/src/websockets-ietf.cpp index f97101c3f..dcbef6777 100644 --- a/src/websockets-ietf.cpp +++ b/src/websockets-ietf.cpp @@ -2,29 +2,29 @@ #include "utils.h" -#include "sha1/sha1.h" #include "base64/base64.hpp" +#include "sha1/sha1.h" -bool WebSocketProto_IETF::canHandle(const RequestHeaders& requestHeaders, - const char* pData, size_t len) const { +bool WebSocketProto_IETF::canHandle(const RequestHeaders &requestHeaders, + const char *pData, size_t len) const { return requestHeaders.find("upgrade") != requestHeaders.end() && strcasecmp(requestHeaders.at("upgrade").c_str(), "websocket") == 0 && requestHeaders.find("sec-websocket-key") != requestHeaders.end(); } -void WebSocketProto_IETF::handshake(const std::string& url, - const RequestHeaders& requestHeaders, - char** ppData, size_t* pLen, - ResponseHeaders* pResponseHeaders, - std::vector* pResponse) const { +void WebSocketProto_IETF::handshake(const std::string &url, + const RequestHeaders &requestHeaders, + char **ppData, size_t *pLen, + ResponseHeaders *pResponseHeaders, + std::vector *pResponse) const { std::string key = requestHeaders.at("sec-websocket-key"); std::string clear = trim(key) + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; SHA1_CTX ctx; reid_SHA1_Init(&ctx); - reid_SHA1_Update(&ctx, (const uint8_t*)safe_str_addr(clear), clear.size()); + reid_SHA1_Update(&ctx, (const uint8_t *)safe_str_addr(clear), clear.size()); std::vector digest(SHA1_DIGEST_SIZE); reid_SHA1_Final(&ctx, safe_vec_addr(digest)); @@ -32,43 +32,57 @@ void WebSocketProto_IETF::handshake(const std::string& url, std::string response = b64encode(digest.begin(), digest.end()); pResponseHeaders->push_back( - std::pair("Connection", "Upgrade")); + std::pair("Connection", "Upgrade")); pResponseHeaders->push_back( - std::pair("Upgrade", "websocket")); + std::pair("Upgrade", "websocket")); pResponseHeaders->push_back( - std::pair("Sec-WebSocket-Accept", response)); + std::pair("Sec-WebSocket-Accept", response)); } bool WebSocketProto_IETF::isFin(uint8_t firstBit) const { return firstBit != 0; } -uint8_t WebSocketProto_IETF::toFin(bool isFin) const { - return isFin ? 1 : 0; -} +uint8_t WebSocketProto_IETF::toFin(bool isFin) const { return isFin ? 1 : 0; } Opcode WebSocketProto_IETF::decodeOpcode(uint8_t rawCode) const { switch (rawCode) { - case 0: return Continuation; - case 1: return Text; - case 2: return Binary; - case 8: return Close; - case 9: return Ping; - case 0xA: return Pong; - case 0xF: return Reserved; - default: return Reserved; + case 0: + return Continuation; + case 1: + return Text; + case 2: + return Binary; + case 8: + return Close; + case 9: + return Ping; + case 0xA: + return Pong; + case 0xF: + return Reserved; + default: + return Reserved; } } uint8_t WebSocketProto_IETF::encodeOpcode(Opcode opcode) const { switch (opcode) { - case Continuation: return 0; - case Text: return 1; - case Binary: return 2; - case Close: return 8; - case Ping: return 9; - case Pong: return 0xA; - case Reserved: return 0xF; - default: return 0xF; // not expected + case Continuation: + return 0; + case Text: + return 1; + case Binary: + return 2; + case Close: + return 8; + case Ping: + return 9; + case Pong: + return 0xA; + case Reserved: + return 0xF; + default: + return 0xF; // not expected } } diff --git a/src/websockets-ietf.h b/src/websockets-ietf.h index dd166c7a3..407b48fde 100644 --- a/src/websockets-ietf.h +++ b/src/websockets-ietf.h @@ -9,14 +9,12 @@ class WebSocketProto_IETF : public WebSocketProto { WebSocketProto_IETF() {} virtual ~WebSocketProto_IETF() {} - bool canHandle(const RequestHeaders& requestHeaders, - const char* pData, size_t len) const; + bool canHandle(const RequestHeaders &requestHeaders, const char *pData, + size_t len) const; - void handshake(const std::string& url, - const RequestHeaders& requestHeaders, - char** ppData, size_t* pLen, - ResponseHeaders* responseHeaders, - std::vector* pResponse) const; + void handshake(const std::string &url, const RequestHeaders &requestHeaders, + char **ppData, size_t *pLen, ResponseHeaders *responseHeaders, + std::vector *pResponse) const; bool isFin(uint8_t firstBit) const; uint8_t toFin(bool isFin) const; diff --git a/src/websockets.cpp b/src/websockets.cpp index f5ece8f23..e4f31be99 100644 --- a/src/websockets.cpp +++ b/src/websockets.cpp @@ -1,26 +1,23 @@ #include "websockets.h" -#include "utils.h" #include "thread.h" +#include "utils.h" #include #include -#include #include +#include #include -#include "sha1/sha1.h" #include "base64/base64.hpp" +#include "sha1/sha1.h" -#include "websockets-ietf.h" -#include "websockets-hybi03.h" #include "websockets-hixie76.h" +#include "websockets-hybi03.h" +#include "websockets-ietf.h" -template -T min(T a, T b) { - return (a > b) ? b : a; -} +template T min(T a, T b) { return (a > b) ? b : a; } -std::string dumpbin(const char* data, size_t len) { +std::string dumpbin(const char *data, size_t len) { std::string output; for (size_t i = 0; i < len; i++) { char byte = data[i]; @@ -56,25 +53,21 @@ WSFrameHeaderInfo WSHyBiFrameHeader::info() const { return inf; } -bool WSHyBiFrameHeader::fin() const { - return _pProto->isFin(read(0, 1)); -} +bool WSHyBiFrameHeader::fin() const { return _pProto->isFin(read(0, 1)); } Opcode WSHyBiFrameHeader::opcode() const { uint8_t oc = read(4, 4); return _pProto->decodeOpcode(oc); } -bool WSHyBiFrameHeader::masked() const { - return read(8, 1) != 0; -} +bool WSHyBiFrameHeader::masked() const { return read(8, 1) != 0; } uint64_t WSHyBiFrameHeader::payloadLength() const { uint8_t pl = read(9, 7); switch (pl) { - case 126: - return read64(16, 16); - case 127: - return read64(16, 64); - default: - return pl; + case 126: + return read64(16, 16); + case 127: + return read64(16, 64); + default: + return pl; } } void WSHyBiFrameHeader::maskingKey(uint8_t key[4]) const { @@ -124,39 +117,37 @@ uint64_t WSHyBiFrameHeader::read64(size_t bitOffset, size_t bitWidth) const { uint8_t WSHyBiFrameHeader::payloadLengthLength() const { uint8_t pll = read(9, 7); switch (pll) { - case 126: - return 7 + 16; - case 127: - return 7 + 64; - default: - return 7; + case 126: + return 7 + 16; + case 127: + return 7 + 64; + default: + return 7; } } uint8_t WSHyBiFrameHeader::maskingKeyLength() const { return masked() ? 32 : 0; } -void WSHyBiParser::handshake(const std::string& url, - const RequestHeaders& requestHeaders, - char** ppData, size_t* pLen, - ResponseHeaders* pResponseHeaders, - std::vector* pResponse) const { +void WSHyBiParser::handshake(const std::string &url, + const RequestHeaders &requestHeaders, + char **ppData, size_t *pLen, + ResponseHeaders *pResponseHeaders, + std::vector *pResponse) const { ASSERT_BACKGROUND_THREAD() _pProto->handshake(url, requestHeaders, ppData, pLen, pResponseHeaders, pResponse); } void WSHyBiParser::createFrameHeaderFooter( - Opcode opcode, bool mask, size_t payloadSize, - int32_t maskingKey, - char pHeaderData[MAX_HEADER_BYTES], size_t* pHeaderLen, - char pFooterData[MAX_FOOTER_BYTES], size_t* pFooterLen - ) const { - _pProto->createFrameHeader(opcode, mask, payloadSize, maskingKey, - pHeaderData, pHeaderLen); + Opcode opcode, bool mask, size_t payloadSize, int32_t maskingKey, + char pHeaderData[MAX_HEADER_BYTES], size_t *pHeaderLen, + char pFooterData[MAX_FOOTER_BYTES], size_t *pFooterLen) const { + _pProto->createFrameHeader(opcode, mask, payloadSize, maskingKey, pHeaderData, + pHeaderLen); } -void WSHyBiParser::read(const char* data, size_t len) { +void WSHyBiParser::read(const char *data, size_t len) { ASSERT_BACKGROUND_THREAD() bool recur = false; while (len > 0 || recur) { @@ -164,58 +155,58 @@ void WSHyBiParser::read(const char* data, size_t len) { assert(len < 1000000000000000000); switch (_state) { - case InHeader: { - // The _header vector accumulates header data until - // the complete header is read. It's possible/likely it also - // holds part of the payload. - size_t startingSize = _header.size(); - std::copy(data, data + min(len, MAX_HEADER_BYTES - startingSize), - std::back_inserter(_header)); - - WSHyBiFrameHeader frame(_pProto, safe_vec_addr(_header), _header.size()); - - if (frame.isHeaderComplete()) { - _pCallbacks->onHeaderComplete(frame.info()); - - size_t payloadOffset = frame.headerLength() - startingSize; - _bytesLeft = frame.payloadLength(); - - // Header was consumed, but no payload - if (_bytesLeft == 0) recur = true; - - _state = InPayload; - _header.clear(); - - data += payloadOffset; - len -= payloadOffset; - } - else { - // All of the data was consumed, but no header - data += len; - len = 0; - } - break; + case InHeader: { + // The _header vector accumulates header data until + // the complete header is read. It's possible/likely it also + // holds part of the payload. + size_t startingSize = _header.size(); + std::copy(data, data + min(len, MAX_HEADER_BYTES - startingSize), + std::back_inserter(_header)); + + WSHyBiFrameHeader frame(_pProto, safe_vec_addr(_header), _header.size()); + + if (frame.isHeaderComplete()) { + _pCallbacks->onHeaderComplete(frame.info()); + + size_t payloadOffset = frame.headerLength() - startingSize; + _bytesLeft = frame.payloadLength(); + + // Header was consumed, but no payload + if (_bytesLeft == 0) + recur = true; + + _state = InPayload; + _header.clear(); + + data += payloadOffset; + len -= payloadOffset; + } else { + // All of the data was consumed, but no header + data += len; + len = 0; } - case InPayload: { - recur = false; + break; + } + case InPayload: { + recur = false; - size_t bytesToConsume = min((uint64_t)len, _bytesLeft); - _bytesLeft -= bytesToConsume; - _pCallbacks->onPayload(data, bytesToConsume); + size_t bytesToConsume = min((uint64_t)len, _bytesLeft); + _bytesLeft -= bytesToConsume; + _pCallbacks->onPayload(data, bytesToConsume); - data += bytesToConsume; - len -= bytesToConsume; + data += bytesToConsume; + len -= bytesToConsume; - if (_bytesLeft == 0) { - _pCallbacks->onFrameComplete(); + if (_bytesLeft == 0) { + _pCallbacks->onFrameComplete(); - _state = InHeader; - } - break; + _state = InHeader; } - default: - assert(false); - break; + break; + } + default: + assert(false); + break; } } } @@ -226,11 +217,12 @@ void WebSocketConnection::startPingTimer() { uv_timer_start(_pPingTimer, pingTimerCallback, 20000, 20000); } -bool WebSocketConnection::accept(const RequestHeaders& requestHeaders, - const char* pData, size_t len) { +bool WebSocketConnection::accept(const RequestHeaders &requestHeaders, + const char *pData, size_t len) { ASSERT_BACKGROUND_THREAD() assert(!_pParser); - if (_connState == WS_CLOSED) return false; + if (_connState == WS_CLOSED) + return false; WebSocketProto_IETF ietf; if (ietf.canHandle(requestHeaders, pData, len)) { @@ -248,22 +240,25 @@ bool WebSocketConnection::accept(const RequestHeaders& requestHeaders, return false; } -void WebSocketConnection::handshake(const std::string& url, - const RequestHeaders& requestHeaders, - char** ppData, size_t* pLen, - ResponseHeaders* pResponseHeaders, - std::vector* pResponse) { +void WebSocketConnection::handshake(const std::string &url, + const RequestHeaders &requestHeaders, + char **ppData, size_t *pLen, + ResponseHeaders *pResponseHeaders, + std::vector *pResponse) { ASSERT_BACKGROUND_THREAD() assert(_pParser); - if (_connState == WS_CLOSED) return; + if (_connState == WS_CLOSED) + return; _pParser->handshake(url, requestHeaders, ppData, pLen, pResponseHeaders, pResponse); } -void WebSocketConnection::sendWSMessage(Opcode opcode, const char* pData, size_t length) { +void WebSocketConnection::sendWSMessage(Opcode opcode, const char *pData, + size_t length) { ASSERT_BACKGROUND_THREAD() - if (_connState == WS_CLOSED) return; + if (_connState == WS_CLOSED) + return; std::vector header(MAX_HEADER_BYTES); std::vector footer(MAX_FOOTER_BYTES); @@ -272,13 +267,12 @@ void WebSocketConnection::sendWSMessage(Opcode opcode, const char* pData, size_t size_t footerLength = 0; _pParser->createFrameHeaderFooter(opcode, false, length, 0, - safe_vec_addr(header), &headerLength, - safe_vec_addr(footer), &footerLength); + safe_vec_addr(header), &headerLength, + safe_vec_addr(footer), &footerLength); header.resize(headerLength); footer.resize(footerLength); - _pCallbacks->sendWSFrame(safe_vec_addr(header), header.size(), - pData, length, + _pCallbacks->sendWSFrame(safe_vec_addr(header), header.size(), pData, length, safe_vec_addr(footer), footer.size()); } @@ -307,11 +301,12 @@ void WebSocketConnection::closeWS(uint16_t code, std::string reason) { } // Make sure code has right endian-ness - unsigned char* code_p = (unsigned char*)&code; + unsigned char *code_p = (unsigned char *)&code; if (!isBigEndian()) swapByteOrder(code_p, code_p + 2); - std::string message = std::string(reinterpret_cast(code_p), 2) + reason; + std::string message = + std::string(reinterpret_cast(code_p), 2) + reason; sendWSMessage(Close, message.c_str(), message.length()); @@ -320,9 +315,10 @@ void WebSocketConnection::closeWS(uint16_t code, std::string reason) { _pCallbacks->closeWSSocket(); } -void WebSocketConnection::read(const char* data, size_t len) { +void WebSocketConnection::read(const char *data, size_t len) { ASSERT_BACKGROUND_THREAD() - if (_connState == WS_CLOSED) return; + if (_connState == WS_CLOSED) + return; assert(_pParser); _pParser->read(data, len); } @@ -332,17 +328,19 @@ void WebSocketConnection::markClosed() { _connState = WS_CLOSED; } -void WebSocketConnection::onHeaderComplete(const WSFrameHeaderInfo& header) { +void WebSocketConnection::onHeaderComplete(const WSFrameHeaderInfo &header) { ASSERT_BACKGROUND_THREAD() - if (_connState == WS_CLOSED) return; + if (_connState == WS_CLOSED) + return; _header = header; if (!header.fin && header.opcode != Continuation) _incompleteContentHeader = header; } -void WebSocketConnection::onPayload(const char* data, size_t len) { +void WebSocketConnection::onPayload(const char *data, size_t len) { ASSERT_BACKGROUND_THREAD() - if (_connState == WS_CLOSED) return; + if (_connState == WS_CLOSED) + return; size_t origSize = _payload.size(); std::copy(data, data + len, std::back_inserter(_payload)); @@ -357,72 +355,76 @@ void WebSocketConnection::onPayload(const char* data, size_t len) { void WebSocketConnection::onFrameComplete() { ASSERT_BACKGROUND_THREAD() debug_log("WebSocketConnection::onFrameComplete", LOG_DEBUG); - if (_connState == WS_CLOSED) return; + if (_connState == WS_CLOSED) + return; if (!_header.fin) { std::copy(_payload.begin(), _payload.end(), - std::back_inserter(_incompleteContentPayload)); + std::back_inserter(_incompleteContentPayload)); } else { switch (_header.opcode) { - case Continuation: { - std::copy(_payload.begin(), _payload.end(), - std::back_inserter(_incompleteContentPayload)); - _pCallbacks->onWSMessage(_incompleteContentHeader.opcode == Binary, - safe_vec_addr(_incompleteContentPayload), _incompleteContentPayload.size()); - - _incompleteContentPayload.clear(); - break; - } - case Text: - case Binary: { - _pCallbacks->onWSMessage(_header.opcode == Binary, safe_vec_addr(_payload), _payload.size()); - break; - } - case Close: { + case Continuation: { + std::copy(_payload.begin(), _payload.end(), + std::back_inserter(_incompleteContentPayload)); + _pCallbacks->onWSMessage(_incompleteContentHeader.opcode == Binary, + safe_vec_addr(_incompleteContentPayload), + _incompleteContentPayload.size()); + + _incompleteContentPayload.clear(); + break; + } + case Text: + case Binary: { + _pCallbacks->onWSMessage(_header.opcode == Binary, + safe_vec_addr(_payload), _payload.size()); + break; + } + case Close: { - if (_connState == WS_OPEN) { - _connState = WS_CLOSE_RECEIVED; - } else if (_connState == WS_CLOSE_SENT) { - _connState = WS_CLOSED; - } + if (_connState == WS_OPEN) { + _connState = WS_CLOSE_RECEIVED; + } else if (_connState == WS_CLOSE_SENT) { + _connState = WS_CLOSED; + } - // If we haven't sent a Close frame before, send one now, echoing - // the callback - if (_connState != WS_CLOSE_SENT && _connState != WS_CLOSED) { - _connState = WS_CLOSED; - sendWSMessage(Close, safe_vec_addr(_payload), _payload.size()); - } + // If we haven't sent a Close frame before, send one now, echoing + // the callback + if (_connState != WS_CLOSE_SENT && _connState != WS_CLOSED) { + _connState = WS_CLOSED; + sendWSMessage(Close, safe_vec_addr(_payload), _payload.size()); + } - // TODO: Delay closeWSSocket call until close message is actually sent - _pCallbacks->closeWSSocket(); + // TODO: Delay closeWSSocket call until close message is actually sent + _pCallbacks->closeWSSocket(); - // TODO: Use code and status - _pCallbacks->onWSClose(0); + // TODO: Use code and status + _pCallbacks->onWSClose(0); - break; - } - case Ping: { - // Send back a pong - sendWSMessage(Pong, safe_vec_addr(_payload), _payload.size()); - break; - } - case Pong: { - // No action needed - break; - } - case Reserved: { - // TODO: Warn and close connection? - break; - } + break; + } + case Ping: { + // Send back a pong + sendWSMessage(Pong, safe_vec_addr(_payload), _payload.size()); + break; + } + case Pong: { + // No action needed + break; + } + case Reserved: { + // TODO: Warn and close connection? + break; + } } } _payload.clear(); } -void pingTimerCallback(uv_timer_t* pHandle) { +void pingTimerCallback(uv_timer_t *pHandle) { ASSERT_BACKGROUND_THREAD() - WebSocketConnection* c = reinterpret_cast(pHandle->data); + WebSocketConnection *c = + reinterpret_cast(pHandle->data); c->sendPing(); } diff --git a/src/websockets.h b/src/websockets.h index ce26ab685..270cfa7e3 100644 --- a/src/websockets.h +++ b/src/websockets.h @@ -1,18 +1,18 @@ #ifndef WEBSOCKETS_HPP #define WEBSOCKETS_HPP -#include #include +#include #include #include #include -#include "utils.h" -#include "thread.h" #include "constants.h" -#include "websockets-base.h" +#include "thread.h" +#include "utils.h" #include "uvutil.h" +#include "websockets-base.h" class WSFrameHeaderInfo { public: @@ -30,19 +30,17 @@ class WSFrameHeaderInfo { */ class WSHyBiFrameHeader { std::vector _data; - WebSocketProto* _pProto; + WebSocketProto *_pProto; public: - WSHyBiFrameHeader() : _data(MAX_HEADER_BYTES), _pProto(NULL) { - } + WSHyBiFrameHeader() : _data(MAX_HEADER_BYTES), _pProto(NULL) {} // The data is copied (up to 14 bytes worth) - WSHyBiFrameHeader(WebSocketProto* pProto, const char* data, size_t len) - : _data(data, data + (std::min(MAX_HEADER_BYTES, len))), _pProto(pProto) { + WSHyBiFrameHeader(WebSocketProto *pProto, const char *data, size_t len) + : _data(data, data + (std::min(MAX_HEADER_BYTES, len))), _pProto(pProto) { } - virtual ~WSHyBiFrameHeader() { - } + virtual ~WSHyBiFrameHeader() {} // IMPORTANT: Don't attempt to call any of the other methods // until isHeaderComplete is true!! @@ -54,7 +52,6 @@ class WSHyBiFrameHeader { size_t headerLength() const; private: - bool fin() const; Opcode opcode() const; bool masked() const; @@ -75,9 +72,9 @@ class WSHyBiFrameHeader { class WSParserCallbacks { public: - virtual void onHeaderComplete(const WSFrameHeaderInfo& header) = 0; + virtual void onHeaderComplete(const WSFrameHeaderInfo &header) = 0; // The data is copied - virtual void onPayload(const char* data, size_t len) = 0; + virtual void onPayload(const char *data, size_t len) = 0; virtual void onFrameComplete() = 0; }; @@ -88,56 +85,52 @@ class WSParser { // Populate response headers with the appropriate values. This call // must not fail, but it will not be called unless canHandle returned // true previously, so any validation should be done in canHandle. - virtual void handshake(const std::string& url, - const RequestHeaders& requestHeaders, - char** ppData, size_t* pLen, - ResponseHeaders* responseHeaders, - std::vector* pResponse) const = 0; - - virtual void createFrameHeaderFooter( - Opcode opcode, bool mask, size_t payloadSize, - int32_t maskingKey, - char pHeaderData[MAX_HEADER_BYTES], size_t* pHeaderLen, - char pFooterData[MAX_FOOTER_BYTES], size_t* pFooterLen - ) const = 0; - - virtual void read(const char* data, size_t len) = 0; + virtual void handshake(const std::string &url, + const RequestHeaders &requestHeaders, char **ppData, + size_t *pLen, ResponseHeaders *responseHeaders, + std::vector *pResponse) const = 0; + + virtual void createFrameHeaderFooter(Opcode opcode, bool mask, + size_t payloadSize, int32_t maskingKey, + char pHeaderData[MAX_HEADER_BYTES], + size_t *pHeaderLen, + char pFooterData[MAX_FOOTER_BYTES], + size_t *pFooterLen) const = 0; + + virtual void read(const char *data, size_t len) = 0; }; class WSHyBiParser : public WSParser { - WSParserCallbacks* _pCallbacks; - WebSocketProto* _pProto; + WSParserCallbacks *_pCallbacks; + WebSocketProto *_pProto; WSParseState _state; std::vector _header; uint64_t _bytesLeft; public: - WSHyBiParser(WSParserCallbacks* callbacks, WebSocketProto* pProto) - : _pCallbacks(callbacks), _pProto(pProto), _state(InHeader) { - } + WSHyBiParser(WSParserCallbacks *callbacks, WebSocketProto *pProto) + : _pCallbacks(callbacks), _pProto(pProto), _state(InHeader) {} virtual ~WSHyBiParser() { try { delete _pProto; - } catch(...) {} + } catch (...) { + } } - void handshake(const std::string& url, - const RequestHeaders& requestHeaders, - char** ppData, size_t* pLen, - ResponseHeaders* responseHeaders, - std::vector* pResponse) const; + void handshake(const std::string &url, const RequestHeaders &requestHeaders, + char **ppData, size_t *pLen, ResponseHeaders *responseHeaders, + std::vector *pResponse) const; - void createFrameHeaderFooter( - Opcode opcode, bool mask, size_t payloadSize, - int32_t maskingKey, - char pHeaderData[MAX_HEADER_BYTES], size_t* pHeaderLen, - char pFooterData[MAX_FOOTER_BYTES], size_t* pFooterLen - ) const; + void createFrameHeaderFooter(Opcode opcode, bool mask, size_t payloadSize, + int32_t maskingKey, + char pHeaderData[MAX_HEADER_BYTES], + size_t *pHeaderLen, + char pFooterData[MAX_FOOTER_BYTES], + size_t *pFooterLen) const; - void read(const char* data, size_t len); + void read(const char *data, size_t len); }; - enum WSConnState { WS_OPEN, WS_CLOSE_RECEIVED, @@ -151,40 +144,37 @@ enum WSConnState { class WebSocketConnectionCallbacks { public: - virtual void onWSMessage(bool binary, const char* data, size_t len) = 0; + virtual void onWSMessage(bool binary, const char *data, size_t len) = 0; virtual void onWSClose(int code) = 0; // Implementers MUST copy data - virtual void sendWSFrame(const char* headerData, size_t headerLength, - const char* pData, size_t dataLength, - const char* footerData, size_t footerLength) = 0; + virtual void sendWSFrame(const char *headerData, size_t headerLength, + const char *pData, size_t dataLength, + const char *footerData, size_t footerLength) = 0; virtual void closeWSSocket() = 0; }; void pingTimerCallback(uv_timer_t *handle); class WebSocketConnection : WSParserCallbacks, NoCopy { - uv_loop_t* _pLoop; + uv_loop_t *_pLoop; WSConnState _connState; std::shared_ptr _pCallbacks; - WSParser* _pParser; + WSParser *_pParser; WSFrameHeaderInfo _incompleteContentHeader; WSFrameHeaderInfo _header; std::vector _incompleteContentPayload; std::vector _payload; - uv_timer_t* _pPingTimer; + uv_timer_t *_pPingTimer; public: - WebSocketConnection( - uv_loop_t* pLoop, - std::shared_ptr callbacks) - : _pLoop(pLoop), - _connState(WS_OPEN), - _pCallbacks(callbacks), + WebSocketConnection(uv_loop_t *pLoop, + std::shared_ptr callbacks) + : _pLoop(pLoop), _connState(WS_OPEN), _pCallbacks(callbacks), _pParser(NULL) { ASSERT_BACKGROUND_THREAD() debug_log("WebSocketConnection::WebSocketConnection", LOG_DEBUG); - _pPingTimer = static_cast(malloc(sizeof(uv_timer_t))); + _pPingTimer = static_cast(malloc(sizeof(uv_timer_t))); uv_timer_init(_pLoop, _pPingTimer); _pPingTimer->data = this; } @@ -196,26 +186,26 @@ class WebSocketConnection : WSParserCallbacks, NoCopy { uv_close(toHandle(_pPingTimer), freeAfterClose); try { delete _pParser; - } catch(...) {} + } catch (...) { + } } - bool accept(const RequestHeaders& requestHeaders, const char* pData, size_t len); - void handshake(const std::string& url, - const RequestHeaders& requestHeaders, - char** ppData, size_t* pLen, - ResponseHeaders* pResponseHeaders, - std::vector* pResponse); + bool accept(const RequestHeaders &requestHeaders, const char *pData, + size_t len); + void handshake(const std::string &url, const RequestHeaders &requestHeaders, + char **ppData, size_t *pLen, ResponseHeaders *pResponseHeaders, + std::vector *pResponse); - void sendWSMessage(Opcode opcode, const char* pData, size_t length); + void sendWSMessage(Opcode opcode, const char *pData, size_t length); void sendPing(); void closeWS(uint16_t code = 1000, std::string reason = ""); - void read(const char* data, size_t len); + void read(const char *data, size_t len); void markClosed(); void startPingTimer(); protected: - void onHeaderComplete(const WSFrameHeaderInfo& header); - void onPayload(const char* data, size_t len); + void onHeaderComplete(const WSFrameHeaderInfo &header); + void onPayload(const char *data, size_t len); void onFrameComplete(); }; diff --git a/src/winutils.cpp b/src/winutils.cpp index 01add2dcc..d22e457f3 100644 --- a/src/winutils.cpp +++ b/src/winutils.cpp @@ -1,56 +1,42 @@ #include "winutils.h" #ifdef _WIN32 -#include #include +#include -std::string wideToUtf8(const std::wstring& value) -{ - if (value.size() == 0) - return std::string(); - - const wchar_t * cstr = value.c_str(); - int chars = ::WideCharToMultiByte(CP_UTF8, 0, - cstr, -1, - nullptr, 0, nullptr, nullptr); - if (chars == 0) { - return std::string(); - } - - std::vector result(chars, 0); - chars = ::WideCharToMultiByte(CP_UTF8, - 0, - cstr, - -1, - &(result[0]), - result.size(), - nullptr, nullptr); - - return std::string(result.begin(), result.end()); -} +std::string wideToUtf8(const std::wstring &value) { + if (value.size() == 0) + return std::string(); + const wchar_t *cstr = value.c_str(); + int chars = + ::WideCharToMultiByte(CP_UTF8, 0, cstr, -1, nullptr, 0, nullptr, nullptr); + if (chars == 0) { + return std::string(); + } + + std::vector result(chars, 0); + chars = ::WideCharToMultiByte(CP_UTF8, 0, cstr, -1, &(result[0]), + result.size(), nullptr, nullptr); + + return std::string(result.begin(), result.end()); +} -std::wstring utf8ToWide(const std::string& value, - const std::string& context) -{ - if (value.size() == 0) - return std::wstring(); +std::wstring utf8ToWide(const std::string &value, const std::string &context) { + if (value.size() == 0) + return std::wstring(); - const char * cstr = value.c_str(); - int chars = ::MultiByteToWideChar(CP_UTF8, 0, - cstr, -1, - nullptr, 0); - if (chars == 0) { - return std::wstring(); - } + const char *cstr = value.c_str(); + int chars = ::MultiByteToWideChar(CP_UTF8, 0, cstr, -1, nullptr, 0); + if (chars == 0) { + return std::wstring(); + } - std::vector result(chars, 0); - chars = ::MultiByteToWideChar(CP_UTF8, 0, - cstr, -1, - &(result[0]), - result.size()); + std::vector result(chars, 0); + chars = + ::MultiByteToWideChar(CP_UTF8, 0, cstr, -1, &(result[0]), result.size()); - return std::wstring(result.begin(), result.end()); + return std::wstring(result.begin(), result.end()); } #endif // ifdef _WIN32 diff --git a/src/winutils.h b/src/winutils.h index c1eaca5ee..015d77554 100644 --- a/src/winutils.h +++ b/src/winutils.h @@ -4,10 +4,10 @@ #include -std::string wideToUtf8(const std::wstring& value); +std::string wideToUtf8(const std::wstring &value); -std::wstring utf8ToWide(const std::string& value, - const std::string& context = std::string()); +std::wstring utf8ToWide(const std::string &value, + const std::string &context = std::string()); #endif // #ifdef _WIN32 #endif // #define WINUTILS_H diff --git a/tests/testthat/test-traffic.R b/tests/testthat/test-traffic.R index ed53088b2..cb38f13b3 100644 --- a/tests/testthat/test-traffic.R +++ b/tests/testthat/test-traffic.R @@ -1,8 +1,10 @@ skip_if_not_possible <- function() { + # @pachadotdev: run sudo pacman -S apache + # this is to run all tests for the WebTechnologies view + # Temporarily disable these tests because they may not run reliably on - # some platforms. - skip("") - # skip_on_cran() + # some platforms (comment this to run) + # skip("") if (Sys.which("ab")[[1]] == "") { skip("ab (Apache bench) not available for running traffic tests")