MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / ReadAttributeSet

Function ReadAttributeSet

src/effects/effects_apply.c:26–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26static AttributeSet ReadAttributeSet
27(
28 FILE *stream
29) {
30 //--------------------------------------------------------------------------
31 // effect format:
32 // attribute count
33 // attributes (id,value) pair
34 //--------------------------------------------------------------------------
35
36 //--------------------------------------------------------------------------
37 // read attribute count
38 //--------------------------------------------------------------------------
39
40 ushort attr_count;
41 fread_assert(&attr_count, sizeof(attr_count), stream);
42
43 //--------------------------------------------------------------------------
44 // read attributes
45 //--------------------------------------------------------------------------
46
47 SIValue values[attr_count];
48 Attribute_ID ids[attr_count];
49
50 for(ushort i = 0; i < attr_count; i++) {
51 // read attribute ID
52 fread_assert(ids + i, sizeof(Attribute_ID), stream);
53
54 // read attribute value
55 values[i] = SIValue_FromBinary(stream);
56 }
57
58 AttributeSet attr_set = NULL;
59 AttributeSet_AddNoClone(&attr_set, ids, values, attr_count, false);
60
61 return attr_set;
62}
63
64static void ApplyCreateNode
65(

Callers 2

ApplyCreateNodeFunction · 0.85
ApplyCreateEdgeFunction · 0.85

Calls 2

SIValue_FromBinaryFunction · 0.85
AttributeSet_AddNoCloneFunction · 0.85

Tested by

no test coverage detected