MCPcopy Create free account
hub / github.com/MariaDB/server / json_norm_value_init

Function json_norm_value_init

strings/json_normalize.c:753–802  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

751
752
753static int
754json_norm_value_init(struct json_norm_value *val, json_engine_t *je)
755{
756 int err= 0;
757 switch (je->value_type) {
758 case JSON_VALUE_STRING:
759 {
760 const char *je_value_begin= (const char *)je->value_begin;
761 size_t je_value_len= (je->value_end - je->value_begin);
762 err= json_norm_value_string_init(val, je_value_begin, je_value_len);
763 break;
764 }
765 case JSON_VALUE_NULL:
766 {
767 json_norm_value_null_init(val);
768 break;
769 }
770 case JSON_VALUE_TRUE:
771 {
772 json_norm_value_true_init(val);
773 break;
774 }
775 case JSON_VALUE_FALSE:
776 {
777 json_norm_value_false_init(val);
778 break;
779 }
780 case JSON_VALUE_ARRAY:
781 {
782 err= json_norm_value_array_init(val);
783 break;
784 }
785 case JSON_VALUE_OBJECT:
786 {
787 err= json_norm_value_object_init(val);
788 break;
789 }
790 case JSON_VALUE_NUMBER:
791 {
792 const char *je_number_begin= (const char *)je->value_begin;
793 size_t je_number_len= (je->value_end - je->value_begin);
794 err= json_norm_value_number_init(val, je_number_begin, je_number_len);
795 break;
796 }
797 default:
798 DBUG_ASSERT(0);
799 return 1;
800 }
801 return err;
802}
803
804
805static int

Callers 3

json_norm_buildFunction · 0.85

Tested by

no test coverage detected