durable_rules 2.00.02 → 2.00.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c2ca593433560df7dd74fab946572d5e31e1da9
4
- data.tar.gz: 8c4a3fce1ed1e958afe88129d02a0cc51a5dc2c5
3
+ metadata.gz: da7281352c66d7ee7dfda3145829aee0ce0bd006
4
+ data.tar.gz: 04f8626eca2fc8a6d8da3d6da53afe932efbe2e5
5
5
  SHA512:
6
- metadata.gz: 95099aa8894fca2ad26c2dbba8dad20e8339479ac06595bf350ab8cb7a12962533a7a3a88bf077e61d21f9bcdd87a11de1aceea5f0de5e974b745105e75d7a39
7
- data.tar.gz: 83d0172ee7ad7b660095fcedbb5044036521b96f5d03839162764c528245d3d77a2db550ae194807234c58e931b660820b8c9b02c99207ef84247baa8a8b316b
6
+ metadata.gz: 1ef6301996e4db96709c006409915a66aedd409379ac08bbb94c3a24d003a8a0dbe42a6c401919b5bdfc3e9c4fe78b2957afc5dcbc57465eda74b90d00265b2d
7
+ data.tar.gz: fcc4e5f9785cd8566b0c74a0b6aef53d4e532e07ccd70df9eed62cce6a0a7867a7d53053ef694bc95c5bf53c2a0d5137d0fbb3d1d9ecf5d5228eb789b9389970
data/src/rules/events.c CHANGED
@@ -2,6 +2,12 @@
2
2
  #include <stdio.h>
3
3
  #include <stdlib.h>
4
4
  #include <string.h>
5
+ #include <errno.h>
6
+ #ifndef _WIN32
7
+ #include <time.h> /* for struct timeval */
8
+ #else
9
+ #include <WinSock2.h>
10
+ #endif
5
11
  #include "rules.h"
6
12
  #include "json.h"
7
13
  #include "regex.h"
@@ -2125,7 +2131,7 @@ unsigned int assertTimers(unsigned int handle) {
2125
2131
  char *pulseMessage = (char *)_alloca(messageSize);
2126
2132
  sprintf_s(pulseMessage,
2127
2133
  messageSize,
2128
- "{ \"sid\":\"%s\", \"id\":\"$pulse\", \"$time\":%ld }",
2134
+ "{ \"sid\":\"%s\", \"id\":\"$pulse\", \"$time\":%lld }",
2129
2135
  state->sid,
2130
2136
  pulseTime);
2131
2137
  #else
@@ -2206,7 +2212,7 @@ unsigned int startTimer(unsigned int handle,
2206
2212
  char *baseMessage = (char *)_alloca(messageSize);
2207
2213
  sprintf_s(baseMessage,
2208
2214
  messageSize,
2209
- "{ \"sid\":\"%s\", \"id\":\"%s\", \"$timerName\":\"%s\", \"$baseTime\":%ld }",
2215
+ "{ \"sid\":\"%s\", \"id\":\"%s\", \"$timerName\":\"%s\", \"$baseTime\":%lld }",
2210
2216
  sid,
2211
2217
  timer,
2212
2218
  timer,
data/src/rules/rules.h CHANGED
@@ -133,10 +133,6 @@ unsigned int assertEvents(unsigned int handle,
133
133
  char *messages,
134
134
  unsigned int *stateOffset);
135
135
 
136
- unsigned int retractEvent(unsigned int handle,
137
- char *message,
138
- unsigned int *stateOffset);
139
-
140
136
  unsigned int assertFact(unsigned int handle,
141
137
  char *message,
142
138
  unsigned int *stateOffset);
data/src/rules/state.c CHANGED
@@ -1,7 +1,12 @@
1
1
  #include <stdio.h>
2
2
  #include <stdlib.h>
3
3
  #include <string.h>
4
- #include <time.h>
4
+ #include <errno.h>
5
+ #ifndef _WIN32
6
+ #include <time.h> /* for struct timeval */
7
+ #else
8
+ #include <WinSock2.h>
9
+ #endif
5
10
  #include "rules.h"
6
11
  #include "json.h"
7
12
  #include "rete.h"
@@ -12,6 +17,33 @@
12
17
  #define MAX_RIGHT_FRAME_NODES 8
13
18
  #define MAX_LOCATION_NODES 16
14
19
 
20
+ #ifdef _WIN32
21
+ int asprintf(char** ret, char* format, ...){
22
+ va_list args;
23
+ *ret = NULL;
24
+ if (!format) return 0;
25
+ va_start(args, format);
26
+ int size = _vscprintf(format, args);
27
+ if (size == 0) {
28
+ *ret = (char*)malloc(1);
29
+ **ret = 0;
30
+ }
31
+ else {
32
+ size++; //for null
33
+ *ret = (char*)malloc(size + 2);
34
+ if (*ret) {
35
+ _vsnprintf(*ret, size, format, args);
36
+ }
37
+ else {
38
+ return -1;
39
+ }
40
+ }
41
+
42
+ va_end(args);
43
+ return size;
44
+ }
45
+ #endif
46
+
15
47
  // The first node is never used as it corresponds to UNDEFINED_HASH_OFFSET
16
48
  #define INIT(type, pool, length) do { \
17
49
  pool.content = malloc(length * sizeof(type)); \
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: 2.00.02
4
+ version: 2.00.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesus Ruiz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-01 00:00:00.000000000 Z
11
+ date: 2019-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake