Home
last modified time | relevance | path

Searched refs:state (Results 1 – 25 of 3088) sorted by relevance

12345678910>>...124

/freebsd/sys/contrib/zstd/zlibWrapper/
H A Dgzread.c32 local int gz_load(state, buf, len, have) in gz_load() argument
33 gz_statep state; in gz_load()
46 ret = read(state.state->fd, buf + *have, get);
52 gz_error(state, Z_ERRNO, zstrerror());
56 state.state->eof = 1;
67 local int gz_avail(state) in gz_avail() argument
68 gz_statep state; in gz_avail()
71 z_streamp strm = &(state.state->strm);
73 if (state.state->err != Z_OK && state.state->err != Z_BUF_ERROR)
75 if (state.state->eof == 0) {
[all …]
H A Dgzwrite.c22 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) {
31 gz_error(state, Z_MEM_ERROR, "out of memory");
36 if (!state.state->direct) {
38 state.state->out = (unsigned char*)malloc(state.state->want);
39 if (state.state->out == NULL) {
40 free(state.state->in);
[all …]
H A Dgzlib.c78 local void gz_reset(state) in gz_reset() argument
79 gz_statep state; in gz_reset()
81 state.state->x.have = 0; /* no output data available */
82 if (state.state->mode == GZ_READ) { /* for reading ... */
83 state.state->eof = 0; /* not at end of file */
84 state.state->past = 0; /* have not read past end yet */
85 state.state->how = LOOK; /* look for gzip header */
87 state.state->seek = 0; /* no seek request pending */
88 gz_error(state, Z_OK, NULL); /* clear error */
89 state.state->x.pos = 0; /* no uncompressed data yet */
[all …]
/freebsd/contrib/lutok/
H A Dstate_test.cpp69 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 Doperations_test.cpp53 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 Dgzread.c13 local int gz_load(gz_statep state, unsigned char *buf, unsigned len, in gz_load() argument
23 ret = read(state->fd, buf + *have, get); in gz_load()
29 gz_error(state, Z_ERRNO, zstrerror()); in gz_load()
33 state->eof = 1; in gz_load()
44 local int gz_avail(gz_statep state) { in gz_avail() argument
46 z_streamp strm = &(state->strm); in gz_avail()
48 if (state->err != Z_OK && state->err != Z_BUF_ERROR) in gz_avail()
50 if (state->eof == 0) { in gz_avail()
52 unsigned char *p = state->in; in gz_avail()
59 if (gz_load(state, state->in + strm->avail_in, in gz_avail()
[all …]
H A Dinflate.c95 struct inflate_state FAR *state; in inflateStateCheck() local
99 state = (struct inflate_state FAR *)strm->state; in inflateStateCheck()
100 if (state == Z_NULL || state->strm != strm || in inflateStateCheck()
101 state->mode < HEAD || state->mode > SYNC) in inflateStateCheck()
107 struct inflate_state FAR *state; in inflateResetKeep() local
110 state = (struct inflate_state FAR *)strm->state; in inflateResetKeep()
111 strm->total_in = strm->total_out = state->total = 0; in inflateResetKeep()
113 if (state->wrap) /* to support ill-conceived Java test suite */ in inflateResetKeep()
114 strm->adler = state->wrap & 1; in inflateResetKeep()
115 state->mode = HEAD; in inflateResetKeep()
[all …]
H A Dgzwrite.c12 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 Dgzlib.c71 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()
79 state->reset = 0; /* no deflateReset pending */ in gz_reset()
80 state->seek = 0; /* no seek request pending */ in gz_reset()
81 gz_error(state, Z_OK, NULL); /* clear error */ in gz_reset()
82 state->x.pos = 0; /* no uncompressed data yet */ in gz_reset()
[all …]
H A Dinfback.c28 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/contrib/kyua/utils/fs/
H A Dlua_module_test.cpp46 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 Dlua_module.cpp65 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 Dlua_module.cpp54 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 Dbhnd_nvram_data_sprom_subr.c50 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 Ddaemon.c183 struct daemon_state state; in main() local
185 daemon_state_init(&state); in main()
211 state.keep_cur_workdir = 0; in main()
214 state.restart_count = (int)strtonum(optarg, 0, in main()
221 state.keep_fds_open = 0; in main()
224 state.log_reopen = true; in main()
227 state.syslog_facility = get_log_mapping(optarg, in main()
229 if (state.syslog_facility == -1) { in main()
232 state.syslog_enabled = true; in main()
233 state.mode = MODE_SUPERVISE; in main()
[all …]
/freebsd/contrib/libarchive/libarchive/
H A Darchive_write_add_filter_compress.c147 struct private_data *state; in archive_compressor_compress_open() local
153 state = calloc(1, sizeof(*state)); in archive_compressor_compress_open()
154 if (state == NULL) { in archive_compressor_compress_open()
169 state->compressed_buffer_size = bs; in archive_compressor_compress_open()
170 state->compressed = malloc(state->compressed_buffer_size); in archive_compressor_compress_open()
172 if (state->compressed == NULL) { in archive_compressor_compress_open()
175 free(state); in archive_compressor_compress_open()
183 state->max_maxcode = 0x10000; /* Should NEVER generate this code. */ in archive_compressor_compress_open()
184 state->in_count = 0; /* Length of input. */ in archive_compressor_compress_open()
185 state->bit_buf = 0; in archive_compressor_compress_open()
[all …]
H A Darchive_read_support_filter_compress.c212 struct private_data *state; in compress_bidder_init() local
220 state = calloc(1, sizeof(*state)); in compress_bidder_init()
222 if (state == NULL || out_block == NULL) { in compress_bidder_init()
224 free(state); in compress_bidder_init()
231 self->data = state; in compress_bidder_init()
232 state->out_block_size = out_block_size; in compress_bidder_init()
233 state->out_block = out_block; in compress_bidder_init()
248 state->maxcode_bits = code & 0x1f; in compress_bidder_init()
249 state->maxcode = (1 << state->maxcode_bits); in compress_bidder_init()
250 state->use_reset_code = code & 0x80; in compress_bidder_init()
[all …]
H A Darchive_read_support_filter_program.c137 struct program_bidder *state; in archive_read_support_filter_program_signature() local
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()
155 if (__archive_read_register_bidder(a, state, NULL, in archive_read_support_filter_program_signature()
157 free_state(state); in archive_read_support_filter_program_signature()
[all …]
/freebsd/sys/contrib/openzfs/module/icp/algs/blake3/
H A Dblake3_generic.c33 static inline void g(uint32_t *state, size_t a, size_t b, size_t c, size_t d, in g() argument
36 state[a] = state[a] + state[b] + x; in g()
37 state[d] = rotr32(state[d] ^ state[a], 16); in g()
38 state[c] = state[c] + state[d]; in g()
39 state[b] = rotr32(state[b] ^ state[c], 12); in g()
40 state[a] = state[a] + state[b] + y; in g()
41 state[d] = rotr32(state[d] ^ state[a], 8); in g()
42 state[c] = state[c] + state[d]; in g()
43 state[b] = rotr32(state[b] ^ state[c], 7); in g()
46 static inline void round_fn(uint32_t state[16], const uint32_t *msg, in round_fn()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Support/BLAKE3/
H A Dblake3_portable.c8 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/contrib/tcpdump/missing/
H A Dsnprintf.c57 struct state { struct
63 int (*append_char)(struct state *, unsigned char); argument
64 int (*reserve)(struct state *, size_t); argument
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)
79 state->sz = max(state->sz * 2, state->sz + n);
80 if (state->max_sz)
81 state->sz = min(state->sz, state->max_sz);
[all …]
/freebsd/sys/dev/evdev/
H A Duinput.c50 #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
164 UINPUT_LOCK(state); in uinput_ev_event()
165 if (state->ucs_state == UINPUT_RUNNING) { in uinput_ev_event()
[all …]
/freebsd/contrib/bearssl/src/symcipher/
H A Daes_small_enc.c30 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 …]
/freebsd/crypto/openssh/
H A Dpacket.c234 struct session_state *state = NULL; in ssh_alloc_session_state() local
237 (state = calloc(1, sizeof(*state))) == 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()
242 (state->incoming_packet = sshbuf_new()) == NULL) in ssh_alloc_session_state()
244 TAILQ_INIT(&state->outgoing); in ssh_alloc_session_state()
247 state->connection_in = -1; in ssh_alloc_session_state()
248 state->connection_out = -1; in ssh_alloc_session_state()
249 state->max_packet_size = 32768; in ssh_alloc_session_state()
[all …]
/freebsd/contrib/expat/lib/
H A Dxmlrole.c115 # define setTopLevel(state) \ argument
116 ((state)->handler \
117 = ((state)->documentEntity ? internalSubset : externalSubset1))
119 # define setTopLevel(state) ((state)->handler = internalSubset) argument
122 typedef int PTRCALL PROLOG_HANDLER(PROLOG_STATE *state, int tok,
138 static int FASTCALL common(PROLOG_STATE *state, int tok);
141 prolog0(PROLOG_STATE *state, int tok, const char *ptr, const char *end, in prolog0() argument
145 state->handler = prolog1; in prolog0()
148 state->handler = prolog1; in prolog0()
151 state->handler = prolog1; in prolog0()
[all …]

12345678910>>...124