Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 36) sorted by relevance

12

/nanopb-2.7.6/tests/common/
Dmalloc_wrappers.c56 char *buf = NULL; in malloc_with_check() local
60 buf = malloc(round_blocksize(size + GUARD_SIZE)); in malloc_with_check()
63 if (buf) in malloc_with_check()
65 ((size_t*)buf)[0] = size; in malloc_with_check()
66 ((size_t*)buf)[1] = CHECK1; in malloc_with_check()
67 ((size_t*)(buf + size))[2] = CHECK2; in malloc_with_check()
70 …if (DEBUG_MALLOC) fprintf(stderr, "Alloc 0x%04x/%u\n", (unsigned)(uintptr_t)(buf + PREFIX_SIZE), (… in malloc_with_check()
71 return buf + PREFIX_SIZE; in malloc_with_check()
85 char *buf = (char*)mem - PREFIX_SIZE; in free_with_check() local
86 size_t size = ((size_t*)buf)[0]; in free_with_check()
[all …]
/nanopb-2.7.6/tests/regression/issue_166/
Denum_encoded_size.c11 uint8_t buf[256]; in main() local
20 s = pb_ostream_from_buffer(buf, sizeof(buf)); in main()
27 s = pb_ostream_from_buffer(buf, sizeof(buf)); in main()
36 s = pb_ostream_from_buffer(buf, sizeof(buf)); in main()
/nanopb-2.7.6/tests/fuzztest/
Drandom_data.c78 void rand_fill(uint8_t *buf, size_t count) in rand_fill() argument
82 *buf++ = rand_byte(); in rand_fill()
87 size_t rand_fill_protobuf(uint8_t *buf, size_t min_bytes, size_t max_bytes, int min_tag) in rand_fill_protobuf() argument
89 pb_ostream_t stream = pb_ostream_from_buffer(buf, max_bytes); in rand_fill_protobuf()
120 uint8_t *buf; in rand_fill_protobuf() local
127 buf = malloc(len); in rand_fill_protobuf()
129 rand_fill(buf, len); in rand_fill_protobuf()
130 pb_write(&stream, buf, len); in rand_fill_protobuf()
131 free(buf); in rand_fill_protobuf()
139 void rand_mess(uint8_t *buf, size_t count) in rand_mess() argument
[all …]
Drandom_data.h30 void rand_fill(uint8_t *buf, size_t count);
33 size_t rand_fill_protobuf(uint8_t *buf, size_t min_bytes, size_t max_bytes, int min_tag);
36 void rand_mess(uint8_t *buf, size_t count);
Dgenerate_message.c55 static uint8_t buf[FUZZTEST_BUFSIZE]; in generate_message() local
68 stream = pb_ostream_from_buffer(buf, sizeof(buf)); in generate_message()
71 fwrite(buf, 1, stream.bytes_written, stdout); in generate_message()
Dflakystream.c4 bool flakystream_callback(pb_istream_t *stream, pb_byte_t *buf, size_t count) in flakystream_callback() argument
18 memcpy(buf, state->buffer + state->position, count); in flakystream_callback()
/nanopb-2.7.6/tests/float_double_conversion/
Dfloat_double_conversion.c34 uint8_t buf[16]; in main() local
48 pb_ostream_t stream = pb_ostream_from_buffer(buf, sizeof(buf)); in main()
59 pb_istream_t stream = pb_istream_from_buffer(buf, msglen); in main()
65 ostream = pb_ostream_from_buffer(buf, sizeof(buf)); in main()
73 pb_istream_t stream = pb_istream_from_buffer(buf, msglen); in main()
/nanopb-2.7.6/tests/regression/issue_227/
Dunaligned_uint64.c6 uint8_t buf[128]; in main() local
7 pb_ostream_t stream = pb_ostream_from_buffer(buf, sizeof(buf)); in main()
/nanopb-2.7.6/tests/regression/issue_547/
Dtest.c8 pb_byte_t buf[512]; in main() local
10 pb_ostream_t stream = pb_ostream_from_buffer(buf, sizeof(buf)); in main()
/nanopb-2.7.6/tests/regression/issue_247/
Dpadding.c21 pb_byte_t buf[128] = {0}; in main() local
22 pb_ostream_t stream = pb_ostream_from_buffer(buf, sizeof(buf)); in main()
/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
25 result = recv(fd, buf, count, MSG_WAITALL); in read_callback()
/nanopb-2.7.6/tests/regression/issue_558/
Dmixed.c10 pb_byte_t buf[64]; in main() local
14 pb_ostream_t ostream = pb_ostream_from_buffer(buf, sizeof(buf)); in main()
32 pb_istream_t istream = pb_istream_from_buffer(buf, msglen); in main()
/nanopb-2.7.6/tests/enum_sizes/
Denumsizes_unittests.c21 uint8_t buf[256]; in main() local
26 pb_ostream_t s = pb_ostream_from_buffer(buf, sizeof(buf)); in main()
33 pb_istream_t s = pb_istream_from_buffer(buf, msgsize); in main()
48 pb_ostream_t s = pb_ostream_from_buffer(buf, sizeof(buf)); in main()
55 pb_istream_t s = pb_istream_from_buffer(buf, msgsize); in main()
/nanopb-2.7.6/tests/regression/issue_229/
Dmultiple_oneof.c9 uint8_t buf[128]; in main() local
13 pb_ostream_t stream = pb_ostream_from_buffer(buf, sizeof(buf)); in main()
24 pb_istream_t stream = pb_istream_from_buffer(buf, msglen); in main()
/nanopb-2.7.6/tests/proto3_optional/
Doptional.c9 uint8_t buf[256]; in main() local
14 pb_ostream_t stream = pb_ostream_from_buffer(buf, sizeof(buf)); in main()
28 pb_istream_t stream = pb_istream_from_buffer(buf, msglen); in main()
/nanopb-2.7.6/tests/regression/issue_544/
Dsubmsg_callback.c24 pb_byte_t buf[64]; in main() local
28 pb_ostream_t ostream = pb_ostream_from_buffer(buf, sizeof(buf)); in main()
45 pb_istream_t istream = pb_istream_from_buffer(buf, msglen); in main()
/nanopb-2.7.6/tests/regression/issue_249/
Dtest.c36 pb_byte_t buf[128] = {0}; in main() local
41 pb_ostream_t stream = pb_ostream_from_buffer(buf, sizeof(buf)); in main()
49 pb_istream_t stream = pb_istream_from_buffer(buf, msglen); in main()
/nanopb-2.7.6/tests/sort_by_tag/
Dsort_by_tag.c10 pb_byte_t buf[256]; in main() local
13 pb_ostream_t ostream = pb_ostream_from_buffer(buf, sizeof(buf)); in main()
35 pb_istream_t istream = pb_istream_from_buffer(buf, msglen); in main()
/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()
/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()
/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
26 *buf++ = *state->buffer++; in read_callback()
31 bool write_callback(pb_ostream_t *stream, const uint8_t *buf, size_t count) in write_callback() argument
40 *state->buffer++ = *buf++; in write_callback()
/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()
25 memcpy(g_history + HISTORY_LEN - len, buf, len); in callback()
29 memcpy(g_history, buf + len - HISTORY_LEN, HISTORY_LEN); in callback()
/nanopb-2.7.6/
Dpb_encode.h38 bool (*callback)(pb_ostream_t *stream, const pb_byte_t *buf, size_t count);
104 pb_ostream_t pb_ostream_from_buffer(pb_byte_t *buf, size_t bufsize);
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);
134 pb_istream_t pb_istream_from_buffer(const pb_byte_t *buf, size_t msglen);
139 bool pb_read(pb_istream_t *stream, pb_byte_t *buf, size_t count);
/nanopb-2.7.6/spm_headers/nanopb/
Dpb_encode.h38 bool (*callback)(pb_ostream_t *stream, const pb_byte_t *buf, size_t count);
104 pb_ostream_t pb_ostream_from_buffer(pb_byte_t *buf, size_t bufsize);
124 bool pb_write(pb_ostream_t *stream, const pb_byte_t *buf, size_t count);

12