durable_rules 0.34.29 → 0.34.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/src/rules/state.h CHANGED
@@ -1,16 +1,22 @@
1
1
 
2
- #define HASH_ID 5863474
3
- #define HASH_SID 193505797
2
+ #define HASH_ID 926444256
3
+ #define HASH_SID 3593476751
4
4
  #define UNDEFINED_INDEX 0xFFFFFFFF
5
- #define MAX_STATE_PROPERTIES 64
6
5
  #define MAX_NAME_LENGTH 256
6
+ #define SID_BUFFER_LENGTH 2
7
+ #define ID_BUFFER_LENGTH 21
7
8
  #define UNDEFINED_HASH_OFFSET 0xFFFFFFFF
8
9
 
10
+ #define JSON_OBJECT_SEQUENCED 1
11
+ #define JSON_OBJECT_HASHED 2
12
+
13
+ #define MAX_OBJECT_PROPERTIES 64
14
+
9
15
  typedef struct jsonProperty {
10
16
  unsigned int hash;
11
17
  unsigned char type;
12
18
  unsigned char isMaterial;
13
- unsigned short valueOffset;
19
+ char *valueString;
14
20
  unsigned short valueLength;
15
21
  char name[MAX_NAME_LENGTH];
16
22
  unsigned short nameLength;
@@ -21,6 +27,15 @@ typedef struct jsonProperty {
21
27
  } value;
22
28
  } jsonProperty;
23
29
 
30
+ typedef struct jsonObject {
31
+ jsonProperty properties[MAX_OBJECT_PROPERTIES];
32
+ unsigned int propertiesLength;
33
+ unsigned int idIndex;
34
+ unsigned int sidIndex;
35
+ char sidBuffer[SID_BUFFER_LENGTH];
36
+ char idBuffer[ID_BUFFER_LENGTH];
37
+ } jsonObject;
38
+
24
39
  typedef struct stateEntry {
25
40
  unsigned int nextHashOffset;
26
41
  unsigned int nextLruOffset;
@@ -28,28 +43,28 @@ typedef struct stateEntry {
28
43
  unsigned int sidHash;
29
44
  unsigned int bindingIndex;
30
45
  unsigned int lastRefresh;
31
- unsigned int propertiesLength;
32
- jsonProperty properties[MAX_STATE_PROPERTIES];
33
46
  char *state;
34
47
  char *sid;
48
+ jsonObject jo;
35
49
  } stateEntry;
36
50
 
37
- unsigned int djbHash(char *str, unsigned int len);
51
+ unsigned int fnv1Hash32(char *str, unsigned int len);
52
+
38
53
  void rehydrateProperty(jsonProperty *property, char *state);
54
+
39
55
  unsigned int refreshState(void *tree, char *sid);
56
+
40
57
  unsigned int constructObject(char *root,
41
58
  char *parentName,
42
59
  char *object,
43
- char createHashtable,
44
- unsigned int maxProperties,
45
- jsonProperty *properties,
46
- unsigned int *propertiesLength,
47
- unsigned int *midIndex,
48
- unsigned int *sidIndex,
60
+ char layout,
61
+ jsonObject *jo,
49
62
  char **next);
63
+
50
64
  unsigned int resolveBinding(void *tree,
51
65
  char *sid,
52
66
  void **rulesBinding);
67
+
53
68
  unsigned int fetchStateProperty(void *tree,
54
69
  char *sid,
55
70
  unsigned int propertyHash,
@@ -57,6 +72,7 @@ unsigned int fetchStateProperty(void *tree,
57
72
  unsigned char ignoreStaleState,
58
73
  char **state,
59
74
  jsonProperty **property);
75
+
60
76
  unsigned int getStateVersion(void *handle,
61
77
  char *sid,
62
78
  unsigned long *stateVersion);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: durable_rules
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.34.29
4
+ version: 0.34.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesus Ruiz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-13 00:00:00.000000000 Z
11
+ date: 2017-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake