MCPcopy Create free account
hub / github.com/acl-dev/acl / json_element

Function json_element

lib_acl/src/json/acl_json_parse.c:472–504  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

470}
471
472static const char *json_element(ACL_JSON *json, const char *data)
473{
474 /* ���������Ա���� */
475 ACL_JSON_NODE *element;
476
477 SKIP_SPACE(data);
478 if (*data == 0)
479 return data;
480
481 if (*data == '{') {
482 data++;
483 json->status = ACL_JSON_S_OBJ;
484 return data;
485 } else if (*data == '[') {
486 data++;
487 json->status = ACL_JSON_S_ARRAY;
488 return data;
489 }
490
491 element = acl_json_node_alloc(json);
492 element->type = ACL_JSON_T_ELEMENT;
493 element->depth = json->curr_node->depth + 1;
494 if (element->depth > json->depth)
495 json->depth = element->depth;
496
497 acl_json_node_add_child(json->curr_node, element);
498
499 /* ���������Ա������Ϊ��ǰ JSON �����ڵ� */
500 json->curr_node = element;
501 json->status = ACL_JSON_S_VALUE;
502
503 return data;
504}
505
506/* ������ǩֵ����ֵ�п����Ǵ��ı�(���ýڵ�ΪҶ�ڵ�)��Ҳ�п�����һ���ӽڵ� */
507

Callers

nothing calls this directly

Calls 2

acl_json_node_allocFunction · 0.85
acl_json_node_add_childFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…