Home
last modified time | relevance | path

Searched refs:arg (Results 1 – 24 of 24) sorted by relevance

/nanopb-2.7.6/tests/alltypes_callback/
Dencode_alltypes_callback.c13 static bool write_varint(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_varint() argument
16 pb_encode_varint(stream, (intptr_t)*arg); in write_varint()
19 static bool write_svarint(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_svarint() argument
22 pb_encode_svarint(stream, (intptr_t)*arg); in write_svarint()
25 static bool write_fixed32(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_fixed32() argument
28 pb_encode_fixed32(stream, *arg); in write_fixed32()
31 static bool write_fixed64(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_fixed64() argument
34 pb_encode_fixed64(stream, *arg); in write_fixed64()
37 static bool write_double(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_double() argument
42 pb_encode_float_as_double(stream, *(float*)*arg); in write_double()
[all …]
Ddecode_alltypes_callback.c18 static bool read_varint(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_varint() argument
24 TEST((int64_t)value == (intptr_t)*arg); in read_varint()
28 static bool read_svarint(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_svarint() argument
34 TEST(value == (intptr_t)*arg); in read_svarint()
38 static bool read_fixed32(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_fixed32() argument
44 TEST(value == *(uint32_t*)*arg); in read_fixed32()
48 static bool read_fixed64(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_fixed64() argument
54 TEST(value == *(uint64_t*)*arg); in read_fixed64()
58 static bool read_double(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_double() argument
67 TEST(memcmp(&value, *arg, sizeof(float)) == 0); in read_double()
[all …]
/nanopb-2.7.6/tests/alltypes_proto3_callback/
Ddecode_alltypes_callback.c18 static bool read_varint(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_varint() argument
24 TEST((int64_t)value == (intptr_t)*arg); in read_varint()
28 static bool read_svarint(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_svarint() argument
34 TEST(value == (intptr_t)*arg); in read_svarint()
38 static bool read_fixed32(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_fixed32() argument
44 TEST(value == *(uint32_t*)*arg); in read_fixed32()
48 static bool read_fixed64(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_fixed64() argument
54 TEST(value == *(uint64_t*)*arg); in read_fixed64()
58 static bool read_double(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_double() argument
67 TEST(memcmp(&value, *arg, sizeof(float)) == 0); in read_double()
[all …]
Dencode_alltypes_callback.c13 static bool write_varint(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_varint() argument
16 pb_encode_varint(stream, (intptr_t)*arg); in write_varint()
19 static bool write_svarint(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_svarint() argument
22 pb_encode_svarint(stream, (intptr_t)*arg); in write_svarint()
25 static bool write_fixed32(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_fixed32() argument
28 pb_encode_fixed32(stream, *arg); in write_fixed32()
31 static bool write_fixed64(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_fixed64() argument
34 pb_encode_fixed64(stream, *arg); in write_fixed64()
37 static bool write_double(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_double() argument
42 pb_encode_float_as_double(stream, *(float*)*arg); in write_double()
[all …]
/nanopb-2.7.6/tests/callbacks/
Ddecode_callbacks.c10 bool print_string(pb_istream_t *stream, const pb_field_t *field, void **arg) in print_string() argument
24 printf((char*)*arg, buffer); in print_string()
28 bool print_int32(pb_istream_t *stream, const pb_field_t *field, void **arg) in print_int32() argument
34 printf((char*)*arg, (long)value); in print_int32()
38 bool print_fixed32(pb_istream_t *stream, const pb_field_t *field, void **arg) in print_fixed32() argument
44 printf((char*)*arg, (long)value); in print_fixed32()
48 bool print_fixed64(pb_istream_t *stream, const pb_field_t *field, void **arg) in print_fixed64() argument
54 printf((char*)*arg, (long)value); in print_fixed64()
74 testmessage.submsg.stringvalue.arg = "submsg {\n stringvalue: \"%s\"\n"; in main()
76 testmessage.submsg.int32value.arg = " int32value: %ld\n"; in main()
[all …]
Dencode_callbacks.c9 bool encode_string(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in encode_string() argument
19 bool encode_int32(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in encode_int32() argument
27 bool encode_fixed32(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in encode_fixed32() argument
37 bool encode_fixed64(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in encode_fixed64() argument
47 bool encode_repeatedstring(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in encode_repeatedstring() argument
/nanopb-2.7.6/tests/cyclic_messages/
Dencode_cyclic_callback.c33 static bool encode_tree(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in encode_tree() argument
36 char *p = (char*)*arg; in encode_tree()
43 tree.left.arg = p; in encode_tree()
47 tree.right.arg = p; in encode_tree()
61 static bool encode_dictionary(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in encode_dictionary() argument
64 char *p = (char*)*arg; in encode_dictionary()
85 pair.treeValue.arg = p; in encode_dictionary()
101 pair.dictValue.dictItem.arg = p; in encode_dictionary()
136 dict.dictItem.arg = argv[1]; in main()
/nanopb-2.7.6/tests/oneof_callback/
Ddecode_oneof.c45 bool print_int32(pb_istream_t *stream, const pb_field_t *field, void **arg) in print_int32() argument
51 printf((char*)*arg, (int)value); in print_int32()
55 bool print_string(pb_istream_t *stream, const pb_field_t *field, void **arg) in print_string() argument
71 printf((char*)*arg, buffer); in print_string()
81 bool msg_callback(pb_istream_t *stream, const pb_field_t *field, void **arg) in msg_callback() argument
95 msg->array.arg = " array: %d\n"; in msg_callback()
102 msg->strvalue.arg = " strvalue: \"%s\"\n"; in msg_callback()
Dencode_oneof.c35 bool encode_int32_array(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in encode_int32_array() argument
49 bool encode_string(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in encode_string() argument
/nanopb-2.7.6/tests/regression/issue_249/
Dtest.c6 static bool write_array(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_array() argument
20 static bool read_array(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_array() argument
23 int *sum = *arg; in read_array()
52 msg.submsg.foo.arg = ∑ in main()
/nanopb-2.7.6/tests/fuzztest/
Dfuzztest.c144 static bool field_callback(pb_istream_t *stream, const pb_field_t *field, void **arg) in field_callback() argument
148 assert(*arg == &g_sentinel); in field_callback()
152 static bool submsg_callback(pb_istream_t *stream, const pb_field_t *field, void **arg) in submsg_callback() argument
156 assert(*arg == &g_sentinel); in submsg_callback()
172 msg->rep_int32.arg = &g_sentinel; in do_callback_decode()
174 msg->rep_string.arg = &g_sentinel; in do_callback_decode()
176 msg->rep_farray.arg = &g_sentinel; in do_callback_decode()
178 msg->req_limits.int64_min.arg = &g_sentinel; in do_callback_decode()
180 msg->cb_oneof.arg = &g_sentinel; in do_callback_decode()
/nanopb-2.7.6/tests/regression/issue_342/
Dtest_extensions.c9 static bool write_string(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_string() argument
/nanopb-2.7.6/tests/regression/issue_544/
Dsubmsg_callback.c6 bool msg_callback(pb_istream_t *stream, const pb_field_t *field, void **arg) in msg_callback() argument
/nanopb-2.7.6/tests/encode_unittests/
Dencode_unittests.c21 bool fieldcallback(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in fieldcallback() argument
29 bool crazyfieldcallback(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in crazyfieldcallback() argument
32 uint32_t *state = (uint32_t*)arg; in crazyfieldcallback()
386 msg.submsg.data.arg = &state; in main()
388 msg2.submsg.submsg.data.arg = &state; in main()
/nanopb-2.7.6/
Dpb_common.c168 const pb_msgdesc_t *msg = (const pb_msgdesc_t*)extension->type->arg; in pb_field_iter_begin_extension()
310 return pCallback->funcs.decode(istream, field, &pCallback->arg); in pb_default_field_callback()
315 return pCallback->funcs.encode(ostream, field, &pCallback->arg); in pb_default_field_callback()
Dpb.h365 bool (*decode)(pb_istream_t *stream, const pb_field_t *field, void **arg);
366 bool (*encode)(pb_ostream_t *stream, const pb_field_t *field, void * const *arg);
370 void *arg; member
410 const void *arg; member
Dpb_encode.c927 if (!callback->funcs.encode(stream, field, &callback->arg)) in pb_enc_submessage()
Dpb_decode.c1589 status = callback->funcs.decode(&substream, field, &callback->arg); in pb_dec_submessage()
/nanopb-2.7.6/tests/mem_release/
Dmem_release.c205 static bool dummy_decode_cb(pb_istream_t *stream, const pb_field_t *field, void **arg) in dummy_decode_cb() argument
231 msg.subs.arg = NULL; in test_Garbage()
/nanopb-2.7.6/docs/
Dconcepts.md238 function pointer and a `void` pointer called `arg` you can use for
240 will be skipped. A pointer to the `arg` is passed to the function, so
253 bool (*encode)(pb_ostream_t *stream, const pb_field_iter_t *field, void * const *arg);
259 | `arg` | Pointer to the `arg` field in the `pb_callback_t` structure. |
279 bool write_string(pb_ostream_t *stream, const pb_field_iter_t *field, void * const *arg)
290 bool (*decode)(pb_istream_t *stream, const pb_field_iter_t *field, void **arg);
296 | `arg` | Pointer to the `arg` field in the `pb_callback_t` structure. |
310 bool read_ints(pb_istream_t *stream, const pb_field_iter_t *field, void **arg)
Dreference.md322 bool (*decode)(pb_istream_t *stream, const pb_field_iter_t *field, void **arg);
323 bool (*encode)(pb_ostream_t *stream, const pb_field_iter_t *field, void * const *arg);
326 void *arg;
329 A pointer to the *arg* is passed to the callback when calling. It can be
331 this is a double pointer. If you set `field.arg` to point to
334 myfunction(*arg); /* Gives pointer to data as argument */
335 myfunction(*(data_t*)*arg); /* Gives value of data as argument */
336 *arg = newdata; /* Alters value of field.arg in structure */
366 const void *arg;
371 assume that `arg` points to a [pb_field_iter_t](#pb_field_iter_t)
Dmigration.md524 - Change the callback function body to use **arg` instead of `arg`.
/nanopb-2.7.6/tests/decode_unittests/
Ddecode_unittests.c24 bool callback_check(pb_istream_t *stream, const pb_field_t *field, void **arg) in callback_check() argument
28 pb_bytes_array_t *ref = (pb_bytes_array_t*) *arg; in callback_check()
355 dest.data.arg = &ref; in main()
/nanopb-2.7.6/spm_headers/nanopb/
Dpb.h365 bool (*decode)(pb_istream_t *stream, const pb_field_t *field, void **arg);
366 bool (*encode)(pb_ostream_t *stream, const pb_field_t *field, void * const *arg);
370 void *arg; member
410 const void *arg; member