| /freebsd/sys/contrib/zstd/zlibWrapper/ |
| H A D | gzread.c | 32 local int gz_load(gz_statep state, unsigned char *buf, unsigned len, in gz_load() argument 42 ret = read(state.state->fd, buf + *have, get); in gz_load() 48 gz_error(state, Z_ERRNO, zstrerror()); in gz_load() 52 state.state->eof = 1; in gz_load() 63 local int gz_avail(gz_statep state) in gz_avail() argument 66 z_streamp strm = &(state.state->strm); in gz_avail() 68 if (state.state->err != Z_OK && state.state->err != Z_BUF_ERROR) in gz_avail() 70 if (state.state->eof == 0) { in gz_avail() 72 unsigned char *p = state.state->in; in gz_avail() 79 if (gz_load(state, state.state->in + strm->avail_in, in gz_avail() [all …]
|
| H A D | gzlib.c | 76 local void gz_reset(gz_statep state) { in gz_reset() argument 77 state.state->x.have = 0; /* no output data available */ in gz_reset() 78 if (state.state->mode == GZ_READ) { /* for reading ... */ in gz_reset() 79 state.state->eof = 0; /* not at end of file */ in gz_reset() 80 state.state->past = 0; /* have not read past end yet */ in gz_reset() 81 state.state->how = LOOK; /* look for gzip header */ in gz_reset() 83 state.state->seek = 0; /* no seek request pending */ in gz_reset() 84 gz_error(state, Z_OK, NULL); /* clear error */ in gz_reset() 85 state.state->x.pos = 0; /* no uncompressed data yet */ in gz_reset() 86 state.state->strm.avail_in = 0; /* no input data yet */ in gz_reset() [all …]
|
| H A D | gzwrite.c | 22 local int gz_init(gz_statep state) { in gz_init() argument 24 z_streamp strm = &(state.state->strm); in gz_init() 27 state.state->in = (unsigned char*)malloc(state.state->want << 1); in gz_init() 28 if (state.state->in == NULL) { in gz_init() 29 gz_error(state, Z_MEM_ERROR, "out of memory"); in gz_init() 34 if (!state.state->direct) { in gz_init() 36 state.state->out = (unsigned char*)malloc(state.state->want); in gz_init() 37 if (state.state->out == NULL) { in gz_init() 38 free(state.state->in); in gz_init() 39 gz_error(state, Z_MEM_ERROR, "out of memory"); in gz_init() [all …]
|
| /freebsd/contrib/lutok/ |
| H A D | state_test.cpp | 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() 73 !lua_isnil(raw(state), -1)); in is_available() 74 lua_pop(raw(state), 1); in is_available() 88 check_modules(lutok::state& state, const std::string& expected) in check_modules() argument 92 ATF_REQUIRE(!((expected == "base") ^ (is_available(state, "assert")))); in check_modules() 94 (is_available(state, "string.byte")))); in check_modules() 96 (is_available(state, "table.concat")))); in check_modules() 111 lutok::state state = lutok::state_c_gate::connect(raw_state); in c_get_upvalues() local [all …]
|
| H A D | operations_test.cpp | 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() 70 hook_multiply(lutok::state& state) in hook_multiply() argument 72 state.push_integer(state.to_integer(-1) * state.to_integer(-2)); in hook_multiply() 83 lutok::state state; in ATF_TEST_CASE_BODY() local 85 lutok::create_module(state, "my_math", members); in ATF_TEST_CASE_BODY() 87 state.open_base(); in ATF_TEST_CASE_BODY() 88 lutok::do_string(state, "return next(my_math) == nil", 0, 1, 0); in ATF_TEST_CASE_BODY() 89 ATF_REQUIRE(state.to_boolean(-1)); in ATF_TEST_CASE_BODY() 90 state.pop(1); in ATF_TEST_CASE_BODY() [all …]
|
| /freebsd/sys/contrib/zlib/ |
| H A D | inflate.c | 89 struct inflate_state FAR *state; in inflateStateCheck() local 93 state = (struct inflate_state FAR *)strm->state; in inflateStateCheck() 94 if (state == Z_NULL || state->strm != strm || in inflateStateCheck() 95 state->mode < HEAD || state->mode > SYNC) in inflateStateCheck() 101 struct inflate_state FAR *state; in inflateResetKeep() local 104 state = (struct inflate_state FAR *)strm->state; in inflateResetKeep() 105 strm->total_in = strm->total_out = state->total = 0; in inflateResetKeep() 108 if (state->wrap) /* to support ill-conceived Java test suite */ in inflateResetKeep() 109 strm->adler = state->wrap & 1; in inflateResetKeep() 110 state->mode = HEAD; in inflateResetKeep() [all …]
|
| H A D | gzread.c | 19 local int gz_load(gz_statep state, unsigned char *buf, unsigned len, in gz_load() argument 24 state->again = 0; in gz_load() 31 ret = (int)read(state->fd, buf + *have, get); in gz_load() 38 state->again = 1; in gz_load() 42 gz_error(state, Z_ERRNO, zstrerror()); in gz_load() 46 state->eof = 1; in gz_load() 57 local int gz_avail(gz_statep state) { in gz_avail() argument 59 z_streamp strm = &(state->strm); in gz_avail() 61 if (state->err != Z_OK && state->err != Z_BUF_ERROR) in gz_avail() 63 if (state->eof == 0) { in gz_avail() [all …]
|
| H A D | gzwrite.c | 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() 24 if (!state->direct) { in gz_init() 26 state->out = (unsigned char *)malloc(state->want); in gz_init() 27 if (state->out == NULL) { in gz_init() 28 free(state->in); in gz_init() 29 gz_error(state, Z_MEM_ERROR, "out of memory"); in gz_init() [all …]
|
| H A D | gzlib.c | 71 local void gz_reset(gz_statep state) { in gz_reset() argument 72 state->x.have = 0; /* no output data available */ in gz_reset() 73 if (state->mode == GZ_READ) { /* for reading ... */ in gz_reset() 74 state->eof = 0; /* not at end of file */ in gz_reset() 75 state->past = 0; /* have not read past end yet */ in gz_reset() 76 state->how = LOOK; /* look for gzip header */ in gz_reset() 77 state->junk = -1; /* mark first member */ in gz_reset() 80 state->reset = 0; /* no deflateReset pending */ in gz_reset() 81 state->again = 0; /* no stalled i/o yet */ in gz_reset() 82 state->skip = 0; /* no seek request pending */ in gz_reset() [all …]
|
| H A D | infback.c | 28 struct inflate_state FAR *state; in inflateBackInit_() local 51 state = (struct inflate_state FAR *)ZALLOC(strm, 1, in inflateBackInit_() 53 if (state == Z_NULL) return Z_MEM_ERROR; in inflateBackInit_() 55 strm->state = (struct internal_state FAR *)state; in inflateBackInit_() 56 state->dmax = 32768U; in inflateBackInit_() 57 state->wbits = (uInt)windowBits; in inflateBackInit_() 58 state->wsize = 1U << windowBits; in inflateBackInit_() 59 state->window = window; in inflateBackInit_() 60 state->wnext = 0; in inflateBackInit_() 61 state->whave = 0; in inflateBackInit_() [all …]
|
| /freebsd/crypto/krb5/src/kdc/ |
| H A D | do_as_req.c | 194 finish_process_as_req(struct as_req_state *state, krb5_error_code errcode) in finish_process_as_req() argument 196 kdc_realm_t *realm = state->active_realm; in finish_process_as_req() 204 krb5_audit_state *au_state = state->au_state; in finish_process_as_req() 207 assert(state); in finish_process_as_req() 208 oldrespond = state->respond; in finish_process_as_req() 209 oldarg = state->arg; in finish_process_as_req() 216 state->ticket_reply.enc_part2 = &state->enc_tkt_reply; in finish_process_as_req() 218 errcode = check_kdcpolicy_as(context, state->request, state->client, in finish_process_as_req() 219 state->server, state->auth_indicators, in finish_process_as_req() 220 state->kdc_time, &state->enc_tkt_reply.times, in finish_process_as_req() [all …]
|
| /freebsd/contrib/kyua/utils/fs/ |
| H A D | lua_module_test.cpp | 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() 54 ATF_REQUIRE(state.is_function(-1)); in ATF_TEST_CASE_BODY() 55 state.pop(3); in ATF_TEST_CASE_BODY() [all …]
|
| H A D | lua_module.cpp | 65 qualify_path(lutok::state& state, const fs::path& path) in qualify_path() argument 67 lutok::stack_cleaner cleaner(state); in qualify_path() 72 state.get_global("_fs_start_dir"); in qualify_path() 73 if (!state.is_string(-1)) in qualify_path() 76 return fs::path(state.to_string(-1)) / path; in qualify_path() 92 to_path(lutok::state& state, const int index) in to_path() argument 94 if (!state.is_string(index)) in to_path() 96 return fs::path(state.to_string(index)); in to_path() 109 lua_fs_basename(lutok::state& state) in lua_fs_basename() argument 111 lutok::stack_cleaner cleaner(state); in lua_fs_basename() [all …]
|
| /freebsd/contrib/kyua/utils/config/ |
| H A D | lua_module.cpp | 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() 64 config::tree& tree = **state.to_userdata< config::tree* >(-1); in get_global_tree() 65 state.pop(1); in get_global_tree() 83 get_tree_key(lutok::state& state, const int table_index, const int field_index) in get_tree_key() argument 85 PRE(state.is_string(field_index)); in get_tree_key() [all …]
|
| /freebsd/sys/dev/bhnd/nvram/ |
| H A D | bhnd_nvram_data_sprom_subr.c | 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, 83 bhnd_sprom_opcode_init(bhnd_sprom_opcode_state *state, in bhnd_sprom_opcode_init() argument 92 state->layout = layout; in bhnd_sprom_opcode_init() 93 state->idx = NULL; in bhnd_sprom_opcode_init() [all …]
|
| /freebsd/usr.sbin/daemon/ |
| H A D | daemon.c | 189 struct daemon_state state; in main() local 192 daemon_state_init(&state); in main() 219 state.keep_cur_workdir = 0; in main() 222 state.restart_count = (int)strtonum(optarg, 0, in main() 229 state.keep_fds_open = 0; in main() 232 state.log_reopen = true; in main() 235 state.syslog_facility = get_log_mapping(optarg, in main() 237 if (state.syslog_facility == -1) { in main() 240 state.syslog_enabled = true; in main() 241 state.mode = MODE_SUPERVISE; in main() [all …]
|
| /freebsd/contrib/llvm-project/llvm/lib/Support/BLAKE3/ |
| H A D | blake3_portable.c | 8 INLINE void g(uint32_t *state, size_t a, size_t b, size_t c, size_t d, in g() argument 10 state[a] = state[a] + state[b] + x; in g() 11 state[d] = rotr32(state[d] ^ state[a], 16); in g() 12 state[c] = state[c] + state[d]; in g() 13 state[b] = rotr32(state[b] ^ state[c], 12); in g() 14 state[a] = state[a] + state[b] + y; in g() 15 state[d] = rotr32(state[d] ^ state[a], 8); in g() 16 state[c] = state[c] + state[d]; in g() 17 state[b] = rotr32(state[b] ^ state[c], 7); in g() 20 INLINE void round_fn(uint32_t state[16], const uint32_t *msg, size_t round) { in round_fn() [all …]
|
| /freebsd/sys/contrib/openzfs/module/icp/algs/blake3/ |
| H A D | blake3_generic.c | 24 static inline void g(uint32_t *state, size_t a, size_t b, size_t c, size_t d, in g() argument 27 state[a] = state[a] + state[b] + x; in g() 28 state[d] = rotr32(state[d] ^ state[a], 16); in g() 29 state[c] = state[c] + state[d]; in g() 30 state[b] = rotr32(state[b] ^ state[c], 12); in g() 31 state[a] = state[a] + state[b] + y; in g() 32 state[d] = rotr32(state[d] ^ state[a], 8); in g() 33 state[c] = state[c] + state[d]; in g() 34 state[b] = rotr32(state[b] ^ state[c], 7); in g() 37 static inline void round_fn(uint32_t state[16], const uint32_t *msg, in round_fn() [all …]
|
| /freebsd/sys/dev/evdev/ |
| H A D | uinput.c | 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) 160 struct uinput_cdev_state *state = evdev_get_softc(evdev); in uinput_ev_event() local 165 UINPUT_LOCK(state); in uinput_ev_event() 166 if (state->ucs_state == UINPUT_RUNNING) { in uinput_ev_event() [all …]
|
| /freebsd/contrib/bearssl/src/symcipher/ |
| H A D | aes_small_enc.c | 30 add_round_key(unsigned *state, const uint32_t *skeys) in add_round_key() argument 38 state[i + 0] ^= (unsigned)(k >> 24); in add_round_key() 39 state[i + 1] ^= (unsigned)(k >> 16) & 0xFF; in add_round_key() 40 state[i + 2] ^= (unsigned)(k >> 8) & 0xFF; in add_round_key() 41 state[i + 3] ^= (unsigned)k & 0xFF; in add_round_key() 46 sub_bytes(unsigned *state) in sub_bytes() argument 51 state[i] = S[state[i]]; in sub_bytes() 56 shift_rows(unsigned *state) in shift_rows() argument 60 tmp = state[1]; in shift_rows() 61 state[1] = state[5]; in shift_rows() [all …]
|
| H A D | aes_small_dec.c | 56 add_round_key(unsigned *state, const uint32_t *skeys) in add_round_key() argument 64 state[i + 0] ^= (unsigned)(k >> 24); in add_round_key() 65 state[i + 1] ^= (unsigned)(k >> 16) & 0xFF; in add_round_key() 66 state[i + 2] ^= (unsigned)(k >> 8) & 0xFF; in add_round_key() 67 state[i + 3] ^= (unsigned)k & 0xFF; in add_round_key() 72 inv_sub_bytes(unsigned *state) in inv_sub_bytes() argument 77 state[i] = iS[state[i]]; in inv_sub_bytes() 82 inv_shift_rows(unsigned *state) in inv_shift_rows() argument 86 tmp = state[13]; in inv_shift_rows() 87 state[13] = state[9]; in inv_shift_rows() [all …]
|
| /freebsd/contrib/expat/lib/ |
| H A D | xmlrole.c | 117 # define setTopLevel(state) \ argument 118 ((state)->handler \ 119 = ((state)->documentEntity ? internalSubset : externalSubset1)) 121 # define setTopLevel(state) ((state)->handler = internalSubset) argument 124 typedef int PTRCALL PROLOG_HANDLER(PROLOG_STATE *state, int tok, 140 static int FASTCALL common(PROLOG_STATE *state, int tok); 143 prolog0(PROLOG_STATE *state, int tok, const char *ptr, const char *end, in prolog0() argument 147 state->handler = prolog1; in prolog0() 150 state->handler = prolog1; in prolog0() 153 state->handler = prolog1; in prolog0() [all …]
|
| /freebsd/crypto/openssh/ |
| H A D | packet.c | 239 struct session_state *state = NULL; in ssh_alloc_session_state() local 242 (state = calloc(1, sizeof(*state))) == NULL || in ssh_alloc_session_state() 244 (state->input = sshbuf_new()) == NULL || in ssh_alloc_session_state() 245 (state->output = sshbuf_new()) == NULL || in ssh_alloc_session_state() 246 (state->outgoing_packet = sshbuf_new()) == NULL || in ssh_alloc_session_state() 247 (state->incoming_packet = sshbuf_new()) == NULL) in ssh_alloc_session_state() 249 TAILQ_INIT(&state->outgoing); in ssh_alloc_session_state() 252 state->connection_in = -1; in ssh_alloc_session_state() 253 state->connection_out = -1; in ssh_alloc_session_state() 254 state->max_packet_size = 32768; in ssh_alloc_session_state() [all …]
|
| /freebsd/crypto/krb5/src/lib/gssapi/generic/ |
| H A D | util_seqstate.c | 68 g_seqnum_state state; in g_seqstate_init() local 71 state = malloc(sizeof(*state)); in g_seqstate_init() 72 if (state == NULL) in g_seqstate_init() 74 state->do_replay = do_replay; in g_seqstate_init() 75 state->do_sequence = do_sequence; in g_seqstate_init() 76 state->seqmask = wide ? UINT64_MAX : UINT32_MAX; in g_seqstate_init() 77 state->base = seqnum; in g_seqstate_init() 78 state->next = state->recvmap = 0; in g_seqstate_init() 79 *state_out = state; in g_seqstate_init() 84 g_seqstate_check(g_seqnum_state state, uint64_t seqnum) in g_seqstate_check() argument [all …]
|
| /freebsd/sys/contrib/openzfs/module/zfs/ |
| H A D | zcp.c | 131 zcp_error_handler(lua_State *state) in zcp_error_handler() argument 135 zcp_cleanup(state); in zcp_error_handler() 137 VERIFY3U(1, ==, lua_gettop(state)); in zcp_error_handler() 138 msg = lua_tostring(state, 1); in zcp_error_handler() 139 luaL_traceback(state, state, msg, 1); in zcp_error_handler() 144 zcp_argerror(lua_State *state, int narg, const char *msg, ...) in zcp_argerror() argument 149 const char *buf = lua_pushvfstring(state, msg, alist); in zcp_argerror() 152 return (luaL_argerror(state, narg, buf)); in zcp_argerror() 167 zcp_register_cleanup(lua_State *state, zcp_cleanup_t cleanfunc, void *cleanarg) in zcp_register_cleanup() argument 169 zcp_run_info_t *ri = zcp_run_info(state); in zcp_register_cleanup() [all …]
|