1+ // Code generated by bitproto. DO NOT EDIT.
2+
3+ #include "bitproto.h"
4+ #include "test_bp.h"
5+
6+ void BpXXXProcessArrayMyMessage3 (void * data , struct BpProcessorContext * ctx ) {
7+ struct BpArrayDescriptor descriptor = BpArrayDescriptor (false, 1 , BpByte ());
8+ BpEndecodeArray (& descriptor , ctx , data );
9+ }
10+
11+ void BpXXXJsonFormatArrayMyMessage3 (void * data , struct BpJsonFormatContext * ctx ) {
12+ struct BpArrayDescriptor descriptor = BpArrayDescriptor (false, 1 , BpByte ());
13+ BpJsonFormatArray (& descriptor , ctx , data );
14+ }
15+
16+ void BpFieldDescriptorsInitMyMessage (struct MyMessage * m , struct BpMessageFieldDescriptor * fds ) {
17+ fds [0 ] = BpMessageFieldDescriptor ((void * )& (m -> payload ), BpArray (8 , 1 * sizeof (unsigned char ), BpXXXProcessArrayMyMessage3 , BpXXXJsonFormatArrayMyMessage3 ), "payload" );
18+ }
19+
20+ void BpXXXProcessMyMessage (void * data , struct BpProcessorContext * ctx ) {
21+ struct MyMessage * m = (struct MyMessage * )(data );
22+ struct BpMessageFieldDescriptor field_descriptors [1 ];
23+ BpFieldDescriptorsInitMyMessage (m , field_descriptors );
24+ struct BpMessageDescriptor descriptor = BpMessageDescriptor (false, 1 , 8 , field_descriptors );
25+ BpEndecodeMessage (& descriptor , ctx , data );
26+ }
27+
28+ void BpXXXJsonFormatMyMessage (void * data , struct BpJsonFormatContext * ctx ) {
29+ struct MyMessage * m = (struct MyMessage * )(data );
30+ struct BpMessageFieldDescriptor field_descriptors [1 ];
31+ BpFieldDescriptorsInitMyMessage (m , field_descriptors );
32+ struct BpMessageDescriptor descriptor = BpMessageDescriptor (false, 1 , 8 , field_descriptors );
33+ BpJsonFormatMessage (& descriptor , ctx , data );
34+ }
35+
36+ int EncodeMyMessage (struct MyMessage * m , unsigned char * s ) {
37+ struct BpProcessorContext ctx = BpProcessorContext (true, s );
38+ BpXXXProcessMyMessage ((void * )m , & ctx );
39+ return 0 ;
40+ }
41+
42+ int DecodeMyMessage (struct MyMessage * m , unsigned char * s ) {
43+ struct BpProcessorContext ctx = BpProcessorContext (false, s );
44+ BpXXXProcessMyMessage ((void * )m , & ctx );
45+ return 0 ;
46+ }
47+
48+ int JsonMyMessage (struct MyMessage * m , char * s ) {
49+ struct BpJsonFormatContext ctx = BpJsonFormatContext (s );
50+ BpXXXJsonFormatMyMessage ((void * )m , & ctx );
51+ return ctx .n ;
52+ }
53+
54+ void BpFieldDescriptorsInitMyPayload (struct MyPayload * m , struct BpMessageFieldDescriptor * fds ) {
55+ }
56+
57+ void BpXXXProcessMyPayload (void * data , struct BpProcessorContext * ctx ) {
58+ struct MyPayload * m = (struct MyPayload * )(data );
59+ struct BpMessageFieldDescriptor field_descriptors [0 ];
60+ BpFieldDescriptorsInitMyPayload (m , field_descriptors );
61+ struct BpMessageDescriptor descriptor = BpMessageDescriptor (false, 0 , 0 , field_descriptors );
62+ BpEndecodeMessage (& descriptor , ctx , data );
63+ }
64+
65+ void BpXXXJsonFormatMyPayload (void * data , struct BpJsonFormatContext * ctx ) {
66+ struct MyPayload * m = (struct MyPayload * )(data );
67+ struct BpMessageFieldDescriptor field_descriptors [0 ];
68+ BpFieldDescriptorsInitMyPayload (m , field_descriptors );
69+ struct BpMessageDescriptor descriptor = BpMessageDescriptor (false, 0 , 0 , field_descriptors );
70+ BpJsonFormatMessage (& descriptor , ctx , data );
71+ }
72+
73+ int EncodeMyPayload (struct MyPayload * m , unsigned char * s ) {
74+ struct BpProcessorContext ctx = BpProcessorContext (true, s );
75+ BpXXXProcessMyPayload ((void * )m , & ctx );
76+ return 0 ;
77+ }
78+
79+ int DecodeMyPayload (struct MyPayload * m , unsigned char * s ) {
80+ struct BpProcessorContext ctx = BpProcessorContext (false, s );
81+ BpXXXProcessMyPayload ((void * )m , & ctx );
82+ return 0 ;
83+ }
84+
85+ int JsonMyPayload (struct MyPayload * m , char * s ) {
86+ struct BpJsonFormatContext ctx = BpJsonFormatContext (s );
87+ BpXXXJsonFormatMyPayload ((void * )m , & ctx );
88+ return ctx .n ;
89+ }
90+
91+ void BpFieldDescriptorsInitMyOtherPayload (struct MyOtherPayload * m , struct BpMessageFieldDescriptor * fds ) {
92+ }
93+
94+ void BpXXXProcessMyOtherPayload (void * data , struct BpProcessorContext * ctx ) {
95+ struct MyOtherPayload * m = (struct MyOtherPayload * )(data );
96+ struct BpMessageFieldDescriptor field_descriptors [0 ];
97+ BpFieldDescriptorsInitMyOtherPayload (m , field_descriptors );
98+ struct BpMessageDescriptor descriptor = BpMessageDescriptor (false, 0 , 0 , field_descriptors );
99+ BpEndecodeMessage (& descriptor , ctx , data );
100+ }
101+
102+ void BpXXXJsonFormatMyOtherPayload (void * data , struct BpJsonFormatContext * ctx ) {
103+ struct MyOtherPayload * m = (struct MyOtherPayload * )(data );
104+ struct BpMessageFieldDescriptor field_descriptors [0 ];
105+ BpFieldDescriptorsInitMyOtherPayload (m , field_descriptors );
106+ struct BpMessageDescriptor descriptor = BpMessageDescriptor (false, 0 , 0 , field_descriptors );
107+ BpJsonFormatMessage (& descriptor , ctx , data );
108+ }
109+
110+ int EncodeMyOtherPayload (struct MyOtherPayload * m , unsigned char * s ) {
111+ struct BpProcessorContext ctx = BpProcessorContext (true, s );
112+ BpXXXProcessMyOtherPayload ((void * )m , & ctx );
113+ return 0 ;
114+ }
115+
116+ int DecodeMyOtherPayload (struct MyOtherPayload * m , unsigned char * s ) {
117+ struct BpProcessorContext ctx = BpProcessorContext (false, s );
118+ BpXXXProcessMyOtherPayload ((void * )m , & ctx );
119+ return 0 ;
120+ }
121+
122+ int JsonMyOtherPayload (struct MyOtherPayload * m , char * s ) {
123+ struct BpJsonFormatContext ctx = BpJsonFormatContext (s );
124+ BpXXXJsonFormatMyOtherPayload ((void * )m , & ctx );
125+ return ctx .n ;
126+ }
0 commit comments