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

Function pn_data_vscan

c/src/core/codec.c:845–1229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

843static pni_node_t *pni_data_peek(pn_data_t *data);
844
845int pn_data_vscan(pn_data_t *data, const char *fmt, va_list ap)
846{
847 pn_data_rewind(data);
848 bool *scanarg = NULL;
849 bool at = false;
850 int level = 0;
851 int count_level = -1;
852 int resume_count = 0;
853
854 while (*fmt) {
855 char code = *(fmt++);
856
857 bool found = false;
858 pn_type_t type;
859
860 bool scanned = false;
861 bool suspend = resume_count > 0;
862
863 switch (code) {
864 case 'n':
865 found = pn_scan_next(data, &type, suspend);
866 if (found && type == PN_NULL) {
867 scanned = true;
868 } else {
869 scanned = false;
870 }
871 if (resume_count && level == count_level) resume_count--;
872 break;
873 case 'o':
874 {
875 bool *value = va_arg(ap, bool *);
876 found = pn_scan_next(data, &type, suspend);
877 if (found && type == PN_BOOL) {
878 *value = pn_data_get_bool(data);
879 scanned = true;
880 } else {
881 *value = 0;
882 scanned = false;
883 }
884 }
885 if (resume_count && level == count_level) resume_count--;
886 break;
887 case 'B':
888 {
889 uint8_t *value = va_arg(ap, uint8_t *);
890 found = pn_scan_next(data, &type, suspend);
891 if (found && type == PN_UBYTE) {
892 *value = pn_data_get_ubyte(data);
893 scanned = true;
894 } else {
895 *value = 0;
896 scanned = false;
897 }
898 }
899 if (resume_count && level == count_level) resume_count--;
900 break;
901 case 'b':
902 {

Callers 1

pn_data_scanFunction · 0.85

Calls 15

pn_data_rewindFunction · 0.85
pn_scan_nextFunction · 0.85
pn_data_get_boolFunction · 0.85
pn_data_get_ubyteFunction · 0.85
pn_data_get_byteFunction · 0.85
pn_data_get_ushortFunction · 0.85
pn_data_get_shortFunction · 0.85
pn_data_get_uintFunction · 0.85
pn_data_get_intFunction · 0.85
pn_data_get_charFunction · 0.85
pn_data_get_ulongFunction · 0.85
pn_data_get_longFunction · 0.85

Tested by

no test coverage detected