Home
last modified time | relevance | path

Searched refs:count (Results 1 – 25 of 48) sorted by relevance

12

/nanopb-2.7.6/examples/network_server/
Dcommon.c11 static bool write_callback(pb_ostream_t *stream, const uint8_t *buf, size_t count) in write_callback() argument
14 return send(fd, buf, count, 0) == count; in write_callback()
17 static bool read_callback(pb_istream_t *stream, uint8_t *buf, size_t count) in read_callback() argument
22 if (count == 0) in read_callback()
25 result = recv(fd, buf, count, MSG_WAITALL); in read_callback()
30 return result == count; in read_callback()
/nanopb-2.7.6/tests/fuzztest/
Dflakystream.c4 bool flakystream_callback(pb_istream_t *stream, pb_byte_t *buf, size_t count) in flakystream_callback() argument
8 if (state->position + count > state->msglen) in flakystream_callback()
13 else if (state->position + count > state->fail_after) in flakystream_callback()
18 memcpy(buf, state->buffer + state->position, count); in flakystream_callback()
19 state->position += count; in flakystream_callback()
Drandom_data.c78 void rand_fill(uint8_t *buf, size_t count) in rand_fill() argument
80 for (; count > 0; count--) in rand_fill()
139 void rand_mess(uint8_t *buf, size_t count) in rand_mess() argument
146 int s = rand_int(0, count - 1); in rand_mess()
147 int l = rand_len(count - s); in rand_mess()
153 int a = rand_int(0, count - 1); in rand_mess()
154 int b = rand_int(0, count - 1); in rand_mess()
162 int s = rand_int(0, count - 2); in rand_mess()
163 int l = rand_len((count - s) / 2); in rand_mess()
169 int s = rand_int(0, count - 1); in rand_mess()
[all …]
Dvalidation.c8 pb_size_t count = 1; in validate_static() local
16 count = *(pb_size_t*)iter->pSize; in validate_static()
17 assert(count <= iter->array_size); in validate_static()
34 for (i = 0; i < count; i++) in validate_static()
64 pb_size_t count = 1; in validate_pointer() local
91 count = *(pb_size_t*)iter->pSize; in validate_pointer()
92 assert(allocated_size >= count * iter->data_size); in validate_pointer()
100 for (i = 0; i < count; i++) in validate_pointer()
Drandom_data.h30 void rand_fill(uint8_t *buf, size_t count);
36 void rand_mess(uint8_t *buf, size_t count);
/nanopb-2.7.6/tests/basic_stream/
Dencode_stream.c10 bool streamcallback(pb_ostream_t *stream, const uint8_t *buf, size_t count) in streamcallback() argument
13 return fwrite(buf, 1, count, file) == count; in streamcallback()
Ddecode_stream.c58 bool callback(pb_istream_t *stream, uint8_t *buf, size_t count) in callback() argument
61 size_t len = fread(buf, 1, count, file); in callback()
63 if (len == count) in callback()
/nanopb-2.7.6/tests/regression/GHSA-gcx3-7m76-287p/
Dtest.c8 bool stream_callback(pb_istream_t *stream, uint8_t *buf, size_t count) in stream_callback() argument
11 size_t len = fread(buf, 1, count, file); in stream_callback()
13 if (len == count) in stream_callback()
/nanopb-2.7.6/tests/any_type/
Ddecode_any.c14 size_t count; in main() local
19 count = fread(buffer, 1, sizeof(buffer), stdin); in main()
20 stream = pb_istream_from_buffer(buffer, count); in main()
/nanopb-2.7.6/tests/basic_buffer/
Ddecode_buffer.c65 size_t count; in main() local
69 count = fread(buffer, 1, sizeof(buffer), stdin); in main()
78 stream = pb_istream_from_buffer(buffer, count); in main()
/nanopb-2.7.6/tests/extensions/
Ddecode_extensions.c15 size_t count; in main() local
27 count = fread(buffer, 1, sizeof(buffer), stdin); in main()
28 stream = pb_istream_from_buffer(buffer, count); in main()
/nanopb-2.7.6/tests/map/
Ddecode_map.c29 size_t count; in main() local
32 count = fread(buffer, 1, sizeof(buffer), stdin); in main()
44 pb_istream_t stream = pb_istream_from_buffer(buffer, count); in main()
/nanopb-2.7.6/tests/msgid/
Ddecode_msgid.c61 size_t count; in main() local
67 count = fread(buffer, 1, sizeof(buffer), stdin); in main()
75 stream = pb_istream_from_buffer(buffer, count); in main()
/nanopb-2.7.6/tests/anonymous_oneof/
Ddecode_oneof.c57 size_t count; in main() local
68 count = fread(buffer, 1, sizeof(buffer), stdin); in main()
80 stream = pb_istream_from_buffer(buffer, count); in main()
/nanopb-2.7.6/tests/io_errors/
Dio_errors.c17 bool read_callback(pb_istream_t *stream, uint8_t *buf, size_t count) in read_callback() argument
21 while (count--) in read_callback()
31 bool write_callback(pb_ostream_t *stream, const uint8_t *buf, size_t count) in write_callback() argument
35 while (count--) in write_callback()
/nanopb-2.7.6/tests/oneof/
Ddecode_oneof.c94 size_t count; in main() local
105 count = fread(buffer, 1, sizeof(buffer), stdin); in main()
117 stream = pb_istream_from_buffer(buffer, count); in main()
123 stream = pb_istream_from_buffer(buffer, count); in main()
/nanopb-2.7.6/
Dpb_encode.c23 static bool checkreturn buf_write(pb_ostream_t *stream, const pb_byte_t *buf, size_t count);
52 static bool checkreturn buf_write(pb_ostream_t *stream, const pb_byte_t *buf, size_t count) in buf_write() argument
56 stream->state = dest + count; in buf_write()
58 for (i = 0; i < count; i++) in buf_write()
81 bool checkreturn pb_write(pb_ostream_t *stream, const pb_byte_t *buf, size_t count) in pb_write() argument
83 if (count > 0 && stream->callback != NULL) in pb_write()
85 if (stream->bytes_written + count < stream->bytes_written || in pb_write()
86 stream->bytes_written + count > stream->max_size) in pb_write()
92 if (!buf_write(stream, buf, count)) in pb_write()
95 if (!stream->callback(stream, buf, count)) in pb_write()
[all …]
Dpb_encode.h38 bool (*callback)(pb_ostream_t *stream, const pb_byte_t *buf, size_t count);
124 bool pb_write(pb_ostream_t *stream, const pb_byte_t *buf, size_t count);
Dpb_decode.h37 bool (*callback)(pb_istream_t *stream, pb_byte_t *buf, size_t count);
139 bool pb_read(pb_istream_t *stream, pb_byte_t *buf, size_t count);
/nanopb-2.7.6/tests/oneof_callback/
Ddecode_oneof.c126 size_t count; in main() local
129 count = fread(buffer, 1, sizeof(buffer), stdin); in main()
140 stream = pb_istream_from_buffer(buffer, count); in main()
/nanopb-2.7.6/examples/using_union_messages/
Ddecode.c60 size_t count = fread(buffer, 1, sizeof(buffer), stdin); in main() local
61 pb_istream_t stream = pb_istream_from_buffer(buffer, count); in main()
/nanopb-2.7.6/tests/raw_decode/
Draw_decode.c17 bool callback(pb_istream_t *stream, uint8_t *buf, size_t count) in callback() argument
20 size_t len = fread(buf, 1, count, file); in callback()
34 if (len == count) in callback()
/nanopb-2.7.6/tests/fixed_count/
DSConscript1 # Test that fixed count option works.
/nanopb-2.7.6/spm_headers/nanopb/
Dpb_encode.h38 bool (*callback)(pb_ostream_t *stream, const pb_byte_t *buf, size_t count);
124 bool pb_write(pb_ostream_t *stream, const pb_byte_t *buf, size_t count);
Dpb_decode.h37 bool (*callback)(pb_istream_t *stream, pb_byte_t *buf, size_t count);
139 bool pb_read(pb_istream_t *stream, pb_byte_t *buf, size_t count);

12