MCPcopy Create free account
hub / github.com/apache/qpid-proton / pni_inspect_atom

Function pni_inspect_atom

c/src/core/codec.c:113–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113void pni_inspect_atom(pn_atom_t *atom, pn_fixed_string_t *str)
114{
115 switch (atom->type) {
116 case PN_NULL:
117 pn_fixed_string_addf(str, "null");
118 return;
119 case PN_BOOL:
120 pn_fixed_string_addf(str, atom->u.as_bool ? "true" : "false");
121 return;
122 case PN_UBYTE:
123 pn_fixed_string_addf(str, "%" PRIu8, atom->u.as_ubyte);
124 return;
125 case PN_BYTE:
126 pn_fixed_string_addf(str, "%" PRIi8, atom->u.as_byte);
127 return;
128 case PN_USHORT:
129 pn_fixed_string_addf(str, "%" PRIu16, atom->u.as_ushort);
130 return;
131 case PN_SHORT:
132 pn_fixed_string_addf(str, "%" PRIi16, atom->u.as_short);
133 return;
134 case PN_UINT:
135 pn_fixed_string_addf(str, "%" PRIu32, atom->u.as_uint);
136 return;
137 case PN_INT:
138 pn_fixed_string_addf(str, "%" PRIi32, atom->u.as_int);
139 return;
140 case PN_CHAR:
141 pn_fixed_string_addf(str, "%c", atom->u.as_char);
142 return;
143 case PN_ULONG:
144 pn_fixed_string_addf(str, "%" PRIu64, atom->u.as_ulong);
145 return;
146 case PN_LONG:
147 pn_fixed_string_addf(str, "%" PRIi64, atom->u.as_long);
148 return;
149 case PN_TIMESTAMP:
150 pn_fixed_string_addf(str, "%" PRIi64, atom->u.as_timestamp);
151 return;
152 case PN_FLOAT:
153 pn_fixed_string_addf(str, "%g", atom->u.as_float);
154 return;
155 case PN_DOUBLE:
156 pn_fixed_string_addf(str, "%g", atom->u.as_double);
157 return;
158 case PN_DECIMAL32:
159 pn_fixed_string_addf(str, "D32(%" PRIu32 ")", atom->u.as_decimal32);
160 return;
161 case PN_DECIMAL64:
162 pn_fixed_string_addf(str, "D64(%" PRIu64 ")", atom->u.as_decimal64);
163 return;
164 case PN_DECIMAL128:
165 pn_fixed_string_addf(str, "D128(%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
166 "%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
167 "%02hhx%02hhx)",
168 atom->u.as_decimal128.bytes[0],
169 atom->u.as_decimal128.bytes[1],
170 atom->u.as_decimal128.bytes[2],

Callers 3

pni_inspect_enterFunction · 0.85
pn_data_dumpFunction · 0.85
pn_message_inspectFunction · 0.85

Calls 2

pn_fixed_string_addfFunction · 0.85
pn_fixed_string_quoteFunction · 0.85

Tested by

no test coverage detected