/freebsd/sys/contrib/zstd/zlibWrapper/ |
H A D | gzwrite.c | 2 * - gz_statep was converted to union to work with -Wstrict-aliasing=1 */ 4 /* gzwrite.c -- zlib functions for writing gzip files 5 * Copyright (C) 2004-2017 Mark Adler 19 /* Initialize state for writing a gzip file. Mark initialization by setting 20 state.state->size to non-zero. Return -1 on a memory allocation failure, or 0 on 22 local int gz_init(state) in gz_init() argument 23 gz_statep state; in gz_init() 26 z_streamp strm = &(state.state->strm); 29 state.state->in = (unsigned char*)malloc(state.state->want << 1); 30 if (state.state->in == NULL) { [all …]
|
H A D | gzread.c | 2 * - gz_statep was converted to union to work with -Wstrict-aliasing=1 */ 4 /* gzread.c -- zlib functions for reading gzip files 12 * see https://github.com/facebook/zstd/issues/1800#issuecomment-545945050 */ 28 /* Use read() to load a buffer -- return -1 on error, otherwise 0. Read from 29 …state.state->fd, and update state.state->eof, state.state->err, and state.state->msg as appropriat… 32 local int gz_load(state, buf, len, have) in gz_load() argument 33 gz_statep state; in gz_load() 39 unsigned get, max = ((unsigned)-1 >> 2) + 1; 43 get = len - *have; 46 ret = read(state.state->fd, buf + *have, get); [all …]
|
H A D | gzlib.c | 2 * - gz_statep was converted to union to work with -Wstrict-aliasing=1 */ 4 /* gzlib.c -- zlib functions common to reading and writing gzip files 5 * Copyright (C) 2004-2017 Mark Adler 14 #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 27 /* Map the Windows error number in ERROR to a locale-dependent error message 54 && msgbuf[chars - 2] == '\r' && msgbuf[chars - 1] == '\n') { 55 chars -= 2; 59 if (chars > sizeof (buf) - 1) { 60 chars = sizeof (buf) - 1; 77 /* Reset gzip file state */ [all …]
|
/freebsd/contrib/lutok/ |
H A D | state_test.cpp | 29 #include "state.ipp" 36 #include <atf-c++.hpp> 44 // A note about the lutok::state tests. 46 // The methods of lutok::state are, in general, thin wrappers around the 53 // Lastly, for every test case that stresses a single lutok::state method, we 54 // only call that method directly. All other Lua state manipulation operations 64 /// \param state The Lua state. 69 is_available(lutok::state& state, const char* symbol) in is_available() argument 71 luaL_loadstring(raw(state), (std::string("return ") + symbol).c_str()); in is_available() 72 const bool ok = (lua_pcall(raw(state), 0, 1, 0) == 0 && in is_available() [all …]
|
H A D | operations_test.cpp | 33 #include <atf-c++.hpp> 36 #include "state.ipp" 45 /// \pre stack(-2) The first summand. 46 /// \pre stack(-1) The second summand. 47 /// \post stack(-1) The result of the sum. 49 /// \param state The Lua state. 53 hook_add(lutok::state& state) in hook_add() argument 55 state.push_integer(state.to_integer(-1) + state.to_integer(-2)); in hook_add() 62 /// \pre stack(-2) The first factor. 63 /// \pre stack(-1) The second factor. [all …]
|
/freebsd/sys/contrib/zlib/ |
H A D | inflate.c | 1 /* inflate.c -- zlib decompression 2 * Copyright (C) 1995-2022 Mark Adler 10 * - First version -- complete rewrite of inflate to simplify code, avoid 16 * - Use pointers for available input and output checking in inffast.c 17 * - Remove input and output counters in inffast.c 18 * - Change inffast.c entry and loop from avail_in >= 7 to >= 6 19 * - Remove unnecessary second byte pull from length extra in inffast.c 20 * - Unroll direct copy to three copies per loop in inffast.c 23 * - Change external routine names to reduce potential conflicts 24 * - Correct filename to inffixed.h for fixed tables in inflate.c [all …]
|
H A D | gzread.c | 1 /* gzread.c -- zlib functions for reading gzip files 2 * Copyright (C) 2004-2017 Mark Adler 9 /* Use read() to load a buffer -- return -1 on error, otherwise 0. Read from 10 state->fd, and update state->eof, state->err, and state->msg as appropriate. 13 local int gz_load(gz_statep state, unsigned char *buf, unsigned len, in gz_load() argument 16 unsigned get, max = ((unsigned)-1 >> 2) + 1; in gz_load() 20 get = len - *have; in gz_load() 23 ret = read(state->fd, buf + *have, get); in gz_load() 29 gz_error(state, Z_ERRNO, zstrerror()); in gz_load() 30 return -1; in gz_load() [all …]
|
H A D | gzwrite.c | 1 /* gzwrite.c -- zlib functions for writing gzip files 2 * Copyright (C) 2004-2019 Mark Adler 9 /* Initialize state for writing a gzip file. Mark initialization by setting 10 state->size to non-zero. Return -1 on a memory allocation failure, or 0 on 12 local int gz_init(gz_statep state) { in gz_init() argument 14 z_streamp strm = &(state->strm); in gz_init() 17 state->in = (unsigned char *)malloc(state->want << 1); in gz_init() 18 if (state->in == NULL) { in gz_init() 19 gz_error(state, Z_MEM_ERROR, "out of memory"); in gz_init() 20 return -1; in gz_init() [all …]
|
H A D | gzlib.c | 1 /* gzlib.c -- zlib functions common to reading and writing gzip files 2 * Copyright (C) 2004-2024 Mark Adler 13 #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 22 /* Map the Windows error number in ERROR to a locale-dependent error message 47 && msgbuf[chars - 2] == '\r' && msgbuf[chars - 1] == '\n') { in gz_strwinerror() 48 chars -= 2; in gz_strwinerror() 52 if (chars > sizeof (buf) - 1) { in gz_strwinerror() 53 chars = sizeof (buf) - 1; in gz_strwinerror() 70 /* Reset gzip file state */ 71 local void gz_reset(gz_statep state) { in gz_reset() argument [all …]
|
H A D | infback.c | 1 /* infback.c -- inflate using a call-back interface 2 * Copyright (C) 1995-2022 Mark Adler 8 inflate.o would be linked into an application--not both. The interface 9 with inffast.c is retained so that optimized assembler-coded versions of 22 windowBits is in the range 8..15, and window is a user-supplied 28 struct inflate_state FAR *state; in inflateBackInit_() local 36 strm->msg = Z_NULL; /* in case we return an error */ in inflateBackInit_() 37 if (strm->zalloc == (alloc_func)0) { in inflateBackInit_() 41 strm->zalloc = zcalloc; in inflateBackInit_() 42 strm->opaque = (voidpf)0; in inflateBackInit_() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/XRay/ |
H A D | BlockVerifier.cpp | 1 //===- BlockVerifier.cpp - FDR Block Verifier -------- [all...] |
/freebsd/sys/dev/bhnd/nvram/ |
H A D | bhnd_nvram_data_sprom_subr.c | 1 /*- 2 * Copyright (c) 2015-2016 Landon Fuller <landonf@FreeBSD.org> 50 static int bhnd_sprom_opcode_reset(bhnd_sprom_opcode_state *state); 52 static int bhnd_sprom_opcode_set_type(bhnd_sprom_opcode_state *state, 55 static int bhnd_sprom_opcode_set_var(bhnd_sprom_opcode_state *state, 57 static int bhnd_sprom_opcode_clear_var(bhnd_sprom_opcode_state *state); 59 static int bhnd_sprom_opcode_flush_bind(bhnd_sprom_opcode_state *state); 61 static int bhnd_sprom_opcode_read_opval32(bhnd_sprom_opcode_state *state, 64 static int bhnd_sprom_opcode_step(bhnd_sprom_opcode_state *state, 69 (_state)->input - (_state)->layout->bindings, ##__VA_ARGS__) [all …]
|
/freebsd/contrib/wpa/src/utils/ |
H A D | state_machine.h | 2 * wpa_supplicant/hostapd - State machine definitions 3 * Copyright (c) 2002-2005, Jouni Malinen <j@w1.fi> 8 * This file includes a set of pre-processor macros that can be used to 9 * implement a state machine. In addition to including this header file, each 10 * file implementing a state machine must define STATE_MACHINE_DATA to be the 11 * data structure including state variables (enum machine_state, 14 * a group of state machines with shared data structure, STATE_MACHINE_ADDR 16 * SM_ENTRY_M macro can be used to define similar group of state machines 24 * SM_STATE - Declaration of a state machine function 25 * @machine: State machine name [all …]
|
/freebsd/contrib/kyua/utils/config/ |
H A D | lua_module.cpp | 32 #include <lutok/state.ipp> 45 /// Gets the tree singleton stored in the Lua state. 47 /// \param state The Lua state. The registry must contain a key named 50 /// \return A reference to the tree associated with the Lua state. 54 get_global_tree(lutok::state& state) in get_global_tree() argument 56 lutok::stack_cleaner cleaner(state); in get_global_tree() 58 state.push_value(lutok::registry_index); in get_global_tree() 59 state.push_string("tree"); in get_global_tree() 60 state.get_table(-2); in get_global_tree() 61 if (state.is_nil(-1)) in get_global_tree() [all …]
|
/freebsd/contrib/expat/lib/ |
H A D | xmlrole.c | 9 Copyright (c) 1997-2000 Thai Open Source Software Center Ltd 12 Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net> 13 Copyright (c) 2002-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> 14 Copyright (c) 2005-2009 Steven Solie <steven@solie.ca> 15 Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org> 111 # define MIN_BYTES_PER_CHAR(enc) ((enc)->minBytesPerChar) 115 # define setTopLevel(state) \ argument 116 ((state)->handler \ 117 = ((state)->documentEntity ? internalSubset : externalSubset1)) 119 # define setTopLevel(state) ((state)->handler = internalSubset) argument [all …]
|
/freebsd/crypto/openssh/ |
H A D | sshkey-xmss.c | 1 /* $OpenBSD: sshkey-xmss.c,v 1.12 2022/10/28 00:39:29 djm Exp $ */ 46 #include "sshkey-xmss.h" 52 /* opaque internal XMSS state */ 53 #define XMSS_MAGIC "xmss-state-v1" 54 #define XMSS_CIPHERNAME "aes256-gcm@openssh.com" 69 u_int32_t idx; /* state read from file */ 71 int have_state; /* .state file exists */ 74 char *enc_ciphername;/* encrypt state with cipher */ 75 u_char *enc_keyiv; /* encrypt state with key */ 97 struct ssh_xmss_state *state; in sshkey_xmss_init() local [all …]
|
H A D | packet.c | 43 #include "openbsd-compat/sys-queue.h" 190 /* Volume-based rekeying */ 193 /* Time-based rekeying */ 220 /* One-off warning about weak ciphers */ 234 struct session_state *state = NULL; in ssh_alloc_session_state() local 237 (state = calloc(1, sizeof(*state))) == NULL || in ssh_alloc_session_state() 238 (ssh->kex = kex_new()) == NULL || in ssh_alloc_session_state() 239 (state->input = sshbuf_new()) == NULL || in ssh_alloc_session_state() 240 (state->output = sshbuf_new()) == NULL || in ssh_alloc_session_state() 241 (state->outgoing_packet = sshbuf_new()) == NULL || in ssh_alloc_session_state() [all …]
|
/freebsd/sys/dev/evdev/ |
H A D | uinput.c | 1 /*- 3 * Copyright (c) 2015-2016 Vladimir Kondratyev <wulf@FreeBSD.org> 50 #define debugf(state, fmt, args...) printf("uinput: " fmt "\n", ##args) argument 52 #define debugf(state, fmt, args...) argument 57 #define UINPUT_LOCK(state) sx_xlock(&(state)->ucs_lock) argument 58 #define UINPUT_UNLOCK(state) sx_unlock(&(state)->ucs_lock) argument 59 #define UINPUT_LOCK_ASSERT(state) sx_assert(&(state)->ucs_lock, SA_LOCKED) argument 60 #define UINPUT_EMPTYQ(state) \ argument 61 ((state)->ucs_buffer_head == (state)->ucs_buffer_tail) 159 struct uinput_cdev_state *state = evdev_get_softc(evdev); in uinput_ev_event() local [all …]
|
/freebsd/contrib/libarchive/libarchive/ |
H A D | archive_write_add_filter_compress.c | 1 /*- 26 /*- 76 #define HSHIFT 8 /* 8 - trunc(log2(HSIZE / 65536)) */ 79 #define MAXCODE(bits) ((1 << (bits)) - 1) 133 archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC, in archive_write_add_filter_compress() 135 f->open = &archive_compressor_compress_open; in archive_write_add_filter_compress() 136 f->code = ARCHIVE_FILTER_COMPRESS; in archive_write_add_filter_compress() 137 f->name = "compress"; in archive_write_add_filter_compress() 147 struct private_data *state; in archive_compressor_compress_open() local 150 f->code = ARCHIVE_FILTER_COMPRESS; in archive_compressor_compress_open() [all …]
|
H A D | archive_read_support_filter_program.c | 1 /*- 137 struct program_bidder *state; in archive_read_support_filter_program_signature() local 140 * Allocate our private state. in archive_read_support_filter_program_signature() 142 state = calloc(1, sizeof (*state)); in archive_read_support_filter_program_signature() 143 if (state == NULL) in archive_read_support_filter_program_signature() 145 state->cmd = strdup(cmd); in archive_read_support_filter_program_signature() 146 if (state->cmd == NULL) in archive_read_support_filter_program_signature() 150 state->signature_len = signature_len; in archive_read_support_filter_program_signature() 151 state->signature = malloc(signature_len); in archive_read_support_filter_program_signature() 152 memcpy(state->signature, signature, signature_len); in archive_read_support_filter_program_signature() [all …]
|
H A D | archive_read_support_filter_compress.c | 1 /*- 2 * Copyright (c) 2003-2007 Tim Kientzle 32 /*- 125 * 65536-256 zero bytes. Thus, we need stack space to expand 126 * a 65280-byte dictionary entry. (Of course, 32640:1 127 * compression could also be considered the "best" case. ;-) 212 struct private_data *state; in compress_bidder_init() local 217 self->code = ARCHIVE_FILTER_COMPRESS; in compress_bidder_init() 218 self->name = "compress (.Z)"; in compress_bidder_init() 220 state = calloc(1, sizeof(*state)); in compress_bidder_init() [all …]
|
/freebsd/contrib/tcpdump/missing/ |
H A D | snprintf.c | 2 * Copyright (c) 1995-1999 Kungliga Tekniska H�gskolan 54 * Common state 57 struct state { struct 63 int (*append_char)(struct state *, unsigned char); argument 64 int (*reserve)(struct state *, size_t); argument 65 /* XXX - methods */ 70 as_reserve (struct state *state, size_t n) 72 if (state->s + n > state->theend) { 73 int off = state->s - state->str; 76 if (state->max_sz && state->sz >= state->max_sz) [all …]
|
/freebsd/usr.sbin/daemon/ |
H A D | daemon.c | 1 /*- 2 * SPDX-License-Identifier: BSD-3-Clause 66 MODE_SUPERVISE, /* initial supervision state */ 68 MODE_NOCHILD, /* child is terminated, final state of the event loop */ 124 { "change-dir", no_argument, NULL, 'c' }, 125 { "close-fds", no_argument, NULL, 'f' }, 128 { "output-file", required_argument, NULL, 'o' }, 129 { "output-mask", required_argument, NULL, 'm' }, 130 { "child-pidfile", required_argument, NULL, 'p' }, 131 { "supervisor-pidfile", required_argument, NULL, 'P' }, [all …]
|
/freebsd/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/ |
H A D | ContainerModeling.cpp | 1 //===-- ContainerModeling.cpp -------------------------------------*- C++ -*--// 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 //===----------------------------------------------------------------------===// 9 // Defines a modeling-checker for modeling STL container-like containers. 11 //===----------------------------------------------------------------------===// 57 void printState(raw_ostream &Out, ProgramStateRef State, const char *NL, 64 void checkLiveSymbols(ProgramStateRef State, SymbolReaper &SR) const; 105 bool hasSubscriptOperator(ProgramStateRef State, const MemRegion *Reg); 106 bool frontModifiable(ProgramStateRef State, const MemRegion *Reg); 107 bool backModifiable(ProgramStateRef State, const MemRegion *Reg); [all …]
|
/freebsd/contrib/kyua/utils/fs/ |
H A D | lua_module_test.cpp | 31 #include <atf-c++.hpp> 33 #include <lutok/state.hpp> 46 lutok::state state; in ATF_TEST_CASE_BODY() local 47 stack_balance_checker checker(state); in ATF_TEST_CASE_BODY() 48 fs::open_fs(state); in ATF_TEST_CASE_BODY() 49 lutok::do_string(state, "return fs.basename", 0, 1, 0); in ATF_TEST_CASE_BODY() 50 ATF_REQUIRE(state.is_function(-1)); in ATF_TEST_CASE_BODY() 51 lutok::do_string(state, "return fs.dirname", 0, 1, 0); in ATF_TEST_CASE_BODY() 52 ATF_REQUIRE(state.is_function(-1)); in ATF_TEST_CASE_BODY() 53 lutok::do_string(state, "return fs.join", 0, 1, 0); in ATF_TEST_CASE_BODY() [all …]
|